Difference between revisions of "Run command Api config"
Pavel.lobko (talk | contribs) (Created page with " ;Step 1 :Register two users on IBM i. ;Step 2 :Contact your system administrator for your IBM i server host name (or IP) and ''two'' available ports for "main" and "manageme...") |
Pavel.lobko (talk | contribs) |
||
Line 1: | Line 1: | ||
− | + | {{DISPLAYTITLE:How to allow calls to run_command API}} | |
+ | This API allows you to call IBM i commands. It is required to obtain OAuth2 token with run_command scope to call IBM i programs. | ||
;Step 1 | ;Step 1 | ||
Line 15: | Line 16: | ||
<span style="background:#e3f6d0;"> "OAuth2": | <span style="background:#e3f6d0;"> "OAuth2": | ||
{ | { | ||
− | "scopes": {" | + | "scopes": {"run_command" : {"description":""} |
}, | }, | ||
"users": | "users": | ||
{ | { | ||
− | "<span style="color:#22d3d3;">USRX</span>":{"description":"<span style="color:#22d3d3;">John Johnes</span>","valid_clients":{"<span style="color:#22d3d3;">TSTCLNT</span>":{"scopes":[" | + | "<span style="color:#22d3d3;">USRX</span>":{"description":"<span style="color:#22d3d3;">John Johnes</span>","valid_clients":{"<span style="color:#22d3d3;">TSTCLNT</span>":{"scopes":["run_command"]}}} |
}, | }, | ||
"clients": | "clients": | ||
Line 25: | Line 26: | ||
"<span style="color:#22d3d3;">TSTCLNT</span>":{"redirect_uri":"<span style="color:#22d3d3;"><main gate URL></span>/oauth2/redirect", | "<span style="color:#22d3d3;">TSTCLNT</span>":{"redirect_uri":"<span style="color:#22d3d3;"><main gate URL></span>/oauth2/redirect", | ||
"description":"Test client", | "description":"Test client", | ||
− | "valid_scopes":[" | + | "valid_scopes":["run_command"], |
"valid_grant_types":["authorization_code"]} | "valid_grant_types":["authorization_code"]} | ||
}, | }, |
Revision as of 17:07, 30 June 2020
This API allows you to call IBM i commands. It is required to obtain OAuth2 token with run_command scope to call IBM i programs.
- Step 1
- Register two users on IBM i.
- Step 2
- Contact your system administrator for your IBM i server host name (or IP) and two available ports for "main" and "management" gates of your first i2Rest Server instance. Create file config.json (you can name it with any name and put it into any available IFS folder). Enter following text, replace host_name, ports, user (must be a regestered IBM i user) and client (must be a regestered IBM i user) with appropriate values.
Basic configuration management API variant (differences are highlighted in green):
{ "gates": { "main" : {"url":"http://<host_name>[:port] (for example api.i2rest.com:1234)"}, "management" : {"url":"http://<host_name>[:port] (for example api.i2rest.com:4321)"} }, "OAuth2": { "scopes": {"run_command" : {"description":""} }, "users": { "USRX":{"description":"John Johnes","valid_clients":{"TSTCLNT":{"scopes":["run_command"]}}} }, "clients": { "TSTCLNT":{"redirect_uri":"<main gate URL>/oauth2/redirect", "description":"Test client", "valid_scopes":["run_command"], "valid_grant_types":["authorization_code"]} }, "tokens": {"type":"token"},"codes":{"type":"code"} } }