Exemplo n.º 1
0
        public static bool StartStreamProcessor(String streamProcessorName)
        {
            bool isSuccess = false;

            try
            {
                AmazonRekognitionClient rekognitionClient;
                using (rekognitionClient = new AmazonRekognitionClient(MyAWSConfigs.KinesisRegion))
                {
                    var describeSP = DescribeStreamProcessor(streamProcessorName);
                    if (describeSP.Status == StreamProcessorStatus.STOPPED)
                    {
                        StartStreamProcessorResponse startStreamProcessorResponse =
                            rekognitionClient.StartStreamProcessor(new StartStreamProcessorRequest()
                        {
                            Name = streamProcessorName,
                        });
                        Console.WriteLine("Stream Processor " + streamProcessorName + " started.");

                        isSuccess = startStreamProcessorResponse.HttpStatusCode == System.Net.HttpStatusCode.OK ? true : false;
                    }
                }
            }
            catch (AmazonRekognitionException e)
            {
                Console.WriteLine("AmazonRekognitionException: " + e);
            }
            catch (Exception e)
            {
                Console.WriteLine("Error: " + e);
            }

            return(isSuccess);
        }
        /// <summary>
        /// Unmarshaller the response from the service to the response class.
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
        {
            StartStreamProcessorResponse response = new StartStreamProcessorResponse();


            return(response);
        }
Exemplo n.º 3
0
        public void StartStreamProcessor()
        {
            StartStreamProcessorResponse startStreamProcessorResponse =
                rekognitionClient.StartStreamProcessor(new StartStreamProcessorRequest()
            {
                Name = streamProcessorName,
            });

            Console.WriteLine("Stream Processor " + streamProcessorName + " started.");
        }