### Local Start Command Output Source: https://github.com/devsapp/fc/blob/main/docs/en/command/local.md Example output when running s local start with a YAML configuration file. ```text url: http://localhost:7665/2016-08-15/proxy/fc-deploy-service/http-trigger-py36/ methods: GET authType: anonymous Tips for more action: Start with customDomain method: [s local start auto] Debug with customDomain method: [s local start -d 3000 auto] ``` -------------------------------- ### Guided Configuration for Serverless Devs Source: https://github.com/devsapp/fc/blob/main/docs/en/config.md Use the `s config add` command for an interactive guided setup of cloud provider credentials. This method prompts you to select a provider and enter your AccessKeyID and AccessKeySecret. ```shell $ s config add ? Please select a provider: (Use arrow keys) ❯ Alibaba Cloud (alibaba) AWS (aws) Azure (azure) Baidu Cloud (baidu) Google Cloud (google) Huawei Cloud (huawei) Tencent Cloud (tencent) Custom (others) ``` ```shell s config add ? Please select a provider: Alibaba Cloud (alibaba) ? AccessKeyID ********** ? AccessKeySecret ********** ? Please create alias for key pair. If not, please enter to skip default ``` -------------------------------- ### Deploy Domain Output Example Source: https://github.com/devsapp/fc/blob/main/docs/en/command/deploy.md Example output displayed after running the custom domain deployment command. ```text fc-deploy-test: region: cn-hangzhou service: name: fc-deploy-service function: name: http-trigger-py36 url: custom_domain: - domain: http://http-trigger-py36.fc-deploy-service.1583208943291465.cn-hangzhou.fc.devsapp.net ``` -------------------------------- ### Deploy Trigger Output Example Source: https://github.com/devsapp/fc/blob/main/docs/en/command/deploy.md Example output displayed after running the trigger deployment command. ```text fc-deploy-test: region: cn-hangzhou service: name: fc-deploy-service function: name: http-trigger-py36 url: system_url: https://1583208943291465.cn-hangzhou.fc.aliyuncs.com/2016-08-15/proxy/fc-deploy-service/http-trigger-py36/ triggers: - type: http name: httpTrigger ``` -------------------------------- ### Deploy Function YAML Configuration Example Source: https://github.com/devsapp/fc/blob/main/docs/en/command/deploy.md Example of a YAML resource description file used for deploying functions. ```text fc-deploy-test: region: cn-hangzhou service: name: fc-deploy-service function: name: http-trigger-py36 runtime: python3 handler: index.handler memorySize: 128 timeout: 60 ``` -------------------------------- ### Example sync command output Source: https://github.com/devsapp/fc/blob/main/docs/en/command/sync.md This is an example of the output you might see after running a sync command. ```text fc-deploy-test: codeFiles: http-trigger-py36: /Users/jiangyu/demo/test/start-fc-http-python3/1583208943291465_cn-hangzhou_fc-deploy_service_http-trigger-py36 configYmlPath: /Users/jiangyu/demo/test/start-fc-http-python3/s.cn-hangzhou-fc-deploy-service.sync.yaml ``` -------------------------------- ### Tracing Configuration Example Source: https://github.com/devsapp/fc/blob/main/docs/en/yaml/service.md Example YAML configuration for enabling link tracking in a service. ```yaml service: name: unit-deploy-service description: 'demo for fc-deploy component' internetAccess: true tracingConfig: Enable ``` -------------------------------- ### Deploy Service YAML Configuration Example Source: https://github.com/devsapp/fc/blob/main/docs/en/command/deploy.md Example of a YAML resource description file used for deploying services. ```text fc-deploy-test: region: cn-hangzhou service: name: fc-deploy-service ``` -------------------------------- ### Alias Get Command Output Example Source: https://github.com/devsapp/fc/blob/main/docs/en/command/alias.md Sample output from the `alias get` command, showing details of an alias including version ID, description, and timestamps. ```text fc-deploy-test: aliasName: pre versionId: 1 description: test publish version additionalVersionWeight: createdTime: 2021-11-08T06:51:36Z lastModifiedTime: 2021-11-08T06:54:02Z ``` -------------------------------- ### Example of Interactive Deployment Prompt Source: https://github.com/devsapp/fc/blob/main/docs/en/command/deploy.md This example illustrates the interactive prompt when online function configuration differs from the last local deployment. It shows the modified content and the choices available: 'use local' to override online configuration or 'use remote' to keep the online configuration unchanged. ```text Local Last Deploy status => Online status description: "this is a test" => "this is a test console" ? Remote function: http-trigger-py36 is inconsistent with the config you deployed last time, deploy it with local config or remote config? (Use arrow keys) ❯ use local use remote ``` -------------------------------- ### FC Version Publish Output Example Source: https://github.com/devsapp/fc/blob/main/docs/en/command/version.md Example output format returned after successfully publishing a service version. ```text fc-deploy-test: versionId: 1 description: test publish version createdTime: 2021-11-08T06:07:00Z lastModifiedTime: 2021-11-08T06:07:00Z ``` -------------------------------- ### Log Output Example Source: https://github.com/devsapp/fc/blob/main/docs/zh/quick_start_function.md Example output from the `s logs` command, showing runtime initialization and invoke start/end logs. ```shell FunctionCompute python3 runtime inited. FC Invoke Start RequestId: eb9cf022-297e-4a27-b3bf-ad304f6e04c9 FC Invoke End RequestId: eb9cf022-297e-4a27-b3bf-ad304f6e04c9 ``` -------------------------------- ### NAS Initialization Output Source: https://context7.com/devsapp/fc/llms.txt Example output format for NAS configuration initialization. ```text fc-deploy-test: userId: 10003 groupId: 10003 mountPoints: - serverAddr: 06c1e48887-rmm92.cn-hangzhou.nas.aliyuncs.com nasDir: /my-service fcDir: /mnt/auto ``` -------------------------------- ### Local HTTP Function Testing with `s local start` Source: https://github.com/devsapp/fc/blob/main/docs/zh/quick_start_function.md Test HTTP functions locally using `s local start`. This command starts a local server and provides a URL for testing. ```shell s local start ``` -------------------------------- ### Deploy resources using YAML Source: https://github.com/devsapp/fc/blob/main/docs/en/command/deploy.md Example output after running the 's deploy' command when a YAML resource description file is present. ```text fc-deploy-test: region: cn-hangzhou service: name: fc-deploy-service function: name: http-trigger-py36 runtime: python3 handler: index.handler memorySize: 128 timeout: 60 url: system_url: https://1583208943291465.cn-hangzhou.fc.aliyuncs.com/2016-08-15/proxy/fc-deploy-service/http-trigger-py36/ custom_domain: - domain: http://http-trigger-py36.fc-deploy-service.1583208943291465.cn-hangzhou.fc.devsapp.net triggers: - type: http name: httpTrigger ``` -------------------------------- ### Sync command help Source: https://github.com/devsapp/fc/blob/main/docs/en/command/sync.md Run this command to get help documentation for the sync command. ```bash sync -h ``` ```bash sync --help ``` -------------------------------- ### Install Serverless Devs CLI Source: https://github.com/devsapp/fc/blob/main/docs/en/quick_start_function.md Installs the Serverless Devs developer tools globally using npm. Ensure Node.js (>=10.8.0) is installed first. ```shell npm install @serverless-devs/s -g ``` -------------------------------- ### Alias Get Command Help Source: https://github.com/devsapp/fc/blob/main/docs/en/command/alias.md Display help documentation for the `alias get` command. Useful for understanding available parameters and options. ```bash alias get -h ``` -------------------------------- ### View command output Source: https://github.com/devsapp/fc/blob/main/docs/en/command/layer.md Example output showing the download progress and local cache path of the layer. ```text ✔ Downloading: [/189******629/test/7d954393-c5a2-4519-94de-d1a4c9e0611f] 144073/144073 100.00% helloworld: /Users/test/.s/cache/layers/189******629-cn-shenzhen-test/8.zip ``` -------------------------------- ### Layer Versions Output Example Source: https://github.com/devsapp/fc/blob/main/docs/en/command/layer.md This is an example of the output format when listing layer versions. It includes details like layer name, ARN, version, and compatible runtimes. ```text fc-deploy-test: - layerName: demo arn: 544c887879c38e5d0afcaf8b4f8f348e#demo#1 version: 1 description: compatibleRuntime: - nodejs12 - nodejs10 - nodejs8 - nodejs6 - python3 - python2.7 ``` -------------------------------- ### local start command Source: https://github.com/devsapp/fc/blob/main/docs/en/command/local.md The local start command is used to debug local HTTP functions. ```APIDOC ## local start ### Description The local start command is used to debug local HTTP functions. ``` -------------------------------- ### FC Deploy Component Configuration Example Source: https://github.com/devsapp/fc/blob/main/docs/en/yaml/service.md Example YAML configuration for the FC deploy component, showing service details, role ARN, and log configuration. ```yaml service: name: unit-deploy-service description: 'demo for fc-deploy component' internetAccess: true role: # role 为已配置好的,配置内容参考服务角色权限 # logConfig: auto logConfig: project: XXX logstore: XXX ``` -------------------------------- ### Local HTTP Function Start Source: https://context7.com/devsapp/fc/llms.txt Starts an HTTP function locally for testing. Allows simulation of custom domain paths and debugging with breakpoints. ```bash # Start HTTP function locally for testing s local start # Start with custom domain path simulation s local start --custom-domain ``` ```bash # Debug HTTP function with breakpoints s local start --config vscode --debug-port 9000 ``` -------------------------------- ### Instance list execution result Source: https://github.com/devsapp/fc/blob/main/docs/en/command/instance.md Example output format when listing active instances. ```text fc-event-test: instances: - instanceId: c-****-1658cb3903eb4644b0ee versionId: 0 ``` -------------------------------- ### Local HTTP Function Test Details Source: https://github.com/devsapp/fc/blob/main/docs/zh/quick_start_function.md Details provided after running `s local start`, including the local URL, allowed methods, and authentication type. It also suggests commands for starting and debugging with custom domains. ```shell url: http://localhost:7665/2016-08-15/proxy/fc-deploy-service/http-trigger-py36/ methods: GET authType: anonymous Tips for more action: Start with customDomain method: [s local start auto] Debug with customDomain method: [s local start -d 3000 auto] ``` -------------------------------- ### Build Functions and Install Dependencies Source: https://github.com/devsapp/fc/blob/main/docs/en/command/build.md Run the `s build` command to build functions and install dependencies when a YAML file is configured. This is a basic operation for the build command. ```bash s build ``` -------------------------------- ### List versions via CLI Source: https://github.com/devsapp/fc/blob/main/docs/en/command/version.md Example of listing service versions in CLI mode without a YAML configuration file. ```bash s cli fc version list --region cn-hangzhou --service-name fc-deploy-service ``` -------------------------------- ### Sample invoke command output Source: https://github.com/devsapp/fc/blob/main/docs/en/command/invoke.md Example output showing the request URL, logs, and the function result. ```text Request url: https://1583208943291465.cn-hangzhou.fc.aliyuncs.com/2016-08-15/proxy/fc-deploy-service/http-trigger-py36/ ========= FC invoke Logs begin ========= FC Invoke Start RequestId: 68f15da2-a453-4f7e-90d3-91198b76afbf FC Invoke End RequestId: 68f15da2-a453-4f7e-90d3-91198b76afbf Duration: 2.96 ms, Billed Duration: 3 ms, Memory Size: 128 MB, Max Memory Used: 10.83 MB ========= FC invoke Logs end ========= FC Invoke Result[code: ${resp.code}]: Hello world! ``` -------------------------------- ### Select Cloud Vendor Source: https://github.com/devsapp/fc/blob/main/docs/en/quick_start_application.md After initiating project creation, select the target cloud vendor. This example shows selecting 'Alibaba Cloud Serverless'. ```shell 🚀 Serverless Awesome: https://github.com/Serverless-Devs/package-awesome ? Hello Serverless for Cloud Vendors (Use arrow keys or type to search) ❯ Alibaba Cloud Serverless AWS Cloud Serverless Baidu Cloud Serverless Huawei Cloud Serverless Tencent Cloud Serverless Dev Template for Serverless Devs ``` -------------------------------- ### Get Layer Download Help Source: https://github.com/devsapp/fc/blob/main/docs/en/command/layer.md Run this command to access the help documentation for the layer download functionality, which explains how to download layer version code. ```bash layer download -h ``` ```bash layer download --help ``` -------------------------------- ### Funcraft template.yaml example Source: https://github.com/devsapp/fc/blob/main/docs/en/command/fun2s.md The source configuration file format used by Funcraft before conversion. ```yaml ROSTemplateFormatVersion: '2015-09-01' Transform: 'Aliyun::Serverless-2018-04-03' Resources: start-fc-http-python3: Type: 'Aliyun::Serverless::Service' Properties: Description: 'helloworld' start-fc-http-python3: Type: 'Aliyun::Serverless::Function' Properties: Handler: index.handler Runtime: nodejs10 CodeUri: './' ``` -------------------------------- ### Layer Detail Command Output Source: https://github.com/devsapp/fc/blob/main/docs/en/command/layer.md Example output returned after executing the layer detail command. ```text fc-deploy-test: layerName: demo version: 1 description: code: repositoryType: null location: https://fc-hz-yunqi-func-code.oss-cn-hangzhou-internal.aliyuncs.com/1583208943291465%2Fdemo%2Fdecddf35-8705-4f80-9baa-2c4a9ffc512b?Expires=1636621101&OSSAccessKeyId=&Signature=cZZHNSpeewLXVoFd2%2FdFuLBe4cc%3D codesize: 550 codeChecksum: 17221560529872498506 createTime: 2021-11-11T08:46:38Z acl: 0 compatibleRuntime: - nodejs12 - nodejs10 - nodejs8 - nodejs6 - python3 - python2.7 arn: 544c887879c38e5d0afcaf8b4f8f348e#demo#1 ``` -------------------------------- ### Get Provisioned Instances (YAML Mode) Source: https://github.com/devsapp/fc/blob/main/docs/en/command/provision.md Obtain details of provisioned instances when a resource description file (YAML) is available. Only requires the qualifier. ```bash s provision get --qualifier qualifier ``` -------------------------------- ### Start Stress Test (YAML Mode) Source: https://github.com/devsapp/fc/blob/main/docs/en/command/stress.md Run this command to perform stress testing when a resource description file in YAML format exists. ```bash s stress start ``` -------------------------------- ### Serverless Devs s.yaml example Source: https://github.com/devsapp/fc/blob/main/docs/en/command/fun2s.md The target configuration file format generated after running the fun2s command. ```yaml edition: 1.0.0 name: transform_fun access: default vars: region: cn-shenzhen services: fc-start-fc-http-python3-start-fc-http-python3: component: devsapp/fc props: region: ${vars.region} service: name: start-fc-http-python3 description: helloworld internetAccess: true function: name: start-fc-http-python3 handler: index.handler runtime: nodejs10 codeUri: ./ ``` -------------------------------- ### Metrics command output Source: https://github.com/devsapp/fc/blob/main/docs/en/command/metrics.md Example output showing the local URL to view function metrics in a browser. ```text [2021-06-07T12:20:06.661] [INFO ] [FC-METRICS] - Please open with browser: http://localhost:3000 ``` -------------------------------- ### Complete Project Initialization Source: https://github.com/devsapp/fc/blob/main/docs/en/quick_start_application.md Example of the full initialization process, including project name, credential selection, and confirmation prompts. The command `s init devsapp/start-fc-http-nodejs12` is generated. ```shell 🚀 Serverless Awesome: https://github.com/Serverless-Devs/package-awesome ? Hello Serverless for Cloud Vendors Alibaba Cloud Serverless ? Please select an Serverless-Devs Application fc-runtime-starter - 快速部署一个 FC 函数 ? Please select an templete fc-http-nodejs - 快速部署一个 nodejs12 http函数 😋 Create application command: [s init devsapp/start-fc-http-nodejs12] ? Please input your project name (init dir) start-fc-http-nodejs12 ✔ file decompression completed ? please select credential alias alibaba-access ... ... 🏄‍ Thanks for using Serverless-Devs 👉 You could [cd /Users/jiangyu/start-application/start-fc-http-nodejs12] and enjoy your serverless journey! 🧭️ If you need help for this example, you can use [s -h] after you enter folder. 💞 Document ❤ Star:https://github.com/Serverless-Devs/Serverless-Devs ? Do you want to deploy the project now? (Y/n) ``` -------------------------------- ### OSS event template path output Source: https://github.com/devsapp/fc/blob/main/docs/en/command/invoke.md Example output showing the location of the generated OSS event template. ```text ... 👓 Event Template Path: event-template/oss-event.json ... ``` -------------------------------- ### Get Help for Ondemand Get Command Source: https://github.com/devsapp/fc/blob/main/docs/en/command/ondemand.md Run 'ondemand get -h' or 'ondemand get --help' to view help information for the ondemand get command. ```bash ondemand get -h ``` ```bash ondemand get --help ``` -------------------------------- ### Configure s.yaml for FC Deployment Source: https://github.com/devsapp/fc/blob/main/docs/en/quick_start_function.md Example configuration for a Function Compute service, including log configuration and HTTP trigger settings. ```yaml edition: 1.0.0 # 命令行YAML规范版本,遵循语义化版本(Semantic Versioning)规范 name: fcDeployApp # 项目名称 access: "default" # 秘钥别名 services: fc-deploy-test: # 服务名称 component: devsapp/fc # 组件名称 props: # 组件的属性值 region: cn-hangzhou service: name: fc-deploy-service description: 'demo for fc-deploy component' logConfig: auto function: name: http-trigger-py36 description: this is a test runtime: python3 codeUri: ./code handler: index.handler memorySize: 128 timeout: 60 triggers: - name: httpTrigger type: http config: authType: anonymous methods: - GET customDomains: - domainName: auto protocol: HTTP routeConfigs: - path: /* methods: - GET ``` -------------------------------- ### List Services with Query Parameters Source: https://github.com/devsapp/fc/blob/main/docs/en/command/api.md This example demonstrates how to list Function Compute services and filter the results using query parameters like limit, nextToken, prefix, and startKey. Ensure the query parameter is formatted as a JSON string. ```shell s cli fc api ListService --query '{"limit": **, "nextToken": "**", "prefix": "**", "startKey": "**"}' ``` -------------------------------- ### Initialize Serverless Devs Project Source: https://github.com/devsapp/fc/blob/main/docs/en/quick_start_application.md Execute the 's' command to start the Serverless Devs project initialization process. This command prompts for project creation if none is detected. ```shell $ s ? Serverless Devs project is not detected. Do you want to create a new project? (Y/n) ``` -------------------------------- ### Verify Serverless Devs Installation Source: https://github.com/devsapp/fc/blob/main/docs/en/quick_start_function.md Checks if the Serverless Devs tool is installed successfully by displaying its version information. ```shell @serverless-devs/s: 2.0.89, @serverless-devs/core: 0.1.7, darwin-x64, node-v12.15.0 ``` -------------------------------- ### Select Serverless Devs Application Source: https://github.com/devsapp/fc/blob/main/docs/en/quick_start_application.md Choose a specific Serverless Devs application template based on your needs. This example selects 'fc-runtime-starter' for quickly deploying an FC function. ```shell ? Please select an Serverless-Devs Application (Use arrow keys or type to search) ❯ fc-runtime-starter - Quickly deploy an FC function... fc-custom-container-stater - Quickly deploy a custom-container application web-framework-stater - Quickly deploy a web framework static-website-stater - Quickly deploy a static website serverless-best-practice - Quickly experience serverless best practices ``` -------------------------------- ### Initialize Django Blog Project Source: https://github.com/devsapp/fc/blob/main/docs/en/quick_start_application.md Use the Serverless Devs CLI to initialize the Django blog template. Ensure you have your credentials configured before running this command. ```shell $ s init django-blog 🚀 Serverless Awesome: https://github.com/Serverless-Devs/package-awesome ? Please input your project name (init dir) django-blog ✔ file decompression completed ? please select credential alias alibaba-access ______ ___ _______ __ _ _______ _______ _______ ___ _______ _______ | | | || _ || | | || || || _ || | | || | | _ | | || |_| || |_| || ___|| _ || |_| || | | _ || ___| | | | | | || || || | __ | | | || || | | | | || | __ | |_| | ___| || || _ || || || |_| || _ | | |___ | |_| || || | | || || _ || | | || |_| || || |_| || || || |_| | |______| |_______||__| |__||_| |__||_______||_______||_______||_______||_______||_______| Welcome to the django-blog application This application requires to open these services: FC : https://fc.console.aliyun.com/ This application can help you quickly deploy the django-blog project. The application uses Django component:https://github.com/devsapp/django The application homepage: https://github.com/devsapp/django-blog * Python 3.7 is recommended; * If the version is greater than Python 3.7: * Operation error: ImportError: cannot import name 'metadata' from 'importlib', you can refer to: https://stackoverflow.com/questions/59216175/importerror-cannot-import-name-metadata-from-importlib * Default information: * Admin:/admin * Default Admin Username: blog * Default Admin Password: myblog12345! 🏄‍ Thanks for using Serverless-Devs 👉 You could [cd /Users/jiangyu/django-blog] and enjoy your serverless journey! 🧭️ If you need help for this example, you can use [s -h] after you enter folder. 💞 Document ❤ Star:https://github.com/Serverless-Devs/Serverless-Devs ``` -------------------------------- ### Initialize NAS resources Source: https://github.com/devsapp/fc/blob/main/docs/en/command/nas.md Displays the output after running the initialization command when a YAML resource description file exists. ```text fc-deploy-test: userId: 10003 groupId: 10003 mountPoints: - serverAddr: 06c1e48887-rmm92.cn-hangzhou.nas.aliyuncs.com nasDir: /fc-deploy-service fcDir: /mnt/auto ``` -------------------------------- ### Deployment Workflow Source: https://context7.com/devsapp/fc/llms.txt Standard commands to build, deploy, and test the function. ```bash # Build and install dependencies s build --use-docker # Deploy to Function Compute s deploy --use-local -y # Test the function locally s local start ``` -------------------------------- ### OSS Trigger Configuration Example Source: https://github.com/devsapp/fc/blob/main/docs/en/yaml/triggers.md Example of configuring an OSS trigger in YAML format. Specify events and filter conditions for object creation. ```yaml triggers: - name: oss sourceArn: acs:oss::: type: oss role: acs:ram:::role/aliyunosseventnotificationrole # qualifier: LATEST config: events: - oss:ObjectCreated:* filter: Key: Prefix: pppppppp Suffix: '' ``` -------------------------------- ### Example Commit Message: Bugfix Source: https://github.com/devsapp/fc/blob/main/CONTRIBUTING.md For fixing bugs, use the 'bugfix' prefix. This example shows a commit message for resolving a panic issue. ```git bugfix: fix panic when input nil parameter ``` -------------------------------- ### Initialize Environment Template Source: https://github.com/devsapp/fc/blob/main/docs/zh/command/env.md Use `s env init-template` to start an interactive process for creating a new environment template. You will be prompted to enter parameters like name, description, engine, and the path to your template code. ```shell s env init-template ``` -------------------------------- ### Example Commit Message: Feature Source: https://github.com/devsapp/fc/blob/main/CONTRIBUTING.md When adding new functionality, use a 'feature' prefix in your commit message. This example illustrates support for a new feature. ```git feature: support oracle in AT mode ``` -------------------------------- ### Example Commit Message: Docs Source: https://github.com/devsapp/fc/blob/main/CONTRIBUTING.md Use explicit commit messages to clearly state the purpose of your changes. This example shows a message for documentation-related updates. ```git docs: add docs about Serverless Devs FC Component cluster installation ``` -------------------------------- ### Sample Output of Provisioned Resources Source: https://github.com/devsapp/fc/blob/main/docs/en/command/provision.md This is a sample output showing the details of provisioned resources, including resource ID, target, scheduled actions, and target tracking policies. ```text fc-deploy-test: resource: 1583208943291465#fc-deploy-service#release#http-trigger-py36 target: 1 scheduledActions: [] targetTrackingPolicies: [] ``` -------------------------------- ### Example Commit Message: Test Source: https://github.com/devsapp/fc/blob/main/CONTRIBUTING.md When adding or modifying tests, use the 'test' prefix. This example shows a commit message for adding a unit test case. ```git test: add unit test case for func InsertIntoArray ``` -------------------------------- ### Start Stress Test (CLI Mode) Source: https://github.com/devsapp/fc/blob/main/docs/en/command/stress.md Use this command when no YAML resource description file is present. Specify region, access key, service name, and function name. ```bash s cli fc stress start --region cn-hangzhou --access myAccess --service-name fc-deploy-service --function-name http-trigger-py36 --function-type event ``` -------------------------------- ### Example Commit Message: Refactor Source: https://github.com/devsapp/fc/blob/main/CONTRIBUTING.md Use the 'refactor' prefix for changes that improve code structure without altering functionality. This example indicates code simplification for readability. ```git refactor: simplify to make codes more readable ``` -------------------------------- ### View provisioned instances list output Source: https://github.com/devsapp/fc/blob/main/docs/en/command/provision.md Standard text output format when listing provisioned resources. ```text fc-deploy-test: - serviceName: fc-deploy-service qualifier: release functionName: http-trigger-py36 resource: 1583208943291465#fc-deploy-service#release#http-trigger-py36 target: 1 current: 1 scheduledActions: (empty array) targetTrackingPolicies: (empty array) ``` -------------------------------- ### GET /layer/versions Source: https://github.com/devsapp/fc/blob/main/docs/en/command/layer.md Retrieves the list of versions for a specified layer. ```APIDOC ## GET /layer/versions ### Description Used to obtain all available versions of a specified layer. ### Parameters #### Query Parameters - **layer-name** (string) - Required - The name of the layer to query. ``` -------------------------------- ### GET /layer/detail Source: https://github.com/devsapp/fc/blob/main/docs/en/command/layer.md Retrieves the details of a specific layer version. ```APIDOC ## GET /layer/detail ### Description Retrieves detailed information about a specific layer version, including its ARN, compatible runtimes, and code location. ### Parameters #### Query Parameters - **region** (string) - Required (CLI mode) - The deployment region (e.g., cn-hangzhou, cn-beijing). - **layer-name** (string) - Required - The name of the layer. - **version-id** (string) - Required - The version of the layer. ### Response #### Success Response (200) - **layerName** (string) - Name of the layer - **version** (string) - Version ID - **code** (object) - Code repository and location details - **codesize** (number) - Size of the code package - **compatibleRuntime** (array) - List of supported runtimes - **arn** (string) - Amazon Resource Name of the layer ``` -------------------------------- ### 查看已配置的阿里云密钥 Source: https://github.com/devsapp/fc/blob/main/docs/zh/quick_start_application.md 使用 `s config get -a alibaba-access` 命令来查看指定别名(如 alibaba-access)的阿里云密钥配置信息。敏感信息会被部分隐藏。 ```shell $ s config get -a alibaba-access [2021-10-27T17:39:39.881] [INFO ] [S-CLI] - alibaba-access: AccountID: 此处填*******tID AccessKeyID: 此处填*********yID AccessKeySecret: 此处填*************ret ``` -------------------------------- ### Sample Service Output Source: https://github.com/devsapp/fc/blob/main/docs/en/command/info.md This is an example of the output when querying only service details, showing the service name, access configuration, IAM role, description, and log configuration. ```text region: cn-hangzhou service: name: fc-deploy-service internetAccess: true role: acs:ram::1583208943291465:role/aliyunfcdefaultrole description: demo for fc-deploy component logConfig: logstore: fc-service-fc-deploy-service-logstore project: 1583208943291465-cn-hangzhou-logproject ``` -------------------------------- ### Alias Get Command Source: https://github.com/devsapp/fc/blob/main/docs/en/command/alias.md Retrieves the details of a specified function alias. ```APIDOC ## alias get command You can run the `alias get` command to obtain the details of the specified alias of a service. You can run the `alias get -h` or `alias get --help` command to obtain the information about the relevant help documentation. ### Parameter description | Parameter | Abbreviation | Required in YAML mode | Required in CLI mode | Description | | ------------ | ------------ | ----------------------- | ---------------------- | ------------------------------------------------------------ | | region | - | No | Yes | The region. Valid values: cn-hangzhou, cn-beijing, cn-beijing, cn-hangzhou, cn-shanghai, cn-qingdao, cn-zhangjiakou, cn-huhehaote, cn-shenzhen, cn-chengdu, cn-hongkong, ap-southeast-1, ap-southeast-2, ap-southeast-3, ap-southeast-5, ap-northeast-1, eu-central-1, eu-west-1, us-west-1, us-east-1, and ap-south-1. | | service-name | - | No | Yes | The name of the service. | | alias-name | - | Yes | Yes | The name of the alias. | > The current command also supports some global parameters (such as `-a/--access`, `--debug`, etc.). For details, please refer to [Serverless Devs global parameters document](https://serverless-devs.com/en/serverless-devs/command/readme#supported-parameters) ### Examples - **If the YAML description file of resources exist**, you can run the `s alias get --alias-name aliasName` command to obtain the details of the specified alias. - **If the YAML description file of resources do not exist (In CLI mode)**, you need to specify the region and the name of the service in the alias get command. Example: `s cli fc alias get --region cn-hangzhou --service-name fc-deploy-service --alias-name pre`. The following sample code shows the command output: ```text fc-deploy-test: aliasName: pre versionId: 1 description: test publish version additionalVersionWeight: createdTime: 2021-11-08T06:51:36Z lastModifiedTime: 2021-11-08T06:54:02Z ``` ``` -------------------------------- ### ondemand get command Source: https://github.com/devsapp/fc/blob/main/docs/en/command/ondemand.md Queries the details of specified on-demand resources. ```APIDOC ## GET /devsapp/fc/ondemand ### Description Queries the details of specified on-demand resources. ### Method GET ### Endpoint /devsapp/fc/ondemand ### Parameters #### Query Parameters - **region** (string) - Required - The region. Valid values: cn-hangzhou, cn-beijing, cn-shanghai, cn-qingdao, cn-zhangjiakou, cn-huhehaote, cn-shenzhen, cn-chengdu, cn-hongkong, ap-southeast-1, ap-southeast-2, ap-southeast-3, ap-southeast-5, ap-northeast-1, eu-central-1, eu-west-1, us-west-1, us-east-1, and ap-south-1. - **service-name** (string) - Required - The name of the service. - **function-name** (string) - Required - The name of the function. - **qualifier** (string) - Required - The version. You can specify LATEST or an alias. ### Request Example ```bash s cli fc ondemand get --region cn-hangzhou --service-name fc-deploy-service --qualifier qualifier ``` ### Response #### Success Response (200) - **serviceName** (string) - The name of the service. - **functionName** (string) - The name of the function. - **qualifier** (string) - The version qualifier. - **resource** (string) - The resource identifier. - **maximumInstanceCount** (integer) - The maximum number of instances. #### Response Example ```json { "serviceName": "fc-deploy-service", "functionName": "http-trigger-py36", "qualifier": "LATEST", "resource": "services/fc-deploy-service.http-trigger-py36/functions/LATEST", "maximumInstanceCount": 1 } ``` ``` -------------------------------- ### Initialize AI Target Detection Project Source: https://github.com/devsapp/fc/blob/main/docs/en/quick_start_application.md Use the s init command to clone and configure the image-prediction-app template. ```shell $ s init devsapp/image-prediction-app 🚀 Serverless Awesome: https://github.com/Serverless-Devs/package-awesome ? Please input your project name (init dir) image-prediction-app ✔ file decompression completed ? please select credential alias alibaba-access ___ __ __ _______ _______ _______ | | | |_| || _ || || | | | | || |_| || ___|| ___| | | | || || | __ | |___ | | | || || || || ___| | | | ||_|| || _ || |_| || |___ |___| |_| |_||__| |__||_______||_______| Welcome to the image-prediction-app application This application requires to open these services: FC : https://fc.console.aliyun.com/ This application can help you quickly deploy the image-prediction-app project. The application uses FC component:https://github.com/devsapp/fc The application homepage: https://github.com/devsapp/image-prediction-app 🏄‍ Thanks for using Serverless-Devs 👉 You could [cd /Users/jiangyu/start-application/image-prediction-app] and enjoy your serverless journey! 🧭️ If you need help for this example, you can use [s -h] after you enter folder. 💞 Document ❤ Star:https://github.com/Serverless-Devs/Serverless-Devs ``` -------------------------------- ### Layer Detail Source: https://github.com/devsapp/fc/blob/main/docs/en/command/layer.md Command to get detailed information about a specific layer and its versions. ```APIDOC ## GET /layer/detail ### Description Retrieves detailed information about a specified layer and its versions. ### Method GET ### Endpoint /layer/detail ### Parameters #### Query Parameters - **layerName** (string) - Required - The name of the layer to get details for. - **version** (string) - Optional - The specific version of the layer to get details for. If not specified, details for all versions may be returned. - **region** (string) - Optional - The region where the service is deployed. ### Request Example ```bash s layer detail --layer-name demo --region cn-hangzhou ``` ### Response #### Success Response (200) - **layerDetails** (object) - An object containing detailed information about the layer and its versions. ``` -------------------------------- ### Initialize Environment Source: https://github.com/devsapp/fc/blob/main/docs/zh/command/env.md Use `s env init` to create a new environment. This command requires a filename for the environment configuration. After execution, a YAML file describing the environment will be created in the `.s/env/` directory. ```shell s env init --filename fc-env-testing.yaml ``` -------------------------------- ### Query Function Logs Source: https://github.com/devsapp/fc/blob/main/docs/en/quick_start_function.md Example output when querying function execution logs. ```shell FunctionCompute python3 runtime inited. FC Invoke Start RequestId: eb9cf022-297e-4a27-b3bf-ad304f6e04c9 FC Invoke End RequestId: eb9cf022-297e-4a27-b3bf-ad304f6e04c9 ``` -------------------------------- ### Sample output of ondemand put Source: https://github.com/devsapp/fc/blob/main/docs/en/command/ondemand.md This is the sample output after successfully publishing or updating an on-demand resource configuration. ```text fc-deploy-test: resource: services/fc-deploy-service.http-trigger-py36/functions/LATEST maximumInstanceCount: 1 ``` -------------------------------- ### GET /provision Source: https://github.com/devsapp/fc/blob/main/docs/en/command/provision.md Retrieves the details of provisioned instances for a specific function version or alias. ```APIDOC ## GET /provision ### Description Retrieves the configuration and status of provisioned instances for a specified service and function. ### Parameters #### Query Parameters - **region** (string) - Required - The target region (e.g., cn-hangzhou). - **service-name** (string) - Required - The name of the service. - **function-name** (string) - Required - The name of the function. - **qualifier** (string) - Required - The version or alias for which provisioned resources are configured. ### Response #### Success Response (200) - **serviceName** (string) - The name of the service. - **functionName** (string) - The name of the function. - **qualifier** (string) - The version or alias. - **target** (number) - The target number of provisioned instances. - **current** (number) - The current number of provisioned instances. - **targetTrackingPolicies** (array) - List of auto-scaling policies. #### Response Example { "serviceName": "fc-deploy-service", "functionName": "http-trigger-py36", "qualifier": "release", "target": 1, "current": 1, "targetTrackingPolicies": [] } ``` -------------------------------- ### Access Layer Version Help Source: https://github.com/devsapp/fc/blob/main/docs/en/command/layer.md Commands to display help documentation for the layer versions command. ```bash layer version -h ``` ```bash layer versions --help ``` -------------------------------- ### GET instance list Source: https://github.com/devsapp/fc/blob/main/docs/en/command/instance.md Retrieves a list of all currently active instances for a specified function. ```APIDOC ## GET instance list ### Description Retrieves a list of all currently active instances of the function. ### Parameters #### Query Parameters - **region** (string) - Required in CLI mode - The region of the service (e.g., cn-shenzhen, us-east-1) - **service-name** (string) - Required in CLI mode - The name of the service - **function-name** (string) - Required in CLI mode - The name of the function - **qualifier** (string) - Optional - Version or alias, default is LATEST ### Response Example ```text fc-event-test: instances: - instanceId: c-****-1658cb3903eb4644b0ee versionId: 0 ``` ``` -------------------------------- ### Deploy Django Blog Project Source: https://github.com/devsapp/fc/blob/main/docs/en/quick_start_application.md Deploy the initialized project to the cloud. The output provides the assigned test domain name for accessing the application. ```shell Tips for next step ====================== * Invoke remote function: s invoke ✔ Try container acceleration djangoBlog: region: cn-shenzhen serviceName: serverless-devs-django functionName: django customDomains: - http://django.serverless-devs-django.1583208943291465.cn-shenzhen.fc.devsapp.net ``` -------------------------------- ### Alias Publish Command Help Source: https://github.com/devsapp/fc/blob/main/docs/en/command/alias.md Display help documentation for the `alias publish` command. Useful for understanding its parameters and how to publish or update aliases. ```bash alias publish -h ``` -------------------------------- ### GET /fc/layer/detail Source: https://github.com/devsapp/fc/blob/main/docs/en/command/layer.md Retrieves the details and download path for a specific version of a Function Compute layer. ```APIDOC ## GET /fc/layer/detail ### Description Retrieves the details of a specific layer version. This command requires the layer name and version ID, and optionally the region if not defined in the YAML configuration. ### Parameters #### Query Parameters - **region** (string) - Required (CLI) / Optional (YAML) - The deployment region (e.g., cn-hangzhou, us-east-1). - **layer-name** (string) - Required - The name of the layer. - **version-id** (string) - Required - The version of the layer. ### Request Example `s cli fc layer detail --region cn-hangzhou --layer-name demo --version-id 1` ### Response #### Success Response (200) - **output** (string) - Returns the local cache path of the downloaded layer zip file. #### Response Example ```text ✔ Downloading: [/189******629/test/7d954393-c5a2-4519-94de-d1a4c9e0611f] 144073/144073 100.00% helloworld: /Users/test/.s/cache/layers/189******629-cn-shenzhen-test/8.zip ``` ``` -------------------------------- ### Configure Provisioned Resources with YAML Source: https://github.com/devsapp/fc/blob/main/docs/en/command/provision.md Use the `s provision put` command with a resource description file (YAML) to configure provisioned resources. Specify the qualifier and target. ```bash s provision put --qualifier release --target 1 ``` -------------------------------- ### Local Function Invocation Output Source: https://github.com/devsapp/fc/blob/main/docs/en/quick_start_function.md Information provided when running local start or invoke commands. ```shell url: http://localhost:7665/2016-08-15/proxy/fc-deploy-service/http-trigger-py36/ methods: GET authType: anonymous Tips for more action: Start with customDomain method: [s local start auto] Debug with customDomain method: [s local start -d 3000 auto] ```