Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
187 changes: 183 additions & 4 deletions .doc_gen/metadata/firehose_metadata.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,110 @@
# zexi 0.4.0
firehose_Hello:
title: Hello &FH;
title_abbrev: Hello &FH;
synopsis: get started using &FH;.
category: Hello
languages:
Python:
versions:
- sdk_version: 3
github: python/example_code/firehose
excerpts:
- description:
snippet_tags:
- python.example_code.firehose.Hello
services:
firehose: {ListDeliveryStreams}
firehose_CreateDeliveryStream:
title: Create a &FH; delivery stream
title_abbrev: Create a delivery stream
synopsis: create an &FH; delivery stream.
category: Actions
languages:
Python:
versions:
- sdk_version: 3
github: python/example_code/firehose
excerpts:
- description:
snippet_tags:
- python.example_code.firehose.FirehoseWrapper.decl
- python.example_code.firehose.CreateDeliveryStream
services:
firehose: {CreateDeliveryStream}
firehose_DescribeDeliveryStream:
title: Describe a &FH; delivery stream
title_abbrev: Describe a delivery stream
synopsis: describe an &FH; delivery stream.
category: Actions
languages:
Python:
versions:
- sdk_version: 3
github: python/example_code/firehose
excerpts:
- description:
snippet_tags:
- python.example_code.firehose.FirehoseWrapper.decl
- python.example_code.firehose.DescribeDeliveryStream
services:
firehose: {DescribeDeliveryStream}
firehose_TagDeliveryStream:
title: Tag a &FH; delivery stream
title_abbrev: Tag a delivery stream
synopsis: tag an &FH; delivery stream.
category: Actions
languages:
Python:
versions:
- sdk_version: 3
github: python/example_code/firehose
excerpts:
- description:
snippet_tags:
- python.example_code.firehose.FirehoseWrapper.decl
- python.example_code.firehose.TagDeliveryStream
services:
firehose: {TagDeliveryStream}
firehose_ListTagsForDeliveryStream:
title: List tags for a &FH; delivery stream
title_abbrev: List tags for a delivery stream
synopsis: list tags for an &FH; delivery stream.
category: Actions
languages:
Python:
versions:
- sdk_version: 3
github: python/example_code/firehose
excerpts:
- description:
snippet_tags:
- python.example_code.firehose.FirehoseWrapper.decl
- python.example_code.firehose.ListTagsForDeliveryStream
services:
firehose: {ListTagsForDeliveryStream}
firehose_StartDeliveryStreamEncryption:
title: Start encryption on a &FH; delivery stream
title_abbrev: Start delivery stream encryption
synopsis: start server-side encryption on an &FH; delivery stream.
category: Actions
languages:
Python:
versions:
- sdk_version: 3
github: python/example_code/firehose
excerpts:
Comment thread
brmur marked this conversation as resolved.
- description:
snippet_tags:
- python.example_code.firehose.FirehoseWrapper.decl
- python.example_code.firehose.StartDeliveryStreamEncryption
services:
firehose: {StartDeliveryStreamEncryption}
firehose_PutRecord:
title: Put a record to a &FH; delivery stream
title_abbrev: Put a record
synopsis: put a record to an &FH; delivery stream.
category: Actions
languages:
Java:
versions:
Expand All @@ -16,8 +121,8 @@ firehose_PutRecord:
excerpts:
- description:
snippet_tags:
- python.example_code.firehose.init
- python.example_code.firehose.put_record
- python.example_code.firehose.FirehoseWrapper.decl
- python.example_code.firehose.PutRecord
SAP ABAP:
versions:
- sdk_version: 1
Expand All @@ -29,6 +134,10 @@ firehose_PutRecord:
services:
firehose: {PutRecord}
firehose_PutRecordBatch:
title: Put a batch of records to a &FH; delivery stream
title_abbrev: Put a record batch
synopsis: put a batch of records to an &FH; delivery stream.
category: Actions
languages:
Java:
versions:
Expand All @@ -54,8 +163,8 @@ firehose_PutRecordBatch:
excerpts:
- description:
snippet_tags:
- python.example_code.firehose.init
- python.example_code.firehose.put_record_batch
- python.example_code.firehose.FirehoseWrapper.decl
- python.example_code.firehose.PutRecordBatch
SAP ABAP:
versions:
- sdk_version: 1
Expand All @@ -66,6 +175,57 @@ firehose_PutRecordBatch:
- frh.abapv1.put_record_batch
services:
firehose: {PutRecordBatch}
firehose_UpdateDestination:
title: Update destination of a &FH; delivery stream
title_abbrev: Update destination
synopsis: update the destination of an &FH; delivery stream.
category: Actions
languages:
Python:
versions:
- sdk_version: 3
github: python/example_code/firehose
excerpts:
- description:
snippet_tags:
- python.example_code.firehose.FirehoseWrapper.decl
- python.example_code.firehose.UpdateDestination
services:
firehose: {UpdateDestination}
firehose_ListDeliveryStreams:
title: List &FH; delivery streams
title_abbrev: List delivery streams
synopsis: list &FH; delivery streams.
category: Actions
languages:
Python:
versions:
- sdk_version: 3
github: python/example_code/firehose
excerpts:
- description:
snippet_tags:
- python.example_code.firehose.FirehoseWrapper.decl
- python.example_code.firehose.ListDeliveryStreams
services:
firehose: {ListDeliveryStreams}
firehose_DeleteDeliveryStream:
title: Delete a &FH; delivery stream
title_abbrev: Delete a delivery stream
synopsis: delete an &FH; delivery stream.
category: Actions
languages:
Python:
versions:
- sdk_version: 3
github: python/example_code/firehose
excerpts:
- description:
snippet_tags:
- python.example_code.firehose.FirehoseWrapper.decl
- python.example_code.firehose.DeleteDeliveryStream
services:
firehose: {DeleteDeliveryStream}
firehose_Scenario_PutRecords:
title: Use &FHlong; to process individual and batch records
title_abbrev: Put records to &FH;
Expand Down Expand Up @@ -93,3 +253,22 @@ firehose_Scenario_PutRecords:
- python/example_code/firehose/scenarios/firehose-put-actions/config.py
services:
firehose: {PutRecord, PutRecordBatch}
firehose_Scenario:
title: Learn &FH; basics
title_abbrev: Learn the basics
synopsis: learn the basics of &FH; by creating a delivery stream and managing it.
category: Scenarios
languages:
Python:
versions:
- sdk_version: 3
github: python/example_code/firehose
excerpts:
- description: Create a Firehose wrapper class to manage operations.
snippet_tags:
- python.example_code.firehose.FirehoseWrapper.class
- description: Run an interactive scenario demonstrating Firehose basics.
snippet_tags:
- python.example_code.firehose.FirehoseScenario
services:
firehose: {CreateDeliveryStream, TagDeliveryStream, DescribeDeliveryStream, ListTagsForDeliveryStream, StartDeliveryStreamEncryption, PutRecord, PutRecordBatch, UpdateDestination, ListDeliveryStreams, DeleteDeliveryStream}
14 changes: 6 additions & 8 deletions javav2/example_code/firehose/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,19 @@ For prerequisites, see the [README](../../README.md#Prerequisites) in the `javav

<!--custom.prerequisites.start-->
<!--custom.prerequisites.end-->

### Single actions

Code excerpts that show you how to call individual service functions.

- [PutRecord](src/main/java/com/example/firehose/scenario/FirehoseScenario.java#L98)
- [PutRecordBatch](src/main/java/com/example/firehose/scenario/FirehoseScenario.java#L131)

### Scenarios

Code examples that show you how to accomplish a specific task by calling multiple
functions within the same service.

- [Put records to Data Firehose](src/main/java/com/example/firehose/scenario/FirehoseScenario.java)

### Actions
_Actions_ are code excerpts from larger programs and must be run in context. While actions show you how to call individual service functions, you can see actions in context in their related scenarios.

- [PutRecord](src/main/java/com/example/firehose/scenario/FirehoseScenario.java#L98)
- [PutRecordBatch](src/main/java/com/example/firehose/scenario/FirehoseScenario.java#L131)


<!--custom.examples.start-->
<!--custom.examples.end-->
Expand Down
48 changes: 42 additions & 6 deletions python/example_code/firehose/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,32 @@ python -m pip install -r requirements.txt
<!--custom.prerequisites.start-->
<!--custom.prerequisites.end-->

### Single actions
### Get started

Code excerpts that show you how to call individual service functions.

- [PutRecord](scenarios/firehose-put-actions/firehose.py#L33)
- [PutRecordBatch](scenarios/firehose-put-actions/firehose.py#L33)
- [Hello Data Firehose](firehose_hello.py#L8) (`ListDeliveryStreams`)

### Scenarios

Code examples that show you how to accomplish a specific task by calling multiple
functions within the same service.

- [Learn the basics](firehose_wrapper.py)
- [Put records to Data Firehose](scenarios/firehose-put-actions/firehose.py)

### Actions
_Actions_ are code excerpts from larger programs and must be run in context. While actions show you how to call individual service functions, you can see actions in context in their related scenarios.

- [CreateDeliveryStream](firehose_wrapper.py#L41)
- [DeleteDeliveryStream](firehose_wrapper.py#L386)
- [DescribeDeliveryStream](firehose_wrapper.py#L89)
- [ListDeliveryStreams](firehose_wrapper.py#L345)
- [ListTagsForDeliveryStream](firehose_wrapper.py#L145)
- [PutRecord](firehose_wrapper.py#L202)
- [PutRecordBatch](firehose_wrapper.py#L238)
- [StartDeliveryStreamEncryption](firehose_wrapper.py#L177)
- [TagDeliveryStream](firehose_wrapper.py#L118)
- [UpdateDestination](firehose_wrapper.py#L293)


<!--custom.examples.start-->
<!--custom.examples.end-->
Expand All @@ -60,15 +72,39 @@ functions within the same service.
<!--custom.instructions.start-->
<!--custom.instructions.end-->

#### Hello Data Firehose

This example shows you how to get started using Data Firehose.

```
python firehose_hello.py
```


#### Learn the basics

Comment thread
brmur marked this conversation as resolved.
This example shows you how to learn the basics of Data Firehose by creating a delivery stream and managing it.


<!--custom.scenario_prereqs.firehose_Scenario.start-->
<!--custom.scenario_prereqs.firehose_Scenario.end-->
Comment thread
brmur marked this conversation as resolved.

Start the example by running the following at a command prompt:

```
python firehose_wrapper.py
```

Comment thread
brmur marked this conversation as resolved.

<!--custom.scenarios.firehose_Scenario.start-->
<!--custom.scenarios.firehose_Scenario.end-->

#### Put records to Data Firehose

This example shows you how to use Data Firehose to process individual and batch records.


<!--custom.scenario_prereqs.firehose_Scenario_PutRecords.start-->
See required [resource and data setup instructions](../../../scenarios/features/firehose/README.md).
<!--custom.scenario_prereqs.firehose_Scenario_PutRecords.end-->

Start the example by running the following at a command prompt:
Expand Down
43 changes: 43 additions & 0 deletions python/example_code/firehose/firehose_hello.py
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]
Loading
Loading