### Initialize Serverless Project Source: https://cloud.tencent.com/document/product/583/95667 Use the 'scf init' command to download the full-stack template for your project. This sets up the basic project structure. ```bash scf init fullstack ``` -------------------------------- ### Get Function Request Status Output Example Source: https://cloud.tencent.com/document/product/583/65348 This is an example of the JSON output returned by the GetRequestStatus API, showing the total count of statuses and details for each request, including function name, return message, request ID, start time, return code, duration, and memory usage. ```json { "Response": { "TotalCount": 0, "Data": [ { "FunctionName": "function-demo", "RetMsg": "Hello", "RequestId": "96d91886-f49b-4962-825e-1b4b8a2585f7", "StartTime": "2024-12-25 19:50:07", "RetCode": 0, "Duration": 0, "MemUsage": 0, "RetryNum": 0 } ], "RequestId": "a63607c3-581f-4be9-8c4b-631c75909f07" } } ``` -------------------------------- ### Create a Static Website Project Source: https://cloud.tencent.com/document/product/583/104729 Use the Serverless Cloud Framework to quickly initialize a static website hosting application using a starter template. ```bash mkdir tencent-website && cd tencent-website scf init website-starter cd website-starter ``` -------------------------------- ### Get Function Logs API Response Example Source: https://cloud.tencent.com/document/product/583/18583 This snippet illustrates a typical response from the GetFunctionLogs API, detailing function log information such as memory usage, return code, duration, and start time. The SearchContext field is deprecated. ```JSON { "Response": { "TotalCount": 1, "Data": [ { "MemUsage": 3174400, "RetCode": 1, "RetMsg": "Success", "Log": "", "BillDuration": 100, "InvokeFinished": 1, "RequestId": "bc309eaa-6d64-11e8-a7fe-5254000b4175", "StartTime": "2018-06-11 18:46:45", "Duration": 0.532, "FunctionName": "APITest", "Level": "", "Source": "", "RetryNum": 1 } ], "SearchContext": { "Offset": "", "Limit": 0, "Keyword": "", "Type": "" }, "RequestId": "e2571ff3-da04-4c53-8438-f58bf057ce4a" } } ``` -------------------------------- ### Install Express and Initialize Project Source: https://cloud.tencent.com/document/product/583/56114 Install the Express framework and the express-generator scaffolding tool, then initialize a new Express project. Ensure Node.js is installed locally. ```bash npm install express --save npm install express-generator --save express WebApp ``` -------------------------------- ### HTTP GET Request Structure Example Source: https://cloud.tencent.com/document/product/583/17238 Example of an HTTP GET request structure using Signature Method v3. Common parameters are placed in HTTP headers. ```http https://cvm.tencentcloudapi.com/?Limit=10&Offset=0 Authorization: TC3-HMAC-SHA256 Credential=AKID********************************/2018-10-09/cvm/tc3_request, SignedHeaders=content-type;host, Signature=5da7a33f6993f0614b047e5df4582db9e9bf4672ba50567dba16c6ccf174c474 Content-Type: application/x-www-form-urlencoded Host: cvm.tencentcloudapi.com X-TC-Action: DescribeInstances X-TC-Version: 2017-03-12 X-TC-Timestamp: 1539084154 X-TC-Region: ap-guangzhou ``` -------------------------------- ### Install Project Dependencies Source: https://cloud.tencent.com/document/product/583/95667 Navigate to your project directory and run 'npm run bootstrap' to install all the necessary dependencies for the full-stack application. ```bash npm run bootstrap ``` -------------------------------- ### Ruby SDK Example for DeleteReservedConcurrencyConfig Source: https://cloud.tencent.com/document/product/583/51249 Example of using the Tencent Cloud SDK for Ruby to call the DeleteReservedConcurrencyConfig API. This snippet requires the SDK to be installed and configured. ```ruby require 'tencentcloud-sdk-ruby' client = TencentCloud::Scf::V20180416::ScfClient.new({ credential: { secret_id: 'SECRETID', secret_key: 'SECRETKEY' }, region: 'ap-guangzhou', profile: { http_profile: { endpoint: 'scf.tencentcloudapi.com' } } }) request = TencentCloud::Scf::V20180416::Models::DeleteReservedConcurrencyConfigRequest.new request.function_name = 'functionName1' request.namespace = 'default' response = client.delete_reserved_concurrency_config(request) puts response.to_json ``` -------------------------------- ### Install Project Dependencies Source: https://cloud.tencent.com/document/product/583/56114 Navigate to your project directory and install all necessary dependencies using npm. ```bash cd WebApp npm install ``` -------------------------------- ### C++ SDK Example for DeleteReservedConcurrencyConfig Source: https://cloud.tencent.com/document/product/583/51249 Example of using the Tencent Cloud SDK for C++ to call the DeleteReservedConcurrencyConfig API. This snippet requires the SDK to be installed and configured. ```cpp #include #include #include #include #include using namespace TencentCloud; using namespace TencentCloud::Scf::V20180416; using namespace TencentCloud::Scf::V20180416::Model; int main() { try { TencentCloud::Initialize(); Credential cred("SECRETID", "SECRETKEY"); ClientProfile clientProfile; HttpProfile httpProfile; httpProfile.SetEndpoint("scf.tencentcloudapi.com"); clientProfile.SetHttpProfile(httpProfile); ScfClient client(cred, "ap-guangzhou", clientProfile); DeleteReservedConcurrencyConfigRequest req; req.SetFunctionName("functionName1"); req.SetNamespace("default"); DeleteReservedConcurrencyConfigResponse resp; client.DeleteReservedConcurrencyConfig(req, &resp); std::cout << resp.ToJsonString() << std::endl; } catch (const std::exception& e) { std::cerr << "Error: " << e.what() << std::endl; } TencentCloud::Shutdown(); return 0; } ``` -------------------------------- ### .NET SDK Example for DeleteReservedConcurrencyConfig Source: https://cloud.tencent.com/document/product/583/51249 Example of using the Tencent Cloud SDK for .NET to call the DeleteReservedConcurrencyConfig API. This snippet requires the SDK to be installed and configured. ```csharp using TencentCloud.Scf.V20180416; using TencentCloud.Scf.V20180416.Models; using TencentCloud.Common; using TencentCloud.Common.Profile; namespace DeleteReservedConcurrencyConfigDemo { class Program { static void Main(string[] args) { try { Credential cred = new Credential("SECRETID", "SECRETKEY"); HttpProfile httpProfile = new HttpProfile(); httpProfile.Endpoint = "scf.tencentcloudapi.com"; ClientProfile clientProfile = new ClientProfile(); clientProfile.HttpProfile = httpProfile; ScfClient client = new ScfClient(cred, "ap-guangzhou", clientProfile); DeleteReservedConcurrencyConfigRequest req = new DeleteReservedConcurrencyConfigRequest(); req.FunctionName = "functionName1"; req.Namespace = "default"; DeleteReservedConcurrencyConfigResponse resp = client.DeleteReservedConcurrencyConfig(req); Console.WriteLine(AbstractModel.ToJsonString(resp)); } catch(TencentCloudSDKException e) { Console.WriteLine(e); } } } } ``` -------------------------------- ### Initialize Project from Template Source: https://cloud.tencent.com/document/product/583/44785 Download a specified template from the component repository using 'scf init xxx', where 'xxx' is the template name. The '--name my-app' flag allows custom project directory naming, and '--debug' shows logs during template download. ```bash scf init xxx --name my-app --debug ``` -------------------------------- ### Initialize a Malagu Project Source: https://cloud.tencent.com/document/product/583/61392 Initialize a new Malagu project using the CLI and navigate into the project directory. ```bash malagu init project-name cd project-name # 进入项目根目录 ``` -------------------------------- ### Node.js SDK Example for DeleteReservedConcurrencyConfig Source: https://cloud.tencent.com/document/product/583/51249 Example of using the Tencent Cloud SDK for Node.js to call the DeleteReservedConcurrencyConfig API. This snippet requires the SDK to be installed and configured. ```javascript const tencentcloud = require("tencentcloud-sdk-nodejs"); const ScfClient = tencentcloud.scf.v20180416.ScfClient; const models = tencentcloud.scf.v20180416.models; const credential = require("tencentcloud-sdk-nodejs/tencentcloud/common/credential"); const clientProfile = require("tencentcloud-sdk-nodejs/tencentcloud/common/profile/client_profile"); const httpProfile = require("tencentcloud-sdk-nodejs/tencentcloud/common/profile/http_profile"); let cred = new credential({ secretId: "SECRETID", secretKey: "SECRETKEY", }); let httpProfile = new httpProfile(); httpProfile.setEndpoint("scf.tencentcloudapi.com"); let clientProfile = new clientProfile(); clientProfile.setHttpProfile(httpProfile); let client = new ScfClient(cred, "ap-guangzhou", clientProfile); let req = new models.DeleteReservedConcurrencyConfigRequest(); let params = { "FunctionName": "functionName1", "Namespace": "default" }; req.from_json_string(JSON.stringify(params)); client.DeleteReservedConcurrencyConfig(req).then( (data) => { console.log(data); }, (err) => { console.error(err); } ); ``` -------------------------------- ### Initialize Nest.js Project Source: https://cloud.tencent.com/document/product/583/59233 Use npm to install the Nest.js CLI and create a new Nest.js project. This is the first step for custom deployment. ```bash npm i -g @nestjs/cli nest new nest-app ```