Selecione suas preferências de cookies

Usamos cookies essenciais e ferramentas semelhantes que são necessárias para fornecer nosso site e serviços. Usamos cookies de desempenho para coletar estatísticas anônimas, para que possamos entender como os clientes usam nosso site e fazer as devidas melhorias. Cookies essenciais não podem ser desativados, mas você pode clicar em “Personalizar” ou “Recusar” para recusar cookies de desempenho.

Se você concordar, a AWS e terceiros aprovados também usarão cookies para fornecer recursos úteis do site, lembrar suas preferências e exibir conteúdo relevante, incluindo publicidade relevante. Para aceitar ou recusar todos os cookies não essenciais, clique em “Aceitar” ou “Recusar”. Para fazer escolhas mais detalhadas, clique em “Personalizar”.

Exemplo de código de grupos do Kinesis Video Streams para pipelines de fluxo de mídia do SDK do Amazon Chime

Modo de foco
Exemplo de código de grupos do Kinesis Video Streams para pipelines de fluxo de mídia do SDK do Amazon Chime - SDK do Amazon Chime

Os exemplos a seguir mostram como criar, atualizar, obter, listar e excluir grupos do Kinesis Video Streams (KVS). Expanda cada seção para saber mais.

''' Define imports and common variables ''' import boto3 from uuid import uuid4 import json client = boto3.client("chime-sdk-media-pipelines", region_name='us-east-1') pool_name = 'MyDemoKvsPool' def pretty_print_json(obj): print(json.dumps(obj, default=str, indent=4))

''' Define imports and common variables ''' import boto3 from uuid import uuid4 import json client = boto3.client("chime-sdk-media-pipelines", region_name='us-east-1') pool_name = 'MyDemoKvsPool' def pretty_print_json(obj): print(json.dumps(obj, default=str, indent=4))
response = client.create_media_pipeline_kinesis_video_stream_pool( StreamConfiguration={ 'Region': 'us-east-1', 'DataRetentionInHours': 24 }, PoolName=pool_name, ClientRequestToken=str(uuid4()), Tags=[ { 'Key': 'MyTagForAccessControl', 'Value': 'SomeTagValue' }, ] ) pretty_print_json(response['KinesisVideoStreamPoolConfiguration'])

Saída:

{ "PoolArn": "arn:aws:chime:us-east-1:account-ID:media-pipeline-kinesis-video-stream-pool/MyDemoKvsPool", "PoolName": "MyDemoKvsPool", "PoolId": "ChimeMediaPipelines-MyDemoKvsPool-1f4e1a69-e718-4884-bf92-8a393ac0405b", "PoolStatus": "CREATING", "StreamConfiguration": { "Region": "us-east-1", "DataRetentionInHours": 24 }, "CreatedTimestamp": "2023-10-13 01:26:09.979000+00:00", "UpdatedTimestamp": "2023-10-13 01:26:09.979000+00:00" }

response = client.create_media_pipeline_kinesis_video_stream_pool( StreamConfiguration={ 'Region': 'us-east-1', 'DataRetentionInHours': 24 }, PoolName=pool_name, ClientRequestToken=str(uuid4()), Tags=[ { 'Key': 'MyTagForAccessControl', 'Value': 'SomeTagValue' }, ] ) pretty_print_json(response['KinesisVideoStreamPoolConfiguration'])

Saída:

{ "PoolArn": "arn:aws:chime:us-east-1:account-ID:media-pipeline-kinesis-video-stream-pool/MyDemoKvsPool", "PoolName": "MyDemoKvsPool", "PoolId": "ChimeMediaPipelines-MyDemoKvsPool-1f4e1a69-e718-4884-bf92-8a393ac0405b", "PoolStatus": "CREATING", "StreamConfiguration": { "Region": "us-east-1", "DataRetentionInHours": 24 }, "CreatedTimestamp": "2023-10-13 01:26:09.979000+00:00", "UpdatedTimestamp": "2023-10-13 01:26:09.979000+00:00" }
response = client.get_media_pipeline_kinesis_video_stream_pool( Identifier=pool_name ) pretty_print_json(response['KinesisVideoStreamPoolConfiguration'])

Saída:

{ "PoolArn": "arn:aws:chime:us-east-1:account-ID:media-pipeline-kinesis-video-stream-pool/MyDemoKvsPool", "PoolName": "MyDemoKvsPool", "PoolId": "ChimeMediaPipelines-MyDemoKvsPool-1f4e1a69-e718-4884-bf92-8a393ac0405b", "PoolStatus": "ACTIVE", "StreamConfiguration": { "Region": "us-east-1", "DataRetentionInHours": 24 }, "CreatedTimestamp": "2023-10-13 01:26:09.979000+00:00", "UpdatedTimestamp": "2023-10-13 01:26:09.979000+00:00" }

response = client.get_media_pipeline_kinesis_video_stream_pool( Identifier=pool_name ) pretty_print_json(response['KinesisVideoStreamPoolConfiguration'])

Saída:

{ "PoolArn": "arn:aws:chime:us-east-1:account-ID:media-pipeline-kinesis-video-stream-pool/MyDemoKvsPool", "PoolName": "MyDemoKvsPool", "PoolId": "ChimeMediaPipelines-MyDemoKvsPool-1f4e1a69-e718-4884-bf92-8a393ac0405b", "PoolStatus": "ACTIVE", "StreamConfiguration": { "Region": "us-east-1", "DataRetentionInHours": 24 }, "CreatedTimestamp": "2023-10-13 01:26:09.979000+00:00", "UpdatedTimestamp": "2023-10-13 01:26:09.979000+00:00" }
response = client.update_media_pipeline_kinesis_video_stream_pool( Identifier=pool_name, StreamConfiguration={ 'DataRetentionInHours': 48 } ) pretty_print_json(response['KinesisVideoStreamPoolConfiguration'])

Saída:

{ "PoolArn": "arn:aws:chime:us-east-1:account-ID:media-pipeline-kinesis-video-stream-pool/MyDemoKvsPool", "PoolName": "MyDemoKvsPool", "PoolId": "ChimeMediaPipelines-MyDemoKvsPool-d08c26ae-0336-4e2e-acdf-805a7d71b891", "PoolStatus": "UPDATING", "PoolSize": 40, "StreamConfiguration": { "Region": "us-east-1", "DataRetentionInHours": 48 }, "CreatedTimestamp": "2023-10-13 01:44:23.010000+00:00", "UpdatedTimestamp": "2023-10-13 01:44:28.486000+00:00" }

response = client.update_media_pipeline_kinesis_video_stream_pool( Identifier=pool_name, StreamConfiguration={ 'DataRetentionInHours': 48 } ) pretty_print_json(response['KinesisVideoStreamPoolConfiguration'])

Saída:

{ "PoolArn": "arn:aws:chime:us-east-1:account-ID:media-pipeline-kinesis-video-stream-pool/MyDemoKvsPool", "PoolName": "MyDemoKvsPool", "PoolId": "ChimeMediaPipelines-MyDemoKvsPool-d08c26ae-0336-4e2e-acdf-805a7d71b891", "PoolStatus": "UPDATING", "PoolSize": 40, "StreamConfiguration": { "Region": "us-east-1", "DataRetentionInHours": 48 }, "CreatedTimestamp": "2023-10-13 01:44:23.010000+00:00", "UpdatedTimestamp": "2023-10-13 01:44:28.486000+00:00" }
list_of_pools = [] max_results = 100 next_token = None while(True): if next_token: response = client.list_media_pipeline_kinesis_video_stream_pools( NextToken=next_token, MaxResults=max_results ) else: response = client.list_media_pipeline_kinesis_video_stream_pools( MaxResults=max_results ) list_of_pools.extend(response['KinesisVideoStreamPools']) next_token = response.get('NextToken') if not next_token: break pretty_print_json(list_of_pools)

Saída:

[ { "PoolName": "MyDemoKvsPool", "PoolId": "ChimeMediaPipelines-MyDemoKvsPool-6588e703-f046-4288-ba7f-0c03de76a6bb", "PoolArn": "arn:aws:chime:us-east-1:account-ID:media-pipeline-kinesis-video-stream-pool/MyDemoKvsPool" } ]

list_of_pools = [] max_results = 100 next_token = None while(True): if next_token: response = client.list_media_pipeline_kinesis_video_stream_pools( NextToken=next_token, MaxResults=max_results ) else: response = client.list_media_pipeline_kinesis_video_stream_pools( MaxResults=max_results ) list_of_pools.extend(response['KinesisVideoStreamPools']) next_token = response.get('NextToken') if not next_token: break pretty_print_json(list_of_pools)

Saída:

[ { "PoolName": "MyDemoKvsPool", "PoolId": "ChimeMediaPipelines-MyDemoKvsPool-6588e703-f046-4288-ba7f-0c03de76a6bb", "PoolArn": "arn:aws:chime:us-east-1:account-ID:media-pipeline-kinesis-video-stream-pool/MyDemoKvsPool" } ]
client.delete_media_pipeline_kinesis_video_stream_pool( Identifier=pool_name )

Saída: Uma solicitação delete_media_pipeline_kinesis_video_stream_pool bem-sucedida não tem corpo.

client.delete_media_pipeline_kinesis_video_stream_pool( Identifier=pool_name )

Saída: Uma solicitação delete_media_pipeline_kinesis_video_stream_pool bem-sucedida não tem corpo.

PrivacidadeTermos do sitePreferências de cookies
© 2025, Amazon Web Services, Inc. ou suas afiliadas. Todos os direitos reservados.