+ All Categories
Home > Documents > CLI Command Reference

CLI Command Reference

Date post: 12-Nov-2021
Category:
Upload: others
View: 45 times
Download: 0 times
Share this document with a friend
22
FunctionStage CLI Command Reference Issue 02 Date 2018-05-22 HUAWEI TECHNOLOGIES CO., LTD.
Transcript
Page 1: CLI Command Reference

FunctionStage

CLI Command Reference

Issue 02

Date 2018-05-22

HUAWEI TECHNOLOGIES CO., LTD.

Page 2: CLI Command Reference

Copyright © Huawei Technologies Co., Ltd. 2018. All rights reserved.No part of this document may be reproduced or transmitted in any form or by any means without prior writtenconsent of Huawei Technologies Co., Ltd. Trademarks and Permissions

and other Huawei trademarks are trademarks of Huawei Technologies Co., Ltd.All other trademarks and trade names mentioned in this document are the property of their respectiveholders. NoticeThe purchased products, services and features are stipulated by the contract made between Huawei and thecustomer. All or part of the products, services and features described in this document may not be within thepurchase scope or the usage scope. Unless otherwise specified in the contract, all statements, information,and recommendations in this document are provided "AS IS" without warranties, guarantees orrepresentations of any kind, either express or implied.

The information in this document is subject to change without notice. Every effort has been made in thepreparation of this document to ensure accuracy of the contents, but all statements, information, andrecommendations in this document do not constitute a warranty of any kind, express or implied.

Huawei Technologies Co., Ltd.Address: Huawei Industrial Base

Bantian, LonggangShenzhen 518129People's Republic of China

Website: http://e.huawei.com

Issue 02 (2018-05-22) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

i

Page 3: CLI Command Reference

Contents

1 Introduction to the CLI Tool....................................................................................................... 1

2 Function-related Commands....................................................................................................... 3

3 Alias-related Commands............................................................................................................10

4 Trigger-related Commands........................................................................................................13

5 Invocation Commands................................................................................................................16

6 Command Description............................................................................................................... 18

FunctionStageCLI Command Reference Contents

Issue 02 (2018-05-22) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

ii

Page 4: CLI Command Reference

1 Introduction to the CLI Tool

FunctionStage provides the command line interface (CLI) tool for you to manage functions,triggers, and aliases, and invoke functions.

Downloading the CLI ToolThe CLI tool can run on a 64-bit Linux operating system (OS) or 64-bit Windows OS. Table1-1 provides the download links of this tool.

Table 1-1 Download links of the CLI tool

OS Download Link MD5 Verification Code

Linux CLI tool 7e8366dafdbff627309c83739be3ff4f

Windows CLI tool 4d97cc9d795ed24ec9785ff73cfd0dd5

Toolkit DescriptionAfter downloading a CLI toolkit, unzip it. Files included in the toolkit are listed in Table 1-2.

Table 1-2 File description

File Description

config.yaml Configuration file. For details, seeConfiguring the CLI Tool.

fss Executable file

README.md Readme file

Configuring the CLI ToolBefore using the CLI tool, configure the user information in the config.yaml file. Table 1-3describes the configuration options contained in this file.

FunctionStageCLI Command Reference 1 Introduction to the CLI Tool

Issue 02 (2018-05-22) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

1

Page 5: CLI Command Reference

Table 1-3 Configuration options

ConfigurationOption

Description Acquisition Method

AccessKey Access key ID (AK) For details, see Managing AccessKeys.

SecretKey Secret access key (SK) For details, see Managing AccessKeys.

RegionName Region in whichFunctionStage resides

For details, see Availability Zone.

ProjectName Name of the project to whichFunctionStage belongs

For details, see Querying a ProjectID.

ProjectId ID of the project to whichFunctionStage belongs

For details, see Querying a ProjectID.

Timeout Timeout of CLI commands.The default value is 30s andthe maximum value is 90s.

Set this option as required.

Endpoint Address of the API Gateway(APIG) service, which is abackend service ofFunctionStage

The address varies depending on theregion. For example, the APIG addressof FunctionStage in North China ishttps://fss-api.cnnorth-1.myhwclouds.com.

IAMAddress Address of the Identity andAccess Management (IAM)node

For details, see Regions andEndpoints.

WARNINGl When you access HUAWEI CLOUD through an API, you must complete AK/SK identity

authentication with the access request encrypted, and ensure that the access request issecret, complete, and correct. Please keep the config.yaml file properly to preventunauthorized use of your access key.

l If your access key is used by an unauthorized person (due to a loss or leakage), you candelete the access key or notify the administrator of resetting it and configure it again.

l A deleted access key cannot be restored. Exercise caution when deleting the access key.

PrecautionsThis document uses Linux as an example to describe all commands.

FunctionStageCLI Command Reference 1 Introduction to the CLI Tool

Issue 02 (2018-05-22) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

2

Page 6: CLI Command Reference

2 Function-related Commands

Creating a FunctionRun the create-function command to create a function. This command can be triggered usingalias cf. The command syntax is as follows:

fss create-function --func-name <function-name> --code-type <inline/zip/jar/obs> --handler<handler-value> --runtime <runtime-value> --file <filename> [(optional-flags)]

Table 2-1 lists the options in this command.

Table 2-1 Options in the command used for creating a function

Option Abbreviation Description Mandatory

--func-name value -n value Name of thefunction to becreated

Yes

--code-type value -t value Code entry mode.Options: inline, zip,jar, and obs.

Yes

--handler value -c value Handler of afunctionNOTE

For a Go function,the initial of thefunction name of thehandler must becapitalized.

Yes

--runtime value -r value Runtime. Options:Python2.7,Python3.6,Node.js6.10, Java8,and Go1.8.

Yes

FunctionStageCLI Command Reference 2 Function-related Commands

Issue 02 (2018-05-22) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

3

Page 7: CLI Command Reference

Option Abbreviation Description Mandatory

--file value -f value Name of a codepackage. The size ofa code packagecannot exceed 20MB.

Yes

--memory-size value -m value Memory. Thedefault value is 128MB.

No

--timeout value --to value Timeout for functionexecution. Thedefault value is 3s.

No

--code-url value -l value URL of a codepackage

No

--description value -d value Function description No

--user-data value -u value Environmentvariable

No

--xrole value -x value Agency No

--publish --pf Creates andpublishes a function.

No

NOTE

If the function needs to invoke other cloud services, such as Distributed Message Service (DMS) andData Ingestion Service (DIS), set the xrole parameter.

The following is an example for creating a Python function with inline code:

./fss cf -n clitest2 -t inline -c python.handler -r Python2.7 -f python_code.py -x servicestage_admin_trust

The following in an example for creating a Java function:

./fss cf -n clitest3 -t jar -c index.handler -r Java8 -f java_code.jar -x servicestage_admin_trust

Deleting a FunctionRun the delete function command to delete a function. This command can be triggered usingalias df. The command syntax is as follows:

fss delete-function --func-urn <function-urn>

Table 2-2 lists the option in this command.

FunctionStageCLI Command Reference 2 Function-related Commands

Issue 02 (2018-05-22) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

4

Page 8: CLI Command Reference

Table 2-2 Option in the command used for deleting a function

Option Abbreviation Description Mandatory

--func-urn value --fu value URN of the functionto be deleted. AURN can be acombination ofdifferent fields. Fordetails, seeDescription of aFunction URN.

Yes

Example command:

./fss df --fu urn:fss:kweci03rg00fsp:7aad83af3e8d42e99ac194e8419e2c9b:function:default:clitest3

Obtaining the Code of a FunctionRun the get-function-code command to obtain the code of a function. This command can betriggered using alias gf. The command syntax is as follows:

fss get-function-code --func-urn <function-urn>

Table 2-3 lists the option in this command.

Table 2-3 Option in the command used for obtaining the code of a function

Option Abbreviation Description Mandatory

--func-urn value --fu value URN of a function Yes

Example command:

./fss gf --fu urn:fss:kweci03rg00fsp:7aad83af3e8d42e99ac194e8419e2c9b:function:default:clitest1

Obtaining the Configuration of a CommandRun the get-function-config command to obtain the configuration of a function. Thiscommand can be triggered using alias gc. The command syntax is as follows:

fss get-function-config --func-urn <function-urn>

Table 2-4 lists the option in this command.

Table 2-4 Option in the command used for obtaining the configuration of a function

Option Abbreviation Description Mandatory

--func-urn value --fu value URN of a function Yes

FunctionStageCLI Command Reference 2 Function-related Commands

Issue 02 (2018-05-22) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

5

Page 9: CLI Command Reference

Example command:

./fss gc --fu urn:fss:kweci03rg00fsp:7aad83af3e8d42e99ac194e8419e2c9b:function:default:clitest1

Obtaining a Function List

Run the list-functions command to obtain a function list. This command can be triggeredusing alias lf. The command syntax is as follows:

fss list-functions [--marker <start-marker>, --max-items <count>]

Table 2-5 lists the options in this command.

Table 2-5 Options in the command used for obtaining a function list

Option Abbreviation Description Mandatory

--marker value -m value Start mark of afunction list. Thedefault value is 1.

No

--max-items value -c value Number of functionsin a function list.The default value is10.

No

Example command:

./fss lf -m 11 -c 3

Querying Function Versions

Run the list-function-versions command to query the versions of a function. This commandcan be triggered using alias lv. The command syntax is as follows:

fss list-function-versions --func-urn <function-urn> [--marker <start-marker>, --max-items<count>]

Table 2-6 lists the options in this command.

Table 2-6 Options in the command used for querying function versions

Option Abbreviation Description Mandatory

--func-urn value --fu value URN of a function Yes

--marker value -m value Start mark of afunction list. Thedefault value is 1.

No

FunctionStageCLI Command Reference 2 Function-related Commands

Issue 02 (2018-05-22) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

6

Page 10: CLI Command Reference

Option Abbreviation Description Mandatory

--max-items value -c value Number of functionsin a function list.The default value is10.

No

Example command:

./fss lv --fu urn:fss:kweci03rg00fsp:7aad83af3e8d42e99ac194e8419e2c9b:function:default:clitest1

Modifying Function Code

Run the update-function command to update the code of a function. This command can betriggered using alias uf. The command syntax is as follows:

fss update-function-code --func-urn <function-urn> --code-type <inline/zip/jar/obs> --handler<handler-value> --runtime <runtime-value> [--file <filename> or --code-url <url-of-code-location> --publish]

Table 2-7 lists the options in this command.

Table 2-7 Options in the command used for modifying function code

Option Abbreviation Description Mandatory

--func-urn value --fu value URN of a function Yes

--code-type value -t value Code entry mode.Options: inline, zip,jar, and obs.

Yes

--handler value -c value Handler of afunctionNOTE

For a Go function,the initial of thefunction name of thehandler must becapitalized.

Yes

--runtime value -r value Runtime. Options:Python3.6,Python2.7,Node.js6.10, Java8,and Go1.8

Yes

--file value -f value Name of a codepackage. The size ofa code packagecannot exceed 20MB.

Yes

FunctionStageCLI Command Reference 2 Function-related Commands

Issue 02 (2018-05-22) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

7

Page 11: CLI Command Reference

Option Abbreviation Description Mandatory

--code-url value -l value URL of a codepackage

No

--publish --pf Creates andpublishes a function.

No

Example command:

./fss uf -fu urn:fss:kweci03rg00fsp:7aad83af3e8d42e99ac194e8419e2c9b:function:default:clitest1 -t inline -f python_code2.py

Modifying Function Configuration

Run the update-function-config command to update the configuration of a function. Thiscommand can be triggered using alias uc. The command syntax is as follows:

fss update-function-config --func-urn <function-urn> [--memory-size <memory-size-value>--timeout <timeout-value> --user-data <user-data-value> --xrole <xole-value> --description<description-value>]

Table 2-8 lists the options in this command.

Table 2-8 Options in the command used for modifying the configuration of a function

Option Abbreviation Description Mandatory

--func-urn value --fu value URN of a function Yes

--memory-size value -m value Memory. Thedefault value is 128MB.

No

--timeout value --to value Timeout for functionexecution. Thedefault value is 3s.

No

--user-data value -u value Environmentvariable

No

--xrole value -x value Agency No

--description value -d value Function description No

Example command:

./fss uc --fu urn:fss:kweci03rg00fsp:7aad83af3e8d42e99ac194e8419e2c9b:function:default:clitest1 -r python2.7 -ha python.handler

FunctionStageCLI Command Reference 2 Function-related Commands

Issue 02 (2018-05-22) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

8

Page 12: CLI Command Reference

Publishing a Function VersionRun the publish-version command to publish a function version. This command can betriggered using alias pv. The command syntax is as follows:

fss publish-version --func-urn <func-urn-value> [--code-digest <code-digest of Functionversion> --description <func-publish-description>]

Table 2-9 lists the options in this command.

Table 2-9 Options in the command used for publishing a function version

Option Abbreviation Description Mandatory

--func-urn value --fu value URN of a function Yes

--code-digest value --pc value Code digest of thefunction version tobe published

Yes

--description value -d value Description of afunction version

No

Example command:

./fss pv --fu urn:fss:kweci03rg00fsp:7aad83af3e8d42e99ac194e8419e2c9b:function:default:clitest1

FunctionStageCLI Command Reference 2 Function-related Commands

Issue 02 (2018-05-22) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

9

Page 13: CLI Command Reference

3 Alias-related Commands

Creating an Alias

Run the create-alias command to create an alias for a function. This command can betriggered using alias ca. The command syntax is as follows:

fss create-alias --func-urn <func-urn-value> --name <func-alias-name> --version <func-alias-version> [--description <func-alias-description>]

Table 3-1 lists the options in this command.

Table 3-1 Options in the command used for creating an alias

Option Abbreviation Description Mandatory

--func-urn value --fu value URN of a function Yes

--name value --an value Alias Yes

--version value --fv value Function version Yes

--description value --ad value Alias description No

Example command:

./fss ca --fu urn:fss:kweci03rg00fsp:7aad83af3e8d42e99ac194e8419e2c9b:function:default:clitest1 --an clitestalias1 --fv latest

Deleting an Alias

Run the delete-alias command to delete an alias of a function. This command can betriggered using alias da. The command syntax is as follows:

fss delete-alias --func-urn <func-urn-value> --name <func-alias-name>

Table 3-2 lists the options in this command.

FunctionStageCLI Command Reference 3 Alias-related Commands

Issue 02 (2018-05-22) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

10

Page 14: CLI Command Reference

Table 3-2 Options in the command used for deleting an alias

Option Abbreviation Description Mandatory

--func-urn value --fu value URN of a function Yes

--name value --an value Alias Yes

Example command:

./fss da --fu urn:fss:kweci03rg00fsp:7aad83af3e8d42e99ac194e8419e2c9b:function:default:clitest1 --an clitestalias2

Querying an Alias

Run the get-alias command to query an alias of a function. This command can be triggeredusing alias ga. The command syntax is as follows:

fss get-alias --func-urn <func-urn-value> --name <func-alias-name>

Table 3-3 lists the options in this command.

Table 3-3 Options in the command used for querying a function alias

Option Abbreviation Description Mandatory

--func-urn value --fu value URN of a function Yes

--name value --an value Alias Yes

Example command:

./fss ga --fu urn:fss:kweci03rg00fsp:7aad83af3e8d42e99ac194e8419e2c9b:function:default:clitest1 --an clitestalias1

Obtaining an Alias List

Run the list-aliases command to obtain the alias list of a function. This command can betriggered using alias la. The command syntax is as follows:

fss list-aliases --func-urn <func-urn-value>

Table 3-4 lists the option in this command.

Table 3-4 Option in the command used for obtaining the alias list of a function

Option Abbreviation Description Mandatory

--func-urn value --fu value URN of a function Yes

FunctionStageCLI Command Reference 3 Alias-related Commands

Issue 02 (2018-05-22) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

11

Page 15: CLI Command Reference

Example command:

./fss la --fu urn:fss:kweci03rg00fsp:7aad83af3e8d42e99ac194e8419e2c9b:function:default:clitest1

Modifying an AliasRun the update-alias command to modify an alias of a function. This command can betriggered using alias ua. The command syntax is as follows:

fss update-alias --func-urn <func-urn-value> --name <func-alias-name> --version <func-alias-version> [--description <func-alias-description>]

Table 3-5 lists the options in this command.

Table 3-5 Options in the command used for modifying an alias

Option Abbreviation Description Mandatory

--func-urn value --fu value URN of a function Yes

--name value --an value Alias Yes

--version value --fv value Function version Yes

--description value --ad value Alias description No

Example command:

./fss ua --fu urn:fss:kweci03rg00fsp:7aad83af3e8d42e99ac194e8419e2c9b:function:default:clitest1 --an clitestalias1 --fv latest

FunctionStageCLI Command Reference 3 Alias-related Commands

Issue 02 (2018-05-22) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

12

Page 16: CLI Command Reference

4 Trigger-related Commands

Creating a TriggerRun the create-trigger command to create a trigger for a function. This command can betriggered using alias ct. The command syntax is as follows:

fss create-trigger --func-urn <func-urn-value> --trigger-type-code <trigger-type-value> --event-type-code <event-type-value> --event-data <event-data-value>

Table 4-1 lists the options in this command.

Table 4-1 Options in the command used for creating a trigger

Option Abbreviation Description Mandatory

--func-urn value --fu value URN of the functionfor which you willcreate a trigger

Yes

--trigger-type-codevalue

--tt value Trigger type.Options: DMS andDIS.

Yes

--event-type-codevalue

--te value Event type of atrigger. The defaultvalue isMessageCreated.

Yes

--event-data value --td value Triggerconfiguration, whichmust be in JSONformat

Yes

NOTE

Currently, only DMS and DIS triggers can be created using this command.

Format of a DIS trigger:

'{"stream_name":"","shard_iterator_type":"","batch_size":0,"polling_interval":0}'

FunctionStageCLI Command Reference 4 Trigger-related Commands

Issue 02 (2018-05-22) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

13

Page 17: CLI Command Reference

Options of shard_iterator_type: LATEST and TRIM_HORIZON

Options of auth_provider: Huawei cloud platform and Huawei IAM authentication

Example command for creating a DMS trigger:

./fss --fu testCLI --tt DMS --te "MessageCreated" --td {"queue_id":"95a8c840-e0f6-4a6f-b4f3-7ce35578388c","consumer_group_id":"g-0ab7ee83-fcaf-4284-be2c-92d1108cbf3f","polling_interval":22}

Deleting a Trigger

Run the delete-trigger command to delete a trigger of a function. This command can betriggered using alias dt. The command syntax is as follows:

fss delete-trigger --func-urn <func-urn-value> --trigger-type-code <trigger-type-value> --trigger-id <trigger-id-value>

Table 4-2 lists the options in this command.

Table 4-2 Options in the command used for deleting a trigger

Option Abbreviation Description Mandatory

--func-urn value --fu value URN of the functionof which you willdelete a trigger

Yes

--trigger-type-codevalue

--tt value Trigger type.Options:DMS and DIS

Yes

--trigger-id value --ti value Trigger ID Yes

Example command for deleting a DMS trigger:

./fss dt --fu testCLI --tt DMS --ti 720e27a9-4152-4c5f-973e-f19c1b620f66

Querying a Trigger

Run the get-trigger command to query the details about a trigger of a function. Thiscommand can be triggered using alias gt. The command syntax is as follows:

fss get-trigger --func-urn <func-urn-value> --trigger-type-code <trigger-type-value> --trigger-id <trigger-id-value>

Table 4-3 lists the options in this command.

Table 4-3 Options in the command used for querying a trigger

Option Abbreviation Description Mandatory

--func-urn value --fu value URN of a function Yes

FunctionStageCLI Command Reference 4 Trigger-related Commands

Issue 02 (2018-05-22) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

14

Page 18: CLI Command Reference

Option Abbreviation Description Mandatory

--trigger-type-codevalue

--tt value Trigger type.Options:DMS, DIS, andSMN

Yes

--trigger-id value --ti value Trigger ID Yes

Example command for querying a trigger:

./fss gt --fu testCLI --tt DMS --ti 720e27a9-4152-4c5f-973e-f19c1b620f66

Obtaining a Trigger ListRun the list-triggers command to list all the triggers of a function. This command can betriggered using alias lt. The command syntax is as follows:

fss list-triggers --func-urn <func-urn-value>

Table 4-4 lists the option in this command.

Table 4-4 Option in the command used for obtaining the trigger list of a function

Option Abbreviation Description Mandatory

--func-urn value --fu value URN of a function Yes

Example command:

./fss lt --fu urn:fss:kweci03rg00fsp:7aad83af3e8d42e99ac194e8419e2c9b:function:default:clitest1

FunctionStageCLI Command Reference 4 Trigger-related Commands

Issue 02 (2018-05-22) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

15

Page 19: CLI Command Reference

5 Invocation Commands

The rules of CLI commands are consistent in different OSs, but the format of JSONparameters entered in the CLI varies depending on the OS. This section describes thecommand operations in Linux OS. For command operations in other OSs, see CommandDescription.

Synchronously Invoking a FunctionRun the invoke command to synchronously invoke a function. This command can betriggered using alias if. The command syntax is as follows:

fss invoke --func-urn <func-urn-value> --event-data <event-data-value>

Table 5-1 lists the options in this command.

Table 5-1 Options in the command used for synchronously invoking a function

Option Abbreviation Description Mandatory

--func-urn value --fu value URN of the functionto be invoked

Yes

--event-data value --ed value Event parameter tobe transmitted whena function is invoked

Yes

Example command:

./fss if --fu urn:fss:kweci03rg00fsp:7aad83af3e8d42e99ac194e8419e2c9b:function:default:clitest1 --ed '{"Name":"sererless"}'

Asynchronously Invoking a FunctionRun the invoke-async command to asynchronously invoke a function. This command can betriggered using alias ia. The command syntax is as follows:

fss invoke-async --func-urn <func-urn-value> --event-data <event-data-value>

Table 5-2 lists the options in this command.

FunctionStageCLI Command Reference 5 Invocation Commands

Issue 02 (2018-05-22) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

16

Page 20: CLI Command Reference

Table 5-2 Options in the command used for asynchronously invoking a function

Option Abbreviation Description Mandatory

--func-urn value --fu value URN of a function Yes

--event-data value --ed value Event parameter tobe transmitted whena function is invoked

Yes

Example command:

./fss ia --fu urn:fss:kweci03rg00fsp:7aad83af3e8d42e99ac194e8419e2c9b:function:default:clitest1 --ed '{"Name":"sererless"}'

FunctionStageCLI Command Reference 5 Invocation Commands

Issue 02 (2018-05-22) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

17

Page 21: CLI Command Reference

6 Command Description

In addition to the preceding command rules, pay attention to the descriptions in this sectionwhen using the CLI tool.

Description of a Function URN

When using the CLI tool, you must enter the URN of a function in most cases. The format ofa function URN is as follows:

urn:fss:<region_id>:<project_id>:function:<package>:<function_name>[:<version>|:!<alias>]

NOTE

A function URN is divided into eight fields by colons. The value of region_id (you can set thisparameter in accordance with the backend) is included in the system configuration. The content in thebrackets ([]) is a function version or alias. If you enter an alias, add an exclamation mark (!) in front of itfor easy identification.

Instead of providing a complete command, you can enter a command with only the requiredfields as follows:

l 1 field: <function_name>. project_id is obtained from a token, package is default, andversion is latest.

l 2 fields: <package>:<function_name>. project_id is obtained from a token, andversion is latest.

l 3 fields: <project_id>:<package>:<function_name>. version is latest.l 4 fields: <project_id>:<package>:<function_name>:<version or alias>.l 7 fields: urn:fss:<region_id>:<project_id>:function:<package>:<function_name>.

version is latest.l 8 fields:

urn:fss:<region_id>:<project_id>:function:<package>:<function_name>:<versionor alias>.

Use of JSON Strings

The format of the JSON parameters entered in the CLI varies depending on the OS. EnterJSON parameters in different OSs as follows:

l Linux: JSON structure in a pair of single quotation marks ('). For example:

FunctionStageCLI Command Reference 6 Command Description

Issue 02 (2018-05-22) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

18

Page 22: CLI Command Reference

./fss if --fu urn:fss:kweci03rg00fsp:7aad83af3e8d42e99ac194e8419e2c9b:function:default:clitest1 --ed '{"Name":"sererless"}'

l Windows: JSON structure in a pair of quotation marks ("). Each quotation mark in theJSON structure must follow a backslash (\). For example:./fss if --fu urn:fss:kweci03rg00fsp:7aad83af3e8d42e99ac194e8419e2c9b:function:default:clitest1 --ed {\"Name\":\"serverless\"}

l Windows PowerShell: JSON structure in a pair of single quotation marks ('). Eachquotation mark in the JSON structure must follow a backslash (\). For example:./fss if --fu urn:fss:kweci03rg00fsp:7aad83af3e8d42e99ac194e8419e2c9b:function:default:clitest1 --ed '{\"Name\":\"serverless\"}'

FunctionStageCLI Command Reference 6 Command Description

Issue 02 (2018-05-22) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

19


Recommended