public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems)
        {
            AmazonRekognitionConfig config = new AmazonRekognitionConfig();

            config.RegionEndpoint = region;
            ConfigureClient(config);
            AmazonRekognitionClient client = new AmazonRekognitionClient(creds, config);

            ListStreamProcessorsResponse resp = new ListStreamProcessorsResponse();

            do
            {
                ListStreamProcessorsRequest req = new ListStreamProcessorsRequest
                {
                    NextToken = resp.NextToken
                    ,
                    MaxResults = maxItems
                };

                resp = client.ListStreamProcessors(req);
                CheckError(resp.HttpStatusCode, "200");

                foreach (var obj in resp.StreamProcessors)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.NextToken));
        }
        public List <string> ListStreamProcessors()
        {
            List <string> streamProcessors = new List <string>();
            ListStreamProcessorsResponse listStreamProcessorsResponse =
                rekognitionClient.ListStreamProcessors(new ListStreamProcessorsRequest()
            {
                MaxResults = 100,
            });

            //List all stream processors (and state) returned from Rekognition
            foreach (StreamProcessor streamProcessor in listStreamProcessorsResponse.StreamProcessors)
            {
                streamProcessors.Add(streamProcessor.Name);
                Console.WriteLine("StreamProcessor name - " + streamProcessor.Name);
                Console.WriteLine("Status - " + streamProcessor.Status + "\n");
            }

            return(streamProcessors);
        }
Exemple #3
0
        public static List <string> ListStreamProcessors()
        {
            List <string> streamProcessors = null;

            try
            {
                AmazonRekognitionClient rekognitionClient;
                using (rekognitionClient = new AmazonRekognitionClient(MyAWSConfigs.KinesisRegion))
                {
                    ListStreamProcessorsResponse listStreamProcessorsResponse =
                        rekognitionClient.ListStreamProcessors(new ListStreamProcessorsRequest()
                    {
                        MaxResults = 100,
                    });

                    if (listStreamProcessorsResponse.HttpStatusCode == System.Net.HttpStatusCode.OK)
                    {
                        streamProcessors = new List <string>();

                        // List all stream processors (and state) returned from Rekognition
                        foreach (StreamProcessor streamProcessor in listStreamProcessorsResponse.StreamProcessors)
                        {
                            streamProcessors.Add(streamProcessor.Name);
                            Console.WriteLine("StreamProcessor name - " + streamProcessor.Name);
                            Console.WriteLine("Status - " + streamProcessor.Status + "\n");
                        }
                    }
                }
            }
            catch (AmazonRekognitionException e)
            {
                Console.WriteLine("AmazonRekognitionException: " + e);
            }
            catch (Exception e)
            {
                Console.WriteLine("Error: " + e);
            }

            return(streamProcessors);
        }