|
| 1 | +//Licensed to the Apache Software Foundation (ASF) under one |
| 2 | +//or more contributor license agreements. See the NOTICE file |
| 3 | +//distributed with this work for additional information |
| 4 | +//regarding copyright ownership. The ASF licenses this file |
| 5 | +//to you under the Apache License, Version 2.0 (the |
| 6 | +//"License"); you may not use this file except in compliance |
| 7 | +//with the License. You may obtain a copy of the License at |
| 8 | +// |
| 9 | +//http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +// |
| 11 | +//Unless required by applicable law or agreed to in writing, |
| 12 | +//software distributed under the License is distributed on an |
| 13 | +//"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 14 | +//KIND, either express or implied. See the License for the |
| 15 | +//specific language governing permissions and limitations |
| 16 | +//under the License. |
| 17 | + |
| 18 | +package org.apache.cloudstack.api.response; |
| 19 | + |
| 20 | +import com.cloud.host.Host; |
| 21 | +import com.cloud.serializer.Param; |
| 22 | +import com.google.gson.annotations.SerializedName; |
| 23 | +import java.util.HashMap; |
| 24 | +import java.util.List; |
| 25 | +import java.util.Map; |
| 26 | +import org.apache.cloudstack.api.ApiConstants; |
| 27 | +import org.apache.cloudstack.api.BaseResponse; |
| 28 | +import org.apache.cloudstack.api.EntityReference; |
| 29 | + |
| 30 | +@EntityReference(value = Host.class) |
| 31 | +public class ListHostLunDevicesResponse extends BaseResponse { |
| 32 | + |
| 33 | + @SerializedName(ApiConstants.HOSTDEVICES_NAME) |
| 34 | + @Param(description = "Device names") |
| 35 | + private List<String> hostDevicesName; |
| 36 | + |
| 37 | + @SerializedName(ApiConstants.HOSTDEVICES_TEXT) |
| 38 | + @Param(description = "Device descriptions") |
| 39 | + private List<String> hostDevicesText; |
| 40 | + |
| 41 | + @SerializedName("vmallocations") |
| 42 | + @Param(description = "Map of device to VM allocations") |
| 43 | + private Map<String, String> vmAllocations; |
| 44 | + |
| 45 | + @SerializedName("haspartitions") |
| 46 | + @Param(description = "Map of devices indicating whether they have partitions") |
| 47 | + private Map<String, Boolean> partitionInfo = new HashMap<>(); |
| 48 | + |
| 49 | + public ListHostLunDevicesResponse(List<String> hostDevicesName, List<String> hostDevicesText) { |
| 50 | + this.hostDevicesName = hostDevicesName; |
| 51 | + this.hostDevicesText = hostDevicesText; |
| 52 | + } |
| 53 | + |
| 54 | + public ListHostLunDevicesResponse() { |
| 55 | + super(); |
| 56 | + this.setObjectName("listhostlundevices"); |
| 57 | + } |
| 58 | + |
| 59 | + public List<String> getHostDevicesNames() { |
| 60 | + return hostDevicesName; |
| 61 | + } |
| 62 | + |
| 63 | + public List<String> getHostDevicesTexts() { |
| 64 | + return hostDevicesText; |
| 65 | + } |
| 66 | + |
| 67 | + public void setHostDevicesNames(List<String> hostDevicesName) { |
| 68 | + this.hostDevicesName = hostDevicesName; |
| 69 | + } |
| 70 | + |
| 71 | + public void setHostDevicesTexts(List<String> hostDevicesText) { |
| 72 | + this.hostDevicesText = hostDevicesText; |
| 73 | + } |
| 74 | + |
| 75 | + public void setVmAllocations(Map<String, String> vmAllocations) { |
| 76 | + this.vmAllocations = vmAllocations; |
| 77 | + } |
| 78 | + |
| 79 | + public Map<String, String> getVmAllocations() { |
| 80 | + return this.vmAllocations; |
| 81 | + } |
| 82 | + |
| 83 | + public Map<String, Boolean> getPartitionInfo() { |
| 84 | + return partitionInfo; |
| 85 | + } |
| 86 | + |
| 87 | + public void setPartitionInfo(Map<String, Boolean> partitionInfo) { |
| 88 | + this.partitionInfo = partitionInfo; |
| 89 | + } |
| 90 | + |
| 91 | + public void addPartitionInfo(String deviceName, boolean hasPartition) { |
| 92 | + if (this.partitionInfo == null) { |
| 93 | + this.partitionInfo = new HashMap<>(); |
| 94 | + } |
| 95 | + this.partitionInfo.put(deviceName, hasPartition); |
| 96 | + } |
| 97 | +} |
0 commit comments