Gets an endpoint for a specified stream for either reading or writing. Use this endpoint in your application to read from the specified stream (using the GetMedia or GetMediaForFragmentList operations) or write to it (using the PutMedia operation).
The returned endpoint does not have the API name appended. The client needs to add the API name to the returned endpoint.
In the request, specify the stream either by StreamName or StreamARN.
Parameters:
-
stream_name
(Optional[StreamName], default:
None
)
–
The name of the stream that you want to get the endpoint for. You must specify either this parameter or a StreamARN in the request.
-
stream_arn
(Optional[ResourceARN], default:
None
)
–
The Amazon Resource Name (ARN) of the stream that you want to get the endpoint for. You must specify either this parameter or a StreamName in the request.
-
api_name
(APIName)
–
The name of the API action for which to get an endpoint.
Raises:
Source code in docs_src/capo_kinesis_video/_services/async_kinesis_video.py
| async def get_data_endpoint(
self,
api_name: "capo_kinesis_video.types.api_name.APIName",
*,
config_overrides: Optional[AsyncKinesisVideoClientConfig] = None,
stream_name: Optional["capo_kinesis_video.types.stream_name.StreamName"] = None,
stream_arn: Optional[
"capo_kinesis_video.types.resource_arn.ResourceARN"
] = None,
) -> "capo_kinesis_video.types.get_data_endpoint_output.GetDataEndpointOutput":
"""<p>Gets an endpoint for a specified stream for either reading or writing. Use this endpoint in your application to read from the specified stream (using the <code>GetMedia</code> or <code>GetMediaForFragmentList</code> operations) or write to it (using the <code>PutMedia</code> operation). </p> <note> <p>The returned endpoint does not have the API name appended. The client needs to add the API name to the returned endpoint.</p> </note> <p>In the request, specify the stream either by <code>StreamName</code> or <code>StreamARN</code>.</p>
Args:
stream_name: <p>The name of the stream that you want to get the endpoint for. You must specify either this parameter or a <code>StreamARN</code> in the request.</p>
stream_arn: <p>The Amazon Resource Name (ARN) of the stream that you want to get the endpoint for. You must specify either this parameter or a <code>StreamName</code> in the request. </p>
api_name: <p>The name of the API action for which to get an endpoint.</p>
Raises:
capo_kinesis_video.errors.client_limit_exceeded_exception.ClientLimitExceededException: <p>Kinesis Video Streams has throttled the request because you have exceeded the limit of allowed client calls. Try making the call later.</p>
capo_kinesis_video.errors.invalid_argument_exception.InvalidArgumentException: <p>The value for this input parameter is invalid.</p>
capo_kinesis_video.errors.not_authorized_exception.NotAuthorizedException: <p>The caller is not authorized to perform this operation.</p>
capo_kinesis_video.errors.resource_not_found_exception.ResourceNotFoundException: <p>Amazon Kinesis Video Streams can't find the stream that you specified.</p>
capo_kinesis_video.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_kinesis_video.types.get_data_endpoint_input.GetDataEndpointInput]",
) -> AsyncOperationResponse[
"capo_kinesis_video.types.get_data_endpoint_output.GetDataEndpointOutput"
]:
import capo_kinesis_video._operations.kinesis_video_20170930.get_data_endpoint
(
output,
http_response,
) = await capo_kinesis_video._operations.kinesis_video_20170930.get_data_endpoint.async_get_data_endpoint(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("GetDataEndpoint")
)
input_: capo_kinesis_video.types.get_data_endpoint_input.GetDataEndpointInput = {
"api_name": api_name
}
if stream_name is not None:
input_["stream_name"] = stream_name
if stream_arn is not None:
input_["stream_arn"] = stream_arn
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|