ControlAccessUsingHttpMethodsRule¶
-
class
oci.load_balancer.models.
ControlAccessUsingHttpMethodsRule
(**kwargs)¶ Bases:
oci.load_balancer.models.rule.Rule
An object that represents the action of returning a specified response code when the requested HTTP method is not in the list of allowed methods for the listener. The load balancer does not forward a disallowed request to the back end servers. The default response code is 405 Method Not Allowed.
If you set the response code to 405 or leave it blank, the system adds an “allow” response header that contains a list of the allowed methods for the listener. If you set the response code to anything other than 405 (or blank), the system does not add the “allow” response header with a list of allowed methods.
This rule applies only to HTTP listeners. No more than one ControlAccessUsingHttpMethodsRule object can be present in a given listener.
Attributes
ACTION_ADD_HTTP_REQUEST_HEADER
str(object=’’) -> str ACTION_ADD_HTTP_RESPONSE_HEADER
str(object=’’) -> str ACTION_ALLOW
str(object=’’) -> str ACTION_CONTROL_ACCESS_USING_HTTP_METHODS
str(object=’’) -> str ACTION_EXTEND_HTTP_REQUEST_HEADER_VALUE
str(object=’’) -> str ACTION_EXTEND_HTTP_RESPONSE_HEADER_VALUE
str(object=’’) -> str ACTION_HTTP_HEADER
str(object=’’) -> str ACTION_IP_BASED_MAX_CONNECTIONS
str(object=’’) -> str ACTION_REDIRECT
str(object=’’) -> str ACTION_REMOVE_HTTP_REQUEST_HEADER
str(object=’’) -> str ACTION_REMOVE_HTTP_RESPONSE_HEADER
str(object=’’) -> str action
[Required] Gets the action of this Rule. allowed_methods
[Required] Gets the allowed_methods of this ControlAccessUsingHttpMethodsRule. status_code
Gets the status_code of this ControlAccessUsingHttpMethodsRule. Methods
__init__
(**kwargs)Initializes a new ControlAccessUsingHttpMethodsRule object with values from keyword arguments. get_subtype
(object_dictionary)Given the hash representation of a subtype of this class, use the info in the hash to return the class of the subtype. -
ACTION_ADD_HTTP_REQUEST_HEADER
= 'ADD_HTTP_REQUEST_HEADER'¶
-
ACTION_ADD_HTTP_RESPONSE_HEADER
= 'ADD_HTTP_RESPONSE_HEADER'¶
-
ACTION_ALLOW
= 'ALLOW'¶
-
ACTION_CONTROL_ACCESS_USING_HTTP_METHODS
= 'CONTROL_ACCESS_USING_HTTP_METHODS'¶
-
ACTION_EXTEND_HTTP_REQUEST_HEADER_VALUE
= 'EXTEND_HTTP_REQUEST_HEADER_VALUE'¶
-
ACTION_EXTEND_HTTP_RESPONSE_HEADER_VALUE
= 'EXTEND_HTTP_RESPONSE_HEADER_VALUE'¶
-
ACTION_HTTP_HEADER
= 'HTTP_HEADER'¶
-
ACTION_IP_BASED_MAX_CONNECTIONS
= 'IP_BASED_MAX_CONNECTIONS'¶
-
ACTION_REDIRECT
= 'REDIRECT'¶
-
ACTION_REMOVE_HTTP_REQUEST_HEADER
= 'REMOVE_HTTP_REQUEST_HEADER'¶
-
ACTION_REMOVE_HTTP_RESPONSE_HEADER
= 'REMOVE_HTTP_RESPONSE_HEADER'¶
-
__init__
(**kwargs)¶ Initializes a new ControlAccessUsingHttpMethodsRule object with values from keyword arguments. The default value of the
action
attribute of this class isCONTROL_ACCESS_USING_HTTP_METHODS
and it should not be changed. The following keyword arguments are supported (corresponding to the getters/setters of this class):Parameters: - action (str) – The value to assign to the action property of this ControlAccessUsingHttpMethodsRule. Allowed values for this property are: “ADD_HTTP_REQUEST_HEADER”, “EXTEND_HTTP_REQUEST_HEADER_VALUE”, “REMOVE_HTTP_REQUEST_HEADER”, “ADD_HTTP_RESPONSE_HEADER”, “EXTEND_HTTP_RESPONSE_HEADER_VALUE”, “REMOVE_HTTP_RESPONSE_HEADER”, “ALLOW”, “CONTROL_ACCESS_USING_HTTP_METHODS”, “REDIRECT”, “HTTP_HEADER”, “IP_BASED_MAX_CONNECTIONS”
- allowed_methods (list[str]) – The value to assign to the allowed_methods property of this ControlAccessUsingHttpMethodsRule.
- status_code (int) – The value to assign to the status_code property of this ControlAccessUsingHttpMethodsRule.
-
action
¶ [Required] Gets the action of this Rule. Allowed values for this property are: “ADD_HTTP_REQUEST_HEADER”, “EXTEND_HTTP_REQUEST_HEADER_VALUE”, “REMOVE_HTTP_REQUEST_HEADER”, “ADD_HTTP_RESPONSE_HEADER”, “EXTEND_HTTP_RESPONSE_HEADER_VALUE”, “REMOVE_HTTP_RESPONSE_HEADER”, “ALLOW”, “CONTROL_ACCESS_USING_HTTP_METHODS”, “REDIRECT”, “HTTP_HEADER”, “IP_BASED_MAX_CONNECTIONS”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.
Returns: The action of this Rule. Return type: str
-
allowed_methods
¶ [Required] Gets the allowed_methods of this ControlAccessUsingHttpMethodsRule. The list of HTTP methods allowed for this listener.
By default, you can specify only the standard HTTP methods defined in the HTTP Method Registry. You can also see a list of supported standard HTTP methods in the Load Balancing service documentation at Managing Rule Sets.
Your backend application must be able to handle the methods specified in this list.
The list of HTTP methods is extensible. If you need to configure custom HTTP methods, contact My Oracle Support to remove the restriction for your tenancy.
Example: [“GET”, “PUT”, “POST”, “PROPFIND”]
Returns: The allowed_methods of this ControlAccessUsingHttpMethodsRule. Return type: list[str]
-
static
get_subtype
(object_dictionary)¶ Given the hash representation of a subtype of this class, use the info in the hash to return the class of the subtype.
-
status_code
¶ Gets the status_code of this ControlAccessUsingHttpMethodsRule. The HTTP status code to return when the requested HTTP method is not in the list of allowed methods. The associated status line returned with the code is mapped from the standard HTTP specification. The default value is 405 (Method Not Allowed).
Example: 403
Returns: The status_code of this ControlAccessUsingHttpMethodsRule. Return type: int
-