/// <summary> /// <para>This operation returns the following information about the stream: the current status of the stream, the stream Amazon Resource Name /// (ARN), and an array of shard objects that comprise the stream. For each shard object there is information about the hash key and sequence /// number ranges that the shard spans, and the IDs of any earlier shards that played in a role in a MergeShards or SplitShard operation that /// created the shard. A sequence number is the identifier associated with every record ingested in the Amazon Kinesis stream. The sequence /// number is assigned by the Amazon Kinesis service when a record is put into the stream. </para> <para>You can limit the number of returned /// shards using the <c>Limit</c> parameter. The number of shards in a stream may be too large to return from a single call to /// <c>DescribeStream</c> . /// You can detect this by using the <c>HasMoreShards</c> flag in the returned output. <c>HasMoreShards</c> is set to <c>true</c> /// when there is more data available. </para> <para>If there are more shards available, you can request more shards by using the shard ID of /// the last shard returned by the <c>DescribeStream</c> request, in the <c>ExclusiveStartShardId</c> parameter in a subsequent request to /// <c>DescribeStream</c> . /// /// <c>DescribeStream</c> is a paginated operation. </para> <para> <c>DescribeStream</c> has a limit of 10 transactions per /// second per account.</para> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeStream service method on /// AmazonKinesis.</param> /// /// <returns>The response from the DescribeStream service method, as returned by AmazonKinesis.</returns> /// /// <exception cref="T:Amazon.Kinesis.Model.LimitExceededException" /> /// <exception cref="T:Amazon.Kinesis.Model.ResourceNotFoundException" /> public DescribeStreamResponse DescribeStream(DescribeStreamRequest request) { var task = DescribeStreamAsync(request); try { return(task.Result); } catch (AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return(null); } }
public Task <IReadOnlyList <IShard> > GetShardsAsync() { var request = new DescribeStreamRequest(Name); return(retryPolicy.ExecuteAsync <IReadOnlyList <IShard> >(async() => { var result = await client.DescribeStreamAsync(request).ConfigureAwait(false); var shards = new List <IShard>(result.StreamDescription.Shards.Count); foreach (var shard in shards) { shards.Add(shard); } return shards; })); }
/// <summary> /// Initiates the asynchronous execution of the DescribeStream operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeStream operation on AmazonKinesisClient.</param> /// <param name="callback">An Action delegate that is invoked when the operation completes.</param> /// <param name="options">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> public void DescribeStreamAsync(DescribeStreamRequest request, AmazonServiceCallback <DescribeStreamRequest, DescribeStreamResponse> callback, AsyncOptions options = null) { options = options == null?new AsyncOptions():options; var marshaller = new DescribeStreamRequestMarshaller(); var unmarshaller = DescribeStreamResponseUnmarshaller.Instance; Action <AmazonWebServiceRequest, AmazonWebServiceResponse, Exception, AsyncOptions> callbackHelper = null; if (callback != null) { callbackHelper = (AmazonWebServiceRequest req, AmazonWebServiceResponse res, Exception ex, AsyncOptions ao) => { AmazonServiceResult <DescribeStreamRequest, DescribeStreamResponse> responseObject = new AmazonServiceResult <DescribeStreamRequest, DescribeStreamResponse>((DescribeStreamRequest)req, (DescribeStreamResponse)res, ex, ao.State); callback(responseObject); } } ; BeginInvoke <DescribeStreamRequest>(request, marshaller, unmarshaller, options, callbackHelper); }
public Task <DescribeStreamResult> DescribeStreamAsync(DescribeStreamRequest request) { return(SendAsync <DescribeStreamResult>("DescribeStream", request)); }
public Task <DescribeStreamResult> DescribeStreamAsync(DescribeStreamRequest request) => SendAsync <DescribeStreamResult>("DescribeStream", request);