Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2010 Amazon.com, Inc. or its affiliates. All Rights Reserved.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License").
   * You may not use this file except in compliance with the License.
   * A copy of the License is located at
   * 
   *  http://aws.amazon.com/apache2.0
   * 
  * or in the "license" file accompanying this file. This file is distributed
  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
  * express or implied. See the License for the specific language governing
  * permissions and limitations under the License.
  */
 package com.amazonaws.services.rds.model;
Container for the parameters to the CreateDBInstance operation.

This API creates a new DB instance.

 
 public class CreateDBInstanceRequest extends AmazonWebServiceRequest {

    
The name of the database to create when the DB Instance is created. If this parameter is not specified, no database is created in the DB Instance.
 
     private String dBName;

    
The DB Instance identifier. This parameter is stored as a lowercase string.
 
     private String dBInstanceIdentifier;

    
The amount of storage (in gigabytes) to be initially allocated for the database instance.
 
     private Integer allocatedStorage;

    
The compute and memory capacity of the DB Instance.
 
     private String dBInstanceClass;

    
The name of the database engine to be used for this instance.
 
     private String engine;

    
The name of master user for the client DB Instance.
 
     private String masterUsername;

    
The password for the master DB Instance user.
 
     private String masterUserPassword;

    
A list of DB Security Groups to associate with this DB Instance.
 
     private java.util.List<StringdBSecurityGroups;

    
The EC2 Availability Zone that the database instance will be created in.
 
     private String availabilityZone;

    
The weekly time range (in UTC) during which system maintenance can occur.
 
     private String preferredMaintenanceWindow;

    
The name of the database parameter group to associate with this DB instance. If this argument is omitted, the default DBParameterGroup for the specified engine will be used.
 
     private String dBParameterGroupName;

    
The number of days for which automated backups are retained. Setting this parameter to a positive number enables backups. Setting this parameter to 0 disables automated backups.
 
     private Integer backupRetentionPeriod;

    
The daily time range during which automated backups are created if automated backups are enabled, as determined by the BackupRetentionPeriod.
    private String preferredBackupWindow;

    
The port number on which the database accepts connections.
    private Integer port;

    
Specifies if the DB Instance is a Multi-AZ deployment.
    private Boolean multiAZ;

    
The version number of the database engine to use.
    private String engineVersion;

    
Indicates that minor engine upgrades will be applied automatically to the DB Instance during the maintenance window.
    private Boolean autoMinorVersionUpgrade;

    
Default constructor for a new CreateDBInstanceRequest object. Callers should use the setter or fluent setter (with...) methods to initialize this object after creating it.
    public CreateDBInstanceRequest() {}
    
    
Constructs a new CreateDBInstanceRequest object. Callers should use the setter or fluent setter (with...) methods to initialize any additional object members.

Parameters:
dBInstanceIdentifier The DB Instance identifier. This parameter is stored as a lowercase string.
allocatedStorage The amount of storage (in gigabytes) to be initially allocated for the database instance.
dBInstanceClass The compute and memory capacity of the DB Instance.
engine The name of the database engine to be used for this instance.
masterUsername The name of master user for the client DB Instance.
masterUserPassword The password for the master DB Instance user.
    public CreateDBInstanceRequest(String dBInstanceIdentifierInteger allocatedStorageString dBInstanceClassString engineString masterUsernameString masterUserPassword) {
        this. = dBInstanceIdentifier;
        this. = allocatedStorage;
        this. = dBInstanceClass;
        this. = engine;
        this. = masterUsername;
        this. = masterUserPassword;
    }
    
    
The name of the database to create when the DB Instance is created. If this parameter is not specified, no database is created in the DB Instance.

Returns:
The name of the database to create when the DB Instance is created. If this parameter is not specified, no database is created in the DB Instance.
    public String getDBName() {
        return ;
    }
    
    
The name of the database to create when the DB Instance is created. If this parameter is not specified, no database is created in the DB Instance.

Parameters:
dBName The name of the database to create when the DB Instance is created. If this parameter is not specified, no database is created in the DB Instance.
    public void setDBName(String dBName) {
        this. = dBName;
    }
    
    
The name of the database to create when the DB Instance is created. If this parameter is not specified, no database is created in the DB Instance.

Returns a reference to this object so that method calls can be chained together.

Parameters:
dBName The name of the database to create when the DB Instance is created. If this parameter is not specified, no database is created in the DB Instance.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateDBInstanceRequest withDBName(String dBName) {
        this. = dBName;
        return this;
    }
    
    
    
The DB Instance identifier. This parameter is stored as a lowercase string.

Returns:
The DB Instance identifier. This parameter is stored as a lowercase string.
    public String getDBInstanceIdentifier() {
        return ;
    }
    
    
The DB Instance identifier. This parameter is stored as a lowercase string.

Parameters:
dBInstanceIdentifier The DB Instance identifier. This parameter is stored as a lowercase string.
    public void setDBInstanceIdentifier(String dBInstanceIdentifier) {
        this. = dBInstanceIdentifier;
    }
    
    
The DB Instance identifier. This parameter is stored as a lowercase string.

Returns a reference to this object so that method calls can be chained together.

Parameters:
dBInstanceIdentifier The DB Instance identifier. This parameter is stored as a lowercase string.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateDBInstanceRequest withDBInstanceIdentifier(String dBInstanceIdentifier) {
        this. = dBInstanceIdentifier;
        return this;
    }
    
    
    
The amount of storage (in gigabytes) to be initially allocated for the database instance.

Returns:
The amount of storage (in gigabytes) to be initially allocated for the database instance.
    public Integer getAllocatedStorage() {
        return ;
    }
    
    
The amount of storage (in gigabytes) to be initially allocated for the database instance.

Parameters:
allocatedStorage The amount of storage (in gigabytes) to be initially allocated for the database instance.
    public void setAllocatedStorage(Integer allocatedStorage) {
        this. = allocatedStorage;
    }
    
    
The amount of storage (in gigabytes) to be initially allocated for the database instance.

Returns a reference to this object so that method calls can be chained together.

Parameters:
allocatedStorage The amount of storage (in gigabytes) to be initially allocated for the database instance.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateDBInstanceRequest withAllocatedStorage(Integer allocatedStorage) {
        this. = allocatedStorage;
        return this;
    }
    
    
    
The compute and memory capacity of the DB Instance.

Returns:
The compute and memory capacity of the DB Instance.
    public String getDBInstanceClass() {
        return ;
    }
    
    
The compute and memory capacity of the DB Instance.

Parameters:
dBInstanceClass The compute and memory capacity of the DB Instance.
    public void setDBInstanceClass(String dBInstanceClass) {
        this. = dBInstanceClass;
    }
    
    
The compute and memory capacity of the DB Instance.

Returns a reference to this object so that method calls can be chained together.

Parameters:
dBInstanceClass The compute and memory capacity of the DB Instance.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateDBInstanceRequest withDBInstanceClass(String dBInstanceClass) {
        this. = dBInstanceClass;
        return this;
    }
    
    
    
The name of the database engine to be used for this instance.

Returns:
The name of the database engine to be used for this instance.
    public String getEngine() {
        return ;
    }
    
    
The name of the database engine to be used for this instance.

Parameters:
engine The name of the database engine to be used for this instance.
    public void setEngine(String engine) {
        this. = engine;
    }
    
    
The name of the database engine to be used for this instance.

Returns a reference to this object so that method calls can be chained together.

Parameters:
engine The name of the database engine to be used for this instance.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateDBInstanceRequest withEngine(String engine) {
        this. = engine;
        return this;
    }
    
    
    
The name of master user for the client DB Instance.

Returns:
The name of master user for the client DB Instance.
    public String getMasterUsername() {
        return ;
    }
    
    
The name of master user for the client DB Instance.

Parameters:
masterUsername The name of master user for the client DB Instance.
    public void setMasterUsername(String masterUsername) {
        this. = masterUsername;
    }
    
    
The name of master user for the client DB Instance.

Returns a reference to this object so that method calls can be chained together.

Parameters:
masterUsername The name of master user for the client DB Instance.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateDBInstanceRequest withMasterUsername(String masterUsername) {
        this. = masterUsername;
        return this;
    }
    
    
    
The password for the master DB Instance user.

Returns:
The password for the master DB Instance user.
    public String getMasterUserPassword() {
        return ;
    }
    
    
The password for the master DB Instance user.

Parameters:
masterUserPassword The password for the master DB Instance user.
    public void setMasterUserPassword(String masterUserPassword) {
        this. = masterUserPassword;
    }
    
    
The password for the master DB Instance user.

Returns a reference to this object so that method calls can be chained together.

Parameters:
masterUserPassword The password for the master DB Instance user.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateDBInstanceRequest withMasterUserPassword(String masterUserPassword) {
        this. = masterUserPassword;
        return this;
    }
    
    
    
A list of DB Security Groups to associate with this DB Instance.

Returns:
A list of DB Security Groups to associate with this DB Instance.
    public java.util.List<StringgetDBSecurityGroups() {
        if ( == null) {
             = new java.util.ArrayList<String>();
        }
        return ;
    }
    
    
A list of DB Security Groups to associate with this DB Instance.

Parameters:
dBSecurityGroups A list of DB Security Groups to associate with this DB Instance.
    public void setDBSecurityGroups(java.util.Collection<StringdBSecurityGroups) {
        java.util.List<StringdBSecurityGroupsCopy = new java.util.ArrayList<String>();
        if (dBSecurityGroups != null) {
            dBSecurityGroupsCopy.addAll(dBSecurityGroups);
        }
        this. = dBSecurityGroupsCopy;
    }
    
    
A list of DB Security Groups to associate with this DB Instance.

Returns a reference to this object so that method calls can be chained together.

Parameters:
dBSecurityGroups A list of DB Security Groups to associate with this DB Instance.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateDBInstanceRequest withDBSecurityGroups(String... dBSecurityGroups) {
        for (String value : dBSecurityGroups) {
            getDBSecurityGroups().add(value);
        }
        return this;
    }
    
    
A list of DB Security Groups to associate with this DB Instance.

Returns a reference to this object so that method calls can be chained together.

Parameters:
dBSecurityGroups A list of DB Security Groups to associate with this DB Instance.
Returns:
A reference to this updated object so that method calls can be chained together.
        java.util.List<StringdBSecurityGroupsCopy = new java.util.ArrayList<String>();
        if (dBSecurityGroups != null) {
            dBSecurityGroupsCopy.addAll(dBSecurityGroups);
        }
        this. = dBSecurityGroupsCopy;
        return this;
    }
    
    
The EC2 Availability Zone that the database instance will be created in.

Returns:
The EC2 Availability Zone that the database instance will be created in.
    public String getAvailabilityZone() {
        return ;
    }
    
    
The EC2 Availability Zone that the database instance will be created in.

Parameters:
availabilityZone The EC2 Availability Zone that the database instance will be created in.
    public void setAvailabilityZone(String availabilityZone) {
        this. = availabilityZone;
    }
    
    
The EC2 Availability Zone that the database instance will be created in.

Returns a reference to this object so that method calls can be chained together.

Parameters:
availabilityZone The EC2 Availability Zone that the database instance will be created in.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateDBInstanceRequest withAvailabilityZone(String availabilityZone) {
        this. = availabilityZone;
        return this;
    }
    
    
    
The weekly time range (in UTC) during which system maintenance can occur.

Returns:
The weekly time range (in UTC) during which system maintenance can occur.
        return ;
    }
    
    
The weekly time range (in UTC) during which system maintenance can occur.

Parameters:
preferredMaintenanceWindow The weekly time range (in UTC) during which system maintenance can occur.
    public void setPreferredMaintenanceWindow(String preferredMaintenanceWindow) {
        this. = preferredMaintenanceWindow;
    }
    
    
The weekly time range (in UTC) during which system maintenance can occur.

Returns a reference to this object so that method calls can be chained together.

Parameters:
preferredMaintenanceWindow The weekly time range (in UTC) during which system maintenance can occur.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateDBInstanceRequest withPreferredMaintenanceWindow(String preferredMaintenanceWindow) {
        this. = preferredMaintenanceWindow;
        return this;
    }
    
    
    
The name of the database parameter group to associate with this DB instance. If this argument is omitted, the default DBParameterGroup for the specified engine will be used.

Returns:
The name of the database parameter group to associate with this DB instance. If this argument is omitted, the default DBParameterGroup for the specified engine will be used.
    public String getDBParameterGroupName() {
        return ;
    }
    
    
The name of the database parameter group to associate with this DB instance. If this argument is omitted, the default DBParameterGroup for the specified engine will be used.

Parameters:
dBParameterGroupName The name of the database parameter group to associate with this DB instance. If this argument is omitted, the default DBParameterGroup for the specified engine will be used.
    public void setDBParameterGroupName(String dBParameterGroupName) {
        this. = dBParameterGroupName;
    }
    
    
The name of the database parameter group to associate with this DB instance. If this argument is omitted, the default DBParameterGroup for the specified engine will be used.

Returns a reference to this object so that method calls can be chained together.

Parameters:
dBParameterGroupName The name of the database parameter group to associate with this DB instance. If this argument is omitted, the default DBParameterGroup for the specified engine will be used.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateDBInstanceRequest withDBParameterGroupName(String dBParameterGroupName) {
        this. = dBParameterGroupName;
        return this;
    }
    
    
    
The number of days for which automated backups are retained. Setting this parameter to a positive number enables backups. Setting this parameter to 0 disables automated backups.

Returns:
The number of days for which automated backups are retained. Setting this parameter to a positive number enables backups. Setting this parameter to 0 disables automated backups.
    public Integer getBackupRetentionPeriod() {
        return ;
    }
    
    
The number of days for which automated backups are retained. Setting this parameter to a positive number enables backups. Setting this parameter to 0 disables automated backups.

Parameters:
backupRetentionPeriod The number of days for which automated backups are retained. Setting this parameter to a positive number enables backups. Setting this parameter to 0 disables automated backups.
    public void setBackupRetentionPeriod(Integer backupRetentionPeriod) {
        this. = backupRetentionPeriod;
    }
    
    
The number of days for which automated backups are retained. Setting this parameter to a positive number enables backups. Setting this parameter to 0 disables automated backups.

Returns a reference to this object so that method calls can be chained together.

Parameters:
backupRetentionPeriod The number of days for which automated backups are retained. Setting this parameter to a positive number enables backups. Setting this parameter to 0 disables automated backups.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateDBInstanceRequest withBackupRetentionPeriod(Integer backupRetentionPeriod) {
        this. = backupRetentionPeriod;
        return this;
    }
    
    
    
The daily time range during which automated backups are created if automated backups are enabled, as determined by the BackupRetentionPeriod.

Returns:
The daily time range during which automated backups are created if automated backups are enabled, as determined by the BackupRetentionPeriod.
    public String getPreferredBackupWindow() {
        return ;
    }
    
    
The daily time range during which automated backups are created if automated backups are enabled, as determined by the BackupRetentionPeriod.

Parameters:
preferredBackupWindow The daily time range during which automated backups are created if automated backups are enabled, as determined by the BackupRetentionPeriod.
    public void setPreferredBackupWindow(String preferredBackupWindow) {
        this. = preferredBackupWindow;
    }
    
    
The daily time range during which automated backups are created if automated backups are enabled, as determined by the BackupRetentionPeriod.

Returns a reference to this object so that method calls can be chained together.

Parameters:
preferredBackupWindow The daily time range during which automated backups are created if automated backups are enabled, as determined by the BackupRetentionPeriod.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateDBInstanceRequest withPreferredBackupWindow(String preferredBackupWindow) {
        this. = preferredBackupWindow;
        return this;
    }
    
    
    
The port number on which the database accepts connections.

Returns:
The port number on which the database accepts connections.
    public Integer getPort() {
        return ;
    }
    
    
The port number on which the database accepts connections.

Parameters:
port The port number on which the database accepts connections.
    public void setPort(Integer port) {
        this. = port;
    }
    
    
The port number on which the database accepts connections.

Returns a reference to this object so that method calls can be chained together.

Parameters:
port The port number on which the database accepts connections.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateDBInstanceRequest withPort(Integer port) {
        this. = port;
        return this;
    }
    
    
    
Specifies if the DB Instance is a Multi-AZ deployment.

Returns:
Specifies if the DB Instance is a Multi-AZ deployment.
    public Boolean isMultiAZ() {
        return ;
    }
    
    
Specifies if the DB Instance is a Multi-AZ deployment.

Parameters:
multiAZ Specifies if the DB Instance is a Multi-AZ deployment.
    public void setMultiAZ(Boolean multiAZ) {
        this. = multiAZ;
    }
    
    
Specifies if the DB Instance is a Multi-AZ deployment.

Returns a reference to this object so that method calls can be chained together.

Parameters:
multiAZ Specifies if the DB Instance is a Multi-AZ deployment.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateDBInstanceRequest withMultiAZ(Boolean multiAZ) {
        this. = multiAZ;
        return this;
    }
    
    
    
Specifies if the DB Instance is a Multi-AZ deployment.

Returns:
Specifies if the DB Instance is a Multi-AZ deployment.
    public Boolean getMultiAZ() {
        return ;
    }
    
    
The version number of the database engine to use.

Returns:
The version number of the database engine to use.
    public String getEngineVersion() {
        return ;
    }
    
    
The version number of the database engine to use.

Parameters:
engineVersion The version number of the database engine to use.
    public void setEngineVersion(String engineVersion) {
        this. = engineVersion;
    }
    
    
The version number of the database engine to use.

Returns a reference to this object so that method calls can be chained together.

Parameters:
engineVersion The version number of the database engine to use.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateDBInstanceRequest withEngineVersion(String engineVersion) {
        this. = engineVersion;
        return this;
    }
    
    
    
Indicates that minor engine upgrades will be applied automatically to the DB Instance during the maintenance window.

Returns:
Indicates that minor engine upgrades will be applied automatically to the DB Instance during the maintenance window.
        return ;
    }
    
    
Indicates that minor engine upgrades will be applied automatically to the DB Instance during the maintenance window.

Parameters:
autoMinorVersionUpgrade Indicates that minor engine upgrades will be applied automatically to the DB Instance during the maintenance window.
    public void setAutoMinorVersionUpgrade(Boolean autoMinorVersionUpgrade) {
        this. = autoMinorVersionUpgrade;
    }
    
    
Indicates that minor engine upgrades will be applied automatically to the DB Instance during the maintenance window.

Returns a reference to this object so that method calls can be chained together.

Parameters:
autoMinorVersionUpgrade Indicates that minor engine upgrades will be applied automatically to the DB Instance during the maintenance window.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateDBInstanceRequest withAutoMinorVersionUpgrade(Boolean autoMinorVersionUpgrade) {
        this. = autoMinorVersionUpgrade;
        return this;
    }
    
    
    
Indicates that minor engine upgrades will be applied automatically to the DB Instance during the maintenance window.

Returns:
Indicates that minor engine upgrades will be applied automatically to the DB Instance during the maintenance window.
        return ;
    }
    
    
Returns a string representation of this object; useful for testing and debugging.

Returns:
A string representation of this object.
See also:
java.lang.Object.toString()
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        sb.append("DBName: " +  + ", ");
        sb.append("DBInstanceIdentifier: " +  + ", ");
        sb.append("AllocatedStorage: " +  + ", ");
        sb.append("DBInstanceClass: " +  + ", ");
        sb.append("Engine: " +  + ", ");
        sb.append("MasterUsername: " +  + ", ");
        sb.append("MasterUserPassword: " +  + ", ");
        sb.append("DBSecurityGroups: " +  + ", ");
        sb.append("AvailabilityZone: " +  + ", ");
        sb.append("PreferredMaintenanceWindow: " +  + ", ");
        sb.append("DBParameterGroupName: " +  + ", ");
        sb.append("BackupRetentionPeriod: " +  + ", ");
        sb.append("PreferredBackupWindow: " +  + ", ");
        sb.append("Port: " +  + ", ");
        sb.append("MultiAZ: " +  + ", ");
        sb.append("EngineVersion: " +  + ", ");
        sb.append("AutoMinorVersionUpgrade: " +  + ", ");
        sb.append("}");
        return sb.toString();
    }
    
}
    
New to GrepCode? Check out our FAQ X