RequestAction (autotransform.step.action.request)
The implementation of RequestAction.
- class autotransform.step.action.request.RequestAction(*, url: str, data: ~typing.Mapping[str, ~typing.Any] = <factory>, headers: ~typing.Mapping[str, ~typing.Any] = <factory>, log_response: bool = False, params: ~typing.Mapping[str, ~typing.Any] = <factory>, post: bool = True)
Bases:
ActionPerforms 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
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- 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