com.softlayer.api.service.virtual.PlacementGroup Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of softlayer-api-client Show documentation
Show all versions of softlayer-api-client Show documentation
API client for accessing the SoftLayer API
package com.softlayer.api.service.virtual;
import com.softlayer.api.ApiClient;
import com.softlayer.api.ResponseHandler;
import com.softlayer.api.annotation.ApiMethod;
import com.softlayer.api.annotation.ApiProperty;
import com.softlayer.api.annotation.ApiType;
import com.softlayer.api.service.Account;
import com.softlayer.api.service.Entity;
import com.softlayer.api.service.Hardware;
import com.softlayer.api.service.hardware.router.Backend;
import com.softlayer.api.service.virtual.Guest;
import com.softlayer.api.service.virtual.placementgroup.Rule;
import java.util.ArrayList;
import java.util.GregorianCalendar;
import java.util.List;
import java.util.concurrent.Future;
/**
* This data type presents the structure for a virtual guest placement group. The data type contains relational properties to the virtual guest placement group rule class.
*
* @see SoftLayer_Virtual_PlacementGroup
*/
@ApiType("SoftLayer_Virtual_PlacementGroup")
public class PlacementGroup extends Entity {
/**
* The account that the placement group is implemented on.
*/
@ApiProperty
protected Account account;
public Account getAccount() {
return account;
}
public void setAccount(Account account) {
this.account = account;
}
/**
* The router the placement group is implemented on.
*/
@ApiProperty
protected Backend backendRouter;
public Backend getBackendRouter() {
return backendRouter;
}
public void setBackendRouter(Backend backendRouter) {
this.backendRouter = backendRouter;
}
/**
* The virtual guests that are members of the placement group.
*/
@ApiProperty
protected List guests;
public List getGuests() {
if (guests == null) {
guests = new ArrayList();
}
return guests;
}
/**
* The placement rule that the placement group is implementing.
*/
@ApiProperty
protected Rule rule;
public Rule getRule() {
return rule;
}
public void setRule(Rule rule) {
this.rule = rule;
}
/**
* The unique ID of the account that created the placement group.
*/
@ApiProperty(canBeNullOrNotSet = true)
protected Long accountId;
public Long getAccountId() {
return accountId;
}
public void setAccountId(Long accountId) {
accountIdSpecified = true;
this.accountId = accountId;
}
protected boolean accountIdSpecified;
public boolean isAccountIdSpecified() {
return accountIdSpecified;
}
public void unsetAccountId() {
accountId = null;
accountIdSpecified = false;
}
/**
* The placement group's backend router's associated unique ID.
*/
@ApiProperty(canBeNullOrNotSet = true)
protected Long backendRouterId;
public Long getBackendRouterId() {
return backendRouterId;
}
public void setBackendRouterId(Long backendRouterId) {
backendRouterIdSpecified = true;
this.backendRouterId = backendRouterId;
}
protected boolean backendRouterIdSpecified;
public boolean isBackendRouterIdSpecified() {
return backendRouterIdSpecified;
}
public void unsetBackendRouterId() {
backendRouterId = null;
backendRouterIdSpecified = false;
}
/**
* The placement group's date of creation.
*/
@ApiProperty(canBeNullOrNotSet = true)
protected GregorianCalendar createDate;
public GregorianCalendar getCreateDate() {
return createDate;
}
public void setCreateDate(GregorianCalendar createDate) {
createDateSpecified = true;
this.createDate = createDate;
}
protected boolean createDateSpecified;
public boolean isCreateDateSpecified() {
return createDateSpecified;
}
public void unsetCreateDate() {
createDate = null;
createDateSpecified = false;
}
/**
* The placement group's associated unique ID.
*/
@ApiProperty(canBeNullOrNotSet = true)
protected Long id;
public Long getId() {
return id;
}
public void setId(Long id) {
idSpecified = true;
this.id = id;
}
protected boolean idSpecified;
public boolean isIdSpecified() {
return idSpecified;
}
public void unsetId() {
id = null;
idSpecified = false;
}
/**
* The placement group's date of most recent modification.
*/
@ApiProperty(canBeNullOrNotSet = true)
protected GregorianCalendar modifyDate;
public GregorianCalendar getModifyDate() {
return modifyDate;
}
public void setModifyDate(GregorianCalendar modifyDate) {
modifyDateSpecified = true;
this.modifyDate = modifyDate;
}
protected boolean modifyDateSpecified;
public boolean isModifyDateSpecified() {
return modifyDateSpecified;
}
public void unsetModifyDate() {
modifyDate = null;
modifyDateSpecified = false;
}
/**
* The placement group's name.
*/
@ApiProperty(canBeNullOrNotSet = true)
protected String name;
public String getName() {
return name;
}
public void setName(String name) {
nameSpecified = true;
this.name = name;
}
protected boolean nameSpecified;
public boolean isNameSpecified() {
return nameSpecified;
}
public void unsetName() {
name = null;
nameSpecified = false;
}
/**
* The associated unique ID of the placement group's rule.
*/
@ApiProperty(canBeNullOrNotSet = true)
protected Long ruleId;
public Long getRuleId() {
return ruleId;
}
public void setRuleId(Long ruleId) {
ruleIdSpecified = true;
this.ruleId = ruleId;
}
protected boolean ruleIdSpecified;
public boolean isRuleIdSpecified() {
return ruleIdSpecified;
}
public void unsetRuleId() {
ruleId = null;
ruleIdSpecified = false;
}
/**
* A count of the virtual guests that are members of the placement group.
*/
@ApiProperty
protected Long guestCount;
public Long getGuestCount() {
return guestCount;
}
public void setGuestCount(Long guestCount) {
this.guestCount = guestCount;
}
public Service asService(ApiClient client) {
return service(client, id);
}
public static Service service(ApiClient client) {
return client.createService(Service.class, null);
}
public static Service service(ApiClient client, Long id) {
return client.createService(Service.class, id == null ? null : id.toString());
}
/**
* SoftLayer_Virtual_PlacementGroup is a collection of virtual guests to be placed relative to each other according to a rule.
*
* @see SoftLayer_Virtual_PlacementGroup
*/
@com.softlayer.api.annotation.ApiService("SoftLayer_Virtual_PlacementGroup")
public static interface Service extends com.softlayer.api.Service {
public ServiceAsync asAsync();
public Mask withNewMask();
public Mask withMask();
public void setMask(Mask mask);
/**
* Add a placement group to your account for use during VSI provisioning.
*
* @see SoftLayer_Virtual_PlacementGroup::createObject
*/
@ApiMethod
public PlacementGroup createObject(PlacementGroup templateObject);
/**
* Delete a placement group from your account.
*
* @see SoftLayer_Virtual_PlacementGroup::deleteObject
*/
@ApiMethod(instanceRequired = true)
public Boolean deleteObject();
/**
* Update a placement group.
*
* @see SoftLayer_Virtual_PlacementGroup::editObject
*/
@ApiMethod(instanceRequired = true)
public Boolean editObject(PlacementGroup templateObject);
/**
* Returns all routers available for use with placement groups. If a datacenter location ID is provided, this method will further restrict the list of routers to ones contained within that datacenter.
*
* @see SoftLayer_Virtual_PlacementGroup::getAvailableRouters
*/
@ApiMethod
public List getAvailableRouters(Long datacenterId);
/**
* @see SoftLayer_Virtual_PlacementGroup::getObject
*/
@ApiMethod(instanceRequired = true)
public PlacementGroup getObject();
/**
* The account that the placement group is implemented on.
*
* @see SoftLayer_Virtual_PlacementGroup::getAccount
*/
@ApiMethod(instanceRequired = true)
public Account getAccount();
/**
* The router the placement group is implemented on.
*
* @see SoftLayer_Virtual_PlacementGroup::getBackendRouter
*/
@ApiMethod(instanceRequired = true)
public Backend getBackendRouter();
/**
* The virtual guests that are members of the placement group.
*
* @see SoftLayer_Virtual_PlacementGroup::getGuests
*/
@ApiMethod(instanceRequired = true)
public List getGuests();
/**
* The placement rule that the placement group is implementing.
*
* @see SoftLayer_Virtual_PlacementGroup::getRule
*/
@ApiMethod(instanceRequired = true)
public Rule getRule();
}
public static interface ServiceAsync extends com.softlayer.api.ServiceAsync {
public Mask withNewMask();
public Mask withMask();
public void setMask(Mask mask);
/**
* Async version of {@link Service#createObject}
*/
public Future createObject(PlacementGroup templateObject);
public Future> createObject(PlacementGroup templateObject, ResponseHandler callback);
/**
* Async version of {@link Service#deleteObject}
*/
public Future deleteObject();
public Future> deleteObject(ResponseHandler callback);
/**
* Async version of {@link Service#editObject}
*/
public Future editObject(PlacementGroup templateObject);
public Future> editObject(PlacementGroup templateObject, ResponseHandler callback);
/**
* Async version of {@link Service#getAvailableRouters}
*/
public Future> getAvailableRouters(Long datacenterId);
public Future> getAvailableRouters(Long datacenterId, ResponseHandler> callback);
/**
* Async version of {@link Service#getObject}
*/
public Future getObject();
public Future> getObject(ResponseHandler callback);
/**
* Async version of {@link Service#getAccount}
*/
public Future getAccount();
/**
* Async callback version of {@link Service#getAccount}
*/
public Future> getAccount(ResponseHandler callback);
/**
* Async version of {@link Service#getBackendRouter}
*/
public Future getBackendRouter();
/**
* Async callback version of {@link Service#getBackendRouter}
*/
public Future> getBackendRouter(ResponseHandler callback);
/**
* Async version of {@link Service#getGuests}
*/
public Future> getGuests();
/**
* Async callback version of {@link Service#getGuests}
*/
public Future> getGuests(ResponseHandler> callback);
/**
* Async version of {@link Service#getRule}
*/
public Future getRule();
/**
* Async callback version of {@link Service#getRule}
*/
public Future> getRule(ResponseHandler callback);
}
public static class Mask extends com.softlayer.api.service.Entity.Mask {
public com.softlayer.api.service.Account.Mask account() {
return withSubMask("account", com.softlayer.api.service.Account.Mask.class);
}
public com.softlayer.api.service.hardware.router.Backend.Mask backendRouter() {
return withSubMask("backendRouter", com.softlayer.api.service.hardware.router.Backend.Mask.class);
}
public Guest.Mask guests() {
return withSubMask("guests", Guest.Mask.class);
}
public com.softlayer.api.service.virtual.placementgroup.Rule.Mask rule() {
return withSubMask("rule", com.softlayer.api.service.virtual.placementgroup.Rule.Mask.class);
}
public Mask accountId() {
withLocalProperty("accountId");
return this;
}
public Mask backendRouterId() {
withLocalProperty("backendRouterId");
return this;
}
public Mask createDate() {
withLocalProperty("createDate");
return this;
}
public Mask id() {
withLocalProperty("id");
return this;
}
public Mask modifyDate() {
withLocalProperty("modifyDate");
return this;
}
public Mask name() {
withLocalProperty("name");
return this;
}
public Mask ruleId() {
withLocalProperty("ruleId");
return this;
}
public Mask guestCount() {
withLocalProperty("guestCount");
return this;
}
}
}