mirror of
https://github.com/apache/cloudstack
synced 2026-08-09 16:13:13 +00:00
Squashed commit of the following: commit f244f9ce7982db16984dd87c31545f1c0240c704 Merge: 993cbb0f5c8e38Author: Murali Reddy <muralimmreddy@gmail.com> Date: Mon May 20 18:54:05 2013 +0530 Merge branch 'master' into portablepublicip Conflicts: server/src/com/cloud/server/ManagementServerImpl.java server/test/org/apache/cloudstack/networkoffering/ChildTestConfiguration.java commit 993cbb0df9fa6e64b96b18ed775b73cdf4a8f5d7 Author: Murali Reddy <muralimmreddy@gmail.com> Date: Mon May 20 18:49:54 2013 +0530 introduce 'transferPortableIP' interface method in network manger. This method will transfer association of portable ip from one network to another network. commit 0c1c2652c1b39e9a81ca35464360e11ed9ef23f1 Merge:a718d35a29e393Author: Murali Reddy <muralimmreddy@gmail.com> Date: Fri May 17 02:48:54 2013 +0530 Merge branch 'master' into portablepublicip Conflicts: utils/src/com/cloud/utils/net/NetUtils.java commita718d353f7Merge:ecca117c211818Author: Murali Reddy <muralimmreddy@gmail.com> Date: Mon May 13 21:22:19 2013 +0530 Merge branch 'master' into portablepublicip Conflicts: api/src/org/apache/cloudstack/api/ResponseGenerator.java server/src/com/cloud/api/ApiResponseHelper.java server/src/com/cloud/network/NetworkServiceImpl.java server/src/com/cloud/network/addr/PublicIp.java server/src/com/cloud/server/ManagementServerImpl.java server/test/com/cloud/network/MockNetworkManagerImpl.java server/test/com/cloud/vpc/MockConfigurationManagerImpl.java server/test/com/cloud/vpc/MockNetworkManagerImpl.java setup/db/db/schema-410to420.sql commitecca117e34Author: Murali Reddy <muralimmreddy@gmail.com> Date: Mon May 13 20:05:29 2013 +0530 added integration tests for testing portable ip ranges commit895a27c277Author: Murali Reddy <muralimmreddy@gmail.com> Date: Mon May 13 15:12:19 2013 +0530 - establish model for transferring portable IP association from a network with which it is associated to another network. - enabling static nat api, extended to transfer potrtable IP across the networks if the VM/network is different from the current associate network of the portable ip commit51509751b2Author: Murali Reddy <muralimmreddy@gmail.com> Date: Mon May 13 12:05:33 2013 +0530 seperate out associate/disassociate with guest network operations from alloc and release of portable ip commitbd058f58c2Author: Murali Reddy <muralimmreddy@gmail.com> Date: Sun May 12 21:14:48 2013 +0530 enhance disasociateIPAddr API to release protable IP associated with a guest network or VPC commit27504d9098Author: Murali Reddy <muralimmreddy@gmail.com> Date: Sun May 12 16:53:45 2013 +0530 enhance asociateIPAddr API to acquire a protable IP and associate with a guest network or VPC commitf82c6a8431Merge:3dbfb440749013Author: Murali Reddy <muralimmreddy@gmail.com> Date: Sat May 11 23:32:13 2013 +0530 Merge branch 'master' into portablepublicip Conflicts: api/src/com/cloud/network/IpAddress.java api/src/org/apache/cloudstack/api/ResponseGenerator.java client/tomcatconf/commands.properties.in server/src/com/cloud/api/ApiResponseHelper.java server/src/com/cloud/configuration/ConfigurationManagerImpl.java server/src/com/cloud/server/ManagementServerImpl.java server/test/org/apache/cloudstack/affinity/AffinityApiTestConfiguration.java server/test/org/apache/cloudstack/networkoffering/ChildTestConfiguration.java setup/db/db/schema-410to420.sql commit3dbfb44eb5Author: Murali Reddy <muralimmreddy@gmail.com> Date: Sat May 11 20:33:19 2013 +0530 - add 'portable' boolean as property of IpAddress, persist the property in IPAddressVO, return the property in IpAddressResponse - add ability to request portable IP in associateIpAddress api commitbf3cb274cfAuthor: Murali Reddy <muralimmreddy@gmail.com> Date: Sat May 11 16:08:40 2013 +0530 add the status of each portable IP (its state, details of associated data center/VPC/guest network etc) in the PortableIpRangeResponse returned by listPortableIpRanges API commite7b2fb2255Author: Murali Reddy <muralimmreddy@gmail.com> Date: Sat May 11 14:36:01 2013 +0530 Introdcues notion of 'portable IP' pool at region level. Introduces root admin only API's to provision portable ip to a region - createPortableIpRange - deletePortableIpRange - listPortableIpRanges
295 lines
10 KiB
Java
295 lines
10 KiB
Java
// Licensed to the Apache Software Foundation (ASF) under one
|
|
// or more contributor license agreements. See the NOTICE file
|
|
// distributed with this work for additional information
|
|
// regarding copyright ownership. The ASF licenses this file
|
|
// to you 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.cloud.configuration;
|
|
|
|
import java.util.List;
|
|
|
|
import javax.naming.NamingException;
|
|
|
|
import com.cloud.exception.InvalidParameterValueException;
|
|
import com.cloud.exception.InsufficientCapacityException;
|
|
import com.cloud.exception.ConcurrentOperationException;
|
|
import com.cloud.exception.ResourceUnavailableException;
|
|
import com.cloud.exception.ResourceAllocationException;
|
|
import org.apache.cloudstack.api.command.admin.config.UpdateCfgCmd;
|
|
import org.apache.cloudstack.api.command.admin.ldap.LDAPConfigCmd;
|
|
import org.apache.cloudstack.api.command.admin.ldap.LDAPRemoveCmd;
|
|
import org.apache.cloudstack.api.command.admin.network.CreateNetworkOfferingCmd;
|
|
import org.apache.cloudstack.api.command.admin.network.DeleteNetworkOfferingCmd;
|
|
import org.apache.cloudstack.api.command.admin.network.UpdateNetworkOfferingCmd;
|
|
import org.apache.cloudstack.api.command.admin.offering.CreateDiskOfferingCmd;
|
|
import org.apache.cloudstack.api.command.admin.offering.CreateServiceOfferingCmd;
|
|
import org.apache.cloudstack.api.command.admin.offering.DeleteDiskOfferingCmd;
|
|
import org.apache.cloudstack.api.command.admin.offering.DeleteServiceOfferingCmd;
|
|
import org.apache.cloudstack.api.command.admin.offering.UpdateDiskOfferingCmd;
|
|
import org.apache.cloudstack.api.command.admin.offering.UpdateServiceOfferingCmd;
|
|
import org.apache.cloudstack.api.command.admin.pod.DeletePodCmd;
|
|
import org.apache.cloudstack.api.command.admin.pod.UpdatePodCmd;
|
|
import org.apache.cloudstack.api.command.admin.region.CreatePortableIpRangeCmd;
|
|
import org.apache.cloudstack.api.command.admin.region.DeletePortableIpRangeCmd;
|
|
import org.apache.cloudstack.api.command.admin.region.ListPortableIpRangesCmd;
|
|
import org.apache.cloudstack.api.command.admin.vlan.CreateVlanIpRangeCmd;
|
|
import org.apache.cloudstack.api.command.admin.vlan.DedicatePublicIpRangeCmd;
|
|
import org.apache.cloudstack.api.command.admin.vlan.DeleteVlanIpRangeCmd;
|
|
import org.apache.cloudstack.api.command.admin.vlan.ReleasePublicIpRangeCmd;
|
|
import org.apache.cloudstack.api.command.admin.zone.CreateZoneCmd;
|
|
import org.apache.cloudstack.api.command.admin.zone.DeleteZoneCmd;
|
|
import org.apache.cloudstack.api.command.admin.zone.UpdateZoneCmd;
|
|
import org.apache.cloudstack.api.command.user.network.ListNetworkOfferingsCmd;
|
|
|
|
import com.cloud.dc.DataCenter;
|
|
import com.cloud.dc.Pod;
|
|
import com.cloud.dc.Vlan;
|
|
import com.cloud.network.Networks.TrafficType;
|
|
import com.cloud.offering.DiskOffering;
|
|
import com.cloud.offering.NetworkOffering;
|
|
import com.cloud.offering.ServiceOffering;
|
|
import com.cloud.user.Account;
|
|
import org.apache.cloudstack.region.PortableIp;
|
|
import org.apache.cloudstack.region.PortableIpRange;
|
|
|
|
public interface ConfigurationService {
|
|
|
|
/**
|
|
* Updates a configuration entry with a new value
|
|
*
|
|
* @param cmd
|
|
* - the command wrapping name and value parameters
|
|
* @return updated configuration object if successful
|
|
*/
|
|
Configuration updateConfiguration(UpdateCfgCmd cmd) throws InvalidParameterValueException;
|
|
|
|
/**
|
|
* Create a service offering through the API
|
|
*
|
|
* @param cmd
|
|
* the command object that specifies the name, number of cpu cores, amount of RAM, etc. for the service
|
|
* offering
|
|
* @return the newly created service offering if successful, null otherwise
|
|
*/
|
|
ServiceOffering createServiceOffering(CreateServiceOfferingCmd cmd);
|
|
|
|
/**
|
|
* Updates a service offering
|
|
*
|
|
* @param serviceOfferingId
|
|
* @param userId
|
|
* @param name
|
|
* @param displayText
|
|
* @param offerHA
|
|
* @param useVirtualNetwork
|
|
* @param tags
|
|
* @return updated service offering
|
|
*/
|
|
ServiceOffering updateServiceOffering(UpdateServiceOfferingCmd cmd);
|
|
|
|
/**
|
|
* Deletes a service offering
|
|
*
|
|
* @param userId
|
|
* @param serviceOfferingId
|
|
*/
|
|
boolean deleteServiceOffering(DeleteServiceOfferingCmd cmd);
|
|
|
|
/**
|
|
* Updates a disk offering
|
|
*
|
|
* @param cmd
|
|
* - the command specifying diskOfferingId, name, description, tags
|
|
* @return updated disk offering
|
|
* @throws
|
|
*/
|
|
DiskOffering updateDiskOffering(UpdateDiskOfferingCmd cmd);
|
|
|
|
/**
|
|
* Deletes a disk offering
|
|
*
|
|
* @param cmd
|
|
* - the command specifying disk offering id
|
|
* @return true or false
|
|
* @throws
|
|
*/
|
|
boolean deleteDiskOffering(DeleteDiskOfferingCmd cmd);
|
|
|
|
/**
|
|
* Creates a new disk offering
|
|
*
|
|
* @param domainId
|
|
* @param name
|
|
* @param description
|
|
* @param numGibibytes
|
|
* @param mirrored
|
|
* @param size
|
|
* @return ID
|
|
*/
|
|
DiskOffering createDiskOffering(CreateDiskOfferingCmd cmd);
|
|
|
|
/**
|
|
* Creates a new pod based on the parameters specified in the command object
|
|
*
|
|
* @param zoneId
|
|
* TODO
|
|
* @param name
|
|
* TODO
|
|
* @param startIp
|
|
* TODO
|
|
* @param endIp
|
|
* TODO
|
|
* @param gateway
|
|
* TODO
|
|
* @param netmask
|
|
* TODO
|
|
* @param allocationState
|
|
* TODO
|
|
* @return the new pod if successful, null otherwise
|
|
* @throws
|
|
* @throws
|
|
*/
|
|
Pod createPod(long zoneId, String name, String startIp, String endIp, String gateway, String netmask, String allocationState);
|
|
|
|
/**
|
|
* Edits a pod in the database. Will not allow you to edit pods that are being used anywhere in the system.
|
|
*
|
|
* @param UpdatePodCmd
|
|
* api command
|
|
*/
|
|
Pod editPod(UpdatePodCmd cmd);
|
|
|
|
/**
|
|
* Deletes a pod from the database. Will not allow you to delete pods that are being used anywhere in the system.
|
|
*
|
|
* @param cmd
|
|
* - the command containing podId
|
|
* @return true or false
|
|
* @throws ,
|
|
*/
|
|
boolean deletePod(DeletePodCmd cmd);
|
|
|
|
/**
|
|
* Creates a new zone
|
|
*
|
|
* @param cmd
|
|
* @return the zone if successful, null otherwise
|
|
* @throws
|
|
* @throws
|
|
*/
|
|
DataCenter createZone(CreateZoneCmd cmd);
|
|
|
|
/**
|
|
* Edits a zone in the database. Will not allow you to edit DNS values if there are VMs in the specified zone.
|
|
*
|
|
* @param UpdateZoneCmd
|
|
* @return Updated zone
|
|
*/
|
|
DataCenter editZone(UpdateZoneCmd cmd);
|
|
|
|
/**
|
|
* Deletes a zone from the database. Will not allow you to delete zones that are being used anywhere in the system.
|
|
*
|
|
* @param userId
|
|
* @param zoneId
|
|
*/
|
|
boolean deleteZone(DeleteZoneCmd cmd);
|
|
|
|
/**
|
|
* Adds a VLAN to the database, along with an IP address range. Can add three types of VLANs: (1) zone-wide VLANs on
|
|
* the
|
|
* virtual public network (2) pod-wide direct attached VLANs (3) account-specific direct attached VLANs
|
|
*
|
|
* @param userId
|
|
* @param vlanType
|
|
* - either "DomR" (VLAN for a virtual public network) or "DirectAttached" (VLAN for IPs that will be
|
|
* directly
|
|
* attached to UserVMs)
|
|
* @param zoneId
|
|
* @param accountId
|
|
* @param podId
|
|
* @param add
|
|
* @param vlanId
|
|
* @param gateway
|
|
* @param startIP
|
|
* @param endIP
|
|
* @throws ResourceAllocationException TODO
|
|
* @throws
|
|
* @return The new Vlan object
|
|
*/
|
|
Vlan createVlanAndPublicIpRange(CreateVlanIpRangeCmd cmd) throws InsufficientCapacityException, ConcurrentOperationException, ResourceUnavailableException, ResourceAllocationException;
|
|
|
|
/**
|
|
* Marks the the account with the default zone-id.
|
|
*
|
|
* @param accountName
|
|
* @param domainId
|
|
* @param zoneId
|
|
* @return The new account object
|
|
* @throws ,
|
|
*/
|
|
Account markDefaultZone(String accountName, long domainId, long defaultZoneId);
|
|
|
|
boolean deleteVlanIpRange(DeleteVlanIpRangeCmd cmd);
|
|
|
|
Vlan dedicatePublicIpRange(DedicatePublicIpRangeCmd cmd) throws ResourceAllocationException;
|
|
|
|
boolean releasePublicIpRange(ReleasePublicIpRangeCmd cmd);
|
|
|
|
NetworkOffering createNetworkOffering(CreateNetworkOfferingCmd cmd);
|
|
|
|
NetworkOffering updateNetworkOffering(UpdateNetworkOfferingCmd cmd);
|
|
|
|
List<? extends NetworkOffering> searchForNetworkOfferings(ListNetworkOfferingsCmd cmd);
|
|
|
|
boolean deleteNetworkOffering(DeleteNetworkOfferingCmd cmd);
|
|
|
|
NetworkOffering getNetworkOffering(long id);
|
|
|
|
Integer getNetworkOfferingNetworkRate(long networkOfferingId, Long dataCenterId);
|
|
|
|
Account getVlanAccount(long vlanId);
|
|
|
|
List<? extends NetworkOffering> listNetworkOfferings(TrafficType trafficType, boolean systemOnly);
|
|
|
|
DataCenter getZone(long id);
|
|
|
|
ServiceOffering getServiceOffering(long serviceOfferingId);
|
|
|
|
Long getDefaultPageSize();
|
|
|
|
Integer getServiceOfferingNetworkRate(long serviceOfferingId, Long dataCenterId);
|
|
|
|
DiskOffering getDiskOffering(long diskOfferingId);
|
|
|
|
boolean updateLDAP(LDAPConfigCmd cmd) throws NamingException;
|
|
|
|
boolean removeLDAP(LDAPRemoveCmd cmd);
|
|
|
|
LDAPConfigCmd listLDAPConfig(LDAPConfigCmd cmd);
|
|
|
|
/**
|
|
* @param offering
|
|
* @return
|
|
*/
|
|
boolean isOfferingForVpc(NetworkOffering offering);
|
|
|
|
PortableIpRange createPortableIpRange(CreatePortableIpRangeCmd cmd) throws ConcurrentOperationException;
|
|
|
|
boolean deletePortableIpRange(DeletePortableIpRangeCmd cmd);
|
|
|
|
List<? extends PortableIpRange> listPortableIpRanges(ListPortableIpRangesCmd cmd);
|
|
|
|
List<? extends PortableIp> listPortableIps(long id);
|
|
}
|