commit
748a524669
14
README.md
14
README.md
|
@ -40,5 +40,19 @@ $ s cli fc-remote-invoke invoke --region * --service-name * --function-name * --
|
|||
|
||||
当函数是 http 函数时,event最终获取值目前仅支持 json 字符串,[示例参考](https://github.com/devsapp/fc-remote-invoke/blob/master/example/http.json)
|
||||
|
||||
````
|
||||
{
|
||||
"body": "body",
|
||||
"method": "POST",
|
||||
"headers": {
|
||||
"key": "value"
|
||||
},
|
||||
"queries": {
|
||||
"key": "value"
|
||||
},
|
||||
"path": "string"
|
||||
}
|
||||
````
|
||||
|
||||
invocation-type 选填,默认 sync
|
||||
event 选填,event 函数默认为空字符串,http 函数默认 GET 请求,其他参数为空
|
|
@ -13,25 +13,25 @@ export default [
|
|||
{
|
||||
name: 'invocation-type',
|
||||
description: 'Invocation type: optional value "async"|"sync", default value "sync" (default: "sync")',
|
||||
alias: '-t',
|
||||
alias: 't',
|
||||
type: String,
|
||||
},
|
||||
{
|
||||
name: 'event',
|
||||
description: 'Event data (strings) passed to the function during invocation (default: "")',
|
||||
alias: '-e',
|
||||
description: 'Event data (strings) passed to the function during invocation (default: "").Http function format refers to [https://github.com/devsapp/fc-remote-invoke#特别说明]',
|
||||
alias: 'e',
|
||||
type: String,
|
||||
},
|
||||
{
|
||||
name: 'event-file',
|
||||
description: 'A file containing event data passed to the function during invoke.',
|
||||
alias: '-f',
|
||||
description: 'Event funtion: A file containing event data passed to the function during invoke. Http function: A file containing http request options sent to http trigger. Format refers to [https://github.com/devsapp/fc-remote-invoke#特别说明]',
|
||||
alias: 'f',
|
||||
type: String,
|
||||
},
|
||||
{
|
||||
name: 'event-stdin',
|
||||
description: 'Read from standard input, to support script pipeline.',
|
||||
alias: '-s',
|
||||
description: 'Read from standard input, to support script pipeline.Http function format refers to [https://github.com/devsapp/fc-remote-invoke#特别说明]',
|
||||
alias: 's',
|
||||
type: Boolean,
|
||||
},
|
||||
{
|
||||
|
@ -65,13 +65,17 @@ export default [
|
|||
{
|
||||
header: 'Examples with Yaml',
|
||||
content: [
|
||||
'$ s exec -- invoke <options>',
|
||||
'$ s exec -- invoke --invocation-type sync --event [payload]',
|
||||
'$ s exec -- invoke --invocation-type async --event-file [path]',
|
||||
'$ s exec -- invoke --event-stdin',
|
||||
],
|
||||
},
|
||||
{
|
||||
header: 'Examples with Cli',
|
||||
content: [
|
||||
'$ s cli fc-remote-invoke invoke --region * --service-name * --function-name * <options>',
|
||||
'$ s cli fc-remote-invoke invoke --region * --service-name * --function-name * --event [payload]',
|
||||
'$ s cli fc-remote-invoke invoke --region * --service-name * --function-name * --event-file [path]',
|
||||
'$ s cli fc-remote-invoke invoke --region * --service-name * --function-name * --event-stdin',
|
||||
],
|
||||
},
|
||||
]
|
|
@ -1,7 +1,7 @@
|
|||
import _ from 'lodash';
|
||||
import * as core from '@serverless-devs/core';
|
||||
import logger from './common/logger';
|
||||
import help from './common/help';
|
||||
import HELP from './common/help';
|
||||
import { InputProps, ICredentials, isProperties, IProperties } from './interface/entity';
|
||||
import RemoteInvoke from './lib/remote-invoke';
|
||||
|
||||
|
@ -103,10 +103,11 @@ export default class FcRemoteInvoke {
|
|||
isHelp,
|
||||
invocationType,
|
||||
} = await this.handlerInputs(inputs);
|
||||
// await this.report('fc-remote-invoke', 'invoke', credentials?.AccountID);
|
||||
await this.report('fc-remote-invoke', 'invoke', credentials?.AccountID);
|
||||
|
||||
if (isHelp) {
|
||||
core.help(help)
|
||||
console.log('??');
|
||||
core.help(HELP);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue