-
Notifications
You must be signed in to change notification settings - Fork 78
Expand file tree
/
Copy pathConfigurationManager.java
More file actions
229 lines (204 loc) · 7.66 KB
/
ConfigurationManager.java
File metadata and controls
229 lines (204 loc) · 7.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
// Copyright 2012 Citrix Systems, Inc. Licensed under the
// Apache License, Version 2.0 (the "License"); you may not use this
// file except in compliance with the License. Citrix Systems, Inc.
// reserves all rights not expressly granted by 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.
//
// Automatically generated by addcopyright.py at 04/03/2012
package com.cloud.configuration;
import java.util.List;
import java.util.Map;
import java.util.Set;
import com.cloud.dc.ClusterVO;
import com.cloud.dc.DataCenter;
import com.cloud.dc.DataCenter.NetworkType;
import com.cloud.dc.DataCenterVO;
import com.cloud.dc.HostPodVO;
import com.cloud.dc.Pod;
import com.cloud.dc.Vlan;
import com.cloud.exception.ConcurrentOperationException;
import com.cloud.exception.InsufficientCapacityException;
import com.cloud.exception.InvalidParameterValueException;
import com.cloud.network.Network;
import com.cloud.network.Network.Capability;
import com.cloud.network.Network.Provider;
import com.cloud.network.Network.Service;
import com.cloud.network.Networks.TrafficType;
import com.cloud.offering.DiskOffering;
import com.cloud.offering.NetworkOffering.Availability;
import com.cloud.offerings.NetworkOfferingVO;
import com.cloud.org.Grouping.AllocationState;
import com.cloud.service.ServiceOfferingVO;
import com.cloud.storage.DiskOfferingVO;
import com.cloud.user.Account;
import com.cloud.utils.component.Manager;
import com.cloud.vm.VirtualMachine;
/**
* ConfigurationManager handles adding pods/zones, changing IP ranges, enabling external firewalls, and editing
* configuration values
*
*/
public interface ConfigurationManager extends ConfigurationService, Manager {
/**
* Updates a configuration entry with a new value
*
* @param userId
* @param name
* @param value
*/
void updateConfiguration(long userId, String name, String category, String value);
/**
* Creates a new service offering
*
* @param name
* @param cpu
* @param ramSize
* @param speed
* @param displayText
* @param localStorageRequired
* @param offerHA
* @param domainId
* @param hostTag
* @param networkRate
* TODO
* @param id
* @param useVirtualNetwork
* @return ID
*/
ServiceOfferingVO createServiceOffering(long userId, boolean isSystem, VirtualMachine.Type vm_typeType, String name, int cpu, int ramSize, int speed, String displayText, boolean localStorageRequired,
boolean offerHA, boolean limitResourceUse, String tags, Long domainId, String hostTag, Integer networkRate);
/**
* Creates a new disk offering
*
* @param domainId
* @param name
* @param description
* @param numGibibytes
* @param tags
* @param isCustomized
* @return newly created disk offering
*/
DiskOfferingVO createDiskOffering(Long domainId, String name, String description, Long numGibibytes, String tags, boolean isCustomized);
/**
* Creates a new pod
*
* @param userId
* @param podName
* @param zoneId
* @param gateway
* @param cidr
* @param startIp
* @param endIp
* @param allocationState
* @param skipGatewayOverlapCheck
* (true if it is ok to not validate that gateway IP address overlap with Start/End IP of the POD)
* @return Pod
*/
HostPodVO createPod(long userId, String podName, long zoneId, String gateway, String cidr, String startIp, String endIp, String allocationState, boolean skipGatewayOverlapCheck);
/**
* Creates a new zone
*
* @param userId
* @param zoneName
* @param dns1
* @param dns2
* @param internalDns1
* @param internalDns2
* @param guestCidr
* @param zoneType
* @param allocationState
* @param networkDomain
* TODO
* @param isSecurityGroupEnabled
* TODO
* @return
* @throws
* @throws
*/
DataCenterVO createZone(long userId, String zoneName, String dns1, String dns2, String internalDns1, String internalDns2, String guestCidr, String domain, Long domainId, NetworkType zoneType, String allocationState,
String networkDomain, boolean isSecurityGroupEnabled);
/**
* Deletes a VLAN from the database, along with all of its IP addresses. Will not delete VLANs that have allocated
* IP addresses.
*
* @param userId
* @param vlanDbId
* @param caller TODO
* @return success/failure
*/
boolean deleteVlanAndPublicIpRange(long userId, long vlanDbId, Account caller);
/**
* Converts a comma separated list of tags to a List
*
* @param tags
* @return List of tags
*/
List<String> csvTagsToList(String tags);
/**
* Converts a List of tags to a comma separated list
*
* @param tags
* @return String containing a comma separated list of tags
*/
String listToCsvTags(List<String> tags);
void checkZoneAccess(Account caller, DataCenter zone);
void checkDiskOfferingAccess(Account caller, DiskOffering dof);
/**
* Creates a new network offering
*
* @param name
* @param displayText
* @param trafficType
* @param tags
* @param networkRate
* TODO
* @param serviceProviderMap
* TODO
* @param isDefault
* TODO
* @param type
* TODO
* @param systemOnly
* TODO
* @param serviceOfferingId
* @param specifyIpRanges
* TODO
* @param id
* @param specifyVlan
* ;
* @param conserveMode
* ;
* @return network offering object
*/
NetworkOfferingVO createNetworkOffering(long userId, String name, String displayText, TrafficType trafficType, String tags, boolean specifyVlan, Availability availability, Integer networkRate,
Map<Service, Set<Provider>> serviceProviderMap, boolean isDefault, Network.GuestType type, boolean systemOnly, Long serviceOfferingId, boolean conserveMode,
Map<Service, Map<Capability, String>> serviceCapabilityMap, boolean specifyIpRanges);
Vlan createVlanAndPublicIpRange(long zoneId, long networkId, long physicalNetworkId, boolean forVirtualNetwork, Long podId, String startIP, String endIP, String vlanGateway, String vlanNetmask, String vlanId, Account vlanOwner) throws InsufficientCapacityException, ConcurrentOperationException, InvalidParameterValueException;
void createDefaultSystemNetworks(long zoneId) throws ConcurrentOperationException;
HostPodVO getPod(long id);
ClusterVO getCluster(long id);
boolean deleteAccountSpecificVirtualRanges(long accountId);
/**
* Edits a pod in the database. Will not allow you to edit pods that are being used anywhere in the system.
*
* @param id
* @param name
* @param startIp
* @param endIp
* @param gateway
* @param netmask
* @param allocationState
* @return Pod
* @throws
* @throws
*/
Pod editPod(long id, String name, String startIp, String endIp, String gateway, String netmask, String allocationStateStr);
void checkPodCidrSubnets(long zoneId, Long podIdToBeSkipped, String cidr);
AllocationState findPodAllocationState(HostPodVO pod);
AllocationState findClusterAllocationState(ClusterVO cluster);
}