com.huawei.openstack4j.openstack.storage.block.domain.CinderBlockLimits Maven / Gradle / Ivy
/*******************************************************************************
* Copyright 2016 ContainX and OpenStack4j
*
* 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.
*******************************************************************************/
package com.huawei.openstack4j.openstack.storage.block.domain;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonRootName;
import com.huawei.openstack4j.model.storage.block.BlockLimits;
import com.google.common.base.MoreObjects;
/**
* Show absolute limits for a tenant
*
* @author Jeremy Unruh
*/
@JsonRootName("limits")
@JsonIgnoreProperties(ignoreUnknown=true)
public class CinderBlockLimits implements BlockLimits {
@JsonProperty
private CinderAbsoluteLimit absolute;
@Override
public Absolute getAbsolute() {
return absolute;
}
@Override
public String toString() {
return MoreObjects.toStringHelper(this).omitNullValues().add("absolute", absolute).toString();
}
public static class CinderAbsoluteLimit implements Absolute {
private int totalSnapshotsUsed;
private int maxTotalBackups;
private int maxTotalVolumeGigabytes;
private int maxTotalSnapshots;
private int maxTotalBackupGigabytes;
private int totalBackupGigabytesUsed;
private int maxTotalVolumes;
private int totalVolumesUsed;
private int totalBackupsUsed;
private int totalGigabytesUsed;
@Override
public int getTotalSnapshotsUsed() {
return totalSnapshotsUsed;
}
@Override
public int getMaxTotalBackups() {
return maxTotalBackups;
}
@Override
public int getMaxTotalVolumeGigabytes() {
return maxTotalVolumeGigabytes;
}
@Override
public int getMaxTotalSnapshots() {
return maxTotalSnapshots;
}
@Override
public int getMaxTotalBackupGigabytes() {
return maxTotalBackupGigabytes;
}
@Override
public int getTotalBackupGigabytesUsed() {
return totalBackupGigabytesUsed;
}
@Override
public int getMaxTotalVolumes() {
return maxTotalVolumes;
}
@Override
public int getTotalVolumesUsed() {
return totalVolumesUsed;
}
@Override
public int getTotalBackupsUsed() {
return totalBackupsUsed;
}
@Override
public int getTotalGigabytesUsed() {
return totalGigabytesUsed;
}
@Override
public String toString() {
return MoreObjects.toStringHelper(this)
.add("totalSnapshotsUsed", totalSnapshotsUsed).add("maxTotalBackups", maxTotalBackups)
.add("maxTotalVolumeGigabytes", maxTotalVolumeGigabytes).add("maxTotalSnapshots", maxTotalSnapshots)
.add("maxTotalBackupGigabytes", maxTotalBackupGigabytes).add("totalBackupGigabytesUsed", totalBackupGigabytesUsed)
.add("maxTotalVolumes", maxTotalVolumes).add("totalVolumesUsed", totalVolumesUsed)
.add("totalBackupsUsed", totalBackupsUsed).add("totalGigabytesUsed", totalGigabytesUsed)
.toString();
}
}
}