Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2010-2015 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.storagegateway.model;
 
 
Container for the parameters to the CreateStorediSCSIVolume operation.

This operation creates a volume on a specified gateway. This operation is supported only for the gateway-stored volume architecture.

The size of the volume to create is inferred from the disk size. You can choose to preserve existing data on the disk, create volume from an existing snapshot, or create an empty volume. If you choose to create an empty gateway volume, then any existing data on the disk is erased.

In the request you must specify the gateway and the disk information on which you are creating the volume. In response, AWS Storage Gateway creates the volume and returns volume information such as the volume Amazon Resource Name (ARN), its size, and the iSCSI target ARN that initiators can use to connect to the volume target.

 
 public class CreateStorediSCSIVolumeRequest extends AmazonWebServiceRequest implements SerializableCloneable {

    
The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation to return a list of gateways for your account and region.

Constraints:
Length: 50 - 500

 
     private String gatewayARN;

    
The unique identifier for the gateway local disk that is configured as a stored volume. Use ListLocalDisks to list disk IDs for a gateway.

Constraints:
Length: 1 - 300

 
     private String diskId;

    
The snapshot ID (e.g. "snap-1122aabb") of the snapshot to restore as the new stored volume. Specify this field if you want to create the iSCSI storage volume from a snapshot otherwise do not include this field. To list snapshots for your account use DescribeSnapshots in the Amazon Elastic Compute Cloud API Reference.

Constraints:
Pattern: \Asnap-[0-9a-fA-F]{8}\z

 
     private String snapshotId;

    
Specify this field as true if you want to preserve the data on the local disk. Otherwise, specifying this field as false creates an empty volume.

Valid Values: true, false

 
     private Boolean preserveExistingData;

    
The name of the iSCSI target used by initiators to connect to the target and as a suffix for the target ARN. For example, specifying TargetName as myvolume results in the target ARN of arn:aws:storagegateway:us-east-1:111122223333:gateway/mygateway/target/iqn.1997-05.com.amazon:myvolume. The target name must be unique across all volumes of a gateway.

Constraints:
Length: 1 - 200
Pattern: ^[-\.;a-z0-9]+$

 
     private String targetName;

    
The network interface of the gateway on which to expose the iSCSI target. Only IPv4 addresses are accepted. Use DescribeGatewayInformation to get a list of the network interfaces available on a gateway.

Valid Values: A valid IP address.

Constraints:
Pattern: \A(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}\z

    private String networkInterfaceId;

    
The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation to return a list of gateways for your account and region.

Constraints:
Length: 50 - 500

Returns:
The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation to return a list of gateways for your account and region.
    public String getGatewayARN() {
        return ;
    }
    
    
The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation to return a list of gateways for your account and region.

Constraints:
Length: 50 - 500

Parameters:
gatewayARN The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation to return a list of gateways for your account and region.
    public void setGatewayARN(String gatewayARN) {
        this. = gatewayARN;
    }
    
    
The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation to return a list of gateways for your account and region.

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

Constraints:
Length: 50 - 500

Parameters:
gatewayARN The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation to return a list of gateways for your account and region.
Returns:
A reference to this updated object so that method calls can be chained together.
        this. = gatewayARN;
        return this;
    }

    
The unique identifier for the gateway local disk that is configured as a stored volume. Use ListLocalDisks to list disk IDs for a gateway.

Constraints:
Length: 1 - 300

Returns:
The unique identifier for the gateway local disk that is configured as a stored volume. Use ListLocalDisks to list disk IDs for a gateway.
    public String getDiskId() {
        return ;
    }
    
    
The unique identifier for the gateway local disk that is configured as a stored volume. Use ListLocalDisks to list disk IDs for a gateway.

Constraints:
Length: 1 - 300

Parameters:
diskId The unique identifier for the gateway local disk that is configured as a stored volume. Use ListLocalDisks to list disk IDs for a gateway.
    public void setDiskId(String diskId) {
        this. = diskId;
    }
    
    
The unique identifier for the gateway local disk that is configured as a stored volume. Use ListLocalDisks to list disk IDs for a gateway.

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

Constraints:
Length: 1 - 300

Parameters:
diskId The unique identifier for the gateway local disk that is configured as a stored volume. Use ListLocalDisks to list disk IDs for a gateway.
Returns:
A reference to this updated object so that method calls can be chained together.
        this. = diskId;
        return this;
    }

    
The snapshot ID (e.g. "snap-1122aabb") of the snapshot to restore as the new stored volume. Specify this field if you want to create the iSCSI storage volume from a snapshot otherwise do not include this field. To list snapshots for your account use DescribeSnapshots in the Amazon Elastic Compute Cloud API Reference.

Constraints:
Pattern: \Asnap-[0-9a-fA-F]{8}\z

Returns:
The snapshot ID (e.g. "snap-1122aabb") of the snapshot to restore as the new stored volume. Specify this field if you want to create the iSCSI storage volume from a snapshot otherwise do not include this field. To list snapshots for your account use DescribeSnapshots in the Amazon Elastic Compute Cloud API Reference.
    public String getSnapshotId() {
        return ;
    }
    
    
The snapshot ID (e.g. "snap-1122aabb") of the snapshot to restore as the new stored volume. Specify this field if you want to create the iSCSI storage volume from a snapshot otherwise do not include this field. To list snapshots for your account use DescribeSnapshots in the Amazon Elastic Compute Cloud API Reference.

Constraints:
Pattern: \Asnap-[0-9a-fA-F]{8}\z

Parameters:
snapshotId The snapshot ID (e.g. "snap-1122aabb") of the snapshot to restore as the new stored volume. Specify this field if you want to create the iSCSI storage volume from a snapshot otherwise do not include this field. To list snapshots for your account use DescribeSnapshots in the Amazon Elastic Compute Cloud API Reference.
    public void setSnapshotId(String snapshotId) {
        this. = snapshotId;
    }
    
    
The snapshot ID (e.g. "snap-1122aabb") of the snapshot to restore as the new stored volume. Specify this field if you want to create the iSCSI storage volume from a snapshot otherwise do not include this field. To list snapshots for your account use DescribeSnapshots in the Amazon Elastic Compute Cloud API Reference.

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

Constraints:
Pattern: \Asnap-[0-9a-fA-F]{8}\z

Parameters:
snapshotId The snapshot ID (e.g. "snap-1122aabb") of the snapshot to restore as the new stored volume. Specify this field if you want to create the iSCSI storage volume from a snapshot otherwise do not include this field. To list snapshots for your account use DescribeSnapshots in the Amazon Elastic Compute Cloud API Reference.
Returns:
A reference to this updated object so that method calls can be chained together.
        this. = snapshotId;
        return this;
    }

    
Specify this field as true if you want to preserve the data on the local disk. Otherwise, specifying this field as false creates an empty volume.

Valid Values: true, false

Returns:
Specify this field as true if you want to preserve the data on the local disk. Otherwise, specifying this field as false creates an empty volume.

Valid Values: true, false

    public Boolean isPreserveExistingData() {
        return ;
    }
    
    
Specify this field as true if you want to preserve the data on the local disk. Otherwise, specifying this field as false creates an empty volume.

Valid Values: true, false

Parameters:
preserveExistingData Specify this field as true if you want to preserve the data on the local disk. Otherwise, specifying this field as false creates an empty volume.

Valid Values: true, false

    public void setPreserveExistingData(Boolean preserveExistingData) {
        this. = preserveExistingData;
    }
    
    
Specify this field as true if you want to preserve the data on the local disk. Otherwise, specifying this field as false creates an empty volume.

Valid Values: true, false

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

Parameters:
preserveExistingData Specify this field as true if you want to preserve the data on the local disk. Otherwise, specifying this field as false creates an empty volume.

Valid Values: true, false

Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateStorediSCSIVolumeRequest withPreserveExistingData(Boolean preserveExistingData) {
        this. = preserveExistingData;
        return this;
    }

    
Specify this field as true if you want to preserve the data on the local disk. Otherwise, specifying this field as false creates an empty volume.

Valid Values: true, false

Returns:
Specify this field as true if you want to preserve the data on the local disk. Otherwise, specifying this field as false creates an empty volume.

Valid Values: true, false

    public Boolean getPreserveExistingData() {
        return ;
    }

    
The name of the iSCSI target used by initiators to connect to the target and as a suffix for the target ARN. For example, specifying TargetName as myvolume results in the target ARN of arn:aws:storagegateway:us-east-1:111122223333:gateway/mygateway/target/iqn.1997-05.com.amazon:myvolume. The target name must be unique across all volumes of a gateway.

Constraints:
Length: 1 - 200
Pattern: ^[-\.;a-z0-9]+$

Returns:
The name of the iSCSI target used by initiators to connect to the target and as a suffix for the target ARN. For example, specifying TargetName as myvolume results in the target ARN of arn:aws:storagegateway:us-east-1:111122223333:gateway/mygateway/target/iqn.1997-05.com.amazon:myvolume. The target name must be unique across all volumes of a gateway.
    public String getTargetName() {
        return ;
    }
    
    
The name of the iSCSI target used by initiators to connect to the target and as a suffix for the target ARN. For example, specifying TargetName as myvolume results in the target ARN of arn:aws:storagegateway:us-east-1:111122223333:gateway/mygateway/target/iqn.1997-05.com.amazon:myvolume. The target name must be unique across all volumes of a gateway.

Constraints:
Length: 1 - 200
Pattern: ^[-\.;a-z0-9]+$

Parameters:
targetName The name of the iSCSI target used by initiators to connect to the target and as a suffix for the target ARN. For example, specifying TargetName as myvolume results in the target ARN of arn:aws:storagegateway:us-east-1:111122223333:gateway/mygateway/target/iqn.1997-05.com.amazon:myvolume. The target name must be unique across all volumes of a gateway.
    public void setTargetName(String targetName) {
        this. = targetName;
    }
    
    
The name of the iSCSI target used by initiators to connect to the target and as a suffix for the target ARN. For example, specifying TargetName as myvolume results in the target ARN of arn:aws:storagegateway:us-east-1:111122223333:gateway/mygateway/target/iqn.1997-05.com.amazon:myvolume. The target name must be unique across all volumes of a gateway.

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

Constraints:
Length: 1 - 200
Pattern: ^[-\.;a-z0-9]+$

Parameters:
targetName The name of the iSCSI target used by initiators to connect to the target and as a suffix for the target ARN. For example, specifying TargetName as myvolume results in the target ARN of arn:aws:storagegateway:us-east-1:111122223333:gateway/mygateway/target/iqn.1997-05.com.amazon:myvolume. The target name must be unique across all volumes of a gateway.
Returns:
A reference to this updated object so that method calls can be chained together.
        this. = targetName;
        return this;
    }

    
The network interface of the gateway on which to expose the iSCSI target. Only IPv4 addresses are accepted. Use DescribeGatewayInformation to get a list of the network interfaces available on a gateway.

Valid Values: A valid IP address.

Constraints:
Pattern: \A(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}\z

Returns:
The network interface of the gateway on which to expose the iSCSI target. Only IPv4 addresses are accepted. Use DescribeGatewayInformation to get a list of the network interfaces available on a gateway.

Valid Values: A valid IP address.

    public String getNetworkInterfaceId() {
        return ;
    }
    
    
The network interface of the gateway on which to expose the iSCSI target. Only IPv4 addresses are accepted. Use DescribeGatewayInformation to get a list of the network interfaces available on a gateway.

Valid Values: A valid IP address.

Constraints:
Pattern: \A(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}\z

Parameters:
networkInterfaceId The network interface of the gateway on which to expose the iSCSI target. Only IPv4 addresses are accepted. Use DescribeGatewayInformation to get a list of the network interfaces available on a gateway.

Valid Values: A valid IP address.

    public void setNetworkInterfaceId(String networkInterfaceId) {
        this. = networkInterfaceId;
    }
    
    
The network interface of the gateway on which to expose the iSCSI target. Only IPv4 addresses are accepted. Use DescribeGatewayInformation to get a list of the network interfaces available on a gateway.

Valid Values: A valid IP address.

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

Constraints:
Pattern: \A(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}\z

Parameters:
networkInterfaceId The network interface of the gateway on which to expose the iSCSI target. Only IPv4 addresses are accepted. Use DescribeGatewayInformation to get a list of the network interfaces available on a gateway.

Valid Values: A valid IP address.

Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateStorediSCSIVolumeRequest withNetworkInterfaceId(String networkInterfaceId) {
        this. = networkInterfaceId;
        return this;
    }

    
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("{");
        if (getGatewayARN() != nullsb.append("GatewayARN: " + getGatewayARN() + ",");
        if (getDiskId() != nullsb.append("DiskId: " + getDiskId() + ",");
        if (getSnapshotId() != nullsb.append("SnapshotId: " + getSnapshotId() + ",");
        if (isPreserveExistingData() != nullsb.append("PreserveExistingData: " + isPreserveExistingData() + ",");
        if (getTargetName() != nullsb.append("TargetName: " + getTargetName() + ",");
        if (getNetworkInterfaceId() != nullsb.append("NetworkInterfaceId: " + getNetworkInterfaceId() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getGatewayARN() == null) ? 0 : getGatewayARN().hashCode()); 
        hashCode = prime * hashCode + ((getDiskId() == null) ? 0 : getDiskId().hashCode()); 
        hashCode = prime * hashCode + ((getSnapshotId() == null) ? 0 : getSnapshotId().hashCode()); 
        hashCode = prime * hashCode + ((isPreserveExistingData() == null) ? 0 : isPreserveExistingData().hashCode()); 
        hashCode = prime * hashCode + ((getTargetName() == null) ? 0 : getTargetName().hashCode()); 
        hashCode = prime * hashCode + ((getNetworkInterfaceId() == null) ? 0 : getNetworkInterfaceId().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof CreateStorediSCSIVolumeRequest == falsereturn false;
        
        if (other.getGatewayARN() == null ^ this.getGatewayARN() == nullreturn false;
        if (other.getGatewayARN() != null && other.getGatewayARN().equals(this.getGatewayARN()) == falsereturn false
        if (other.getDiskId() == null ^ this.getDiskId() == nullreturn false;
        if (other.getDiskId() != null && other.getDiskId().equals(this.getDiskId()) == falsereturn false
        if (other.getSnapshotId() == null ^ this.getSnapshotId() == nullreturn false;
        if (other.getSnapshotId() != null && other.getSnapshotId().equals(this.getSnapshotId()) == falsereturn false
        if (other.isPreserveExistingData() == null ^ this.isPreserveExistingData() == nullreturn false;
        if (other.isPreserveExistingData() != null && other.isPreserveExistingData().equals(this.isPreserveExistingData()) == falsereturn false
        if (other.getTargetName() == null ^ this.getTargetName() == nullreturn false;
        if (other.getTargetName() != null && other.getTargetName().equals(this.getTargetName()) == falsereturn false
        if (other.getNetworkInterfaceId() == null ^ this.getNetworkInterfaceId() == nullreturn false;
        if (other.getNetworkInterfaceId() != null && other.getNetworkInterfaceId().equals(this.getNetworkInterfaceId()) == falsereturn false
        return true;
    }
    
    @Override
        
            return (CreateStorediSCSIVolumeRequestsuper.clone();
    }
}
    
New to GrepCode? Check out our FAQ X