Skip to content

Commit 9b1f117

Browse files
authored
bash; adding service, healthimaging (#5261)
1 parent 0992647 commit 9b1f117

11 files changed

+855
-29
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# zexi 0.4.0
2+
medical-imaging_CreateDatastore:
3+
title: Create a data store using the &AHI; SDK
4+
title_abbrev: Create a data store
5+
synopsis: create a data store.
6+
category:
7+
languages:
8+
Bash:
9+
versions:
10+
- sdk_version: 2
11+
github: aws-cli/bash-linux/medical-imaging
12+
sdkguide:
13+
excerpts:
14+
- description:
15+
snippet_tags:
16+
- aws-cli.bash-linux.medical-imaging.errecho
17+
- aws-cli.bash-linux.medical-imaging.CreateDatastore
18+
services:
19+
medical-imaging: {CreateDatastore}
20+
medical-imaging_DeleteDatastore:
21+
title: Delete a data store using the &AHI; SDK
22+
title_abbrev: Delete a data store
23+
synopsis: delete a data store.
24+
category:
25+
languages:
26+
Bash:
27+
versions:
28+
- sdk_version: 2
29+
github: aws-cli/bash-linux/medical-imaging
30+
sdkguide:
31+
excerpts:
32+
- description:
33+
snippet_tags:
34+
- aws-cli.bash-linux.medical-imaging.errecho
35+
- aws-cli.bash-linux.medical-imaging.DeleteDatastore
36+
services:
37+
medical-imaging: {DeleteDatastore}
38+
medical-imaging_ListDatastores:
39+
title: List a data stores using the &AHI; SDK
40+
title_abbrev: List data stores
41+
synopsis: list a data stores.
42+
category:
43+
languages:
44+
Bash:
45+
versions:
46+
- sdk_version: 2
47+
github: aws-cli/bash-linux/medical-imaging
48+
sdkguide:
49+
excerpts:
50+
- description:
51+
snippet_tags:
52+
- aws-cli.bash-linux.medical-imaging.errecho
53+
- aws-cli.bash-linux.medical-imaging.ListDatastores
54+
services:
55+
medical-imaging: {ListDatastores}
56+
medical-imaging_GetDatastore:
57+
title: Get data store properties using the &AHI; SDK
58+
title_abbrev: Get data store properties
59+
synopsis: get data store properties.
60+
category:
61+
languages:
62+
Bash:
63+
versions:
64+
- sdk_version: 2
65+
github: aws-cli/bash-linux/medical-imaging
66+
sdkguide:
67+
excerpts:
68+
- description:
69+
snippet_tags:
70+
- aws-cli.bash-linux.medical-imaging.errecho
71+
- aws-cli.bash-linux.medical-imaging.GetDatastore
72+
services:
73+
medical-imaging: {GetDatastore}

.doc_gen/metadata/services.yaml

+15
Original file line numberDiff line numberDiff line change
@@ -670,6 +670,21 @@ mediapackage:
670670
tags:
671671
product_categories: {'Media Services'}
672672
version: mediapackage-2017-10-12
673+
medical-imaging:
674+
long: '&AHIlong;'
675+
short: '&AHI;'
676+
sort: HealthImaging
677+
expanded:
678+
long: AWS HealthImaging
679+
short: HealthImaging
680+
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.
681+
guide:
682+
subtitle: User Guide
683+
url: healthimaging/latest/devguide/what-is.html
684+
api_ref: healthimaging/latest/APIReference/Welcome.html
685+
tags:
686+
product_categories: {'Machine Learning'}
687+
version: medical-imaging-2023-07-19
673688
migration-hub:
674689
long: '&MHBlong;'
675690
short: '&MHB;'

aws-cli/README.md

+13-8
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,24 @@ To run these examples, you'll need:
2525
## Running the examples
2626

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

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

37+
### Tests
38+
39+
Most examples are accompanied by a unit or integration test
40+
script that you can run to validate that each example works. The test scripts
41+
include setup and teardown to create and destroy any prerequisite resources.
42+
We take care that all AWS resources that the example creates are also destroyed
43+
to avoid incurring any unwanted costs.
44+
45+
4146
## AWS CLI downloads
4247

4348
For information about how to download and install the AWS CLI, see [Installing

aws-cli/bash-linux/README.md

+9-5
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,7 @@ To run these examples, you need:
2727
## Running the examples
2828

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

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

39+
### Tests
40+
41+
Most examples are accompanied by a unit or integration test
42+
script that you can run to validate that each example works. The test scripts
43+
include setup and teardown to create and destroy any prerequisite resources.
44+
We take care that all AWS resources that the example creates are also destroyed
45+
to avoid incurring any unwanted costs.
46+
4347
## AWS CLI downloads
4448

4549
For information about how to download and install the AWS CLI, see [Installing

aws-cli/bash-linux/iam/iam_create_user_assume_role_scenario.sh

+3-5
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ function sts_assume_role() {
288288
--role-session-name "$role_session_name" \
289289
--role-arn "$role_arn" \
290290
--output text \
291-
--query "Credentials.{AccessKeyId: AccessKeyId ,SecretAccessKey: SecretAccessKey ,SessionToken: SessionToken}")
291+
--query "Credentials.[AccessKeyId, SecretAccessKey, SessionToken]")
292292

293293
local error_code=${?}
294294

@@ -358,8 +358,7 @@ function iam_create_user_assume_role() {
358358
return 1
359359
fi
360360

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

@@ -492,8 +491,7 @@ function iam_create_user_assume_role() {
492491
return 1
493492
fi
494493

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

498496
export AWS_ACCESS_KEY_ID=${credentials[0]}
499497
export AWS_SECRET_ACCESS_KEY=${credentials[1]}

aws-cli/bash-linux/iam/tests/test_iam_examples.sh

+12-11
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,18 @@
1818
###############################################################################
1919

2020
# Set default values.
21-
# bashsupport disable=BP5001
22-
INTERACTIVE=false
23-
VERBOSE=false
2421

2522
###############################################################################
2623
# function main
2724
#
2825
# This function runs the IAM examples' tests.
2926
###############################################################################
3027
function main() {
28+
# bashsupport disable=BP2001
29+
export INTERACTIVE=false
30+
# bashsupport disable=BP2001
31+
export VERBOSE=false
32+
3133
source ./test_general.sh
3234
{
3335
local current_directory
@@ -125,8 +127,8 @@ function main() {
125127
0
126128
test_count=$((test_count + 1))
127129

128-
# shellcheck disable=SC2206
129-
local user_values=($test_command_response)
130+
local user_values
131+
IFS=$'\t ' read -r -a user_values <<<"$test_command_response"
130132
if [[ "${#user_values[@]}" -lt "2" ]]; then
131133
test_failed "Listing users returned less than 2 users."
132134
fi
@@ -152,9 +154,8 @@ function main() {
152154
"iam_create_user_access_key -u $user_name " \
153155
0
154156
test_count=$((test_count + 1))
155-
156-
# shellcheck disable=SC2206
157-
local access_key_values=($test_command_response)
157+
local access_key_values
158+
IFS=$'\t ' read -r -a access_key_values <<<"$test_command_response"
158159
local key_name2=${access_key_values[0]}
159160

160161
run_test "$test_count. Listing access keys without user" \
@@ -166,8 +167,8 @@ function main() {
166167
"iam_list_access_keys -u $user_name " \
167168
0
168169
test_count=$((test_count + 1))
169-
# shellcheck disable=SC2206
170-
local access_key_values=($test_command_response)
170+
171+
IFS=$'\t ' read -r -a access_key_values <<<"$test_command_response"
171172
if [[ "${#access_key_values[@]}" -ne "2" ]]; then
172173
test_failed "Listing access keys returned incorrect number of keys."
173174
fi
@@ -258,7 +259,7 @@ function main() {
258259
test_count=$((test_count + 1))
259260

260261
# bashsupport disable=BP2001
261-
mock_input="True"
262+
export mock_input="True"
262263

263264
# bashsupport disable=BP2001
264265
export mock_input_array=("iamtestcli_scenario")
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
<!--Generated by WRITEME on 2023-08-11 15:51:03.699447 (UTC)-->
2+
# HealthImaging code examples for the Command Line Interface with Bash script
3+
4+
## Overview
5+
6+
Shows how to use the AWS Command Line Interface with Bash script to work with AWS HealthImaging.
7+
8+
<!--custom.overview.start-->
9+
<!--custom.overview.end-->
10+
11+
*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.*
12+
13+
## ⚠ Important
14+
15+
* Running this code might result in charges to your AWS account.
16+
* Running the tests might result in charges to your AWS account.
17+
* 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).
18+
* 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).
19+
20+
<!--custom.important.start-->
21+
<!--custom.important.end-->
22+
23+
## Code examples
24+
25+
### Prerequisites
26+
27+
For prerequisites, see the [README](../../README.md#Prerequisites) in the `aws-cli` folder.
28+
29+
30+
<!--custom.prerequisites.start-->
31+
<!--custom.prerequisites.end-->
32+
33+
### Single actions
34+
35+
Code excerpts that show you how to call individual service functions.
36+
37+
* [Create a data store](medical_imaging_operations.sh#L22) (`CreateDatastore`)
38+
* [Delete a data store](medical_imaging_operations.sh#L267) (`DeleteDatastore`)
39+
* [Get data store properties](medical_imaging_operations.sh#L196) (`GetDatastore`)
40+
* [List data stores](medical_imaging_operations.sh#L91) (`ListDatastores`)
41+
42+
## Run the examples
43+
44+
### Instructions
45+
46+
47+
<!--custom.instructions.start-->
48+
<!--custom.instructions.end-->
49+
50+
51+
52+
### Tests
53+
54+
⚠ Running tests might result in charges to your AWS account.
55+
56+
57+
To find instructions for running these tests, see the [README](../../README.md#Tests)
58+
in the `aws-cli` folder.
59+
60+
61+
62+
<!--custom.tests.start-->
63+
<!--custom.tests.end-->
64+
65+
## Additional resources
66+
67+
* [HealthImaging User Guide](https://docs.aws.amazon.com/healthimaging/latest/devguide/what-is.html)
68+
* [HealthImaging API Reference](https://docs.aws.amazon.com/healthimaging/latest/APIReference/Welcome.html)
69+
* [Command Line Interface with Bash script HealthImaging reference](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/medical-imaging/index.html)
70+
71+
<!--custom.resources.start-->
72+
<!--custom.resources.end-->
73+
74+
---
75+
76+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
77+
78+
SPDX-License-Identifier: Apache-2.0

0 commit comments

Comments
 (0)