You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by al...@apache.org on 2012/08/03 03:54:13 UTC
[2/30] git commit: Merge branch 'master' into vpc
Merge branch 'master' into vpc
Conflicts:
api/src/com/cloud/api/ApiConstants.java
Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/0e0b75a0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/0e0b75a0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/0e0b75a0
Branch: refs/heads/vpc
Commit: 0e0b75a04149b0437cbfd8fcbd6116d5fa631129
Parents: d6df2fd befd6dd
Author: Alena Prokharchyk <al...@citrix.com>
Authored: Thu Aug 2 18:18:04 2012 -0700
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Thu Aug 2 18:45:37 2012 -0700
----------------------------------------------------------------------
agent-simulator/scripts/__old__/deletePod.sh | 26 --
.../scripts/__old__/deleteServiceOffering.sh | 25 --
agent-simulator/scripts/__old__/deleteVlan.sh | 26 --
.../scripts/__old__/deployVirtualMachine.sh | 26 --
agent-simulator/scripts/__old__/listRouters.sh | 22 --
.../scripts/__old__/listVirtualMachine.sh | 22 --
.../scripts/__old__/queryAsyncJobResult.sh | 53 ---
agent-simulator/scripts/__old__/run.sh | 25 --
agent-simulator/scripts/__old__/setupDirectPods.sh | 31 --
agent-simulator/scripts/__old__/setupHosts.sh | 23 --
.../scripts/__old__/setupPodAndNetwork.sh | 39 ---
.../scripts/__old__/setupServiceOffering.sh | 24 --
agent-simulator/scripts/__old__/setupVlan.sh | 26 --
.../scripts/__old__/simulator_advanced.sh | 55 ---
agent-simulator/scripts/__old__/simulator_basic.sh | 53 ---
agent-simulator/scripts/__old__/startRouter.sh | 26 --
agent-simulator/scripts/__old__/testQuery.sh | 22 --
agent-simulator/scripts/addHostStats.py | 52 ---
agent-simulator/scripts/addHosts.png | Bin 44302 -> 0 bytes
.../scripts/guava/__old__/1000routers.sh | 37 --
.../scripts/guava/__old__/createAdminAccount.sh | 24 --
.../scripts/guava/__old__/createStoragePool.sh | 20 --
.../scripts/guava/__old__/createUserAccount.sh | 24 --
.../scripts/guava/__old__/deleteAccount.sh | 25 --
agent-simulator/scripts/guava/__old__/deletePod.sh | 26 --
.../scripts/guava/__old__/deleteServiceOffering.sh | 25 --
.../scripts/guava/__old__/deleteVlan.sh | 26 --
.../scripts/guava/__old__/deployVirtualMachine.sh | 27 --
.../scripts/guava/__old__/destroyVirtualMachine.sh | 25 --
.../scripts/guava/__old__/listCapacity.sh | 22 --
.../scripts/guava/__old__/listEvents.sh | 22 --
agent-simulator/scripts/guava/__old__/listHosts.sh | 22 --
.../scripts/guava/__old__/listRouters.sh | 22 --
.../scripts/guava/__old__/listTemplates.sh | 22 --
.../scripts/guava/__old__/listVirtualMachine.sh | 22 --
agent-simulator/scripts/guava/__old__/load.sh | 31 --
.../scripts/guava/__old__/networkShutDown.sh | 24 --
.../scripts/guava/__old__/networkStart.sh | 24 --
.../scripts/guava/__old__/reconnectStats.sh | 28 --
agent-simulator/scripts/guava/__old__/setup.sh | 44 ---
.../scripts/guava/__old__/setupDirectPods.sh | 31 --
.../scripts/guava/__old__/setupHosts.sh | 23 --
.../scripts/guava/__old__/setupPodAndNetwork.sh | 39 ---
.../scripts/guava/__old__/setupServiceOffering.sh | 24 --
agent-simulator/scripts/guava/__old__/setupVlan.sh | 26 --
.../scripts/guava/__old__/startRouter.sh | 26 --
.../scripts/guava/__old__/startVirtualMachine.sh | 26 --
.../scripts/guava/__old__/stopVirtualMachine.sh | 26 --
agent-simulator/scripts/guava/__old__/stress.sh | 55 ---
agent-simulator/scripts/guava/__old__/stress2.sh | 127 -------
agent-simulator/scripts/guava/setup.py | 147 --------
.../scripts/guava/tests/testProvision.py | 139 --------
agent-simulator/scripts/kumquat/setup.py | 194 -----------
.../scripts/kumquat/tests/testProvision.py | 259 ---------------
agent-simulator/scripts/run.bat | 19 -
.../scripts/zucchini/__old__/deletePod.sh | 26 --
.../zucchini/__old__/deleteServiceOffering.sh | 25 --
.../scripts/zucchini/__old__/deleteVlan.sh | 26 --
.../scripts/zucchini/__old__/deployBulk-sg.sh | 206 ------------
.../scripts/zucchini/__old__/deployBulk.sh | 159 ---------
.../zucchini/__old__/deployVirtualMachine.sh | 26 --
.../scripts/zucchini/__old__/destroySystemVm.sh | 52 ---
.../zucchini/__old__/destroyVirtualMachine.sh | 25 --
.../scripts/zucchini/__old__/listCapacity.sh | 22 --
.../scripts/zucchini/__old__/listEvents.sh | 22 --
.../scripts/zucchini/__old__/listHosts.sh | 22 --
.../scripts/zucchini/__old__/listRouters.sh | 22 --
.../scripts/zucchini/__old__/listTemplates.sh | 22 --
.../scripts/zucchini/__old__/listVirtualMachine.sh | 22 --
.../scripts/zucchini/__old__/monitor.sh | 36 --
.../scripts/zucchini/__old__/newsetup.sh | 228 -------------
.../scripts/zucchini/__old__/reconnectStats.sh | 28 --
agent-simulator/scripts/zucchini/__old__/setup.sh | 90 -----
.../scripts/zucchini/__old__/setupDirectPods.sh | 31 --
.../scripts/zucchini/__old__/setupHosts.sh | 23 --
.../scripts/zucchini/__old__/setupPodAndNetwork.sh | 39 ---
.../zucchini/__old__/setupServiceOffering.sh | 24 --
.../scripts/zucchini/__old__/setupVlan.sh | 26 --
.../scripts/zucchini/__old__/setup_sg.sh | 252 --------------
agent-simulator/scripts/zucchini/__old__/small.sh | 158 ---------
.../scripts/zucchini/__old__/so_setup.sh | 21 --
.../scripts/zucchini/__old__/startRouter.sh | 26 --
.../zucchini/__old__/startVirtualMachine.sh | 26 --
.../scripts/zucchini/__old__/stopRouter.sh | 49 ---
.../scripts/zucchini/__old__/stopVirtualMachine.sh | 49 ---
.../scripts/zucchini/__old__/zucchini219.sh | 119 -------
agent-simulator/scripts/zucchini/setup.py | 217 ------------
.../scripts/zucchini/tests/testListVm.py | 53 ---
.../scripts/zucchini/tests/testProvision.py | 184 ----------
.../scripts/zucchini/zucchini.configuration.sql | 46 ---
api/src/com/cloud/api/ApiConstants.java | 2 +
api/src/com/cloud/api/commands/CreateVPCCmd.java | 4 +
api/src/com/cloud/api/commands/DeleteVPCCmd.java | 3 +
api/src/com/cloud/api/commands/ListVMsCmd.java | 17 +-
api/src/com/cloud/api/commands/RestartVPCCmd.java | 3 +
api/src/com/cloud/api/commands/UpdateVPCCmd.java | 2 +
build/build-cloud.xml | 1 +
build/developer.xml | 2 +
cloud.spec | 25 ++-
console-proxy/.classpath | 18 +
console-proxy/.project | 18 +
console-proxy/conf.dom0/consoleproxy.properties.in | 17 +
console-proxy/conf.dom0/log4j-cloud.xml.in | 18 +
console-proxy/conf/agent.properties | 17 +
console-proxy/conf/consoleproxy.properties | 17 +
console-proxy/conf/log4j-cloud.xml | 18 +
console-proxy/scripts/run.bat | 17 +
console-proxy/ui/viewer-update.ftl | 20 +-
core/.classpath | 18 +
core/.project | 18 +
debian/cloud-agent-deps.install | 17 +
debian/cloud-agent-libs.install | 17 +
debian/cloud-agent-scripts.config | 17 +
debian/cloud-agent-scripts.install | 17 +
debian/cloud-agent-scripts.postinst | 16 +
debian/cloud-agent.config | 17 +
debian/cloud-agent.install | 17 +
debian/cloud-agent.postinst | 18 +-
debian/cloud-cli.config | 17 +
debian/cloud-cli.install | 17 +
debian/cloud-client-ui.install | 17 +
debian/cloud-client.config | 17 +
debian/cloud-client.install | 17 +
debian/cloud-client.postinst | 16 +
debian/cloud-core.install | 17 +
debian/cloud-deps.install | 17 +
debian/cloud-management.config | 17 +
debian/cloud-python.install | 17 +
debian/cloud-server.install | 17 +
debian/cloud-setup.install | 17 +
debian/cloud-system-iso.install | 17 +
debian/cloud-usage.install | 17 +
debian/cloud-usage.postinst | 18 +-
debian/cloud-utils.install | 17 +
deps/.classpath | 18 +
deps/.project | 18 +
docs/en-US/Author_Group.xml | 21 ++-
docs/en-US/Book_Info.xml | 29 ++-
docs/en-US/about-pods.xml | 23 ++-
docs/en-US/about-virtual-networks.xml | 23 ++-
docs/en-US/about-working-with-vms.xml | 32 ++-
docs/en-US/accept-membership-invite.xml | 27 ++-
docs/en-US/accessing-vms.xml | 24 ++-
docs/en-US/accounts-users-domains.xml | 21 ++-
docs/en-US/accounts.xml | 21 ++-
docs/en-US/acquire-new-ip-address.xml | 23 ++-
docs/en-US/add-additional-guest-network.xml | 26 ++-
docs/en-US/add-ingress-egress-rules.xml | 80 ++---
docs/en-US/add-iso.xml | 31 ++-
docs/en-US/add-load-balancer-rule.xml | 25 ++-
docs/en-US/add-members-to-projects.xml | 23 ++-
.../en-US/add-password-management-to-templates.xml | 25 ++-
docs/en-US/add-projects-members-from-ui.xml | 23 ++-
docs/en-US/add-security-group.xml | 23 ++-
docs/en-US/added-API-commands.xml | 27 ++-
docs/en-US/added-cloudPlatform-error-codes.xml | 22 ++-
.../adding-IP-addresses-for-the-public-network.xml | 23 ++-
docs/en-US/admin-alerts.xml | 21 ++-
docs/en-US/admin-guide.xml | 21 ++-
docs/en-US/advanced-zone-configuration.xml | 23 ++-
...dvanced-zone-physical-network-configuration.xml | 22 ++-
docs/en-US/alerts.xml | 18 +
docs/en-US/allocators.xml | 25 ++-
docs/en-US/api-reference.xml | 18 +
docs/en-US/appendix-a-time-zones.xml | 23 ++-
docs/en-US/asynchronous-commands-example.xml | 20 +-
docs/en-US/asynchronous-commands.xml | 21 +-
docs/en-US/attach-iso-to-vm.xml | 21 ++-
docs/en-US/attaching-volume.xml | 24 ++-
.../automatic-snapshot-creation-retention.xml | 32 ++-
docs/en-US/basic-zone-configuration.xml | 25 ++-
.../basic-zone-physical-network-configuration.xml | 21 ++-
docs/en-US/best-practices-for-vms.xml | 19 +-
docs/en-US/best-practices-primary-storage.xml | 22 ++-
docs/en-US/best-practices-secondary-storage.xml | 22 ++-
docs/en-US/best-practices-templates.xml | 21 ++-
docs/en-US/best-practices-virtual-router.xml | 23 ++-
...change-console-proxy-ssl-certificate-domain.xml | 27 ++-
docs/en-US/change-host-password.xml | 23 ++-
.../change-network-offering-on-guest-network.xml | 26 ++-
docs/en-US/change-to-behavior-of-list-commands.xml | 23 ++-
docs/en-US/changing-root-password.xml | 21 ++-
docs/en-US/changing-secondary-storage-ip.xml | 22 ++-
docs/en-US/changing-secondary-storage-servers.xml | 21 ++-
docs/en-US/changing-secondary-storage-serversp.xml | 23 ++-
docs/en-US/changing-service-offering-for-vm.xml | 23 ++-
docs/en-US/changing-vm-name-os-group.xml | 26 ++-
docs/en-US/cloud-infrastructure-concepts.xml | 23 ++-
docs/en-US/cloud-infrastructure-overview.xml | 22 ++-
docs/en-US/cloud_infrastructure_overview.xml | 19 +-
docs/en-US/cloudplatform-api.xml | 27 ++-
docs/en-US/cloudstack-admin.xml | 22 ++-
docs/en-US/cloudstack.ent | 2 +-
docs/en-US/cloudstack.xml | 23 ++-
docs/en-US/cloudstack_admin.xml | 21 ++-
docs/en-US/cloudstack_developers.xml | 21 ++-
docs/en-US/cloudstack_features.xml | 38 ++-
docs/en-US/cloudstack_installation.xml | 22 ++-
docs/en-US/cloudstack_system_requirements.xml | 25 ++-
docs/en-US/cloudstack_trial_installation.xml | 22 ++-
docs/en-US/cloudstack_whatis.xml | 41 ++-
docs/en-US/cluster-add.xml | 21 ++-
docs/en-US/compatibility-matrix.xml | 21 ++-
docs/en-US/compute-disk-service-offerings.xml | 25 ++-
docs/en-US/concepts.xml | 21 ++-
.../configure-guest-traffic-in-advanced-zone.xml | 25 ++-
...onfigure-public-traffic-in-an-advanced-zone.xml | 5 +-
docs/en-US/configure-usage-server.xml | 31 ++-
docs/en-US/configure-virtual-router.xml | 23 ++-
docs/en-US/configure-vpn.xml | 25 ++-
docs/en-US/configure-xenserver-dom-memory.xml | 21 ++-
docs/en-US/configure-xenserver-dom0-memory.xml | 21 ++-
docs/en-US/configuring-projects.xml | 23 ++-
docs/en-US/console-proxy.xml | 23 ++-
docs/en-US/contacting-support.xml | 19 +-
docs/en-US/convert-hyperv-vm-to-template.xml | 26 ++-
docs/en-US/create-bare-metal-template.xml | 35 ++-
docs/en-US/create-new-projects.xml | 26 ++-
docs/en-US/create-template-from-existing-vm.xml | 37 ++-
docs/en-US/create-template-from-snapshot.xml | 24 ++-
docs/en-US/create-templates-overview.xml | 26 ++-
docs/en-US/create-windows-template.xml | 21 ++-
docs/en-US/creating-compute-offerings.xml | 31 ++-
docs/en-US/creating-disk-offerings.xml | 29 ++-
docs/en-US/creating-network-offerings.xml | 51 ++--
docs/en-US/creating-new-volumes.xml | 28 ++-
docs/en-US/creating-system-service-offerings.xml | 29 ++-
docs/en-US/creating-vms.xml | 28 ++-
docs/en-US/customizing-dns.xml | 32 ++-
docs/en-US/dates-in-usage-record.xml | 18 +
docs/en-US/dedicated-ha-hosts.xml | 25 ++-
docs/en-US/default-account-resource-limit.xml | 24 ++-
docs/en-US/default-template.xml | 23 ++-
docs/en-US/delete-templates.xml | 21 ++-
docs/en-US/deleting-vms.xml | 24 ++-
docs/en-US/deployment-architecture-overview.xml | 23 ++-
docs/en-US/deployment_architecture_overview.xml | 24 ++-
docs/en-US/detach-move-volumes.xml | 26 ++-
docs/en-US/developer-getting-started.xml | 22 ++-
docs/en-US/developer-guide.xml | 21 ++-
docs/en-US/developer-introduction.xml | 21 ++-
docs/en-US/developer_guide.xml | 21 ++-
docs/en-US/disable-enable-zones-pods-clusters.xml | 23 ++-
docs/en-US/disk-volume-usage-record-format.xml | 19 +-
docs/en-US/dns-dhcp.xml | 21 ++-
docs/en-US/domains.xml | 22 ++-
.../kvm/storage/LibvirtStorageAdaptor.java | 3 +-
server/src/com/cloud/configuration/Config.java | 1 +
.../configuration/ConfigurationManagerImpl.java | 1 +
server/src/com/cloud/server/Criteria.java | 2 +
.../src/com/cloud/server/ManagementServerImpl.java | 2 +-
.../secondary/SecondaryStorageManagerImpl.java | 2 +-
server/src/com/cloud/test/DatabaseConfig.java | 2 +
server/src/com/cloud/vm/UserVmManagerImpl.java | 14 +
.../cloud/agent/manager/SearchCriteria2Test.java | 99 ------
setup/db/db/schema-303to40.sql | 3 +-
tools/devcloud/README | 32 ++-
tools/devcloud/basebuild/Vagrantfile | 2 +-
tools/devcloud/build_vagrant_basebox.sh | 65 ++++
ui/scripts/instances.js | 2 +-
ui/scripts/system.js | 23 +-
261 files changed, 3126 insertions(+), 5189 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/0e0b75a0/api/src/com/cloud/api/ApiConstants.java
----------------------------------------------------------------------
diff --cc api/src/com/cloud/api/ApiConstants.java
index 732fe81,08b9465..923385d
--- a/api/src/com/cloud/api/ApiConstants.java
+++ b/api/src/com/cloud/api/ApiConstants.java
@@@ -378,6 -366,8 +379,7 @@@ public class ApiConstants
public static final String NICIRA_NVP_TRANSPORT_ZONE_UUID = "transportzoneuuid";
public static final String NICIRA_NVP_DEVICE_NAME = "niciradevicename";
+
-
public enum HostDetails {
all, capacity, events, stats, min;
}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/0e0b75a0/api/src/com/cloud/api/commands/CreateVPCCmd.java
----------------------------------------------------------------------
diff --cc api/src/com/cloud/api/commands/CreateVPCCmd.java
index 22073ec,0000000..8a67f9f
mode 100644,000000..100644
--- a/api/src/com/cloud/api/commands/CreateVPCCmd.java
+++ b/api/src/com/cloud/api/commands/CreateVPCCmd.java
@@@ -1,180 -1,0 +1,184 @@@
+// 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.api.commands;
+
+import org.apache.log4j.Logger;
++
+import com.cloud.api.ApiConstants;
+import com.cloud.api.BaseAsyncCreateCmd;
+import com.cloud.api.BaseCmd;
+import com.cloud.api.IdentityMapper;
++import com.cloud.api.Implementation;
+import com.cloud.api.Parameter;
+import com.cloud.api.ServerApiException;
+import com.cloud.api.response.VpcResponse;
+import com.cloud.event.EventTypes;
+import com.cloud.exception.ConcurrentOperationException;
+import com.cloud.exception.InsufficientCapacityException;
+import com.cloud.exception.ResourceAllocationException;
+import com.cloud.exception.ResourceUnavailableException;
+import com.cloud.network.vpc.Vpc;
+import com.cloud.user.UserContext;
++
++@Implementation(description="Creates a VPC", responseObject=VpcResponse.class)
+public class CreateVPCCmd extends BaseAsyncCreateCmd{
+ public static final Logger s_logger = Logger.getLogger(CreateVPCCmd.class.getName());
+ private static final String s_name = "createvpcresponse";
+
+ /////////////////////////////////////////////////////
+ //////////////// API parameters /////////////////////
+ /////////////////////////////////////////////////////
+
+ @Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="the account associated with the VPC. " +
+ "Must be used with the domainId parameter.")
+ private String accountName;
+
+ @IdentityMapper(entityTableName="domain")
+ @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="the domain ID associated with the VPC. " +
+ "If used with the account parameter returns the VPC associated with the account for the specified domain.")
+ private Long domainId;
+
+ @IdentityMapper(entityTableName="data_center")
+ @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, required=true, description="the ID of the availability zone")
+ private Long zoneId;
+
+ @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, required=true, description="the name of the VPC")
+ private String vpcName;
+
+ @Parameter(name=ApiConstants.DISPLAY_TEXT, type=CommandType.STRING, required=true, description="the display text of " +
+ "the VPC")
+ private String displayText;
+
+ @Parameter(name=ApiConstants.CIDR, type=CommandType.STRING, required=true, description="the cidr of the VPC. All VPC " +
+ "guest networks' cidrs should be within this CIDR")
+ private String cidr;
+
+
+ @IdentityMapper(entityTableName="vpc_offerings")
+ @Parameter(name=ApiConstants.VPC_OFF_ID, type=CommandType.LONG, required=true, description="the ID of the VPC offering")
+ private Long vpcOffering;
+
+ @Parameter(name=ApiConstants.NETWORK_DOMAIN, type=CommandType.STRING, description="network domain")
+ private String networkDomain;
+
+ /////////////////////////////////////////////////////
+ /////////////////// Accessors ///////////////////////
+ /////////////////////////////////////////////////////
+
+ public String getAccountName() {
+ return accountName;
+ }
+
+ public Long getDomainId() {
+ return domainId;
+ }
+
+ public Long getZoneId() {
+ return zoneId;
+ }
+
+ public String getVpcName() {
+ return vpcName;
+ }
+
+ public String getCidr() {
+ return cidr;
+ }
+
+ public String getDisplayText() {
+ return displayText;
+ }
+
+ public Long getVpcOffering() {
+ return vpcOffering;
+ }
+
+ public String getNetworkDomain() {
+ return networkDomain;
+ }
+
+ @Override
+ public void create() throws ResourceAllocationException {
+ Vpc vpc = _vpcService.createVpc(getZoneId(), getVpcOffering(), getEntityOwnerId(), getVpcName(), getDisplayText(),
+ getCidr(), getNetworkDomain());
+ if (vpc != null) {
+ this.setEntityId(vpc.getId());
+ } else {
+ throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create a VPC");
+ }
+ }
+
+ @Override
+ public void execute() {
+ Vpc vpc = null;
+ try {
+ if (_vpcService.startVpc(this.getEntityId(), true)) {
+ vpc = _vpcService.getVpc(getEntityId());
+ }
+ } catch (ResourceUnavailableException ex) {
+ s_logger.warn("Exception: ", ex);
+ throw new ServerApiException(BaseCmd.RESOURCE_UNAVAILABLE_ERROR, ex.getMessage());
+ } catch (ConcurrentOperationException ex) {
+ s_logger.warn("Exception: ", ex);
+ throw new ServerApiException(BaseCmd.INTERNAL_ERROR, ex.getMessage());
+ } catch (InsufficientCapacityException ex) {
+ s_logger.info(ex);
+ s_logger.trace(ex);
+ throw new ServerApiException(BaseCmd.INSUFFICIENT_CAPACITY_ERROR, ex.getMessage());
+ }
+
+ if (vpc != null) {
+ VpcResponse response = _responseGenerator.createVpcResponse(vpc);
+ response.setResponseName(getCommandName());
+ this.setResponseObject(response);
+ } else {
+ throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create VPC");
+ }
+ }
+
+ @Override
+ public String getEntityTable() {
+ return "vpc";
+ }
+
+
+ @Override
+ public String getEventType() {
+ return EventTypes.EVENT_VPC_CREATE;
+ }
+
+
+ @Override
+ public String getEventDescription() {
+ return "creating VPC. Id: " + getEntityId();
+ }
+
+ @Override
+ public String getCommandName() {
+ return s_name;
+ }
+
+ @Override
+ public long getEntityOwnerId() {
+ Long accountId = finalyzeAccountId(accountName, domainId, null, true);
+ if (accountId == null) {
+ return UserContext.current().getCaller().getId();
+ }
+
+ return accountId;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/0e0b75a0/api/src/com/cloud/api/commands/DeleteVPCCmd.java
----------------------------------------------------------------------
diff --cc api/src/com/cloud/api/commands/DeleteVPCCmd.java
index 9a4a177,0000000..21b8402
mode 100644,000000..100644
--- a/api/src/com/cloud/api/commands/DeleteVPCCmd.java
+++ b/api/src/com/cloud/api/commands/DeleteVPCCmd.java
@@@ -1,104 -1,0 +1,107 @@@
+// 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.api.commands;
+
+import org.apache.log4j.Logger;
+
+import com.cloud.api.ApiConstants;
+import com.cloud.api.BaseAsyncCmd;
+import com.cloud.api.BaseCmd;
+import com.cloud.api.IdentityMapper;
++import com.cloud.api.Implementation;
+import com.cloud.api.Parameter;
+import com.cloud.api.ServerApiException;
+import com.cloud.api.response.SuccessResponse;
+import com.cloud.event.EventTypes;
+import com.cloud.exception.ConcurrentOperationException;
+import com.cloud.exception.ResourceUnavailableException;
+import com.cloud.network.vpc.Vpc;
+import com.cloud.user.Account;
+
++
++@Implementation(description="Deletes a VPC", responseObject=SuccessResponse.class)
+public class DeleteVPCCmd extends BaseAsyncCmd{
+ public static final Logger s_logger = Logger.getLogger(DeleteVPCCmd.class.getName());
+ private static final String s_name = "deletevpcresponse";
+
+ /////////////////////////////////////////////////////
+ //////////////// API parameters /////////////////////
+ /////////////////////////////////////////////////////
+
+ @IdentityMapper(entityTableName="vpc")
+ @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the ID of the VPC")
+ private Long id;
+
+
+ /////////////////////////////////////////////////////
+ /////////////////// Accessors ///////////////////////
+ /////////////////////////////////////////////////////
+
+ public Long getId() {
+ return id;
+ }
+
+
+ /////////////////////////////////////////////////////
+ /////////////// API Implementation///////////////////
+ /////////////////////////////////////////////////////
+
+ @Override
+ public String getEventType() {
+ return EventTypes.EVENT_VPC_DELETE;
+ }
+
+ @Override
+ public String getEventDescription() {
+ return "Deleting VPC id=" + getId();
+ }
+
+ @Override
+ public void execute() {
+ try {
+ boolean result = _vpcService.deleteVpc(getId());
+ if (result) {
+ SuccessResponse response = new SuccessResponse(getCommandName());
+ this.setResponseObject(response);
+ } else {
+ throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete VPC");
+ }
+ }catch (ResourceUnavailableException ex) {
+ s_logger.warn("Exception: ", ex);
+ throw new ServerApiException(BaseCmd.RESOURCE_UNAVAILABLE_ERROR, ex.getMessage());
+ } catch (ConcurrentOperationException ex) {
+ s_logger.warn("Exception: ", ex);
+ throw new ServerApiException(BaseCmd.INTERNAL_ERROR, ex.getMessage());
+ }
+ }
+
+ @Override
+ public String getCommandName() {
+ return s_name;
+ }
+
+ @Override
+ public long getEntityOwnerId() {
+ Vpc vpc = _entityMgr.findById(Vpc.class, getId());
+ if (vpc != null) {
+ return vpc.getAccountId();
+ }
+
+ return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/0e0b75a0/api/src/com/cloud/api/commands/RestartVPCCmd.java
----------------------------------------------------------------------
diff --cc api/src/com/cloud/api/commands/RestartVPCCmd.java
index 5a5e5dc,0000000..bbb5cdd
mode 100644,000000..100644
--- a/api/src/com/cloud/api/commands/RestartVPCCmd.java
+++ b/api/src/com/cloud/api/commands/RestartVPCCmd.java
@@@ -1,107 -1,0 +1,110 @@@
+// 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.api.commands;
+
+import org.apache.log4j.Logger;
+
+import com.cloud.api.ApiConstants;
+import com.cloud.api.BaseAsyncCmd;
+import com.cloud.api.BaseCmd;
+import com.cloud.api.IdentityMapper;
++import com.cloud.api.Implementation;
+import com.cloud.api.Parameter;
+import com.cloud.api.ServerApiException;
+import com.cloud.api.response.SuccessResponse;
++import com.cloud.api.response.VpcResponse;
+import com.cloud.event.EventTypes;
+import com.cloud.exception.ConcurrentOperationException;
+import com.cloud.exception.InsufficientCapacityException;
+import com.cloud.exception.ResourceUnavailableException;
+import com.cloud.network.vpc.Vpc;
+import com.cloud.user.Account;
+
++@Implementation(description="Restarts a VPC", responseObject=VpcResponse.class)
+public class RestartVPCCmd extends BaseAsyncCmd{
+ public static final Logger s_logger = Logger.getLogger(RestartVPCCmd.class.getName());
+ private static final String _name = "restartvpcresponse";
+
+ /////////////////////////////////////////////////////
+ //////////////// API parameters /////////////////////
+ /////////////////////////////////////////////////////
+
+ @IdentityMapper(entityTableName="vpc")
+ @Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="the id of the VPC")
+ private Long id;
+
+
+ /////////////////////////////////////////////////////
+ /////////////////// Accessors ///////////////////////
+ /////////////////////////////////////////////////////
+
+ public Long getId() {
+ return id;
+ }
+
+
+ /////////////////////////////////////////////////////
+ /////////////// API Implementation///////////////////
+ /////////////////////////////////////////////////////
+ @Override
+ public String getCommandName() {
+ return _name;
+ }
+
+ @Override
+ public long getEntityOwnerId() {
+ Vpc vpc = _entityMgr.findById(Vpc.class, getId());
+ if (vpc != null) {
+ return vpc.getAccountId();
+ }
+
+ return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
+ }
+
+ @Override
+ public void execute(){
+ try {
+ boolean result = _vpcService.restartVpc(getId());
+ if (result) {
+ SuccessResponse response = new SuccessResponse(getCommandName());
+ this.setResponseObject(response);
+ } else {
+ throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to restart VPC");
+ }
+ } catch (ResourceUnavailableException ex) {
+ s_logger.warn("Exception: ", ex);
+ throw new ServerApiException(BaseCmd.RESOURCE_UNAVAILABLE_ERROR, ex.getMessage());
+ } catch (ConcurrentOperationException ex) {
+ s_logger.warn("Exception: ", ex);
+ throw new ServerApiException(BaseCmd.INTERNAL_ERROR, ex.getMessage());
+ } catch (InsufficientCapacityException ex) {
+ s_logger.info(ex);
+ s_logger.trace(ex);
+ throw new ServerApiException(BaseCmd.INSUFFICIENT_CAPACITY_ERROR, ex.getMessage());
+ }
+ }
+
+ @Override
+ public String getEventType() {
+ return EventTypes.EVENT_VPC_RESTART;
+ }
+
+ @Override
+ public String getEventDescription() {
+ return "restarting VPC id=" + getId();
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/0e0b75a0/api/src/com/cloud/api/commands/UpdateVPCCmd.java
----------------------------------------------------------------------
diff --cc api/src/com/cloud/api/commands/UpdateVPCCmd.java
index 3f2b932,0000000..0331be6
mode 100644,000000..100644
--- a/api/src/com/cloud/api/commands/UpdateVPCCmd.java
+++ b/api/src/com/cloud/api/commands/UpdateVPCCmd.java
@@@ -1,107 -1,0 +1,109 @@@
+// 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.api.commands;
+
+import org.apache.log4j.Logger;
+
+import com.cloud.api.ApiConstants;
+import com.cloud.api.BaseAsyncCmd;
+import com.cloud.api.BaseCmd;
+import com.cloud.api.IdentityMapper;
++import com.cloud.api.Implementation;
+import com.cloud.api.Parameter;
+import com.cloud.api.ServerApiException;
+import com.cloud.api.response.VpcResponse;
+import com.cloud.event.EventTypes;
+import com.cloud.network.vpc.Vpc;
+import com.cloud.user.Account;
+
++@Implementation(description="Updates a VPC", responseObject=VpcResponse.class)
+public class UpdateVPCCmd extends BaseAsyncCmd{
+ public static final Logger s_logger = Logger.getLogger(UpdateVPCCmd.class.getName());
+ private static final String _name = "updatevpcresponse";
+
+ /////////////////////////////////////////////////////
+ //////////////// API parameters /////////////////////
+ /////////////////////////////////////////////////////
+
+ @IdentityMapper(entityTableName="vpc")
+ @Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="the id of the VPC")
+ private Long id;
+
+ @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="the name of the VPC")
+ private String vpcName;
+
+ @Parameter(name=ApiConstants.DISPLAY_TEXT, type=CommandType.STRING, description="the display text of the VPC")
+ private String displayText;
+
+
+ /////////////////////////////////////////////////////
+ /////////////////// Accessors ///////////////////////
+ /////////////////////////////////////////////////////
+
+ public String getVpcName() {
+ return vpcName;
+ }
+
+ public String getDisplayText() {
+ return displayText;
+ }
+
+ public Long getId() {
+ return id;
+ }
+
+
+ /////////////////////////////////////////////////////
+ /////////////// API Implementation///////////////////
+ /////////////////////////////////////////////////////
+ @Override
+ public String getCommandName() {
+ return _name;
+ }
+
+ @Override
+ public long getEntityOwnerId() {
+ Vpc vpc = _entityMgr.findById(Vpc.class, getId());
+ if (vpc != null) {
+ return vpc.getAccountId();
+ }
+
+ return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
+ }
+
+ @Override
+ public void execute(){
+ Vpc result = _vpcService.updateVpc(getId(), getVpcName(), getDisplayText());
+ if (result != null) {
+ VpcResponse response = _responseGenerator.createVpcResponse(result);
+ response.setResponseName(getCommandName());
+ this.setResponseObject(response);
+ } else {
+ throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to update VPC");
+ }
+ }
+
+ @Override
+ public String getEventType() {
+ return EventTypes.EVENT_VPC_UPDATE;
+ }
+
+ @Override
+ public String getEventDescription() {
+ return "updating VPC id=" + getId();
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/0e0b75a0/server/src/com/cloud/configuration/Config.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/0e0b75a0/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/0e0b75a0/server/src/com/cloud/server/ManagementServerImpl.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/0e0b75a0/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/0e0b75a0/server/src/com/cloud/vm/UserVmManagerImpl.java
----------------------------------------------------------------------
diff --cc server/src/com/cloud/vm/UserVmManagerImpl.java
index 32c1aa6,c514a98..66c5fb4
--- a/server/src/com/cloud/vm/UserVmManagerImpl.java
+++ b/server/src/com/cloud/vm/UserVmManagerImpl.java
@@@ -3107,7 -3071,15 +3113,15 @@@ public class UserVmManagerImpl implemen
if (id != null) {
sc.setParameters("id", id);
}
-
+
+ if (templateId != null) {
+ sc.setParameters("templateId", templateId);
+ }
+
+ if (isoId != null) {
+ sc.setParameters("isoId", isoId);
+ }
+
if (networkId != null) {
sc.setJoinParameters("nicSearch", "networkId", networkId);
}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/0e0b75a0/ui/scripts/system.js
----------------------------------------------------------------------