mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Here's the actual object model. This will allow developers to follow how CloudStack works by following the object model
This commit is contained in:
parent
b9ddcf8cfe
commit
c0ccabb5a3
4
framework/ipc/.settings/org.eclipse.m2e.core.prefs
Executable file
4
framework/ipc/.settings/org.eclipse.m2e.core.prefs
Executable file
@ -0,0 +1,4 @@
|
|||||||
|
activeProfiles=
|
||||||
|
eclipse.preferences.version=1
|
||||||
|
resolveWorkspaceProjects=true
|
||||||
|
version=1
|
||||||
5
platform/api/.settings/org.eclipse.jdt.core.prefs
Executable file
5
platform/api/.settings/org.eclipse.jdt.core.prefs
Executable file
@ -0,0 +1,5 @@
|
|||||||
|
eclipse.preferences.version=1
|
||||||
|
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
|
||||||
|
org.eclipse.jdt.core.compiler.compliance=1.5
|
||||||
|
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
||||||
|
org.eclipse.jdt.core.compiler.source=1.5
|
||||||
4
platform/api/.settings/org.eclipse.m2e.core.prefs
Executable file
4
platform/api/.settings/org.eclipse.m2e.core.prefs
Executable file
@ -0,0 +1,4 @@
|
|||||||
|
activeProfiles=
|
||||||
|
eclipse.preferences.version=1
|
||||||
|
resolveWorkspaceProjects=true
|
||||||
|
version=1
|
||||||
@ -0,0 +1,24 @@
|
|||||||
|
/*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
* distributed with this work for additional information
|
||||||
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
|
* to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
package org.apache.cloudstack.platform.cloud.entity.api;
|
||||||
|
|
||||||
|
import org.apache.cloudstack.platform.entity.api.CloudEntity;
|
||||||
|
|
||||||
|
public interface NetworkEntity extends CloudEntity {
|
||||||
|
}
|
||||||
@ -0,0 +1,29 @@
|
|||||||
|
/*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
* distributed with this work for additional information
|
||||||
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
|
* to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
package org.apache.cloudstack.platform.cloud.entity.api;
|
||||||
|
|
||||||
|
import org.apache.cloudstack.platform.entity.api.CloudEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author ahuang
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public interface NicEntity extends CloudEntity {
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,27 @@
|
|||||||
|
/*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
* distributed with this work for additional information
|
||||||
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
|
* to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
package org.apache.cloudstack.platform.cloud.entity.api;
|
||||||
|
|
||||||
|
import org.apache.cloudstack.platform.entity.api.CloudEntity;
|
||||||
|
|
||||||
|
import com.cloud.storage.Snapshot;
|
||||||
|
|
||||||
|
public interface SnapshotEntity extends CloudEntity, Snapshot {
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,27 @@
|
|||||||
|
/*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
* distributed with this work for additional information
|
||||||
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
|
* to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
package org.apache.cloudstack.platform.cloud.entity.api;
|
||||||
|
|
||||||
|
import org.apache.cloudstack.platform.entity.api.CloudEntity;
|
||||||
|
|
||||||
|
import com.cloud.template.VirtualMachineTemplate;
|
||||||
|
|
||||||
|
public interface TemplateEntity extends CloudEntity, VirtualMachineTemplate {
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,113 @@
|
|||||||
|
/*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
* distributed with this work for additional information
|
||||||
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
|
* to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
package org.apache.cloudstack.platform.cloud.entity.api;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.cloudstack.platform.entity.api.CloudEntity;
|
||||||
|
|
||||||
|
import com.cloud.deploy.DeployDestination;
|
||||||
|
import com.cloud.deploy.DeploymentPlanner.ExcludeList;
|
||||||
|
import com.cloud.vm.VirtualMachine;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* VirtualMachineEntity represents a Virtual Machine in Cloud Orchestration
|
||||||
|
* Platform.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public interface VirtualMachineEntity extends CloudEntity, VirtualMachine {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the list of tags associated with the virtual machine
|
||||||
|
*/
|
||||||
|
List<String> getTags();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Start the virtual machine with a given deploy destination
|
||||||
|
* @param dest destination to which to deploy the machine
|
||||||
|
* @param exclude list of areas to exclude
|
||||||
|
* @param plannerToUse the Deployment Planner that should be used
|
||||||
|
*/
|
||||||
|
void startIn(DeployDestination dest, ExcludeList exclude, String plannerToUse);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Migrate this VM to a certain destination.
|
||||||
|
*
|
||||||
|
* @param dest
|
||||||
|
* @param exclude
|
||||||
|
* @param plannerToUse
|
||||||
|
*/
|
||||||
|
void migrateTo(DeployDestination dest, ExcludeList exclude);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Stop the virtual machine
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
void stop();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Cleans up after any botched starts. CloudStack Orchestration Platform
|
||||||
|
* will attempt a best effort to actually shutdown any resource but
|
||||||
|
* even if it cannot, it releases the resource from its database.
|
||||||
|
*/
|
||||||
|
void cleanup();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Destroys the VM.
|
||||||
|
*/
|
||||||
|
void destroy();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Duplicate this VM in the database so that it will start new
|
||||||
|
* @param externalId
|
||||||
|
* @return a new VirtualMachineEntity
|
||||||
|
*/
|
||||||
|
VirtualMachineEntity duplicate(String externalId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Take a VM snapshot
|
||||||
|
*/
|
||||||
|
void takeSnapshotOf();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Attach volume to this VM
|
||||||
|
* @param volume volume to attach
|
||||||
|
* @param deviceId deviceId to use
|
||||||
|
*/
|
||||||
|
void attach(VolumeEntity volume, short deviceId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Detach the volume from this VM
|
||||||
|
* @param volume volume to detach
|
||||||
|
*/
|
||||||
|
void detach(VolumeEntity volume);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Connect the VM to a network
|
||||||
|
* @param network network to attach
|
||||||
|
* @param deviceId device id to use when a nic is created
|
||||||
|
*/
|
||||||
|
void connectTo(NetworkEntity network, short deviceId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Disconnect the VM from this network
|
||||||
|
* @param netowrk network to disconnect from
|
||||||
|
*/
|
||||||
|
void disconnectFrom(NetworkEntity netowrk);
|
||||||
|
}
|
||||||
@ -0,0 +1,34 @@
|
|||||||
|
/*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
* distributed with this work for additional information
|
||||||
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
|
* to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
package org.apache.cloudstack.platform.cloud.entity.api;
|
||||||
|
|
||||||
|
import org.apache.cloudstack.platform.entity.api.CloudEntity;
|
||||||
|
|
||||||
|
import com.cloud.storage.Volume;
|
||||||
|
|
||||||
|
public interface VolumeEntity extends CloudEntity, Volume {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Take a snapshot of the volume
|
||||||
|
*/
|
||||||
|
void takeSnapshotOf();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
90
platform/api/src/org/apache/cloudstack/platform/entity/api/CloudEntity.java
Executable file
90
platform/api/src/org/apache/cloudstack/platform/entity/api/CloudEntity.java
Executable file
@ -0,0 +1,90 @@
|
|||||||
|
/*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
* distributed with this work for additional information
|
||||||
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
|
* to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
package org.apache.cloudstack.platform.entity.api;
|
||||||
|
|
||||||
|
import java.lang.reflect.Method;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* All entities returned by the Cloud Orchestration Platform must implement
|
||||||
|
* this interface. CloudValueEntity is an immutable representation of
|
||||||
|
* an entity exposed by Cloud Orchestration Platform. For each object, it
|
||||||
|
* defines two ids: uuid, generated by CloudStack Orchestration Platform, and
|
||||||
|
* an external id that is set by the caller when the entity is created. All
|
||||||
|
* ids must be unique for that entity. CloudValueEntity also can be converted
|
||||||
|
* to a CloudActionableEntity which contains actions the object can perform.
|
||||||
|
*/
|
||||||
|
public interface CloudEntity {
|
||||||
|
/**
|
||||||
|
* @return the uuid of the object.
|
||||||
|
*/
|
||||||
|
String getUuid();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the id which is often the database id.
|
||||||
|
*/
|
||||||
|
long getId();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return external id set by the caller
|
||||||
|
*/
|
||||||
|
String getExternalId();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return current state for the entity
|
||||||
|
*/
|
||||||
|
String getCurrentState();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return desired state for the entity
|
||||||
|
*/
|
||||||
|
String getDesiredState();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the time the entity was created
|
||||||
|
*/
|
||||||
|
Date getCreatedTime();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the time the entity was last updated
|
||||||
|
*/
|
||||||
|
Date getLastUpdatedTime();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return reference to the owner of this entity
|
||||||
|
*/
|
||||||
|
String getOwner();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return details stored for this entity when created.
|
||||||
|
*/
|
||||||
|
Map<String, String> getDetails(String source);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return a list of sources that have added to the details.
|
||||||
|
*/
|
||||||
|
List<String> getDetailSources();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return list of actions that can be performed on the object in its current state
|
||||||
|
*/
|
||||||
|
List<Method> getApplicableActions();
|
||||||
|
}
|
||||||
@ -0,0 +1,24 @@
|
|||||||
|
/*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
* distributed with this work for additional information
|
||||||
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
|
* to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
package org.apache.cloudstack.platform.exception;
|
||||||
|
|
||||||
|
public class InsufficientCapacityException {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
5
platform/compute/.settings/org.eclipse.jdt.core.prefs
Executable file
5
platform/compute/.settings/org.eclipse.jdt.core.prefs
Executable file
@ -0,0 +1,5 @@
|
|||||||
|
eclipse.preferences.version=1
|
||||||
|
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
|
||||||
|
org.eclipse.jdt.core.compiler.compliance=1.5
|
||||||
|
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
||||||
|
org.eclipse.jdt.core.compiler.source=1.5
|
||||||
4
platform/compute/.settings/org.eclipse.m2e.core.prefs
Executable file
4
platform/compute/.settings/org.eclipse.m2e.core.prefs
Executable file
@ -0,0 +1,4 @@
|
|||||||
|
activeProfiles=
|
||||||
|
eclipse.preferences.version=1
|
||||||
|
resolveWorkspaceProjects=true
|
||||||
|
version=1
|
||||||
5
platform/storage/.settings/org.eclipse.jdt.core.prefs
Executable file
5
platform/storage/.settings/org.eclipse.jdt.core.prefs
Executable file
@ -0,0 +1,5 @@
|
|||||||
|
eclipse.preferences.version=1
|
||||||
|
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
|
||||||
|
org.eclipse.jdt.core.compiler.compliance=1.5
|
||||||
|
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
||||||
|
org.eclipse.jdt.core.compiler.source=1.5
|
||||||
4
platform/storage/.settings/org.eclipse.m2e.core.prefs
Executable file
4
platform/storage/.settings/org.eclipse.m2e.core.prefs
Executable file
@ -0,0 +1,4 @@
|
|||||||
|
activeProfiles=
|
||||||
|
eclipse.preferences.version=1
|
||||||
|
resolveWorkspaceProjects=true
|
||||||
|
version=1
|
||||||
@ -0,0 +1,2 @@
|
|||||||
|
eclipse.preferences.version=1
|
||||||
|
encoding/<project>=UTF-8
|
||||||
@ -0,0 +1,4 @@
|
|||||||
|
activeProfiles=
|
||||||
|
eclipse.preferences.version=1
|
||||||
|
resolveWorkspaceProjects=true
|
||||||
|
version=1
|
||||||
Loading…
x
Reference in New Issue
Block a user