Created
May 28, 2020 18:53
-
-
Save hammertoe/4f3409dad274162c0b0180d140387d11 to your computer and use it in GitHub Desktop.
Example of some IBM Cloud Function commands
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A simple hello world function | |
% cat hello.py | |
def main(args): | |
name = args.get("name", "unknown") | |
return {"message": f"Hello {name}!"} | |
# create an action | |
% ic fn action create hello hello.py | |
ok: created action hello | |
# list actions | |
% ic fn action list | |
actions | |
/[email protected]_dev/hello private python:3.7 | |
# invoke a function | |
% ic fn action invoke hello -r | |
{ | |
"message": "Hello unknown!" | |
} | |
# Update a function | |
% ic fn action update hello hello.py | |
ok: updated action hello | |
# Delete a function | |
% ic fn action delete hello | |
ok: deleted action hello | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment