diff --git a/api/src/org/apache/cloudstack/entity/cloud/CloudResource.java b/api/src/org/apache/cloudstack/entity/CloudResource.java similarity index 79% rename from api/src/org/apache/cloudstack/entity/cloud/CloudResource.java rename to api/src/org/apache/cloudstack/entity/CloudResource.java index 3213c1600e0..83bfa448156 100644 --- a/api/src/org/apache/cloudstack/entity/cloud/CloudResource.java +++ b/api/src/org/apache/cloudstack/entity/CloudResource.java @@ -14,7 +14,7 @@ // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. -package org.apache.cloudstack.entity.cloud; +package org.apache.cloudstack.entity; import java.util.Date; @@ -24,6 +24,8 @@ import java.util.Date; * Base class for cloud resources. */ public abstract class CloudResource { + protected long id; + protected String uuid; protected Date removed; protected Date created; @@ -41,5 +43,19 @@ public abstract class CloudResource { this.created = created; } + public long getId() { + return id; + } + public void setId(long id) { + this.id = id; + } + + public String getUuid() { + return uuid; + } + + public void setUuid(String uuid) { + this.uuid = uuid; + } } diff --git a/api/src/org/apache/cloudstack/entity/cloud/ComputeOfferingResource.java b/api/src/org/apache/cloudstack/entity/cloud/ComputeOfferingResource.java new file mode 100644 index 00000000000..bee016c6f4a --- /dev/null +++ b/api/src/org/apache/cloudstack/entity/cloud/ComputeOfferingResource.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 org.apache.cloudstack.entity.cloud; + +import org.apache.cloudstack.entity.CloudResource; + +/** + * + */ +public class ComputeOfferingResource extends CloudResource { + +} diff --git a/api/src/org/apache/cloudstack/entity/cloud/DiskOfferingResource.java b/api/src/org/apache/cloudstack/entity/cloud/DiskOfferingResource.java new file mode 100644 index 00000000000..ae649644f96 --- /dev/null +++ b/api/src/org/apache/cloudstack/entity/cloud/DiskOfferingResource.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 org.apache.cloudstack.entity.cloud; + +import org.apache.cloudstack.entity.CloudResource; + +/** + * + */ +public class DiskOfferingResource extends CloudResource { + +} diff --git a/api/src/org/apache/cloudstack/entity/cloud/InstanceGroupResource.java b/api/src/org/apache/cloudstack/entity/cloud/InstanceGroupResource.java index 60af39b9e6a..d30a3c4f7e0 100644 --- a/api/src/org/apache/cloudstack/entity/cloud/InstanceGroupResource.java +++ b/api/src/org/apache/cloudstack/entity/cloud/InstanceGroupResource.java @@ -19,6 +19,7 @@ package org.apache.cloudstack.entity.cloud; import java.util.List; import javax.xml.bind.annotation.XmlRootElement; +import org.apache.cloudstack.entity.CloudResource; import org.apache.cloudstack.entity.identity.AccountResource; @@ -29,30 +30,13 @@ import org.apache.cloudstack.entity.identity.AccountResource; public class InstanceGroupResource extends CloudResource { // attributes - private long id; - private String uuid; private String name; // relationships private AccountResource account; - private List vms; + private List vms; - public long getId() { - return id; - } - - public void setId(long id) { - this.id = id; - } - - public String getUuid() { - return uuid; - } - - public void setUuid(String uuid) { - this.uuid = uuid; - } public String getName() { return name; @@ -70,11 +54,11 @@ public class InstanceGroupResource extends CloudResource { this.account = account; } - public List getVms() { + public List getVms() { return vms; } - public void setVms(List vms) { + public void setVms(List vms) { this.vms = vms; } diff --git a/api/src/org/apache/cloudstack/entity/cloud/NicResource.java b/api/src/org/apache/cloudstack/entity/cloud/NicResource.java new file mode 100644 index 00000000000..b63cc6b3e51 --- /dev/null +++ b/api/src/org/apache/cloudstack/entity/cloud/NicResource.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 org.apache.cloudstack.entity.cloud; + +import org.apache.cloudstack.entity.CloudResource; + +/** + * + */ +public class NicResource extends CloudResource { + +} diff --git a/api/src/org/apache/cloudstack/entity/cloud/TemplateResource.java b/api/src/org/apache/cloudstack/entity/cloud/TemplateResource.java new file mode 100644 index 00000000000..fea6818749a --- /dev/null +++ b/api/src/org/apache/cloudstack/entity/cloud/TemplateResource.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 org.apache.cloudstack.entity.cloud; + +import org.apache.cloudstack.entity.CloudResource; + +/** + * + */ +public class TemplateResource extends CloudResource { + +} diff --git a/api/src/org/apache/cloudstack/entity/cloud/UserVmResource.java b/api/src/org/apache/cloudstack/entity/cloud/UserVmResource.java new file mode 100644 index 00000000000..70859674e2c --- /dev/null +++ b/api/src/org/apache/cloudstack/entity/cloud/UserVmResource.java @@ -0,0 +1,57 @@ +// 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.entity.cloud; + +import java.util.Map; + +/** + * User VM resource. + */ +public class UserVmResource extends VirtualMachineResource { + + private Map userData; + private String displayName; + + // relationship + private InstanceGroupResource vmGroup; + + public Map getUserData() { + return userData; + } + + public void setUserData(Map userData) { + this.userData = userData; + } + + public String getDisplayName() { + return displayName; + } + + public void setDisplayName(String displayName) { + this.displayName = displayName; + } + + public InstanceGroupResource getVmGroup() { + return vmGroup; + } + + public void setVmGroup(InstanceGroupResource vmGroup) { + this.vmGroup = vmGroup; + } + + +} diff --git a/api/src/org/apache/cloudstack/entity/cloud/VirtualMachineResource.java b/api/src/org/apache/cloudstack/entity/cloud/VirtualMachineResource.java index 35e01392145..3dcbd438a92 100644 --- a/api/src/org/apache/cloudstack/entity/cloud/VirtualMachineResource.java +++ b/api/src/org/apache/cloudstack/entity/cloud/VirtualMachineResource.java @@ -16,9 +16,117 @@ // under the License. package org.apache.cloudstack.entity.cloud; +import java.util.List; + +import org.apache.cloudstack.entity.CloudResource; +import org.apache.cloudstack.entity.identity.AccountResource; +import org.apache.cloudstack.entity.infrastructure.HostResource; + +import com.cloud.hypervisor.Hypervisor.HypervisorType; +import com.cloud.vm.VirtualMachine.State; + /** - * + * VirtualMachine entity resource */ public class VirtualMachineResource extends CloudResource { + //attributes + protected String name; + protected State state = null; + protected HypervisorType hypervisorType; + protected long guestOsId; + protected String vncPassword; + protected boolean haEnabled; + protected boolean limitCpuUse; + + + //relationships + protected HostResource host; + protected AccountResource account; + protected TemplateResource template; + protected ComputeOfferingResource computeOffering; + protected DiskOfferingResource diskOffering; + protected List nics; + + + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + public State getState() { + return state; + } + public void setState(State state) { + this.state = state; + } + public HypervisorType getHypervisorType() { + return hypervisorType; + } + public void setHypervisorType(HypervisorType hypervisorType) { + this.hypervisorType = hypervisorType; + } + public long getGuestOsId() { + return guestOsId; + } + public void setGuestOsId(long guestOsId) { + this.guestOsId = guestOsId; + } + public String getVncPassword() { + return vncPassword; + } + public void setVncPassword(String vncPassword) { + this.vncPassword = vncPassword; + } + public boolean isHaEnabled() { + return haEnabled; + } + public void setHaEnabled(boolean haEnabled) { + this.haEnabled = haEnabled; + } + public boolean isLimitCpuUse() { + return limitCpuUse; + } + public void setLimitCpuUse(boolean limitCpuUse) { + this.limitCpuUse = limitCpuUse; + } + public HostResource getHost() { + return host; + } + public void setHost(HostResource host) { + this.host = host; + } + public AccountResource getAccount() { + return account; + } + public void setAccount(AccountResource account) { + this.account = account; + } + public TemplateResource getTemplate() { + return template; + } + public void setTemplate(TemplateResource template) { + this.template = template; + } + public ComputeOfferingResource getComputeOffering() { + return computeOffering; + } + public void setComputeOffering(ComputeOfferingResource computeOffering) { + this.computeOffering = computeOffering; + } + public DiskOfferingResource getDiskOffering() { + return diskOffering; + } + public void setDiskOffering(DiskOfferingResource diskOffering) { + this.diskOffering = diskOffering; + } + public List getNics() { + return nics; + } + public void setNics(List nics) { + this.nics = nics; + } + + } diff --git a/api/src/org/apache/cloudstack/entity/identity/AccountResource.java b/api/src/org/apache/cloudstack/entity/identity/AccountResource.java index c64a59d6f5b..efb5e6550a9 100644 --- a/api/src/org/apache/cloudstack/entity/identity/AccountResource.java +++ b/api/src/org/apache/cloudstack/entity/identity/AccountResource.java @@ -16,9 +16,85 @@ // under the License. package org.apache.cloudstack.entity.identity; +import java.util.Map; + +import org.apache.cloudstack.entity.CloudResource; + +import com.cloud.user.Account.State; + /** * Account Identity */ -public class AccountResource { +public class AccountResource extends CloudResource { + + // attributes + private String name; + private short type; + private State state; + private String networkDomain; + private Long defaultZoneId; + private Map details; + + // relation + private DomainResource domain; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public short getType() { + return type; + } + + public void setType(short type) { + this.type = type; + } + + public State getState() { + return state; + } + + public void setState(State state) { + this.state = state; + } + + public String getNetworkDomain() { + return networkDomain; + } + + public void setNetworkDomain(String networkDomain) { + this.networkDomain = networkDomain; + } + + public Long getDefaultZoneId() { + return defaultZoneId; + } + + public void setDefaultZoneId(Long defaultZoneId) { + this.defaultZoneId = defaultZoneId; + } + + + public Map getDetails() { + return details; + } + + public void setDetails(Map details) { + this.details = details; + } + + public DomainResource getDomain() { + return domain; + } + + public void setDomain(DomainResource domain) { + this.domain = domain; + } + + } diff --git a/api/src/org/apache/cloudstack/entity/identity/DomainResource.java b/api/src/org/apache/cloudstack/entity/identity/DomainResource.java new file mode 100644 index 00000000000..419fefd1a1c --- /dev/null +++ b/api/src/org/apache/cloudstack/entity/identity/DomainResource.java @@ -0,0 +1,80 @@ +// 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.entity.identity; + +import java.util.List; + +import com.cloud.domain.Domain.State; + +/** + * Domain Resource + */ +public class DomainResource { + + // attributes + private String name; + private String path; + private State state; + private String networkDomain; + + + // relationship + private DomainResource parent; + private List children; + + + public DomainResource getParent() { + return parent; + } + public void setParent(DomainResource parent) { + this.parent = parent; + } + public List getChildren() { + return children; + } + public void setChildren(List children) { + this.children = children; + } + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + public String getPath() { + return path; + } + public void setPath(String path) { + this.path = path; + } + public State getState() { + return state; + } + public void setState(State state) { + this.state = state; + } + public String getNetworkDomain() { + return networkDomain; + } + public void setNetworkDomain(String networkDomain) { + this.networkDomain = networkDomain; + } + + + + +} diff --git a/api/src/org/apache/cloudstack/entity/infrastructure/ClusterResource.java b/api/src/org/apache/cloudstack/entity/infrastructure/ClusterResource.java new file mode 100644 index 00000000000..ec0e5ab57c1 --- /dev/null +++ b/api/src/org/apache/cloudstack/entity/infrastructure/ClusterResource.java @@ -0,0 +1,24 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package org.apache.cloudstack.entity.infrastructure; + +/** + * + */ +public class ClusterResource extends InfrastructureResource { + +} diff --git a/api/src/org/apache/cloudstack/entity/infrastructure/DataCenterResource.java b/api/src/org/apache/cloudstack/entity/infrastructure/DataCenterResource.java new file mode 100644 index 00000000000..bb2ed5675e2 --- /dev/null +++ b/api/src/org/apache/cloudstack/entity/infrastructure/DataCenterResource.java @@ -0,0 +1,24 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package org.apache.cloudstack.entity.infrastructure; + +/** + * + */ +public class DataCenterResource extends InfrastructureResource { + +} diff --git a/api/src/org/apache/cloudstack/entity/infrastructure/HostResource.java b/api/src/org/apache/cloudstack/entity/infrastructure/HostResource.java new file mode 100644 index 00000000000..28ea8a66dfe --- /dev/null +++ b/api/src/org/apache/cloudstack/entity/infrastructure/HostResource.java @@ -0,0 +1,24 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package org.apache.cloudstack.entity.infrastructure; + +/** + * + */ +public class HostResource extends InfrastructureResource { + +} diff --git a/api/src/org/apache/cloudstack/entity/infrastructure/InfrastructureResource.java b/api/src/org/apache/cloudstack/entity/infrastructure/InfrastructureResource.java new file mode 100644 index 00000000000..980a5398ca5 --- /dev/null +++ b/api/src/org/apache/cloudstack/entity/infrastructure/InfrastructureResource.java @@ -0,0 +1,24 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package org.apache.cloudstack.entity.infrastructure; + +/** + * Base class for Infrastructure resource. + */ +public abstract class InfrastructureResource { + +} diff --git a/api/src/org/apache/cloudstack/entity/infrastructure/PodResource.java b/api/src/org/apache/cloudstack/entity/infrastructure/PodResource.java new file mode 100644 index 00000000000..318527a5a1e --- /dev/null +++ b/api/src/org/apache/cloudstack/entity/infrastructure/PodResource.java @@ -0,0 +1,24 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package org.apache.cloudstack.entity.infrastructure; + +/** + * + */ +public class PodResource extends InfrastructureResource { + +}