com.softlayer.api.service.network.SecurityGroup 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.network;
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.Location;
import com.softlayer.api.service.container.network.securitygroup.Limit;
import com.softlayer.api.service.network.securitygroup.OrderBinding;
import com.softlayer.api.service.network.securitygroup.Request;
import com.softlayer.api.service.network.securitygroup.Rule;
import com.softlayer.api.service.virtual.network.securitygroup.NetworkComponentBinding;
import java.util.ArrayList;
import java.util.GregorianCalendar;
import java.util.List;
import java.util.concurrent.Future;
/**
* The SoftLayer_Network_SecurityGroup data type contains general information for a single security group. A security group contains a set of IP filter [[SoftLayer_Network_SecurityGroup_Rule (type)|rules]] that define how to handle incoming (ingress) and outgoing (egress) traffic to both the public and private interfaces of a virtual server instance and a set of [[SoftLayer_Virtual_Network_SecurityGroup_NetworkComponentBinding (type)|bindings]] to associate virtual guest network components with the security group.
*
* @see SoftLayer_Network_SecurityGroup
*/
@ApiType("SoftLayer_Network_SecurityGroup")
public class SecurityGroup extends Entity {
/**
* The account this security group belongs to.
*/
@ApiProperty
protected Account account;
public Account getAccount() {
return account;
}
public void setAccount(Account account) {
this.account = account;
}
/**
* The network component bindings for this security group.
*/
@ApiProperty
protected List networkComponentBindings;
public List getNetworkComponentBindings() {
if (networkComponentBindings == null) {
networkComponentBindings = new ArrayList();
}
return networkComponentBindings;
}
/**
* The order bindings for this security group
*/
@ApiProperty
protected List orderBindings;
public List getOrderBindings() {
if (orderBindings == null) {
orderBindings = new ArrayList();
}
return orderBindings;
}
/**
* The rules for this security group.
*/
@ApiProperty
protected List rules;
public List getRules() {
if (rules == null) {
rules = new ArrayList();
}
return rules;
}
/**
* The date a security group was created.
*/
@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 description for a security group.
*/
@ApiProperty(canBeNullOrNotSet = true)
protected String description;
public String getDescription() {
return description;
}
public void setDescription(String description) {
descriptionSpecified = true;
this.description = description;
}
protected boolean descriptionSpecified;
public boolean isDescriptionSpecified() {
return descriptionSpecified;
}
public void unsetDescription() {
description = null;
descriptionSpecified = false;
}
/**
* The unique ID for a security group.
*/
@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 date a security group was last modified.
*/
@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 name for a security group.
*/
@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;
}
/**
* A count of the network component bindings for this security group.
*/
@ApiProperty
protected Long networkComponentBindingCount;
public Long getNetworkComponentBindingCount() {
return networkComponentBindingCount;
}
public void setNetworkComponentBindingCount(Long networkComponentBindingCount) {
this.networkComponentBindingCount = networkComponentBindingCount;
}
/**
* A count of the order bindings for this security group
*/
@ApiProperty
protected Long orderBindingCount;
public Long getOrderBindingCount() {
return orderBindingCount;
}
public void setOrderBindingCount(Long orderBindingCount) {
this.orderBindingCount = orderBindingCount;
}
/**
* A count of the rules for this security group.
*/
@ApiProperty
protected Long ruleCount;
public Long getRuleCount() {
return ruleCount;
}
public void setRuleCount(Long ruleCount) {
this.ruleCount = ruleCount;
}
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());
}
/**
* The Security Group service provides a common interface to interact with an account's security groups, their rules, and virtual guest instances associated with the groups. A security group contains a set of IP filter rules that define how to handle incoming (ingress) and outgoing (egress) traffic to both the public and private interfaces of a virtual server instance. The rules that you add to a security group are known as [[SoftLayer_Network_SecurityGroup_Rule (type)|security group rules]]. Security groups can be assigned to one or more virtual servers by attaching virtual guest network components through [[SoftLayer_Virtual_Network_SecurityGroup_NetworkComponentBinding (type)|bindings]].
*
* Additional information can be found in Bluemix Docs and SoftLayer API Examples https://console.bluemix.net/docs/infrastructure/security-groups/sg_index.html https://softlayer.github.io/classes/softlayer_network_securitygroup/
*
* @see SoftLayer_Network_SecurityGroup
*/
@com.softlayer.api.annotation.ApiService("SoftLayer_Network_SecurityGroup")
public static interface Service extends com.softlayer.api.Service {
public ServiceAsync asAsync();
public Mask withNewMask();
public Mask withMask();
public void setMask(Mask mask);
/**
* Add new rules to a security group by sending in an array of template [[SoftLayer_Network_SecurityGroup_Rule (type)]] objects to be created.
*
* @see SoftLayer_Network_SecurityGroup::addRules
*/
@ApiMethod(instanceRequired = true)
public Request addRules(List ruleTemplates);
/**
* Attach virtual guest network components to a security group by creating [[SoftLayer_Virtual_Network_SecurityGroup_NetworkComponentBinding (type)]] objects.
*
* @see SoftLayer_Network_SecurityGroup::attachNetworkComponents
*/
@ApiMethod(instanceRequired = true)
public Request attachNetworkComponents(List networkComponentIds);
/**
* Create a new security group.
*
* @see SoftLayer_Network_SecurityGroup::createObject
*/
@ApiMethod
public SecurityGroup createObject(SecurityGroup templateObject);
/**
* Create new security groups.
*
* @see SoftLayer_Network_SecurityGroup::createObjects
*/
@ApiMethod
public List createObjects(List templateObjects);
/**
* Delete a security group for an account. A security group cannot be deleted if any network components are attached or if the security group is a remote security group for a [[SoftLayer_Network_SecurityGroup_Rule (type)|rule]].
*
* @see SoftLayer_Network_SecurityGroup::deleteObject
*/
@ApiMethod(instanceRequired = true)
public Boolean deleteObject();
/**
* Delete security groups for an account. A security group cannot be deleted if any network components are attached or if the security group is a remote security group for a [[SoftLayer_Network_SecurityGroup_Rule (type)|rule]].
*
* @see SoftLayer_Network_SecurityGroup::deleteObjects
*/
@ApiMethod
public Boolean deleteObjects(List templateObjects);
/**
* Detach virtual guest network components from a security group by deleting its [[SoftLayer_Virtual_Network_SecurityGroup_NetworkComponentBinding (type)]].
*
* @see SoftLayer_Network_SecurityGroup::detachNetworkComponents
*/
@ApiMethod(instanceRequired = true)
public Request detachNetworkComponents(List networkComponentIds);
/**
* Edit a security group.
*
* @see SoftLayer_Network_SecurityGroup::editObject
*/
@ApiMethod(instanceRequired = true)
public Boolean editObject(SecurityGroup templateObject);
/**
* Edit security groups.
*
* @see SoftLayer_Network_SecurityGroup::editObjects
*/
@ApiMethod
public Boolean editObjects(List templateObjects);
/**
* Edit rules that belong to the security group. An array of skeleton [[SoftLayer_Network_SecurityGroup_Rule]] objects must be sent in with only the properties defined that you want to change. To edit a property to null, send in -1 for integer properties and "" for string properties. Unchanged properties are left alone.
*
* @see SoftLayer_Network_SecurityGroup::editRules
*/
@ApiMethod(instanceRequired = true)
public Request editRules(List rules);
/**
* @see SoftLayer_Network_SecurityGroup::getAllObjects
*/
@ApiMethod
public List getAllObjects();
/**
* List the current security group limits
*
* @see SoftLayer_Network_SecurityGroup::getLimits
*/
@ApiMethod
public List getLimits();
/**
* @see SoftLayer_Network_SecurityGroup::getObject
*/
@ApiMethod(instanceRequired = true)
public SecurityGroup getObject();
/**
* List the data centers that currently support the use of security groups.
*
* @see SoftLayer_Network_SecurityGroup::getSupportedDataCenters
*/
@ApiMethod
public List getSupportedDataCenters();
/**
* Remove rules from a security group.
*
* @see SoftLayer_Network_SecurityGroup::removeRules
*/
@ApiMethod(instanceRequired = true)
public Request removeRules(List ruleIds);
/**
* The account this security group belongs to.
*
* @see SoftLayer_Network_SecurityGroup::getAccount
*/
@ApiMethod(instanceRequired = true)
public Account getAccount();
/**
* The network component bindings for this security group.
*
* @see SoftLayer_Network_SecurityGroup::getNetworkComponentBindings
*/
@ApiMethod(instanceRequired = true)
public List getNetworkComponentBindings();
/**
* The order bindings for this security group
*
* @see SoftLayer_Network_SecurityGroup::getOrderBindings
*/
@ApiMethod(instanceRequired = true)
public List getOrderBindings();
/**
* The rules for this security group.
*
* @see SoftLayer_Network_SecurityGroup::getRules
*/
@ApiMethod(instanceRequired = true)
public List getRules();
}
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#addRules}
*/
public Future addRules(List ruleTemplates);
public Future> addRules(List ruleTemplates, ResponseHandler callback);
/**
* Async version of {@link Service#attachNetworkComponents}
*/
public Future attachNetworkComponents(List networkComponentIds);
public Future> attachNetworkComponents(List networkComponentIds, ResponseHandler callback);
/**
* Async version of {@link Service#createObject}
*/
public Future createObject(SecurityGroup templateObject);
public Future> createObject(SecurityGroup templateObject, ResponseHandler callback);
/**
* Async version of {@link Service#createObjects}
*/
public Future> createObjects(List templateObjects);
public Future> createObjects(List templateObjects, ResponseHandler> callback);
/**
* Async version of {@link Service#deleteObject}
*/
public Future deleteObject();
public Future> deleteObject(ResponseHandler callback);
/**
* Async version of {@link Service#deleteObjects}
*/
public Future deleteObjects(List templateObjects);
public Future> deleteObjects(List templateObjects, ResponseHandler callback);
/**
* Async version of {@link Service#detachNetworkComponents}
*/
public Future detachNetworkComponents(List networkComponentIds);
public Future> detachNetworkComponents(List networkComponentIds, ResponseHandler callback);
/**
* Async version of {@link Service#editObject}
*/
public Future editObject(SecurityGroup templateObject);
public Future> editObject(SecurityGroup templateObject, ResponseHandler callback);
/**
* Async version of {@link Service#editObjects}
*/
public Future editObjects(List templateObjects);
public Future> editObjects(List templateObjects, ResponseHandler callback);
/**
* Async version of {@link Service#editRules}
*/
public Future editRules(List rules);
public Future> editRules(List rules, ResponseHandler callback);
/**
* Async version of {@link Service#getAllObjects}
*/
public Future> getAllObjects();
public Future> getAllObjects(ResponseHandler> callback);
/**
* Async version of {@link Service#getLimits}
*/
public Future> getLimits();
public Future> getLimits(ResponseHandler> callback);
/**
* Async version of {@link Service#getObject}
*/
public Future getObject();
public Future> getObject(ResponseHandler callback);
/**
* Async version of {@link Service#getSupportedDataCenters}
*/
public Future> getSupportedDataCenters();
public Future> getSupportedDataCenters(ResponseHandler> callback);
/**
* Async version of {@link Service#removeRules}
*/
public Future removeRules(List ruleIds);
public Future> removeRules(List ruleIds, 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#getNetworkComponentBindings}
*/
public Future> getNetworkComponentBindings();
/**
* Async callback version of {@link Service#getNetworkComponentBindings}
*/
public Future> getNetworkComponentBindings(ResponseHandler> callback);
/**
* Async version of {@link Service#getOrderBindings}
*/
public Future> getOrderBindings();
/**
* Async callback version of {@link Service#getOrderBindings}
*/
public Future> getOrderBindings(ResponseHandler> callback);
/**
* Async version of {@link Service#getRules}
*/
public Future> getRules();
/**
* Async callback version of {@link Service#getRules}
*/
public Future> getRules(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.virtual.network.securitygroup.NetworkComponentBinding.Mask networkComponentBindings() {
return withSubMask("networkComponentBindings", com.softlayer.api.service.virtual.network.securitygroup.NetworkComponentBinding.Mask.class);
}
public com.softlayer.api.service.network.securitygroup.OrderBinding.Mask orderBindings() {
return withSubMask("orderBindings", com.softlayer.api.service.network.securitygroup.OrderBinding.Mask.class);
}
public com.softlayer.api.service.network.securitygroup.Rule.Mask rules() {
return withSubMask("rules", com.softlayer.api.service.network.securitygroup.Rule.Mask.class);
}
public Mask createDate() {
withLocalProperty("createDate");
return this;
}
public Mask description() {
withLocalProperty("description");
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 networkComponentBindingCount() {
withLocalProperty("networkComponentBindingCount");
return this;
}
public Mask orderBindingCount() {
withLocalProperty("orderBindingCount");
return this;
}
public Mask ruleCount() {
withLocalProperty("ruleCount");
return this;
}
}
}