Skip to content

Commit

Permalink
Tools, Rust: Allow finding snippets in rust src/bin
Browse files Browse the repository at this point in the history
Closes #5506
Closes #5545
  • Loading branch information
DavidSouther committed Oct 19, 2023
1 parent 10f87b9 commit 1ffffbe
Show file tree
Hide file tree
Showing 30 changed files with 196 additions and 170 deletions.
6 changes: 5 additions & 1 deletion .tools/readmes/snippets.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,11 @@ def tag_from_line(token, line) -> str:
def scan_for_snippets(root):
snippets = {}
for root, dirs, files in os.walk(root):
dirs[:] = [d for d in dirs if d not in IGNORE_FOLDERS]
dirs[:] = [
d
for d in dirs
if d not in IGNORE_FOLDERS or ("rust_dev_preview" in root and "src" in root)
]
for f in files:
ext = os.path.splitext(f)[1].lower()
if ext in EXT_IGNORES:
Expand Down
16 changes: 8 additions & 8 deletions rust_dev_preview/examples/auto-scaling/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!--Generated by WRITEME on 2023-09-20 20:49:21.334873 (UTC)-->
<!--Generated by WRITEME on 2023-10-19 19:08:38.622952 (UTC)-->
# Auto Scaling code examples for the SDK for Rust

## Overview
Expand Down Expand Up @@ -41,21 +41,21 @@ Code excerpts that show you how to call individual service functions.

* [Create a group](src/bin/create-autoscaling-group.rs#L32) (`CreateAutoScalingGroup`)
* [Delete a group](src/bin/delete-autoscaling-group.rs#L32) (`DeleteAutoScalingGroup`)
* [Disable metrics collection for a group](src/scenario.rs#L608) (`DisableMetricsCollection`)
* [Enable metrics collection for a group](src/scenario.rs#L288) (`EnableMetricsCollection`)
* [Disable metrics collection for a group](src/scenario.rs#L617) (`DisableMetricsCollection`)
* [Enable metrics collection for a group](src/scenario.rs#L297) (`EnableMetricsCollection`)
* [Get information about groups](src/bin/list-autoscaling-groups.rs#L24) (`DescribeAutoScalingGroups`)
* [Get information about instances](src/scenario.rs#L529) (`DescribeAutoScalingInstances`)
* [Get information about scaling activities](src/scenario.rs#L393) (`DescribeScalingActivities`)
* [Set the desired capacity of a group](src/scenario.rs#L586) (`SetDesiredCapacity`)
* [Terminate an instance in a group](src/scenario.rs#L645) (`TerminateInstanceInAutoScalingGroup`)
* [Get information about instances](src/scenario.rs#L535) (`DescribeAutoScalingInstances`)
* [Get information about scaling activities](src/scenario.rs#L402) (`DescribeScalingActivities`)
* [Set the desired capacity of a group](src/scenario.rs#L595) (`SetDesiredCapacity`)
* [Terminate an instance in a group](src/scenario.rs#L654) (`TerminateInstanceInAutoScalingGroup`)
* [Update a group](src/bin/update-autoscaling-group.rs#L32) (`UpdateAutoScalingGroup`)

### Scenarios

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

* [Manage groups and instances](README.md)
* [Manage groups and instances](rust_dev_preview/examples/auto-scaling/Cargo.toml)

## Run the examples

Expand Down
8 changes: 4 additions & 4 deletions rust_dev_preview/examples/batch/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!--Generated by WRITEME on 2023-06-06 21:26:10.108417 (UTC)-->
<!--Generated by WRITEME on 2023-10-19 19:08:38.636659 (UTC)-->
# AWS Batch code examples for the SDK for Rust

## Overview
Expand All @@ -12,7 +12,7 @@ Shows how to use the AWS SDK for Rust to work with AWS Batch.

## ⚠ Important

* Running this code might result in charges to your AWS account.
* Running this code might result in charges to your AWS account. For more details, see [AWS Pricing](https://aws.amazon.com/pricing/?aws-products-pricing.sort-by=item.additionalFields.productNameLowercase&aws-products-pricing.sort-order=asc&awsf.Free%20Tier%20Type=*all&awsf.tech-category=*all) and [Free Tier](https://aws.amazon.com/free/?all-free-tier.sort-by=item.additionalFields.SortRank&all-free-tier.sort-order=asc&awsf.Free%20Tier%20Types=*all&awsf.Free%20Tier%20Categories=*all).
* Running the tests might result in charges to your AWS account.
* We recommend that you grant your code least privilege. At most, grant only the minimum permissions required to perform the task. For more information, see [Grant least privilege](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#grant-least-privilege).
* This code is not tested in every AWS Region. For more information, see [AWS Regional Services](https://aws.amazon.com/about-aws/global-infrastructure/regional-product-services).
Expand All @@ -24,7 +24,7 @@ Shows how to use the AWS SDK for Rust to work with AWS Batch.

### Prerequisites

For prerequisites, see the [README](../README.md#Prerequisites) in the `rust_dev_preview` folder.
For prerequisites, see the [README](../../README.md#Prerequisites) in the `rust_dev_preview` folder.


<!--custom.prerequisites.start-->
Expand All @@ -51,7 +51,7 @@ Code excerpts that show you how to call individual service functions.
⚠ Running tests might result in charges to your AWS account.


To find instructions for running these tests, see the [README](../README.md#Tests)
To find instructions for running these tests, see the [README](../../README.md#Tests)
in the `rust_dev_preview` folder.


Expand Down
8 changes: 4 additions & 4 deletions rust_dev_preview/examples/cloudwatch/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!--Generated by WRITEME on 2023-06-06 21:26:10.416519 (UTC)-->
<!--Generated by WRITEME on 2023-10-19 19:08:38.713653 (UTC)-->
# CloudWatch code examples for the SDK for Rust

## Overview
Expand All @@ -12,7 +12,7 @@ Shows how to use the AWS SDK for Rust to work with Amazon CloudWatch.

## ⚠ Important

* Running this code might result in charges to your AWS account.
* Running this code might result in charges to your AWS account. For more details, see [AWS Pricing](https://aws.amazon.com/pricing/?aws-products-pricing.sort-by=item.additionalFields.productNameLowercase&aws-products-pricing.sort-order=asc&awsf.Free%20Tier%20Type=*all&awsf.tech-category=*all) and [Free Tier](https://aws.amazon.com/free/?all-free-tier.sort-by=item.additionalFields.SortRank&all-free-tier.sort-order=asc&awsf.Free%20Tier%20Types=*all&awsf.Free%20Tier%20Categories=*all).
* Running the tests might result in charges to your AWS account.
* We recommend that you grant your code least privilege. At most, grant only the minimum permissions required to perform the task. For more information, see [Grant least privilege](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#grant-least-privilege).
* This code is not tested in every AWS Region. For more information, see [AWS Regional Services](https://aws.amazon.com/about-aws/global-infrastructure/regional-product-services).
Expand All @@ -24,7 +24,7 @@ Shows how to use the AWS SDK for Rust to work with Amazon CloudWatch.

### Prerequisites

For prerequisites, see the [README](../README.md#Prerequisites) in the `rust_dev_preview` folder.
For prerequisites, see the [README](../../README.md#Prerequisites) in the `rust_dev_preview` folder.


<!--custom.prerequisites.start-->
Expand All @@ -45,7 +45,7 @@ For prerequisites, see the [README](../README.md#Prerequisites) in the `rust_dev
⚠ Running tests might result in charges to your AWS account.


To find instructions for running these tests, see the [README](../README.md#Tests)
To find instructions for running these tests, see the [README](../../README.md#Tests)
in the `rust_dev_preview` folder.


Expand Down
14 changes: 7 additions & 7 deletions rust_dev_preview/examples/dynamodb/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!--Generated by WRITEME on 2023-06-06 21:26:11.128012 (UTC)-->
<!--Generated by WRITEME on 2023-10-19 19:08:38.990842 (UTC)-->
# DynamoDB code examples for the SDK for Rust

## Overview
Expand All @@ -12,7 +12,7 @@ Shows how to use the AWS SDK for Rust to work with Amazon DynamoDB.

## ⚠ Important

* Running this code might result in charges to your AWS account.
* Running this code might result in charges to your AWS account. For more details, see [AWS Pricing](https://aws.amazon.com/pricing/?aws-products-pricing.sort-by=item.additionalFields.productNameLowercase&aws-products-pricing.sort-order=asc&awsf.Free%20Tier%20Type=*all&awsf.tech-category=*all) and [Free Tier](https://aws.amazon.com/free/?all-free-tier.sort-by=item.additionalFields.SortRank&all-free-tier.sort-order=asc&awsf.Free%20Tier%20Types=*all&awsf.Free%20Tier%20Categories=*all).
* Running the tests might result in charges to your AWS account.
* We recommend that you grant your code least privilege. At most, grant only the minimum permissions required to perform the task. For more information, see [Grant least privilege](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#grant-least-privilege).
* This code is not tested in every AWS Region. For more information, see [AWS Regional Services](https://aws.amazon.com/about-aws/global-infrastructure/regional-product-services).
Expand All @@ -24,7 +24,7 @@ Shows how to use the AWS SDK for Rust to work with Amazon DynamoDB.

### Prerequisites

For prerequisites, see the [README](../README.md#Prerequisites) in the `rust_dev_preview` folder.
For prerequisites, see the [README](../../README.md#Prerequisites) in the `rust_dev_preview` folder.


<!--custom.prerequisites.start-->
Expand All @@ -37,17 +37,17 @@ Code excerpts that show you how to call individual service functions.
* [Create a table](src/scenario/create.rs#L14) (`CreateTable`)
* [Delete a table](src/scenario/delete.rs#L38) (`DeleteTable`)
* [Delete an item from a table](src/scenario/delete.rs#L14) (`DeleteItem`)
* [List tables](src/bin/list-tables-main.rs#L8) (`ListTables`)
* [List tables](src/scenario/list.rs#L9) (`ListTables`)
* [Put an item in a table](src/scenario/add.rs#L27) (`PutItem`)
* [Query a table](src/scenario/movies/server.rs#L28) (`Query`)
* [Scan a table](src/scenario/list.rs#L181) (`Scan`)
* [Scan a table](src/scenario/list.rs#L180) (`Scan`)

### Scenarios

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

* [Query a table using PartiQL](src/bin/partiql.rs)
* [Query a table using PartiQL](src/bin/partiql.rs)

## Run the examples

Expand Down Expand Up @@ -80,7 +80,7 @@ This example shows you how to do the following:
⚠ Running tests might result in charges to your AWS account.


To find instructions for running these tests, see the [README](../README.md#Tests)
To find instructions for running these tests, see the [README](../../README.md#Tests)
in the `rust_dev_preview` folder.


Expand Down
8 changes: 4 additions & 4 deletions rust_dev_preview/examples/ebs/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!--Generated by WRITEME on 2023-06-06 21:26:11.288887 (UTC)-->
<!--Generated by WRITEME on 2023-10-19 19:08:39.004717 (UTC)-->
# Amazon EBS code examples for the SDK for Rust

## Overview
Expand All @@ -12,7 +12,7 @@ Shows how to use the AWS SDK for Rust to work with Amazon Elastic Block Store (A

## ⚠ Important

* Running this code might result in charges to your AWS account.
* Running this code might result in charges to your AWS account. For more details, see [AWS Pricing](https://aws.amazon.com/pricing/?aws-products-pricing.sort-by=item.additionalFields.productNameLowercase&aws-products-pricing.sort-order=asc&awsf.Free%20Tier%20Type=*all&awsf.tech-category=*all) and [Free Tier](https://aws.amazon.com/free/?all-free-tier.sort-by=item.additionalFields.SortRank&all-free-tier.sort-order=asc&awsf.Free%20Tier%20Types=*all&awsf.Free%20Tier%20Categories=*all).
* Running the tests might result in charges to your AWS account.
* We recommend that you grant your code least privilege. At most, grant only the minimum permissions required to perform the task. For more information, see [Grant least privilege](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#grant-least-privilege).
* This code is not tested in every AWS Region. For more information, see [AWS Regional Services](https://aws.amazon.com/about-aws/global-infrastructure/regional-product-services).
Expand All @@ -24,7 +24,7 @@ Shows how to use the AWS SDK for Rust to work with Amazon Elastic Block Store (A

### Prerequisites

For prerequisites, see the [README](../README.md#Prerequisites) in the `rust_dev_preview` folder.
For prerequisites, see the [README](../../README.md#Prerequisites) in the `rust_dev_preview` folder.


<!--custom.prerequisites.start-->
Expand Down Expand Up @@ -53,7 +53,7 @@ Code excerpts that show you how to call individual service functions.
⚠ Running tests might result in charges to your AWS account.


To find instructions for running these tests, see the [README](../README.md#Tests)
To find instructions for running these tests, see the [README](../../README.md#Tests)
in the `rust_dev_preview` folder.


Expand Down
8 changes: 4 additions & 4 deletions rust_dev_preview/examples/ec2/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!--Generated by WRITEME on 2023-06-06 21:26:11.501592 (UTC)-->
<!--Generated by WRITEME on 2023-10-19 19:08:39.082463 (UTC)-->
# Amazon EC2 code examples for the SDK for Rust

## Overview
Expand All @@ -12,7 +12,7 @@ Shows how to use the AWS SDK for Rust to work with Amazon Elastic Compute Cloud

## ⚠ Important

* Running this code might result in charges to your AWS account.
* Running this code might result in charges to your AWS account. For more details, see [AWS Pricing](https://aws.amazon.com/pricing/?aws-products-pricing.sort-by=item.additionalFields.productNameLowercase&aws-products-pricing.sort-order=asc&awsf.Free%20Tier%20Type=*all&awsf.tech-category=*all) and [Free Tier](https://aws.amazon.com/free/?all-free-tier.sort-by=item.additionalFields.SortRank&all-free-tier.sort-order=asc&awsf.Free%20Tier%20Types=*all&awsf.Free%20Tier%20Categories=*all).
* Running the tests might result in charges to your AWS account.
* We recommend that you grant your code least privilege. At most, grant only the minimum permissions required to perform the task. For more information, see [Grant least privilege](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#grant-least-privilege).
* This code is not tested in every AWS Region. For more information, see [AWS Regional Services](https://aws.amazon.com/about-aws/global-infrastructure/regional-product-services).
Expand All @@ -24,7 +24,7 @@ Shows how to use the AWS SDK for Rust to work with Amazon Elastic Compute Cloud

### Prerequisites

For prerequisites, see the [README](../README.md#Prerequisites) in the `rust_dev_preview` folder.
For prerequisites, see the [README](../../README.md#Prerequisites) in the `rust_dev_preview` folder.


<!--custom.prerequisites.start-->
Expand Down Expand Up @@ -59,7 +59,7 @@ Code excerpts that show you how to call individual service functions.
⚠ Running tests might result in charges to your AWS account.


To find instructions for running these tests, see the [README](../README.md#Tests)
To find instructions for running these tests, see the [README](../../README.md#Tests)
in the `rust_dev_preview` folder.


Expand Down
8 changes: 4 additions & 4 deletions rust_dev_preview/examples/ecr/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!--Generated by WRITEME on 2023-06-06 21:26:11.656471 (UTC)-->
<!--Generated by WRITEME on 2023-10-19 19:08:39.095677 (UTC)-->
# Amazon ECR code examples for the SDK for Rust

## Overview
Expand All @@ -12,7 +12,7 @@ Shows how to use the AWS SDK for Rust to work with Amazon Elastic Container Regi

## ⚠ Important

* Running this code might result in charges to your AWS account.
* Running this code might result in charges to your AWS account. For more details, see [AWS Pricing](https://aws.amazon.com/pricing/?aws-products-pricing.sort-by=item.additionalFields.productNameLowercase&aws-products-pricing.sort-order=asc&awsf.Free%20Tier%20Type=*all&awsf.tech-category=*all) and [Free Tier](https://aws.amazon.com/free/?all-free-tier.sort-by=item.additionalFields.SortRank&all-free-tier.sort-order=asc&awsf.Free%20Tier%20Types=*all&awsf.Free%20Tier%20Categories=*all).
* Running the tests might result in charges to your AWS account.
* We recommend that you grant your code least privilege. At most, grant only the minimum permissions required to perform the task. For more information, see [Grant least privilege](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#grant-least-privilege).
* This code is not tested in every AWS Region. For more information, see [AWS Regional Services](https://aws.amazon.com/about-aws/global-infrastructure/regional-product-services).
Expand All @@ -24,7 +24,7 @@ Shows how to use the AWS SDK for Rust to work with Amazon Elastic Container Regi

### Prerequisites

For prerequisites, see the [README](../README.md#Prerequisites) in the `rust_dev_preview` folder.
For prerequisites, see the [README](../../README.md#Prerequisites) in the `rust_dev_preview` folder.


<!--custom.prerequisites.start-->
Expand Down Expand Up @@ -52,7 +52,7 @@ Code excerpts that show you how to call individual service functions.
⚠ Running tests might result in charges to your AWS account.


To find instructions for running these tests, see the [README](../README.md#Tests)
To find instructions for running these tests, see the [README](../../README.md#Tests)
in the `rust_dev_preview` folder.


Expand Down
8 changes: 4 additions & 4 deletions rust_dev_preview/examples/ecs/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!--Generated by WRITEME on 2023-06-06 21:26:11.809611 (UTC)-->
<!--Generated by WRITEME on 2023-10-19 19:08:39.115877 (UTC)-->
# Amazon ECS code examples for the SDK for Rust

## Overview
Expand All @@ -12,7 +12,7 @@ Shows how to use the AWS SDK for Rust to work with Amazon Elastic Container Serv

## ⚠ Important

* Running this code might result in charges to your AWS account.
* Running this code might result in charges to your AWS account. For more details, see [AWS Pricing](https://aws.amazon.com/pricing/?aws-products-pricing.sort-by=item.additionalFields.productNameLowercase&aws-products-pricing.sort-order=asc&awsf.Free%20Tier%20Type=*all&awsf.tech-category=*all) and [Free Tier](https://aws.amazon.com/free/?all-free-tier.sort-by=item.additionalFields.SortRank&all-free-tier.sort-order=asc&awsf.Free%20Tier%20Types=*all&awsf.Free%20Tier%20Categories=*all).
* Running the tests might result in charges to your AWS account.
* We recommend that you grant your code least privilege. At most, grant only the minimum permissions required to perform the task. For more information, see [Grant least privilege](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#grant-least-privilege).
* This code is not tested in every AWS Region. For more information, see [AWS Regional Services](https://aws.amazon.com/about-aws/global-infrastructure/regional-product-services).
Expand All @@ -24,7 +24,7 @@ Shows how to use the AWS SDK for Rust to work with Amazon Elastic Container Serv

### Prerequisites

For prerequisites, see the [README](../README.md#Prerequisites) in the `rust_dev_preview` folder.
For prerequisites, see the [README](../../README.md#Prerequisites) in the `rust_dev_preview` folder.


<!--custom.prerequisites.start-->
Expand Down Expand Up @@ -53,7 +53,7 @@ Code excerpts that show you how to call individual service functions.
⚠ Running tests might result in charges to your AWS account.


To find instructions for running these tests, see the [README](../README.md#Tests)
To find instructions for running these tests, see the [README](../../README.md#Tests)
in the `rust_dev_preview` folder.


Expand Down
Loading

0 comments on commit 1ffffbe

Please sign in to comment.