Container for the parameters to the CreateVault operation. This operation creates a new vault with the specified name. The name of the vault must be unique within a region for an AWS account. You can create up to 1,000 vaults per account. If you need to create more vaults, contact Amazon Glacier.

You must use the following guidelines when naming a vault.

  • Names can be between 1 and 255 characters long.

  • Allowed characters are a-z, A-Z, 0-9, '_' (underscore), '-' (hyphen), and '.' (period).

This operation is idempotent.

An AWS account has full permission to perform all operations (actions). However, AWS Identity and Access Management (IAM) users don't have any permissions by default. You must grant them explicit permission to perform specific actions. For more information, see Access Control Using AWS Identity and Access Management (IAM).

For conceptual information and underlying REST API, see Creating a Vault in Amazon Glacier and Create Vault in the Amazon Glacier Developer Guide.

Inheritance: AmazonGlacierRequest
Ejemplo n.º 1
0
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.Glacier.Model.CreateVaultRequest();

            if (cmdletContext.AccountId != null)
            {
                request.AccountId = cmdletContext.AccountId;
            }
            if (cmdletContext.VaultName != null)
            {
                request.VaultName = cmdletContext.VaultName;
            }

            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);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Initiates the asynchronous execution of the CreateVault operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the CreateVault 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<CreateVaultResponse> CreateVaultAsync(CreateVaultRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new CreateVaultRequestMarshaller();
            var unmarshaller = CreateVaultResponseUnmarshaller.Instance;

            return InvokeAsync<CreateVaultRequest,CreateVaultResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }
Ejemplo n.º 3
0
        internal CreateVaultResponse CreateVault(CreateVaultRequest request)
        {
            var marshaller = new CreateVaultRequestMarshaller();
            var unmarshaller = CreateVaultResponseUnmarshaller.Instance;

            return Invoke<CreateVaultRequest,CreateVaultResponse>(request, marshaller, unmarshaller);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Initiates the asynchronous execution of the CreateVault operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the CreateVault operation on AmazonGlacierClient.</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 EndCreateVault
        ///         operation.</returns>
        public IAsyncResult BeginCreateVault(CreateVaultRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new CreateVaultRequestMarshaller();
            var unmarshaller = CreateVaultResponseUnmarshaller.Instance;

            return BeginInvoke<CreateVaultRequest>(request, marshaller, unmarshaller,
                callback, state);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Initiates the asynchronous execution of the CreateVault operation.
        /// <seealso cref="Amazon.Glacier.IAmazonGlacier.CreateVault"/>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the CreateVault 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<CreateVaultResponse> CreateVaultAsync(CreateVaultRequest request, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new CreateVaultRequestMarshaller();
            var unmarshaller = CreateVaultResponseUnmarshaller.GetInstance();
            return Invoke<IRequest, CreateVaultRequest, CreateVaultResponse>(request, marshaller, unmarshaller, signer, cancellationToken);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// <para>This operation creates a new vault with the specified name. The name of the vault must be unique within a region for an AWS account.
        /// You can create up to 1,000 vaults per account. If you need to create more vaults, contact Amazon Glacier.</para> <para>You must use the
        /// following guidelines when naming a vault. </para> <para>
        /// <ul>
        /// <li> <para> Names can be between 1 and 255 characters long. </para> </li>
        /// <li> <para>Allowed characters are a-z, A-Z, 0-9, '_' (underscore), '-' (hyphen), and '.' (period).</para> </li>
        /// 
        /// </ul>
        /// </para> <para>This operation is idempotent.</para> <para>An AWS account has full permission to perform all operations (actions). However,
        /// AWS Identity and Access Management (IAM) users don't have any permissions by default. You must grant them explicit permission to perform
        /// specific actions. For more information, see <a href="http://docs.aws.amazon.com/amazonglacier/latest/dev/using-iam-with-amazon-glacier.html">Access Control Using AWS Identity and Access Management (IAM)</a> .</para> <para> For conceptual information and underlying REST API, go to
        /// <a href="http://docs.aws.amazon.com/amazonglacier/latest/dev/creating-vaults.html">Creating a Vault in Amazon Glacier</a> and <a href="http://docs.aws.amazon.com/amazonglacier/latest/dev/api-vault-put.html">Create Vault </a> in the <i>Amazon Glacier Developer
        /// Guide</i> .
        /// </para>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the CreateVault service method on AmazonGlacier.</param>
        /// 
        /// <returns>The response from the CreateVault service method, as returned by AmazonGlacier.</returns>
        /// 
        /// <exception cref="T:Amazon.Glacier.Model.MissingParameterValueException" />
        /// <exception cref="T:Amazon.Glacier.Model.ServiceUnavailableException" />
        /// <exception cref="T:Amazon.Glacier.Model.InvalidParameterValueException" />
        /// <exception cref="T:Amazon.Glacier.Model.LimitExceededException" />
		public CreateVaultResponse CreateVault(CreateVaultRequest request)
        {
            var task = CreateVaultAsync(request);
            try
            {
                return task.Result;
            }
            catch(AggregateException e)
            {
                ExceptionDispatchInfo.Capture(e.InnerException).Throw();
                return null;
            }
        }
Ejemplo n.º 7
0
 /// <summary>
 /// Creates a vault.
 /// </summary>
 /// <param name="vaultName">The name of the vault to create.</param>
 public void CreateVault(string vaultName)
 {
     CreateVaultRequest request = new CreateVaultRequest() { VaultName = vaultName };
     request.BeforeRequestEvent += new UserAgentPostFix("CreateVault").UserAgentRequestEventHandlerSync;
     this.glacierClient.CreateVault(request);
 }
Ejemplo n.º 8
0
 /// <summary>
 /// <para>This operation creates a new vault with the specified name. The name of the vault must be unique within a region for an AWS account.
 /// You can create up to 1,000 vaults per account. If you need to create more vaults, contact Amazon Glacier.</para> <para>You must use the
 /// following guidelines when naming a vault. </para> <para>
 /// <ul>
 /// <li> <para> Names can be between 1 and 255 characters long. </para> </li>
 /// <li> <para>Allowed characters are a-z, A-Z, 0-9, '_' (underscore), '-' (hyphen), and '.' (period).</para> </li>
 /// 
 /// </ul>
 /// </para> <para>This operation is idempotent.</para> <para>An AWS account has full permission to perform all operations (actions). However,
 /// AWS Identity and Access Management (IAM) users don't have any permissions by default. You must grant them explicit permission to perform
 /// specific actions. For more information, see Access Control Using AWS Identity and Access Management (IAM).</para> <para> For conceptual
 /// information and underlying REST API, go to Creating a Vault in Amazon Glacier and Create Vault in the <i>Amazon Glacier Developer Guide</i>
 /// .
 /// </para>
 /// </summary>
 /// 
 /// <param name="createVaultRequest">Container for the necessary parameters to execute the CreateVault service method on AmazonGlacier.</param>
 /// 
 /// <returns>The response from the CreateVault service method, as returned by AmazonGlacier.</returns>
 /// 
 /// <exception cref="MissingParameterValueException"/>
 /// <exception cref="ServiceUnavailableException"/>
 /// <exception cref="InvalidParameterValueException"/>
 /// <exception cref="LimitExceededException"/>
 public CreateVaultResponse CreateVault(CreateVaultRequest createVaultRequest)
 {
     IAsyncResult asyncResult = invokeCreateVault(createVaultRequest, null, null, true);
     return EndCreateVault(asyncResult);
 }
Ejemplo n.º 9
0
 /// <summary>
 /// Initiates the asynchronous execution of the CreateVault operation.
 /// <seealso cref="Amazon.Glacier.AmazonGlacier.CreateVault"/>
 /// </summary>
 /// 
 /// <param name="createVaultRequest">Container for the necessary parameters to execute the CreateVault operation on AmazonGlacier.</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 EndCreateVault
 ///         operation.</returns>
 public IAsyncResult BeginCreateVault(CreateVaultRequest createVaultRequest, AsyncCallback callback, object state)
 {
     return invokeCreateVault(createVaultRequest, callback, state, false);
 }
Ejemplo n.º 10
0
 IAsyncResult invokeCreateVault(CreateVaultRequest createVaultRequest, AsyncCallback callback, object state, bool synchronized)
 {
     IRequest irequest = new CreateVaultRequestMarshaller().Marshall(createVaultRequest);
     var unmarshaller = CreateVaultResponseUnmarshaller.GetInstance();
     AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller);
     Invoke(result);
     return result;
 }
        private CreateVaultRequest CreateVaultRequest(DeveloperOptions devOptions)
        {
            var request = new CreateVaultRequest()
            {
                // TODO - need to determine where defaults are used, and then not create the constructor where value is null (to use default)

                // These are required values.
                AccountId = devOptions.AccountId,
                VaultName = devOptions.VaultName
            };
            return request;
        }
Ejemplo n.º 12
0
        /// <summary>
        /// <para>This operation creates a new vault with the specified name. The name of the vault must be unique within a region for an AWS account.
        /// You can create up to 1,000 vaults per account. If you need to create more vaults, contact Amazon Glacier.</para> <para>You must use the
        /// following guidelines when naming a vault. </para> <para>
        /// <ul>
        /// <li> <para> Names can be between 1 and 255 characters long. </para> </li>
        /// <li> <para>Allowed characters are a-z, A-Z, 0-9, '_' (underscore), '-' (hyphen), and '.' (period).</para> </li>
        /// 
        /// </ul>
        /// </para> <para>This operation is idempotent.</para> <para>An AWS account has full permission to perform all operations (actions). However,
        /// AWS Identity and Access Management (IAM) users don't have any permissions by default. You must grant them explicit permission to perform
        /// specific actions. For more information, see <a href="http://docs.aws.amazon.com/amazonglacier/latest/dev/using-iam-with-amazon-glacier.html">Access Control Using AWS Identity and Access Management (IAM)</a> .</para> <para> For conceptual information and underlying REST API, go to
        /// <a href="http://docs.aws.amazon.com/amazonglacier/latest/dev/creating-vaults.html">Creating a Vault in Amazon Glacier</a> and <a href="http://docs.aws.amazon.com/amazonglacier/latest/dev/api-vault-put.html">Create Vault </a> in the <i>Amazon Glacier Developer
        /// Guide</i> .
        /// </para>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the CreateVault service method on AmazonGlacier.</param>
        /// 
        /// <returns>The response from the CreateVault service method, as returned by AmazonGlacier.</returns>
        /// 
        /// <exception cref="T:Amazon.Glacier.Model.MissingParameterValueException" />
        /// <exception cref="T:Amazon.Glacier.Model.ServiceUnavailableException" />
        /// <exception cref="T:Amazon.Glacier.Model.InvalidParameterValueException" />
        /// <exception cref="T:Amazon.Glacier.Model.LimitExceededException" />
		public CreateVaultResponse CreateVault(CreateVaultRequest request)
        {
            var task = CreateVaultAsync(request);
            try
            {
                return task.Result;
            }
            catch(AggregateException e)
            {
                throw e.InnerException;
            }
        }
Ejemplo n.º 13
0
        /// <summary>
        /// Initiates the asynchronous execution of the CreateVault operation.
        /// <seealso cref="Amazon.Glacier.IAmazonGlacier.CreateVault"/>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the CreateVault 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 async Task<CreateVaultResponse> CreateVaultAsync(CreateVaultRequest request, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new CreateVaultRequestMarshaller();
            var unmarshaller = CreateVaultResponseUnmarshaller.GetInstance();
            var response = await Invoke<IRequest, CreateVaultRequest, CreateVaultResponse>(request, marshaller, unmarshaller, signer, cancellationToken)
                .ConfigureAwait(continueOnCapturedContext: false);
            return response;
        }
Ejemplo n.º 14
0
 private Amazon.Glacier.Model.CreateVaultResponse CallAWSServiceOperation(IAmazonGlacier client, Amazon.Glacier.Model.CreateVaultRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Glacier", "CreateVault");
     try
     {
         #if DESKTOP
         return(client.CreateVault(request));
         #elif CORECLR
         return(client.CreateVaultAsync(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;
     }
 }
Ejemplo n.º 15
0
 /// <summary>
 /// Creates a vault.
 /// </summary>
 /// <param name="vaultName">The name of the vault to create.</param>
 public void CreateVault(string vaultName)
 {
     CreateVaultRequest request = new CreateVaultRequest() { VaultName = vaultName };
     ((Amazon.Runtime.Internal.IAmazonWebServiceRequest)request).AddBeforeRequestHandler(new UserAgentPostFix("CreateVault").UserAgentRequestEventHandlerSync);
     this.glacierClient.CreateVault(request);
 }