Beispiel #1
0
        public static bool DeleteEventSourceMapping(string uuid)
        {
            bool isSuccess = false;

            try
            {
                AmazonLambdaClient lambdaClient;

                using (lambdaClient = new AmazonLambdaClient(Models.MyAWSConfigs.KinesisRegion))
                {
                    DeleteEventSourceMappingRequest request = new DeleteEventSourceMappingRequest
                    {
                        UUID = uuid,
                    };
                    DeleteEventSourceMappingResponse response = lambdaClient.DeleteEventSourceMapping(request);
                    isSuccess = true;

                    Thread.Sleep(1 * 1000);

                    //if (response.HttpStatusCode == System.Net.HttpStatusCode.OK)
                    //    isSuccess = true;
                    //else
                    //    Console.WriteLine("Error deleting event source mapping");
                }
            }
            catch (AmazonLambdaException e)
            {
                Console.WriteLine("AmazonLambdaException: " + e);
            }
            catch (Exception e)
            {
                Console.WriteLine("Error: " + e);
            }

            return(isSuccess);
        }