2018-10-11 15:00:23 -07:00
< ? php
2018-12-28 10:35:52 -08:00
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2018-10-11 15:00:23 -07:00
// SPDX-License-Identifier: Apache-2.0
2024-02-05 10:49:20 -07:00
2018-10-11 15:00:23 -07:00
/*
2019-02-02 17:12:28 -08:00
* ABOUT THIS PHP SAMPLE: This sample is part of the AWS SDK for PHP Developer Guide topic at
2019-02-02 17:06:53 -08:00
* https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/kinesis-example-data-stream.html
2019-02-01 20:26:30 -08:00
*
2018-10-11 15:00:23 -07:00
*/
2019-02-01 20:26:30 -08:00
// snippet-start:[kinesis.php.describe_data_stream.complete]
// snippet-start:[kinesis.php.describe_data_stream.import]
2018-10-11 15:00:23 -07:00
require 'vendor/autoload.php' ;
2024-02-05 10:49:20 -07:00
2018-10-11 15:00:23 -07:00
use Aws\Exception\AwsException ;
2024-02-05 10:49:20 -07:00
2019-02-01 20:26:30 -08:00
// snippet-end:[kinesis.php.describe_data_stream.import]
2024-02-05 10:49:20 -07:00
2018-10-11 15:00:23 -07:00
/**
* Get information about an existing Amazon Kinesis Data Stream.
*
* This code expects that you have AWS credentials set up per:
* https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/guide_credentials.html
*/
2024-02-05 10:49:20 -07:00
2019-02-01 20:26:30 -08:00
//Create a KinesisClient
// snippet-start:[kinesis.php.describe_data_stream.main]
2018-12-17 10:39:03 -08:00
$kinesisClient = new Aws\Kinesis\KinesisClient ([
2018-10-11 15:00:23 -07:00
'profile' => 'default' ,
'version' => '2013-12-02' ,
'region' => 'us-east-2'
]);
2024-02-05 10:49:20 -07:00
2018-10-11 15:00:23 -07:00
$name = " my_stream_name " ;
2024-02-05 10:49:20 -07:00
2018-10-11 15:00:23 -07:00
try {
2018-12-17 10:39:03 -08:00
$result = $kinesisClient -> describeStream ([
2018-10-11 15:00:23 -07:00
'StreamName' => $name ,
]);
var_dump ( $result );
} catch ( AwsException $e ) {
// output error message if fails
echo $e -> getMessage ();
echo " \n " ;
}
2024-02-05 10:49:20 -07:00
2019-02-01 20:26:30 -08:00
// snippet-end:[kinesis.php.describe_data_stream.main]
// snippet-end:[kinesis.php.describe_data_stream.complete]