From 982a9d3d73d74c9a1c35280964634fd533d74a69 Mon Sep 17 00:00:00 2001 From: Elysa Hall Date: Mon, 30 Dec 2024 18:33:46 +0000 Subject: [PATCH] CLI examples for ec2, ecs, ivs-realtime, lambda --- awscli/examples/ec2/allocate-address.rst | 23 +++++- .../examples/ecs/discover-poll-endpoint.rst | 17 ++++ .../examples/ecs/wait/services-inactive.rst | 9 +++ awscli/examples/ecs/wait/task-stopped.rst | 22 ++++++ awscli/examples/ivs-realtime/create-stage.rst | 75 ++++++++++++++++-- .../examples/ivs-realtime/get-composition.rst | 75 +++++++++++++++++- awscli/examples/ivs-realtime/get-stage.rst | 17 ++-- .../ivs-realtime/start-composition.rst | 77 +++++++++++++++++++ awscli/examples/ivs-realtime/update-stage.rst | 22 ++++-- awscli/examples/lambda/invoke.rst | 4 +- 10 files changed, 318 insertions(+), 23 deletions(-) create mode 100644 awscli/examples/ecs/discover-poll-endpoint.rst create mode 100644 awscli/examples/ecs/wait/services-inactive.rst create mode 100644 awscli/examples/ecs/wait/task-stopped.rst diff --git a/awscli/examples/ec2/allocate-address.rst b/awscli/examples/ec2/allocate-address.rst index 99d973e47fa5..c46f6c91e5ce 100755 --- a/awscli/examples/ec2/allocate-address.rst +++ b/awscli/examples/ec2/allocate-address.rst @@ -53,4 +53,25 @@ Output:: "NetworkBorderGroup": "us-west-2", } -For more information, see `Elastic IP addresses `__ in the *Amazon EC2 User Guide*. \ No newline at end of file +For more information, see `Elastic IP addresses `__ in the *Amazon EC2 User Guide*. + +**Example 4: To allocate an Elastic IP address from an IPAM pool** + +The following ``allocate-address`` example allocates a specific /32 Elastic IP address from an Amazon VPC IP Address Manager (IPAM) pool. :: + + aws ec2 allocate-address \ + --region us-east-1 \ + --ipam-pool-id ipam-pool-1234567890abcdef0 \ + --address 192.0.2.0 + +Output:: + + { + "PublicIp": "192.0.2.0", + "AllocationId": "eipalloc-abcdef01234567890", + "PublicIpv4Pool": "ipam-pool-1234567890abcdef0", + "NetworkBorderGroup": "us-east-1", + "Domain": "vpc" + } + +For more information, see `Allocate sequential Elastic IP addresses from an IPAM pool `__ in the *Amazon VPC IPAM User Guide*. diff --git a/awscli/examples/ecs/discover-poll-endpoint.rst b/awscli/examples/ecs/discover-poll-endpoint.rst new file mode 100644 index 000000000000..ca8c9a8a42ca --- /dev/null +++ b/awscli/examples/ecs/discover-poll-endpoint.rst @@ -0,0 +1,17 @@ +**Get the endpoint for ECS agent for polling updates** + +The following ``discover-poll-endpoint`` example returns the endpoint for the ECS agent to poll for the updates. You can pass container instance ID or full ARN of container instances. This example uses ID of the container instance. :: + + aws ecs discover-poll-endpoint \ + --container-instance d5f596ccb5794833b778c680c318ft78 \ + --cluster-name MyCluster + +Output:: + + { + "endpoint": "https://ecs-a-16.us-west-2.amazonaws.com/", + "telemetryEndpoint": "https://ecs-t-16.us-west-2.amazonaws.com/", + "serviceConnectEndpoint": "https://ecs-sc.us-west-2.api.aws" + } + +For more information on Agent Endpoints, see `Create VPC Endpoints for Amazon ECS `__ in the *Amazon ECS Developer Guide*. \ No newline at end of file diff --git a/awscli/examples/ecs/wait/services-inactive.rst b/awscli/examples/ecs/wait/services-inactive.rst new file mode 100644 index 000000000000..91d0050788c5 --- /dev/null +++ b/awscli/examples/ecs/wait/services-inactive.rst @@ -0,0 +1,9 @@ +**Wait until an ECS service becomes inactive** + +The following ``service-inactive`` example waits until ECS services becomes inactive in the cluster. :: + + aws ecs wait services-inactive \ + --cluster MyCluster \ + --services MyService + +This command produces no output. diff --git a/awscli/examples/ecs/wait/task-stopped.rst b/awscli/examples/ecs/wait/task-stopped.rst new file mode 100644 index 000000000000..80f6042d9c61 --- /dev/null +++ b/awscli/examples/ecs/wait/task-stopped.rst @@ -0,0 +1,22 @@ +**Example 1: Wait until an ECS task is in stopped state** + +The following ``wait tasks-stopped`` example waits until the provided tasks in the command are in a stopped state. You can pass IDs or full ARN of the tasks. This example uses ID of the task. :: + + aws ecs wait tasks-stopped \ + --cluster MyCluster \ + --tasks 2c196f0a00dd4f58b7c8897a5c7bce13 + +This command produces no output. + +**Example 2: Wait until multiple ECS tasks are in stopped state** + +The following ``wait tasks-stopped`` example waits until the multiple tasks provided in the command are in a stopped state. You can pass IDs or full ARN of the tasks. This example uses IDs of the tasks. :: + + aws ecs wait tasks-stopped \ + --cluster MyCluster \ + --tasks 2c196f0a00dd4f58b7c8897a5c7bce13 4d590253bb114126b7afa7b58EXAMPLE + +This command produces no output. + + + diff --git a/awscli/examples/ivs-realtime/create-stage.rst b/awscli/examples/ivs-realtime/create-stage.rst index 5b94fa41baf6..c9b32d4ea151 100644 --- a/awscli/examples/ivs-realtime/create-stage.rst +++ b/awscli/examples/ivs-realtime/create-stage.rst @@ -19,11 +19,24 @@ Output:: "stage": { "activeSessionId": "st-a1b2c3d4e5f6g", "arn": "arn:aws:ivs:us-west-2:123456789012:stage/abcdABCDefgh", + "autoParticipantRecordingConfiguration": { + "storageConfigurationArn": "", + "mediaTypes": [ + "AUDIO_VIDEO" + ], + "thumbnailConfiguration": { + "targetIntervalSeconds": 60, + "storage": [ + "SEQUENTIAL" + ], + "recordingMode": "DISABLED" + } + }, "endpoints": { "events": "wss://global.events.live-video.net", "rtmp": "rtmp://9x0y8z7s6t5u.global-contribute-staging.live-video.net/app/", "rtmps": "rtmps://9x0y8z7s6t5u.global-contribute-staging.live-video.net:443/app/", - "whip": "https://1a2b3c4d5e6f.global-bm.whip.live-video.net" + "whip": "https://9x0y8z7s6t5u.global-bm.whip.live-video.net" }, "name": "stage1", "tags": {} @@ -47,16 +60,23 @@ Output:: "activeSessionId": "st-a1b2c3d4e5f6g", "arn": "arn:aws:ivs:us-west-2:123456789012:stage/abcdABCDefgh", "autoParticipantRecordingConfiguration": { - "mediaTypes": [ - "AUDIO_VIDEO" - ], - "storageConfigurationArn": "arn:aws:ivs:us-west-2:123456789012:storage-configuration/abcdABCDefgh", - }, + "storageConfigurationArn": "arn:aws:ivs:us-west-2:123456789012:storage-configuration/abcdABCDefgh" + "mediaTypes": [ + "AUDIO_VIDEO" + ], + "thumbnailConfiguration": { + "targetIntervalSeconds": 60, + "storage": [ + "SEQUENTIAL" + ], + "recordingMode": "DISABLED" + } + }, "endpoints": { "events": "wss://global.events.live-video.net", "rtmp": "rtmp://9x0y8z7s6t5u.global-contribute-staging.live-video.net/app/", "rtmps": "rtmps://9x0y8z7s6t5u.global-contribute-staging.live-video.net:443/app/", - "whip": "https://1a2b3c4d5e6f.global-bm.whip.live-video.net" + "whip": "https://9x0y8z7s6t5u.global-bm.whip.live-video.net" }, "name": "stage1", "tags": {} @@ -64,3 +84,44 @@ Output:: } For more information, see `Enabling Multiple Hosts on an Amazon IVS Stream `__ in the *Amazon Interactive Video Service User Guide*. + +**Example 3: To create a stage and configure individial participant recording with thumbnail recording enabled** + +The following ``create-stage`` example creates a stage and configures individual participant recording with thumbnail recording enabled. :: + + aws ivs-realtime create-stage \ + --name stage1 \ + --auto-participant-recording-configuration '{"mediaTypes": ["AUDIO_VIDEO"],"storageConfigurationArn": "arn:aws:ivs:us-west-2:123456789012:storage-configuration/abcdABCDefgh", \ + "thumbnailConfiguration": {"recordingMode": "INTERVAL","storage": ["SEQUENTIAL"],"targetIntervalSeconds": 60}}' + +Output:: + + { + "stage": { + "activeSessionId": "st-a1b2c3d4e5f6g", + "arn": "arn:aws:ivs:us-west-2:123456789012:stage/abcdABCDefgh", + "autoParticipantRecordingConfiguration": { + "storageConfigurationArn": "arn:aws:ivs:us-west-2:123456789012:storage-configuration/abcdABCDefgh", + "mediaTypes": [ + "AUDIO_VIDEO" + ], + "thumbnailConfiguration": { + "targetIntervalSeconds": 60, + "storage": [ + "SEQUENTIAL" + ], + "recordingMode": "INTERVAL" + } + }, + "endpoints": { + "events": "wss://global.events.live-video.net", + "rtmp": "rtmp://9x0y8z7s6t5u.global-contribute-staging.live-video.net/app/", + "rtmps": "rtmps://9x0y8z7s6t5u.global-contribute-staging.live-video.net:443/app/", + "whip": "https://9x0y8z7s6t5u.global-bm.whip.live-video.net" + }, + "name": "stage1", + "tags": {} + } + } + +For more information, see `Enabling Multiple Hosts on an Amazon IVS Stream `__ in the *Amazon Interactive Video Service User Guide*. \ No newline at end of file diff --git a/awscli/examples/ivs-realtime/get-composition.rst b/awscli/examples/ivs-realtime/get-composition.rst index c85f680c10b2..f796cde2d83f 100644 --- a/awscli/examples/ivs-realtime/get-composition.rst +++ b/awscli/examples/ivs-realtime/get-composition.rst @@ -33,7 +33,7 @@ Output:: "recordingConfiguration": { "format": "HLS" }, - "storageConfigurationArn": "arn:arn:aws:ivs:ap-northeast-1:123456789012:storage-configuration/FefABabCDcdE" + "storageConfigurationArn": "arn:arn:aws:ivs:ap-northeast-1:123456789012:storage-configuration/FefABabCDcdE", } }, "detail": { @@ -130,4 +130,77 @@ Output:: } } +For more information, see `Composite Recording (Real-Time Streaming) `__ in the *Amazon Interactive Video Service User Guide*. + +**Example 3: To get a composition with thumbnail recording enabled** + +The following ``get-composition`` example gets the composition for the ARN (Amazon Resource Name) specified, which has thumbnail recording enabled with default settings. :: + + aws ivs-realtime get-composition \ + --arn "arn:aws:ivs:ap-northeast-1:123456789012:composition/abcdABCDefgh" + +Output:: + + { + "composition": { + "arn": "arn:aws:ivs:ap-northeast-1:123456789012:composition/abcdABCDefgh", + "destinations": [ + { + "configuration": { + "channel": { + "channelArn": "arn:aws:ivs:ap-northeast-1:123456789012:channel/abcABCdefDEg", + "encoderConfigurationArn": "arn:aws:ivs:ap-northeast-1:123456789012:encoder-configuration/ABabCDcdEFef" + }, + "name": "" + }, + "id": "AabBCcdDEefF", + "startTime": "2023-10-16T23:26:00+00:00", + "state": "ACTIVE" + }, + { + "configuration": { + "name": "", + "s3": { + "encoderConfigurationArns": [ + "arn:aws:ivs:arn:aws:ivs:ap-northeast-1:123456789012:encoder-configuration/ABabCDcdEFef" + ], + "recordingConfiguration": { + "format": "HLS" + }, + "storageConfigurationArn": "arn:arn:aws:ivs:ap-northeast-1:123456789012:storage-configuration/FefABabCDcdE", + "thumbnailConfigurations": [ + { + "targetIntervalSeconds": 60, + "storage": [ + "SEQUENTIAL" + ], + } + ] + } + }, + "detail": { + "s3": { + "recordingPrefix": "aBcDeFgHhGfE/AbCdEfGhHgFe/GHFabcgefABC/composite" + } + }, + "id": "GHFabcgefABC", + "startTime": "2023-10-16T23:26:00+00:00", + "state": "STARTING" + } + ], + "layout": { + "grid": { + "featuredParticipantAttribute": "" + "gridGap": 2, + "omitStoppedVideo": false, + "videoAspectRatio": "VIDEO", + "videoFillMode": "" } + }, + "stageArn": "arn:aws:ivs:ap-northeast-1:123456789012:stage/defgABCDabcd", + "startTime": "2023-10-16T23:24:00+00:00", + "state": "ACTIVE", + "tags": {} + } + } + For more information, see `Composite Recording (Real-Time Streaming) `__ in the *Amazon Interactive Video Service User Guide*. \ No newline at end of file diff --git a/awscli/examples/ivs-realtime/get-stage.rst b/awscli/examples/ivs-realtime/get-stage.rst index cf56514a5a99..22bb45d6c93a 100644 --- a/awscli/examples/ivs-realtime/get-stage.rst +++ b/awscli/examples/ivs-realtime/get-stage.rst @@ -12,20 +12,27 @@ Output:: "activeSessionId": "st-a1b2c3d4e5f6g", "arn": "arn:aws:ivs:us-west-2:123456789012:stage/abcdABCDefgh", "autoParticipantRecordingConfiguration": { + "storageConfigurationArn": "", "mediaTypes": [ - "AUDIO_VIDEO" + "AUDIO_VIDEO" ], - "storageConfigurationArn": "arn:aws:ivs:us-west-2:123456789012:storage-configuration/abcdABCDefgh", - }, + "thumbnailConfiguration": { + "targetIntervalSeconds": 60, + "storage": [ + "SEQUENTIAL" + ], + "recordingMode": "DISABLED", + } + }, "endpoints": { "events": "wss://global.events.live-video.net", "rtmp": "rtmp://9x0y8z7s6t5u.global-contribute-staging.live-video.net/app/", "rtmps": "rtmps://9x0y8z7s6t5u.global-contribute-staging.live-video.net:443/app/", - "whip": "https://1a2b3c4d5e6f.global-bm.whip.live-video.net" + "whip": "https://9x0y8z7s6t5u.global-bm.whip.live-video.net" }, "name": "test", "tags": {} } } -For more information, see `Enabling Multiple Hosts on an Amazon IVS Stream `__ in the *Amazon Interactive Video Service User Guide*. +For more information, see `Enabling Multiple Hosts on an Amazon IVS Stream `__ in the *Amazon Interactive Video Service User Guide*. \ No newline at end of file diff --git a/awscli/examples/ivs-realtime/start-composition.rst b/awscli/examples/ivs-realtime/start-composition.rst index fbfac59128a3..ba7eaee808c9 100644 --- a/awscli/examples/ivs-realtime/start-composition.rst +++ b/awscli/examples/ivs-realtime/start-composition.rst @@ -136,4 +136,81 @@ Output:: } } +For more information, see `Composite Recording (Real-Time Streaming) `__ in the *Amazon Interactive Video Service User Guide*. + +**Example 3: To start a composition with thubnail recording enabled** + +The following ``start-composition`` example starts a composition for the specified stage to be streamed to the specified locations with thumbnail recording enabled. :: + + aws ivs-realtime start-composition \ + --stage-arn arn:aws:ivs:ap-northeast-1:123456789012:stage/defgABCDabcd \ + --destinations '[{"channel": {"channelArn": "arn:aws:ivs:ap-northeast-1:123456789012:channel/abcABCdefDEg", \ + "encoderConfigurationArn": "arn:aws:ivs:ap-northeast-1:123456789012:encoder-configuration/ABabCDcdEFef"}}, \ + {"s3": {"encoderConfigurationArns": ["arn:aws:ivs:ap-northeast-1:123456789012:encoder-configuration/ABabCDcdEFef"], \ + "storageConfigurationArn": "arn:aws:ivs:ap-northeast-1:123456789012:storage-configuration/FefABabCDcdE", \ + "thumbnailConfigurations": [{"storage": ["SEQUENTIAL"],"targetIntervalSeconds": 60}]}}]' + +Output:: + + { + "composition": { + "arn": "arn:aws:ivs:ap-northeast-1:123456789012:composition/abcdABCDefgh", + "destinations": [ + { + "configuration": { + "channel": { + "channelArn": "arn:aws:ivs:ap-northeast-1:123456789012:channel/abcABCdefDEg", + "encoderConfigurationArn": "arn:aws:ivs:ap-northeast-1:123456789012:encoder-configuration/ABabCDcdEFef" + }, + "name": "" + }, + "id": "AabBCcdDEefF", + "state": "STARTING" + }, + { + "configuration": { + "name": "", + "s3": { + "encoderConfigurationArns": [ + "arn:aws:ivs:arn:aws:ivs:ap-northeast-1:123456789012:encoder-configuration/ABabCDcdEFef" + ], + "recordingConfiguration": { + "format": "HLS" + }, + "storageConfigurationArn": "arn:arn:aws:ivs:ap-northeast-1:123456789012:storage-configuration/FefABabCDcdE", + "thumbnailConfigurations": [ + { + "targetIntervalSeconds": 60, + "storage": [ + "SEQUENTIAL" + ] + } + ] + } + }, + "detail": { + "s3": { + "recordingPrefix": "aBcDeFgHhGfE/AbCdEfGhHgFe/GHFabcgefABC/composite" + } + }, + "id": "GHFabcgefABC", + "state": "STARTING" + } + ], + "layout": { + "grid": { + "featuredParticipantAttribute": "" + "gridGap": 2, + "omitStoppedVideo": false, + "videoAspectRatio": "VIDEO", + "videoFillMode": "" + } + }, + "stageArn": "arn:aws:ivs:ap-northeast-1:123456789012:stage/defgABCDabcd", + "startTime": "2023-10-16T23:24:00+00:00", + "state": "STARTING", + "tags": {} + } + } + For more information, see `Composite Recording (Real-Time Streaming) `__ in the *Amazon Interactive Video Service User Guide*. \ No newline at end of file diff --git a/awscli/examples/ivs-realtime/update-stage.rst b/awscli/examples/ivs-realtime/update-stage.rst index 8a566d6a9631..945fab63b9c7 100644 --- a/awscli/examples/ivs-realtime/update-stage.rst +++ b/awscli/examples/ivs-realtime/update-stage.rst @@ -1,10 +1,11 @@ **To update a stage's configuration** -The following ``update-stage`` example updates a stage for a specified stage ARN to update the stage name and configure individual participant recording. :: +The following ``update-stage`` example updates a stage for a specified stage ARN to update the stage name and configure individual participant recording with thumbnail recording enabled. :: aws ivs-realtime update-stage \ --arn arn:aws:ivs:us-west-2:123456789012:stage/abcdABCDefgh \ - --auto-participant-recording-configuration '{"mediaTypes": ["AUDIO_VIDEO"],"storageConfigurationArn": "arn:aws:ivs:us-west-2:123456789012:storage-configuration/abcdABCDefgh"}' \ + --auto-participant-recording-configuration '{"mediaTypes": ["AUDIO_VIDEO"],"storageConfigurationArn": "arn:aws:ivs:us-west-2:123456789012:storage-configuration/abcdABCDefgh", \ + "thumbnailConfiguration": {"recordingMode": "INTERVAL","storage": ["SEQUENTIAL"],"targetIntervalSeconds": 60}}' \ --name stage1a Output:: @@ -13,10 +14,17 @@ Output:: "stage": { "arn": "arn:aws:ivs:us-west-2:123456789012:stage/abcdABCDefgh", "autoParticipantRecordingConfiguration": { - "mediaTypes": [ - "AUDIO_VIDEO" - ], - "storageConfigurationArn": "arn:aws:ivs:us-west-2:123456789012:storage-configuration/abcdABCDefgh", + "mediaTypes": [ + "AUDIO_VIDEO" + ], + "storageConfigurationArn": "arn:aws:ivs:us-west-2:123456789012:storage-configuration/abcdABCDefgh", + "thumbnailConfiguration": { + "targetIntervalSeconds": 60, + "storage": [ + "SEQUENTIAL" + ], + "recordingMode": "INTERVAL" + } }, "endpoints": { "events": "wss://global.events.live-video.net", @@ -29,4 +37,4 @@ Output:: } } -For more information, see `Enabling Multiple Hosts on an Amazon IVS Stream `__ in the *Amazon Interactive Video Service User Guide*. +For more information, see `Enabling Multiple Hosts on an Amazon IVS Stream `__ in the *Amazon Interactive Video Service User Guide*. \ No newline at end of file diff --git a/awscli/examples/lambda/invoke.rst b/awscli/examples/lambda/invoke.rst index 0e213cf703d1..6f50021ce551 100755 --- a/awscli/examples/lambda/invoke.rst +++ b/awscli/examples/lambda/invoke.rst @@ -15,7 +15,7 @@ Output:: "StatusCode": 200 } -For more information, see `Synchronous Invocation `__ in the *AWS Lambda Developer Guide*. +For more information, see `Invoke a Lambda function synchronously `__ in the *AWS Lambda Developer Guide*. **Example 2: To invoke a Lambda function asynchronously** @@ -34,4 +34,4 @@ Output:: "StatusCode": 202 } -For more information, see `Asynchronous Invocation `__ in the *AWS Lambda Developer Guide*. +For more information, see `Invoking a Lambda function asynchronously `__ in the *AWS Lambda Developer Guide*.