Amazon.Lambda.AmazonLambdaClient.GetFunctionConfigurationAsync C# (CSharp) Метод

GetFunctionConfigurationAsync() публичный Метод

Initiates the asynchronous execution of the GetFunctionConfiguration operation.
public GetFunctionConfigurationAsync ( Amazon.Lambda.Model.GetFunctionConfigurationRequest request, System cancellationToken = default(CancellationToken) ) : Task
request Amazon.Lambda.Model.GetFunctionConfigurationRequest Container for the necessary parameters to execute the GetFunctionConfiguration operation.
cancellationToken System /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. ///
Результат Task
        public Task<GetFunctionConfigurationResponse> GetFunctionConfigurationAsync(GetFunctionConfigurationRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new GetFunctionConfigurationRequestMarshaller();
            var unmarshaller = GetFunctionConfigurationResponseUnmarshaller.Instance;

            return InvokeAsync<GetFunctionConfigurationRequest,GetFunctionConfigurationResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }

Same methods

AmazonLambdaClient::GetFunctionConfigurationAsync ( string functionName, System cancellationToken = default(CancellationToken) ) : Task
AmazonLambdaClient::GetFunctionConfigurationAsync ( Amazon.Lambda.Model.GetFunctionConfigurationRequest request, GetFunctionConfigurationResponse>.AmazonServiceCallback callback, AsyncOptions options = null ) : void
AmazonLambdaClient::GetFunctionConfigurationAsync ( string functionName, GetFunctionConfigurationResponse>.AmazonServiceCallback callback, AsyncOptions options = null ) : void

Usage Example

        public async Task <LambdaSizeCalculationResultItem> RunTestAsync(LambdaInvocationRequest invocationRequest)
        {
            Console.WriteLine("Starting config fetch prior to test run");

            var settings = await _client.GetFunctionConfigurationAsync(invocationRequest.FunctionName);

            var memory = settings.MemorySize;

            Console.WriteLine("Starting dry run");
            await _client.InvokeAsync(await CreateLambdaRequest(invocationRequest));

            Console.WriteLine("Starting test run # 1");
            var response = await _client.InvokeAsync(await CreateLambdaRequest(invocationRequest));

            Console.WriteLine("Starting test run # 2");
            var response2 = await _client.InvokeAsync(await CreateLambdaRequest(invocationRequest));

            if (response.StatusCode > 299 || response.StatusCode < 200)
            {
                throw new InvalidProgramException($"The Lambda which was invoked with the given payload returned with a status code not in the 200 series. The status code was '{response.StatusCode}'");
            }
            if (response2.StatusCode > 299 || response2.StatusCode < 200)
            {
                throw new InvalidProgramException($"The Lambda which was invoked with the given payload returned with a status code not in the 200 series. The status code was '{response2.StatusCode}'");
            }
            var log1 = response.LogResult;

            var item1 = ParseResultFromLog(log1, memory);

            var log2 = response2.LogResult;

            var item2 = ParseResultFromLog(log2, memory);

            var item = item2.Latency < item1.Latency ? item2 : item1;

            Console.WriteLine($"Selected best out of two test result:{item.ToString()}");

            return(item);
        }
AmazonLambdaClient