<#1762 [Plugin]New plugin to invoke a simple REST ...
# flyte-github
c
#1762 [Plugin]New plugin to invoke a simple REST WebAPI sync Issue created by kumare3 ### Motivation: Why do you think this is important? FlytePlugins provides a simple way to invoke a WebAPI synchronously. Adding a simple plugin that can invoke a REST WebAPI (without auth) may open up a lot of new use-cases. Also the API should have a corresponding Python API of the form
Copy code
@dataclass
class Outputs():
   ...


t1 = SyncRestAPI(
            url="https://mydomain/xyz?params={{.inputs.x}}&params={{.inputs.y}}",
            inputs=kwargs(x=int,y=int),
            outputs=Outputs,
            timeout=30s,
            retries=3,
           caching....,
)

@workflow
def foo():
    t1(x=...)
the backend plugin can be a simple HTTP Rest call invoker, that passes a json input and receives a json input. this plugin can implement the following API https://github.com/flyteorg/flyteplugins/blob/master/go/tasks/pluginmachinery/webapi/plugin.go#L148-L154 It is important to handle timeouts, retries, http error codes etc. Outputs can be either a complex JSON or maybe a single item or map etc ### Goal: What should the final outcome look like, ideally? Explained above ### Describe alternatives you've considered using python to invoke and write an API called. This is very expensive owing to the fact of starting a pod. ### Propose: Link/Inline OR Additional context No response ### Are you sure this issue hasn't been raised already? • Yes ### Have you read the Code of Conduct? • Yes flyteorg/flyte