ReturnHttpResponseAction¶
-
class
oci.waf.models.
ReturnHttpResponseAction
(**kwargs)¶ Bases:
oci.waf.models.action.Action
An object that represents an action which returns a defined HTTP response.
Attributes
TYPE_ALLOW
str(object=’’) -> str TYPE_CHECK
str(object=’’) -> str TYPE_RETURN_HTTP_RESPONSE
str(object=’’) -> str body
Gets the body of this ReturnHttpResponseAction. code
[Required] Gets the code of this ReturnHttpResponseAction. headers
Gets the headers of this ReturnHttpResponseAction. name
[Required] Gets the name of this Action. type
[Required] Gets the type of this Action. Methods
__init__
(**kwargs)Initializes a new ReturnHttpResponseAction 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. -
TYPE_ALLOW
= 'ALLOW'¶
-
TYPE_CHECK
= 'CHECK'¶
-
TYPE_RETURN_HTTP_RESPONSE
= 'RETURN_HTTP_RESPONSE'¶
-
__init__
(**kwargs)¶ Initializes a new ReturnHttpResponseAction object with values from keyword arguments. The default value of the
type
attribute of this class isRETURN_HTTP_RESPONSE
and it should not be changed. The following keyword arguments are supported (corresponding to the getters/setters of this class):Parameters: - type (str) – The value to assign to the type property of this ReturnHttpResponseAction. Allowed values for this property are: “CHECK”, “ALLOW”, “RETURN_HTTP_RESPONSE”
- name (str) – The value to assign to the name property of this ReturnHttpResponseAction.
- code (int) – The value to assign to the code property of this ReturnHttpResponseAction.
- headers (list[oci.waf.models.ResponseHeader]) – The value to assign to the headers property of this ReturnHttpResponseAction.
- body (oci.waf.models.HttpResponseBody) – The value to assign to the body property of this ReturnHttpResponseAction.
-
body
¶ Gets the body of this ReturnHttpResponseAction.
Returns: The body of this ReturnHttpResponseAction. Return type: oci.waf.models.HttpResponseBody
-
code
¶ [Required] Gets the code of this ReturnHttpResponseAction. Response code.
The following response codes are valid values for this property:
2xx
200 OK 201 Created 202 Accepted 206 Partial Content
3xx
300 Multiple Choices 301 Moved Permanently 302 Found 303 See Other 307 Temporary Redirect
4xx
400 Bad Request 401 Unauthorized 403 Forbidden 404 Not Found 405 Method Not Allowed 408 Request Timeout 409 Conflict 411 Length Required 412 Precondition Failed 413 Payload Too Large 414 URI Too Long 415 Unsupported Media Type 416 Range Not Satisfiable 422 Unprocessable Entity 429 Too Many Requests 494 Request Header Too Large 495 Cert Error 496 No Cert 497 HTTP to HTTPS
5xx
500 Internal Server Error 501 Not Implemented 502 Bad Gateway 503 Service Unavailable 504 Gateway Timeout 507 Insufficient Storage
Example: 200
Returns: The code of this ReturnHttpResponseAction. Return type: int
-
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.
-
headers
¶ Gets the headers of this ReturnHttpResponseAction. Adds headers defined in this array for HTTP response.
Hop-by-hop headers are not allowed to be set:
- Connection
- Keep-Alive
- Proxy-Authenticate
- Proxy-Authorization
- TE
- Trailer
- Transfer-Encoding
- Upgrade
Returns: The headers of this ReturnHttpResponseAction. Return type: list[oci.waf.models.ResponseHeader]
-
name
¶ [Required] Gets the name of this Action. Action name. Can be used to reference the action.
Returns: The name of this Action. Return type: str
-
type
¶ [Required] Gets the type of this Action. * CHECK is a non-terminating action that does not stop the execution of rules in current module,
just emits a log message documenting result of rule execution.- ALLOW is a non-terminating action which upon matching rule skips all remaining rules in the current module.
- RETURN_HTTP_RESPONSE is a terminating action which is executed immediately, returns a defined HTTP response.
Allowed values for this property are: “CHECK”, “ALLOW”, “RETURN_HTTP_RESPONSE”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.
Returns: The type of this Action. Return type: str
-