
com.solidfire.element.api.CloneVolumeRequest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of element-api Show documentation
Show all versions of element-api Show documentation
Library for interfacing with the Public and Incubating SolidFire Element API.
/*
* Copyright © 2015 SolidFire, Inc. 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.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License 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.
*/
/*
* DO NOT EDIT THIS CODE BY HAND! It has been generated with jsvcgen.
*/
package com.solidfire.element.api;
import com.solidfire.javautil.Optional;
import com.solidfire.client.ApiException;
import com.solidfire.javautil.Optional;
import java.net.URL;
import java.util.Arrays;
import java.util.Objects;
import com.solidfire.annotation.Since;
import static com.solidfire.javautil.Optional.of;
/**
* The Request object for the "CloneVolume" API Service call.
**/
public class CloneVolumeRequest {
private final Long volumeID;
private final String name;
private final Optional newAccountID;
private final Optional newSize;
private final Optional access;
private final Optional snapshotID;
private final Optional> attributes;
/**
* The Request object for the "CloneVolume" API Service call.
* @param volumeID [required] The ID of the volume to clone.
* @param name [required] The name for the newly-created volume.
* @param newAccountID (optional) AccountID for the owner of the new volume.
* @param newSize (optional) New size of the volume, in bytes.
* @param access (optional) Access settings for the new volume.
* @param snapshotID (optional) ID of the snapshot to use as the source of the clone.
* @param attributes (optional) List of Name/Value pairs in JSON object format.
* @since 7.0
**/
@Since("7.0")
public CloneVolumeRequest(Long volumeID, String name, Optional newAccountID, Optional newSize, Optional access, Optional snapshotID, Optional> attributes) {
this.name = name;
this.newSize = newSize;
this.newAccountID = newAccountID;
this.attributes = attributes;
this.volumeID = volumeID;
this.snapshotID = snapshotID;
this.access = access;
}
/**
* The ID of the volume to clone.
**/
public Long getVolumeID() {
return this.volumeID;
}
/**
* The name for the newly-created volume.
**/
public String getName() {
return this.name;
}
/**
* AccountID for the owner of the new volume.
* If unspecified, the AccountID of the owner of the volume being cloned is used.
**/
public Optional getNewAccountID() {
return this.newAccountID;
}
/**
* New size of the volume, in bytes.
* May be greater or less than the size of the volume being cloned.
* If unspecified, the clone's volume size will be the same as the source volume.
* Size is rounded up to the nearest 1 MiB.
**/
public Optional getNewSize() {
return this.newSize;
}
/**
* Access settings for the new volume.
*
readOnly: Only read operations are allowed.
*
readWrite: Reads and writes are allowed.
*
locked: No reads or writes are allowed.
*
replicationTarget: Identify a volume as the target volume for a paired set of volumes. If the volume is not paired, the access status is locked.
*
* If unspecified, the access settings of the clone will be the same as the source.
**/
public Optional getAccess() {
return this.access;
}
/**
* ID of the snapshot to use as the source of the clone.
* If unspecified, the clone will be created with a snapshot of the active volume.
**/
public Optional getSnapshotID() {
return this.snapshotID;
}
/**
* List of Name/Value pairs in JSON object format.
**/
public Optional> getAttributes() {
return this.attributes;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
CloneVolumeRequest that = (CloneVolumeRequest) o;
return Objects.equals( volumeID , that.volumeID )
&& Objects.equals( name , that.name )
&& Objects.equals( newAccountID , that.newAccountID )
&& Objects.equals( newSize , that.newSize )
&& Objects.equals( access , that.access )
&& Objects.equals( snapshotID , that.snapshotID )
&& Objects.equals( attributes , that.attributes );
}
@Override
public int hashCode() {
return Objects.hash( volumeID, name, newAccountID, newSize, access, snapshotID, attributes );
}
@Override
public String toString() {
final StringBuilder sb = new StringBuilder();
sb.append( "{ " );
sb.append(" volumeID : ").append(volumeID).append(",");
sb.append(" name : ").append(name).append(",");
if(null != newAccountID && newAccountID.isPresent())
sb.append(" newAccountID : ").append(newAccountID.get()).append(",");
if(null != newSize && newSize.isPresent())
sb.append(" newSize : ").append(newSize.get()).append(",");
if(null != access && access.isPresent())
sb.append(" access : ").append(access.get()).append(",");
if(null != snapshotID && snapshotID.isPresent())
sb.append(" snapshotID : ").append(snapshotID.get()).append(",");
if(null != attributes && attributes.isPresent())
sb.append(" attributes : ").append(attributes.get());
sb.append( " }" );
if(sb.lastIndexOf(", }") != -1)
sb.deleteCharAt(sb.lastIndexOf(", }"));
return sb.toString();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy