more changes

This commit is contained in:
Alex Huang 2012-09-05 13:39:10 -07:00
parent e41cb9ff74
commit 2a4872eb88
5 changed files with 67 additions and 49 deletions

View File

@ -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 {
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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<AsyncJob> listJobs();
List<AsyncJob> listJobsInProgress();
List<AsyncJob> listJobsCompleted(Long from);
List<AsyncJob> listJobsInWaiting();
void cancelJob(String job);
}

View File

@ -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);
}