public ListTagsForStreamResponse ListTags(string exclusiveStartTagKey = null, string streamName = null) { if (string.IsNullOrEmpty(streamName) && string.IsNullOrEmpty(_streamName)) { throw new Exception("Please specify a stream name to list tags"); } var listTagsRequest = new ListTagsForStreamRequest() { StreamName = streamName ?? _streamName, ExclusiveStartTagKey = exclusiveStartTagKey, }; var response = AsyncHelper.RunSync(() => _client.ListTagsForStreamAsync(listTagsRequest)); return(response); }
/// <summary> /// List the tags attached to a Kinesis stream. /// </summary> /// <param name="client">An initialized Kinesis client object.</param> /// <param name="streamName">The name of the Kinesis stream for which you /// wish to display tags.</param> public static async Task ListTagsAsync(IAmazonKinesis client, string streamName) { var request = new ListTagsForStreamRequest { StreamName = streamName, Limit = 10, }; var response = await client.ListTagsForStreamAsync(request); DisplayTags(response.Tags); while (response.HasMoreTags) { request.ExclusiveStartTagKey = response.Tags[response.Tags.Count - 1].Key; response = await client.ListTagsForStreamAsync(request); } }
private Amazon.Kinesis.Model.ListTagsForStreamResponse CallAWSServiceOperation(IAmazonKinesis client, Amazon.Kinesis.Model.ListTagsForStreamRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Kinesis", "ListTagsForStream"); try { #if DESKTOP return(client.ListTagsForStream(request)); #elif CORECLR return(client.ListTagsForStreamAsync(request).GetAwaiter().GetResult()); #else #error "Unknown build edition" #endif } catch (AmazonServiceException exc) { var webException = exc.InnerException as System.Net.WebException; if (webException != null) { throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException); } throw; } }