public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.Lambda.Model.GetFunctionConfigurationRequest();

            if (cmdletContext.FunctionName != null)
            {
                request.FunctionName = cmdletContext.FunctionName;
            }
            if (cmdletContext.Qualifier != null)
            {
                request.Qualifier = cmdletContext.Qualifier;
            }

            CmdletOutput output;

            // issue call
            var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint);

            try
            {
                var    response       = CallAWSServiceOperation(client, request);
                object pipelineOutput = null;
                pipelineOutput = cmdletContext.Select(response, this);
                output         = new CmdletOutput
                {
                    PipelineOutput  = pipelineOutput,
                    ServiceResponse = response
                };
            }
            catch (Exception e)
            {
                output = new CmdletOutput {
                    ErrorResponse = e
                };
            }

            return(output);
        }
示例#2
0
        /// <summary>
        /// Initiates the asynchronous execution of the GetFunctionConfiguration operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the GetFunctionConfiguration operation.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// <returns>The task object representing the asynchronous operation.</returns>
        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);
        }
示例#3
0
 /// <summary>
 /// Returns the configuration information of the Lambda function. This the same information
 /// you provided as parameters when uploading the function by using <a>CreateFunction</a>.
 /// 
 ///  
 /// <para>
 /// If you are using the versioning feature, you can retrieve this information for a specific
 /// function version by using the optional <code>Qualifier</code> parameter and specifying
 /// the function version or alias that points to it. If you don't provide it, the API
 /// returns information about the $LATEST version of the function. For more information
 /// about versioning, see <a href="http://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html">AWS
 /// Lambda Function Versioning and Aliases</a>.
 /// </para>
 ///  
 /// <para>
 /// This operation requires permission for the <code>lambda:GetFunctionConfiguration</code>
 /// operation.
 /// </para>
 /// </summary>
 /// <param name="functionName">The name of the Lambda function for which you want to retrieve the configuration information.  You can specify a function name (for example, <code>Thumbnail</code>) or you can specify Amazon Resource Name (ARN) of the function (for example, <code>arn:aws:lambda:us-west-2:account-id:function:ThumbNail</code>). AWS Lambda also allows you to specify a partial ARN (for example, <code>account-id:Thumbnail</code>). Note that the length constraint applies only to the ARN. If you specify only the function name, it is limited to 64 character in length. </param>
 /// <param name="cancellationToken">
 ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
 /// </param>
 /// 
 /// <returns>The response from the GetFunctionConfiguration service method, as returned by Lambda.</returns>
 /// <exception cref="Amazon.Lambda.Model.InvalidParameterValueException">
 /// One of the parameters in the request is invalid. For example, if you provided an IAM
 /// role for AWS Lambda to assume in the <code>CreateFunction</code> or the <code>UpdateFunctionConfiguration</code>
 /// API, that AWS Lambda is unable to assume you will get this exception.
 /// </exception>
 /// <exception cref="Amazon.Lambda.Model.ResourceNotFoundException">
 /// The resource (for example, a Lambda function or access policy statement) specified
 /// in the request does not exist.
 /// </exception>
 /// <exception cref="Amazon.Lambda.Model.ServiceException">
 /// The AWS Lambda service encountered an internal error.
 /// </exception>
 /// <exception cref="Amazon.Lambda.Model.TooManyRequestsException">
 /// 
 /// </exception>
 public Task<GetFunctionConfigurationResponse> GetFunctionConfigurationAsync(string functionName, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
 {
     var request = new GetFunctionConfigurationRequest();
     request.FunctionName = functionName;
     return GetFunctionConfigurationAsync(request, cancellationToken);
 }
示例#4
0
        internal GetFunctionConfigurationResponse GetFunctionConfiguration(GetFunctionConfigurationRequest request)
        {
            var marshaller = new GetFunctionConfigurationRequestMarshaller();
            var unmarshaller = GetFunctionConfigurationResponseUnmarshaller.Instance;

            return Invoke<GetFunctionConfigurationRequest,GetFunctionConfigurationResponse>(request, marshaller, unmarshaller);
        }
 private Amazon.Lambda.Model.GetFunctionConfigurationResponse CallAWSServiceOperation(IAmazonLambda client, Amazon.Lambda.Model.GetFunctionConfigurationRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Lambda", "GetFunctionConfiguration");
     try
     {
         #if DESKTOP
         return(client.GetFunctionConfiguration(request));
         #elif CORECLR
         return(client.GetFunctionConfigurationAsync(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;
     }
 }
示例#6
0
 /// <summary>
 /// Returns the configuration information of the Lambda function. This the same information
 /// you provided as parameters when uploading the function by using <a>CreateFunction</a>.
 /// 
 ///  
 /// <para>
 /// If you are using the versioning feature, you can retrieve this information for a specific
 /// function version by using the optional <code>Qualifier</code> parameter and specifying
 /// the function version or alias that points to it. If you don't provide it, the API
 /// returns information about the $LATEST version of the function. For more information
 /// about versioning, see <a href="http://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html">AWS
 /// Lambda Function Versioning and Aliases</a>.
 /// </para>
 ///  
 /// <para>
 /// This operation requires permission for the <code>lambda:GetFunctionConfiguration</code>
 /// operation.
 /// </para>
 /// </summary>
 /// <param name="functionName">The name of the Lambda function for which you want to retrieve the configuration information.  You can specify a function name (for example, <code>Thumbnail</code>) or you can specify Amazon Resource Name (ARN) of the function (for example, <code>arn:aws:lambda:us-west-2:account-id:function:ThumbNail</code>). AWS Lambda also allows you to specify a partial ARN (for example, <code>account-id:Thumbnail</code>). Note that the length constraint applies only to the ARN. If you specify only the function name, it is limited to 64 character in length. </param>
 /// 
 /// <returns>The response from the GetFunctionConfiguration service method, as returned by Lambda.</returns>
 /// <exception cref="Amazon.Lambda.Model.InvalidParameterValueException">
 /// One of the parameters in the request is invalid. For example, if you provided an IAM
 /// role for AWS Lambda to assume in the <code>CreateFunction</code> or the <code>UpdateFunctionConfiguration</code>
 /// API, that AWS Lambda is unable to assume you will get this exception.
 /// </exception>
 /// <exception cref="Amazon.Lambda.Model.ResourceNotFoundException">
 /// The resource (for example, a Lambda function or access policy statement) specified
 /// in the request does not exist.
 /// </exception>
 /// <exception cref="Amazon.Lambda.Model.ServiceException">
 /// The AWS Lambda service encountered an internal error.
 /// </exception>
 /// <exception cref="Amazon.Lambda.Model.TooManyRequestsException">
 /// 
 /// </exception>
 public GetFunctionConfigurationResponse GetFunctionConfiguration(string functionName)
 {
     var request = new GetFunctionConfigurationRequest();
     request.FunctionName = functionName;
     return GetFunctionConfiguration(request);
 }
        /// <summary>
        /// Initiates the asynchronous execution of the GetFunctionConfiguration operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the GetFunctionConfiguration operation on AmazonLambdaClient.</param>
        /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
        /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
        ///          procedure using the AsyncState property.</param>
        /// 
        /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetFunctionConfiguration
        ///         operation.</returns>
        public IAsyncResult BeginGetFunctionConfiguration(GetFunctionConfigurationRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new GetFunctionConfigurationRequestMarshaller();
            var unmarshaller = GetFunctionConfigurationResponseUnmarshaller.Instance;

            return BeginInvoke<GetFunctionConfigurationRequest>(request, marshaller, unmarshaller,
                callback, state);
        }
示例#8
0
 /// <summary>
 /// Initiates the asynchronous execution of the GetFunctionConfiguration operation.
 /// </summary>
 /// 
 /// <param name="request">Container for the necessary parameters to execute the GetFunctionConfiguration operation on AmazonLambdaClient.</param>
 /// <param name="callback">An Action delegate that is invoked when the operation completes.</param>
 /// <param name="options">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
 ///          procedure using the AsyncState property.</param>
 public void GetFunctionConfigurationAsync(GetFunctionConfigurationRequest request, AmazonServiceCallback<GetFunctionConfigurationRequest, GetFunctionConfigurationResponse> callback, AsyncOptions options = null)
 {
     options = options == null?new AsyncOptions():options;
     var marshaller = new GetFunctionConfigurationRequestMarshaller();
     var unmarshaller = GetFunctionConfigurationResponseUnmarshaller.Instance;
     Action<AmazonWebServiceRequest, AmazonWebServiceResponse, Exception, AsyncOptions> callbackHelper = null;
     if(callback !=null )
         callbackHelper = (AmazonWebServiceRequest req, AmazonWebServiceResponse res, Exception ex, AsyncOptions ao) => { 
             AmazonServiceResult<GetFunctionConfigurationRequest,GetFunctionConfigurationResponse> responseObject 
                     = new AmazonServiceResult<GetFunctionConfigurationRequest,GetFunctionConfigurationResponse>((GetFunctionConfigurationRequest)req, (GetFunctionConfigurationResponse)res, ex , ao.State);    
                 callback(responseObject); 
         };
     BeginInvoke<GetFunctionConfigurationRequest>(request, marshaller, unmarshaller, options, callbackHelper);
 }
示例#9
0
 /// <summary>
 /// Returns the configuration information of the Lambda function. This the same information
 /// you provided as parameters when uploading the function by using <a>CreateFunction</a>.
 /// 
 ///  
 /// <para>
 /// If you are using the versioning feature, you can retrieve this information for a specific
 /// function version by using the optional <code>Qualifier</code> parameter and specifying
 /// the function version or alias that points to it. If you don't provide it, the API
 /// returns information about the $LATEST version of the function. For more information
 /// about versioning, see <a href="http://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html">AWS
 /// Lambda Function Versioning and Aliases</a>.
 /// </para>
 ///  
 /// <para>
 /// This operation requires permission for the <code>lambda:GetFunctionConfiguration</code>
 /// operation.
 /// </para>
 /// </summary>
 /// <param name="functionName">The name of the Lambda function for which you want to retrieve the configuration information.  You can specify a function name (for example, <code>Thumbnail</code>) or you can specify Amazon Resource Name (ARN) of the function (for example, <code>arn:aws:lambda:us-west-2:account-id:function:ThumbNail</code>). AWS Lambda also allows you to specify a partial ARN (for example, <code>account-id:Thumbnail</code>). Note that the length constraint applies only to the ARN. If you specify only the function name, it is limited to 64 character in length. </param>
 /// <param name="callback">An Action delegate that is invoked when the operation completes.</param>
 /// <param name="options">
 ///     A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
 ///     procedure using the AsyncState property.
 /// </param>
 /// 
 /// <returns>The response from the GetFunctionConfiguration service method, as returned by Lambda.</returns>
 /// <exception cref="Amazon.Lambda.Model.InvalidParameterValueException">
 /// One of the parameters in the request is invalid. For example, if you provided an IAM
 /// role for AWS Lambda to assume in the <code>CreateFunction</code> or the <code>UpdateFunctionConfiguration</code>
 /// API, that AWS Lambda is unable to assume you will get this exception.
 /// </exception>
 /// <exception cref="Amazon.Lambda.Model.ResourceNotFoundException">
 /// The resource (for example, a Lambda function or access policy statement) specified
 /// in the request does not exist.
 /// </exception>
 /// <exception cref="Amazon.Lambda.Model.ServiceException">
 /// The AWS Lambda service encountered an internal error.
 /// </exception>
 /// <exception cref="Amazon.Lambda.Model.TooManyRequestsException">
 /// 
 /// </exception>
 public void GetFunctionConfigurationAsync(string functionName,  AmazonServiceCallback<GetFunctionConfigurationRequest, GetFunctionConfigurationResponse> callback, AsyncOptions options = null)
 {
     var request = new GetFunctionConfigurationRequest();
     request.FunctionName = functionName;
     GetFunctionConfigurationAsync(request, callback, options);
 }