com.softlayer.api.service.network.contentdelivery.authentication.Address 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.contentdelivery.authentication;
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.Entity;
import java.util.GregorianCalendar;
import java.util.List;
import java.util.concurrent.Future;
/**
* The SoftLayer_Network_ContentDelivery_Authentication_Address data type models an individual IP address that CDN allow or deny access from.
*
* @see SoftLayer_Network_ContentDelivery_Authentication_Address
*/
@ApiType("SoftLayer_Network_ContentDelivery_Authentication_Address")
public class Address extends Entity {
/**
* The type of access on an IP address. It can be "ALLOW" or "DENY"
*/
@ApiProperty(canBeNullOrNotSet = true)
protected String accessType;
public String getAccessType() {
return accessType;
}
public void setAccessType(String accessType) {
accessTypeSpecified = true;
this.accessType = accessType;
}
protected boolean accessTypeSpecified;
public boolean isAccessTypeSpecified() {
return accessTypeSpecified;
}
public void unsetAccessType() {
accessType = null;
accessTypeSpecified = false;
}
/**
* The internal identifier of the CDN account
*/
@ApiProperty(canBeNullOrNotSet = true)
protected Long cdnAccountId;
public Long getCdnAccountId() {
return cdnAccountId;
}
public void setCdnAccountId(Long cdnAccountId) {
cdnAccountIdSpecified = true;
this.cdnAccountId = cdnAccountId;
}
protected boolean cdnAccountIdSpecified;
public boolean isCdnAccountIdSpecified() {
return cdnAccountIdSpecified;
}
public void unsetCdnAccountId() {
cdnAccountId = null;
cdnAccountIdSpecified = false;
}
/**
* The created date
*/
@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 internal identifier of an authentication IP address
*/
@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 IP address that you want to block or allow access to
*/
@ApiProperty(canBeNullOrNotSet = true)
protected String ipAddress;
public String getIpAddress() {
return ipAddress;
}
public void setIpAddress(String ipAddress) {
ipAddressSpecified = true;
this.ipAddress = ipAddress;
}
protected boolean ipAddressSpecified;
public boolean isIpAddressSpecified() {
return ipAddressSpecified;
}
public void unsetIpAddress() {
ipAddress = null;
ipAddressSpecified = false;
}
/**
* The last modified date
*/
@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 of an authentication IP. This helps you to keep track of IP addresses.
*/
@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 priority of an authentication IP address. The smaller number, the higher in priority. Higher priority IP will be matched first.
*/
@ApiProperty(canBeNullOrNotSet = true)
protected Long priority;
public Long getPriority() {
return priority;
}
public void setPriority(Long priority) {
prioritySpecified = true;
this.priority = priority;
}
protected boolean prioritySpecified;
public boolean isPrioritySpecified() {
return prioritySpecified;
}
public void unsetPriority() {
priority = null;
prioritySpecified = false;
}
/**
* The internal identifier of the user who created an authentication IP record
*/
@ApiProperty(canBeNullOrNotSet = true)
protected Long userId;
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
userIdSpecified = true;
this.userId = userId;
}
protected boolean userIdSpecified;
public boolean isUserIdSpecified() {
return userIdSpecified;
}
public void unsetUserId() {
userId = null;
userIdSpecified = false;
}
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());
}
/**
* For more details on CDN's content authentication service, see [[SoftLayer_Network_ContentDelivery_Authentication_Token|Authentication Token]].
*
* You can restrict or grant access to your content by configuring an authentication IP address or an IP block. . This configuration will affect the entire secure content of your CDN account. Configuring an authentication IP Address does not mean all of your content will be secured. You must place your content in the right directories (/media/securehttp, /media/secureflash, /media/securewm) and you have to use an authentication token. Authentication IP address validation occurs before a token is validated. Consider authentication IP as an additional way to secure your content. You can have up to 20 IP address records. If you want to block access from IP 211.37.0.0/16, you can enter "211.37." instead. IP blocks can be specified in the manner of "8bit times n".
*
* {| cellspacing="5" style="width: 40%; border: 0px; margin-left: auto; margin-right: auto; padding: 10px;"
* |-
* |style="background: #d2d2d2; padding: 10px; text-align: center;"|'''IP range'''
* |style="background: #d2d2d2; padding: 10px; text-align: center;"|'''value you will pass to API'''
* |-
* |style="background: #e7e7e7"|123.0.0.0/8
* |style="background: #e7e7e7"|123.
* |-
* |style="background: #f5f5f5"|123.123.0.0/16
* |style="background: #f5f5f5"|123.123.
* |-
* |style="background: #e7e7e7"|123.123.123.0/24
* |style="background: #e7e7e7"|123.123.123.
* |-
* |style="background: #e7e7e7"|123.123.123.123
* |style="background: #e7e7e7"|123.123.123.123 (Allow or Deny a single IP)
* |-
* |}
*
*
*
*
* IP match starts from higher priority IP to lower and if there is a match, it will stop the process.
*
* You can also set an authentication IP with an * (asterisk). This can be helpful if you want to deny all IP addresses. The example below shows that requests from 199.7.0.0/16 are allowed and requests from any other IP ranges are blocked.
*
* {| cellspacing="5" style="width: 60%; border: 0px; margin-left: auto; margin-right: auto; padding: 10px;"
* |-
* |style="background: #d2d2d2; padding: 10px; text-align: center;"|'''Name'''
* |style="background: #d2d2d2; padding: 10px; text-align: center;"|'''IP Address'''
* |style="background: #d2d2d2; padding: 10px; text-align: center;"|'''Access Type'''
* |style="background: #d2d2d2; padding: 10px; text-align: center;"|'''Priority'''
* |-
* |style="background: #e7e7e7"|Allow from Netherlands
* |style="background: #e7e7e7"|199.7.
* |style="background: #e7e7e7"|ALLOW
* |style="background: #e7e7e7"|10
* |-
* |style="background: #e7e7e7"|Deny all
* |style="background: #e7e7e7"|*
* |style="background: #e7e7e7"|DENY
* |style="background: #e7e7e7"|20
* |-
* |}
*
* @see SoftLayer_Network_ContentDelivery_Authentication_Address
*/
@com.softlayer.api.annotation.ApiService("SoftLayer_Network_ContentDelivery_Authentication_Address")
public static interface Service extends com.softlayer.api.Service {
public ServiceAsync asAsync();
public Mask withNewMask();
public Mask withMask();
public void setMask(Mask mask);
/**
* This method creates an authentication IP record. Required parameters are
*
*
* * cdnAccountId - A CDN account id that belongs to your SoftLayer Account
* * ipAddress - An IP address or a IP range
* * accessType- It can be "ALLOW" or "DENY"
*
* @see SoftLayer_Network_ContentDelivery_Authentication_Address::createObject
*/
@ApiMethod
public Address createObject(Address templateObject);
/**
* This method deletes an authentication IP address.
*
* @see SoftLayer_Network_ContentDelivery_Authentication_Address::deleteObject
*/
@ApiMethod(instanceRequired = true)
public Boolean deleteObject();
/**
* This method let you edit an authentication IP object by passing a modified object.
*
* @see SoftLayer_Network_ContentDelivery_Authentication_Address::editObject
*/
@ApiMethod(instanceRequired = true)
public Boolean editObject(Address templateObject);
/**
* getObject retrieves the SoftLayer_Network_ContentDelivery_Authentication_Address object whose ID number corresponds to the ID number of the initial parameter passed to the SoftLayer_Network_ContentDelivery_Authentication_Address service. You can only retrieve authentication IP addresses assigned to one of your CDN account.
*
* @see SoftLayer_Network_ContentDelivery_Authentication_Address::getObject
*/
@ApiMethod(instanceRequired = true)
public Address getObject();
/**
* The authentication IP address match occurs from the higher priority IP to the lower. This method will be helpful if you want to modify the order (priority) of the authentication IP addresses. You can use this method instead of editing individual authentication IP addresses.
*
* You can retrieve authentication IP address using [[SoftLayer_Network_ContentDelivery_Account::getAuthenticationIpAddresses|getAuthenticationIpAddresses]] method. Then, rearrange the authentication IP addresses and pass them to this method. When creating template objects as parameter, make sure to include the id of each authentication IP addresses. You must provide every authentication IP address. New priorities will be assigned to each authentication IP addresses in the order of they are passed.
*
* @see SoftLayer_Network_ContentDelivery_Authentication_Address::rearrangeAuthenticationIp
*/
@ApiMethod
public Boolean rearrangeAuthenticationIp(Long cdnAccountId, List templateObjects);
}
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(Address templateObject);
public Future> createObject(Address 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(Address templateObject);
public Future> editObject(Address templateObject, ResponseHandler callback);
/**
* Async version of {@link Service#getObject}
*/
public Future getObject();
public Future> getObject(ResponseHandler callback);
/**
* Async version of {@link Service#rearrangeAuthenticationIp}
*/
public Future rearrangeAuthenticationIp(Long cdnAccountId, List templateObjects);
public Future> rearrangeAuthenticationIp(Long cdnAccountId, List templateObjects, ResponseHandler callback);
}
public static class Mask extends com.softlayer.api.service.Entity.Mask {
public Mask accessType() {
withLocalProperty("accessType");
return this;
}
public Mask cdnAccountId() {
withLocalProperty("cdnAccountId");
return this;
}
public Mask createDate() {
withLocalProperty("createDate");
return this;
}
public Mask id() {
withLocalProperty("id");
return this;
}
public Mask ipAddress() {
withLocalProperty("ipAddress");
return this;
}
public Mask modifyDate() {
withLocalProperty("modifyDate");
return this;
}
public Mask name() {
withLocalProperty("name");
return this;
}
public Mask priority() {
withLocalProperty("priority");
return this;
}
public Mask userId() {
withLocalProperty("userId");
return this;
}
}
}