Container for the parameters to the CreateFileSystem operation. Creates a new, empty file system. The operation requires a creation token in the request that Amazon EFS uses to ensure idempotent creation (calling the operation with same creation token has no effect). If a file system does not currently exist that is owned by the caller's AWS account with the specified creation token, this operation does the following:
  • Creates a new, empty file system. The file system will have an Amazon EFS assigned ID, and an initial lifecycle state creating.

  • Returns with the description of the created file system.

Otherwise, this operation returns a FileSystemAlreadyExists error with the ID of the existing file system.

For basic use cases, you can use a randomly generated UUID for the creation token.

The idempotent operation allows you to retry a CreateFileSystem call without risk of creating an extra file system. This can happen when an initial call fails in a way that leaves it uncertain whether or not a file system was actually created. An example might be that a transport level timeout occurred or your connection was reset. As long as you use the same creation token, if the initial call had succeeded in creating a file system, the client can learn of its existence from the FileSystemAlreadyExists error.

The CreateFileSystem call returns while the file system's lifecycle state is still creating. You can check the file system creation status by calling the DescribeFileSystems operation, which among other things returns the file system state.

This operation also takes an optional PerformanceMode parameter that you choose for your file system. We recommend generalPurpose performance mode for most file systems. File systems using the maxIO performance mode can scale to higher levels of aggregate throughput and operations per second with a tradeoff of slightly higher latencies for most file operations. The performance mode can't be changed after the file system has been created. For more information, see Amazon EFS: Performance Modes.

After the file system is fully created, Amazon EFS sets its lifecycle state to available, at which point you can create one or more mount targets for the file system in your VPC. For more information, see CreateMountTarget. You mount your Amazon EFS file system on an EC2 instances in your VPC via the mount target. For more information, see Amazon EFS: How it Works.

This operation requires permissions for the elasticfilesystem:CreateFileSystem action.

Inheritance: AmazonElasticFileSystemRequest
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.ElasticFileSystem.Model.CreateFileSystemRequest();

            if (cmdletContext.CreationToken != null)
            {
                request.CreationToken = cmdletContext.CreationToken;
            }
            if (cmdletContext.Encrypted != null)
            {
                request.Encrypted = cmdletContext.Encrypted.Value;
            }
            if (cmdletContext.KmsKeyId != null)
            {
                request.KmsKeyId = cmdletContext.KmsKeyId;
            }
            if (cmdletContext.PerformanceMode != null)
            {
                request.PerformanceMode = cmdletContext.PerformanceMode;
            }
            if (cmdletContext.ProvisionedThroughputInMibp != null)
            {
                request.ProvisionedThroughputInMibps = cmdletContext.ProvisionedThroughputInMibp.Value;
            }
            if (cmdletContext.Tag != null)
            {
                request.Tags = cmdletContext.Tag;
            }
            if (cmdletContext.ThroughputMode != null)
            {
                request.ThroughputMode = cmdletContext.ThroughputMode;
            }

            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
 private Amazon.ElasticFileSystem.Model.CreateFileSystemResponse CallAWSServiceOperation(IAmazonElasticFileSystem client, Amazon.ElasticFileSystem.Model.CreateFileSystemRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Elastic File System", "CreateFileSystem");
     try
     {
         #if DESKTOP
         return(client.CreateFileSystem(request));
         #elif CORECLR
         return(client.CreateFileSystemAsync(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>
        /// Initiates the asynchronous execution of the CreateFileSystem operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the CreateFileSystem 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<CreateFileSystemResponse> CreateFileSystemAsync(CreateFileSystemRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new CreateFileSystemRequestMarshaller();
            var unmarshaller = CreateFileSystemResponseUnmarshaller.Instance;

            return InvokeAsync<CreateFileSystemRequest,CreateFileSystemResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }
        internal CreateFileSystemResponse CreateFileSystem(CreateFileSystemRequest request)
        {
            var marshaller = new CreateFileSystemRequestMarshaller();
            var unmarshaller = CreateFileSystemResponseUnmarshaller.Instance;

            return Invoke<CreateFileSystemRequest,CreateFileSystemResponse>(request, marshaller, unmarshaller);
        }
 /// <summary>
 /// Creates a new, empty file system. The operation requires a creation token in the
 /// request that Amazon EFS uses to ensure idempotent creation (calling the operation
 /// with same creation token has no effect). If a file system does not currently exist
 /// that is owned by the caller's AWS account with the specified creation token, this
 /// operation does the following: 
 /// 
 ///  <ul> <li>Creates a new, empty file system. The file system will have an Amazon EFS
 /// assigned ID, and an initial lifecycle state "creating". </li> <li> Returns with the
 /// description of the created file system. </li> </ul> 
 /// <para>
 /// Otherwise, this operation returns a <code>FileSystemAlreadyExists</code> error with
 /// the ID of the existing file system.
 /// </para>
 ///  <note>For basic use cases, you can use a randomly generated UUID for the creation
 /// token.</note> 
 /// <para>
 ///  The idempotent operation allows you to retry a <code>CreateFileSystem</code> call
 /// without risk of creating an extra file system. This can happen when an initial call
 /// fails in a way that leaves it uncertain whether or not a file system was actually
 /// created. An example might be that a transport level timeout occurred or your connection
 /// was reset. As long as you use the same creation token, if the initial call had succeeded
 /// in creating a file system, the client can learn of its existence from the <code>FileSystemAlreadyExists</code>
 /// error. 
 /// </para>
 ///  <note>The <code>CreateFileSystem</code> call returns while the file system's lifecycle
 /// state is still "creating". You can check the file system creation status by calling
 /// the <a>DescribeFileSystems</a> API, which among other things returns the file system
 /// state.</note> 
 /// <para>
 ///  After the file system is fully created, Amazon EFS sets its lifecycle state to "available",
 /// at which point you can create one or more mount targets for the file system (<a>CreateMountTarget</a>)
 /// in your VPC. You mount your Amazon EFS file system on an EC2 instances in your VPC
 /// via the mount target. For more information, see <a href="http://docs.aws.amazon.com/efs/latest/ug/how-it-works.html">Amazon
 /// EFS: How it Works</a> 
 /// </para>
 ///  
 /// <para>
 ///  This operation requires permission for the <code>elasticfilesystem:CreateFileSystem</code>
 /// action. 
 /// </para>
 /// </summary>
 /// <param name="creationToken">String of up to 64 ASCII characters. Amazon EFS uses this to ensure idempotent creation.</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 CreateFileSystem 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.FileSystemAlreadyExistsException">
 /// Returned if the file system you are trying to create already exists, with the creation
 /// token you provided.
 /// </exception>
 /// <exception cref="Amazon.ElasticFileSystem.Model.FileSystemLimitExceededException">
 /// Returned if the AWS account has already created maximum number of file systems allowed
 /// per account.
 /// </exception>
 /// <exception cref="Amazon.ElasticFileSystem.Model.InternalServerErrorException">
 /// Returned if an error occurred on the server side.
 /// </exception>
 public Task<CreateFileSystemResponse> CreateFileSystemAsync(string creationToken, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
 {
     var request = new CreateFileSystemRequest();
     request.CreationToken = creationToken;
     return CreateFileSystemAsync(request, cancellationToken);
 }
        /// <summary>
        /// Initiates the asynchronous execution of the CreateFileSystem operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the CreateFileSystem 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 EndCreateFileSystem
        ///         operation.</returns>
        public IAsyncResult BeginCreateFileSystem(CreateFileSystemRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new CreateFileSystemRequestMarshaller();
            var unmarshaller = CreateFileSystemResponseUnmarshaller.Instance;

            return BeginInvoke<CreateFileSystemRequest>(request, marshaller, unmarshaller,
                callback, state);
        }
 /// <summary>
 /// Creates a new, empty file system. The operation requires a creation token in the
 /// request that Amazon EFS uses to ensure idempotent creation (calling the operation
 /// with same creation token has no effect). If a file system does not currently exist
 /// that is owned by the caller's AWS account with the specified creation token, this
 /// operation does the following: 
 /// 
 ///  <ul> <li>Creates a new, empty file system. The file system will have an Amazon EFS
 /// assigned ID, and an initial lifecycle state "creating". </li> <li> Returns with the
 /// description of the created file system. </li> </ul> 
 /// <para>
 /// Otherwise, this operation returns a <code>FileSystemAlreadyExists</code> error with
 /// the ID of the existing file system.
 /// </para>
 ///  <note>For basic use cases, you can use a randomly generated UUID for the creation
 /// token.</note> 
 /// <para>
 ///  The idempotent operation allows you to retry a <code>CreateFileSystem</code> call
 /// without risk of creating an extra file system. This can happen when an initial call
 /// fails in a way that leaves it uncertain whether or not a file system was actually
 /// created. An example might be that a transport level timeout occurred or your connection
 /// was reset. As long as you use the same creation token, if the initial call had succeeded
 /// in creating a file system, the client can learn of its existence from the <code>FileSystemAlreadyExists</code>
 /// error. 
 /// </para>
 ///  <note>The <code>CreateFileSystem</code> call returns while the file system's lifecycle
 /// state is still "creating". You can check the file system creation status by calling
 /// the <a>DescribeFileSystems</a> API, which among other things returns the file system
 /// state.</note> 
 /// <para>
 ///  After the file system is fully created, Amazon EFS sets its lifecycle state to "available",
 /// at which point you can create one or more mount targets for the file system (<a>CreateMountTarget</a>)
 /// in your VPC. You mount your Amazon EFS file system on an EC2 instances in your VPC
 /// via the mount target. For more information, see <a href="http://docs.aws.amazon.com/efs/latest/ug/how-it-works.html">Amazon
 /// EFS: How it Works</a> 
 /// </para>
 ///  
 /// <para>
 ///  This operation requires permission for the <code>elasticfilesystem:CreateFileSystem</code>
 /// action. 
 /// </para>
 /// </summary>
 /// <param name="creationToken">String of up to 64 ASCII characters. Amazon EFS uses this to ensure idempotent creation.</param>
 /// 
 /// <returns>The response from the CreateFileSystem 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.FileSystemAlreadyExistsException">
 /// Returned if the file system you are trying to create already exists, with the creation
 /// token you provided.
 /// </exception>
 /// <exception cref="Amazon.ElasticFileSystem.Model.FileSystemLimitExceededException">
 /// Returned if the AWS account has already created maximum number of file systems allowed
 /// per account.
 /// </exception>
 /// <exception cref="Amazon.ElasticFileSystem.Model.InternalServerErrorException">
 /// Returned if an error occurred on the server side.
 /// </exception>
 public CreateFileSystemResponse CreateFileSystem(string creationToken)
 {
     var request = new CreateFileSystemRequest();
     request.CreationToken = creationToken;
     return CreateFileSystem(request);
 }