Run remote

Purpose: Call a remote service in a single statement.

 run-remote <service> \
     ( local <app name> ) | ( location <location> ) \
     url-path <service URL> |
         ( \
         app-path <app path> \
         request-path <request path> \
         [ url-params <url params> ] \
         ) \
     [ request-body content <content> \
         [ content-length <content length> ] \
         [ content-type <content type> ] ] \
     [ method <request method> ] \
     [ environment <name>=<value> [ , ... ] ] \
     [ timeout <timeout> ]\
     [ status <status> ]  \
     [ started <started> ] \
     [ finished-okay <finished okay> ]\
     [ data <data> ] \
     [ error <error> ] \
     [ status <status> ] \
     [ status-text <status text> ] \
     [ handler-status <service status> ]


run-remote is a combination of new-remote, call-remote and read-remote in one. Clauses for each of those can be specified in any order. Only a single <service> can be used. If a call to <service> succeeds, its results are read. Use either:
See details for each clause in new-remote (for "local" through "timeout" clauses), call-remote (for "status" through "finished-okay" clauses) and read-remote (for "data" through "handler-status" clauses).
Examples
 begin-handler /serv public
     run-remote nf local "hash-server-yey" \
         url-path "/hash-server-yey/server/op=add/key=sb_XYZ/data=sdb_123" \
         finished-okay sfok \
         data rdata error edata  \
         status st handler-status rstatus
     if-true sfok  not-equal  1 or st  not-equal  GG_OKAY
         @Call did not succeed
     else-if
         @Result is <<p-out rdata> and (any) error is <<p-out edata>>
     end-if

 end-handler

See also
Distributed computing
call-remote  
new-remote  
read-remote  
run-remote  
See all
documentation


Copyright (c) 2019-2024 Gliim LLC. All contents on this web site is "AS IS" without warranties or guarantees of any kind.