Skip to content
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

bash; adding service, healthimaging #5261

Merged
merged 2 commits into from
Aug 18, 2023
Merged
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
73 changes: 73 additions & 0 deletions .doc_gen/metadata/medical-imaging_metadata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# zexi 0.4.0
medical-imaging_CreateDatastore:
title: Create a data store using the &AHI; SDK
title_abbrev: Create a data store
synopsis: create a data store.
category:
languages:
Bash:
versions:
- sdk_version: 2
github: aws-cli/bash-linux/medical-imaging
sdkguide:
excerpts:
- description:
snippet_tags:
- aws-cli.bash-linux.medical-imaging.errecho
- aws-cli.bash-linux.medical-imaging.CreateDatastore
services:
medical-imaging: {CreateDatastore}
medical-imaging_DeleteDatastore:
title: Delete a data store using the &AHI; SDK
title_abbrev: Delete a data store
synopsis: delete a data store.
category:
languages:
Bash:
versions:
- sdk_version: 2
github: aws-cli/bash-linux/medical-imaging
sdkguide:
excerpts:
- description:
snippet_tags:
- aws-cli.bash-linux.medical-imaging.errecho
- aws-cli.bash-linux.medical-imaging.DeleteDatastore
services:
medical-imaging: {DeleteDatastore}
medical-imaging_ListDatastores:
title: List a data stores using the &AHI; SDK
title_abbrev: List data stores
synopsis: list a data stores.
category:
languages:
Bash:
versions:
- sdk_version: 2
github: aws-cli/bash-linux/medical-imaging
sdkguide:
excerpts:
- description:
snippet_tags:
- aws-cli.bash-linux.medical-imaging.errecho
- aws-cli.bash-linux.medical-imaging.ListDatastores
services:
medical-imaging: {ListDatastores}
medical-imaging_GetDatastore:
title: Get data store properties using the &AHI; SDK
title_abbrev: Get data store properties
synopsis: get data store properties.
category:
languages:
Bash:
versions:
- sdk_version: 2
github: aws-cli/bash-linux/medical-imaging
sdkguide:
excerpts:
- description:
snippet_tags:
- aws-cli.bash-linux.medical-imaging.errecho
- aws-cli.bash-linux.medical-imaging.GetDatastore
services:
medical-imaging: {GetDatastore}
15 changes: 15 additions & 0 deletions .doc_gen/metadata/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,21 @@ mediapackage:
tags:
product_categories: {'Media Services'}
version: mediapackage-2017-10-12
medical-imaging:
long: '&AHIlong;'
short: '&AHI;'
sort: HealthImaging
expanded:
long: AWS HealthImaging
short: HealthImaging
blurb: is a HIPAA-eligible service that helps health care providers and their medical imaging ISV partners store, transform, and apply machine learning to medical images.
guide:
subtitle: User Guide
url: healthimaging/latest/devguide/what-is.html
api_ref: healthimaging/latest/APIReference/Welcome.html
tags:
product_categories: {'Machine Learning'}
version: medical-imaging-2023-07-19
migration-hub:
long: '&MHBlong;'
short: '&MHB;'
Expand Down
21 changes: 13 additions & 8 deletions aws-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,24 @@ To run these examples, you'll need:
## Running the examples

Examples are typically written as functions in shell script files that can be
sourced from other files. Most are accompanied by a unit or integration test
script that you can run to validate that each example works. The test scripts
include setup and teardown to create and destroy any prerequisite resources.
We take care that all AWS resources that the example creates are also destroyed
to avoid incurring any unwanted costs. When you're done with an example, we do
recommend that you check the resources in your account to ensure that the
sourced from other files. When you're done with an example, we do
recommend that you check the resources in your account to ensure that the
teardown worked as expected and didn't accidentally leave any resources behind.

To run the examples, you need to create a shared credentials file. For more
information about how to set up a shared credentials file, see [Configuration
To run the examples, you need to create a shared credentials file. For more
information about how to set up a shared credentials file, see [Configuration
and Credential File Settings](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html)
in the _AWS CLI User Guide_.

### Tests

Most examples are accompanied by a unit or integration test
script that you can run to validate that each example works. The test scripts
include setup and teardown to create and destroy any prerequisite resources.
We take care that all AWS resources that the example creates are also destroyed
to avoid incurring any unwanted costs.


## AWS CLI downloads

For information about how to download and install the AWS CLI, see [Installing
Expand Down
14 changes: 9 additions & 5 deletions aws-cli/bash-linux/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,7 @@ To run these examples, you need:
## Running the examples

Examples are typically written as functions in shell script files that can be
sourced from other files. Most are accompanied by a unit or integration test
script that you can run to validate that each example works. The test scripts
include setup and teardown to create and destroy any prerequisite resources.
We take care that all AWS resources that the example creates are also destroyed
to avoid incurring any unwanted costs. When you're done with an example, we do
sourced from other files. When you're done with an example, we do
recommend that you check the resources in your account to ensure that the
teardown worked as expected and didn't accidentally leave any resources behind.

Expand All @@ -40,6 +36,14 @@ information about how to set up a shared credentials file, see [Configuration
and Credential File Settings](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html)
in the _AWS CLI User Guide_.

### Tests

Most examples are accompanied by a unit or integration test
script that you can run to validate that each example works. The test scripts
include setup and teardown to create and destroy any prerequisite resources.
We take care that all AWS resources that the example creates are also destroyed
to avoid incurring any unwanted costs.

## AWS CLI downloads

For information about how to download and install the AWS CLI, see [Installing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ function sts_assume_role() {
--role-session-name "$role_session_name" \
--role-arn "$role_arn" \
--output text \
--query "Credentials.{AccessKeyId: AccessKeyId ,SecretAccessKey: SecretAccessKey ,SessionToken: SessionToken}")
--query "Credentials.[AccessKeyId, SecretAccessKey, SessionToken]")

local error_code=${?}

Expand Down Expand Up @@ -358,8 +358,7 @@ function iam_create_user_assume_role() {
return 1
fi

# shellcheck disable=SC2206
local access_key_values=($access_key_response) # Convert to array.
IFS=$'\t ' read -r -a access_key_values <<<"$access_key_response"
local key_name=${access_key_values[0]}
local key_secret=${access_key_values[1]}

Expand Down Expand Up @@ -492,8 +491,7 @@ function iam_create_user_assume_role() {
return 1
fi

# shellcheck disable=SC2206
credentials=(${credentials}) # Convert to array.
IFS=$'\t ' read -r -a credentials <<<"$credentials"

export AWS_ACCESS_KEY_ID=${credentials[0]}
export AWS_SECRET_ACCESS_KEY=${credentials[1]}
Expand Down
23 changes: 12 additions & 11 deletions aws-cli/bash-linux/iam/tests/test_iam_examples.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,18 @@
###############################################################################

# Set default values.
# bashsupport disable=BP5001
INTERACTIVE=false
VERBOSE=false

###############################################################################
# function main
#
# This function runs the IAM examples' tests.
###############################################################################
function main() {
# bashsupport disable=BP2001
export INTERACTIVE=false
# bashsupport disable=BP2001
export VERBOSE=false

source ./test_general.sh
{
local current_directory
Expand Down Expand Up @@ -125,8 +127,8 @@ function main() {
0
test_count=$((test_count + 1))

# shellcheck disable=SC2206
local user_values=($test_command_response)
local user_values
IFS=$'\t ' read -r -a user_values <<<"$test_command_response"
if [[ "${#user_values[@]}" -lt "2" ]]; then
test_failed "Listing users returned less than 2 users."
fi
Expand All @@ -152,9 +154,8 @@ function main() {
"iam_create_user_access_key -u $user_name " \
0
test_count=$((test_count + 1))

# shellcheck disable=SC2206
local access_key_values=($test_command_response)
local access_key_values
IFS=$'\t ' read -r -a access_key_values <<<"$test_command_response"
local key_name2=${access_key_values[0]}

run_test "$test_count. Listing access keys without user" \
Expand All @@ -166,8 +167,8 @@ function main() {
"iam_list_access_keys -u $user_name " \
0
test_count=$((test_count + 1))
# shellcheck disable=SC2206
local access_key_values=($test_command_response)

IFS=$'\t ' read -r -a access_key_values <<<"$test_command_response"
if [[ "${#access_key_values[@]}" -ne "2" ]]; then
test_failed "Listing access keys returned incorrect number of keys."
fi
Expand Down Expand Up @@ -258,7 +259,7 @@ function main() {
test_count=$((test_count + 1))

# bashsupport disable=BP2001
mock_input="True"
export mock_input="True"

# bashsupport disable=BP2001
export mock_input_array=("iamtestcli_scenario")
Expand Down
78 changes: 78 additions & 0 deletions aws-cli/bash-linux/medical-imaging/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<!--Generated by WRITEME on 2023-08-11 15:51:03.699447 (UTC)-->
# HealthImaging code examples for the Command Line Interface with Bash script

## Overview

Shows how to use the AWS Command Line Interface with Bash script to work with AWS HealthImaging.

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

*HealthImaging is a HIPAA-eligible service that helps health care providers and their medical imaging ISV partners store, transform, and apply machine learning to medical images.*

## ⚠ Important

* Running this code might result in charges to your AWS account.
* 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).

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

## Code examples

### Prerequisites

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


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

### Single actions

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

* [Create a data store](medical_imaging_operations.sh#L22) (`CreateDatastore`)
* [Delete a data store](medical_imaging_operations.sh#L267) (`DeleteDatastore`)
* [Get data store properties](medical_imaging_operations.sh#L196) (`GetDatastore`)
* [List data stores](medical_imaging_operations.sh#L91) (`ListDatastores`)

## Run the examples

### Instructions


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



### Tests

⚠ Running tests might result in charges to your AWS account.


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



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

## Additional resources

* [HealthImaging User Guide](https://docs.aws.amazon.com/healthimaging/latest/devguide/what-is.html)
* [HealthImaging API Reference](https://docs.aws.amazon.com/healthimaging/latest/APIReference/Welcome.html)
* [Command Line Interface with Bash script HealthImaging reference](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/medical-imaging/index.html)

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

---

Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.

SPDX-License-Identifier: Apache-2.0
Loading