Container for the parameters to the CreateDBInstance operation.

Creates a new DB instance.

Наследование: AmazonRDSRequest
        public DBInstance CreateDatabase(CreateDBInstanceRequest request)
        {
            CreateDBInstanceResponse response = Client.CreateDBInstance(request);

            if (response.CreateDBInstanceResult!=null)
            {
                return response.CreateDBInstanceResult.DBInstance;
            }
            throw new Exception("Failed to get CreateDBInstanceResult response");
        }
 /// <summary>
 /// Initiates the asynchronous execution of the CreateDBInstance operation.
 /// <seealso cref="Amazon.RDS.AmazonRDS.CreateDBInstance"/>
 /// </summary>
 /// 
 /// <param name="createDBInstanceRequest">Container for the necessary parameters to execute the CreateDBInstance operation on AmazonRDS.</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 EndCreateDBInstance
 ///         operation.</returns>
 public IAsyncResult BeginCreateDBInstance(CreateDBInstanceRequest createDBInstanceRequest, AsyncCallback callback, object state)
 {
     return invokeCreateDBInstance(createDBInstanceRequest, callback, state, false);
 }
 IAsyncResult invokeCreateDBInstance(CreateDBInstanceRequest createDBInstanceRequest, AsyncCallback callback, object state, bool synchronized)
 {
     IRequest irequest = new CreateDBInstanceRequestMarshaller().Marshall(createDBInstanceRequest);
     var unmarshaller = CreateDBInstanceResponseUnmarshaller.GetInstance();
     AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller);
     Invoke(result);
     return result;
 }
 /// <summary>
 /// <para> Creates a new DB instance. </para>
 /// </summary>
 /// 
 /// <param name="createDBInstanceRequest">Container for the necessary parameters to execute the CreateDBInstance service method on
 ///          AmazonRDS.</param>
 /// 
 /// <returns>The response from the CreateDBInstance service method, as returned by AmazonRDS.</returns>
 /// 
 /// <exception cref="DBParameterGroupNotFoundException"/>
 /// <exception cref="InstanceQuotaExceededException"/>
 /// <exception cref="DBSubnetGroupNotFoundException"/>
 /// <exception cref="DBInstanceAlreadyExistsException"/>
 /// <exception cref="StorageQuotaExceededException"/>
 /// <exception cref="InvalidVPCNetworkStateException"/>
 /// <exception cref="DBSecurityGroupNotFoundException"/>
 /// <exception cref="InsufficientDBInstanceCapacityException"/>
 /// <exception cref="DBSubnetGroupDoesNotCoverEnoughAZsException"/>
 /// <exception cref="InvalidSubnetException"/>
 /// <exception cref="OptionGroupNotFoundException"/>
 /// <exception cref="ProvisionedIopsNotAvailableInAZException"/>
 public CreateDBInstanceResponse CreateDBInstance(CreateDBInstanceRequest createDBInstanceRequest)
 {
     IAsyncResult asyncResult = invokeCreateDBInstance(createDBInstanceRequest, null, null, true);
     return EndCreateDBInstance(asyncResult);
 }
Пример #5
0
        /// <summary>
        /// Initiates the asynchronous execution of the CreateDBInstance operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the CreateDBInstance 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<CreateDBInstanceResponse> CreateDBInstanceAsync(CreateDBInstanceRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new CreateDBInstanceRequestMarshaller();
            var unmarshaller = CreateDBInstanceResponseUnmarshaller.Instance;

            return InvokeAsync<CreateDBInstanceRequest,CreateDBInstanceResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }
Пример #6
0
        /// <summary>
        /// Creates a new DB instance.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the CreateDBInstance service method.</param>
        /// 
        /// <returns>The response from the CreateDBInstance service method, as returned by RDS.</returns>
        /// <exception cref="Amazon.RDS.Model.AuthorizationNotFoundException">
        /// Specified CIDRIP or EC2 security group is not authorized for the specified DB security
        /// group. 
        /// 
        ///  
        /// <para>
        /// RDS may not also be authorized via IAM to perform necessary actions on your behalf.
        /// </para>
        /// </exception>
        /// <exception cref="Amazon.RDS.Model.DBClusterNotFoundException">
        /// <i>DBClusterIdentifier</i> does not refer to an existing DB cluster.
        /// </exception>
        /// <exception cref="Amazon.RDS.Model.DBInstanceAlreadyExistsException">
        /// User already has a DB instance with the given identifier.
        /// </exception>
        /// <exception cref="Amazon.RDS.Model.DBParameterGroupNotFoundException">
        /// <i>DBParameterGroupName</i> does not refer to an existing DB parameter group.
        /// </exception>
        /// <exception cref="Amazon.RDS.Model.DBSecurityGroupNotFoundException">
        /// <i>DBSecurityGroupName</i> does not refer to an existing DB security group.
        /// </exception>
        /// <exception cref="Amazon.RDS.Model.DBSubnetGroupDoesNotCoverEnoughAZsException">
        /// Subnets in the DB subnet group should cover at least two Availability Zones unless
        /// there is only one Availability Zone.
        /// </exception>
        /// <exception cref="Amazon.RDS.Model.DBSubnetGroupNotFoundException">
        /// <i>DBSubnetGroupName</i> does not refer to an existing DB subnet group.
        /// </exception>
        /// <exception cref="Amazon.RDS.Model.InstanceQuotaExceededException">
        /// Request would result in user exceeding the allowed number of DB instances.
        /// </exception>
        /// <exception cref="Amazon.RDS.Model.InsufficientDBInstanceCapacityException">
        /// Specified DB instance class is not available in the specified Availability Zone.
        /// </exception>
        /// <exception cref="Amazon.RDS.Model.InvalidDBClusterStateException">
        /// The supplied value is not a valid DB cluster state.
        /// </exception>
        /// <exception cref="Amazon.RDS.Model.InvalidSubnetException">
        /// The requested subnet is invalid, or multiple subnets were requested that are not
        /// all in a common VPC.
        /// </exception>
        /// <exception cref="Amazon.RDS.Model.InvalidVPCNetworkStateException">
        /// DB subnet group does not cover all Availability Zones after it is created because
        /// users' change.
        /// </exception>
        /// <exception cref="Amazon.RDS.Model.KMSKeyNotAccessibleException">
        /// Error accessing KMS key.
        /// </exception>
        /// <exception cref="Amazon.RDS.Model.OptionGroupNotFoundException">
        /// The specified option group could not be found.
        /// </exception>
        /// <exception cref="Amazon.RDS.Model.ProvisionedIopsNotAvailableInAZException">
        /// Provisioned IOPS not available in the specified Availability Zone.
        /// </exception>
        /// <exception cref="Amazon.RDS.Model.StorageQuotaExceededException">
        /// Request would result in user exceeding the allowed amount of storage available across
        /// all DB instances.
        /// </exception>
        /// <exception cref="Amazon.RDS.Model.StorageTypeNotSupportedException">
        /// <i>StorageType</i> specified cannot be associated with the DB Instance.
        /// </exception>
        public CreateDBInstanceResponse CreateDBInstance(CreateDBInstanceRequest request)
        {
            var marshaller = new CreateDBInstanceRequestMarshaller();
            var unmarshaller = CreateDBInstanceResponseUnmarshaller.Instance;

            return Invoke<CreateDBInstanceRequest,CreateDBInstanceResponse>(request, marshaller, unmarshaller);
        }
Пример #7
0
        /// <summary>
        /// Initiates the asynchronous execution of the CreateDBInstance operation.
        /// <seealso cref="Amazon.RDS.IAmazonRDS.CreateDBInstance"/>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the CreateDBInstance 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<CreateDBInstanceResponse> CreateDBInstanceAsync(CreateDBInstanceRequest request, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new CreateDBInstanceRequestMarshaller();
            var unmarshaller = CreateDBInstanceResponseUnmarshaller.GetInstance();
            return Invoke<IRequest, CreateDBInstanceRequest, CreateDBInstanceResponse>(request, marshaller, unmarshaller, signer, cancellationToken);
        }
Пример #8
0
        /// <summary>
        /// <para> Creates a new DB instance. </para>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the CreateDBInstance service method on
        /// AmazonRDS.</param>
        /// 
        /// <returns>The response from the CreateDBInstance service method, as returned by AmazonRDS.</returns>
        /// 
        /// <exception cref="T:Amazon.RDS.Model.DBParameterGroupNotFoundException" />
        /// <exception cref="T:Amazon.RDS.Model.InstanceQuotaExceededException" />
        /// <exception cref="T:Amazon.RDS.Model.DBSubnetGroupNotFoundException" />
        /// <exception cref="T:Amazon.RDS.Model.DBInstanceAlreadyExistsException" />
        /// <exception cref="T:Amazon.RDS.Model.StorageQuotaExceededException" />
        /// <exception cref="T:Amazon.RDS.Model.InvalidVPCNetworkStateException" />
        /// <exception cref="T:Amazon.RDS.Model.DBSecurityGroupNotFoundException" />
        /// <exception cref="T:Amazon.RDS.Model.InsufficientDBInstanceCapacityException" />
        /// <exception cref="T:Amazon.RDS.Model.DBSubnetGroupDoesNotCoverEnoughAZsException" />
        /// <exception cref="T:Amazon.RDS.Model.InvalidSubnetException" />
        /// <exception cref="T:Amazon.RDS.Model.OptionGroupNotFoundException" />
        /// <exception cref="T:Amazon.RDS.Model.ProvisionedIopsNotAvailableInAZException" />
		public CreateDBInstanceResponse CreateDBInstance(CreateDBInstanceRequest request)
        {
            var task = CreateDBInstanceAsync(request);
            try
            {
                return task.Result;
            }
            catch(AggregateException e)
            {
                ExceptionDispatchInfo.Capture(e.InnerException).Throw();
                return null;
            }
        }
        private Task CreateDatabase()
        {
            var request = new CreateDBInstanceRequest
            {
                Engine = "postgres",
                EngineVersion = "9.4.5",
                DBInstanceClass = _context.Settings.Database.InstanceClass,
                AllocatedStorage = 5,
                PubliclyAccessible = true,
                BackupRetentionPeriod = _context.Settings.Database.BackupRetentionPeriod,
                MasterUsername = _context.Settings.Database.MasterUserName,
                MasterUserPassword = _context.Settings.Database.MasterUserPassword,
                DBName = _context.Settings.Database.Name,
                DBInstanceIdentifier = _context.Settings.Database.Name
            };

            return _client.CreateDBInstanceAsync(request);
        }
Пример #10
0
        /// <summary>
        /// <para> Creates a new DB instance. </para>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the CreateDBInstance service method on
        /// AmazonRDS.</param>
        /// 
        /// <returns>The response from the CreateDBInstance service method, as returned by AmazonRDS.</returns>
        /// 
        /// <exception cref="T:Amazon.RDS.Model.DBParameterGroupNotFoundException" />
        /// <exception cref="T:Amazon.RDS.Model.InstanceQuotaExceededException" />
        /// <exception cref="T:Amazon.RDS.Model.DBSubnetGroupNotFoundException" />
        /// <exception cref="T:Amazon.RDS.Model.DBInstanceAlreadyExistsException" />
        /// <exception cref="T:Amazon.RDS.Model.StorageQuotaExceededException" />
        /// <exception cref="T:Amazon.RDS.Model.InvalidVPCNetworkStateException" />
        /// <exception cref="T:Amazon.RDS.Model.DBSecurityGroupNotFoundException" />
        /// <exception cref="T:Amazon.RDS.Model.InsufficientDBInstanceCapacityException" />
        /// <exception cref="T:Amazon.RDS.Model.DBSubnetGroupDoesNotCoverEnoughAZsException" />
        /// <exception cref="T:Amazon.RDS.Model.InvalidSubnetException" />
        /// <exception cref="T:Amazon.RDS.Model.OptionGroupNotFoundException" />
        /// <exception cref="T:Amazon.RDS.Model.ProvisionedIopsNotAvailableInAZException" />
		public CreateDBInstanceResponse CreateDBInstance(CreateDBInstanceRequest request)
        {
            var task = CreateDBInstanceAsync(request);
            try
            {
                return task.Result;
            }
            catch(AggregateException e)
            {
                throw e.InnerException;
            }
        }
Пример #11
0
        /// <summary>
        /// <para> Creates a new DB instance. </para>
        /// </summary>
        /// 
        /// <param name="createDBInstanceRequest">Container for the necessary parameters to execute the CreateDBInstance service method on
        /// AmazonRDS.</param>
        /// 
        /// <returns>The response from the CreateDBInstance service method, as returned by AmazonRDS.</returns>
        /// 
        /// <exception cref="T:Amazon.RDS.Model.DBParameterGroupNotFoundException" />
        /// <exception cref="T:Amazon.RDS.Model.InstanceQuotaExceededException" />
        /// <exception cref="T:Amazon.RDS.Model.DBSubnetGroupNotFoundException" />
        /// <exception cref="T:Amazon.RDS.Model.DBInstanceAlreadyExistsException" />
        /// <exception cref="T:Amazon.RDS.Model.StorageQuotaExceededException" />
        /// <exception cref="T:Amazon.RDS.Model.InvalidVPCNetworkStateException" />
        /// <exception cref="T:Amazon.RDS.Model.DBSecurityGroupNotFoundException" />
        /// <exception cref="T:Amazon.RDS.Model.InsufficientDBInstanceCapacityException" />
        /// <exception cref="T:Amazon.RDS.Model.DBSubnetGroupDoesNotCoverEnoughAZsException" />
        /// <exception cref="T:Amazon.RDS.Model.InvalidSubnetException" />
        /// <exception cref="T:Amazon.RDS.Model.OptionGroupNotFoundException" />
        /// <exception cref="T:Amazon.RDS.Model.ProvisionedIopsNotAvailableInAZException" />
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
		public async Task<CreateDBInstanceResponse> CreateDBInstanceAsync(CreateDBInstanceRequest createDBInstanceRequest, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new CreateDBInstanceRequestMarshaller();
            var unmarshaller = CreateDBInstanceResponseUnmarshaller.GetInstance();
            var response = await Invoke<IRequest, CreateDBInstanceRequest, CreateDBInstanceResponse>(createDBInstanceRequest, marshaller, unmarshaller, signer, cancellationToken)
                .ConfigureAwait(continueOnCapturedContext: false);
            return response;
        }
Пример #12
0
        /// <summary>
        /// Initiates the asynchronous execution of the CreateDBInstance operation.
        /// <seealso cref="Amazon.RDS.IAmazonRDS"/>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the CreateDBInstance operation on AmazonRDSClient.</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 EndCreateDBInstance
        ///         operation.</returns>
        public IAsyncResult BeginCreateDBInstance(CreateDBInstanceRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new CreateDBInstanceRequestMarshaller();
            var unmarshaller = CreateDBInstanceResponseUnmarshaller.Instance;

            return BeginInvoke<CreateDBInstanceRequest>(request, marshaller, unmarshaller,
                callback, state);
        }
 protected override void ProcessRecord()
 {
     AmazonRDS client = base.GetClient();
     Amazon.RDS.Model.CreateDBInstanceRequest request = new Amazon.RDS.Model.CreateDBInstanceRequest();
     request.DBName = this._DBName;
     request.DBInstanceIdentifier = this._DBInstanceIdentifier;
     request.AllocatedStorage = this._AllocatedStorage;
     request.DBInstanceClass = this._DBInstanceClass;
     request.Engine = this._Engine;
     request.MasterUsername = this._MasterUsername;
     request.MasterUserPassword = this._MasterUserPassword;
     if (string.IsNullOrEmpty(this._DBSecurityGroups))
     {
         request.DBSecurityGroups.Add(this._DBSecurityGroups);
     }
     request.AvailabilityZone = this._AvailabilityZone;
     request.PreferredMaintenanceWindow = this._PreferredMaintenanceWindow;
     request.DBParameterGroupName = this._DBParameterGroupName;
     request.BackupRetentionPeriod = this._BackupRetentionPeriod;
     request.PreferredBackupWindow = this._PreferredBackupWindow;
     request.Port = this._Port;
     Amazon.RDS.Model.CreateDBInstanceResponse response = client.CreateDBInstance(request);
     base.WriteObject(response.CreateDBInstanceResult, true);
 }
Пример #14
0
 /// <summary>
 /// <para> Creates a new DB instance. </para>
 /// </summary>
 /// 
 /// <param name="createDBInstanceRequest">Container for the necessary parameters to execute the CreateDBInstance service method on
 ///           AmazonRDS.</param>
 /// 
 /// <returns>The response from the CreateDBInstance service method, as returned by AmazonRDS.</returns>
 /// 
 /// <exception cref="DBParameterGroupNotFoundException"/>
 /// <exception cref="InstanceQuotaExceededException"/>
 /// <exception cref="DBSubnetGroupNotFoundException"/>
 /// <exception cref="DBInstanceAlreadyExistsException"/>
 /// <exception cref="StorageQuotaExceededException"/>
 /// <exception cref="InvalidVPCNetworkStateException"/>
 /// <exception cref="DBSecurityGroupNotFoundException"/>
 /// <exception cref="InsufficientDBInstanceCapacityException"/>
 public CreateDBInstanceResponse CreateDBInstance(CreateDBInstanceRequest createDBInstanceRequest)
 {
     IRequest<CreateDBInstanceRequest> request = new CreateDBInstanceRequestMarshaller().Marshall(createDBInstanceRequest);
     CreateDBInstanceResponse response = Invoke<CreateDBInstanceRequest, CreateDBInstanceResponse> (request, this.signer, CreateDBInstanceResponseUnmarshaller.GetInstance());
     return response;
 }
Пример #15
0
        private CreateDBInstanceRequest CreateDbInstanceRequest(DeveloperOptions devOptions)
        {
            var request = new CreateDBInstanceRequest()
            {
                // 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.
                BackupRetentionPeriod = devOptions.BackupRetentionPeriod,
                DBParameterGroupName = devOptions.DBParameterGroupName,
                DBSecurityGroups = devOptions.DBSecurityGroups,
                DBSubnetGroupName = devOptions.SubnetGroupName,
                DBInstanceClass = devOptions.DbInstanceClass,
                DBInstanceIdentifier = devOptions.DbInstanceIdentifier,
                DBName = devOptions.DbName,
                Engine = devOptions.Engine,
                EngineVersion = devOptions.EngineVersion,
                LicenseModel = devOptions.LicenseModel,
                MasterUsername = devOptions.DBAUsername,
                MasterUserPassword = devOptions.DBAPassword,
                Iops = devOptions.ProvisionedIOPs,
                MultiAZ = devOptions.MultiAZ,
                OptionGroupName = devOptions.OptionGroup,
                Port = devOptions.Port,
                PreferredBackupWindow = devOptions.PreferredBackupWindow,
                PreferredMaintenanceWindow = devOptions.PreferredMXWindow,
                PubliclyAccessible = devOptions.PubliclyAccessible,
                Tags = devOptions.Tags,
                VpcSecurityGroupIds = devOptions.VPCSecurityGroupIds
            };

            if (!devOptions.MultiAZ)
            {
                request.AvailabilityZone = devOptions.AvailabilityZone;
            }

            // Oracle DB only parameter
            if (request.Engine.Equals("Oracle") && devOptions.CharacterSet != null)
            {
                request.CharacterSetName = devOptions.CharacterSet;
            }

            if (devOptions.AllocatedStorage != null)
            {
                request.AllocatedStorage = devOptions.AllocatedStorage;
            }

            if (devOptions.AutoMinorVersionUpgrade != null)
            {
                request.AutoMinorVersionUpgrade = devOptions.AutoMinorVersionUpgrade;
            }
            return request;
        }