RequestAction (autotransform.step.action.request)¶
The implementation of RequestAction.
- class autotransform.step.action.request.RequestAction(*, url: str, data: Mapping[str, Any] = None, headers: Mapping[str, Any] = None, log_response: bool = False, params: Mapping[str, Any] = None, post: bool = True)¶
Bases:
Action
Performs a URL request for a Change. Used for interacting with REST APIs.
- url¶
The URL to send a request to.
- Type:
str
- data¶
Data to include in the request. Defaults to {}.
- Type:
optional, Mapping[str, Any]
- headers¶
Headers to include in the request. Defaults to {}.
- Type:
optional, Mapping[str, Any]
- log_response¶
Indicates whether to log the response using DebugEvent. Defaults to False.
- Type:
optional, bool
- params¶
Params to include in the request. Defaults to {}.
- Type:
optional, Mapping[str, Any]
- post¶
Whether to send the request as a POST. Defaults to True.
- Type:
optional, bool
- name¶
The name of the component.
- Type:
ClassVar[ActionName]
- data: Mapping[str, Any]¶
- headers: Mapping[str, Any]¶
- log_response: bool¶
- name: ClassVar[ActionName] = 'request'¶
- params: Mapping[str, Any]¶
- post: bool¶
- run(change: Change) bool ¶
Performs a REST API request for a Change.
- Parameters:
change (Change) – The Change to perform the request on.
- Returns:
Whether the request returned a non-error response.
- Return type:
bool
- url: str¶