diff --git a/platform/api/src/org/apache/cloudstack/platform/cloud/entity/api/NetworkEntity.java b/platform/api/src/org/apache/cloudstack/platform/cloud/entity/api/NetworkEntity.java index 3092905e4b9..ce7be7c0f77 100755 --- a/platform/api/src/org/apache/cloudstack/platform/cloud/entity/api/NetworkEntity.java +++ b/platform/api/src/org/apache/cloudstack/platform/cloud/entity/api/NetworkEntity.java @@ -20,5 +20,7 @@ package org.apache.cloudstack.platform.cloud.entity.api; import org.apache.cloudstack.platform.entity.api.CloudEntity; -public interface NetworkEntity extends CloudEntity { +import com.cloud.network.Network; + +public interface NetworkEntity extends CloudEntity, Network { } diff --git a/platform/api/src/org/apache/cloudstack/platform/cloud/entity/api/SnapshotEntity.java b/platform/api/src/org/apache/cloudstack/platform/cloud/entity/api/SnapshotEntity.java index 13bc7276ccf..bb80f914fe2 100755 --- a/platform/api/src/org/apache/cloudstack/platform/cloud/entity/api/SnapshotEntity.java +++ b/platform/api/src/org/apache/cloudstack/platform/cloud/entity/api/SnapshotEntity.java @@ -23,5 +23,27 @@ import org.apache.cloudstack.platform.entity.api.CloudEntity; import com.cloud.storage.Snapshot; public interface SnapshotEntity extends CloudEntity, Snapshot { + /** + * Make a reservation for backing up this snapshot + * @param expiration time in seconds to expire the reservation + * @return reservation token + */ + String reserveForBackup(int expiration); + /** + * Perform the backup according to the reservation token + * @param reservationToken token returned by reserveForBackup + */ + void backup(String reservationToken); + + /** + * restore this snapshot to this vm. + * @param vm + */ + void restore(String vm); + + /** + * Destroy this snapshot. + */ + void destroy(); } diff --git a/platform/api/src/org/apache/cloudstack/platform/cloud/entity/api/VolumeEntity.java b/platform/api/src/org/apache/cloudstack/platform/cloud/entity/api/VolumeEntity.java index 4ba204c227f..99e4c823d83 100755 --- a/platform/api/src/org/apache/cloudstack/platform/cloud/entity/api/VolumeEntity.java +++ b/platform/api/src/org/apache/cloudstack/platform/cloud/entity/api/VolumeEntity.java @@ -27,8 +27,48 @@ public interface VolumeEntity extends CloudEntity, Volume { /** * Take a snapshot of the volume */ - void takeSnapshotOf(); + SnapshotEntity takeSnapshotOf(boolean full); + /** + * Make a reservation to do storage migration + * + * @param expirationTime time in seconds the reservation is cancelled + * @return reservation token + */ + String reserveForMigration(long expirationTime); + /** + * Migrate using a reservation. + * @param reservationToken reservation token + */ + void migrate(String reservationToken); + /** + * Setup for a copy of this volume. + * @return destination to copy to + */ + VolumeEntity setupForCopy(); + + /** + * Perform the copy + * @param dest copy to this volume + */ + void copy(VolumeEntity dest); + + /** + * Attach to the vm + * @param vm vm to attach to + * @param deviceId device id to use + */ + void attachTo(String vm, long deviceId); + + /** + * Detach from the vm + */ + void detachFrom(); + + /** + * Destroy the volume + */ + void destroy(); } diff --git a/platform/api/src/org/apache/cloudstack/platform/service/api/JobsManagementService.java b/platform/api/src/org/apache/cloudstack/platform/service/api/JobsManagementService.java deleted file mode 100755 index ed1c4c005ac..00000000000 --- a/platform/api/src/org/apache/cloudstack/platform/service/api/JobsManagementService.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * 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.service.api; - -import java.util.List; - -import com.cloud.async.AsyncJob; - -public interface JobsManagementService { - List listJobs(); - - List listJobsInProgress(); - - List listJobsCompleted(Long from); - - List listJobsInWaiting(); - - void cancelJob(String job); -} diff --git a/platform/api/src/org/apache/cloudstack/platform/service/api/OrchestrationService.java b/platform/api/src/org/apache/cloudstack/platform/service/api/OrchestrationService.java index 09edd9f2b83..13133e200cc 100755 --- a/platform/api/src/org/apache/cloudstack/platform/service/api/OrchestrationService.java +++ b/platform/api/src/org/apache/cloudstack/platform/service/api/OrchestrationService.java @@ -24,6 +24,7 @@ import java.util.Map; import com.cloud.exception.InsufficientCapacityException; import com.cloud.hypervisor.Hypervisor; +import com.cloud.utils.exception.CloudRuntimeException; import com.cloud.vm.VirtualMachine; public interface OrchestrationService { @@ -102,10 +103,6 @@ public interface OrchestrationService { void joinNetwork(String network1, String network2); - void attachNetwork(String network, String vm); - - void detachNetwork(String network, String vm); - void attachVolume(String vm, String vol); void createNetwork(); @@ -114,13 +111,5 @@ public interface OrchestrationService { void createVolume(); - void destroyVolume(); - - void snapshotVirtualMachine(String vm); - - void snapshotVolume(String volume); - - void backup(String snapshot); - void registerTemplate(String name, URL path, String os, Hypervisor hypervisor); }