mirror of https://github.com/apache/cloudstack.git
Merge branch 'master' of ssh://git.cloud.com/var/lib/git/cloudstack-oss
This commit is contained in:
commit
098f6edaa0
|
|
@ -25,6 +25,7 @@ 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;
|
||||
|
|
@ -45,9 +46,11 @@ public class AddNetworkServiceProviderCmd extends BaseAsyncCreateCmd {
|
|||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@IdentityMapper(entityTableName="physical_network")
|
||||
@Parameter(name=ApiConstants.PHYSICAL_NETWORK_ID, type=CommandType.LONG, required=true, description="the Physical Network ID to add the provider to")
|
||||
private Long physicalNetworkId;
|
||||
|
||||
@IdentityMapper(entityTableName="physical_network")
|
||||
@Parameter(name=ApiConstants.DEST_PHYSICAL_NETWORK_ID, type=CommandType.LONG, description="the destination Physical Network ID to bridge to")
|
||||
private Long destinationPhysicalNetworkId;
|
||||
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ 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;
|
||||
|
|
@ -43,6 +44,7 @@ public class AddTrafficTypeCmd extends BaseAsyncCreateCmd {
|
|||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@IdentityMapper(entityTableName="physical_network")
|
||||
@Parameter(name=ApiConstants.PHYSICAL_NETWORK_ID, type=CommandType.LONG, required=true, description="the Physical Network ID")
|
||||
private Long physicalNetworkId;
|
||||
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ 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.PlugService;
|
||||
|
|
@ -50,9 +51,11 @@ public class ConfigureVirtualRouterElementCmd extends BaseAsyncCmd {
|
|||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@IdentityMapper(entityTableName = "virtual_router_providers")
|
||||
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the ID of the virtual router provider")
|
||||
private Long id;
|
||||
|
||||
@IdentityMapper(entityTableName = "physical_network_service_providers")
|
||||
@Parameter(name=ApiConstants.ENABLED, type=CommandType.BOOLEAN, required=true, description="Enabled/Disabled the service provider")
|
||||
private Boolean enabled;
|
||||
|
||||
|
|
|
|||
|
|
@ -95,6 +95,7 @@ public class CreateNetworkCmd extends BaseCmd {
|
|||
@Parameter(name=ApiConstants.ACL_TYPE, type=CommandType.STRING, description="Access control type; supported values are account and domain. If not specified, defaulted to Account. Account means that only the account owner can use the network, domain - all accouns in the domain can use the network")
|
||||
private String aclType;
|
||||
|
||||
@IdentityMapper(entityTableName="physical_network")
|
||||
@Parameter(name=ApiConstants.PHYSICAL_NETWORK_ID, type=CommandType.LONG, description="the Physical Network ID the network belongs to")
|
||||
private Long physicalNetworkId;
|
||||
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ 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;
|
||||
|
|
@ -45,6 +46,7 @@ public class CreatePhysicalNetworkCmd extends BaseAsyncCreateCmd {
|
|||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@IdentityMapper(entityTableName="data_center")
|
||||
@Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, required=true, description="the Zone ID for the physical network")
|
||||
private Long zoneId;
|
||||
|
||||
|
|
@ -54,6 +56,7 @@ public class CreatePhysicalNetworkCmd extends BaseAsyncCreateCmd {
|
|||
@Parameter(name=ApiConstants.NETWORK_SPEED, type=CommandType.STRING, description="the speed for the physical network[1G/10G]")
|
||||
private String speed;
|
||||
|
||||
@IdentityMapper(entityTableName="domain")
|
||||
@Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="domain ID of the account owning a physical network")
|
||||
private Long domainId;
|
||||
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ 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.PlugService;
|
||||
|
|
@ -50,6 +51,7 @@ public class CreateVirtualRouterElementCmd extends BaseAsyncCreateCmd {
|
|||
/////////////////////////////////////////////////////
|
||||
|
||||
@Parameter(name=ApiConstants.NETWORK_SERVICE_PROVIDER_ID, type=CommandType.LONG, required=true, description="the network service provider ID of the virtual router element")
|
||||
@IdentityMapper(entityTableName="physical_network_service_providers")
|
||||
private Long nspId;
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
|
|
|
|||
|
|
@ -84,6 +84,7 @@ public class CreateVlanIpRangeCmd extends BaseCmd {
|
|||
@Parameter(name=ApiConstants.NETWORK_ID, type=CommandType.LONG, description="the network id")
|
||||
private Long networkID;
|
||||
|
||||
@IdentityMapper(entityTableName="physical_network")
|
||||
@Parameter(name=ApiConstants.PHYSICAL_NETWORK_ID, type=CommandType.LONG, description="the physical network id")
|
||||
private Long physicalNetworkId;
|
||||
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ 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;
|
||||
|
|
@ -41,7 +42,8 @@ public class DeleteNetworkServiceProviderCmd extends BaseAsyncCmd {
|
|||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
|
||||
@IdentityMapper(entityTableName="physical_network_service_providers")
|
||||
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the ID of the network service provider")
|
||||
private Long id;
|
||||
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ 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;
|
||||
|
|
@ -40,7 +41,7 @@ public class DeletePhysicalNetworkCmd extends BaseAsyncCmd {
|
|||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@IdentityMapper(entityTableName="physical_network")
|
||||
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the ID of the Physical network")
|
||||
private Long id;
|
||||
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ 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;
|
||||
|
|
@ -39,7 +40,7 @@ public class DeleteTrafficTypeCmd extends BaseAsyncCmd {
|
|||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@IdentityMapper(entityTableName="physical_network_traffic_types")
|
||||
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="traffic type id")
|
||||
private Long id;
|
||||
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ import org.apache.log4j.Logger;
|
|||
|
||||
import com.cloud.api.ApiConstants;
|
||||
import com.cloud.api.BaseListCmd;
|
||||
import com.cloud.api.IdentityMapper;
|
||||
import com.cloud.api.Implementation;
|
||||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.response.ListResponse;
|
||||
|
|
@ -42,6 +43,7 @@ public class ListNetworkServiceProvidersCmd extends BaseListCmd {
|
|||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@IdentityMapper(entityTableName="physical_network")
|
||||
@Parameter(name=ApiConstants.PHYSICAL_NETWORK_ID, type=CommandType.LONG, required=true, description="the Physical Network ID")
|
||||
private Long physicalNetworkId;
|
||||
|
||||
|
|
|
|||
|
|
@ -75,6 +75,7 @@ public class ListNetworksCmd extends BaseListCmd {
|
|||
@Parameter(name=ApiConstants.PROJECT_ID, type=CommandType.LONG, description="list networks by project id")
|
||||
private Long projectId;
|
||||
|
||||
@IdentityMapper(entityTableName="physical_network")
|
||||
@Parameter(name=ApiConstants.PHYSICAL_NETWORK_ID, type=CommandType.LONG, description="list networks by physical network id")
|
||||
private Long physicalNetworkId;
|
||||
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ public class ListPhysicalNetworksCmd extends BaseListCmd {
|
|||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@IdentityMapper(entityTableName="physical_networks")
|
||||
@IdentityMapper(entityTableName="physical_network")
|
||||
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="list physical network by id")
|
||||
private Long id;
|
||||
|
||||
|
|
|
|||
|
|
@ -77,6 +77,10 @@ public class ListPublicIpAddressesCmd extends BaseListCmd {
|
|||
@IdentityMapper(entityTableName="projects")
|
||||
@Parameter(name=ApiConstants.PROJECT_ID, type=CommandType.LONG, description="list ips by project")
|
||||
private Long projectId;
|
||||
|
||||
@IdentityMapper(entityTableName="physical_network")
|
||||
@Parameter(name=ApiConstants.PHYSICAL_NETWORK_ID, type=CommandType.LONG, description="lists all public IP addresses by physical network id")
|
||||
private Long physicalNetworkId;
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////////// Accessors ///////////////////////
|
||||
|
|
@ -116,6 +120,10 @@ public class ListPublicIpAddressesCmd extends BaseListCmd {
|
|||
public Long getProjectId() {
|
||||
return projectId;
|
||||
}
|
||||
|
||||
public Long getPhysicalNetworkId() {
|
||||
return physicalNetworkId;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////// API Implementation///////////////////
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ import org.apache.log4j.Logger;
|
|||
|
||||
import com.cloud.api.ApiConstants;
|
||||
import com.cloud.api.BaseListCmd;
|
||||
import com.cloud.api.IdentityMapper;
|
||||
import com.cloud.api.Implementation;
|
||||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.response.ListResponse;
|
||||
|
|
@ -42,7 +43,7 @@ public class ListTrafficTypesCmd extends BaseListCmd {
|
|||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@IdentityMapper(entityTableName="physical_network")
|
||||
@Parameter(name=ApiConstants.PHYSICAL_NETWORK_ID, type=CommandType.LONG, required=true, description="the Physical Network ID")
|
||||
private Long physicalNetworkId;
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import org.apache.log4j.Logger;
|
|||
|
||||
import com.cloud.api.ApiConstants;
|
||||
import com.cloud.api.BaseListCmd;
|
||||
import com.cloud.api.IdentityMapper;
|
||||
import com.cloud.api.Implementation;
|
||||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.PlugService;
|
||||
|
|
@ -31,9 +32,11 @@ public class ListVirtualRouterElementsCmd extends BaseListCmd {
|
|||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
@IdentityMapper(entityTableName = "virtual_router_providers")
|
||||
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="list virtual router elements by id")
|
||||
private Long id;
|
||||
|
||||
@IdentityMapper(entityTableName = "physical_network_service_providers")
|
||||
@Parameter(name=ApiConstants.NSP_ID, type=CommandType.LONG, description="list virtual router elements by network service provider id")
|
||||
private Long nspId;
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@ import com.cloud.api.BaseListCmd;
|
|||
import com.cloud.api.IdentityMapper;
|
||||
import com.cloud.api.Implementation;
|
||||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.BaseCmd.CommandType;
|
||||
import com.cloud.api.response.ListResponse;
|
||||
import com.cloud.api.response.VlanIpRangeResponse;
|
||||
import com.cloud.dc.Vlan;
|
||||
|
|
@ -74,6 +73,10 @@ public class ListVlanIpRangesCmd extends BaseListCmd {
|
|||
|
||||
@Parameter(name=ApiConstants.FOR_VIRTUAL_NETWORK, type=CommandType.BOOLEAN, description="true if VLAN is of Virtual type, false if Direct")
|
||||
private Boolean forVirtualNetwork;
|
||||
|
||||
@IdentityMapper(entityTableName="physical_network")
|
||||
@Parameter(name=ApiConstants.PHYSICAL_NETWORK_ID, type=CommandType.LONG, description="physical network id of the VLAN IP range")
|
||||
private Long physicalNetworkId;
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////////// Accessors ///////////////////////
|
||||
|
|
@ -115,6 +118,10 @@ public class ListVlanIpRangesCmd extends BaseListCmd {
|
|||
return projectId;
|
||||
}
|
||||
|
||||
public Long getPhysicalNetworkId() {
|
||||
return physicalNetworkId;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////// API Implementation///////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ 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;
|
||||
|
|
@ -45,6 +46,7 @@ public class UpdateNetworkServiceProviderCmd extends BaseAsyncCmd {
|
|||
@Parameter(name=ApiConstants.STATE, type=CommandType.STRING, description="Enabled/Disabled/Shutdown the physical network service provider")
|
||||
private String state;
|
||||
|
||||
@IdentityMapper(entityTableName="physical_network_service_providers")
|
||||
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="network service provider id")
|
||||
private Long id;
|
||||
|
||||
|
|
@ -88,7 +90,7 @@ public class UpdateNetworkServiceProviderCmd extends BaseAsyncCmd {
|
|||
response.setResponseName(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
}else {
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to add service provider to physical network");
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to update service provider");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ 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;
|
||||
|
|
@ -42,7 +43,7 @@ public class UpdatePhysicalNetworkCmd extends BaseAsyncCmd {
|
|||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@IdentityMapper(entityTableName="physical_network")
|
||||
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="physical network id")
|
||||
private Long id;
|
||||
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ 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;
|
||||
|
|
@ -41,6 +42,7 @@ public class UpdateTrafficTypeCmd extends BaseAsyncCmd {
|
|||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@IdentityMapper(entityTableName="physical_network_traffic_types")
|
||||
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="traffic type id")
|
||||
private Long id;
|
||||
|
||||
|
|
|
|||
|
|
@ -88,6 +88,9 @@ public class IPAddressResponse extends BaseResponse implements ControlledEntityR
|
|||
|
||||
@SerializedName(ApiConstants.STATE) @Param(description="State of the ip address. Can be: Allocatin, Allocated and Releasing")
|
||||
private String state;
|
||||
|
||||
@SerializedName(ApiConstants.PHYSICAL_NETWORK_ID) @Param(description="the physical network this belongs to")
|
||||
private IdentityProxy physicalNetworkId = new IdentityProxy("physical_network");
|
||||
|
||||
/*
|
||||
@SerializedName(ApiConstants.JOB_ID) @Param(description="shows the current pending asynchronous job ID. This tag is not returned if no current pending jobs are acting on the volume")
|
||||
|
|
@ -196,4 +199,12 @@ public class IPAddressResponse extends BaseResponse implements ControlledEntityR
|
|||
public void setProjectName(String projectName) {
|
||||
this.projectName = projectName;
|
||||
}
|
||||
|
||||
public void setPhysicalNetworkId(long physicalNetworkId) {
|
||||
this.physicalNetworkId.setValue(physicalNetworkId);
|
||||
}
|
||||
|
||||
public long getphysicalNetworkId() {
|
||||
return physicalNetworkId.getValue();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ public class NetworkResponse extends BaseResponse implements ControlledEntityRes
|
|||
private String networkDomain;
|
||||
|
||||
@SerializedName(ApiConstants.PHYSICAL_NETWORK_ID) @Param(description="the physical network id")
|
||||
private Long physicalNetworkId;
|
||||
private IdentityProxy physicalNetworkId = new IdentityProxy("physical_network");
|
||||
|
||||
@SerializedName(ApiConstants.ACL_TYPE) @Param(description="acl type - access type to the network")
|
||||
private String aclType;
|
||||
|
|
@ -248,7 +248,7 @@ public class NetworkResponse extends BaseResponse implements ControlledEntityRes
|
|||
}
|
||||
|
||||
public void setPhysicalNetworkId(Long physicalNetworkId) {
|
||||
this.physicalNetworkId = physicalNetworkId;
|
||||
this.physicalNetworkId.setValue(physicalNetworkId);
|
||||
}
|
||||
|
||||
public void setAclType(String aclType) {
|
||||
|
|
|
|||
|
|
@ -25,10 +25,11 @@ import com.cloud.api.IdentityProxy;
|
|||
import com.cloud.serializer.Param;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class PhysicalNetworkResponse extends BaseResponse{
|
||||
|
||||
@SerializedName(ApiConstants.ID) @Param(description="the id of the physical network")
|
||||
private IdentityProxy id = new IdentityProxy("physical_networks");
|
||||
@SerializedName(ApiConstants.ID) @Param(description="the uuid of the physical network")
|
||||
private String id;
|
||||
|
||||
@SerializedName(ApiConstants.BROADCAST_DOMAIN_RANGE) @Param(description="Broadcast domain range of the physical network")
|
||||
private String broadcastDomainRange;
|
||||
|
|
@ -43,7 +44,7 @@ public class PhysicalNetworkResponse extends BaseResponse{
|
|||
private String vlan;
|
||||
|
||||
@SerializedName(ApiConstants.DOMAIN_ID) @Param(description="the domain id of the physical network owner")
|
||||
private Long domainId;
|
||||
private IdentityProxy domainId = new IdentityProxy("domain");
|
||||
|
||||
@SerializedName(ApiConstants.TAGS) @Param(description="comma separated tag")
|
||||
private String tags;
|
||||
|
|
@ -54,8 +55,8 @@ public class PhysicalNetworkResponse extends BaseResponse{
|
|||
@SerializedName(ApiConstants.NETWORK_SPEED) @Param(description="the speed of the physical network")
|
||||
private String networkSpeed;
|
||||
|
||||
public void setId(long id) {
|
||||
this.id.setValue(id);
|
||||
public void setId(String uuid) {
|
||||
this.id = uuid;
|
||||
}
|
||||
|
||||
public void setZoneId(Long zoneId) {
|
||||
|
|
@ -68,7 +69,7 @@ public class PhysicalNetworkResponse extends BaseResponse{
|
|||
|
||||
|
||||
public void setDomainId(Long domainId) {
|
||||
this.domainId = domainId;
|
||||
this.domainId.setValue(domainId);
|
||||
}
|
||||
|
||||
public void setVlan(String vlan) {
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ package com.cloud.api.response;
|
|||
import java.util.List;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
import com.cloud.api.IdentityProxy;
|
||||
import com.cloud.serializer.Param;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
|
|
@ -30,16 +31,16 @@ public class ProviderResponse extends BaseResponse {
|
|||
private String name;
|
||||
|
||||
@SerializedName(ApiConstants.PHYSICAL_NETWORK_ID) @Param(description="the physical network this belongs to")
|
||||
private Long physicalNetworkId;
|
||||
private IdentityProxy physicalNetworkId = new IdentityProxy("physical_network");
|
||||
|
||||
@SerializedName(ApiConstants.DEST_PHYSICAL_NETWORK_ID) @Param(description="the destination physical network")
|
||||
private Long destinationPhysicalNetworkId;
|
||||
private IdentityProxy destinationPhysicalNetworkId = new IdentityProxy("physical_network");
|
||||
|
||||
@SerializedName(ApiConstants.STATE) @Param(description="state of the network provider")
|
||||
private String state;
|
||||
|
||||
@SerializedName(ApiConstants.ID) @Param(description="id of the network provider")
|
||||
private Long id;
|
||||
@SerializedName(ApiConstants.ID) @Param(description="uuid of the network provider")
|
||||
private String id;
|
||||
|
||||
@SerializedName(ApiConstants.SERVICE_LIST) @Param(description="services for this provider")
|
||||
private List<String> services;
|
||||
|
|
@ -56,19 +57,19 @@ public class ProviderResponse extends BaseResponse {
|
|||
}
|
||||
|
||||
public void setPhysicalNetworkId(long physicalNetworkId) {
|
||||
this.physicalNetworkId = physicalNetworkId;
|
||||
this.physicalNetworkId.setValue(physicalNetworkId);
|
||||
}
|
||||
|
||||
public long getphysicalNetworkId() {
|
||||
return physicalNetworkId;
|
||||
return physicalNetworkId.getValue();
|
||||
}
|
||||
|
||||
public void setDestinationPhysicalNetworkId(long destPhysicalNetworkId) {
|
||||
this.destinationPhysicalNetworkId = destPhysicalNetworkId;
|
||||
this.destinationPhysicalNetworkId.setValue(destPhysicalNetworkId);
|
||||
}
|
||||
|
||||
public long getDestinationPhysicalNetworkId() {
|
||||
return destinationPhysicalNetworkId;
|
||||
return destinationPhysicalNetworkId.getValue();
|
||||
}
|
||||
|
||||
public void setState(String state) {
|
||||
|
|
@ -79,11 +80,11 @@ public class ProviderResponse extends BaseResponse {
|
|||
return this.state;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
public void setId(String uuid) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
public String getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@
|
|||
package com.cloud.api.response;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
import com.cloud.api.IdentityProxy;
|
||||
import com.cloud.serializer.Param;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
|
|
@ -25,13 +26,13 @@ import com.google.gson.annotations.SerializedName;
|
|||
public class TrafficTypeResponse extends BaseResponse {
|
||||
|
||||
@SerializedName(ApiConstants.ID) @Param(description="id of the network provider")
|
||||
private Long id;
|
||||
private String id;
|
||||
|
||||
@SerializedName(ApiConstants.TRAFFIC_TYPE) @Param(description="the trafficType to be added to the physical network")
|
||||
private String trafficType;
|
||||
|
||||
@SerializedName(ApiConstants.PHYSICAL_NETWORK_ID) @Param(description="the physical network this belongs to")
|
||||
private Long physicalNetworkId;
|
||||
private IdentityProxy physicalNetworkId = new IdentityProxy("physical_network");
|
||||
|
||||
@SerializedName(ApiConstants.XEN_NETWORK_LABEL) @Param(description="The network name label of the physical device dedicated to this traffic on a XenServer host")
|
||||
private String xenNetworkLabel;
|
||||
|
|
@ -43,18 +44,18 @@ public class TrafficTypeResponse extends BaseResponse {
|
|||
private String vmwareNetworkLabel;
|
||||
|
||||
public void setPhysicalNetworkId(long physicalNetworkId) {
|
||||
this.physicalNetworkId = physicalNetworkId;
|
||||
this.physicalNetworkId.setValue(physicalNetworkId);
|
||||
}
|
||||
|
||||
public long getphysicalNetworkId() {
|
||||
return physicalNetworkId;
|
||||
return physicalNetworkId.getValue();
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
public void setId(String uuid) {
|
||||
this.id = uuid;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
public String getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,15 +1,16 @@
|
|||
package com.cloud.api.response;
|
||||
|
||||
import com.cloud.api.ApiConstants;
|
||||
import com.cloud.api.IdentityProxy;
|
||||
import com.cloud.serializer.Param;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class VirtualRouterProviderResponse extends BaseResponse implements ControlledEntityResponse {
|
||||
@SerializedName(ApiConstants.ID) @Param(description="the id of the router")
|
||||
private Long id;
|
||||
private IdentityProxy id = new IdentityProxy("virtual_router_providers");
|
||||
|
||||
@SerializedName(ApiConstants.NSP_ID) @Param(description="the physical network service provider id of the provider")
|
||||
private Long nspId;
|
||||
private IdentityProxy nspId = new IdentityProxy("physical_network_service_providers");
|
||||
|
||||
@SerializedName(ApiConstants.ENABLED) @Param(description="Enabled/Disabled the service provider")
|
||||
private Boolean enabled;
|
||||
|
|
@ -35,11 +36,7 @@ public class VirtualRouterProviderResponse extends BaseResponse implements Contr
|
|||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
this.id.setValue(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -63,19 +60,10 @@ public class VirtualRouterProviderResponse extends BaseResponse implements Contr
|
|||
}
|
||||
|
||||
public void setNspId(Long nspId) {
|
||||
this.nspId = nspId;
|
||||
}
|
||||
|
||||
public Long getNspId() {
|
||||
return nspId;
|
||||
this.nspId.setValue(nspId);
|
||||
}
|
||||
|
||||
public void setEnabled(Boolean enabled) {
|
||||
this.enabled = enabled;
|
||||
}
|
||||
|
||||
public Boolean getEnabled() {
|
||||
return enabled;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ public class VlanIpRangeResponse extends BaseResponse implements ControlledEntit
|
|||
private String projectName;
|
||||
|
||||
@SerializedName(ApiConstants.PHYSICAL_NETWORK_ID) @Param(description="the physical network this belongs to")
|
||||
private Long physicalNetworkId;
|
||||
private IdentityProxy physicalNetworkId = new IdentityProxy("physical_network");
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id.setValue(id);
|
||||
|
|
@ -149,10 +149,10 @@ public class VlanIpRangeResponse extends BaseResponse implements ControlledEntit
|
|||
}
|
||||
|
||||
public void setPhysicalNetworkId(long physicalNetworkId) {
|
||||
this.physicalNetworkId = physicalNetworkId;
|
||||
this.physicalNetworkId.setValue(physicalNetworkId);
|
||||
}
|
||||
|
||||
public long getphysicalNetworkId() {
|
||||
return physicalNetworkId;
|
||||
return physicalNetworkId.getValue();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,6 +69,8 @@ public interface IpAddress extends ControlledEntity {
|
|||
|
||||
Long getAssociatedWithVmId();
|
||||
|
||||
public Long getPhysicalNetworkId();
|
||||
|
||||
/**
|
||||
* @return database id.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -65,4 +65,6 @@ public interface PhysicalNetwork {
|
|||
|
||||
String getSpeed();
|
||||
|
||||
String getUuid();
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -70,4 +70,6 @@ public interface PhysicalNetworkServiceProvider {
|
|||
boolean isSecuritygroupServiceProvided();
|
||||
|
||||
List<Service> getEnabledServices();
|
||||
|
||||
String getUuid();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,4 +42,6 @@ public interface PhysicalNetworkTrafficType {
|
|||
String getKvmNetworkLabel();
|
||||
|
||||
String getVmwareNetworkLabel();
|
||||
|
||||
String getUuid();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ import com.cloud.agent.api.AttachIsoCommand;
|
|||
import com.cloud.agent.api.AttachVolumeCommand;
|
||||
import com.cloud.agent.api.BackupSnapshotCommand;
|
||||
import com.cloud.agent.api.CheckHealthCommand;
|
||||
import com.cloud.agent.api.CheckNetworkCommand;
|
||||
import com.cloud.agent.api.CheckOnHostCommand;
|
||||
import com.cloud.agent.api.CheckVirtualMachineCommand;
|
||||
import com.cloud.agent.api.Command;
|
||||
|
|
@ -244,6 +245,8 @@ public class HypervResource extends ServerResourceBase implements ServerResource
|
|||
//return execute((VpnUsersCfgCommand) cmd);
|
||||
} else if (cmd instanceof CheckSshCommand) {
|
||||
return execute((CheckSshCommand)cmd);
|
||||
} else if (cmd instanceof CheckNetworkCommand) {
|
||||
//return execute((CheckNetworkCommand) cmd);
|
||||
} else {
|
||||
s_logger.info("SCVMM agent recived unimplemented command: " + _gson.toJson(cmd));
|
||||
return Answer.createUnsupportedCommandAnswer(cmd);
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ import com.cloud.agent.api.BackupSnapshotCommand;
|
|||
import com.cloud.agent.api.BumpUpPriorityCommand;
|
||||
import com.cloud.agent.api.CheckHealthAnswer;
|
||||
import com.cloud.agent.api.CheckHealthCommand;
|
||||
import com.cloud.agent.api.CheckNetworkCommand;
|
||||
import com.cloud.agent.api.CheckOnHostAnswer;
|
||||
import com.cloud.agent.api.CheckOnHostCommand;
|
||||
import com.cloud.agent.api.CheckRouterAnswer;
|
||||
|
|
@ -393,6 +394,8 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
|
|||
answer = execute((BumpUpPriorityCommand)cmd);
|
||||
} else if (cmd instanceof GetDomRVersionCmd) {
|
||||
answer = execute((GetDomRVersionCmd)cmd);
|
||||
} else if (cmd instanceof CheckNetworkCommand) {
|
||||
//answer = execute((CheckNetworkCommand) cmd);
|
||||
} else {
|
||||
answer = Answer.createUnsupportedCommandAnswer(cmd);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ import com.cloud.api.response.TemplateResponse;
|
|||
import com.cloud.api.response.TrafficTypeResponse;
|
||||
import com.cloud.api.response.UserResponse;
|
||||
import com.cloud.api.response.UserVmResponse;
|
||||
import com.cloud.api.response.VirtualRouterProviderResponse;
|
||||
import com.cloud.api.response.VirtualRouterProviderResponse;
|
||||
import com.cloud.api.response.VlanIpRangeResponse;
|
||||
import com.cloud.api.response.VolumeResponse;
|
||||
import com.cloud.api.response.VpnUsersResponse;
|
||||
|
|
@ -128,7 +128,7 @@ import com.cloud.network.PhysicalNetwork;
|
|||
import com.cloud.network.PhysicalNetworkServiceProvider;
|
||||
import com.cloud.network.PhysicalNetworkTrafficType;
|
||||
import com.cloud.network.RemoteAccessVpn;
|
||||
import com.cloud.network.VirtualRouterProvider;
|
||||
import com.cloud.network.VirtualRouterProvider;
|
||||
import com.cloud.network.VpnUser;
|
||||
import com.cloud.network.router.VirtualRouter;
|
||||
import com.cloud.network.rules.FirewallRule;
|
||||
|
|
@ -708,6 +708,7 @@ public class ApiResponseHelper implements ResponseGenerator {
|
|||
|
||||
ipResponse.setNetworkId(networkId);
|
||||
ipResponse.setState(ipAddress.getState().toString());
|
||||
ipResponse.setPhysicalNetworkId(ipAddress.getPhysicalNetworkId());
|
||||
|
||||
// show this info to admin only
|
||||
Account account = UserContext.current().getCaller();
|
||||
|
|
@ -2773,7 +2774,7 @@ public class ApiResponseHelper implements ResponseGenerator {
|
|||
response.setNetworkSpeed(result.getSpeed());
|
||||
response.setVlan(result.getVnet());
|
||||
response.setDomainId(result.getDomainId());
|
||||
response.setId(result.getId());
|
||||
response.setId(result.getUuid());
|
||||
if(result.getBroadcastDomainRange() != null){
|
||||
response.setBroadcastDomainRange(result.getBroadcastDomainRange().toString());
|
||||
}
|
||||
|
|
@ -2829,7 +2830,7 @@ public class ApiResponseHelper implements ResponseGenerator {
|
|||
@Override
|
||||
public ProviderResponse createNetworkServiceProviderResponse(PhysicalNetworkServiceProvider result){
|
||||
ProviderResponse response = new ProviderResponse();
|
||||
response.setId(result.getId());
|
||||
response.setId(result.getUuid());
|
||||
response.setName(result.getProviderName());
|
||||
response.setPhysicalNetworkId(result.getPhysicalNetworkId());
|
||||
response.setDestinationPhysicalNetworkId(result.getDestinationPhysicalNetworkId());
|
||||
|
|
@ -2849,7 +2850,7 @@ public class ApiResponseHelper implements ResponseGenerator {
|
|||
@Override
|
||||
public TrafficTypeResponse createTrafficTypeResponse(PhysicalNetworkTrafficType result) {
|
||||
TrafficTypeResponse response = new TrafficTypeResponse();
|
||||
response.setId(result.getId());
|
||||
response.setId(result.getUuid());
|
||||
response.setPhysicalNetworkId(result.getPhysicalNetworkId());
|
||||
response.setTrafficType(result.getTrafficType().toString());
|
||||
response.setXenLabel(result.getXenNetworkLabel());
|
||||
|
|
|
|||
|
|
@ -35,7 +35,6 @@ import javax.naming.ConfigurationException;
|
|||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.acl.ControlledEntity.ACLType;
|
||||
import com.cloud.acl.SecurityChecker;
|
||||
import com.cloud.alert.AlertManager;
|
||||
import com.cloud.api.commands.CreateCfgCmd;
|
||||
|
|
|
|||
|
|
@ -905,21 +905,25 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag
|
|||
NetworkOfferingVO offering = null;
|
||||
if (_networkOfferingDao.findByUniqueName(NetworkOffering.DefaultSharedNetworkOfferingWithSGService) == null) {
|
||||
offering = _configMgr.createNetworkOffering(Account.ACCOUNT_ID_SYSTEM, NetworkOffering.DefaultSharedNetworkOfferingWithSGService, "Offering for Shared Security group enabled networks", TrafficType.Guest, null, null, false, Availability.Optional, null, defaultSharedNetworkOfferingProviders, true, Network.GuestType.Shared, false, null, null);
|
||||
offering.setState(NetworkOffering.State.Enabled);
|
||||
_networkOfferingDao.update(offering.getId(), offering);
|
||||
}
|
||||
|
||||
if (_networkOfferingDao.findByUniqueName(NetworkOffering.DefaultSharedNetworkOffering) == null) {
|
||||
offering = _configMgr.createNetworkOffering(Account.ACCOUNT_ID_SYSTEM, NetworkOffering.DefaultSharedNetworkOffering, "Offering for Shared networks", TrafficType.Guest, null, null, true, Availability.Optional, null, defaultSharedNetworkOfferingProviders, true, Network.GuestType.Shared, false, null, null);
|
||||
offering.setState(NetworkOffering.State.Enabled);
|
||||
_networkOfferingDao.update(offering.getId(), offering);
|
||||
}
|
||||
|
||||
if (_networkOfferingDao.findByUniqueName(NetworkOffering.DefaultIsolatedNetworkOfferingWithSourceNatService) == null) {
|
||||
offering = _configMgr.createNetworkOffering(Account.ACCOUNT_ID_SYSTEM,NetworkOffering.DefaultIsolatedNetworkOfferingWithSourceNatService, "Offering for Isolated networks with Source Nat service enabled", TrafficType.Guest, null, null, false, Availability.Required, null, defaultIsolatedSourceNatEnabledNetworkOfferingProviders, true, Network.GuestType.Isolated, false, null, null);
|
||||
offering.setState(NetworkOffering.State.Enabled);
|
||||
_networkOfferingDao.update(offering.getId(), offering);
|
||||
}
|
||||
|
||||
if (_networkOfferingDao.findByUniqueName(NetworkOffering.DefaultIsolatedNetworkOffering) == null) {
|
||||
offering = _configMgr.createNetworkOffering(Account.ACCOUNT_ID_SYSTEM, NetworkOffering.DefaultIsolatedNetworkOffering, "Offering for Isolated networks with no Source Nat service", TrafficType.Guest, null, null, true, Availability.Optional, null, defaultIsolatedNetworkOfferingProviders, true, Network.GuestType.Isolated, false, null, null);
|
||||
offering.setState(NetworkOffering.State.Enabled);
|
||||
_networkOfferingDao.update(offering.getId(), offering);
|
||||
}
|
||||
|
||||
|
|
@ -2606,7 +2610,7 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag
|
|||
|
||||
_accountMgr.checkAccess(callerAccount, null, network);
|
||||
|
||||
boolean success = restartNetwork(networkId, callerAccount, callerUser, null, cleanup);
|
||||
boolean success = restartNetwork(networkId, callerAccount, callerUser, cleanup);
|
||||
|
||||
if (success) {
|
||||
s_logger.debug("Network id=" + networkId + " is restarted successfully.");
|
||||
|
|
@ -2637,7 +2641,7 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag
|
|||
}
|
||||
}
|
||||
|
||||
private boolean restartNetwork(long networkId, Account callerAccount, User callerUser, Long newNetworkOfferingId, boolean cleanup) throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException {
|
||||
private boolean restartNetwork(long networkId, Account callerAccount, User callerUser, boolean cleanup) throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException {
|
||||
|
||||
NetworkVO network = _networksDao.findById(networkId);
|
||||
|
||||
|
|
@ -2652,13 +2656,6 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag
|
|||
return false;
|
||||
}
|
||||
|
||||
//Only after network was shutdown properly, change the network offering
|
||||
if (newNetworkOfferingId != null) {
|
||||
s_logger.debug("Updating network " + network + " with the new network offering id=" + newNetworkOfferingId + " as a part of network restart");
|
||||
network.setNetworkOfferingId(newNetworkOfferingId);
|
||||
_networksDao.update(networkId, network, finalizeServicesAndProvidersForNetwork(_configMgr.getNetworkOffering(newNetworkOfferingId), network.getPhysicalNetworkId()));
|
||||
}
|
||||
|
||||
//implement the network elements and rules again
|
||||
DeployDestination dest = new DeployDestination(_dcDao.findById(network.getDataCenterId()), null, null, null);
|
||||
|
||||
|
|
@ -3328,31 +3325,43 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag
|
|||
//have to restart the network
|
||||
restartNetwork = true;
|
||||
}
|
||||
|
||||
//1) Shutdown all the elements and cleanup all the rules
|
||||
ReservationContext context = new ReservationContextImpl(null, null, callerUser, callerAccount);
|
||||
if (restartNetwork) {
|
||||
s_logger.debug("Shutting down elements and resources for network id=" + networkId + " as a part of network update");
|
||||
|
||||
_networksDao.update(networkId, network);
|
||||
|
||||
boolean success = true;
|
||||
if (restartNetwork && (network.getState() == Network.State.Implemented || network.getState() == Network.State.Setup)) {
|
||||
//network offering id will be updated in the restartNetowrk call aftet the network elements are shutdown properly
|
||||
s_logger.info("Restarting network " + network + " as a part of update network call");
|
||||
|
||||
try {
|
||||
success = restartNetwork(networkId, callerAccount, callerUser, networkOfferingId, true);
|
||||
} catch (Exception e) {
|
||||
success = false;
|
||||
if (!shutdownNetworkElementsAndResources(context, true, network)) {
|
||||
s_logger.warn("Failed to shutdown the network elements and resources as a part of network restart: " + network.getState());
|
||||
throw new CloudRuntimeException("Failed to shutdown the network elements and resources as a part of network restart: " + network.getState());
|
||||
}
|
||||
|
||||
if (success) {
|
||||
s_logger.debug("Successully restarted the network " + network + " as a part of updateNetwork call");
|
||||
} else {
|
||||
s_logger.warn("Failed to restart the network " + network + " as a part of updateNetwork call");
|
||||
}
|
||||
} else if (networkOfferingId != null) {
|
||||
network.setNetworkOfferingId(networkOfferingId);
|
||||
_networksDao.update(networkId, network, finalizeServicesAndProvidersForNetwork(_configMgr.getNetworkOffering(networkOfferingId), network.getPhysicalNetworkId()));
|
||||
}
|
||||
|
||||
return network;
|
||||
//2) Only after all the elements and rules are shutdown properly, update the network VO
|
||||
if (networkOfferingId != null) {
|
||||
network.setNetworkOfferingId(networkOfferingId);
|
||||
_networksDao.update(networkId, network, finalizeServicesAndProvidersForNetwork(_configMgr.getNetworkOffering(networkOfferingId), network.getPhysicalNetworkId()));
|
||||
} else {
|
||||
_networksDao.update(networkId, network);
|
||||
}
|
||||
|
||||
//get updated network
|
||||
network = _networksDao.findById(networkId);
|
||||
|
||||
//3) Implement the elements and rules again
|
||||
if (restartNetwork) {
|
||||
DeployDestination dest = new DeployDestination(_dcDao.findById(network.getDataCenterId()), null, null, null);
|
||||
|
||||
s_logger.debug("Implementing the network " + network + " elements and resources as a part of network update");
|
||||
try {
|
||||
implementNetworkElementsAndResources(dest, context, network, _networkOfferingDao.findById(network.getNetworkOfferingId()));
|
||||
} catch (Exception ex) {
|
||||
s_logger.warn("Failed to implement network " + network + " elements and resources as a part of network update due to ", ex);
|
||||
throw new CloudRuntimeException("Failed to implement network " + network + " elements and resources as a part of network update");
|
||||
}
|
||||
}
|
||||
|
||||
return getNetwork(network.getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -3903,7 +3912,7 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag
|
|||
}
|
||||
|
||||
// Delete networks
|
||||
List<NetworkVO> networks = _networksDao.listByPhysicalNetworkIncludingRemoved(physicalNetworkId);
|
||||
List<NetworkVO> networks = _networksDao.listByPhysicalNetwork(physicalNetworkId);
|
||||
if (networks != null && !networks.isEmpty()) {
|
||||
for (NetworkVO network : networks) {
|
||||
_networksDao.remove(network.getId());
|
||||
|
|
@ -4161,6 +4170,8 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag
|
|||
if(element != null && element.isReady(provider)){
|
||||
provider.setState(PhysicalNetworkServiceProvider.State.Enabled);
|
||||
update = true;
|
||||
}else{
|
||||
throw new CloudRuntimeException("Provider is not ready, cannot Enable the provider, please configure the provider first");
|
||||
}
|
||||
break;
|
||||
case Disabled:
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ package com.cloud.network;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import javax.persistence.CollectionTable;
|
||||
import javax.persistence.Column;
|
||||
|
|
@ -47,6 +48,9 @@ public class PhysicalNetworkVO implements PhysicalNetwork {
|
|||
@TableGenerator(name="physical_networks_sq", table="sequence", pkColumnName="name", valueColumnName="value", pkColumnValue="physical_networks_seq", allocationSize=1)
|
||||
@Column(name="id")
|
||||
long id;
|
||||
|
||||
@Column(name="uuid")
|
||||
private String uuid;
|
||||
|
||||
@Column(name="data_center_id")
|
||||
long dataCenterId;
|
||||
|
|
@ -99,6 +103,7 @@ public class PhysicalNetworkVO implements PhysicalNetwork {
|
|||
this.broadcastDomainRange = BroadcastDomainRange.ZONE;
|
||||
}
|
||||
this.state = State.Disabled;
|
||||
this.uuid = UUID.randomUUID().toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -203,5 +208,14 @@ public class PhysicalNetworkVO implements PhysicalNetwork {
|
|||
@Override
|
||||
public String getSpeed() {
|
||||
return speed;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUuid() {
|
||||
return this.uuid;
|
||||
}
|
||||
|
||||
public void setUuid(String uuid) {
|
||||
this.uuid = uuid;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ public interface NetworkDao extends GenericDao<NetworkVO, Long> {
|
|||
|
||||
Long getNetworkCountByOfferingId(long offeringId);
|
||||
|
||||
List<NetworkVO> listByPhysicalNetworkIncludingRemoved(long physicalNetworkId);
|
||||
List<NetworkVO> listByPhysicalNetwork(long physicalNetworkId);
|
||||
|
||||
List<NetworkVO> listSecurityGroupEnabledNetworks();
|
||||
|
||||
|
|
|
|||
|
|
@ -346,10 +346,10 @@ public class NetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implements N
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<NetworkVO> listByPhysicalNetworkIncludingRemoved(long physicalNetworkId) {
|
||||
public List<NetworkVO> listByPhysicalNetwork(long physicalNetworkId) {
|
||||
SearchCriteria<NetworkVO> sc = PhysicalNetworkSearch.create();
|
||||
sc.setParameters("physicalNetworkId", physicalNetworkId);
|
||||
return listIncludingRemovedBy(sc);
|
||||
return listBy(sc);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ package com.cloud.network.dao;
|
|||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
|
|
@ -39,6 +40,9 @@ public class PhysicalNetworkServiceProviderVO implements PhysicalNetworkServiceP
|
|||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "id")
|
||||
private long id;
|
||||
|
||||
@Column(name="uuid")
|
||||
private String uuid;
|
||||
|
||||
@Column(name = "physical_network_id")
|
||||
private long physicalNetworkId;
|
||||
|
|
@ -94,6 +98,7 @@ public class PhysicalNetworkServiceProviderVO implements PhysicalNetworkServiceP
|
|||
this.physicalNetworkId = physicalNetworkId;
|
||||
this.providerName = name;
|
||||
this.state = State.Disabled;
|
||||
this.uuid = UUID.randomUUID().toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -228,6 +233,15 @@ public class PhysicalNetworkServiceProviderVO implements PhysicalNetworkServiceP
|
|||
this.securitygroupServiceProvided = securitygroupServiceProvided;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUuid() {
|
||||
return this.uuid;
|
||||
}
|
||||
|
||||
public void setUuid(String uuid) {
|
||||
this.uuid = uuid;
|
||||
}
|
||||
|
||||
public void setEnabledServices(List<Service> services){
|
||||
this.setVpnServiceProvided(services.contains(Service.Vpn));
|
||||
this.setDhcpServiceProvided(services.contains(Service.Dhcp));
|
||||
|
|
|
|||
|
|
@ -17,6 +17,8 @@
|
|||
*/
|
||||
package com.cloud.network.dao;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.EnumType;
|
||||
|
|
@ -36,6 +38,9 @@ public class PhysicalNetworkTrafficTypeVO implements PhysicalNetworkTrafficType
|
|||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "id")
|
||||
private long id;
|
||||
|
||||
@Column(name="uuid")
|
||||
private String uuid;
|
||||
|
||||
@Column(name = "physical_network_id")
|
||||
private long physicalNetworkId;
|
||||
|
|
@ -66,6 +71,7 @@ public class PhysicalNetworkTrafficTypeVO implements PhysicalNetworkTrafficType
|
|||
this.kvmNetworkLabel = kvmLabel;
|
||||
this.vmwareNetworkLabel = vmwareLabel;
|
||||
this.setVlan(vlan);
|
||||
this.uuid = UUID.randomUUID().toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -116,6 +122,15 @@ public class PhysicalNetworkTrafficTypeVO implements PhysicalNetworkTrafficType
|
|||
|
||||
public String getVlan() {
|
||||
return vlan;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUuid() {
|
||||
return this.uuid;
|
||||
}
|
||||
|
||||
public void setUuid(String uuid) {
|
||||
this.uuid = uuid;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -371,7 +371,7 @@ public class VirtualRouterElement extends AdapterBase implements VirtualRouterEl
|
|||
|
||||
List<DomainRouterVO> routers = _routerDao.listByNetworkAndRole(network.getId(), Role.VIRTUAL_ROUTER);
|
||||
if (routers == null || routers.isEmpty()) {
|
||||
s_logger.trace("Can't find dhcp element in network " + network.getId());
|
||||
s_logger.debug("Can't find virtual router element in network " + network.getId());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -390,7 +390,7 @@ public class VirtualRouterElement extends AdapterBase implements VirtualRouterEl
|
|||
public VirtualRouterProvider configure(ConfigureVirtualRouterElementCmd cmd) {
|
||||
VirtualRouterProviderVO element = _vrProviderDao.findById(cmd.getId());
|
||||
if (element == null) {
|
||||
s_logger.trace("Can't find element with network service provider id " + cmd.getId());
|
||||
s_logger.debug("Can't find element with network service provider id " + cmd.getId());
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
@ -404,10 +404,10 @@ public class VirtualRouterElement extends AdapterBase implements VirtualRouterEl
|
|||
public VirtualRouterProvider addElement(Long nspId) {
|
||||
VirtualRouterProviderVO element = _vrProviderDao.findByNspIdAndType(nspId, VirtualRouterProviderType.VirtualRouter);
|
||||
if (element != null) {
|
||||
s_logger.trace("There is already a virtual router element with service provider id " + nspId);
|
||||
s_logger.debug("There is already a virtual router element with service provider id " + nspId);
|
||||
return null;
|
||||
}
|
||||
element = new VirtualRouterProviderVO(nspId, null, VirtualRouterProviderType.VirtualRouter);
|
||||
element = new VirtualRouterProviderVO(nspId, VirtualRouterProviderType.VirtualRouter);
|
||||
_vrProviderDao.persist(element);
|
||||
return element;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@
|
|||
package com.cloud.network.element;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.UUID;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
|
|
@ -56,12 +57,13 @@ public class VirtualRouterProviderVO implements VirtualRouterProvider {
|
|||
Date removed;
|
||||
|
||||
public VirtualRouterProviderVO() {
|
||||
this.uuid = UUID.randomUUID().toString();
|
||||
}
|
||||
|
||||
public VirtualRouterProviderVO(long nspId, String uuid, VirtualRouterProviderType type) {
|
||||
public VirtualRouterProviderVO(long nspId, VirtualRouterProviderType type) {
|
||||
this.nspId = nspId;
|
||||
this.uuid = uuid;
|
||||
this.type = type;
|
||||
this.uuid = UUID.randomUUID().toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -1156,8 +1156,8 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
|
|||
if (publicNetwork) {
|
||||
routers = _routerDao.listByNetworkAndRole(guestNetwork.getId(), Role.VIRTUAL_ROUTER);
|
||||
} else {
|
||||
Long podId = dest.getPod().getId();
|
||||
if (isPodBased) {
|
||||
Long podId = dest.getPod().getId();
|
||||
routers = _routerDao.listByNetworkAndPodAndRole(guestNetwork.getId(), podId, Role.VIRTUAL_ROUTER);
|
||||
plan = new DataCenterDeployment(dcId, podId, null, null, null, null);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -47,7 +47,6 @@ import javax.crypto.SecretKey;
|
|||
import org.apache.commons.codec.binary.Base64;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.acl.ControlledEntity.ACLType;
|
||||
import com.cloud.configuration.Config;
|
||||
import com.cloud.configuration.ConfigurationVO;
|
||||
import com.cloud.configuration.Resource;
|
||||
|
|
@ -68,7 +67,6 @@ import com.cloud.domain.dao.DomainDao;
|
|||
import com.cloud.exception.InternalErrorException;
|
||||
import com.cloud.exception.InvalidParameterValueException;
|
||||
import com.cloud.network.Network;
|
||||
import com.cloud.network.Network.GuestType;
|
||||
import com.cloud.network.Network.Provider;
|
||||
import com.cloud.network.Network.Service;
|
||||
import com.cloud.network.Network.State;
|
||||
|
|
@ -820,7 +818,8 @@ public class ConfigurationServerImpl implements ConfigurationServer {
|
|||
return tags;
|
||||
}
|
||||
|
||||
private void createDefaultNetworkOfferings() {
|
||||
@DB
|
||||
protected void createDefaultNetworkOfferings() {
|
||||
|
||||
NetworkOfferingVO publicNetworkOffering = new NetworkOfferingVO(NetworkOfferingVO.SystemPublicNetwork, TrafficType.Public);
|
||||
publicNetworkOffering = _networkOfferingDao.persistDefaultNetworkOffering(publicNetworkOffering);
|
||||
|
|
@ -859,6 +858,8 @@ public class ConfigurationServerImpl implements ConfigurationServer {
|
|||
|
||||
|
||||
//The only one diff between 1 and 2 network offerings is that the first one has SG enabled. In Basic zone only first network offering has to be enabled, in Advance zone - the second one
|
||||
Transaction txn = Transaction.currentTxn();
|
||||
txn.start();
|
||||
|
||||
//Offering #1
|
||||
NetworkOfferingVO deafultSharedSGNetworkOffering = new NetworkOfferingVO(
|
||||
|
|
@ -868,6 +869,7 @@ public class ConfigurationServerImpl implements ConfigurationServer {
|
|||
false, false, null, null, null, true,
|
||||
Availability.Optional, null, Network.GuestType.Shared);
|
||||
|
||||
deafultSharedSGNetworkOffering.setState(NetworkOffering.State.Enabled);
|
||||
deafultSharedSGNetworkOffering = _networkOfferingDao.persistDefaultNetworkOffering(deafultSharedSGNetworkOffering);
|
||||
|
||||
for (Service service : defaultSharedSGNetworkOfferingProviders.keySet()) {
|
||||
|
|
@ -884,6 +886,7 @@ public class ConfigurationServerImpl implements ConfigurationServer {
|
|||
false, true, null, null, null, true,
|
||||
Availability.Optional, null, Network.GuestType.Shared);
|
||||
|
||||
defaultSharedNetworkOffering.setState(NetworkOffering.State.Enabled);
|
||||
defaultSharedNetworkOffering = _networkOfferingDao.persistDefaultNetworkOffering(defaultSharedNetworkOffering);
|
||||
|
||||
for (Service service : defaultSharedNetworkOfferingProviders.keySet()) {
|
||||
|
|
@ -900,6 +903,7 @@ public class ConfigurationServerImpl implements ConfigurationServer {
|
|||
false, false, null, null, null, true,
|
||||
Availability.Required, null, Network.GuestType.Isolated);
|
||||
|
||||
defaultIsolatedSourceNatEnabledNetworkOffering.setState(NetworkOffering.State.Enabled);
|
||||
defaultIsolatedSourceNatEnabledNetworkOffering = _networkOfferingDao.persistDefaultNetworkOffering(defaultIsolatedSourceNatEnabledNetworkOffering);
|
||||
|
||||
|
||||
|
|
@ -917,13 +921,16 @@ public class ConfigurationServerImpl implements ConfigurationServer {
|
|||
false, true, null, null, null, true,
|
||||
Availability.Optional, null, Network.GuestType.Isolated);
|
||||
|
||||
defaultSharedNetworkOffering = _networkOfferingDao.persistDefaultNetworkOffering(defaultIsolatedEnabledNetworkOffering);
|
||||
defaultIsolatedEnabledNetworkOffering.setState(NetworkOffering.State.Enabled);
|
||||
defaultIsolatedEnabledNetworkOffering = _networkOfferingDao.persistDefaultNetworkOffering(defaultIsolatedEnabledNetworkOffering);
|
||||
|
||||
for (Service service : defaultIsolatedNetworkOfferingProviders.keySet()) {
|
||||
NetworkOfferingServiceMapVO offService = new NetworkOfferingServiceMapVO(defaultSharedNetworkOffering.getId(), service, defaultIsolatedNetworkOfferingProviders.get(service));
|
||||
NetworkOfferingServiceMapVO offService = new NetworkOfferingServiceMapVO(defaultIsolatedEnabledNetworkOffering.getId(), service, defaultIsolatedNetworkOfferingProviders.get(service));
|
||||
_ntwkOfferingServiceMapDao.persist(offService);
|
||||
s_logger.trace("Added service for the network offering: " + offService);
|
||||
}
|
||||
|
||||
txn.commit();
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1147,6 +1147,7 @@ public class ManagementServerImpl implements ManagementServer {
|
|||
Boolean forVirtual = cmd.getForVirtualNetwork();
|
||||
String vlanType = null;
|
||||
Long projectId = cmd.getProjectId();
|
||||
Long physicalNetworkId = cmd.getPhysicalNetworkId();
|
||||
|
||||
if (accountName != null && domainId != null) {
|
||||
if (projectId != null) {
|
||||
|
|
@ -1192,6 +1193,7 @@ public class ManagementServerImpl implements ManagementServer {
|
|||
sb.and("vlan", sb.entity().getVlanTag(), SearchCriteria.Op.EQ);
|
||||
sb.and("networkId", sb.entity().getNetworkId(), SearchCriteria.Op.EQ);
|
||||
sb.and("vlanType", sb.entity().getVlanType(), SearchCriteria.Op.EQ);
|
||||
sb.and("physicalNetworkId", sb.entity().getPhysicalNetworkId(), SearchCriteria.Op.EQ);
|
||||
|
||||
if (accountId != null) {
|
||||
SearchBuilder<AccountVlanMapVO> accountVlanMapSearch = _accountVlanMapDao.createSearchBuilder();
|
||||
|
|
@ -1238,6 +1240,10 @@ public class ManagementServerImpl implements ManagementServer {
|
|||
if (vlanType != null) {
|
||||
sc.setParameters("vlanType", vlanType);
|
||||
}
|
||||
|
||||
if (physicalNetworkId != null) {
|
||||
sc.setParameters("physicalNetworkId", physicalNetworkId);
|
||||
}
|
||||
}
|
||||
|
||||
return _vlanDao.search(sc, searchFilter);
|
||||
|
|
@ -2038,6 +2044,7 @@ public class ManagementServerImpl implements ManagementServer {
|
|||
String accountName = cmd.getAccountName();
|
||||
Object keyword = cmd.getKeyword();
|
||||
Long projectId = cmd.getProjectId();
|
||||
Long physicalNetworkId = cmd.getPhysicalNetworkId();
|
||||
|
||||
List<Long> permittedAccounts = new ArrayList<Long>();
|
||||
|
||||
|
|
@ -2107,6 +2114,7 @@ public class ManagementServerImpl implements ManagementServer {
|
|||
sb.and("address", sb.entity().getAddress(), SearchCriteria.Op.EQ);
|
||||
sb.and("vlanDbId", sb.entity().getVlanId(), SearchCriteria.Op.EQ);
|
||||
sb.and("id", sb.entity().getId(), SearchCriteria.Op.EQ);
|
||||
sb.and("physicalNetworkId", sb.entity().getPhysicalNetworkId(), SearchCriteria.Op.EQ);
|
||||
|
||||
if ((permittedAccounts.isEmpty()) && (domainId != null)) {
|
||||
// if accountId isn't specified, we can do a domain match for the admin case
|
||||
|
|
@ -2169,6 +2177,10 @@ public class ManagementServerImpl implements ManagementServer {
|
|||
if (vlan != null) {
|
||||
sc.setParameters("vlanDbId", vlan);
|
||||
}
|
||||
|
||||
if (physicalNetworkId != null) {
|
||||
sc.setParameters("physicalNetworkId", physicalNetworkId);
|
||||
}
|
||||
|
||||
return _publicIpAddressDao.search(sc, searchFilter);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,6 @@
|
|||
package com.cloud.agent;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.ejb.Local;
|
||||
import javax.naming.ConfigurationException;
|
||||
|
|
@ -12,24 +10,13 @@ import com.cloud.agent.api.Command;
|
|||
import com.cloud.agent.api.StartupCommand;
|
||||
import com.cloud.agent.manager.AgentAttache;
|
||||
import com.cloud.agent.manager.Commands;
|
||||
import com.cloud.api.commands.UpdateHostPasswordCmd;
|
||||
import com.cloud.dc.DataCenterVO;
|
||||
import com.cloud.dc.HostPodVO;
|
||||
import com.cloud.dc.PodCluster;
|
||||
import com.cloud.exception.AgentUnavailableException;
|
||||
import com.cloud.exception.ConnectionException;
|
||||
import com.cloud.exception.OperationTimedoutException;
|
||||
import com.cloud.host.Host;
|
||||
import com.cloud.host.Host.Type;
|
||||
import com.cloud.host.HostStats;
|
||||
import com.cloud.host.HostVO;
|
||||
import com.cloud.host.Status.Event;
|
||||
import com.cloud.hypervisor.Hypervisor.HypervisorType;
|
||||
import com.cloud.resource.ServerResource;
|
||||
import com.cloud.service.ServiceOfferingVO;
|
||||
import com.cloud.template.VirtualMachineTemplate;
|
||||
import com.cloud.user.User;
|
||||
import com.cloud.utils.Pair;
|
||||
|
||||
@Local(value = { AgentManager.class })
|
||||
public class MockAgentManagerImpl implements AgentManager {
|
||||
|
|
@ -102,7 +89,7 @@ public class MockAgentManagerImpl implements AgentManager {
|
|||
@Override
|
||||
public void unregisterForHostEvents(int id) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -133,46 +120,52 @@ public class MockAgentManagerImpl implements AgentManager {
|
|||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public boolean tapLoadingAgents(Long hostId, TapAgentsAction action) {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public AgentAttache handleDirectConnectAgent(HostVO host, StartupCommand[] cmds, ServerResource resource, boolean forRebalance) throws ConnectionException {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public boolean agentStatusTransitTo(HostVO host, Event e, long msId) {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public AgentAttache findAttache(long hostId) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public void pullAgentToMaintenance(long hostId) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public void disconnectWithoutInvestigation(long hostId, Event event) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public void pullAgentOutMaintenance(long hostId) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Answer sendToSSVM(Long dcId, Command cmd) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -168,7 +168,7 @@ public class MockNetworkManagerImpl implements NetworkManager, Manager, NetworkS
|
|||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public PublicIp assignSourceNatIpAddress(Account owner, Network network, long callerId) throws ConcurrentOperationException, InsufficientAddressCapacityException {
|
||||
|
|
@ -216,7 +216,7 @@ public class MockNetworkManagerImpl implements NetworkManager, Manager, NetworkS
|
|||
|
||||
@Override
|
||||
public void prepare(VirtualMachineProfile<? extends VMInstanceVO> profile, DeployDestination dest, ReservationContext context) throws InsufficientCapacityException, ConcurrentOperationException,
|
||||
ResourceUnavailableException {
|
||||
ResourceUnavailableException {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
|
@ -277,7 +277,7 @@ public class MockNetworkManagerImpl implements NetworkManager, Manager, NetworkS
|
|||
|
||||
@Override
|
||||
public Pair<NetworkGuru, NetworkVO> implementNetwork(long networkId, DeployDestination dest, ReservationContext context) throws ConcurrentOperationException, ResourceUnavailableException,
|
||||
InsufficientCapacityException {
|
||||
InsufficientCapacityException {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
|
@ -315,7 +315,7 @@ public class MockNetworkManagerImpl implements NetworkManager, Manager, NetworkS
|
|||
|
||||
@Override
|
||||
public boolean associateIpAddressListToAccount(long userId, long accountId, long zoneId, Long vlanId, Network networkToAssociateWith) throws InsufficientCapacityException,
|
||||
ConcurrentOperationException, ResourceUnavailableException {
|
||||
ConcurrentOperationException, ResourceUnavailableException {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
|
@ -433,12 +433,12 @@ public class MockNetworkManagerImpl implements NetworkManager, Manager, NetworkS
|
|||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Map<String, Set<String>> listNetworkOfferingServices(long networkOfferingId) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<? extends RemoteAccessVPNServiceProvider> getRemoteAccessVpnElements() {
|
||||
return null;
|
||||
|
|
@ -570,17 +570,17 @@ public class MockNetworkManagerImpl implements NetworkManager, Manager, NetworkS
|
|||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public boolean restartNetwork(RestartNetworkCmd cmd, boolean cleanup) throws ConcurrentOperationException, ResourceUnavailableException,
|
||||
InsufficientCapacityException {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
InsufficientCapacityException {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public Long getPodIdForVlan(long vlanDbId) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -708,4 +708,10 @@ public class MockNetworkManagerImpl implements NetworkManager, Manager, NetworkS
|
|||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long getPhysicalNetworkId(Network network) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,12 +23,6 @@ import com.cloud.utils.component.Manager;
|
|||
@Local(value = { AccountManager.class, AccountService.class })
|
||||
public class MockAccountManagerImpl implements Manager, AccountManager {
|
||||
|
||||
@Override
|
||||
public UserAccount createUserAccount(String userName, String password, String firstName, String lastName, String email, String timezone, String accountName, short accountType, Long domainId, String networkDomain) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteUserAccount(long accountId) {
|
||||
// TODO Auto-generated method stub
|
||||
|
|
@ -229,45 +223,53 @@ public class MockAccountManagerImpl implements Manager, AccountManager {
|
|||
public void checkAccess(Account account, AccessType accessType, ControlledEntity... entities) throws PermissionDeniedException {
|
||||
// TODO Auto-generated method stub
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void logoutUser(Long userId) {
|
||||
// TODO Auto-generated method stub
|
||||
// TODO Auto-generated method stub
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public UserAccount getUserAccount(String username, Long domainId) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public UserAccount authenticateUser(String username, String password, Long domainId, Map<String, Object[]> requestParameters) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Pair<User, Account> findUserByApiKey(String apiKey) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public UserVO createUser(long accountId, String userName, String password, String firstName, String lastName, String email, String timezone) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Account createAccount(String accountName, short accountType, Long domainId, String networkDomain) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String[] createApiKeyAndSecretKey(RegisterCmd cmd) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean lockAccount(long accountId) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserAccount createUserAccount(String userName, String password, String firstName, String lastName, String email, String timezone, String accountName, short accountType, Long domainId, String networkDomain,
|
||||
Map details) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Account createAccount(String accountName, short accountType, Long domainId, String networkDomain, Map details) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import javax.naming.ConfigurationException;
|
|||
import com.cloud.agent.api.StopAnswer;
|
||||
import com.cloud.agent.api.VmStatsEntry;
|
||||
import com.cloud.agent.manager.Commands;
|
||||
import com.cloud.api.commands.AssignVMCmd;
|
||||
import com.cloud.api.commands.AttachVolumeCmd;
|
||||
import com.cloud.api.commands.CreateTemplateCmd;
|
||||
import com.cloud.api.commands.CreateVMGroupCmd;
|
||||
|
|
@ -18,10 +19,10 @@ import com.cloud.api.commands.DeployVMCmd;
|
|||
import com.cloud.api.commands.DestroyVMCmd;
|
||||
import com.cloud.api.commands.DetachVolumeCmd;
|
||||
import com.cloud.api.commands.ListVMsCmd;
|
||||
import com.cloud.api.commands.MoveUserVMCmd;
|
||||
import com.cloud.api.commands.RebootVMCmd;
|
||||
import com.cloud.api.commands.RecoverVMCmd;
|
||||
import com.cloud.api.commands.ResetVMPasswordCmd;
|
||||
import com.cloud.api.commands.RestoreVMCmd;
|
||||
import com.cloud.api.commands.StartVMCmd;
|
||||
import com.cloud.api.commands.UpdateVMCmd;
|
||||
import com.cloud.api.commands.UpgradeVMCmd;
|
||||
|
|
@ -38,6 +39,7 @@ import com.cloud.host.Host;
|
|||
import com.cloud.hypervisor.Hypervisor.HypervisorType;
|
||||
import com.cloud.offering.ServiceOffering;
|
||||
import com.cloud.server.Criteria;
|
||||
import com.cloud.storage.StoragePool;
|
||||
import com.cloud.storage.Volume;
|
||||
import com.cloud.template.VirtualMachineTemplate;
|
||||
import com.cloud.user.Account;
|
||||
|
|
@ -234,7 +236,7 @@ public class MockUserVmManagerImpl implements UserVmManager, UserVmService, Mana
|
|||
|
||||
@Override
|
||||
public UserVm startVirtualMachine(StartVMCmd cmd) throws StorageUnavailableException, ExecutionException, ConcurrentOperationException, ResourceUnavailableException,
|
||||
InsufficientCapacityException, ResourceAllocationException {
|
||||
InsufficientCapacityException, ResourceAllocationException {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
|
@ -269,7 +271,7 @@ public class MockUserVmManagerImpl implements UserVmManager, UserVmService, Mana
|
|||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public UserVm startVirtualMachine(DeployVMCmd cmd) throws InsufficientCapacityException, ConcurrentOperationException, ResourceUnavailableException {
|
||||
|
|
@ -310,7 +312,7 @@ public class MockUserVmManagerImpl implements UserVmManager, UserVmService, Mana
|
|||
@Override
|
||||
public void deletePrivateTemplateRecord(Long templateId) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -327,7 +329,7 @@ public class MockUserVmManagerImpl implements UserVmManager, UserVmService, Mana
|
|||
|
||||
@Override
|
||||
public UserVm createVirtualMachine(DeployVMCmd cmd) throws InsufficientCapacityException, ResourceUnavailableException, ConcurrentOperationException, StorageUnavailableException,
|
||||
ResourceAllocationException {
|
||||
ResourceAllocationException {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
|
@ -365,14 +367,26 @@ public class MockUserVmManagerImpl implements UserVmManager, UserVmService, Mana
|
|||
}
|
||||
|
||||
@Override
|
||||
public UserVm moveVMToUser(MoveUserVMCmd moveUserVMCmd) throws ResourceAllocationException, ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException {
|
||||
public VirtualMachine migrateVirtualMachine(Long vmId, Host destinationHost) throws ResourceUnavailableException, ConcurrentOperationException, ManagementServerException,
|
||||
VirtualMachineMigrationException {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public VirtualMachine migrateVirtualMachine(Long vmId, Host destinationHost) throws ResourceUnavailableException, ConcurrentOperationException, ManagementServerException,
|
||||
VirtualMachineMigrationException {
|
||||
public UserVm moveVMToUser(AssignVMCmd moveUserVMCmd) throws ResourceAllocationException, ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public VirtualMachine vmStorageMigration(Long vmId, StoragePool destPool) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserVm restoreVM(RestoreVMCmd cmd) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ import com.cloud.network.NetworkVO;
|
|||
import com.cloud.offering.ServiceOffering;
|
||||
import com.cloud.service.ServiceOfferingVO;
|
||||
import com.cloud.storage.DiskOfferingVO;
|
||||
import com.cloud.storage.StoragePool;
|
||||
import com.cloud.storage.VMTemplateVO;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.User;
|
||||
|
|
@ -82,7 +83,7 @@ public class MockVirtualMachineManagerImpl implements VirtualMachineManager {
|
|||
|
||||
@Override
|
||||
public <T extends VMInstanceVO> boolean advanceStop(T vm, boolean forced, User caller, Account account) throws ResourceUnavailableException, OperationTimedoutException,
|
||||
ConcurrentOperationException {
|
||||
ConcurrentOperationException {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
|
@ -113,7 +114,7 @@ public class MockVirtualMachineManagerImpl implements VirtualMachineManager {
|
|||
|
||||
@Override
|
||||
public <T extends VMInstanceVO> T migrate(T vm, long srcHostId, DeployDestination dest) throws ResourceUnavailableException, ConcurrentOperationException, ManagementServerException,
|
||||
VirtualMachineMigrationException {
|
||||
VirtualMachineMigrationException {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
|
@ -133,7 +134,7 @@ public class MockVirtualMachineManagerImpl implements VirtualMachineManager {
|
|||
@Override
|
||||
public <T extends VMInstanceVO> T allocate(T vm, VMTemplateVO template, ServiceOfferingVO serviceOffering, Pair<? extends DiskOfferingVO, Long> rootDiskOffering,
|
||||
List<Pair<DiskOfferingVO, Long>> dataDiskOfferings, List<Pair<NetworkVO, NicProfile>> networks, Map<Param, Object> params, DeploymentPlan plan, HypervisorType hyperType, Account owner)
|
||||
throws InsufficientCapacityException {
|
||||
throws InsufficientCapacityException {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
|
@ -160,21 +161,21 @@ public class MockVirtualMachineManagerImpl implements VirtualMachineManager {
|
|||
|
||||
@Override
|
||||
public <T extends VMInstanceVO> T start(T vm, Map<Param, Object> params, User caller, Account account, DeploymentPlan planToDeploy) throws InsufficientCapacityException,
|
||||
ResourceUnavailableException {
|
||||
ResourceUnavailableException {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T extends VMInstanceVO> T advanceStart(T vm, Map<Param, Object> params, User caller, Account account) throws InsufficientCapacityException, ResourceUnavailableException,
|
||||
ConcurrentOperationException, OperationTimedoutException {
|
||||
ConcurrentOperationException, OperationTimedoutException {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T extends VMInstanceVO> T advanceStart(T vm, Map<Param, Object> params, User caller, Account account, DeploymentPlan planToDeploy) throws InsufficientCapacityException,
|
||||
ResourceUnavailableException, ConcurrentOperationException, OperationTimedoutException {
|
||||
ResourceUnavailableException, ConcurrentOperationException, OperationTimedoutException {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
|
@ -187,7 +188,7 @@ public class MockVirtualMachineManagerImpl implements VirtualMachineManager {
|
|||
|
||||
@Override
|
||||
public <T extends VMInstanceVO> T advanceReboot(T vm, Map<Param, Object> params, User caller, Account account) throws InsufficientCapacityException, ResourceUnavailableException,
|
||||
ConcurrentOperationException, OperationTimedoutException {
|
||||
ConcurrentOperationException, OperationTimedoutException {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
|
@ -198,10 +199,10 @@ public class MockVirtualMachineManagerImpl implements VirtualMachineManager {
|
|||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public VMInstanceVO findById(long vmId) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
@Override
|
||||
public <T extends VMInstanceVO> T storageMigration(T vm, StoragePool storagePoolId) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -118,6 +118,10 @@ DROP TABLE IF EXISTS `cloud`.`network_tags`;
|
|||
DROP TABLE IF EXISTS `cloud`.`op_host_transfer`;
|
||||
DROP TABLE IF EXISTS `cloud`.`projects`;
|
||||
DROP TABLE IF EXISTS `cloud`.`physical_network`;
|
||||
DROP TABLE IF EXISTS `cloud`.`physical_network_tags`;
|
||||
DROP TABLE IF EXISTS `cloud`.`physical_network_isolation_methods`;
|
||||
DROP TABLE IF EXISTS `cloud`.`physical_network_traffic_types`;
|
||||
DROP TABLE IF EXISTS `cloud`.`physical_network_service_providers`;
|
||||
DROP TABLE IF EXISTS `cloud`.`virtual_router_elements`;
|
||||
|
||||
CREATE TABLE `cloud`.`version` (
|
||||
|
|
@ -458,10 +462,9 @@ CREATE TABLE `cloud`.`vlan` (
|
|||
`network_id` bigint unsigned NOT NULL COMMENT 'id of corresponding network offering',
|
||||
`physical_network_id` bigint unsigned NOT NULL COMMENT 'physical network id that this configuration is based on',
|
||||
PRIMARY KEY (`id`),
|
||||
CONSTRAINT `fk_vlan__network_id` FOREIGN KEY (`network_id`) REFERENCES `networks`(`id`),
|
||||
#CONSTRAINT `fk_vlan__network_id` FOREIGN KEY (`network_id`) REFERENCES `networks`(`id`),
|
||||
CONSTRAINT `fk_vlan__data_center_id` FOREIGN KEY (`data_center_id`) REFERENCES `data_center`(`id`),
|
||||
CONSTRAINT `uc_vlan__uuid` UNIQUE (`uuid`),
|
||||
#CONSTRAINT `fk_vlan__network_id` FOREIGN KEY (`network_id`) REFERENCES `networks`(`id`),
|
||||
CONSTRAINT `fk_vlan__physical_network_id` FOREIGN KEY (`physical_network_id`) REFERENCES `physical_network`(`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
|
|
@ -1851,6 +1854,7 @@ CREATE TABLE `ntwk_service_map` (
|
|||
|
||||
CREATE TABLE `cloud`.`physical_network` (
|
||||
`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
|
||||
`uuid` varchar(40),
|
||||
`data_center_id` bigint unsigned NOT NULL COMMENT 'data center id that this physical network belongs to',
|
||||
`vnet` varchar(255),
|
||||
`speed` varchar(32),
|
||||
|
|
@ -1862,6 +1866,7 @@ CREATE TABLE `cloud`.`physical_network` (
|
|||
PRIMARY KEY (`id`),
|
||||
CONSTRAINT `fk_physical_network__data_center_id` FOREIGN KEY (`data_center_id`) REFERENCES `data_center`(`id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `fk_physical_network__domain_id` FOREIGN KEY(`domain_id`) REFERENCES `domain`(`id`),
|
||||
CONSTRAINT `uc_physical_networks__uuid` UNIQUE (`uuid`),
|
||||
INDEX `i_physical_network__removed`(`removed`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
|
|
@ -1885,6 +1890,7 @@ CREATE TABLE `cloud`.`physical_network_isolation_methods` (
|
|||
|
||||
CREATE TABLE `cloud`.`physical_network_traffic_types` (
|
||||
`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
|
||||
`uuid` varchar(40),
|
||||
`physical_network_id` bigint unsigned NOT NULL COMMENT 'id of the physical network',
|
||||
`traffic_type` varchar(32) NOT NULL COMMENT 'type of traffic going through this network',
|
||||
`xen_network_label` varchar(255) COMMENT 'The network name label of the physical device dedicated to this traffic on a XenServer host',
|
||||
|
|
@ -1893,11 +1899,13 @@ CREATE TABLE `cloud`.`physical_network_traffic_types` (
|
|||
`vlan` varchar(255) COMMENT 'The vlan tag to be sent down to a VMware host',
|
||||
PRIMARY KEY (`id`),
|
||||
CONSTRAINT `fk_physical_network_traffic_types__physical_network_id` FOREIGN KEY (`physical_network_id`) REFERENCES `physical_network`(`id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `uc_traffic_types__uuid` UNIQUE (`uuid`),
|
||||
UNIQUE KEY(`physical_network_id`, `traffic_type`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE `cloud`.`physical_network_service_providers` (
|
||||
`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
|
||||
`uuid` varchar(40),
|
||||
`physical_network_id` bigint unsigned NOT NULL COMMENT 'id of the physical network',
|
||||
`provider_name` varchar(255) NOT NULL COMMENT 'Service Provider name',
|
||||
`state` varchar(32) NOT NULL DEFAULT 'Disabled' COMMENT 'provider state',
|
||||
|
|
@ -1914,7 +1922,8 @@ CREATE TABLE `cloud`.`physical_network_service_providers` (
|
|||
`user_data_service_provided` tinyint(1) unsigned NOT NULL DEFAULT 0 COMMENT 'Is UserData service provided',
|
||||
`security_group_service_provided` tinyint(1) unsigned NOT NULL DEFAULT 0 COMMENT 'Is SG service provided',
|
||||
PRIMARY KEY (`id`),
|
||||
CONSTRAINT `fk_pnetwork_service_providers__physical_network_id` FOREIGN KEY (`physical_network_id`) REFERENCES `physical_network`(`id`) ON DELETE CASCADE
|
||||
CONSTRAINT `fk_pnetwork_service_providers__physical_network_id` FOREIGN KEY (`physical_network_id`) REFERENCES `physical_network`(`id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `uc_service_providers__uuid` UNIQUE (`uuid`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE `cloud`.`external_load_balancer_devices` (
|
||||
|
|
@ -1974,12 +1983,13 @@ CREATE TABLE `cloud`.`network_external_firewall_device_map` (
|
|||
CREATE TABLE `cloud`.`virtual_router_providers` (
|
||||
`id` bigint unsigned NOT NULL auto_increment COMMENT 'id',
|
||||
`nsp_id` bigint unsigned NOT NULL COMMENT 'Network Service Provider ID',
|
||||
`uuid` varchar(255) UNIQUE,
|
||||
`uuid` varchar(40),
|
||||
`type` varchar(255) NOT NULL COMMENT 'Virtual router, or ElbVM',
|
||||
`enabled` int(1) NOT NULL COMMENT 'Enabled or disabled',
|
||||
`removed` datetime COMMENT 'date removed if not null',
|
||||
PRIMARY KEY (`id`),
|
||||
CONSTRAINT `fk_virtual_router_providers__nsp_id` FOREIGN KEY (`nsp_id`) REFERENCES `physical_network_service_providers` (`id`) ON DELETE CASCADE
|
||||
CONSTRAINT `fk_virtual_router_providers__nsp_id` FOREIGN KEY (`nsp_id`) REFERENCES `physical_network_service_providers` (`id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `uc_virtual_router_providers__uuid` UNIQUE (`uuid`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
SET foreign_key_checks = 1;
|
||||
|
|
|
|||
|
|
@ -297,6 +297,224 @@ body.login {
|
|||
background: #FFFFFF;
|
||||
}
|
||||
|
||||
/*Install wizard*/
|
||||
.install-wizard {
|
||||
width: 1024px;
|
||||
height: 768px;
|
||||
margin: auto;
|
||||
overflow: hidden;
|
||||
border: 1px solid #E2E2E2;
|
||||
border-top: none;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.install-wizard .header {
|
||||
text-align: center;
|
||||
background: #0D6CAA;
|
||||
color: #FFFFFF;
|
||||
padding: 32px 0 89px;
|
||||
/*+text-shadow:0px 2px 2px #4B4B4B;*/
|
||||
-moz-text-shadow: 0px 2px 2px #4B4B4B;
|
||||
-webkit-text-shadow: 0px 2px 2px #4B4B4B;
|
||||
-o-text-shadow: 0px 2px 2px #4B4B4B;
|
||||
text-shadow: 0px 2px 2px #4B4B4B;
|
||||
z-index: 9;
|
||||
}
|
||||
|
||||
.install-wizard .step {
|
||||
max-width: 691px;
|
||||
margin: auto;
|
||||
padding: 56px 0 0;
|
||||
}
|
||||
|
||||
.install-wizard .step .title {
|
||||
width: 303px;
|
||||
margin: auto auto 30px;
|
||||
font-size: 22px;
|
||||
clear: both;
|
||||
color: #1D4E7D;
|
||||
}
|
||||
|
||||
.install-wizard .step .subtitle {
|
||||
color: #808080;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.install-wizard .step p {
|
||||
color: #4A4A4A;
|
||||
font-size: 15px;
|
||||
line-height: 23px;
|
||||
}
|
||||
|
||||
.install-wizard .step .field {
|
||||
text-align: left;
|
||||
margin: 0 0 12px;
|
||||
}
|
||||
|
||||
.install-wizard .step .field label {
|
||||
display: block;
|
||||
clear: both;
|
||||
font-size: 13px;
|
||||
color: #4D4D4D;
|
||||
}
|
||||
|
||||
.install-wizard .step .field label.error {
|
||||
color: #FF2424;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.install-wizard .body {
|
||||
width: 987px;
|
||||
height: 626px;
|
||||
margin: -52px auto auto;
|
||||
z-index: 10;
|
||||
/*+box-shadow:0px 3px 15px #696767;*/
|
||||
-moz-box-shadow: 0px 3px 15px #696767;
|
||||
-webkit-box-shadow: 0px 3px 15px #696767;
|
||||
-o-box-shadow: 0px 3px 15px #696767;
|
||||
box-shadow: 0px 3px 15px #696767;
|
||||
background: #FFFFFF;
|
||||
}
|
||||
|
||||
.install-wizard h2 {
|
||||
font-size: 24px;
|
||||
margin: 0 0 19px;
|
||||
}
|
||||
|
||||
.install-wizard input[type=text],
|
||||
.install-wizard input[type=password],
|
||||
.install-wizard input[type=text],
|
||||
.install-wizard select {
|
||||
width: 288px;
|
||||
/*+border-radius:4px;*/
|
||||
-moz-border-radius: 4px;
|
||||
-webkit-border-radius: 4px;
|
||||
-khtml-border-radius: 4px;
|
||||
border-radius: 4px 4px 4px 4px;
|
||||
border: 1px solid #CDCDCD;
|
||||
/*+box-shadow:inset 0px 1px 0px #AEAEAE;*/
|
||||
-moz-box-shadow: inset 0px 1px 0px #AEAEAE;
|
||||
-webkit-box-shadow: inset 0px 1px 0px #AEAEAE;
|
||||
-o-box-shadow: inset 0px 1px 0px #AEAEAE;
|
||||
box-shadow: inset 0px 1px 0px #AEAEAE;
|
||||
font-size: 14px;
|
||||
color: #232323;
|
||||
padding: 6px;
|
||||
background: #F7F7F7;
|
||||
}
|
||||
|
||||
.install-wizard .button {
|
||||
background: url(../images/bg-gradients.png) 0px -221px;
|
||||
padding: 7px 16px 7px 18px;
|
||||
/*+border-radius:10px;*/
|
||||
-moz-border-radius: 10px;
|
||||
-webkit-border-radius: 10px;
|
||||
-khtml-border-radius: 10px;
|
||||
border-radius: 10px 10px 10px 10px;
|
||||
border: 1px solid #505050;
|
||||
color: #FFFFFF;
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
/*+text-shadow:0px -1px 3px #3F4351;*/
|
||||
-moz-text-shadow: 0px -1px 3px #3F4351;
|
||||
-webkit-text-shadow: 0px -1px 3px #3F4351;
|
||||
-o-text-shadow: 0px -1px 3px #3F4351;
|
||||
text-shadow: 0px -1px 3px #3F4351;
|
||||
float: right;
|
||||
cursor: pointer;
|
||||
margin-top: 15px;
|
||||
}
|
||||
|
||||
.install-wizard .button.advanced-installation {
|
||||
background: #E0DEDE;
|
||||
color: #7D7D7D;
|
||||
border: 1px solid #C7C2C2;
|
||||
/*+text-shadow:0px 0px #FFFFFF;*/
|
||||
-moz-text-shadow: 0px 0px #FFFFFF;
|
||||
-webkit-text-shadow: 0px 0px #FFFFFF;
|
||||
-o-text-shadow: 0px 0px #FFFFFF;
|
||||
text-shadow: 0px 0px #FFFFFF;
|
||||
float: left;
|
||||
}
|
||||
|
||||
/*** Setup form*/
|
||||
.install-wizard .step .setup-form {
|
||||
display: inline-block;
|
||||
background: #F0F0F0;
|
||||
width: 469px;
|
||||
border: 1px solid #CFCFCF;
|
||||
/*+text-shadow:0px 1px 0px #FFFFFF;*/
|
||||
-moz-text-shadow: 0px 1px 0px #FFFFFF;
|
||||
-webkit-text-shadow: 0px 1px 0px #FFFFFF;
|
||||
-o-text-shadow: 0px 1px 0px #FFFFFF;
|
||||
text-shadow: 0px 1px 0px #FFFFFF;
|
||||
}
|
||||
|
||||
.install-wizard .step .setup-form .title {
|
||||
float: left;
|
||||
margin: 17px 0 0 29px;
|
||||
color: #626F7C;
|
||||
}
|
||||
|
||||
.install-wizard .step .setup-form .field {
|
||||
width: 389px;
|
||||
display: inline-block;
|
||||
margin: 6px 0 1px 31px;
|
||||
padding: 9px;
|
||||
background: #E2E2E2;
|
||||
color: #57646D;
|
||||
}
|
||||
|
||||
.install-wizard .step .setup-form .field .name {
|
||||
width: 93px;
|
||||
text-align: right;
|
||||
float: left;
|
||||
font-size: 13px;
|
||||
padding: 10px 0 0 0px;
|
||||
}
|
||||
|
||||
.install-wizard .step .setup-form .field .value {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.install-wizard .step .setup-form input[type=text],
|
||||
.install-wizard .step .setup-form input[type=password] {
|
||||
width: 278px;
|
||||
border: 1px solid #8D8D8D;
|
||||
padding: 2px 2px 1px;
|
||||
margin: 6px 4px 0 0;
|
||||
}
|
||||
|
||||
.install-wizard .step .setup-form .multi-range input[type=text] {
|
||||
width: 128px;
|
||||
}
|
||||
|
||||
.install-wizard .step .setup-form input.button {
|
||||
margin: 0 30px 14px 15px;
|
||||
}
|
||||
|
||||
/*** Step: Change user*/
|
||||
.install-wizard .step.change-user {
|
||||
text-align: center;
|
||||
padding-top: 95px;
|
||||
width: 316px;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
.install-wizard .step.intro {
|
||||
}
|
||||
|
||||
.install-wizard .step.intro .title {
|
||||
color: #565454;
|
||||
margin-left: 0;
|
||||
margin-bottom: 21px;
|
||||
font-size: 25px;
|
||||
}
|
||||
|
||||
.install-wizard .step.intro .subtitle {
|
||||
margin-bottom: 9px;
|
||||
}
|
||||
|
||||
/*Notifications*/
|
||||
div.notification-box {
|
||||
width: 323px;
|
||||
|
|
@ -3451,10 +3669,11 @@ label.error {
|
|||
}
|
||||
|
||||
.multi-wizard .progress ul li span.multiline {
|
||||
/*+placement:shift -22px 12px;*/
|
||||
/*+placement:shift -21px 12px;*/
|
||||
position: relative;
|
||||
left: -22px;
|
||||
left: -21px;
|
||||
top: 12px;
|
||||
width: 71px;
|
||||
}
|
||||
|
||||
.multi-wizard .progress ul li span.arrow {
|
||||
|
|
@ -4207,12 +4426,12 @@ label.error {
|
|||
}
|
||||
|
||||
.multi-wizard.zone-wizard .progress ul li {
|
||||
width: 128px;
|
||||
width: 288px;
|
||||
padding: 0 32px 0 0;
|
||||
}
|
||||
|
||||
.multi-wizard.zone-wizard .progress ul li span.arrow {
|
||||
margin: 0 0 0 32px;
|
||||
margin: 0 0 0 193px;
|
||||
}
|
||||
|
||||
.multi-wizard.zone-wizard .select-network .content .section {
|
||||
|
|
|
|||
|
|
@ -374,10 +374,8 @@
|
|||
<div class="multi-wizard zone-wizard">
|
||||
<div class="progress">
|
||||
<ul>
|
||||
<li class="first"><span class="number">1</span><span class="multiline">Select Network</span><span class="arrow"></span></li>
|
||||
<li><span class="number">2</span><span>Setup Zone</span><span class="arrow"></span></li>
|
||||
<li><span class="number">3</span><span>Setup Pod</span><span class="arrow"></span></li>
|
||||
<li class="last"><span class="number">4</span><span class="multiline">Setup IP Range</span></li>
|
||||
<li class="first"><span class="number">1</span><span>Zone Type</span><span class="arrow"></span></li>
|
||||
<li class="last"><span class="number">2</span><span>Setup Zone</span></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="steps">
|
||||
|
|
@ -387,8 +385,8 @@
|
|||
<div class="content">
|
||||
<!-- Select template -->
|
||||
<div class="section select-network-model">
|
||||
<h3>Setup network model</h3>
|
||||
<p>Please select a network model for your zone.</p>
|
||||
<h3>Setup zone type</h3>
|
||||
<p>Please select a configuration for your zone.</p>
|
||||
<div class="select-area">
|
||||
<div class="desc">Choose this network model if you do <em>not</em> want to enable any VLAN support. All virtual instances created under this network model will be assigned an IP directly from the network and security groups are used to provide security and segregation.</div>
|
||||
<input type="radio" name="network-model" value="Basic" checked="checked" />
|
||||
|
|
@ -516,7 +514,7 @@
|
|||
</div>
|
||||
|
||||
<!-- Step 3: Setup pod -->
|
||||
<div class="setup-pod">
|
||||
<div class="setup-pod disabled">
|
||||
<form>
|
||||
<div class="main-desc">Please enter the following information to add a new pod</div>
|
||||
<div class="content input-area">
|
||||
|
|
@ -568,7 +566,7 @@
|
|||
</div>
|
||||
|
||||
<!-- Step 4: Add IP range -->
|
||||
<div class="add-ip-range">
|
||||
<div class="add-ip-range disabled">
|
||||
<form>
|
||||
<div class="main-desc">Please add an IP range for your zone</div>
|
||||
<div class="content input-area">
|
||||
|
|
|
|||
16
ui/index.jsp
16
ui/index.jsp
|
|
@ -374,10 +374,8 @@
|
|||
<div class="multi-wizard zone-wizard">
|
||||
<div class="progress">
|
||||
<ul>
|
||||
<li class="first"><span class="number">1</span><span class="multiline">Select Network</span><span class="arrow"></span></li>
|
||||
<li><span class="number">2</span><span>Setup Zone</span><span class="arrow"></span></li>
|
||||
<li><span class="number">3</span><span>Setup Pod</span><span class="arrow"></span></li>
|
||||
<li class="last"><span class="number">4</span><span class="multiline">Setup IP Range</span></li>
|
||||
<li class="first"><span class="number">1</span><span>Zone Type</span><span class="arrow"></span></li>
|
||||
<li class="last"><span class="number">2</span><span>Setup Zone</span></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="steps">
|
||||
|
|
@ -387,8 +385,8 @@
|
|||
<div class="content">
|
||||
<!-- Select template -->
|
||||
<div class="section select-network-model">
|
||||
<h3>Setup network model</h3>
|
||||
<p>Please select a network model for your zone.</p>
|
||||
<h3>Setup zone type</h3>
|
||||
<p>Please select a configuration for your zone.</p>
|
||||
<div class="select-area">
|
||||
<div class="desc">Choose this network model if you do <em>not</em> want to enable any VLAN support. All virtual instances created under this network model will be assigned an IP directly from the network and security groups are used to provide security and segregation.</div>
|
||||
<input type="radio" name="network-model" value="Basic" checked="checked" />
|
||||
|
|
@ -516,7 +514,7 @@
|
|||
</div>
|
||||
|
||||
<!-- Step 3: Setup pod -->
|
||||
<div class="setup-pod">
|
||||
<div class="setup-pod disabled">
|
||||
<form>
|
||||
<div class="main-desc">Please enter the following information to add a new pod</div>
|
||||
<div class="content input-area">
|
||||
|
|
@ -568,7 +566,7 @@
|
|||
</div>
|
||||
|
||||
<!-- Step 4: Add IP range -->
|
||||
<div class="add-ip-range">
|
||||
<div class="add-ip-range disabled">
|
||||
<form>
|
||||
<div class="main-desc">Please add an IP range for your zone</div>
|
||||
<div class="content input-area">
|
||||
|
|
@ -1399,7 +1397,7 @@
|
|||
<script src="scripts/ui-custom/login.js" type="text/javascript"></script>
|
||||
<script src="scripts/ui-custom/projects.js" type="text/javascript"></script>
|
||||
<script src="scripts/cloudStack.js" type="text/javascript"></script>
|
||||
<script src="scripts-test/installWizard.js" type="text/javascript"></script>
|
||||
<script src="scripts/installWizard.js" type="text/javascript"></script>
|
||||
<script src="scripts/ui-custom/installWizard.js" type="text/javascript"></script>
|
||||
<script src="scripts/projects.js" type="text/javascript"></script>
|
||||
<script src="scripts/dashboard.js" type="text/javascript"></script>
|
||||
|
|
|
|||
|
|
@ -82,7 +82,10 @@
|
|||
if (args.doInstall) {
|
||||
cloudStack.uiCustom.installWizard({
|
||||
$container: $container,
|
||||
context: context
|
||||
context: context,
|
||||
complete: function() {
|
||||
$container.cloudStack(cloudStackArgs);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// Show cloudStack main UI
|
||||
|
|
|
|||
|
|
@ -2,11 +2,106 @@
|
|||
cloudStack.installWizard = {
|
||||
// Check if install wizard should be invoked
|
||||
check: function(args) {
|
||||
args.response.success({
|
||||
doInstall: args.context.users[0].username == 'newuser'
|
||||
});
|
||||
},
|
||||
|
||||
changeUser: function(args) {
|
||||
setTimeout(function() {
|
||||
args.response.success({
|
||||
doInstall: false
|
||||
data: {
|
||||
newUser: {
|
||||
username: args.data.username
|
||||
}
|
||||
}
|
||||
});
|
||||
}, 100);
|
||||
}, 500);
|
||||
},
|
||||
|
||||
// Copy text
|
||||
copy: {
|
||||
whatIsCloudStack: function(args) {
|
||||
args.response.success({
|
||||
text: 'CloudStack is open source software written in java that is designed to deploy and manage large networks of virtual machines, as a highly available, scalable cloud computing platform. CloudStack current supports the most popular open source hypervisors VMware, Oracle VM, KVM, XenServer and Xen Cloud Platform. CloudStack offers three ways to manage cloud computing environments: a easy-to-use web interface, command line and a full-featured RESTful API.'
|
||||
});
|
||||
},
|
||||
|
||||
whatIsAZone: function(args) {
|
||||
args.response.success({
|
||||
text: 'A zone is integral to the CloudStack platform -- your entire network is represented via a zone. More text goes here...'
|
||||
});
|
||||
},
|
||||
|
||||
whatIsAPod: function(args) {
|
||||
args.response.success({
|
||||
text: 'A pod is a part of a zone. More text goes here...'
|
||||
});
|
||||
},
|
||||
|
||||
whatIsACluster: function(args) {
|
||||
args.response.success({
|
||||
text: 'A cluster is a part of a zone. More text goes here...'
|
||||
});
|
||||
},
|
||||
|
||||
whatIsAHost: function(args) {
|
||||
args.response.success({
|
||||
text: 'A host is a part of a zone. More text goes here...'
|
||||
});
|
||||
},
|
||||
|
||||
whatIsPrimaryStorage: function(args) {
|
||||
args.response.success({
|
||||
text: 'Primary storage is a part of a zone. More text goes here...'
|
||||
});
|
||||
},
|
||||
|
||||
whatIsSecondaryStorage: function(args) {
|
||||
args.response.success({
|
||||
text: 'Secondary storage is a part of a zone. More text goes here...'
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
action: function(args) {
|
||||
var complete = args.response.success;
|
||||
|
||||
var createZone = function(args) {
|
||||
createPod();
|
||||
};
|
||||
|
||||
var createPod = function(args) {
|
||||
createIPRange();
|
||||
};
|
||||
|
||||
var createIPRange = function(args) {
|
||||
createCluster();
|
||||
};
|
||||
|
||||
var createCluster = function(args) {
|
||||
createHost();
|
||||
};
|
||||
|
||||
var createHost = function(args) {
|
||||
createPrimaryStorage();
|
||||
};
|
||||
|
||||
var createPrimaryStorage = function(args) {
|
||||
createSecondaryStorage();
|
||||
};
|
||||
|
||||
var createSecondaryStorage = function(args) {
|
||||
pollSystemVMs();
|
||||
};
|
||||
|
||||
var pollSystemVMs = function() {
|
||||
setTimeout(function() {
|
||||
complete();
|
||||
}, 5000);
|
||||
};
|
||||
|
||||
createZone();
|
||||
}
|
||||
};
|
||||
}(jQuery, cloudStack, testData));
|
||||
}(jQuery, cloudStack, testData));
|
||||
|
|
|
|||
|
|
@ -1070,6 +1070,7 @@
|
|||
|
||||
password: {
|
||||
label: 'Password',
|
||||
isPassword: true,
|
||||
validation: { required: true }
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -151,11 +151,34 @@
|
|||
|
||||
// Show cloudStack main UI widget
|
||||
complete: function(args) {
|
||||
$container.cloudStack($.extend(cloudStack, {
|
||||
context: {
|
||||
users: [args.user]
|
||||
var context = {
|
||||
users: [args.user]
|
||||
};
|
||||
var cloudStackArgs = $.extend(cloudStack, {
|
||||
context: context
|
||||
});
|
||||
|
||||
// Check to invoke install wizard
|
||||
cloudStack.installWizard.check({
|
||||
context: context,
|
||||
response: {
|
||||
success: function(args) {
|
||||
if (args.doInstall) {
|
||||
cloudStack.uiCustom.installWizard({
|
||||
$container: $container,
|
||||
context: context,
|
||||
complete: function() {
|
||||
// Show cloudStack main UI
|
||||
$container.cloudStack(cloudStackArgs);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// Show cloudStack main UI
|
||||
$container.cloudStack(cloudStackArgs);
|
||||
}
|
||||
}
|
||||
}
|
||||
}));
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -0,0 +1,285 @@
|
|||
(function($, cloudStack, testData) {
|
||||
cloudStack.installWizard = {
|
||||
// Check if install wizard should be invoked
|
||||
check: function(args) {
|
||||
args.response.success({
|
||||
doInstall: false
|
||||
});
|
||||
|
||||
// $.ajax({
|
||||
// url: createURL('listZones'),
|
||||
// dataType: 'json',
|
||||
// async: true,
|
||||
// success: function(data) {
|
||||
// args.response.success({
|
||||
// doInstall: !data.listzonesresponse.zone
|
||||
// });
|
||||
// }
|
||||
// });
|
||||
},
|
||||
|
||||
changeUser: function(args) {
|
||||
$.ajax({
|
||||
url: createURL('updateUser'),
|
||||
data: {
|
||||
id: cloudStack.context.users[0].userid,
|
||||
password: md5Hashed ? $.md5(args.data.password) : args.data.password
|
||||
},
|
||||
dataType: 'json',
|
||||
async: true,
|
||||
success: function(data) {
|
||||
args.response.success({
|
||||
data: { newUser: data.updateuserresponse.user }
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// Copy text
|
||||
copy: {
|
||||
whatIsCloudStack: function(args) {
|
||||
args.response.success({
|
||||
text: 'CloudStack is open source software written in java that is designed to deploy and manage large networks of virtual machines, as a highly available, scalable cloud computing platform. CloudStack current supports the most popular open source hypervisors VMware, Oracle VM, KVM, XenServer and Xen Cloud Platform. CloudStack offers three ways to manage cloud computing environments: a easy-to-use web interface, command line and a full-featured RESTful API.'
|
||||
});
|
||||
},
|
||||
|
||||
whatIsAZone: function(args) {
|
||||
args.response.success({
|
||||
text: 'A zone is integral to the CloudStack platform -- your entire network is represented via a zone. More text goes here...'
|
||||
});
|
||||
},
|
||||
|
||||
whatIsAPod: function(args) {
|
||||
args.response.success({
|
||||
text: 'A pod is a part of a zone. More text goes here...'
|
||||
});
|
||||
},
|
||||
|
||||
whatIsACluster: function(args) {
|
||||
args.response.success({
|
||||
text: 'A cluster is a part of a zone. More text goes here...'
|
||||
});
|
||||
},
|
||||
|
||||
whatIsAHost: function(args) {
|
||||
args.response.success({
|
||||
text: 'A host is a part of a zone. More text goes here...'
|
||||
});
|
||||
},
|
||||
|
||||
whatIsPrimaryStorage: function(args) {
|
||||
args.response.success({
|
||||
text: 'Primary storage is a part of a zone. More text goes here...'
|
||||
});
|
||||
},
|
||||
|
||||
whatIsSecondaryStorage: function(args) {
|
||||
args.response.success({
|
||||
text: 'Secondary storage is a part of a zone. More text goes here...'
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
action: function(args) {
|
||||
var complete = args.response.success;
|
||||
var data = args.data
|
||||
|
||||
/**
|
||||
* Step 1: add zone
|
||||
*/
|
||||
var createZone = function(args) {
|
||||
debugger;
|
||||
$.ajax({
|
||||
url: createURL('createZone'),
|
||||
data: {
|
||||
name: data.zone.name,
|
||||
networktype: 'Basic',
|
||||
internaldns1: data.zone.internaldns1,
|
||||
internaldns2: data.zone.internaldns2
|
||||
},
|
||||
dataType: 'json',
|
||||
async: true,
|
||||
success: function(data) {
|
||||
createPod({
|
||||
data: {
|
||||
zone: data.createzoneresponse.zone
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Step 2: add pod
|
||||
*/
|
||||
var createPod = function(args) {
|
||||
$.ajax({
|
||||
url: createURL('createPod'),
|
||||
data: {
|
||||
name: data['pod-name'],
|
||||
zoneid: args.data.zone.id,
|
||||
gateway: data['pod-gateway'],
|
||||
netmask: data['pod-netmask'],
|
||||
startip: data['pod-ip-range-start'],
|
||||
endip: data['pod-ip-range-end']
|
||||
},
|
||||
dataType: 'json',
|
||||
async: true,
|
||||
success: function(data) {
|
||||
createIPRange({
|
||||
data: $.extend(args.data, {
|
||||
pod: data.createpodresponse.pod
|
||||
})
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Step 3: add public IP range
|
||||
*/
|
||||
var createIPRange = function(args) {
|
||||
$.ajax({
|
||||
url: createURL('createVlanIpRange'),
|
||||
data: {
|
||||
zoneid: args.data.zone.id,
|
||||
vlan: 'untagged',
|
||||
gateway: data['guest-gateway'],
|
||||
netmask: data['guest-netmask'],
|
||||
startip: data['guest-ip-range-start'],
|
||||
endip: data['guest-ip-range-end']
|
||||
},
|
||||
dataType: 'json',
|
||||
async: true,
|
||||
success: function(data) {
|
||||
createCluster({
|
||||
data: $.extend(args.data, {
|
||||
ipRange: data.createvlaniprangeresponse.vlan
|
||||
})
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Step 4: add cluster
|
||||
*/
|
||||
var createCluster = function(args) {
|
||||
$.ajax({
|
||||
url: createURL('addCluster'),
|
||||
data: {
|
||||
clustername: data.cluster.name,
|
||||
podid: args.data.pod.id,
|
||||
zoneid: args.data.zone.id,
|
||||
hypervisor: data.cluster.hypervisor,
|
||||
clustertype: 'CloudManaged'
|
||||
},
|
||||
dataType: 'json',
|
||||
async: true,
|
||||
success: function(data) {
|
||||
createHost({
|
||||
data: $.extend(args.data, {
|
||||
cluster: data.addclusterresponse.cluster[0]
|
||||
})
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Step 5: add host
|
||||
*/
|
||||
var createHost = function(args) {
|
||||
$.ajax({
|
||||
url: createURL('addHost'),
|
||||
data: {
|
||||
clustername: args.data.cluster.name,
|
||||
zoneid: args.data.zone.id,
|
||||
podid: args.data.pod.id,
|
||||
hypervisor: 'XenServer',
|
||||
clustertype: 'CloudManaged',
|
||||
url: 'http://' + data.host.hostname,
|
||||
username: data.host.username,
|
||||
password: data.host.password
|
||||
},
|
||||
dataType: 'json',
|
||||
async: true,
|
||||
success: function(data) {
|
||||
createPrimaryStorage({
|
||||
data: $.extend(args.data, {
|
||||
host: data.addhostresponse.host[0]
|
||||
})
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Step 6: add primary storage
|
||||
*/
|
||||
var createPrimaryStorage = function(args) {
|
||||
$.ajax({
|
||||
url: createURL('createStoragePool'),
|
||||
data: {
|
||||
name: data.primaryStorage.name,
|
||||
clusterid: args.data.cluster.id,
|
||||
zoneid: args.data.zone.id,
|
||||
podid: args.data.pod.id,
|
||||
hypervisor: 'XenServer',
|
||||
clustertype: 'CloudManaged',
|
||||
url: 'nfs://' + data.primaryStorage.server + data.primaryStorage.path
|
||||
},
|
||||
dataType: 'json',
|
||||
async: true,
|
||||
success: function(data) {
|
||||
createSecondaryStorage({
|
||||
data: $.extend(args.data, {
|
||||
host: data.createstoragepoolresponse.storagepool
|
||||
})
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Step 7: add secondary storage
|
||||
*/
|
||||
var createSecondaryStorage = function(args) {
|
||||
$.ajax({
|
||||
url: createURL('addSecondaryStorage'),
|
||||
data: {
|
||||
clusterid: args.data.cluster.id,
|
||||
zoneid: args.data.zone.id,
|
||||
url: 'nfs://' + data.secondaryStorage.nfsServer + data.secondaryStorage.path
|
||||
},
|
||||
dataType: 'json',
|
||||
async: true,
|
||||
success: function(data) {
|
||||
pollSystemVMs();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Final step: poll for system VMs, wait until they are active to complete wizard
|
||||
*/
|
||||
var pollSystemVMs = function() {
|
||||
var poll = setInterval(function() {
|
||||
$.ajax({
|
||||
url: createURL('listSystemVms'),
|
||||
dataType: 'json',
|
||||
async: true,
|
||||
success: function(data) {
|
||||
if (data.listsystemvmsresponse.systemvm) {
|
||||
clearInterval(poll);
|
||||
complete();
|
||||
}
|
||||
}
|
||||
});
|
||||
}, 1000);
|
||||
};
|
||||
|
||||
createZone();
|
||||
}
|
||||
};
|
||||
}(jQuery, cloudStack, testData));
|
||||
|
|
@ -1,43 +1,682 @@
|
|||
(function($, cloudStack, testData) {
|
||||
cloudStack.uiCustom.installWizard = function(args) {
|
||||
var installWizard = function(args) {
|
||||
var context = args.context;
|
||||
var $installWizard = $('<div>').addClass('install-wizard');
|
||||
var $container = args.$container;
|
||||
var state = {}; // Hold wizard form state
|
||||
|
||||
/**
|
||||
* Successful installation action
|
||||
*/
|
||||
var complete = function() {
|
||||
$installWizard.remove();
|
||||
|
||||
args.complete();
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrive copy text and append to element -- async
|
||||
* @param id
|
||||
* @param $elem
|
||||
*/
|
||||
var getCopy = function(id, $elem) {
|
||||
cloudStack.installWizard.copy[id]({
|
||||
response: {
|
||||
success: function(args) {
|
||||
$elem.append(args.text);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return $elem;
|
||||
};
|
||||
|
||||
/**
|
||||
* Go to specified step in flow -- for use in individual steps
|
||||
* @param stateStepID ID to group state elements in (i.e., zone, pod, cluster, ...)
|
||||
* @param $elem (optional) Element containing <form>, to serialize for state
|
||||
*/
|
||||
var goTo = cloudStack._goto = function(stepID, stateID, $elem) {
|
||||
var $nextStep = steps[stepID]();
|
||||
var $body = $installWizard.find('.body');
|
||||
|
||||
if (stateID && $elem) {
|
||||
state[stateID] = cloudStack.serializeForm($elem.is('form') ? $elem : $elem.find('form'));
|
||||
}
|
||||
|
||||
$body.children().fadeOut('fast', function() {
|
||||
$(this).remove();
|
||||
$nextStep.addClass('step').hide().appendTo($body).fadeIn();
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Generic page elements
|
||||
*/
|
||||
var elems = {
|
||||
nextButton: function() {
|
||||
return $('<div>').addClass('button next').html('Next');
|
||||
header: function() {
|
||||
return $('<div></div>').addClass('header')
|
||||
.append(
|
||||
$.merge(
|
||||
$('<h2></h2>').html('Hello and Welcome to CloudStack.'),
|
||||
$('<h3></h3>').html('This tour will aid you in setting up your CloudStack installation')
|
||||
)
|
||||
);
|
||||
},
|
||||
body: function() {
|
||||
return $('<div></div>').addClass('body');
|
||||
},
|
||||
nextButton: function(label, options) {
|
||||
var $button = options && !options.type ?
|
||||
$('<div>').addClass('button goTo').html(label) :
|
||||
$('<input>').attr({ type: 'submit' }).addClass('button goTo').val(label);
|
||||
|
||||
return $button;
|
||||
}
|
||||
};
|
||||
|
||||
// Layout/behavior for each step in wizard
|
||||
/**
|
||||
* Layout/behavior for each step in wizard
|
||||
*/
|
||||
var steps = {
|
||||
// Welcome screen
|
||||
welcome: function(args) {
|
||||
return $.merge(
|
||||
$('<h1>').html('Welcome screen'),
|
||||
$('<p>').html('Welcome text goes here.'),
|
||||
$('<div>').addClass('button next').html('Next'),
|
||||
elems.nextButton().click(args.nextStep)
|
||||
changeUser: function(args) {
|
||||
var $changeUser = $('<div></div>').addClass('step change-user');
|
||||
var $form = $('<form></form>').appendTo($changeUser);
|
||||
|
||||
// Fields
|
||||
var $password = $('<input>').addClass('required').attr({ type: 'password', name: 'password' });
|
||||
var $passwordConfirm = $('<input>').addClass('required').attr({ type: 'password', name: 'password-confirm' });
|
||||
var $save = elems.nextButton('Save and continue', { type: 'submit' });
|
||||
|
||||
$form.append(
|
||||
$('<div></div>').addClass('title').html('Please change your password.'),
|
||||
$('<div></div>').addClass('field').append(
|
||||
$('<label>New Password:</label>'), $password
|
||||
),
|
||||
$('<div></div>').addClass('field').append(
|
||||
$('<label>Confirm Password:</label>'), $passwordConfirm
|
||||
),
|
||||
$save
|
||||
);
|
||||
|
||||
$form.validate();
|
||||
|
||||
// Save event
|
||||
$form.submit(function() {
|
||||
if (!$form.valid()) return false;
|
||||
|
||||
var $loading = $('<div></div>').addClass('loading-overlay').prependTo($form);
|
||||
cloudStack.installWizard.changeUser({
|
||||
data: cloudStack.serializeForm($form),
|
||||
response: {
|
||||
success: function(args) {
|
||||
goTo('intro', 'newUser', $form);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
return $changeUser;
|
||||
},
|
||||
|
||||
intro: function(args) {
|
||||
var $intro = $('<div></div>').addClass('intro');
|
||||
var $title = $('<div></div>').addClass('title')
|
||||
.html('What is CloudStack?');
|
||||
var $subtitle = $('<div></div>').addClass('subtitle')
|
||||
.html('Subtitle text goes here');
|
||||
var $copy = getCopy('whatIsCloudStack', $('<p></p>'));
|
||||
var $continue = elems.nextButton('Continue with basic installation');
|
||||
var $advanced = elems.nextButton('Setup advanced installation').addClass('advanced-installation');
|
||||
|
||||
$continue.click(function() {
|
||||
goTo('addZoneIntro');
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
$advanced.click(function() {
|
||||
complete();
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
return $intro.append(
|
||||
$title, $subtitle,
|
||||
$copy,
|
||||
$advanced,
|
||||
$continue
|
||||
);
|
||||
},
|
||||
|
||||
addZone: function(args) {
|
||||
var $zoneWizard = $('#template').find('.multi-wizard.zone-wizard').clone();
|
||||
/**
|
||||
* Add zone intro text
|
||||
* @param args
|
||||
*/
|
||||
addZoneIntro: function(args) {
|
||||
var $intro = $('<div></div>').addClass('intro');
|
||||
var $title = $('<div></div>').addClass('title')
|
||||
.html('Let\'s add a zone.');
|
||||
var $subtitle = $('<div></div>').addClass('subtitle')
|
||||
.html('What is a zone?');
|
||||
var $copy = getCopy('whatIsAZone', $('<p></p>'));
|
||||
var $continue = elems.nextButton('OK');
|
||||
|
||||
return $.merge(
|
||||
$zoneWizard.find('.steps .setup-zone'),
|
||||
elems.nextButton().click(function() {
|
||||
args.nextStep({
|
||||
data: {
|
||||
zone: cloudStack.serializeForm
|
||||
$continue.click(function() {
|
||||
goTo('addZone');
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
return $intro.append(
|
||||
$title, $subtitle,
|
||||
$copy,
|
||||
$continue
|
||||
);
|
||||
},
|
||||
|
||||
/**
|
||||
* Add zone form
|
||||
* @param args
|
||||
*/
|
||||
addZone: function(args) {
|
||||
var $addZone = $('<div></div>').addClass('add-zone');
|
||||
var $addZoneForm = $('<div>').addClass('setup-form').append(
|
||||
$('#template').find('.multi-wizard.zone-wizard .steps .setup-zone').clone()
|
||||
);
|
||||
var $save = elems.nextButton('Continue', { type: 'submit' });
|
||||
var $title = $('<div></div>').addClass('title').html('Setup Zone');
|
||||
|
||||
$addZoneForm.find('form').validate();
|
||||
|
||||
$save.click(function() {
|
||||
if (!$addZoneForm.find('form').valid()) return false;
|
||||
|
||||
goTo('addIPRange', 'zone', $addZoneForm);
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
// Remove unneeded fields
|
||||
$addZoneForm.find('.main-desc, .conditional').remove();
|
||||
$addZoneForm.find('.field:last').remove();
|
||||
|
||||
return $addZone.append(
|
||||
$addZoneForm
|
||||
.prepend($title)
|
||||
.append($save)
|
||||
);
|
||||
},
|
||||
|
||||
/**
|
||||
* Add IP range form
|
||||
* @param args
|
||||
*/
|
||||
addIPRange: function(args) {
|
||||
var $addIPRange = $('<div></div>').addClass('add-zone');
|
||||
var $addIPRangeForm = $('<div>').addClass('setup-form').append(
|
||||
$('#template').find('.multi-wizard.zone-wizard .steps .add-ip-range').clone()
|
||||
);
|
||||
var $save = elems.nextButton('Continue', { type: 'submit' });
|
||||
var $title = $('<div></div>').addClass('title').html('Setup IP Range');
|
||||
|
||||
$addIPRangeForm.find('form').validate();
|
||||
|
||||
$save.click(function() {
|
||||
if (!$addIPRangeForm.find('form').valid()) return false;
|
||||
|
||||
goTo('addPodIntro', 'zoneIPRange', $addIPRangeForm);
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
// Remove unneeded fields
|
||||
$addIPRangeForm.find('.main-desc, .conditional').remove();
|
||||
|
||||
return $addIPRange.append(
|
||||
$addIPRangeForm
|
||||
.prepend($title)
|
||||
.append($save)
|
||||
);
|
||||
},
|
||||
|
||||
/**
|
||||
* Add pod intro text
|
||||
* @param args
|
||||
*/
|
||||
addPodIntro: function(args) {
|
||||
var $intro = $('<div></div>').addClass('intro');
|
||||
var $title = $('<div></div>').addClass('title')
|
||||
.html('Let\'s add a pod.');
|
||||
var $subtitle = $('<div></div>').addClass('subtitle')
|
||||
.html('What is a pod?');
|
||||
var $copy = getCopy('whatIsAPod', $('<p></p>'));
|
||||
var $continue = elems.nextButton('OK');
|
||||
|
||||
$continue.click(function() {
|
||||
goTo('addPod');
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
return $intro.append(
|
||||
$title, $subtitle,
|
||||
$copy,
|
||||
$continue
|
||||
);
|
||||
},
|
||||
|
||||
/**
|
||||
* Add pod form
|
||||
* @param args
|
||||
*/
|
||||
addPod: function(args) {
|
||||
var $addPod = $('<div></div>').addClass('add-pod');
|
||||
var $addPodForm = $('<div>').addClass('setup-form').append(
|
||||
$('#template').find('.multi-wizard.zone-wizard .steps .setup-pod').clone()
|
||||
);
|
||||
var $save = elems.nextButton('Continue', { type: 'submit' });
|
||||
var $title = $('<div></div>').addClass('title').html('Add a Pod');
|
||||
|
||||
$addPodForm.find('form').validate();
|
||||
|
||||
$save.click(function() {
|
||||
if (!$addPodForm.find('form').valid()) return false;
|
||||
|
||||
goTo('addClusterIntro', 'pod', $addPodForm);
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
// Remove unneeded fields
|
||||
$addPodForm.find('.main-desc, .conditional').remove();
|
||||
|
||||
return $addPod.append(
|
||||
$addPodForm
|
||||
.prepend($title)
|
||||
.append($save)
|
||||
);
|
||||
},
|
||||
|
||||
/**
|
||||
* Add cluster intro text
|
||||
* @param args
|
||||
*/
|
||||
addClusterIntro: function(args) {
|
||||
var $intro = $('<div></div>').addClass('intro');
|
||||
var $title = $('<div></div>').addClass('title')
|
||||
.html('Let\'s add a cluster.');
|
||||
var $subtitle = $('<div></div>').addClass('subtitle')
|
||||
.html('What is a cluster?');
|
||||
var $copy = getCopy('whatIsACluster', $('<p></p>'));
|
||||
var $continue = elems.nextButton('OK');
|
||||
|
||||
$continue.click(function() {
|
||||
goTo('addCluster');
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
return $intro.append(
|
||||
$title, $subtitle,
|
||||
$copy,
|
||||
$continue
|
||||
);
|
||||
},
|
||||
|
||||
/**
|
||||
* Add cluster form
|
||||
* @param args
|
||||
*/
|
||||
addCluster: function(args) {
|
||||
var $addCluster = $('<div></div>').addClass('add-cluster');
|
||||
var addClusterForm = cloudStack.dialog.createForm({
|
||||
context: {
|
||||
zones: [{}]
|
||||
},
|
||||
noDialog: true,
|
||||
form: cloudStack.sections.system
|
||||
.subsections.clusters.listView
|
||||
.actions.add.createForm,
|
||||
after: function(args) {
|
||||
goTo('addHostIntro', 'cluster', $addClusterForm);
|
||||
}
|
||||
});
|
||||
var $addClusterForm = $('<div>').addClass('setup-form').append(
|
||||
addClusterForm.$formContainer
|
||||
);
|
||||
|
||||
var $save = elems.nextButton('Continue', { type: 'submit' }).appendTo($addClusterForm.find('form'));
|
||||
var $title = $('<div></div>').addClass('title').html('Add a Cluster');
|
||||
|
||||
$addClusterForm.find('form').submit(function() {
|
||||
addClusterForm.completeAction($addClusterForm);
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
// Cleanup
|
||||
$addClusterForm.find('.message').remove();
|
||||
$addClusterForm.find('.form-item').addClass('field').find('label.error').hide();
|
||||
$addClusterForm.find('.form-item[rel=podId]').remove();
|
||||
|
||||
return $addCluster.append(
|
||||
$addClusterForm
|
||||
.prepend($title)
|
||||
);
|
||||
},
|
||||
|
||||
/**
|
||||
* Add host intro text
|
||||
* @param args
|
||||
*/
|
||||
addHostIntro: function(args) {
|
||||
var $intro = $('<div></div>').addClass('intro');
|
||||
var $title = $('<div></div>').addClass('title')
|
||||
.html('Let\'s add a host.');
|
||||
var $subtitle = $('<div></div>').addClass('subtitle')
|
||||
.html('What is a host?');
|
||||
var $copy = getCopy('whatIsAHost', $('<p></p>'));
|
||||
var $continue = elems.nextButton('OK');
|
||||
|
||||
$continue.click(function() {
|
||||
goTo('addHost');
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
return $intro.append(
|
||||
$title, $subtitle,
|
||||
$copy,
|
||||
$continue
|
||||
);
|
||||
},
|
||||
|
||||
/**
|
||||
* Add host form
|
||||
* @param args
|
||||
*/
|
||||
addHost: function(args) {
|
||||
var $addHost = $('<div></div>').addClass('add-host');
|
||||
var addHostForm = cloudStack.dialog.createForm({
|
||||
context: { zones: [{}] },
|
||||
noDialog: true,
|
||||
form: {
|
||||
title: 'Add new host',
|
||||
desc: 'Please fill in the following information to add a new host fro the specified zone configuration.',
|
||||
fields: {
|
||||
hostname: {
|
||||
label: 'Host name',
|
||||
validation: { required: true }
|
||||
},
|
||||
|
||||
username: {
|
||||
label: 'User name',
|
||||
validation: { required: true }
|
||||
},
|
||||
|
||||
password: {
|
||||
label: 'Password',
|
||||
validation: { required: true },
|
||||
isPassword: true
|
||||
},
|
||||
//always appear (begin)
|
||||
hosttags: {
|
||||
label: 'Host tags',
|
||||
validation: { required: false }
|
||||
}
|
||||
});
|
||||
})
|
||||
//always appear (end)
|
||||
}
|
||||
},
|
||||
after: function(args) {
|
||||
goTo('addPrimaryStorageIntro', 'host', $addHostForm);
|
||||
}
|
||||
});
|
||||
var $addHostForm = $('<div>').addClass('setup-form').append(
|
||||
addHostForm.$formContainer
|
||||
);
|
||||
var $save = elems.nextButton('Continue', { type: 'submit' }).appendTo($addHostForm.find('form'));
|
||||
var $title = $('<div></div>').addClass('title').html('Add a Host');
|
||||
|
||||
$addHostForm.find('form').submit(function() {
|
||||
addHostForm.completeAction($addHostForm);
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
// Cleanup
|
||||
$addHostForm.find('.message').remove();
|
||||
$addHostForm.find('.form-item').addClass('field').find('label.error').hide();
|
||||
$addHostForm.find('.form-item[rel=cluster], .form-item[rel=pod]').remove();
|
||||
|
||||
return $addHost.append(
|
||||
$addHostForm
|
||||
.prepend($title)
|
||||
);
|
||||
},
|
||||
|
||||
/**
|
||||
* Add primary storage intro text
|
||||
* @param args
|
||||
*/
|
||||
addPrimaryStorageIntro: function(args) {
|
||||
var $intro = $('<div></div>').addClass('intro');
|
||||
var $title = $('<div></div>').addClass('title')
|
||||
.html('Let\'s add primary storage.');
|
||||
var $subtitle = $('<div></div>').addClass('subtitle')
|
||||
.html('What is primary storage?');
|
||||
var $copy = getCopy('whatIsPrimaryStorage', $('<p></p>'));
|
||||
var $continue = elems.nextButton('OK');
|
||||
|
||||
$continue.click(function() {
|
||||
goTo('addPrimaryStorage');
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
return $intro.append(
|
||||
$title, $subtitle,
|
||||
$copy,
|
||||
$continue
|
||||
);
|
||||
},
|
||||
|
||||
/**
|
||||
* Add primary storage
|
||||
* @param args
|
||||
*/
|
||||
addPrimaryStorage: function(args) {
|
||||
var $addPrimaryStorage = $('<div></div>').addClass('add-primary-storage');
|
||||
var addPrimaryStorageForm = cloudStack.dialog.createForm({
|
||||
noDialog: true,
|
||||
form: {
|
||||
title: 'Add new primary storage',
|
||||
desc: 'Please fill in the following information to add a new primary storage',
|
||||
fields: {
|
||||
name: {
|
||||
label: 'Name',
|
||||
validation: { required: true }
|
||||
},
|
||||
|
||||
server: {
|
||||
label: 'Server',
|
||||
validation: { required: true }
|
||||
},
|
||||
|
||||
path: {
|
||||
label: 'Path',
|
||||
validation: { required: true }
|
||||
},
|
||||
|
||||
storageTags: {
|
||||
label: 'Storage Tags',
|
||||
validation: { required: false }
|
||||
}
|
||||
}
|
||||
},
|
||||
after: function(args) {
|
||||
goTo('addSecondaryStorageIntro', 'primaryStorage', $addPrimaryStorageForm);
|
||||
}
|
||||
});
|
||||
var $addPrimaryStorageForm = $('<div>').addClass('setup-form').append(
|
||||
addPrimaryStorageForm.$formContainer
|
||||
);
|
||||
var $save = elems.nextButton('Continue', { type: 'submit' }).appendTo($addPrimaryStorageForm.find('form'));
|
||||
var $title = $('<div></div>').addClass('title').html('Add Primary Storage');
|
||||
|
||||
$addPrimaryStorageForm.find('form').submit(function() {
|
||||
addPrimaryStorageForm.completeAction($addPrimaryStorageForm);
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
// Cleanup
|
||||
$addPrimaryStorageForm.find('.message').remove();
|
||||
$addPrimaryStorageForm.find('.form-item').addClass('field').find('label.error').hide();
|
||||
$addPrimaryStorageForm.find('.form-item[rel=clusterId], .form-item[rel=podId]').remove();
|
||||
|
||||
return $addPrimaryStorage.append(
|
||||
$addPrimaryStorageForm
|
||||
.prepend($title)
|
||||
);
|
||||
},
|
||||
|
||||
/**
|
||||
* Add secondary storage intro text
|
||||
* @param args
|
||||
*/
|
||||
addSecondaryStorageIntro: function(args) {
|
||||
var $intro = $('<div></div>').addClass('intro');
|
||||
var $title = $('<div></div>').addClass('title')
|
||||
.html('Let\'s add secondary storage.');
|
||||
var $subtitle = $('<div></div>').addClass('subtitle')
|
||||
.html('What is a secondary storage?');
|
||||
var $copy = getCopy('whatIsSecondaryStorage', $('<p></p>'));
|
||||
var $continue = elems.nextButton('OK');
|
||||
|
||||
$continue.click(function() {
|
||||
goTo('addSecondaryStorage');
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
return $intro.append(
|
||||
$title, $subtitle,
|
||||
$copy,
|
||||
$continue
|
||||
);
|
||||
},
|
||||
|
||||
/**
|
||||
* Add secondary storage
|
||||
* @param args
|
||||
*/
|
||||
addSecondaryStorage: function(args) {
|
||||
var $addSecondaryStorage = $('<div></div>').addClass('add-secondary-storage');
|
||||
var addSecondaryStorageForm = cloudStack.dialog.createForm({
|
||||
noDialog: true,
|
||||
form: {
|
||||
title: 'Add new secondary storage',
|
||||
desc: 'Please fill in the following information to add a new secondary storage',
|
||||
fields: {
|
||||
nfsServer: {
|
||||
label: 'NFS Server',
|
||||
validation: { required: true }
|
||||
},
|
||||
path: {
|
||||
label: 'Path',
|
||||
validation: { required: true }
|
||||
}
|
||||
}
|
||||
},
|
||||
after: function(args) {
|
||||
goTo('launchInfo', 'secondaryStorage', $addSecondaryStorageForm);
|
||||
}
|
||||
});
|
||||
var $addSecondaryStorageForm = $('<div>').addClass('setup-form').append(
|
||||
addSecondaryStorageForm.$formContainer
|
||||
);
|
||||
var $save = elems.nextButton('Continue', { type: 'submit' }).appendTo($addSecondaryStorageForm.find('form'));
|
||||
var $title = $('<div></div>').addClass('title').html('Add Secondary Storage');
|
||||
|
||||
$addSecondaryStorageForm.find('form').submit(function() {
|
||||
addSecondaryStorageForm.completeAction($addSecondaryStorageForm);
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
// Cleanup
|
||||
$addSecondaryStorageForm.find('.message').remove();
|
||||
$addSecondaryStorageForm.find('.form-item').addClass('field').find('label.error').hide();
|
||||
|
||||
return $addSecondaryStorage.append(
|
||||
$addSecondaryStorageForm
|
||||
.prepend($title)
|
||||
);
|
||||
},
|
||||
|
||||
/**
|
||||
* Pre-launch text
|
||||
*/
|
||||
launchInfo: function(args) {
|
||||
var $intro = $('<div></div>').addClass('intro');
|
||||
var $title = $('<div></div>').addClass('title')
|
||||
.html('Congratulations!.');
|
||||
var $subtitle = $('<div></div>').addClass('subtitle')
|
||||
.html('Click the launch button.');
|
||||
var $copy = getCopy('whatIsACluster', $('<p></p>'));
|
||||
var $continue = elems.nextButton('Launch');
|
||||
|
||||
$continue.click(function() {
|
||||
goTo('launch');
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
return $intro.append(
|
||||
$title, $subtitle,
|
||||
$copy,
|
||||
$continue
|
||||
);
|
||||
},
|
||||
|
||||
/**
|
||||
* Initiates launch tasks
|
||||
*/
|
||||
launch: function(args) {
|
||||
var $intro = $('<div></div>').addClass('intro');
|
||||
var $title = $('<div></div>').addClass('title')
|
||||
.html('Now building your cloud...')
|
||||
.append($('<img>').attr({ src: 'images/ajax-loader.gif' }));
|
||||
var $subtitle = $('<div></div>').addClass('subtitle')
|
||||
.html('You may want to get a cup of coffee right now.');
|
||||
|
||||
cloudStack.installWizard.action({
|
||||
data: state,
|
||||
response: {
|
||||
success: function() {
|
||||
complete();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return $intro.append(
|
||||
$title, $subtitle
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
$installWizard.append(steps.addZone).appendTo($container);
|
||||
var initialStep = steps.changeUser().addClass('step');
|
||||
|
||||
$installWizard.append(
|
||||
$.merge(
|
||||
elems.header(),
|
||||
elems.body().append(initialStep)
|
||||
)
|
||||
).appendTo($container);
|
||||
};
|
||||
}(jQuery, cloudStack, testData));
|
||||
|
||||
cloudStack.uiCustom.installWizard = installWizard;
|
||||
}(jQuery, cloudStack, testData));
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
return function(listViewArgs) {
|
||||
var $wizard = $('#template').find('div.zone-wizard').clone();
|
||||
var $progress = $wizard.find('div.progress ul li');
|
||||
var $steps = $wizard.find('div.steps').children().hide();
|
||||
var $steps = $wizard.find('div.steps').children().hide().filter(':not(.disabled)');
|
||||
var $diagramParts = $wizard.find('div.diagram').children().hide();
|
||||
|
||||
// Close wizard
|
||||
|
|
|
|||
|
|
@ -38,37 +38,37 @@ import com.cloud.utils.db.GenericDao;
|
|||
*/
|
||||
public class MockComponentLocator extends ComponentLocator {
|
||||
MockComponentLibrary _library = new MockComponentLibrary();
|
||||
|
||||
|
||||
public MockComponentLocator(String server) {
|
||||
super(server);
|
||||
}
|
||||
|
||||
|
||||
public ComponentInfo<? extends GenericDao<?, ? extends Serializable>> addDao(String name, Class<? extends GenericDao<?, ? extends Serializable>> dao) {
|
||||
return _library.addDao(name, dao);
|
||||
}
|
||||
|
||||
|
||||
public ComponentInfo<Manager> addManager(String name, Class<? extends Manager> manager) {
|
||||
return _library.addManager(name, manager);
|
||||
}
|
||||
|
||||
|
||||
public <T> ComponentInfo<Adapter> addOneAdapter(Class<T> interphace, String name, Class<? extends T> adapterClass) {
|
||||
return _library.addOneAdapter(interphace, name, adapterClass);
|
||||
}
|
||||
|
||||
|
||||
public <T> List<ComponentInfo<Adapter>> addAdapterChain(Class<T> interphace, List<Pair<String, Class<? extends T>>> adapters) {
|
||||
return _library.addAdapterChain(interphace, adapters);
|
||||
}
|
||||
|
||||
|
||||
public <T> ComponentInfo<PluggableService> addService(String name, Class<T> serviceInterphace, Class<? extends PluggableService> service) {
|
||||
return _library.addService(name, serviceInterphace, service);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected Pair<XmlHandler, HashMap<String, List<ComponentInfo<Adapter>>>> parse2(String filename) {
|
||||
Pair<XmlHandler, HashMap<String, List<ComponentInfo<Adapter>>>> result = new Pair<XmlHandler, HashMap<String, List<ComponentInfo<Adapter>>>>(new XmlHandler("fake"), new HashMap<String, List<ComponentInfo<Adapter>>>());
|
||||
_daoMap = new LinkedHashMap<String, ComponentInfo<GenericDao<?, ? extends Serializable>>>();
|
||||
_managerMap = new LinkedHashMap<String, ComponentInfo<Manager>>();
|
||||
_checkerMap = new HashMap<String, ComponentInfo<SystemIntegrityChecker>>();
|
||||
_checkerMap = new LinkedHashMap<String, ComponentInfo<SystemIntegrityChecker>>();
|
||||
_adapterMap = new HashMap<String, Adapters<? extends Adapter>>();
|
||||
_factories = new HashMap<Class<?>, Class<?>>();
|
||||
_daoMap.putAll(_library.getDaos());
|
||||
|
|
@ -77,7 +77,7 @@ public class MockComponentLocator extends ComponentLocator {
|
|||
_factories.putAll(_library.getFactories());
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
public void makeActive(InterceptorLibrary interceptors) {
|
||||
s_singletons.clear();
|
||||
s_locators.clear();
|
||||
|
|
@ -86,24 +86,24 @@ public class MockComponentLocator extends ComponentLocator {
|
|||
s_callbackFilter = new DatabaseCallbackFilter();
|
||||
s_interceptors.clear();
|
||||
if (interceptors != null) {
|
||||
resetInterceptors(interceptors);
|
||||
resetInterceptors(interceptors);
|
||||
}
|
||||
s_tl.set(this);
|
||||
parse("fake file");
|
||||
}
|
||||
|
||||
|
||||
protected class MockComponentLibrary extends ComponentLibraryBase implements ComponentLibrary {
|
||||
|
||||
|
||||
@Override
|
||||
public Map<String, List<ComponentInfo<Adapter>>> getAdapters() {
|
||||
return _adapters;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Map<Class<?>, Class<?>> getFactories() {
|
||||
return new HashMap<Class<?>, Class<?>>();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Map<String, ComponentInfo<GenericDao<?, ?>>> getDaos() {
|
||||
return _daos;
|
||||
|
|
@ -116,7 +116,7 @@ public class MockComponentLocator extends ComponentLocator {
|
|||
|
||||
@Override
|
||||
public Map<String, ComponentInfo<PluggableService>> getPluggableServices() {
|
||||
return _pluggableServices;
|
||||
return _pluggableServices;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue