public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.Lambda.Model.GetFunctionRequest(); 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); }
/// <summary> /// Initiates the asynchronous execution of the GetFunction operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the GetFunction 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<GetFunctionResponse> GetFunctionAsync(GetFunctionRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new GetFunctionRequestMarshaller(); var unmarshaller = GetFunctionResponseUnmarshaller.Instance; return InvokeAsync<GetFunctionRequest,GetFunctionResponse>(request, marshaller, unmarshaller, cancellationToken); }
/// <summary> /// Returns the configuration information of the Lambda function and a presigned URL link /// to the .zip file you uploaded with <a>CreateFunction</a> so you can download the .zip /// file. Note that the URL is valid for up to 10 minutes. The configuration information /// is the same information you provided as parameters when uploading the function. /// /// /// <para> /// Using the optional <code>Qualifier</code> parameter, you can specify a specific function /// version for which you want this information. If you don't specify this parameter, /// the API uses unqualified function ARN which return information about the <code>$LATEST</code> /// version of the Lambda function. For more information, 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:GetFunction</code> action. /// </para> /// </summary> /// <param name="functionName">The Lambda function name. 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 GetFunction 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<GetFunctionResponse> GetFunctionAsync(string functionName, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var request = new GetFunctionRequest(); request.FunctionName = functionName; return GetFunctionAsync(request, cancellationToken); }
internal GetFunctionResponse GetFunction(GetFunctionRequest request) { var marshaller = new GetFunctionRequestMarshaller(); var unmarshaller = GetFunctionResponseUnmarshaller.Instance; return Invoke<GetFunctionRequest,GetFunctionResponse>(request, marshaller, unmarshaller); }
private Amazon.Lambda.Model.GetFunctionResponse CallAWSServiceOperation(IAmazonLambda client, Amazon.Lambda.Model.GetFunctionRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Lambda", "GetFunction"); try { #if DESKTOP return(client.GetFunction(request)); #elif CORECLR return(client.GetFunctionAsync(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; } }
/// <summary> /// Returns the configuration information of the Lambda function and a presigned URL link /// to the .zip file you uploaded with <a>CreateFunction</a> so you can download the .zip /// file. Note that the URL is valid for up to 10 minutes. The configuration information /// is the same information you provided as parameters when uploading the function. /// /// /// <para> /// Using the optional <code>Qualifier</code> parameter, you can specify a specific function /// version for which you want this information. If you don't specify this parameter, /// the API uses unqualified function ARN which return information about the <code>$LATEST</code> /// version of the Lambda function. For more information, 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:GetFunction</code> action. /// </para> /// </summary> /// <param name="functionName">The Lambda function name. 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 GetFunction 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 GetFunctionResponse GetFunction(string functionName) { var request = new GetFunctionRequest(); request.FunctionName = functionName; return GetFunction(request); }
/// <summary> /// Initiates the asynchronous execution of the GetFunction operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the GetFunction 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 EndGetFunction /// operation.</returns> public IAsyncResult BeginGetFunction(GetFunctionRequest request, AsyncCallback callback, object state) { var marshaller = new GetFunctionRequestMarshaller(); var unmarshaller = GetFunctionResponseUnmarshaller.Instance; return BeginInvoke<GetFunctionRequest>(request, marshaller, unmarshaller, callback, state); }
/// <summary> /// Initiates the asynchronous execution of the GetFunction operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the GetFunction 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 GetFunctionAsync(GetFunctionRequest request, AmazonServiceCallback<GetFunctionRequest, GetFunctionResponse> callback, AsyncOptions options = null) { options = options == null?new AsyncOptions():options; var marshaller = new GetFunctionRequestMarshaller(); var unmarshaller = GetFunctionResponseUnmarshaller.Instance; Action<AmazonWebServiceRequest, AmazonWebServiceResponse, Exception, AsyncOptions> callbackHelper = null; if(callback !=null ) callbackHelper = (AmazonWebServiceRequest req, AmazonWebServiceResponse res, Exception ex, AsyncOptions ao) => { AmazonServiceResult<GetFunctionRequest,GetFunctionResponse> responseObject = new AmazonServiceResult<GetFunctionRequest,GetFunctionResponse>((GetFunctionRequest)req, (GetFunctionResponse)res, ex , ao.State); callback(responseObject); }; BeginInvoke<GetFunctionRequest>(request, marshaller, unmarshaller, options, callbackHelper); }
/// <summary> /// Returns the configuration information of the Lambda function and a presigned URL link /// to the .zip file you uploaded with <a>CreateFunction</a> so you can download the .zip /// file. Note that the URL is valid for up to 10 minutes. The configuration information /// is the same information you provided as parameters when uploading the function. /// /// /// <para> /// Using the optional <code>Qualifier</code> parameter, you can specify a specific function /// version for which you want this information. If you don't specify this parameter, /// the API uses unqualified function ARN which return information about the <code>$LATEST</code> /// version of the Lambda function. For more information, 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:GetFunction</code> action. /// </para> /// </summary> /// <param name="functionName">The Lambda function name. 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 GetFunction 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 GetFunctionAsync(string functionName, AmazonServiceCallback<GetFunctionRequest, GetFunctionResponse> callback, AsyncOptions options = null) { var request = new GetFunctionRequest(); request.FunctionName = functionName; GetFunctionAsync(request, callback, options); }