-
Notifications
You must be signed in to change notification settings - Fork 24
Support serverless invoke
#86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
I would love this one to land, thanks for the effort you put into it! |
invoke/scalewayInvoke.js
Outdated
| api, | ||
| ); | ||
|
|
||
| // Interrogate config to see if we're invoking a container or a function |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@RamyChaabane as discussed offline, I'll add a validation step before this, to throw an error if the function name is not mentioned at all in the serverless config file.
invoke/scalewayInvoke.js
Outdated
| function validateFunction() { | ||
| // Here we check that the function is both specified, and defined as either a function or container | ||
| if(!this.options.function) { | ||
| const msg = 'Function not specified'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function or Container not specfied
invoke/scalewayInvoke.js
Outdated
| this.isFunction = this.isDefinedFunction(this.options.function); | ||
|
|
||
| if(!this.isContainer && !this.isFunction) { | ||
| const msg = `Function ${this.options.function} not defined in servleress.yml`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function or Container
invoke/scalewayInvoke.js
Outdated
| } | ||
| } | ||
|
|
||
| function lookUpFunction(ns) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lookUpFunctionOrContainer(ns)
invoke/scalewayInvoke.js
Outdated
| this.isContainer = false; | ||
| this.isFunction = false; | ||
|
|
||
| function validateFunction() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
validateFunctionOrContainer
Add support for
serverless invokecommand, similar to AWS example.Changes:
invokeand update tests to useinvokerather than hitting HTTP endpoints.teststoshared, and add tests.