Return-Path: X-Original-To: apmail-cloudstack-commits-archive@www.apache.org Delivered-To: apmail-cloudstack-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C61E311252 for ; Mon, 13 May 2013 18:01:18 +0000 (UTC) Received: (qmail 49751 invoked by uid 500); 13 May 2013 18:00:59 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 49518 invoked by uid 500); 13 May 2013 18:00:58 -0000 Mailing-List: contact commits-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list commits@cloudstack.apache.org Received: (qmail 46655 invoked by uid 99); 13 May 2013 18:00:54 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 May 2013 18:00:54 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 8AC6688F984; Mon, 13 May 2013 18:00:54 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: bfederle@apache.org To: commits@cloudstack.apache.org Date: Mon, 13 May 2013 18:01:35 -0000 Message-Id: In-Reply-To: <4d0ae21910454ef5994690ed7feb08ab@git.apache.org> References: <4d0ae21910454ef5994690ed7feb08ab@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [44/96] [abbrv] [partial] merge master http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/src/com/cloud/agent/api/storage/PrepareOVAPackingAnswer.java ---------------------------------------------------------------------- diff --git a/api/src/com/cloud/agent/api/storage/PrepareOVAPackingAnswer.java b/api/src/com/cloud/agent/api/storage/PrepareOVAPackingAnswer.java new file mode 100755 index 0000000..923d952 --- /dev/null +++ b/api/src/com/cloud/agent/api/storage/PrepareOVAPackingAnswer.java @@ -0,0 +1,26 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.agent.api.storage; + +import com.cloud.agent.api.Answer; + +public class PrepareOVAPackingAnswer extends Answer { + public PrepareOVAPackingAnswer(PrepareOVAPackingCommand cmd, boolean result, String details) { + super(cmd, result, details); + } + +} http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/src/com/cloud/agent/api/storage/PrepareOVAPackingCommand.java ---------------------------------------------------------------------- diff --git a/api/src/com/cloud/agent/api/storage/PrepareOVAPackingCommand.java b/api/src/com/cloud/agent/api/storage/PrepareOVAPackingCommand.java new file mode 100755 index 0000000..29fa26d --- /dev/null +++ b/api/src/com/cloud/agent/api/storage/PrepareOVAPackingCommand.java @@ -0,0 +1,48 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.agent.api.storage; + +import com.cloud.agent.api.Command; + +public class PrepareOVAPackingCommand extends Command { + private String templatePath; + private String secUrl; + + public PrepareOVAPackingCommand() { + } + + public PrepareOVAPackingCommand(String secUrl, String templatePath) { + this.secUrl = secUrl; + this.templatePath = templatePath; + } + + @Override + public boolean executeInSequence() { + return true; + } + + public String getTemplatePath() { + return this.templatePath; + } + + public String getSecondaryStorageUrl() { + return this.secUrl; + } + +} + + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/src/com/cloud/agent/api/storage/PrimaryStorageDownloadAnswer.java ---------------------------------------------------------------------- diff --git a/api/src/com/cloud/agent/api/storage/PrimaryStorageDownloadAnswer.java b/api/src/com/cloud/agent/api/storage/PrimaryStorageDownloadAnswer.java deleted file mode 100644 index a5a6c49..0000000 --- a/api/src/com/cloud/agent/api/storage/PrimaryStorageDownloadAnswer.java +++ /dev/null @@ -1,54 +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 com.cloud.agent.api.storage; - -import com.cloud.agent.api.Answer; - -public class PrimaryStorageDownloadAnswer extends Answer { - private String installPath; - private long templateSize = 0L; - - protected PrimaryStorageDownloadAnswer() { - } - - public PrimaryStorageDownloadAnswer(String detail) { - super(null, false, detail); - } - - public PrimaryStorageDownloadAnswer(String installPath, long templateSize ) { - super(null); - this.installPath = installPath; - this.templateSize = templateSize; - } - - public String getInstallPath() { - return installPath; - } - - public void setInstallPath(String installPath) { - this.installPath = installPath; - } - - public void setTemplateSize(long templateSize) { - this.templateSize = templateSize; - } - - public Long getTemplateSize() { - return templateSize; - } - -} http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/src/com/cloud/agent/api/storage/PrimaryStorageDownloadCommand.java ---------------------------------------------------------------------- diff --git a/api/src/com/cloud/agent/api/storage/PrimaryStorageDownloadCommand.java b/api/src/com/cloud/agent/api/storage/PrimaryStorageDownloadCommand.java deleted file mode 100644 index 8d955bb..0000000 --- a/api/src/com/cloud/agent/api/storage/PrimaryStorageDownloadCommand.java +++ /dev/null @@ -1,87 +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 com.cloud.agent.api.storage; - -import com.cloud.agent.api.to.StorageFilerTO; -import com.cloud.storage.Storage.ImageFormat; -import com.cloud.storage.StoragePool; - -/** - * - */ -public class PrimaryStorageDownloadCommand extends AbstractDownloadCommand { - String localPath; - String poolUuid; - long poolId; - - StorageFilerTO primaryPool; - - String secondaryStorageUrl; - String primaryStorageUrl; - - protected PrimaryStorageDownloadCommand() { - } - - public PrimaryStorageDownloadCommand(String name, String url, ImageFormat format, long accountId, StoragePool pool, int wait) { - super(name, url, format, accountId); - this.poolId = pool.getId(); - this.poolUuid = pool.getUuid(); - this.primaryPool = new StorageFilerTO(pool); - setWait(wait); - } - - public String getPoolUuid() { - return poolUuid; - } - - public long getPoolId() { - return poolId; - } - - public StorageFilerTO getPool() { - return primaryPool; - } - - public void setLocalPath(String path) { - this.localPath = path; - } - - public String getLocalPath() { - return localPath; - } - - public void setSecondaryStorageUrl(String url) { - secondaryStorageUrl = url; - } - - public String getSecondaryStorageUrl() { - return secondaryStorageUrl; - } - - public void setPrimaryStorageUrl(String url) { - primaryStorageUrl = url; - } - - public String getPrimaryStorageUrl() { - return primaryStorageUrl; - } - - @Override - public boolean executeInSequence() { - return true; - } -} http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/src/com/cloud/agent/api/storage/ResizeVolumeAnswer.java ---------------------------------------------------------------------- diff --git a/api/src/com/cloud/agent/api/storage/ResizeVolumeAnswer.java b/api/src/com/cloud/agent/api/storage/ResizeVolumeAnswer.java deleted file mode 100644 index 3434b98..0000000 --- a/api/src/com/cloud/agent/api/storage/ResizeVolumeAnswer.java +++ /dev/null @@ -1,40 +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 com.cloud.agent.api.storage; - -import com.cloud.agent.api.Answer; - -public class ResizeVolumeAnswer extends Answer { - private long newSize; - - protected ResizeVolumeAnswer() { - - } - - public ResizeVolumeAnswer(ResizeVolumeCommand cmd, boolean result, String details, long newSize) { - super(cmd, result, details); - this.newSize = newSize; - } - - public ResizeVolumeAnswer(ResizeVolumeCommand cmd, boolean result, String details) { - super(cmd, result, details); - } - - public long getNewSize() { - return newSize; - } -} http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/src/com/cloud/agent/api/storage/ResizeVolumeCommand.java ---------------------------------------------------------------------- diff --git a/api/src/com/cloud/agent/api/storage/ResizeVolumeCommand.java b/api/src/com/cloud/agent/api/storage/ResizeVolumeCommand.java deleted file mode 100644 index 82d3ae7..0000000 --- a/api/src/com/cloud/agent/api/storage/ResizeVolumeCommand.java +++ /dev/null @@ -1,85 +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 com.cloud.agent.api.storage; - -import com.cloud.agent.api.Command; -import com.cloud.agent.api.to.StorageFilerTO; - -public class ResizeVolumeCommand extends Command { - private String path; - private StorageFilerTO pool; - private String vmInstance; - private Long newSize; - private Long currentSize; - private boolean shrinkOk; - - protected ResizeVolumeCommand() { - - } - - public ResizeVolumeCommand(String path, - StorageFilerTO pool, - Long currentSize, - Long newSize, - boolean shrinkOk, - String vmInstance) - { - this.path = path; - this.pool = pool; - this.vmInstance = vmInstance; - this.currentSize = currentSize; - this.newSize = newSize; - this.shrinkOk = shrinkOk; - } - - public String getPath() { - return path; - } - - public String getPoolUuid() { - return pool.getUuid(); - } - - public StorageFilerTO getPool() { - return pool; - } - - public long getNewSize() { - return newSize; - } - - public long getCurrentSize() { - return currentSize; - } - - public boolean getShrinkOk() { - return shrinkOk; - } - - public String getInstanceName() { - return vmInstance; - } - - /** - * {@inheritDoc} - */ - @Override - public boolean executeInSequence() { - return false; - } - -} http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/src/com/cloud/agent/api/storage/StorageCommand.java ---------------------------------------------------------------------- diff --git a/api/src/com/cloud/agent/api/storage/StorageCommand.java b/api/src/com/cloud/agent/api/storage/StorageCommand.java deleted file mode 100644 index 270143b..0000000 --- a/api/src/com/cloud/agent/api/storage/StorageCommand.java +++ /dev/null @@ -1,26 +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 com.cloud.agent.api.storage; - -import com.cloud.agent.api.Command; - -public abstract class StorageCommand extends Command { - protected StorageCommand() { - super(); - } - -} http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/src/com/cloud/agent/api/storage/UpgradeDiskAnswer.java ---------------------------------------------------------------------- diff --git a/api/src/com/cloud/agent/api/storage/UpgradeDiskAnswer.java b/api/src/com/cloud/agent/api/storage/UpgradeDiskAnswer.java deleted file mode 100644 index 9660136..0000000 --- a/api/src/com/cloud/agent/api/storage/UpgradeDiskAnswer.java +++ /dev/null @@ -1,29 +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 com.cloud.agent.api.storage; - -import com.cloud.agent.api.Answer; -import com.cloud.agent.api.Command; - -public class UpgradeDiskAnswer extends Answer { - - public UpgradeDiskAnswer() {} - - public UpgradeDiskAnswer(Command cmd, boolean success, String details) { - super(cmd, success, details); - } -} http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/src/com/cloud/agent/api/storage/UpgradeDiskCommand.java ---------------------------------------------------------------------- diff --git a/api/src/com/cloud/agent/api/storage/UpgradeDiskCommand.java b/api/src/com/cloud/agent/api/storage/UpgradeDiskCommand.java deleted file mode 100644 index f8363e1..0000000 --- a/api/src/com/cloud/agent/api/storage/UpgradeDiskCommand.java +++ /dev/null @@ -1,50 +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 com.cloud.agent.api.storage; - - -public class UpgradeDiskCommand extends StorageCommand { - - private String _imagePath; - private String _newSize; - - public UpgradeDiskCommand() {} - - public UpgradeDiskCommand(String imagePath, String newSize) { - _imagePath = imagePath; - _newSize = newSize; - } - - public String getImagePath() { - return _imagePath; - } - public void setImagePath(String imagePath) { - _imagePath = imagePath; - } - - public String getNewSize() { - return _newSize; - } - public void setNewSize(String newSize) { - _newSize = newSize; - } - - @Override - public boolean executeInSequence() { - return true; - } -} http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/src/com/cloud/agent/api/storage/UploadAnswer.java ---------------------------------------------------------------------- diff --git a/api/src/com/cloud/agent/api/storage/UploadAnswer.java b/api/src/com/cloud/agent/api/storage/UploadAnswer.java deleted file mode 100755 index f2d9788..0000000 --- a/api/src/com/cloud/agent/api/storage/UploadAnswer.java +++ /dev/null @@ -1,123 +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 com.cloud.agent.api.storage; - -import java.io.File; - -import com.cloud.agent.api.Answer; -import com.cloud.agent.api.Command; -import com.cloud.storage.Upload; - -public class UploadAnswer extends Answer { - - - private String jobId; - private int uploadPct; - private String errorString; - private Upload.Status uploadStatus; - private String uploadPath; - private String installPath; - public Long templateSize = 0L; - - public int getUploadPct() { - return uploadPct; - } - public String getErrorString() { - return errorString; - } - - public String getUploadStatusString() { - return uploadStatus.toString(); - } - - public Upload.Status getUploadStatus() { - return uploadStatus; - } - - public String getUploadPath() { - return uploadPath; - } - protected UploadAnswer() { - - } - - public void setErrorString(String errorString) { - this.errorString = errorString; - } - public String getJobId() { - return jobId; - } - public void setJobId(String jobId) { - this.jobId = jobId; - } - - public UploadAnswer(String jobId, int uploadPct, String errorString, - Upload.Status uploadStatus, String fileSystemPath, String installPath, long templateSize) { - super(); - this.jobId = jobId; - this.uploadPct = uploadPct; - this.errorString = errorString; - this.details = errorString; - this.uploadStatus = uploadStatus; - this.uploadPath = fileSystemPath; - this.installPath = fixPath(installPath); - this.templateSize = templateSize; - } - - public UploadAnswer(String jobId, int uploadPct, Command command, - Upload.Status uploadStatus, String fileSystemPath, String installPath) { - super(command); - this.jobId = jobId; - this.uploadPct = uploadPct; - this.uploadStatus = uploadStatus; - this.uploadPath = fileSystemPath; - this.installPath = installPath; - } - - private static String fixPath(String path){ - if (path == null) { - return path; - } - if (path.startsWith(File.separator)) { - path=path.substring(File.separator.length()); - } - if (path.endsWith(File.separator)) { - path=path.substring(0, path.length()-File.separator.length()); - } - return path; - } - - public void setUploadStatus(Upload.Status uploadStatus) { - this.uploadStatus = uploadStatus; - } - - public String getInstallPath() { - return installPath; - } - public void setInstallPath(String installPath) { - this.installPath = fixPath(installPath); - } - - public void setTemplateSize(long templateSize) { - this.templateSize = templateSize; - } - - public Long getTemplateSize() { - return templateSize; - } - -} http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/src/com/cloud/agent/api/storage/UploadCommand.java ---------------------------------------------------------------------- diff --git a/api/src/com/cloud/agent/api/storage/UploadCommand.java b/api/src/com/cloud/agent/api/storage/UploadCommand.java deleted file mode 100644 index 473bd5b..0000000 --- a/api/src/com/cloud/agent/api/storage/UploadCommand.java +++ /dev/null @@ -1,145 +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 com.cloud.agent.api.storage; - -import org.apache.cloudstack.api.InternalIdentity; - -import com.cloud.agent.api.storage.DownloadCommand.PasswordAuth; -import com.cloud.agent.api.to.TemplateTO; -import com.cloud.storage.Upload.Type; -import com.cloud.template.VirtualMachineTemplate; - - -public class UploadCommand extends AbstractUploadCommand implements InternalIdentity { - - private TemplateTO template; - private String url; - private String installPath; - private boolean hvm; - private String description; - private String checksum; - private PasswordAuth auth; - private long templateSizeInBytes; - private long id; - private Type type; - - public UploadCommand(VirtualMachineTemplate template, String url, String installPath, long sizeInBytes) { - - this.template = new TemplateTO(template); - this.url = url; - this.installPath = installPath; - this.checksum = template.getChecksum(); - this.id = template.getId(); - this.templateSizeInBytes = sizeInBytes; - - } - - public UploadCommand(String url, long id, long sizeInBytes, String installPath, Type type){ - this.template = null; - this.url = url; - this.installPath = installPath; - this.id = id; - this.type = type; - this.templateSizeInBytes = sizeInBytes; - } - - protected UploadCommand() { - } - - public UploadCommand(UploadCommand that) { - this.template = that.template; - this.url = that.url; - this.installPath = that.installPath; - this.checksum = that.getChecksum(); - this.id = that.id; - } - - public String getDescription() { - return description; - } - - - public TemplateTO getTemplate() { - return template; - } - - public void setTemplate(TemplateTO template) { - this.template = template; - } - - @Override - public String getUrl() { - return url; - } - - @Override - public void setUrl(String url) { - this.url = url; - } - - public boolean isHvm() { - return hvm; - } - - public void setHvm(boolean hvm) { - this.hvm = hvm; - } - - public PasswordAuth getAuth() { - return auth; - } - - public void setAuth(PasswordAuth auth) { - this.auth = auth; - } - - public Long getTemplateSizeInBytes() { - return templateSizeInBytes; - } - - public void setTemplateSizeInBytes(Long templateSizeInBytes) { - this.templateSizeInBytes = templateSizeInBytes; - } - - public long getId() { - return id; - } - - public void setId(long id) { - this.id = id; - } - - public void setInstallPath(String installPath) { - this.installPath = installPath; - } - - public void setDescription(String description) { - this.description = description; - } - - public void setChecksum(String checksum) { - this.checksum = checksum; - } - - public String getInstallPath() { - return installPath; - } - - public String getChecksum() { - return checksum; - } -} http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/src/com/cloud/agent/api/storage/UploadProgressCommand.java ---------------------------------------------------------------------- diff --git a/api/src/com/cloud/agent/api/storage/UploadProgressCommand.java b/api/src/com/cloud/agent/api/storage/UploadProgressCommand.java deleted file mode 100644 index 7f6d584..0000000 --- a/api/src/com/cloud/agent/api/storage/UploadProgressCommand.java +++ /dev/null @@ -1,48 +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 com.cloud.agent.api.storage; - -public class UploadProgressCommand extends UploadCommand { - - public static enum RequestType {GET_STATUS, ABORT, RESTART, PURGE, GET_OR_RESTART} - private String jobId; - private RequestType request; - - protected UploadProgressCommand() { - super(); - } - - public UploadProgressCommand(UploadCommand cmd, String jobId, RequestType req) { - super(cmd); - - this.jobId = jobId; - this.setRequest(req); - } - - public String getJobId() { - return jobId; - } - - public void setRequest(RequestType request) { - this.request = request; - } - - public RequestType getRequest() { - return request; - } - -} http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/src/com/cloud/agent/api/storage/ssCommand.java ---------------------------------------------------------------------- diff --git a/api/src/com/cloud/agent/api/storage/ssCommand.java b/api/src/com/cloud/agent/api/storage/ssCommand.java deleted file mode 100644 index c218a8d..0000000 --- a/api/src/com/cloud/agent/api/storage/ssCommand.java +++ /dev/null @@ -1,48 +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 com.cloud.agent.api.storage; - -import com.cloud.agent.api.Command; - -public abstract class ssCommand extends Command { - private String secUrl; - - - public ssCommand() { - } - - protected ssCommand(ssCommand that) { - this.secUrl = that.secUrl; - } - public ssCommand(String secUrl) { - this.secUrl = secUrl; - } - - @Override - public boolean executeInSequence() { - return true; - } - - public String getSecUrl() { - return secUrl; - } - - public void setSecUrl(String secUrl) { - this.secUrl = secUrl; - } - -} http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/src/com/cloud/agent/api/uploadTemplateToSwiftFromSecondaryStorageCommand.java ---------------------------------------------------------------------- diff --git a/api/src/com/cloud/agent/api/uploadTemplateToSwiftFromSecondaryStorageCommand.java b/api/src/com/cloud/agent/api/uploadTemplateToSwiftFromSecondaryStorageCommand.java deleted file mode 100644 index 10001b1..0000000 --- a/api/src/com/cloud/agent/api/uploadTemplateToSwiftFromSecondaryStorageCommand.java +++ /dev/null @@ -1,80 +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 com.cloud.agent.api; - -import com.cloud.agent.api.LogLevel.Log4jLevel; -import com.cloud.agent.api.to.SwiftTO; - -/** - * - * - */ - -public class uploadTemplateToSwiftFromSecondaryStorageCommand extends Command { - @LogLevel(Log4jLevel.Off) - private SwiftTO swift; - private String secondaryStorageUrl; - - private Long dcId; - private Long accountId; - private Long templateId; - - protected uploadTemplateToSwiftFromSecondaryStorageCommand() { - - } - - public uploadTemplateToSwiftFromSecondaryStorageCommand(SwiftTO swift, String secondaryStorageUrl, Long dcId, Long accountId, Long templateId, int wait) { - - this.swift = swift; - this.secondaryStorageUrl = secondaryStorageUrl; - this.dcId = dcId; - this.accountId = accountId; - this.templateId = templateId; - setWait(wait); - } - - public SwiftTO getSwift() { - return this.swift; - } - - public void setSwift(SwiftTO swift) { - this.swift = swift; - } - - public String getSecondaryStorageUrl() { - return secondaryStorageUrl; - } - - public Long getDcId() { - return dcId; - } - - public Long getAccountId() { - return accountId; - } - - public Long getTemplateId() { - return templateId; - } - - @Override - public boolean executeInSequence() { - // TODO Auto-generated method stub - return true; - } - -} http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/src/com/cloud/alert/AlertAdapter.java ---------------------------------------------------------------------- diff --git a/api/src/com/cloud/alert/AlertAdapter.java b/api/src/com/cloud/alert/AlertAdapter.java new file mode 100644 index 0000000..c04776a --- /dev/null +++ b/api/src/com/cloud/alert/AlertAdapter.java @@ -0,0 +1,22 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.alert; + +import com.cloud.utils.component.Adapter; + +public interface AlertAdapter extends Adapter { +} http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/src/com/cloud/async/AsyncJob.java ---------------------------------------------------------------------- diff --git a/api/src/com/cloud/async/AsyncJob.java b/api/src/com/cloud/async/AsyncJob.java index 866429b..ccdc406 100644 --- a/api/src/com/cloud/async/AsyncJob.java +++ b/api/src/com/cloud/async/AsyncJob.java @@ -50,7 +50,10 @@ public interface AsyncJob extends Identity, InternalIdentity { AutoScaleVmProfile, AutoScaleVmGroup, GlobalLoadBalancerRule, - AffinityGroup + LoadBalancerRule, + AffinityGroup, + InternalLbVm, + DedicatedGuestVlanRange } long getUserId(); http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/src/com/cloud/configuration/ConfigurationService.java ---------------------------------------------------------------------- diff --git a/api/src/com/cloud/configuration/ConfigurationService.java b/api/src/com/cloud/configuration/ConfigurationService.java index 6937d0b..fdbd9d6 100644 --- a/api/src/com/cloud/configuration/ConfigurationService.java +++ b/api/src/com/cloud/configuration/ConfigurationService.java @@ -20,6 +20,11 @@ import java.util.List; import javax.naming.NamingException; +import com.cloud.exception.InvalidParameterValueException; +import com.cloud.exception.InsufficientCapacityException; +import com.cloud.exception.ConcurrentOperationException; +import com.cloud.exception.ResourceUnavailableException; +import com.cloud.exception.ResourceAllocationException; import org.apache.cloudstack.api.command.admin.config.UpdateCfgCmd; import org.apache.cloudstack.api.command.admin.ldap.LDAPConfigCmd; import org.apache.cloudstack.api.command.admin.ldap.LDAPRemoveCmd; @@ -46,10 +51,6 @@ import org.apache.cloudstack.api.command.user.network.ListNetworkOfferingsCmd; import com.cloud.dc.DataCenter; import com.cloud.dc.Pod; import com.cloud.dc.Vlan; -import com.cloud.exception.ConcurrentOperationException; -import com.cloud.exception.InsufficientCapacityException; -import com.cloud.exception.ResourceAllocationException; -import com.cloud.exception.ResourceUnavailableException; import com.cloud.network.Networks.TrafficType; import com.cloud.offering.DiskOffering; import com.cloud.offering.NetworkOffering; @@ -65,7 +66,7 @@ public interface ConfigurationService { * - the command wrapping name and value parameters * @return updated configuration object if successful */ - Configuration updateConfiguration(UpdateCfgCmd cmd); + Configuration updateConfiguration(UpdateCfgCmd cmd) throws InvalidParameterValueException; /** * Create a service offering through the API @@ -250,7 +251,7 @@ public interface ConfigurationService { NetworkOffering getNetworkOffering(long id); - Integer getNetworkOfferingNetworkRate(long networkOfferingId); + Integer getNetworkOfferingNetworkRate(long networkOfferingId, Long dataCenterId); Account getVlanAccount(long vlanId); @@ -262,7 +263,7 @@ public interface ConfigurationService { Long getDefaultPageSize(); - Integer getServiceOfferingNetworkRate(long serviceOfferingId); + Integer getServiceOfferingNetworkRate(long serviceOfferingId, Long dataCenterId); DiskOffering getDiskOffering(long diskOfferingId); http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/src/com/cloud/event/EventTypes.java ---------------------------------------------------------------------- diff --git a/api/src/com/cloud/event/EventTypes.java b/api/src/com/cloud/event/EventTypes.java index e7781fa..17a7f62 100755 --- a/api/src/com/cloud/event/EventTypes.java +++ b/api/src/com/cloud/event/EventTypes.java @@ -16,6 +16,9 @@ // under the License. package com.cloud.event; +import java.util.HashMap; +import java.util.Map; + import com.cloud.configuration.Configuration; import com.cloud.dc.DataCenter; import com.cloud.dc.Pod; @@ -23,8 +26,18 @@ import com.cloud.dc.StorageNetworkIpRange; import com.cloud.dc.Vlan; import com.cloud.domain.Domain; import com.cloud.host.Host; -import com.cloud.network.*; -import com.cloud.network.as.*; +import com.cloud.network.GuestVlan; +import com.cloud.network.Network; +import com.cloud.network.PhysicalNetwork; +import com.cloud.network.PhysicalNetworkServiceProvider; +import com.cloud.network.PhysicalNetworkTrafficType; +import com.cloud.network.PublicIpAddress; +import com.cloud.network.RemoteAccessVpn; +import com.cloud.network.as.AutoScaleCounter; +import com.cloud.network.as.AutoScalePolicy; +import com.cloud.network.as.AutoScaleVmGroup; +import com.cloud.network.as.AutoScaleVmProfile; +import com.cloud.network.as.Condition; import com.cloud.network.router.VirtualRouter; import com.cloud.network.rules.LoadBalancer; import com.cloud.network.rules.StaticNat; @@ -43,9 +56,6 @@ import com.cloud.user.Account; import com.cloud.user.User; import com.cloud.vm.VirtualMachine; -import java.util.HashMap; -import java.util.Map; - public class EventTypes { //map of Event and corresponding entity for which Event is applicable @@ -400,6 +410,14 @@ public class EventTypes { public static final String EVENT_AFFINITY_GROUP_ASSIGN = "AG.ASSIGN"; public static final String EVENT_AFFINITY_GROUP_REMOVE = "AG.REMOVE"; public static final String EVENT_VM_AFFINITY_GROUP_UPDATE = "VM.AG.UPDATE"; + + public static final String EVENT_INTERNAL_LB_VM_START = "INTERNALLBVM.START"; + public static final String EVENT_INTERNAL_LB_VM_STOP = "INTERNALLBVM.STOP"; + + // Dedicated guest vlan range + public static final String EVENT_GUEST_VLAN_RANGE_DEDICATE = "GUESTVLANRANGE.DEDICATE"; + public static final String EVENT_DEDICATED_GUEST_VLAN_RANGE_RELEASE = "GUESTVLANRANGE.RELEASE"; + static { @@ -701,6 +719,9 @@ public class EventTypes { entityEventDetails.put(EVENT_AUTOSCALEVMGROUP_UPDATE, AutoScaleVmGroup.class.getName()); entityEventDetails.put(EVENT_AUTOSCALEVMGROUP_ENABLE, AutoScaleVmGroup.class.getName()); entityEventDetails.put(EVENT_AUTOSCALEVMGROUP_DISABLE, AutoScaleVmGroup.class.getName()); + + entityEventDetails.put(EVENT_GUEST_VLAN_RANGE_DEDICATE, GuestVlan.class.getName()); + entityEventDetails.put(EVENT_DEDICATED_GUEST_VLAN_RANGE_RELEASE, GuestVlan.class.getName()); } public static String getEntityForEvent (String eventName) { http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/src/com/cloud/event/UsageEvent.java ---------------------------------------------------------------------- diff --git a/api/src/com/cloud/event/UsageEvent.java b/api/src/com/cloud/event/UsageEvent.java new file mode 100644 index 0000000..0d4ef17 --- /dev/null +++ b/api/src/com/cloud/event/UsageEvent.java @@ -0,0 +1,33 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.event; + +import org.apache.cloudstack.api.InternalIdentity; + +import java.util.Date; + +public interface UsageEvent extends InternalIdentity { + String getType(); + + Date getCreateDate(); + long getAccountId(); + Long getSize(); + Long getTemplateId(); + Long getOfferingId(); + long getResourceId(); + long getZoneId(); +} http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/src/com/cloud/exception/AgentControlChannelException.java ---------------------------------------------------------------------- diff --git a/api/src/com/cloud/exception/AgentControlChannelException.java b/api/src/com/cloud/exception/AgentControlChannelException.java new file mode 100644 index 0000000..50b84d4 --- /dev/null +++ b/api/src/com/cloud/exception/AgentControlChannelException.java @@ -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 com.cloud.exception; + +import com.cloud.exception.CloudException; + +public class AgentControlChannelException extends CloudException { + private static final long serialVersionUID = -310647782960500466L; + + public AgentControlChannelException(String msg) { + super(msg); + } +} http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/src/com/cloud/info/ConsoleProxyLoadInfo.java ---------------------------------------------------------------------- diff --git a/api/src/com/cloud/info/ConsoleProxyLoadInfo.java b/api/src/com/cloud/info/ConsoleProxyLoadInfo.java new file mode 100644 index 0000000..a3ec3e3 --- /dev/null +++ b/api/src/com/cloud/info/ConsoleProxyLoadInfo.java @@ -0,0 +1,48 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.info; + +public class ConsoleProxyLoadInfo { + + private long id; + private String name; + private int count; + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public int getCount() { + return count; + } + + public void setCount(int count) { + this.count = count; + } +} http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/src/com/cloud/info/RunningHostCountInfo.java ---------------------------------------------------------------------- diff --git a/api/src/com/cloud/info/RunningHostCountInfo.java b/api/src/com/cloud/info/RunningHostCountInfo.java new file mode 100644 index 0000000..f77a4dc --- /dev/null +++ b/api/src/com/cloud/info/RunningHostCountInfo.java @@ -0,0 +1,48 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.info; + +public class RunningHostCountInfo { + + private long dcId; + private String hostType; + private int count; + + public long getDcId() { + return dcId; + } + + public void setDcId(long dcId) { + this.dcId = dcId; + } + + public String getHostType() { + return hostType; + } + + public void setHostType(String hostType) { + this.hostType = hostType; + } + + public int getCount() { + return count; + } + + public void setCount(int count) { + this.count = count; + } +} http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/src/com/cloud/network/GuestVlan.java ---------------------------------------------------------------------- diff --git a/api/src/com/cloud/network/GuestVlan.java b/api/src/com/cloud/network/GuestVlan.java new file mode 100644 index 0000000..a5173d8 --- /dev/null +++ b/api/src/com/cloud/network/GuestVlan.java @@ -0,0 +1,31 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.network; + +import org.apache.cloudstack.api.Identity; +import org.apache.cloudstack.api.InternalIdentity; + +public interface GuestVlan extends InternalIdentity, Identity { + + public long getId(); + + public long getAccountId(); + + public String getGuestVlanRange(); + + public long getPhysicalNetworkId(); +} http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/src/com/cloud/network/IpAddress.java ---------------------------------------------------------------------- diff --git a/api/src/com/cloud/network/IpAddress.java b/api/src/com/cloud/network/IpAddress.java index 71c9b4e..c48e8b9 100644 --- a/api/src/com/cloud/network/IpAddress.java +++ b/api/src/com/cloud/network/IpAddress.java @@ -81,4 +81,7 @@ public interface IpAddress extends ControlledEntity, Identity, InternalIdentity Long getVpcId(); String getVmIp(); + + Long getNetworkId(); + } http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/src/com/cloud/network/Network.java ---------------------------------------------------------------------- diff --git a/api/src/com/cloud/network/Network.java b/api/src/com/cloud/network/Network.java index f1b6f87..100f69e 100644 --- a/api/src/com/cloud/network/Network.java +++ b/api/src/com/cloud/network/Network.java @@ -16,18 +16,19 @@ // under the License. package com.cloud.network; +import java.net.URI; +import java.util.ArrayList; +import java.util.List; + +import org.apache.cloudstack.acl.ControlledEntity; +import org.apache.cloudstack.api.Identity; +import org.apache.cloudstack.api.InternalIdentity; + import com.cloud.network.Networks.BroadcastDomainType; import com.cloud.network.Networks.Mode; import com.cloud.network.Networks.TrafficType; import com.cloud.utils.fsm.StateMachine2; import com.cloud.utils.fsm.StateObject; -import org.apache.cloudstack.acl.ControlledEntity; -import org.apache.cloudstack.api.Identity; -import org.apache.cloudstack.api.InternalIdentity; - -import java.net.URI; -import java.util.ArrayList; -import java.util.List; /** * owned by an account. @@ -50,7 +51,7 @@ public interface Network extends ControlledEntity, StateObject, I Capability.MultipleIps, Capability.TrafficStatistics, Capability.SupportedTrafficDirection, Capability.SupportedEgressProtocols); public static final Service Lb = new Service("Lb", Capability.SupportedLBAlgorithms, Capability.SupportedLBIsolation, Capability.SupportedProtocols, Capability.TrafficStatistics, Capability.LoadBalancingSupportedIps, - Capability.SupportedStickinessMethods, Capability.ElasticLb); + Capability.SupportedStickinessMethods, Capability.ElasticLb, Capability.LbSchemes); public static final Service UserData = new Service("UserData"); public static final Service SourceNat = new Service("SourceNat", Capability.SupportedSourceNatTypes, Capability.RedundantRouter); public static final Service StaticNat = new Service("StaticNat", Capability.ElasticIp); @@ -124,6 +125,7 @@ public interface Network extends ControlledEntity, StateObject, I public static final Provider None = new Provider("None", false); // NiciraNvp is not an "External" provider, otherwise we get in trouble with NetworkServiceImpl.providersConfiguredForExternalNetworking public static final Provider NiciraNvp = new Provider("NiciraNvp", false); + public static final Provider InternalLbVm = new Provider("InternalLbVm", false); public static final Provider CiscoVnmc = new Provider("CiscoVnmc", true); private String name; @@ -177,6 +179,7 @@ public interface Network extends ControlledEntity, StateObject, I public static final Capability SupportedTrafficDirection = new Capability("SupportedTrafficDirection"); public static final Capability SupportedEgressProtocols = new Capability("SupportedEgressProtocols"); public static final Capability HealthCheckPolicy = new Capability("HealthCheckPolicy"); + public static final Capability LbSchemes = new Capability("LbSchemes"); private String name; http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/src/com/cloud/network/NetworkModel.java ---------------------------------------------------------------------- diff --git a/api/src/com/cloud/network/NetworkModel.java b/api/src/com/cloud/network/NetworkModel.java index 4d7d714..f84a8b0 100644 --- a/api/src/com/cloud/network/NetworkModel.java +++ b/api/src/com/cloud/network/NetworkModel.java @@ -33,6 +33,7 @@ import com.cloud.network.Networks.TrafficType; import com.cloud.network.element.NetworkElement; import com.cloud.network.element.UserDataServiceProvider; import com.cloud.offering.NetworkOffering; +import com.cloud.offering.NetworkOffering.Detail; import com.cloud.user.Account; import com.cloud.vm.Nic; import com.cloud.vm.NicProfile; @@ -181,7 +182,7 @@ public interface NetworkModel { /** * @return */ - String getDefaultNetworkDomain(); + String getDefaultNetworkDomain(long zoneId); /** * @param ntwkOffId @@ -263,4 +264,12 @@ public interface NetworkModel { boolean isProviderEnabledInZone(long zoneId, String provider); Nic getPlaceholderNicForRouter(Network network, Long podId); + + IpAddress getPublicIpAddress(String ipAddress, long zoneId); + + List getUsedIpsInNetwork(Network network); + + Map getNtwkOffDetails(long offId); + + Networks.IsolationType[] listNetworkIsolationMethods(); } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/src/com/cloud/network/NetworkService.java ---------------------------------------------------------------------- diff --git a/api/src/com/cloud/network/NetworkService.java b/api/src/com/cloud/network/NetworkService.java index b832ccd..2b4982a 100755 --- a/api/src/com/cloud/network/NetworkService.java +++ b/api/src/com/cloud/network/NetworkService.java @@ -18,6 +18,8 @@ package com.cloud.network; import java.util.List; +import org.apache.cloudstack.api.command.admin.network.DedicateGuestVlanRangeCmd; +import org.apache.cloudstack.api.command.admin.network.ListDedicatedGuestVlanRangesCmd; import org.apache.cloudstack.api.command.admin.usage.ListTrafficTypeImplementorsCmd; import org.apache.cloudstack.api.command.user.network.*; import org.apache.cloudstack.api.command.user.vm.ListNicsCmd; @@ -27,6 +29,7 @@ import com.cloud.exception.InsufficientAddressCapacityException; import com.cloud.exception.InsufficientCapacityException; import com.cloud.exception.ResourceAllocationException; import com.cloud.exception.ResourceUnavailableException; +import com.cloud.network.GuestVlan; import com.cloud.network.Network.Service; import com.cloud.network.Networks.TrafficType; import com.cloud.user.Account; @@ -112,6 +115,12 @@ public interface NetworkService { boolean deletePhysicalNetworkTrafficType(Long id); + GuestVlan dedicateGuestVlanRange(DedicateGuestVlanRangeCmd cmd); + + Pair, Integer> listDedicatedGuestVlanRanges(ListDedicatedGuestVlanRangesCmd cmd); + + boolean releaseDedicatedGuestVlanRange(Long dedicatedGuestVlanRangeId); + Pair, Integer> listTrafficTypes(Long physicalNetworkId); @@ -136,6 +145,7 @@ public interface NetworkService { ResourceAllocationException, ResourceUnavailableException, ConcurrentOperationException; /** + * * @param networkName * @param displayText * @param physicalNetworkId @@ -146,17 +156,18 @@ public interface NetworkService { * @param netmask * @param networkOwnerId * @param vpcId TODO + * @param sourceNat * @return * @throws InsufficientCapacityException * @throws ConcurrentOperationException * @throws ResourceAllocationException */ Network createPrivateNetwork(String networkName, String displayText, long physicalNetworkId, String vlan, - String startIp, String endIP, String gateway, String netmask, long networkOwnerId, Long vpcId) + String startIp, String endIP, String gateway, String netmask, long networkOwnerId, Long vpcId, Boolean sourceNat) throws ResourceAllocationException, ConcurrentOperationException, InsufficientCapacityException; /* Requests an IP address for the guest nic */ - String allocateSecondaryGuestIP(Account account, long zoneId, Long nicId, + NicSecondaryIp allocateSecondaryGuestIP(Account account, long zoneId, Long nicId, Long networkId, String ipaddress) throws InsufficientAddressCapacityException; boolean releaseSecondaryIpFromNic(long ipAddressId); http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/src/com/cloud/network/UserIpv6Address.java ---------------------------------------------------------------------- diff --git a/api/src/com/cloud/network/UserIpv6Address.java b/api/src/com/cloud/network/UserIpv6Address.java new file mode 100644 index 0000000..4c33d45 --- /dev/null +++ b/api/src/com/cloud/network/UserIpv6Address.java @@ -0,0 +1,52 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.network; + +import org.apache.cloudstack.acl.ControlledEntity; +import org.apache.cloudstack.api.Identity; +import org.apache.cloudstack.api.InternalIdentity; + +/** + * @author Sheng Yang + * + */ +public interface UserIpv6Address extends ControlledEntity, Identity, InternalIdentity { + enum State { + Allocating, // The IP Address is being propagated to other network elements and is not ready for use yet. + Allocated, // The IP address is in used. + Releasing, // The IP address is being released for other network elements and is not ready for allocation. + Free // The IP address is ready to be allocated. + } + + long getDataCenterId(); + + String getAddress(); + + long getVlanId(); + + State getState(); + + Long getNetworkId(); + + Long getSourceNetworkId(); + + Long getPhysicalNetworkId(); + + void setState(UserIpv6Address.State state); + + String getMacAddress(); +} http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/src/com/cloud/network/VirtualNetworkApplianceService.java ---------------------------------------------------------------------- diff --git a/api/src/com/cloud/network/VirtualNetworkApplianceService.java b/api/src/com/cloud/network/VirtualNetworkApplianceService.java index 250ecb2..58eead2 100644 --- a/api/src/com/cloud/network/VirtualNetworkApplianceService.java +++ b/api/src/com/cloud/network/VirtualNetworkApplianceService.java @@ -63,5 +63,7 @@ public interface VirtualNetworkApplianceService { VirtualRouter startRouter(long id) throws ResourceUnavailableException, InsufficientCapacityException, ConcurrentOperationException; VirtualRouter destroyRouter(long routerId, Account caller, Long callerUserId) throws ResourceUnavailableException, ConcurrentOperationException; + + VirtualRouter findRouter(long routerId); } http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/src/com/cloud/network/VirtualRouterProvider.java ---------------------------------------------------------------------- diff --git a/api/src/com/cloud/network/VirtualRouterProvider.java b/api/src/com/cloud/network/VirtualRouterProvider.java index ed6a274..f67686e 100644 --- a/api/src/com/cloud/network/VirtualRouterProvider.java +++ b/api/src/com/cloud/network/VirtualRouterProvider.java @@ -23,7 +23,8 @@ public interface VirtualRouterProvider extends InternalIdentity, Identity { public enum VirtualRouterProviderType { VirtualRouter, ElasticLoadBalancerVm, - VPCVirtualRouter + VPCVirtualRouter, + InternalLbVm } public VirtualRouterProviderType getType(); http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/src/com/cloud/network/lb/LoadBalancingRule.java ---------------------------------------------------------------------- diff --git a/api/src/com/cloud/network/lb/LoadBalancingRule.java b/api/src/com/cloud/network/lb/LoadBalancingRule.java index 3e11e8c..4b37782 100644 --- a/api/src/com/cloud/network/lb/LoadBalancingRule.java +++ b/api/src/com/cloud/network/lb/LoadBalancingRule.java @@ -25,111 +25,83 @@ import com.cloud.network.as.Condition; import com.cloud.network.as.Counter; import com.cloud.network.rules.FirewallRule; import com.cloud.network.rules.LoadBalancer; +import com.cloud.network.rules.LoadBalancerContainer.Scheme; import com.cloud.utils.Pair; +import com.cloud.utils.net.Ip; -public class LoadBalancingRule implements FirewallRule, LoadBalancer { +public class LoadBalancingRule { private LoadBalancer lb; + private Ip sourceIp; private List destinations; private List stickinessPolicies; private LbAutoScaleVmGroup autoScaleVmGroup; private List healthCheckPolicies; public LoadBalancingRule(LoadBalancer lb, List destinations, - List stickinessPolicies, List healthCheckPolicies) { + List stickinessPolicies, List healthCheckPolicies, Ip sourceIp) { this.lb = lb; this.destinations = destinations; this.stickinessPolicies = stickinessPolicies; this.healthCheckPolicies = healthCheckPolicies; + this.sourceIp = sourceIp; } - @Override public long getId() { return lb.getId(); } - @Override - public long getAccountId() { - return lb.getAccountId(); - } - - @Override - public long getDomainId() { - return lb.getDomainId(); - } - - @Override public String getName() { return lb.getName(); } - @Override public String getDescription() { return lb.getDescription(); } - @Override public int getDefaultPortStart() { return lb.getDefaultPortStart(); } - @Override public int getDefaultPortEnd() { return lb.getDefaultPortEnd(); } - @Override public String getAlgorithm() { return lb.getAlgorithm(); } - @Override public String getUuid() { return lb.getUuid(); } - @Override public String getXid() { return lb.getXid(); } - @Override - public Long getSourceIpAddressId() { - return lb.getSourceIpAddressId(); - } - - @Override public Integer getSourcePortStart() { return lb.getSourcePortStart(); } - @Override public Integer getSourcePortEnd() { return lb.getSourcePortEnd(); } - @Override public String getProtocol() { return lb.getProtocol(); } - @Override - public Purpose getPurpose() { - return Purpose.LoadBalancing; + public FirewallRule.Purpose getPurpose() { + return FirewallRule.Purpose.LoadBalancing; } - @Override - public State getState() { + public FirewallRule.State getState() { return lb.getState(); } - @Override public long getNetworkId() { return lb.getNetworkId(); } - public LoadBalancer getLb() { - return lb; - } public void setDestinations(List destinations) { this.destinations = destinations; @@ -287,36 +259,6 @@ public class LoadBalancingRule implements FirewallRule, LoadBalancer { } } - @Override - public Integer getIcmpCode() { - return null; - } - - @Override - public Integer getIcmpType() { - return null; - } - - @Override - public List getSourceCidrList() { - return null; - } - - @Override - public Long getRelated() { - return null; - } - - @Override - public TrafficType getTrafficType() { - return null; - } - - @Override - public FirewallRuleType getType() { - return FirewallRuleType.User; - } - public LbAutoScaleVmGroup getAutoScaleVmGroup() { return autoScaleVmGroup; } @@ -473,4 +415,11 @@ public class LoadBalancingRule implements FirewallRule, LoadBalancer { } } + public Ip getSourceIp() { + return sourceIp; + } + + public Scheme getScheme() { + return lb.getScheme(); + } } http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/src/com/cloud/network/lb/LoadBalancingRulesService.java ---------------------------------------------------------------------- diff --git a/api/src/com/cloud/network/lb/LoadBalancingRulesService.java b/api/src/com/cloud/network/lb/LoadBalancingRulesService.java index ed39bed..5fc41e3 100644 --- a/api/src/com/cloud/network/lb/LoadBalancingRulesService.java +++ b/api/src/com/cloud/network/lb/LoadBalancingRulesService.java @@ -17,10 +17,10 @@ package com.cloud.network.lb; import java.util.List; +import java.util.Map; import org.apache.cloudstack.api.command.user.loadbalancer.CreateLBHealthCheckPolicyCmd; import org.apache.cloudstack.api.command.user.loadbalancer.CreateLBStickinessPolicyCmd; -import org.apache.cloudstack.api.command.user.loadbalancer.CreateLoadBalancerRuleCmd; import org.apache.cloudstack.api.command.user.loadbalancer.ListLBHealthCheckPoliciesCmd; import org.apache.cloudstack.api.command.user.loadbalancer.ListLBStickinessPoliciesCmd; import org.apache.cloudstack.api.command.user.loadbalancer.ListLoadBalancerRuleInstancesCmd; @@ -30,12 +30,13 @@ import org.apache.cloudstack.api.command.user.loadbalancer.UpdateLoadBalancerRul import com.cloud.exception.InsufficientAddressCapacityException; import com.cloud.exception.NetworkRuleConflictException; import com.cloud.exception.ResourceUnavailableException; -import com.cloud.network.lb.LoadBalancingRule.LbStickinessPolicy; import com.cloud.network.rules.HealthCheckPolicy; import com.cloud.network.rules.LoadBalancer; +import com.cloud.network.rules.LoadBalancerContainer.Scheme; import com.cloud.network.rules.StickinessPolicy; import com.cloud.uservm.UserVm; import com.cloud.utils.Pair; +import com.cloud.utils.net.Ip; public interface LoadBalancingRulesService { @@ -49,7 +50,9 @@ public interface LoadBalancingRulesService { * @return the newly created LoadBalancerVO if successful, null otherwise * @throws InsufficientAddressCapacityException */ - LoadBalancer createLoadBalancerRule(CreateLoadBalancerRuleCmd lb, boolean openFirewall) throws NetworkRuleConflictException, InsufficientAddressCapacityException; + LoadBalancer createPublicLoadBalancerRule(String xId, String name, String description, + int srcPortStart, int srcPortEnd, int defPortStart, int defPortEnd, Long ipAddrId, String protocol, String algorithm, + long networkId, long lbOwnerId, boolean openFirewall) throws NetworkRuleConflictException, InsufficientAddressCapacityException; LoadBalancer updateLoadBalancerRule(UpdateLoadBalancerRuleCmd cmd); @@ -134,8 +137,9 @@ public interface LoadBalancingRulesService { List searchForLBHealthCheckPolicies(ListLBHealthCheckPoliciesCmd cmd); - List listByNetworkId(long networkId); - LoadBalancer findById(long LoadBalancer); - public void updateLBHealthChecks() throws ResourceUnavailableException; + + public void updateLBHealthChecks(Scheme scheme) throws ResourceUnavailableException; + + Map getLbInstances(long lbId); } http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/src/com/cloud/network/router/VirtualRouter.java ---------------------------------------------------------------------- diff --git a/api/src/com/cloud/network/router/VirtualRouter.java b/api/src/com/cloud/network/router/VirtualRouter.java index d7239dd..2311f48 100755 --- a/api/src/com/cloud/network/router/VirtualRouter.java +++ b/api/src/com/cloud/network/router/VirtualRouter.java @@ -23,7 +23,7 @@ import com.cloud.vm.VirtualMachine; */ public interface VirtualRouter extends VirtualMachine { public enum Role { - VIRTUAL_ROUTER, LB + VIRTUAL_ROUTER, LB, INTERNAL_LB_VM } Role getRole(); boolean getIsRedundantRouter(); http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/src/com/cloud/network/rules/LoadBalancer.java ---------------------------------------------------------------------- diff --git a/api/src/com/cloud/network/rules/LoadBalancer.java b/api/src/com/cloud/network/rules/LoadBalancer.java index ab6085a..e6dadca 100644 --- a/api/src/com/cloud/network/rules/LoadBalancer.java +++ b/api/src/com/cloud/network/rules/LoadBalancer.java @@ -19,16 +19,10 @@ package com.cloud.network.rules; /** * Definition for a LoadBalancer */ -public interface LoadBalancer extends FirewallRule { - - String getName(); - - String getDescription(); - +public interface LoadBalancer extends FirewallRule, LoadBalancerContainer { + int getDefaultPortStart(); int getDefaultPortEnd(); - String getAlgorithm(); - } http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/src/com/cloud/network/rules/LoadBalancerContainer.java ---------------------------------------------------------------------- diff --git a/api/src/com/cloud/network/rules/LoadBalancerContainer.java b/api/src/com/cloud/network/rules/LoadBalancerContainer.java new file mode 100644 index 0000000..9d5ea59 --- /dev/null +++ b/api/src/com/cloud/network/rules/LoadBalancerContainer.java @@ -0,0 +1,33 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.network.rules; + +public interface LoadBalancerContainer { + + public enum Scheme { + Public, Internal; + } + + String getName(); + + String getDescription(); + + String getAlgorithm(); + + Scheme getScheme(); + +} http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/src/com/cloud/network/rules/RulesService.java ---------------------------------------------------------------------- diff --git a/api/src/com/cloud/network/rules/RulesService.java b/api/src/com/cloud/network/rules/RulesService.java index d47b38f..45abd84 100644 --- a/api/src/com/cloud/network/rules/RulesService.java +++ b/api/src/com/cloud/network/rules/RulesService.java @@ -67,7 +67,7 @@ public interface RulesService { boolean applyPortForwardingRules(long ipAdddressId, Account caller) throws ResourceUnavailableException; - boolean enableStaticNat(long ipAddressId, long vmId, long networkId, boolean isSystemVm, String vmGuestIp) throws NetworkRuleConflictException, ResourceUnavailableException; + boolean enableStaticNat(long ipAddressId, long vmId, long networkId, String vmGuestIp) throws NetworkRuleConflictException, ResourceUnavailableException; PortForwardingRule getPortForwardigRule(long ruleId); http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/src/com/cloud/network/security/SecurityGroupRules.java ---------------------------------------------------------------------- diff --git a/api/src/com/cloud/network/security/SecurityGroupRules.java b/api/src/com/cloud/network/security/SecurityGroupRules.java index d255e46..4dbafd6 100644 --- a/api/src/com/cloud/network/security/SecurityGroupRules.java +++ b/api/src/com/cloud/network/security/SecurityGroupRules.java @@ -31,6 +31,8 @@ public interface SecurityGroupRules extends InternalIdentity { Long getRuleId(); + String getRuleUuid(); + int getStartPort(); int getEndPort(); http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/src/com/cloud/network/vpc/PrivateIp.java ---------------------------------------------------------------------- diff --git a/api/src/com/cloud/network/vpc/PrivateIp.java b/api/src/com/cloud/network/vpc/PrivateIp.java index 857fc22..eb68433 100644 --- a/api/src/com/cloud/network/vpc/PrivateIp.java +++ b/api/src/com/cloud/network/vpc/PrivateIp.java @@ -44,5 +44,6 @@ public interface PrivateIp { String getMacAddress(); long getNetworkId(); + boolean getSourceNat(); } http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/src/com/cloud/network/vpc/VpcGateway.java ---------------------------------------------------------------------- diff --git a/api/src/com/cloud/network/vpc/VpcGateway.java b/api/src/com/cloud/network/vpc/VpcGateway.java index 1756616..e3530d0 100644 --- a/api/src/com/cloud/network/vpc/VpcGateway.java +++ b/api/src/com/cloud/network/vpc/VpcGateway.java @@ -77,4 +77,8 @@ public interface VpcGateway extends Identity, ControlledEntity, InternalIdentity * @return */ State getState(); + /** + * @return + */ + boolean getSourceNat(); } http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/src/com/cloud/network/vpc/VpcOffering.java ---------------------------------------------------------------------- diff --git a/api/src/com/cloud/network/vpc/VpcOffering.java b/api/src/com/cloud/network/vpc/VpcOffering.java index 3961d0a..3ec81e6 100644 --- a/api/src/com/cloud/network/vpc/VpcOffering.java +++ b/api/src/com/cloud/network/vpc/VpcOffering.java @@ -26,6 +26,7 @@ public interface VpcOffering extends InternalIdentity, Identity { } public static final String defaultVPCOfferingName = "Default VPC offering"; + public static final String defaultVPCNSOfferingName = "Default VPC offering with Netscaler"; /** * http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/src/com/cloud/network/vpc/VpcService.java ---------------------------------------------------------------------- diff --git a/api/src/com/cloud/network/vpc/VpcService.java b/api/src/com/cloud/network/vpc/VpcService.java index 07ce89b..23e2764 100644 --- a/api/src/com/cloud/network/vpc/VpcService.java +++ b/api/src/com/cloud/network/vpc/VpcService.java @@ -163,6 +163,7 @@ public interface VpcService { /** * Persists VPC private gateway in the Database. * + * * @param vpcId TODO * @param physicalNetworkId * @param vlan @@ -170,13 +171,14 @@ public interface VpcService { * @param gateway * @param netmask * @param gatewayOwnerId + * @param isSourceNat * @return * @throws InsufficientCapacityException * @throws ConcurrentOperationException * @throws ResourceAllocationException */ public PrivateGateway createVpcPrivateGateway(long vpcId, Long physicalNetworkId, String vlan, String ipAddress, - String gateway, String netmask, long gatewayOwnerId) throws ResourceAllocationException, + String gateway, String netmask, long gatewayOwnerId, Boolean isSourceNat) throws ResourceAllocationException, ConcurrentOperationException, InsufficientCapacityException; /** http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/src/com/cloud/offering/NetworkOffering.java ---------------------------------------------------------------------- diff --git a/api/src/com/cloud/offering/NetworkOffering.java b/api/src/com/cloud/offering/NetworkOffering.java index 6f0b993..72e2a2b 100644 --- a/api/src/com/cloud/offering/NetworkOffering.java +++ b/api/src/com/cloud/offering/NetworkOffering.java @@ -16,6 +16,8 @@ // under the License. package com.cloud.offering; +import java.util.Map; + import org.apache.cloudstack.acl.InfrastructureEntity; import org.apache.cloudstack.api.Identity; import org.apache.cloudstack.api.InternalIdentity; @@ -38,6 +40,11 @@ public interface NetworkOffering extends InfrastructureEntity, InternalIdentity, Disabled, Enabled } + + public enum Detail { + InternalLbProvider, + PublicLbProvider + } public final static String SystemPublicNetwork = "System-Public-Network"; public final static String SystemControlNetwork = "System-Control-Network"; @@ -116,5 +123,9 @@ public interface NetworkOffering extends InfrastructureEntity, InternalIdentity, boolean isInline(); boolean getIsPersistent(); + + boolean getInternalLb(); + + boolean getPublicLb(); } http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/src/com/cloud/offering/ServiceOffering.java ---------------------------------------------------------------------- diff --git a/api/src/com/cloud/offering/ServiceOffering.java b/api/src/com/cloud/offering/ServiceOffering.java index d6c215f..165369c 100755 --- a/api/src/com/cloud/offering/ServiceOffering.java +++ b/api/src/com/cloud/offering/ServiceOffering.java @@ -30,6 +30,7 @@ public interface ServiceOffering extends InfrastructureEntity, InternalIdentity, public static final String ssvmDefaultOffUniqueName = "Cloud.com-SecondaryStorage"; public static final String routerDefaultOffUniqueName = "Cloud.Com-SoftwareRouter"; public static final String elbVmDefaultOffUniqueName = "Cloud.Com-ElasticLBVm"; + public static final String internalLbVmDefaultOffUniqueName = "Cloud.Com-InternalLBVm"; public enum StorageType { local, http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/src/com/cloud/resource/UnableDeleteHostException.java ---------------------------------------------------------------------- diff --git a/api/src/com/cloud/resource/UnableDeleteHostException.java b/api/src/com/cloud/resource/UnableDeleteHostException.java new file mode 100755 index 0000000..154147c --- /dev/null +++ b/api/src/com/cloud/resource/UnableDeleteHostException.java @@ -0,0 +1,28 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.resource; + +import com.cloud.utils.SerialVersionUID; +import com.cloud.exception.CloudException; + +public class UnableDeleteHostException extends CloudException { + private static final long serialVersionUID = SerialVersionUID.UnableDeleteHostException; + + public UnableDeleteHostException(String msg) { + super(msg); + } +} http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/src/com/cloud/storage/StoragePoolDiscoverer.java ---------------------------------------------------------------------- diff --git a/api/src/com/cloud/storage/StoragePoolDiscoverer.java b/api/src/com/cloud/storage/StoragePoolDiscoverer.java new file mode 100644 index 0000000..40a925d --- /dev/null +++ b/api/src/com/cloud/storage/StoragePoolDiscoverer.java @@ -0,0 +1,33 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.storage; + +import java.net.URI; +import java.util.Map; + +import com.cloud.exception.DiscoveryException; +import com.cloud.utils.component.Adapter; + +/** + * Discoverer to find new Storage Pools. + */ +public interface StoragePoolDiscoverer extends Adapter { + + Map> find(long dcId, Long podId, URI uri, Map details) throws DiscoveryException; + + Map> find(long dcId, Long podId, URI uri, Map details, String username, String password) throws DiscoveryException; +} http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/src/com/cloud/storage/snapshot/SnapshotSchedule.java ---------------------------------------------------------------------- diff --git a/api/src/com/cloud/storage/snapshot/SnapshotSchedule.java b/api/src/com/cloud/storage/snapshot/SnapshotSchedule.java index 12c1445..6f3d2ce 100644 --- a/api/src/com/cloud/storage/snapshot/SnapshotSchedule.java +++ b/api/src/com/cloud/storage/snapshot/SnapshotSchedule.java @@ -16,12 +16,12 @@ // under the License. package com.cloud.storage.snapshot; -import java.util.Date; +import org.apache.cloudstack.api.Identity; +import org.apache.cloudstack.api.InternalIdentity; -public interface SnapshotSchedule { - long getId(); +import java.util.Date; - String getUuid(); +public interface SnapshotSchedule extends InternalIdentity, Identity { Long getVolumeId(); @@ -38,10 +38,9 @@ public interface SnapshotSchedule { Long getAsyncJobId(); - void setAsyncJobId(long asyncJobId); + void setAsyncJobId(Long asyncJobId); Long getSnapshotId(); void setSnapshotId(Long snapshotId); - } http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/src/com/cloud/vm/ConsoleProxy.java ---------------------------------------------------------------------- diff --git a/api/src/com/cloud/vm/ConsoleProxy.java b/api/src/com/cloud/vm/ConsoleProxy.java new file mode 100644 index 0000000..1d4fcb1 --- /dev/null +++ b/api/src/com/cloud/vm/ConsoleProxy.java @@ -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 com.cloud.vm; + +/** + * ConsoleProxy is a system VM instance that is used + * to proxy VNC traffic + */ +public interface ConsoleProxy extends SystemVm { + public int getActiveSession(); + public byte[] getSessionDetails(); +} + http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/src/com/cloud/vm/SecondaryStorageVm.java ---------------------------------------------------------------------- diff --git a/api/src/com/cloud/vm/SecondaryStorageVm.java b/api/src/com/cloud/vm/SecondaryStorageVm.java new file mode 100644 index 0000000..9acff14 --- /dev/null +++ b/api/src/com/cloud/vm/SecondaryStorageVm.java @@ -0,0 +1,26 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.vm; + +/** + * Secondary Storage VM is a system VM instance that is used + * to interface the management server to secondary storage + */ +public interface SecondaryStorageVm extends SystemVm { + enum Role { templateProcessor, commandExecutor } +} + http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/src/com/cloud/vm/SystemVm.java ---------------------------------------------------------------------- diff --git a/api/src/com/cloud/vm/SystemVm.java b/api/src/com/cloud/vm/SystemVm.java new file mode 100644 index 0000000..a697d08 --- /dev/null +++ b/api/src/com/cloud/vm/SystemVm.java @@ -0,0 +1,26 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.vm; + +import java.util.Date; + +public interface SystemVm extends VirtualMachine { + public String getPublicIpAddress(); + public String getPublicNetmask(); + public String getPublicMacAddress(); + public Date getLastUpdateTime(); +}