public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.ElasticFileSystem.Model.DescribeMountTargetSecurityGroupsRequest(); if (cmdletContext.MountTargetId != null) { request.MountTargetId = cmdletContext.MountTargetId; } 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 DescribeMountTargetSecurityGroups operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeMountTargetSecurityGroups 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<DescribeMountTargetSecurityGroupsResponse> DescribeMountTargetSecurityGroupsAsync(DescribeMountTargetSecurityGroupsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DescribeMountTargetSecurityGroupsRequestMarshaller(); var unmarshaller = DescribeMountTargetSecurityGroupsResponseUnmarshaller.Instance; return InvokeAsync<DescribeMountTargetSecurityGroupsRequest,DescribeMountTargetSecurityGroupsResponse>(request, marshaller, unmarshaller, cancellationToken); }
internal DescribeMountTargetSecurityGroupsResponse DescribeMountTargetSecurityGroups(DescribeMountTargetSecurityGroupsRequest request) { var marshaller = new DescribeMountTargetSecurityGroupsRequestMarshaller(); var unmarshaller = DescribeMountTargetSecurityGroupsResponseUnmarshaller.Instance; return Invoke<DescribeMountTargetSecurityGroupsRequest,DescribeMountTargetSecurityGroupsResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Returns the security groups currently in effect for a mount target. This operation /// requires that the network interface of the mount target has been created and the life /// cycle state of the mount target is not "deleted". /// /// /// <para> /// This operation requires permissions for the following actions: /// </para> /// <ul> <li> <code>elasticfilesystem:DescribeMountTargetSecurityGroups</code> action /// on the mount target's file system. </li> <li> <code>ec2:DescribeNetworkInterfaceAttribute</code> /// action on the mount target's network interface. </li> </ul> /// </summary> /// <param name="mountTargetId">The ID of the mount target whose security groups you want to retrieve.</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 DescribeMountTargetSecurityGroups service method, as returned by ElasticFileSystem.</returns> /// <exception cref="Amazon.ElasticFileSystem.Model.BadRequestException"> /// Returned if the request is malformed or contains an error such as an invalid parameter /// value or a missing required parameter. /// </exception> /// <exception cref="Amazon.ElasticFileSystem.Model.IncorrectMountTargetStateException"> /// Returned if the mount target is not in the correct state for the operation. /// </exception> /// <exception cref="Amazon.ElasticFileSystem.Model.InternalServerErrorException"> /// Returned if an error occurred on the server side. /// </exception> /// <exception cref="Amazon.ElasticFileSystem.Model.MountTargetNotFoundException"> /// Returned if there is no mount target with the specified ID found in the caller's account. /// </exception> public Task<DescribeMountTargetSecurityGroupsResponse> DescribeMountTargetSecurityGroupsAsync(string mountTargetId, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var request = new DescribeMountTargetSecurityGroupsRequest(); request.MountTargetId = mountTargetId; return DescribeMountTargetSecurityGroupsAsync(request, cancellationToken); }
/// <summary> /// Initiates the asynchronous execution of the DescribeMountTargetSecurityGroups operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeMountTargetSecurityGroups operation on AmazonElasticFileSystemClient.</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 EndDescribeMountTargetSecurityGroups /// operation.</returns> public IAsyncResult BeginDescribeMountTargetSecurityGroups(DescribeMountTargetSecurityGroupsRequest request, AsyncCallback callback, object state) { var marshaller = new DescribeMountTargetSecurityGroupsRequestMarshaller(); var unmarshaller = DescribeMountTargetSecurityGroupsResponseUnmarshaller.Instance; return BeginInvoke<DescribeMountTargetSecurityGroupsRequest>(request, marshaller, unmarshaller, callback, state); }
/// <summary> /// Returns the security groups currently in effect for a mount target. This operation /// requires that the network interface of the mount target has been created and the life /// cycle state of the mount target is not "deleted". /// /// /// <para> /// This operation requires permissions for the following actions: /// </para> /// <ul> <li> <code>elasticfilesystem:DescribeMountTargetSecurityGroups</code> action /// on the mount target's file system. </li> <li> <code>ec2:DescribeNetworkInterfaceAttribute</code> /// action on the mount target's network interface. </li> </ul> /// </summary> /// <param name="mountTargetId">The ID of the mount target whose security groups you want to retrieve.</param> /// /// <returns>The response from the DescribeMountTargetSecurityGroups service method, as returned by ElasticFileSystem.</returns> /// <exception cref="Amazon.ElasticFileSystem.Model.BadRequestException"> /// Returned if the request is malformed or contains an error such as an invalid parameter /// value or a missing required parameter. /// </exception> /// <exception cref="Amazon.ElasticFileSystem.Model.IncorrectMountTargetStateException"> /// Returned if the mount target is not in the correct state for the operation. /// </exception> /// <exception cref="Amazon.ElasticFileSystem.Model.InternalServerErrorException"> /// Returned if an error occurred on the server side. /// </exception> /// <exception cref="Amazon.ElasticFileSystem.Model.MountTargetNotFoundException"> /// Returned if there is no mount target with the specified ID is found in the caller's /// account. /// </exception> public DescribeMountTargetSecurityGroupsResponse DescribeMountTargetSecurityGroups(string mountTargetId) { var request = new DescribeMountTargetSecurityGroupsRequest(); request.MountTargetId = mountTargetId; return DescribeMountTargetSecurityGroups(request); }
private Amazon.ElasticFileSystem.Model.DescribeMountTargetSecurityGroupsResponse CallAWSServiceOperation(IAmazonElasticFileSystem client, Amazon.ElasticFileSystem.Model.DescribeMountTargetSecurityGroupsRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Elastic File System", "DescribeMountTargetSecurityGroups"); try { #if DESKTOP return(client.DescribeMountTargetSecurityGroups(request)); #elif CORECLR return(client.DescribeMountTargetSecurityGroupsAsync(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; } }