Container for the parameters to the CreateNFSFileShare operation. Creates a file share on an existing file gateway. In Storage Gateway, a file share is a file system mount point backed by Amazon S3 cloud storage. Storage Gateway exposes file shares using a Network File System (NFS) interface.
Наследование: AmazonStorageGatewayRequest
Пример #1
0
        /// <summary>
        /// Initiates the asynchronous execution of the CreateNFSFileShare operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the CreateNFSFileShare operation on AmazonStorageGatewayClient.</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 EndCreateNFSFileShare
        ///         operation.</returns>
        public IAsyncResult BeginCreateNFSFileShare(CreateNFSFileShareRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new CreateNFSFileShareRequestMarshaller();
            var unmarshaller = CreateNFSFileShareResponseUnmarshaller.Instance;

            return BeginInvoke<CreateNFSFileShareRequest>(request, marshaller, unmarshaller,
                callback, state);
        }
Пример #2
0
        /// <summary>
        /// Creates a file share on an existing file gateway. In Storage Gateway, a file share
        /// is a file system mount point backed by Amazon S3 cloud storage. Storage Gateway exposes
        /// file shares using a Network File System (NFS) interface.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the CreateNFSFileShare service method.</param>
        /// 
        /// <returns>The response from the CreateNFSFileShare service method, as returned by StorageGateway.</returns>
        /// <exception cref="Amazon.StorageGateway.Model.InternalServerErrorException">
        /// An internal server error has occurred during the request. For more information, see
        /// the error and message fields.
        /// </exception>
        /// <exception cref="Amazon.StorageGateway.Model.InvalidGatewayRequestException">
        /// An exception occurred because an invalid gateway request was issued to the service.
        /// For more information, see the error and message fields.
        /// </exception>
        public CreateNFSFileShareResponse CreateNFSFileShare(CreateNFSFileShareRequest request)
        {
            var marshaller = new CreateNFSFileShareRequestMarshaller();
            var unmarshaller = CreateNFSFileShareResponseUnmarshaller.Instance;

            return Invoke<CreateNFSFileShareRequest,CreateNFSFileShareResponse>(request, marshaller, unmarshaller);
        }
 public object Execute(ExecutorContext context)
 {
     var cmdletContext = context as CmdletContext;
     // create request
     var request = new Amazon.StorageGateway.Model.CreateNFSFileShareRequest();
     
     
      // populate CacheAttributes
     var requestCacheAttributesIsNull = true;
     request.CacheAttributes = new Amazon.StorageGateway.Model.CacheAttributes();
     System.Int32? requestCacheAttributes_cacheAttributes_CacheStaleTimeoutInSecond = null;
     if (cmdletContext.CacheAttributes_CacheStaleTimeoutInSecond != null)
     {
         requestCacheAttributes_cacheAttributes_CacheStaleTimeoutInSecond = cmdletContext.CacheAttributes_CacheStaleTimeoutInSecond.Value;
     }
     if (requestCacheAttributes_cacheAttributes_CacheStaleTimeoutInSecond != null)
     {
         request.CacheAttributes.CacheStaleTimeoutInSeconds = requestCacheAttributes_cacheAttributes_CacheStaleTimeoutInSecond.Value;
         requestCacheAttributesIsNull = false;
     }
      // determine if request.CacheAttributes should be set to null
     if (requestCacheAttributesIsNull)
     {
         request.CacheAttributes = null;
     }
     if (cmdletContext.ClientList != null)
     {
         request.ClientList = cmdletContext.ClientList;
     }
     if (cmdletContext.ClientToken != null)
     {
         request.ClientToken = cmdletContext.ClientToken;
     }
     if (cmdletContext.DefaultStorageClass != null)
     {
         request.DefaultStorageClass = cmdletContext.DefaultStorageClass;
     }
     if (cmdletContext.FileShareName != null)
     {
         request.FileShareName = cmdletContext.FileShareName;
     }
     if (cmdletContext.GatewayARN != null)
     {
         request.GatewayARN = cmdletContext.GatewayARN;
     }
     if (cmdletContext.GuessMIMETypeEnabled != null)
     {
         request.GuessMIMETypeEnabled = cmdletContext.GuessMIMETypeEnabled.Value;
     }
     if (cmdletContext.KMSEncrypted != null)
     {
         request.KMSEncrypted = cmdletContext.KMSEncrypted.Value;
     }
     if (cmdletContext.KMSKey != null)
     {
         request.KMSKey = cmdletContext.KMSKey;
     }
     if (cmdletContext.LocationARN != null)
     {
         request.LocationARN = cmdletContext.LocationARN;
     }
     
      // populate NFSFileShareDefaults
     var requestNFSFileShareDefaultsIsNull = true;
     request.NFSFileShareDefaults = new Amazon.StorageGateway.Model.NFSFileShareDefaults();
     System.String requestNFSFileShareDefaults_nFSFileShareDefaults_DirectoryMode = null;
     if (cmdletContext.NFSFileShareDefaults_DirectoryMode != null)
     {
         requestNFSFileShareDefaults_nFSFileShareDefaults_DirectoryMode = cmdletContext.NFSFileShareDefaults_DirectoryMode;
     }
     if (requestNFSFileShareDefaults_nFSFileShareDefaults_DirectoryMode != null)
     {
         request.NFSFileShareDefaults.DirectoryMode = requestNFSFileShareDefaults_nFSFileShareDefaults_DirectoryMode;
         requestNFSFileShareDefaultsIsNull = false;
     }
     System.String requestNFSFileShareDefaults_nFSFileShareDefaults_FileMode = null;
     if (cmdletContext.NFSFileShareDefaults_FileMode != null)
     {
         requestNFSFileShareDefaults_nFSFileShareDefaults_FileMode = cmdletContext.NFSFileShareDefaults_FileMode;
     }
     if (requestNFSFileShareDefaults_nFSFileShareDefaults_FileMode != null)
     {
         request.NFSFileShareDefaults.FileMode = requestNFSFileShareDefaults_nFSFileShareDefaults_FileMode;
         requestNFSFileShareDefaultsIsNull = false;
     }
     System.Int64? requestNFSFileShareDefaults_nFSFileShareDefaults_GroupId = null;
     if (cmdletContext.NFSFileShareDefaults_GroupId != null)
     {
         requestNFSFileShareDefaults_nFSFileShareDefaults_GroupId = cmdletContext.NFSFileShareDefaults_GroupId.Value;
     }
     if (requestNFSFileShareDefaults_nFSFileShareDefaults_GroupId != null)
     {
         request.NFSFileShareDefaults.GroupId = requestNFSFileShareDefaults_nFSFileShareDefaults_GroupId.Value;
         requestNFSFileShareDefaultsIsNull = false;
     }
     System.Int64? requestNFSFileShareDefaults_nFSFileShareDefaults_OwnerId = null;
     if (cmdletContext.NFSFileShareDefaults_OwnerId != null)
     {
         requestNFSFileShareDefaults_nFSFileShareDefaults_OwnerId = cmdletContext.NFSFileShareDefaults_OwnerId.Value;
     }
     if (requestNFSFileShareDefaults_nFSFileShareDefaults_OwnerId != null)
     {
         request.NFSFileShareDefaults.OwnerId = requestNFSFileShareDefaults_nFSFileShareDefaults_OwnerId.Value;
         requestNFSFileShareDefaultsIsNull = false;
     }
      // determine if request.NFSFileShareDefaults should be set to null
     if (requestNFSFileShareDefaultsIsNull)
     {
         request.NFSFileShareDefaults = null;
     }
     if (cmdletContext.ObjectACL != null)
     {
         request.ObjectACL = cmdletContext.ObjectACL;
     }
     if (cmdletContext.ReadOnly != null)
     {
         request.ReadOnly = cmdletContext.ReadOnly.Value;
     }
     if (cmdletContext.RequesterPay != null)
     {
         request.RequesterPays = cmdletContext.RequesterPay.Value;
     }
     if (cmdletContext.Role != null)
     {
         request.Role = cmdletContext.Role;
     }
     if (cmdletContext.Squash != null)
     {
         request.Squash = cmdletContext.Squash;
     }
     if (cmdletContext.Tag != null)
     {
         request.Tags = cmdletContext.Tag;
     }
     
     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;
 }
 private Amazon.StorageGateway.Model.CreateNFSFileShareResponse CallAWSServiceOperation(IAmazonStorageGateway client, Amazon.StorageGateway.Model.CreateNFSFileShareRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Storage Gateway", "CreateNFSFileShare");
     try
     {
         #if DESKTOP
         return client.CreateNFSFileShare(request);
         #elif CORECLR
         return client.CreateNFSFileShareAsync(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;
     }
 }
Пример #5
0
        /// <summary>
        /// Initiates the asynchronous execution of the CreateNFSFileShare operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the CreateNFSFileShare 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<CreateNFSFileShareResponse> CreateNFSFileShareAsync(CreateNFSFileShareRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new CreateNFSFileShareRequestMarshaller();
            var unmarshaller = CreateNFSFileShareResponseUnmarshaller.Instance;

            return InvokeAsync<CreateNFSFileShareRequest,CreateNFSFileShareResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }