diff --git a/docs/fg/api-ref/ALL_META.TXT.json b/docs/fg/api-ref/ALL_META.TXT.json new file mode 100644 index 00000000..c0d3403d --- /dev/null +++ b/docs/fg/api-ref/ALL_META.TXT.json @@ -0,0 +1,1761 @@ +[ + { + "dockw":"API Reference" + }, + { + "uri":"functiongraph_06_1600.html", + "node_id":"functiongraph_06_1600.xml", + "product_code":"functiongraph", + "code":"1", + "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "doc_type":"api", + "kw":"Before You Start", + "search_title":"", + "metedata":[ + { + "documenttype":"api", + "prodname":"functiongraph" + } + ], + "title":"Before You Start", + "githuburl":"" + }, + { + "uri":"functiongraph_06_0100.html", + "node_id":"functiongraph_06_0100.xml", + "product_code":"functiongraph", + "code":"2", + "des":"Welcome to FunctionGraph. FunctionGraph hosts and computes event-driven functions in a serverless context while ensuring high availability, high scalability, and zero mai", + "doc_type":"api", + "kw":"Overview,Before You Start,API Reference", + "search_title":"", + "metedata":[ + { + "documenttype":"api", + "prodname":"functiongraph" + } + ], + "title":"Overview", + "githuburl":"" + }, + { + "uri":"functiongraph_06_1601.html", + "node_id":"functiongraph_06_1601.xml", + "product_code":"functiongraph", + "code":"3", + "des":"FunctionGraph supports Representational State Transfer (REST) APIs, allowing you to call APIs using HTTPS. For details about API calling, see Calling APIs.", + "doc_type":"api", + "kw":"API Calling,Before You Start,API Reference", + "search_title":"", + "metedata":[ + { + "documenttype":"api", + "prodname":"functiongraph" + } + ], + "title":"API Calling", + "githuburl":"" + }, + { + "uri":"functiongraph_06_1602.html", + "node_id":"functiongraph_06_1602.xml", + "product_code":"functiongraph", + "code":"4", + "des":"An endpoint is the request address for calling an API. Endpoints vary depending on services and regions. For the endpoints of all services, see Regions and Endpoints.", + "doc_type":"api", + "kw":"Endpoints,Before You Start,API Reference", + "search_title":"", + "metedata":[ + { + "documenttype":"api", + "prodname":"functiongraph" + } + ], + "title":"Endpoints", + "githuburl":"" + }, + { + "uri":"functiongraph_06_1603.html", + "node_id":"functiongraph_06_1603.xml", + "product_code":"functiongraph", + "code":"5", + "des":"The number of functions that you can create is determined by your quota. For details, see .For more constraints, see API description.", + "doc_type":"api", + "kw":"Constraints,Before You Start,API Reference", + "search_title":"", + "metedata":[ + { + "documenttype":"api", + "prodname":"functiongraph" + } + ], + "title":"Constraints", + "githuburl":"" + }, + { + "uri":"functiongraph_06_1604.html", + "node_id":"functiongraph_06_1604.xml", + "product_code":"functiongraph", + "code":"6", + "des":"AccountAn account is created upon successful registration with the cloud system. The account has full access permissions for all of its cloud services and resources. It c", + "doc_type":"api", + "kw":"Concepts,Before You Start,API Reference", + "search_title":"", + "metedata":[ + { + "documenttype":"api", + "prodname":"functiongraph" + } + ], + "title":"Concepts", + "githuburl":"" + }, + { + "uri":"functiongraph_06_0101.html", + "node_id":"functiongraph_06_0101.xml", + "product_code":"functiongraph", + "code":"7", + "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "doc_type":"api", + "kw":"Function Model Definition", + "search_title":"", + "metedata":[ + { + "documenttype":"api", + "prodname":"functiongraph" + } + ], + "title":"Function Model Definition", + "githuburl":"" + }, + { + "uri":"functiongraph_06_0102.html", + "node_id":"functiongraph_06_0102.xml", + "product_code":"functiongraph", + "code":"8", + "des":"The function model of FunctionGraph is as follows:Table 1 describes the parameters in the function model.The format of a function URN is as follows:A function URN is divi", + "doc_type":"api", + "kw":"Function Model,Function Model Definition,API Reference", + "search_title":"", + "metedata":[ + { + "documenttype":"api", + "prodname":"functiongraph" + } + ], + "title":"Function Model", + "githuburl":"" + }, + { + "uri":"functiongraph_06_0103.html", + "node_id":"functiongraph_06_0103.xml", + "product_code":"functiongraph", + "code":"9", + "des":"Table 1 describes the parameters in the trigger type model.Table 2 describes the parameters in the trigger instance model.The data of a Simple Message Notification (SMN) ", + "doc_type":"api", + "kw":"Trigger Management Models,Function Model Definition,API Reference", + "search_title":"", + "metedata":[ + { + "documenttype":"api", + "prodname":"functiongraph" + } + ], + "title":"Trigger Management Models", + "githuburl":"" + }, + { + "uri":"functiongraph_06_1500.html", + "node_id":"functiongraph_06_1500.xml", + "product_code":"functiongraph", + "code":"10", + "des":"FunctionGraph provides developers and partners with open APIs for development, deployment, hosting, and O&M, helping users quickly implement service innovations at low co", + "doc_type":"api", + "kw":"API Overview,API Reference", + "search_title":"", + "metedata":[ + { + "documenttype":"api", + "prodname":"functiongraph" + } + ], + "title":"API Overview", + "githuburl":"" + }, + { + "uri":"functiongraph_06_0200.html", + "node_id":"functiongraph_06_0200.xml", + "product_code":"functiongraph", + "code":"11", + "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "doc_type":"api", + "kw":"Calling APIs", + "search_title":"", + "metedata":[ + { + "documenttype":"api", + "prodname":"functiongraph" + } + ], + "title":"Calling APIs", + "githuburl":"" + }, + { + "uri":"functiongraph_06_0210.html", + "node_id":"functiongraph_06_0210.xml", + "product_code":"functiongraph", + "code":"12", + "des":"This section describes the structure of a REST API request, and uses the Identity and Access Management (IAM) API for obtaining a user token as an example to demonstrate ", + "doc_type":"api", + "kw":"Making an API Request,Calling APIs,API Reference", + "search_title":"", + "metedata":[ + { + "documenttype":"api", + "prodname":"functiongraph" + } + ], + "title":"Making an API Request", + "githuburl":"" + }, + { + "uri":"functiongraph_06_0230.html", + "node_id":"functiongraph_06_0230.xml", + "product_code":"functiongraph", + "code":"13", + "des":"Requests for calling an API can be authenticated using either of the following methods:Token-based authentication: Requests are authenticated using a token.AK/SK-based au", + "doc_type":"api", + "kw":"Authentication,Calling APIs,API Reference", + "search_title":"", + "metedata":[ + { + "documenttype":"api", + "prodname":"functiongraph" + } + ], + "title":"Authentication", + "githuburl":"" + }, + { + "uri":"functiongraph_06_0220.html", + "node_id":"functiongraph_06_0220.xml", + "product_code":"functiongraph", + "code":"14", + "des":"After sending a request, you will receive a response, including a status code, response header, and response body.A status code is a group of digits, ranging from 1xx to ", + "doc_type":"api", + "kw":"Response,Calling APIs,API Reference", + "search_title":"", + "metedata":[ + { + "documenttype":"api", + "prodname":"functiongraph" + } + ], + "title":"Response", + "githuburl":"" + }, + { + "uri":"functiongraph_06_0201.html", + "node_id":"functiongraph_06_0201.xml", + "product_code":"functiongraph", + "code":"15", + "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "doc_type":"api", + "kw":"Examples", + "search_title":"", + "metedata":[ + { + "documenttype":"api", + "opensource":"false", + "prodname":"functiongraph" + } + ], + "title":"Examples", + "githuburl":"" + }, + { + "uri":"functiongraph_06_0202.html", + "node_id":"functiongraph_06_0202.xml", + "product_code":"functiongraph", + "code":"16", + "des":"This example guides you through the procedure for creating a Python 2.7 function and associating a timer trigger with it to periodically download files from an OBS bucket", + "doc_type":"api", + "kw":"Example 1: Using a Timer Trigger to Periodically Download Files from an OBS Bucket,Examples,API Refe", + "search_title":"", + "metedata":[ + { + "documenttype":"api", + "prodname":"functiongraph", + "opensource":"true" + } + ], + "title":"Example 1: Using a Timer Trigger to Periodically Download Files from an OBS Bucket", + "githuburl":"" + }, + { + "uri":"functiongraph_06_0203.html", + "node_id":"functiongraph_06_0203.xml", + "product_code":"functiongraph", + "code":"17", + "des":"This example guides you through the procedure for creating a Python 2.7 function and associating an APIG trigger with it to obtain a static web page.For details about how", + "doc_type":"api", + "kw":"Example 2: Using an APIG Trigger to Obtain a Static Web Page,Examples,API Reference", + "search_title":"", + "metedata":[ + { + "documenttype":"api", + "prodname":"functiongraph", + "opensource":"true" + } + ], + "title":"Example 2: Using an APIG Trigger to Obtain a Static Web Page", + "githuburl":"" + }, + { + "uri":"functiongraph_06_0204.html", + "node_id":"functiongraph_06_0204.xml", + "product_code":"", + "code":"18", + "des":"This example guides you through the procedure for uploading local code to an OBS bucket and creating a Python 2.7 function using the link URL of the OBS bucket.For detail", + "doc_type":"", + "kw":"Example 3: Creating a Function by Uploading Code to an OBS Bucket,Examples,API Reference", + "search_title":"", + "metedata":[ + { + + } + ], + "title":"Example 3: Creating a Function by Uploading Code to an OBS Bucket", + "githuburl":"" + }, + { + "uri":"functiongraph_06_1704.html", + "node_id":"functiongraph_06_1704.xml", + "product_code":"", + "code":"19", + "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "doc_type":"", + "kw":"APIs", + "search_title":"", + "metedata":[ + { + + } + ], + "title":"APIs", + "githuburl":"" + }, + { + "uri":"FunctionInvocation.html", + "node_id":"functioninvocation.xml", + "product_code":"", + "code":"20", + "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "doc_type":"api", + "kw":"Function Invocation", + "search_title":"", + "metedata":[ + { + "documenttype":"api" + } + ], + "title":"Function Invocation", + "githuburl":"" + }, + { + "uri":"functiongraph_06_0125.html", + "node_id":"functiongraph_06_0125.xml", + "product_code":"", + "code":"21", + "des":"This API is used to execute a function synchronously. Clients must wait for explicit responses to their requests from the function. Responses are returned only after func", + "doc_type":"api", + "kw":"Executing a Function Synchronously,Function Invocation,API Reference", + "search_title":"", + "metedata":[ + { + "opensource":"true", + "documenttype":"api", + "operation_id":"InvokeFunction" + } + ], + "title":"Executing a Function Synchronously", + "githuburl":"" + }, + { + "uri":"functiongraph_06_0126.html", + "node_id":"functiongraph_06_0126.xml", + "product_code":"", + "code":"22", + "des":"This API is used to execute a function asynchronously.POST /v2/{project_id}/fgs/functions/{function_urn}/invocations-asyncStatus code: 202Status code: 400Status code: 401", + "doc_type":"api", + "kw":"Executing a Function Asynchronously,Function Invocation,API Reference", + "search_title":"", + "metedata":[ + { + "opensource":"true", + "documenttype":"api", + "operation_id":"AsyncInvokeFunction" + } + ], + "title":"Executing a Function Asynchronously", + "githuburl":"" + }, + { + "uri":"FunctionQuotas.html", + "node_id":"functionquotas.xml", + "product_code":"", + "code":"23", + "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "doc_type":"api", + "kw":"Function Quotas", + "search_title":"", + "metedata":[ + { + "documenttype":"api" + } + ], + "title":"Function Quotas", + "githuburl":"" + }, + { + "uri":"functiongraph_06_0137.html", + "node_id":"functiongraph_06_0137.xml", + "product_code":"", + "code":"24", + "des":"This API is used to query tenant quotas.GET /v2/{project_id}/fgs/quotasStatus code: 200Status code: 400Status code: 401Status code: 403Status code: 500Query quotas.Status", + "doc_type":"api", + "kw":"Querying Tenant Quotas,Function Quotas,API Reference", + "search_title":"", + "metedata":[ + { + "opensource":"true", + "documenttype":"api", + "operation_id":"ListQuotas" + } + ], + "title":"Querying Tenant Quotas", + "githuburl":"" + }, + { + "uri":"Dependencies.html", + "node_id":"dependencies.xml", + "product_code":"", + "code":"25", + "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "doc_type":"api", + "kw":"Dependencies", + "search_title":"", + "metedata":[ + { + "documenttype":"api" + } + ], + "title":"Dependencies", + "githuburl":"" + }, + { + "uri":"functiongraph_06_0127.html", + "node_id":"functiongraph_06_0127.xml", + "product_code":"", + "code":"26", + "des":"This API is used to query all dependencies.GET /v2/{project_id}/fgs/dependenciesStatus code: 200Status code: 401Status code: 403Status code: 404Status code: 500Dependenci", + "doc_type":"api", + "kw":"Querying Dependencies,Dependencies,API Reference", + "search_title":"", + "metedata":[ + { + "opensource":"true", + "documenttype":"api", + "operation_id":"ListDependencies" + } + ], + "title":"Querying Dependencies", + "githuburl":"" + }, + { + "uri":"functiongraph_06_0152.html", + "node_id":"functiongraph_06_0152.xml", + "product_code":"", + "code":"27", + "des":"This API is used to create a dependency version.POST /v2/{project_id}/fgs/dependencies/versionStatus code: 200Status code: 401Status code: 403Status code: 404Status code:", + "doc_type":"api", + "kw":"Creating a Dependency Version,Dependencies,API Reference", + "search_title":"", + "metedata":[ + { + "opensource":"true", + "documenttype":"api", + "operation_id":"CreateDependencyVersion" + } + ], + "title":"Creating a Dependency Version", + "githuburl":"" + }, + { + "uri":"functiongraph_06_0153.html", + "node_id":"functiongraph_06_0153.xml", + "product_code":"", + "code":"28", + "des":"This API is used to query dependency versions.GET /v2/{project_id}/fgs/dependencies/{depend_id}/versionStatus code: 200Status code: 401Status code: 403Status code: 404Sta", + "doc_type":"api", + "kw":"Querying Dependency Versions,Dependencies,API Reference", + "search_title":"", + "metedata":[ + { + "opensource":"true", + "documenttype":"api", + "operation_id":"ListDependencyVersion" + } + ], + "title":"Querying Dependency Versions", + "githuburl":"" + }, + { + "uri":"functiongraph_06_0154.html", + "node_id":"functiongraph_06_0154.xml", + "product_code":"", + "code":"29", + "des":"This API is used to query the details about a dependency version.GET /v2/{project_id}/fgs/dependencies/{depend_id}/version/{version}Status code: 200Status code: 401Status", + "doc_type":"api", + "kw":"Querying a Dependency Version,Dependencies,API Reference", + "search_title":"", + "metedata":[ + { + "opensource":"true", + "documenttype":"api", + "operation_id":"ShowDependencyVersion" + } + ], + "title":"Querying a Dependency Version", + "githuburl":"" + }, + { + "uri":"functiongraph_06_0155.html", + "node_id":"functiongraph_06_0155.xml", + "product_code":"", + "code":"30", + "des":"This API is used to delete a dependency version.DELETE /v2/{project_id}/fgs/dependencies/{depend_id}/version/{version}Status code: 401Status code: 403Status code: 404Stat", + "doc_type":"api", + "kw":"Deleting a Dependency Version,Dependencies,API Reference", + "search_title":"", + "metedata":[ + { + "opensource":"true", + "documenttype":"api", + "operation_id":"DeleteDependencyVersion" + } + ], + "title":"Deleting a Dependency Version", + "githuburl":"" + }, + { + "uri":"TestEvents.html", + "node_id":"testevents.xml", + "product_code":"", + "code":"31", + "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "doc_type":"api", + "kw":"Test Events", + "search_title":"", + "metedata":[ + { + "documenttype":"api" + } + ], + "title":"Test Events", + "githuburl":"" + }, + { + "uri":"functiongraph_06_0132.html", + "node_id":"functiongraph_06_0132.xml", + "product_code":"", + "code":"32", + "des":"This API is used to query the test events of a function.GET /v2/{project_id}/fgs/functions/{function_urn}/eventsStatus code: 200Status code: 400Status code: 401Status cod", + "doc_type":"api", + "kw":"Querying Test Events of a Function,Test Events,API Reference", + "search_title":"", + "metedata":[ + { + "opensource":"true", + "documenttype":"api", + "operation_id":"ListEvents" + } + ], + "title":"Querying Test Events of a Function", + "githuburl":"" + }, + { + "uri":"functiongraph_06_0133.html", + "node_id":"functiongraph_06_0133.xml", + "product_code":"", + "code":"33", + "des":"This API is used to create a test event.POST /v2/{project_id}/fgs/functions/{function_urn}/eventsStatus code: 200Status code: 400Status code: 401Status code: 403Status co", + "doc_type":"api", + "kw":"Creating a Test Event,Test Events,API Reference", + "search_title":"", + "metedata":[ + { + "opensource":"true", + "documenttype":"api", + "operation_id":"CreateEvent" + } + ], + "title":"Creating a Test Event", + "githuburl":"" + }, + { + "uri":"functiongraph_06_0129.html", + "node_id":"functiongraph_06_0129.xml", + "product_code":"", + "code":"34", + "des":"This API is used to delete a test event.DELETE /v2/{project_id}/fgs/functions/{function_urn}/events/{event_id}Status code: 400Status code: 401Status code: 403Status code:", + "doc_type":"api", + "kw":"Deleting a Test Event,Test Events,API Reference", + "search_title":"", + "metedata":[ + { + "opensource":"true", + "documenttype":"api", + "operation_id":"DeleteEvent" + } + ], + "title":"Deleting a Test Event", + "githuburl":"" + }, + { + "uri":"functiongraph_06_0135.html", + "node_id":"functiongraph_06_0135.xml", + "product_code":"", + "code":"35", + "des":"This API is used to query the details of a test event.GET /v2/{project_id}/fgs/functions/{function_urn}/events/{event_id}Status code: 200Status code: 400Status code: 401S", + "doc_type":"api", + "kw":"Obtaining the Details of a Test Event,Test Events,API Reference", + "search_title":"", + "metedata":[ + { + "opensource":"true", + "documenttype":"api", + "operation_id":"ShowEvent" + } + ], + "title":"Obtaining the Details of a Test Event", + "githuburl":"" + }, + { + "uri":"functiongraph_06_0136.html", + "node_id":"functiongraph_06_0136.xml", + "product_code":"", + "code":"36", + "des":"This API is used to update a test event.PUT /v2/{project_id}/fgs/functions/{function_urn}/events/{event_id}Status code: 200Status code: 400Status code: 401Status code: 40", + "doc_type":"api", + "kw":"Updating a Test Event,Test Events,API Reference", + "search_title":"", + "metedata":[ + { + "opensource":"true", + "documenttype":"api", + "operation_id":"UpdateEvent" + } + ], + "title":"Updating a Test Event", + "githuburl":"" + }, + { + "uri":"FunctionLifecycleManagement.html", + "node_id":"functionlifecyclemanagement.xml", + "product_code":"", + "code":"37", + "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "doc_type":"api", + "kw":"Function Lifecycle Management", + "search_title":"", + "metedata":[ + { + "documenttype":"api" + } + ], + "title":"Function Lifecycle Management", + "githuburl":"" + }, + { + "uri":"functiongraph_06_0105.html", + "node_id":"functiongraph_06_0105.xml", + "product_code":"", + "code":"38", + "des":"This API is used to query all functions.GET /v2/{project_id}/fgs/functionsStatus code: 200Status code: 401Status code: 403Status code: 404Status code: 500Query functions ", + "doc_type":"api", + "kw":"Querying Functions,Function Lifecycle Management,API Reference", + "search_title":"", + "metedata":[ + { + "opensource":"true", + "documenttype":"api", + "operation_id":"ListFunctions" + } + ], + "title":"Querying Functions", + "githuburl":"" + }, + { + "uri":"functiongraph_06_0108.html", + "node_id":"functiongraph_06_0108.xml", + "product_code":"", + "code":"39", + "des":"This API is used to create a function.POST /v2/{project_id}/fgs/functionsStatus code: 200Status code: 400Status code: 401Status code: 403Status code: 404Status code: 500S", + "doc_type":"api", + "kw":"Creating a Function,Function Lifecycle Management,API Reference", + "search_title":"", + "metedata":[ + { + "opensource":"true", + "documenttype":"api", + "operation_id":"CreateFunction" + } + ], + "title":"Creating a Function", + "githuburl":"" + }, + { + "uri":"functiongraph_06_0109.html", + "node_id":"functiongraph_06_0109.xml", + "product_code":"", + "code":"40", + "des":"This API is used to delete a function or a non-latest version of a function.If the URN contains a function version or alias, the function version or the version correspon", + "doc_type":"api", + "kw":"Deleting a Function or Function Version,Function Lifecycle Management,API Reference", + "search_title":"", + "metedata":[ + { + "opensource":"true", + "documenttype":"api", + "operation_id":"DeleteFunction" + } + ], + "title":"Deleting a Function or Function Version", + "githuburl":"" + }, + { + "uri":"functiongraph_06_0107.html", + "node_id":"functiongraph_06_0107.xml", + "product_code":"", + "code":"41", + "des":"This API is used to query the code of a function.GET /v2/{project_id}/fgs/functions/{function_urn}/codeStatus code: 200Status code: 400Status code: 401Status code: 403Sta", + "doc_type":"api", + "kw":"Querying the Code of a Function,Function Lifecycle Management,API Reference", + "search_title":"", + "metedata":[ + { + "opensource":"true", + "documenttype":"api", + "operation_id":"ShowFunctionCode" + } + ], + "title":"Querying the Code of a Function", + "githuburl":"" + }, + { + "uri":"functiongraph_06_0110.html", + "node_id":"functiongraph_06_0110.xml", + "product_code":"", + "code":"42", + "des":"This API is used to modify the code of a function.PUT /v2/{project_id}/fgs/functions/{function_urn}/codeStatus code: 200Status code: 400Status code: 401Status code: 403St", + "doc_type":"api", + "kw":"Modifying the Code of a Function,Function Lifecycle Management,API Reference", + "search_title":"", + "metedata":[ + { + "opensource":"true", + "documenttype":"api", + "operation_id":"UpdateFunctionCode" + } + ], + "title":"Modifying the Code of a Function", + "githuburl":"" + }, + { + "uri":"functiongraph_06_0106.html", + "node_id":"functiongraph_06_0106.xml", + "product_code":"", + "code":"43", + "des":"This API is used to query the metadata of a function.GET /v2/{project_id}/fgs/functions/{function_urn}/configStatus code: 200Status code: 400Status code: 401Status code: ", + "doc_type":"api", + "kw":"Querying the Metadata of a Function,Function Lifecycle Management,API Reference", + "search_title":"", + "metedata":[ + { + "opensource":"true", + "documenttype":"api", + "operation_id":"ShowFunctionConfig" + } + ], + "title":"Querying the Metadata of a Function", + "githuburl":"" + }, + { + "uri":"functiongraph_06_0111.html", + "node_id":"functiongraph_06_0111.xml", + "product_code":"", + "code":"44", + "des":"This API is used to modify the metadata of a function.PUT /v2/{project_id}/fgs/functions/{function_urn}/configStatus code: 200Status code: 400Status code: 401Status code:", + "doc_type":"api", + "kw":"Modifying the Metadata of a Function,Function Lifecycle Management,API Reference", + "search_title":"", + "metedata":[ + { + "opensource":"true", + "documenttype":"api", + "operation_id":"UpdateFunctionConfig" + } + ], + "title":"Modifying the Metadata of a Function", + "githuburl":"" + }, + { + "uri":"functiongraph_06_1018.html", + "node_id":"functiongraph_06_1018.xml", + "product_code":"", + "code":"45", + "des":"This API is used to update the maximum number of instances of a function.PUT /v2/{project_id}/fgs/functions/{function_urn}/config-max-instanceStatus code: 200Status code:", + "doc_type":"api", + "kw":"Updating Max. Instances of a Function,Function Lifecycle Management,API Reference", + "search_title":"", + "metedata":[ + { + "opensource":"true", + "documenttype":"api", + "operation_id":"UpdateFunctionMaxInstanceConfig" + } + ], + "title":"Updating Max. Instances of a Function", + "githuburl":"" + }, + { + "uri":"functiongraph_23_1031_01.html", + "node_id":"functiongraph_23_1031_01.xml", + "product_code":"", + "code":"46", + "des":"This API is used to query function tags.GET /v2/{project_id}/{resource_type}/{resource_id}/tagsStatus code: 200Status code: 400Status code: 401Status code: 403Status code", + "doc_type":"api", + "kw":"Querying Function Tags,Function Lifecycle Management,API Reference", + "search_title":"", + "metedata":[ + { + "opensource":"true", + "documenttype":"api", + "operation_id":"ListFunctionTags" + } + ], + "title":"Querying Function Tags", + "githuburl":"" + }, + { + "uri":"functiongraph_23_1031_02.html", + "node_id":"functiongraph_23_1031_02.xml", + "product_code":"", + "code":"47", + "des":"This API is used to query ServiceBridge functions bound to a specified function.GET /v2/{project_id}/fgs/functions/{function_urn}/servicebridge/relationStatus code: 200St", + "doc_type":"api", + "kw":"Querying ServiceBridge Functions Bound to a Specified Function,Function Lifecycle Management,API Ref", + "search_title":"", + "metedata":[ + { + "opensource":"true", + "documenttype":"api", + "operation_id":"ListBridgeFunctions" + } + ], + "title":"Querying ServiceBridge Functions Bound to a Specified Function", + "githuburl":"" + }, + { + "uri":"functiongraph_06_1022.html", + "node_id":"functiongraph_06_1022.xml", + "product_code":"", + "code":"48", + "des":"This API is used to query resource tags.GET /v2/{project_id}/{resource_type}/tagsStatus code: 200Status code: 400Status code: 401Status code: 403Status code: 500Query res", + "doc_type":"api", + "kw":"Querying Resource Tags,Function Lifecycle Management,API Reference", + "search_title":"", + "metedata":[ + { + "opensource":"true", + "documenttype":"api", + "operation_id":"ShowProjectTagsList" + } + ], + "title":"Querying Resource Tags", + "githuburl":"" + }, + { + "uri":"functiongraph_06_1021.html", + "node_id":"functiongraph_06_1021.xml", + "product_code":"", + "code":"49", + "des":"This API is used to query resources.POST /v2/{project_id}/{resource_type}/resource-instances/{action}Status code: 200Status code: 400Status code: 401Status code: 403Statu", + "doc_type":"api", + "kw":"Querying Resources,Function Lifecycle Management,API Reference", + "search_title":"", + "metedata":[ + { + "opensource":"true", + "documenttype":"api", + "operation_id":"ShowResInstanceInfo" + } + ], + "title":"Querying Resources", + "githuburl":"" + }, + { + "uri":"functiongraph_06_1024.html", + "node_id":"functiongraph_06_1024.xml", + "product_code":"", + "code":"50", + "des":"This API is used to delete resource tags.DELETE /v2/{project_id}/{resource_type}/{resource_id}/tags/deleteStatus code: 400Delete resource tags.NoneSee Error Codes.", + "doc_type":"api", + "kw":"Deleting Resource Tags,Function Lifecycle Management,API Reference", + "search_title":"", + "metedata":[ + { + "opensource":"true", + "documenttype":"api", + "operation_id":"DeleteTags" + } + ], + "title":"Deleting Resource Tags", + "githuburl":"" + }, + { + "uri":"functiongraph_06_1023.html", + "node_id":"functiongraph_06_1023.xml", + "product_code":"", + "code":"51", + "des":"This API is used to create resource tags.POST /v2/{project_id}/{resource_type}/{resource_id}/tags/createStatus code: 400Create resource tags testKey1:testValue1 and testK", + "doc_type":"api", + "kw":"Creating Resource Tags,Function Lifecycle Management,API Reference", + "search_title":"", + "metedata":[ + { + "opensource":"true", + "documenttype":"api", + "operation_id":"CreateTags" + } + ], + "title":"Creating Resource Tags", + "githuburl":"" + }, + { + "uri":"functiongraph_23_1031_04.html", + "node_id":"functiongraph_23_1031_04.xml", + "product_code":"", + "code":"52", + "des":"This API is used to update the pinning status of a function.PUT /v2/{project_id}/fgs/functions/{func_urn}/collect/{state}Status code: 500Update the pinning status of a fu", + "doc_type":"api", + "kw":"Updating the Pinning Status of a Function,Function Lifecycle Management,API Reference", + "search_title":"", + "metedata":[ + { + "opensource":"true", + "documenttype":"api", + "operation_id":"UpdateFunctionCollectState" + } + ], + "title":"Updating the Pinning Status of a Function", + "githuburl":"" + }, + { + "uri":"functiongraph_23_1031_03.html", + "node_id":"functiongraph_23_1031_03.xml", + "product_code":"", + "code":"53", + "des":"This API is used to query the available ServiceBridge version.GET /v2/{project_id}/fgs/servicebridge/versionStatus code: 200Status code: 400Status code: 401Status code: 4", + "doc_type":"api", + "kw":"Querying the Available ServiceBridge Version,Function Lifecycle Management,API Reference", + "search_title":"", + "metedata":[ + { + "opensource":"true", + "documenttype":"api", + "operation_id":"ListBridgeVersions" + } + ], + "title":"Querying the Available ServiceBridge Version", + "githuburl":"" + }, + { + "uri":"VersionsandAliases.html", + "node_id":"versionsandaliases.xml", + "product_code":"", + "code":"54", + "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "doc_type":"api", + "kw":"Versions and Aliases", + "search_title":"", + "metedata":[ + { + "documenttype":"api" + } + ], + "title":"Versions and Aliases", + "githuburl":"" + }, + { + "uri":"functiongraph_06_0118.html", + "node_id":"functiongraph_06_0118.xml", + "product_code":"", + "code":"55", + "des":"This API is used to query the versions and aliases of a function.GET /v2/{project_id}/fgs/functions/{function_urn}/aliasesStatus code: 200Status code: 401Status code: 403", + "doc_type":"api", + "kw":"Querying All Versions and Aliases of a Function,Versions and Aliases,API Reference", + "search_title":"", + "metedata":[ + { + "opensource":"true", + "documenttype":"api", + "operation_id":"ListVersionAliases" + } + ], + "title":"Querying All Versions and Aliases of a Function", + "githuburl":"" + }, + { + "uri":"functiongraph_06_0114.html", + "node_id":"functiongraph_06_0114.xml", + "product_code":"", + "code":"56", + "des":"This API is used to create an alias for a function version.POST /v2/{project_id}/fgs/functions/{function_urn}/aliasesStatus code: 200Status code: 400Status code: 401Statu", + "doc_type":"api", + "kw":"Creating an Alias for a Function Version,Versions and Aliases,API Reference", + "search_title":"", + "metedata":[ + { + "opensource":"true", + "documenttype":"api", + "operation_id":"CreateVersionAlias" + } + ], + "title":"Creating an Alias for a Function Version", + "githuburl":"" + }, + { + "uri":"functiongraph_06_0116.html", + "node_id":"functiongraph_06_0116.xml", + "product_code":"", + "code":"57", + "des":"This API is used to delete an alias of a function version.DELETE /v2/{project_id}/fgs/functions/{function_urn}/aliases/{alias_name}Status code: 401Status code: 403Status ", + "doc_type":"api", + "kw":"Deleting an Alias of a Function Version,Versions and Aliases,API Reference", + "search_title":"", + "metedata":[ + { + "opensource":"true", + "documenttype":"api", + "operation_id":"DeleteVersionAlias" + } + ], + "title":"Deleting an Alias of a Function Version", + "githuburl":"" + }, + { + "uri":"functiongraph_06_0117.html", + "node_id":"functiongraph_06_0117.xml", + "product_code":"", + "code":"58", + "des":"This API is used to query the alias of a function version.GET /v2/{project_id}/fgs/functions/{function_urn}/aliases/{alias_name}Status code: 200Status code: 401Status cod", + "doc_type":"api", + "kw":"Querying the Alias of a Function Version,Versions and Aliases,API Reference", + "search_title":"", + "metedata":[ + { + "opensource":"true", + "documenttype":"api", + "operation_id":"ShowVersionAlias" + } + ], + "title":"Querying the Alias of a Function Version", + "githuburl":"" + }, + { + "uri":"functiongraph_06_0115.html", + "node_id":"functiongraph_06_0115.xml", + "product_code":"", + "code":"59", + "des":"This API is used to modify the alias of a function version.PUT /v2/{project_id}/fgs/functions/{function_urn}/aliases/{alias_name}Status code: 200Status code: 400Status co", + "doc_type":"api", + "kw":"Modifying the Alias of a Function Version,Versions and Aliases,API Reference", + "search_title":"", + "metedata":[ + { + "opensource":"true", + "documenttype":"api", + "operation_id":"UpdateVersionAlias" + } + ], + "title":"Modifying the Alias of a Function Version", + "githuburl":"" + }, + { + "uri":"functiongraph_06_0113.html", + "node_id":"functiongraph_06_0113.xml", + "product_code":"", + "code":"60", + "des":"This API is used to query the versions of a function.GET /v2/{project_id}/fgs/functions/{function_urn}/versionsStatus code: 200Status code: 400Status code: 401Status code", + "doc_type":"api", + "kw":"Querying the Versions of a Function,Versions and Aliases,API Reference", + "search_title":"", + "metedata":[ + { + "opensource":"true", + "documenttype":"api", + "operation_id":"ListFunctionVersions" + } + ], + "title":"Querying the Versions of a Function", + "githuburl":"" + }, + { + "uri":"functiongraph_06_0144.html", + "node_id":"functiongraph_06_0144.xml", + "product_code":"", + "code":"61", + "des":"This API is used to publish a function version.POST /v2/{project_id}/fgs/functions/{function_urn}/versionsStatus code: 200Status code: 400Status code: 401Status code: 403", + "doc_type":"api", + "kw":"Publishing a Function Version,Versions and Aliases,API Reference", + "search_title":"", + "metedata":[ + { + "opensource":"true", + "documenttype":"api", + "operation_id":"CreateFunctionVersion" + } + ], + "title":"Publishing a Function Version", + "githuburl":"" + }, + { + "uri":"FunctionMetrics.html", + "node_id":"functionmetrics.xml", + "product_code":"", + "code":"62", + "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "doc_type":"api", + "kw":"Function Metrics", + "search_title":"", + "metedata":[ + { + "documenttype":"api" + } + ], + "title":"Function Metrics", + "githuburl":"" + }, + { + "uri":"functiongraph_06_0139.html", + "node_id":"functiongraph_06_0139.xml", + "product_code":"", + "code":"63", + "des":"This API is used to query tenant-level function statistics.The statistics include function format, quota and usage, and traffic report.You can query data in a specific pe", + "doc_type":"api", + "kw":"Querying Tenant-Level Function Statistics,Function Metrics,API Reference", + "search_title":"", + "metedata":[ + { + "opensource":"true", + "documenttype":"api", + "operation_id":"ListStatistics" + } + ], + "title":"Querying Tenant-Level Function Statistics", + "githuburl":"" + }, + { + "uri":"functiongraph_06_0138.html", + "node_id":"functiongraph_06_0138.xml", + "product_code":"", + "code":"64", + "des":"This API is used to query metrics of a function in a specified period.GET /v2/{project_id}/fgs/functions/{func_urn}/statistics/{period}Status code: 200Query metrics of a ", + "doc_type":"api", + "kw":"Querying Metrics in a Specified Period,Function Metrics,API Reference", + "search_title":"", + "metedata":[ + { + "opensource":"true", + "documenttype":"api", + "operation_id":"ListFunctionStatistics" + } + ], + "title":"Querying Metrics in a Specified Period", + "githuburl":"" + }, + { + "uri":"FunctionLogs.html", + "node_id":"functionlogs.xml", + "product_code":"", + "code":"65", + "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "doc_type":"api", + "kw":"Function Logs", + "search_title":"", + "metedata":[ + { + "documenttype":"api" + } + ], + "title":"Function Logs", + "githuburl":"" + }, + { + "uri":"functiongraph_06_0145.html", + "node_id":"functiongraph_06_0145.xml", + "product_code":"", + "code":"66", + "des":"This API is used to query the LTS log group and stream settings of a function.GET /v2/{project_id}/fgs/functions/{function_urn}/lts-log-detailStatus code: 200Status code:", + "doc_type":"api", + "kw":"Querying the Log Group and Stream of a Function,Function Logs,API Reference", + "search_title":"", + "metedata":[ + { + "opensource":"true", + "documenttype":"api", + "operation_id":"ShowLtsLogDetails" + } + ], + "title":"Querying the Log Group and Stream of a Function", + "githuburl":"" + }, + { + "uri":"functiongraph_06_0112_01.html", + "node_id":"functiongraph_06_0112_01.xml", + "product_code":"", + "code":"67", + "des":"This API is used to enable log reporting to LTS.POST /v2/{project_id}/fgs/functions/enable-lts-logsStatus code: 429Enable log reporting to LTS.Status code: 429Too many re", + "doc_type":"api", + "kw":"Enabling Log Reporting to LTS,Function Logs,API Reference", + "search_title":"", + "metedata":[ + { + "opensource":"true", + "documenttype":"api", + "operation_id":"EnableLtsLogs" + } + ], + "title":"Enabling Log Reporting to LTS", + "githuburl":"" + }, + { + "uri":"Templates.html", + "node_id":"templates.xml", + "product_code":"", + "code":"68", + "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "doc_type":"api", + "kw":"Function Templates", + "search_title":"", + "metedata":[ + { + "documenttype":"api" + } + ], + "title":"Function Templates", + "githuburl":"" + }, + { + "uri":"functiongraph_23_1031_06.html", + "node_id":"functiongraph_23_1031_06.xml", + "product_code":"", + "code":"69", + "des":"This API is used to query a specified function template.GET /v2/{project_id}/fgs/templates/{template_id}Status code: 200Status code: 400Status code: 401Status code: 403St", + "doc_type":"api", + "kw":"Querying a Specified Function Template,Function Templates,API Reference", + "search_title":"", + "metedata":[ + { + "opensource":"true", + "documenttype":"api", + "operation_id":"ShowFunctionTemplate" + } + ], + "title":"Querying a Specified Function Template", + "githuburl":"" + }, + { + "uri":"ReservedInstances.html", + "node_id":"reservedinstances.xml", + "product_code":"", + "code":"70", + "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "doc_type":"api", + "kw":"Reserved Instances", + "search_title":"", + "metedata":[ + { + "documenttype":"api" + } + ], + "title":"Reserved Instances", + "githuburl":"" + }, + { + "uri":"functiongraph_06_0112_2.html", + "node_id":"functiongraph_06_0112_2.xml", + "product_code":"", + "code":"71", + "des":"This API is used to query reserved instances of a function.GET /v2/{project_id}/fgs/functions/reservedinstanceconfigsStatus code: 200Status code: 400Status code: 401Statu", + "doc_type":"api", + "kw":"Querying Reserved Instances of a Function,Reserved Instances,API Reference", + "search_title":"", + "metedata":[ + { + "opensource":"true", + "documenttype":"api", + "operation_id":"ListReservedInstanceConfigs" + } + ], + "title":"Querying Reserved Instances of a Function", + "githuburl":"" + }, + { + "uri":"functiongraph_06_0112_1.html", + "node_id":"functiongraph_06_0112_1.xml", + "product_code":"", + "code":"72", + "des":"This API is used to change the number of reserved instances.PUT /v2/{project_id}/fgs/functions/{function_urn}/reservedinstancesStatus code: 200Status code: 400Status code", + "doc_type":"api", + "kw":"Changing the Number of Reserved Instances,Reserved Instances,API Reference", + "search_title":"", + "metedata":[ + { + "opensource":"true", + "documenttype":"api", + "operation_id":"UpdateFunctionReservedInstancesCount" + } + ], + "title":"Changing the Number of Reserved Instances", + "githuburl":"" + }, + { + "uri":"functiongraph_06_0112_3.html", + "node_id":"functiongraph_06_0112_3.xml", + "product_code":"", + "code":"73", + "des":"This API is used to query the number of instances reserved for a function.GET /v2/{project_id}/fgs/functions/reservedinstancesStatus code: 200Status code: 400Status code:", + "doc_type":"api", + "kw":"Querying the Number of Reserved Instances,Reserved Instances,API Reference", + "search_title":"", + "metedata":[ + { + "opensource":"true", + "documenttype":"api", + "operation_id":"ListFunctionReservedInstances" + } + ], + "title":"Querying the Number of Reserved Instances", + "githuburl":"" + }, + { + "uri":"FunctionImportAndExport.html", + "node_id":"functionimportandexport.xml", + "product_code":"", + "code":"74", + "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "doc_type":"api", + "kw":"Function Import and Export", + "search_title":"", + "metedata":[ + { + "documenttype":"api" + } + ], + "title":"Function Import and Export", + "githuburl":"" + }, + { + "uri":"functiongraph_06_0108_1.html", + "node_id":"functiongraph_06_0108_1.xml", + "product_code":"", + "code":"75", + "des":"This API is used to export a function.GET /v2/{project_id}/fgs/functions/{function_urn}/exportStatus code: 404Status code: 500Export function code only.GET /v2/{project_i", + "doc_type":"api", + "kw":"Exporting a Function,Function Import and Export,API Reference", + "search_title":"", + "metedata":[ + { + "opensource":"true", + "documenttype":"api", + "operation_id":"ExportFunction" + } + ], + "title":"Exporting a Function", + "githuburl":"" + }, + { + "uri":"functiongraph_06_0108_0.html", + "node_id":"functiongraph_06_0108_0.xml", + "product_code":"", + "code":"76", + "des":"This API is used to import a function.POST /v2/{project_id}/fgs/functions/importStatus code: 200Status code: 409Status code: 500Import a function from a Base64-encoded fi", + "doc_type":"api", + "kw":"Importing a Function,Function Import and Export,API Reference", + "search_title":"", + "metedata":[ + { + "opensource":"true", + "documenttype":"api", + "operation_id":"ImportFunction" + } + ], + "title":"Importing a Function", + "githuburl":"" + }, + { + "uri":"FunctionTriggers.html", + "node_id":"functiontriggers.xml", + "product_code":"", + "code":"77", + "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "doc_type":"api", + "kw":"Function Triggers", + "search_title":"", + "metedata":[ + { + "documenttype":"api" + } + ], + "title":"Function Triggers", + "githuburl":"" + }, + { + "uri":"functiongraph_06_0121.html", + "node_id":"functiongraph_06_0121.xml", + "product_code":"", + "code":"78", + "des":"This API is used to delete all triggers of a function.If a non-latest function version is specified, all triggers corresponding to the version will be deleted.If an alias", + "doc_type":"api", + "kw":"Deleting All Triggers of a Function,Function Triggers,API Reference", + "search_title":"", + "metedata":[ + { + "opensource":"true", + "documenttype":"api", + "operation_id":"BatchDeleteFunctionTriggers" + } + ], + "title":"Deleting All Triggers of a Function", + "githuburl":"" + }, + { + "uri":"functiongraph_06_0119.html", + "node_id":"functiongraph_06_0119.xml", + "product_code":"", + "code":"79", + "des":"This API is used to query all triggers of a function.GET /v2/{project_id}/fgs/triggers/{function_urn}Status code: 200Status code: 400Status code: 401Status code: 403Statu", + "doc_type":"api", + "kw":"Querying All Triggers of a Function,Function Triggers,API Reference", + "search_title":"", + "metedata":[ + { + "opensource":"true", + "documenttype":"api", + "operation_id":"ListFunctionTriggers" + } + ], + "title":"Querying All Triggers of a Function", + "githuburl":"" + }, + { + "uri":"functiongraph_06_0122.html", + "node_id":"functiongraph_06_0122.xml", + "product_code":"", + "code":"80", + "des":"This API is used to create a trigger.Trigger types include timer, APIG, CTS, DDS, DMS, DIS, LTS, OBS, SMN, and Kafka.Trigger types include timer, APIG, CTS, DDS, DMS, DIS", + "doc_type":"api", + "kw":"Creating a Trigger,Function Triggers,API Reference", + "search_title":"", + "metedata":[ + { + "opensource":"true", + "documenttype":"api", + "operation_id":"CreateFunctionTrigger" + } + ], + "title":"Creating a Trigger", + "githuburl":"" + }, + { + "uri":"functiongraph_06_0123.html", + "node_id":"functiongraph_06_0123.xml", + "product_code":"", + "code":"81", + "des":"This API is used to delete a trigger.DELETE /v2/{project_id}/fgs/triggers/{function_urn}/{trigger_type_code}/{trigger_id}Status code: 400Status code: 401Status code: 403S", + "doc_type":"api", + "kw":"Deleting a Trigger,Function Triggers,API Reference", + "search_title":"", + "metedata":[ + { + "opensource":"true", + "documenttype":"api", + "operation_id":"DeleteFunctionTrigger" + } + ], + "title":"Deleting a Trigger", + "githuburl":"" + }, + { + "uri":"functiongraph_06_0120.html", + "node_id":"functiongraph_06_0120.xml", + "product_code":"", + "code":"82", + "des":"This API is used to query a specified trigger.GET /v2/{project_id}/fgs/triggers/{function_urn}/{trigger_type_code}/{trigger_id}Status code: 200Status code: 400Status code", + "doc_type":"api", + "kw":"Querying a Trigger,Function Triggers,API Reference", + "search_title":"", + "metedata":[ + { + "opensource":"true", + "documenttype":"api", + "operation_id":"ShowFunctionTrigger" + } + ], + "title":"Querying a Trigger", + "githuburl":"" + }, + { + "uri":"functiongraph_06_0124.html", + "node_id":"functiongraph_06_0124.xml", + "product_code":"", + "code":"83", + "des":"This API is used to update a trigger.PUT /v2/{project_id}/fgs/triggers/{function_urn}/{trigger_type_code}/{trigger_id}Status code: 200Status code: 404Enable a trigger.Sta", + "doc_type":"api", + "kw":"Updating a Trigger,Function Triggers,API Reference", + "search_title":"", + "metedata":[ + { + "opensource":"true", + "documenttype":"api", + "operation_id":"UpdateTrigger" + } + ], + "title":"Updating a Trigger", + "githuburl":"" + }, + { + "uri":"AsynchronousExecutionNotification.html", + "node_id":"asynchronousexecutionnotification.xml", + "product_code":"", + "code":"84", + "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "doc_type":"api", + "kw":"Asynchronous Execution Notification", + "search_title":"", + "metedata":[ + { + "documenttype":"api" + } + ], + "title":"Asynchronous Execution Notification", + "githuburl":"" + }, + { + "uri":"functiongraph_06_0140.html", + "node_id":"functiongraph_06_0140.xml", + "product_code":"", + "code":"85", + "des":"This API is used to query the asynchronous invocation setting of a function version.GET /v2/{project_id}/fgs/functions/{function_urn}/async-invoke-configStatus code: 200S", + "doc_type":"api", + "kw":"Querying Asynchronous Execution Notification Settings of a Function Version,Asynchronous Execution N", + "search_title":"", + "metedata":[ + { + "opensource":"true", + "documenttype":"api", + "operation_id":"ShowFunctionAsyncInvokeConfig" + } + ], + "title":"Querying Asynchronous Execution Notification Settings of a Function Version", + "githuburl":"" + }, + { + "uri":"functiongraph_06_0141.html", + "node_id":"functiongraph_06_0141.xml", + "product_code":"", + "code":"86", + "des":"This API is used to delete the asynchronous execution notification settings of a function.DELETE /v2/{project_id}/fgs/functions/{function_urn}/async-invoke-configStatus c", + "doc_type":"api", + "kw":"Deleting Asynchronous Execution Notification Settings,Asynchronous Execution Notification,API Refere", + "search_title":"", + "metedata":[ + { + "opensource":"true", + "documenttype":"api", + "operation_id":"DeleteFunctionAsyncInvokeConfig" + } + ], + "title":"Deleting Asynchronous Execution Notification Settings", + "githuburl":"" + }, + { + "uri":"functiongraph_06_0142.html", + "node_id":"functiongraph_06_0142.xml", + "product_code":"", + "code":"87", + "des":"This API is used to configure asynchronous execution notification for a function.PUT /v2/{project_id}/fgs/functions/{function_urn}/async-invoke-configStatus code: 200Stat", + "doc_type":"api", + "kw":"Configuring Asynchronous Execution Notification,Asynchronous Execution Notification,API Reference", + "search_title":"", + "metedata":[ + { + "opensource":"true", + "documenttype":"api", + "operation_id":"UpdateFunctionAsyncInvokeConfig" + } + ], + "title":"Configuring Asynchronous Execution Notification", + "githuburl":"" + }, + { + "uri":"functiongraph_06_0143.html", + "node_id":"functiongraph_06_0143.xml", + "product_code":"", + "code":"88", + "des":"This API is used to query the asynchronous execution notification settings of a function's all versions.GET /v2/{project_id}/fgs/functions/{function_urn}/async-invoke-con", + "doc_type":"api", + "kw":"Querying Asynchronous Execution Notification Settings of a Function's All Versions,Asynchronous Exec", + "search_title":"", + "metedata":[ + { + "opensource":"true", + "documenttype":"api", + "operation_id":"ListFunctionAsyncInvokeConfig" + } + ], + "title":"Querying Asynchronous Execution Notification Settings of a Function's All Versions", + "githuburl":"" + }, + { + "uri":"functiongraph_06_0112_00_3.html", + "node_id":"functiongraph_06_0112_00_3.xml", + "product_code":"", + "code":"89", + "des":"This API is used to query the asynchronous invocation requests of a function.GET /v2/{project_id}/fgs/functions/{function_urn}/async-invocationsStatus code: 200Status cod", + "doc_type":"api", + "kw":"Querying Asynchronous Invocation Requests,Asynchronous Execution Notification,API Reference", + "search_title":"", + "metedata":[ + { + "opensource":"true", + "documenttype":"api", + "operation_id":"ListAsyncInvocations" + } + ], + "title":"Querying Asynchronous Invocation Requests", + "githuburl":"" + }, + { + "uri":"functiongraph_06_0146_00_1.html", + "node_id":"functiongraph_06_0146_00_1.xml", + "product_code":"", + "code":"90", + "des":"This API is used to stop asynchronous invocation of a function with N concurrent instances. When calling this API, set recursive to false and force to true. The API will ", + "doc_type":"api", + "kw":"Stopping an Asynchronous Invocation Request,Asynchronous Execution Notification,API Reference", + "search_title":"", + "metedata":[ + { + "opensource":"true", + "documenttype":"api", + "operation_id":"CancelAsyncInvocation" + } + ], + "title":"Stopping an Asynchronous Invocation Request", + "githuburl":"" + }, + { + "uri":"functiongraph_06_1300.html", + "node_id":"functiongraph_06_1300.xml", + "product_code":"functiongraph", + "code":"91", + "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "doc_type":"api", + "kw":"Appendix", + "search_title":"", + "metedata":[ + { + "documenttype":"api", + "prodname":"functiongraph" + } + ], + "title":"Appendix", + "githuburl":"" + }, + { + "uri":"functiongraph_06_1310.html", + "node_id":"functiongraph_06_1310.xml", + "product_code":"functiongraph", + "code":"92", + "des":"Table 1 describes the status codes.", + "doc_type":"api", + "kw":"Status Codes,Appendix,API Reference", + "search_title":"", + "metedata":[ + { + "documenttype":"api", + "prodname":"functiongraph" + } + ], + "title":"Status Codes", + "githuburl":"" + }, + { + "uri":"ErrorCode.html", + "node_id":"errorcode.xml", + "product_code":"functiongraph", + "code":"93", + "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "doc_type":"api", + "kw":"Error Codes,Appendix,API Reference", + "search_title":"", + "metedata":[ + { + "documenttype":"api", + "prodname":"functiongraph" + } + ], + "title":"Error Codes", + "githuburl":"" + }, + { + "uri":"functiongraph_06_0260.html", + "node_id":"functiongraph_06_0260.xml", + "product_code":"functiongraph", + "code":"94", + "des":"When calling APIs, you need to enter a project ID in some URLs. To obtain a project ID, perform the following steps:Log in to the management console.Click the username an", + "doc_type":"api", + "kw":"Obtaining a Project ID,Appendix,API Reference", + "search_title":"", + "metedata":[ + { + "documenttype":"api", + "prodname":"functiongraph" + } + ], + "title":"Obtaining a Project ID", + "githuburl":"" + }, + { + "uri":"functiongraph_06_1340.html", + "node_id":"functiongraph_06_1340.xml", + "product_code":"functiongraph", + "code":"95", + "des":"This section describes the function metrics reported to Cloud Eye.Their namespace and dimension are also included. You can view monitoring graphs and alarm messages on th", + "doc_type":"api", + "kw":"FunctionGraph Metrics,Appendix,API Reference", + "search_title":"", + "metedata":[ + { + "documenttype":"api", + "prodname":"functiongraph" + } + ], + "title":"FunctionGraph Metrics", + "githuburl":"" + } +] \ No newline at end of file diff --git a/docs/fg/api-ref/AsynchronousExecutionNotification.html b/docs/fg/api-ref/AsynchronousExecutionNotification.html new file mode 100644 index 00000000..1ac55d66 --- /dev/null +++ b/docs/fg/api-ref/AsynchronousExecutionNotification.html @@ -0,0 +1,26 @@ + + +
+
+
Status Code + |
+Error Code + |
+Error Message + |
+Description + |
+
---|---|---|---|
400 + |
+FSS.0400 + |
+Invalid parameter. + |
+Invalid request parameters. + |
+
401 + |
+FSS.0401 + |
+Unauthorized access. + |
+Access denied. + |
+
403 + |
+FSS.0403 + |
+Forbidden + |
+Unauthorized operation. + |
+
404 + |
+FSS.0404 + |
+The specified resource was not found. + |
+The resource cannot be found. + |
+
406 + |
+FSS.0406 + |
+Not acceptable. + |
+Incorrect request format. For example, the request body may not be in the required JSON format. + |
+
408 + |
+FSS.0408 + |
+Request timeout. + |
+Request timed out. + |
+
409 + |
+FSS.0409 + |
+The specified resource already exists. + |
+The resource already exists. + |
+
410 + |
+FSS.0410 + |
+The specified resource does not exist. + |
+The specified resource does not exist. + |
+
413 + |
+FSS.0413 + |
+The request body is too large. + |
+The request body exceeds the maximum allowed limit. + |
+
424 + |
+FSS.0424 + |
+Invalid dependency. + |
+Invalid dependency. + |
+
426 + |
+FSS.0426 + |
+An upgrade is required. + |
+Unsupported operation. Perform an upgrade. + |
+
428 + |
+FSS.0428 + |
+The preconditions have not been met. + |
+The prerequisite has not been met. For example, you must delete related resources before deleting a resource. + |
+
429 + |
+FSS.0429 + |
+Too many requests. + |
+Too many concurrent requests. Please try again later. + |
+
500 + |
+FSS.0500 + |
+Internal server error. + |
+The service is temporarily abnormal due to an internal invocation error. Please try again later. + |
+
502 + |
+FSS.0502 + |
+Bad gateway. + |
+Gateway error. + |
+
503 + |
+FSS.0503 + |
+Service unavailable. + |
+Service unavailable. + |
+
504 + |
+FSS.0504 + |
+Gateway timeout. + |
+Gateway timed out. + |
+
400 + |
+FSS.1001 + |
+Invalid query parameter. + |
+Invalid query parameter. + |
+
400 + |
+FSS.1002 + |
+Invalid function name. + |
+Invalid function name. + |
+
400 + |
+FSS.1003 + |
+Invalid function handler. + |
+Invalid handler. + |
+
400 + |
+FSS.1004 + |
+Invalid Package (function app). + |
+Invalid function package. + |
+
400 + |
+FSS.1005 + |
+Invalid runtime. + |
+Invalid runtime. + |
+
400 + |
+FSS.1006 + |
+Invalid function code entry mode. + |
+Invalid code type. + |
+
400 + |
+FSS.1007 + |
+Invalid function memory. + |
+Invalid memory. + |
+
400 + |
+FSS.1008 + |
+Invalid function timeout. + |
+Invalid timeout. + |
+
400 + |
+FSS.1009 + |
+Invalid function UserData. + |
+Invalid environment variables. + |
+
400 + |
+FSS.1010 + |
+Invalid URL. + |
+Invalid URL. + |
+
400 + |
+FSS.1011 + |
+Invalid function code. + |
+Invalid function code. + |
+
400 + |
+FSS.1012 + |
+The function code must be configured. + |
+The function code cannot be left blank. + |
+
400 + |
+FSS.1013 + |
+Invalid file type. + |
+Invalid file type. + |
+
400 + |
+FSS.1014 + |
+Invalid function alias. + |
+Invalid alias. + |
+
400 + |
+FSS.1015 + |
+Invalid function version. + |
+Invalid version. + |
+
400 + |
+FSS.1016 + |
+The function cannot be published because no changes have been made since last publication. + |
+The function code cannot be published because it has not been changed since last publication. + |
+
400 + |
+FSS.1017 + |
+The number of items in the UserData field exceeds the maximum allowed limit (20). + |
+The number of environment variables exceeds 20. + |
+
400 + |
+FSS.1018 + |
+The total size of the UserData field exceeds the maximum allowed limit (2 KB). + |
+The total size of environment variables exceeds 2 KB. + |
+
400 + |
+FSS.1019 + |
+The description exceeds the maximum allowed limit. + |
+The maximum length is 512 characters. + |
+
400 + |
+FSS.1021 + |
+invalid service link agency. + |
+Failed to create the service-linked agency. + |
+
400 + |
+FSS.1022 + |
+Only one YAML file is allowed. + |
+Only one YAML file is allowed. + |
+
400 + |
+FSS.1023 + |
+The imported file is too large. + |
+The imported file exceeds the maximum allowed limit. + |
+
400 + |
+FSS.1024 + |
+Invalid dependency. + |
+Invalid dependency. + |
+
400 + |
+FSS.1025 + |
+Invalid YAML file. + |
+Invalid YAML file. + |
+
400 + |
+FSS.1026 + |
+Invalid Concurrency. + |
+Invalid concurrency policy. + |
+
400 + |
+FSS.1027 + |
+Invalid packageName (app name). + |
+Invalid package or app name. + |
+
400 + |
+FSS.1028 + |
+The app cannot be deleted because it contains functions. + |
+The app cannot be deleted because it contains functions. + |
+
400 + |
+FSS.1029 + |
+The default app cannot be deleted. + |
+The default app cannot be deleted. + |
+
400 + |
+FSS.1031 + |
+The dependency already exists. + |
+The dependency already exists. + |
+
400 + |
+FSS.1032 + |
+Invalid dependency type. + |
+Invalid dependency type. Currently, only local ZIP packages or packages from OBS can be uploaded. + |
+
412 + |
+FSS.1033 + |
+The dependency is currently in use. + |
+Failed to delete the dependency because it is in use. + |
+
400 + |
+FSS.1034 + |
+Invalid image URL. + |
+Invalid image URL. + |
+
400 + |
+FSS.1035 + |
+The image does not exist. + |
+The image does not exist. + |
+
400 + |
+FSS.1036 + |
+The VPC does not exist. + |
+The VPC does not exist. + |
+
400 + |
+FSS.1037 + |
+No subnet matches the specified ID. + |
+No matched subnets found. + |
+
400 + |
+FSS.1038 + |
+The file system configuration already exists in the function. + |
+The file system configuration already exists in the function. + |
+
400 + |
+FSS.1039 + |
+The mounting path is invalid. + |
+Invalid mounting path. + |
+
403 + |
+FSS.1040 + |
+The selected Xrole does not have permissions to mount the resources. + |
+The selected agency does not have permissions to mount the resources. + |
+
403 + |
+FSS.1041 + |
+The number of functions exceeds the maximum allowed limit. + |
+The number of functions exceeds 400. + |
+
403 + |
+FSS.1042 + |
+The total code size of functions exceeds the maximum allowed limit. + |
+The total size of functions exceeds 20 GB. + |
+
403 + |
+FSS.1043 + |
+The number of aliases exceeds the maximum allowed limit. + |
+The number of aliases exceeds the maximum allowed limit. + |
+
403 + |
+FSS.1044 + |
+The number of apps exceeds the maximum allowed limit (400). + |
+The number of apps exceeds 400. + |
+
403 + |
+FSS.1045 + |
+The number of dependencies exceeds the maximum allowed limit. + |
+The number of dependencies exceeds the maximum allowed limit. + |
+
403 + |
+FSS.1046 + |
+The dependency is inaccessible. + |
+The dependency is unavailable. + |
+
403 + |
+FSS.1047 + |
+The number of bound VPCs exceeds the maximum limit allowed for a tenant. + |
+The number of bound VPCs exceeds the maximum limit allowed for a tenant. + |
+
403 + |
+FSS.1048 + |
+The number of bound VPCs exceeds the maximum limit allowed for a project. + |
+The number of bound VPCs exceeds the maximum limit allowed for a project. + |
+
403 + |
+FSS.1049 + |
+The number of file systems mounted to the function exceeds the maximum allowed limit (5). + |
+The number of file systems mounted to the function exceeds 5. + |
+
404 + |
+FSS.1050 + |
+The mounted resource cannot be found. + |
+The mounted resource cannot be found. + |
+
404 + |
+FSS.1051 + |
+The function does not exist. + |
+The function cannot be found. + |
+
404 + |
+FSS.1052 + |
+The version does not exist. + |
+The version cannot be found. + |
+
404 + |
+FSS.1053 + |
+The alias does not exist. + |
+The alias cannot be found. + |
+
404 + |
+FSS.1054 + |
+The function app does not exist in OBS. + |
+The specified code package cannot be found in OBS. + |
+
404 + |
+FSS.1055 + |
+The app does not exist. + |
+The specified function app cannot be found in OBS. + |
+
404 + |
+FSS.1056 + |
+The dependency does not exist. + |
+The dependency does not exist. + |
+
404 + |
+FSS.1057 + |
+The function name does not exist in the YAML file. + |
+The function name does not exist in the YAML file. + |
+
400 + |
+FSS.1058 + |
+The app name and function name cannot be the same in the YAML file. + |
+The combination of the app name and function name cannot be the same in the YAML file. + |
+
404 + |
+FSS.1059 + |
+The function template does not exist. + |
+The function template does not exist. + |
+
404 + |
+FSS.1060 + |
+The event template cannot be found. + |
+The event template does not exist. + |
+
409 + |
+FSS.1061 + |
+The function already exists. + |
+The function already exists. + |
+
409 + |
+FSS.1062 + |
+The version already exists. + |
+The version already exists. + |
+
409 + |
+FSS.1063 + |
+The alias already exists. + |
+The alias already exists. + |
+
409 + |
+FSS.1064 + |
+The app already exists. + |
+The app already exists. + |
+
409 + |
+FSS.1065 + |
+The dependency already exists. + |
+The dependency already exists. + |
+
409 + |
+FSS.1066 + |
+The version is already in use by another alias. + |
+The version is already in use by another alias. + |
+
409 + |
+FSS.1067 + |
+The function template already exists. + |
+The function template already exists. + |
+
403 + |
+FSS.1068 + |
+The number of events configured for the function exceeds the maximum allowed limit. + |
+The number of events configured for the function exceeds the maximum allowed limit. + |
+
403 + |
+FSS.1069 + |
+The size of EventData exceeds 4 KB. + |
+The event size exceeds 4 KB. + |
+
404 + |
+FSS.1070 + |
+The event cannot be found. + |
+The event cannot be found. + |
+
413 + |
+FSS.1071 + |
+The size of the code package to be uploaded exceeds the maximum allowed limit (50 MB). + |
+The size of the code package to be uploaded exceeds 50 MB. + |
+
413 + |
+FSS.1072 + |
+The size of the inline code exceeds the maximum allowed limit (10 KB). + |
+The code exceeds 10 KB. + |
+
403 + |
+FSS.1073 + |
+The function event already exists. + |
+The function event already exists. + |
+
400 + |
+FSS.1074 + |
+The event field is invalid. + |
+Invalid event field. + |
+
400 + |
+FSS.1075 + |
+The user ID and user group ID must be an integer from –1 to 65,534, excluding 0, 1000, and 1002. + |
+The user ID and user group ID must be an integer from –1 to 65,534, excluding 0, 1000, and 1002. + |
+
412 + |
+FSS.1090 + |
+The subnet is not in the ACTIVE state. + |
+The subnet is not in the ACTIVE state. + |
+
400 + |
+FSS.1091 + |
+The additional version is invalid. + |
+Invalid additional version. + |
+
400 + |
+FSS.1092 + |
+The weight of the additional version is invalid. + |
+The weight of the additional version is invalid. + |
+
400 + |
+FSS.1093 + |
+The major version and the additional version cannot be the same. + |
+The major version and the additional version cannot be the same. + |
+
403 + |
+FSS.1094 + |
+The version cannot be deleted because it has been used as the additional version of an alias. + |
+The version cannot be deleted because it has been used as the additional version of an alias. + |
+
412 + |
+FSS.1095 + |
+The mounted resource is not ready. + |
+The mounted resource is not ready. + |
+
403 + |
+FSS.1096 + |
+The file sharing protocol of the mounted resource is not NFS. + |
+The file sharing protocol of the mounted resource is not NFS. + |
+
400 + |
+FSS.1101 + |
+Invalid trigger type. + |
+Invalid trigger type. + |
+
400 + |
+FSS.1102 + |
+Invalid SMN trigger parameters. + |
+Invalid SMN trigger parameters. + |
+
400 + |
+FSS.1106 + |
+Invalid OBS trigger parameters. + |
+Invalid OBS trigger parameters. + |
+
400 + |
+FSS.1107 + |
+Invalid APIG trigger parameters. + |
+Invalid APIG trigger parameters. + |
+
403 + |
+FSS.1108 + |
+The bucket configuration of the current trigger conflicts with that of an existing OBS trigger. + |
+The bucket configuration of the current trigger conflicts with that of an existing OBS trigger. + |
+
400 + |
+FSS.1109 + |
+Invalid timer trigger parameters. + |
+Invalid timer trigger parameters. + |
+
404 + |
+FSS.1111 + |
+The Kafka resource cannot be found. + |
+The Kafka resource cannot be found. + |
+
400 + |
+FSS.1112 + |
+The Kafka trigger parameters are invalid. + |
+Invalid Kafka trigger parameters. + |
+
400 + |
+FSS.1113 + |
+The username and password must be specified because Kafka SASL_SSL is enabled. + |
+The username and password must be specified because Kafka SASL_SSL is enabled. + |
+
400 + |
+FSS.1114 + |
+The subnet of the function must be the same as that of the Kafka instance. + |
+The subnet of the function is different from that of the Kafka instance. + |
+
503 + |
+FSS.1115 + |
+The network is unreachable. + |
+The network is unreachable. + |
+
400 + |
+FSS.1116 + |
+Kafka instance configuration error. Please check the username and password. + |
+Kafka instance configuration error. Check the username and password. + |
+
400 + |
+FSS.1117 + |
+Failed to query messages from the Kafka instance. + |
+Failed to query messages from the Kafka instance. + |
+
401 + |
+FSS.1118 + |
+Access denied. + |
+Access denied. The user is not in the whitelist. + |
+
403 + |
+FSS.1121 + |
+Forbidden + |
+Access denied. Check whether the corresponding agency has been configured. + |
+
403 + |
+FSS.1122 + |
+Forbidden + |
+Access denied. Check whether the corresponding agency has been configured. + |
+
403 + |
+FSS.1123 + |
+The number of pull triggers exceeds the maximum allowed limit. + |
+The number of pull-mode triggers has reached 10. + |
+
403 + |
+FSS.1124 + |
+The number of APIs exceeds the maximum allowed limit. + |
+The number of APIs exceeds the maximum allowed limit. + |
+
403 + |
+FSS.1125 + |
+Forbidden + |
+Access denied. + |
+
403 + |
+FSS.1126 + |
+You do not have permissions to call the API. + |
+You do not have permissions to call the API. + |
+
403 + |
+FSS.1127 + |
+The EPS user does not have permissions to call the API. + |
+The EPS user does not have permissions to call the API. + |
+
403 + |
+FSS.1128 + |
+list enterprise failed. + |
+Failed to list the enterprise projects for which you have permission. + |
+
404 + |
+FSS.1131 + |
+The trigger does not exist. + |
+The trigger cannot be found. + |
+
404 + |
+FSS.1132 + |
+The SMN trigger does not exist. View the SMN console. + |
+The SMN trigger cannot be found. + |
+
404 + |
+FSS.1136 + |
+The OBS trigger does not exist. + |
+The OBS trigger cannot be found. + |
+
404 + |
+FSS.1137 + |
+Invalid trigger type. + |
+The trigger type cannot be found. + |
+
404 + |
+FSS.1138 + |
+The APIG trigger does not exist. + |
+The APIG trigger cannot be found. + |
+
404 + |
+FSS.1140 + |
+The timer trigger does not exist. + |
+The timer trigger cannot be found. + |
+
409 + |
+FSS.1141 + |
+The SMN trigger already exists. + |
+The SMN trigger already exists. + |
+
409 + |
+FSS.1145 + |
+The OBS trigger already exists. + |
+The OBS trigger already exists. + |
+
409 + |
+FSS.1146 + |
+The APIG trigger already exists. + |
+The APIG trigger already exists. + |
+
409 + |
+FSS.1147 + |
+The request path already exists. + |
+The request path already exists. + |
+
409 + |
+FSS.1148 + |
+The timer trigger already exists. + |
+The timer trigger already exists. + |
+
409 + |
+FSS.1150 + |
+The Kafka trigger already exists. + |
+The Kafka trigger already exists. + |
+
406 + |
+FSS.1151 + |
+The OBS bucket is in a different region. + |
+The region where the OBS bucket is located does not match the current region. + |
+
426 + |
+FSS.1152 + |
+The selected bucket cannot be used to create a trigger. + |
+The selected OBS bucket cannot be used to create a trigger. + |
+
412 + |
+FSS.1153 + |
+The triggering conditions have not been met. + |
+The triggering conditions have not been met. + |
+
403 + |
+FSS.1154 + |
+Aliases of a function bound with triggers cannot be deleted. + |
+The aliases cannot be deleted because they are bound with triggers. + |
+
500 + |
+FSS.1162 + |
+The operation cannot take effect immediately due to service exception. + |
+The operation cannot take effect immediately because the service is abnormal. + |
+
503 + |
+FSS.1169 + |
+The network is unreachable. + |
+The network is unreachable. + |
+
404 + |
+FSS.1171 + |
+The SMN topic does not exist. Create one on the SMN console. + |
+The SMN topic does not exist. + |
+
400 + |
+FSS.1172 + |
+The database or collection does not exist. + |
+The DB instance cannot be found. + |
+
400 + |
+FSS.1221 + |
+lts log has been enabled. + |
+LTS has already been enabled. + |
+
404 + |
+FSS.1174 + |
+The Kafka trigger does not exist. + |
+The Kafka trigger cannot be found. + |
+
413 + |
+FSS.1201 + |
+The request body is too large. + |
+The request body exceeds the maximum allowed limit. + |
+
500 + |
+FSS.1202 + |
+The response body or callback body is invalid because they do not contain any status code. + |
+Invalid response body. + |
+
500 + |
+FSS.1302 + |
+Failed to save the data. + |
+Failed to save the trigger data. + |
+
400 + |
+FSS.1303 + |
+Access denied due to insufficient permissions. + |
+Failed to verify permission. Access denied. + |
+
400 + |
+FSS.1306 + |
+The number of triggers exceeds the maximum allowed limit. + |
+Trigger threshold reached. + |
+
400 + |
+FSS.1307 + |
+The trigger name already exists. + |
+The trigger name already exists. + |
+
400 + |
+FSS.1308 + |
+The operation resource does not exist. + |
+The resource does not exist. + |
+
400 + |
+FSS.1309 + |
+Invalid function URN. + |
+Invalid function URN. + |
+
400 + |
+FSS.1310 + |
+Unauthorized user. + |
+Failed to obtain the user token. + |
+
400 + |
+FSS.1312 + |
+The notification name must be specified. + |
+No key notification name specified. + |
+
400 + |
+FSS.1313 + |
+The number of operation resources has reached the maximum allowed limit. + |
+The number of operation resources exceeds 100. + |
+
400 + |
+FSS.1314 + |
+The operation resource must be specified. + |
+No operation resource specified. + |
+
400 + |
+FSS.1316 + |
+The resource operation has already been selected. + |
+Duplicate operation resource. + |
+
400 + |
+FSS.1317 + |
+The trigger name is too long. + |
+The trigger name is too long. + |
+
400 + |
+FSS.1318 + |
+Invalid trigger operation. + |
+Invalid trigger operation. + |
+
502 + |
+FSS.1319 + |
+Invalid trigger name. + |
+Invalid trigger name. + |
+
503 + |
+FSS.1401 + |
+Failed to obtain the image information. + |
+Failed to obtain the image information. + |
+
503 + |
+FSS.1402 + |
+Failed to pull the image to create a container. + |
+Failed to pull the image to create a container. + |
+
503 + |
+FSS.1403 + |
+Failed to pull the image to delete a container. + |
+Failed to pull the image to delete a container. + |
+
400 + |
+FSS.1404 + |
+Invalid function initializer. + |
+Invalid function initializer. + |
+
400 + |
+FSS.1405 + |
+Invalid initialization timeout. + |
+Invalid initialization timeout. + |
+
+
+
+
+
+
+
+
+
+
+
+
Welcome to FunctionGraph. FunctionGraph hosts and computes event-driven functions in a serverless context while ensuring high availability, high scalability, and zero maintenance. All you need to do is write your code and set conditions. You pay only for what you use and you are not charged when your code is not running.
+This document describes how to use application programming interfaces (APIs) to perform operations on FunctionGraph resources, such as creating, deleting, query, and executing functions. For details about all supported operations, see API Overview.
+The function model of FunctionGraph is as follows:
+{ + "functions": [ + { + "func_urn": "urn:fss:xxxxxxxxx:7aad83af3e8d42e99ac194e8419e2c9b:function:default:test", + "func_name": "test", + "domain_id": "cff01_hk", + "namespace": "7aad83af3e8d42e99ac194e8419e2c9b", + "project_name": "xxxxxxxxxx", + "package": "default", + "runtime": "Node.js6.10", + "timeout": 3, + "handler": "test.handler", + "memory_size": 128, + "cpu": 300, + "code_type": "inline", + "code_url": "", + "code_filename": "index.js", + "code_size": 272, + "user_data": "", + "digest": "decbce6939297b0b5ec6d1a23bf9c725870f5e69fc338a89a6a4029264688dc26338f56d08b6535de47f15ad538e22ca66613b9a46f807d50b687bb53fded1c6", + "version": "latest", + "image_name": "latest-5qe8e", + "xrole": "cff", + "app_xrole": null, + "description": "111", + "version_description": "", + "last_modified": "2018-03-28T11:30:32+08:00", +"func_code": { + "file": "", + "link": "" + }, + "func_vpc":null, + "mount_config":null, + "depend_list": null, + "strategy_config": { + "concurrency": -1 + }, + "extend_config": "", + "dependencies": null, +"initializer_handler": "index.initializer", +"initializer_timeout": 3 + } + ], + "next_marker": 45 + }+
Table 1 describes the parameters in the function model.
+ +Parameter + |
+Description + |
+
---|---|
func_urn + |
+Function URN. + |
+
func_name + |
+Function name. + |
+
domain_id + |
+Tenant name. + |
+
namespace + |
+Project ID. + |
+
project_name + |
+Project name. + |
+
package + |
+Group to which the function belongs. This field is defined to group functions. + |
+
runtime + |
+Environment for executing the function. FunctionGraph supports Node.js 6.10, Node.js 8.10, Node.js 10.16, Node.js 12.13, Python 2.7, Python 3.6, Java 8, Go 1.8, C# (.NET Core 2.0), C# (.NET Core 2.1), C# (.NET Core 3.1), and PHP 7.3. + |
+
timeout + |
+Maximum duration the function can be executed. Value range: 3s–900s. + |
+
handler + |
+Handler of the function in the format of "xx.xx". It must contain a period (.). +For example, for Node.js function myfunction.handler, the file name is myfunction.js, and the entry point function is handler. + |
+
memory_size + |
+Memory (MB) consumed by the function. +Options: 128, 256, 512, 768, 1024, 1280, 1536, 1792, 2048, 2560, 3072, 3584, and 4096. + |
+
cpu + |
+Number of CPU millicores used by the function (1 core = 1000 millicores). +The value of this field is proportional to that of MemorySize. By default, 100 CPU millicores are required for 128 MB memory. The value is calculated as follows: Memory/128 x 100 + 200 (basic CPU millicores). + |
+
code_type + |
+Function code type. Options: +
|
+
code_url + |
+
|
+
code_filename + |
+Function file name. +
|
+
code_size + |
+Code size in bytes. + |
+
user_data + |
+Name/Value information defined for the function. +For example, if a function needs to access a host, define Host={host_ip}. You can define a maximum of 20 such parameters, and their total length cannot exceed 4 KB. + |
+
digest + |
+SHA512 hash value of function code, which is used to determine whether the function is changed. + |
+
version + |
+Function version, which is automatically generated by the system. The version name is in the format of "vYYYYMMDD-HHMMSS" (v+year/month/day-hour/minute/second). + |
+
image_name + |
+Internal identifier of a function version. + |
+
xrole + |
+Agency used by the function. You need to create an agency on the Identity and Access Management (IAM) console. This field is mandatory when a function needs to access other services. + |
+
app_xrole + |
+Agency used by the function app. You need to create an agency on the IAM console. This field is mandatory when a function needs to access other services. + |
+
description + |
+Description of the function. + |
+
version_description + |
+Description of the function version. + |
+
last_modified + |
+Time when the function was last updated. + |
+
func_code + |
+Function code. See Table 2. + |
+
depend_list + |
+Dependency list. + |
+
strategy_config + |
+Function policy configuration. See Table 3. + |
+
extend_config + |
+Function extension configuration. + |
+
dependencies + |
+Dependency list. See Table 5. + |
+
initializer_handler + |
+Initializer of the function in the format of "xx.xx". It must contain a period (.). +For example, for Node.js function myfunction.initializer, the file name is myfunction.js, and the initialization function is initializer. + |
+
initializer_timeout + |
+Maximum duration the function can be initialized. Value range: 1s–300s. + |
+
func_vpc + |
+Virtual Private Cloud (VPC) configuration. See Table 4. + |
+
mount_config + |
+File system configuration. See Table 6. + |
+
Parameter + |
+Description + |
+
---|---|
file + |
+Function code. Nothing will be returned. + |
+
link + |
+Function code link. Nothing will be returned. + |
+
Parameter + |
+Description + |
+
---|---|
concurrency + |
+
|
+
Parameter + |
+Type + |
+Mandatory + |
+Description + |
+
---|---|---|---|
vpc_name + |
+String + |
+- + |
+VPC name. + |
+
vpc_id + |
+String + |
+Yes when func_vpc is not empty. + |
+VPC ID. + |
+
subnet_name + |
+String + |
+- + |
+Subnet name. + |
+
subnet_id + |
+String + |
+Yes when func_vpc is not empty. + |
+Subnet ID. + |
+
cidr + |
+String + |
+- + |
+Subnet mask. + |
+
gateway + |
+String + |
+- + |
+Gateway. + |
+
Parameter + |
+Type + |
+Mandatory + |
+Description + |
+
---|---|---|---|
owner + |
+String + |
+- + |
+Domain ID of the dependency owner. + |
+
link + |
+String + |
+- + |
+URL of the dependency package on OBS. + |
+
runtime + |
+String + |
+- + |
+Language of the dependency package (only used for classification purposes). + |
+
etag + |
+String + |
+- + |
+MD5 value of the dependency package. + |
+
size + |
+Int + |
+- + |
+Size of the dependency package. + |
+
name + |
+String + |
+- + |
+Name of the dependency package. + |
+
description + |
+String + |
+- + |
+Description of the dependency package. + |
+
file_name + |
+String + |
+- + |
+File name of the dependency package (ZIP). + |
+
Parameter + |
+Type + |
+Mandatory + |
+Description + |
+
---|---|---|---|
mount_user + |
++ | +- + |
+File system user configuration. + |
+
func_mounts + |
++ | +- + |
+File system list. + |
+
Parameter + |
+Type + |
+Mandatory + |
+Description + |
+
---|---|---|---|
user_id + |
+Int + |
+Yes when mount_user is not empty. + |
+User ID, which is an integer from –1 to 65,534, excluding 0, 1000, and 1002. + |
+
user_group_id + |
+Int + |
+Yes when mount_user is not empty. + |
+User group ID, which is an integer from –1 to 65,534, excluding 0, 1000, and 1002. + |
+
Parameter + |
+Type + |
+Mandatory + |
+Description + |
+
---|---|---|---|
mount_type + |
+String + |
+Yes when func_mounts is not empty. + |
+Mount type. Options: ecs. + |
+
mount_resource + |
+String + |
+Yes when func_mounts is not empty. + |
+ID of the mounted resource (corresponding cloud service). + |
+
mount_share_path + |
+String + |
+Yes when mount_type is set to ecs. + |
+Remote mount path. Example: 192.168.0.12:/data. + |
+
local_mount_path + |
+String + |
+Yes when func_mounts is not empty. + |
+Function access path. + |
+
The format of a function URN is as follows:
+urn:fss:<region_id>:<project_id>:function:<package>:<function_name>[:<version>|:!<alias>]+
A function URN is divided into eight fields by colons. The value of region_id is included in the system configuration. You can set this parameter to the same as that in the backend. The content in the brackets ([]) is a function version or alias. If you enter an alias, add an exclamation mark (!) in front of it for easy identification.
+When a function URN is used as an API parameter, you can provide it in a simplified format as follows:
+{ + "trigger_type_code":"string", + "display_name":"string", + "status":"string", + "event_codes":"array of string", + "description":"string" +}+
Table 1 describes the parameters in the trigger type model.
+ +Parameter + |
+Description + |
+
---|---|
trigger_type_code + |
+Trigger type code. Options: SMN, APIG, TIMER, DMS, kafka, DDS, CTS, DIS, LTS, and OBS. + |
+
display_name + |
+Trigger type value. + |
+
status + |
+Trigger type status. Options: +
|
+
description + |
+Trigger description. + |
+
{ + "trigger_id":"string", + "trigger_type_code":"string", + "event_type_code":"string", + "status":"string", + "event_data":"json struct", + "last_updated_time":"string", + "created_time":"string" +}+
Table 2 describes the parameters in the trigger instance model.
+ +Parameter + |
+Description + |
+
---|---|
trigger_id + |
+Trigger ID. + |
+
trigger_type_code + |
+Trigger type code. Options: SMN, APIG, TIMER, DMS, kafka, DDS, CTS, DIS, LTS, and OBS. + |
+
event_type_code + |
+Event type code. This parameter is mandatory. It can be any non-null character string. This parameter is not used currently. + |
+
status + |
+Trigger status. Options: ACTIVE and DISABLED. + |
+
event_data + |
+Trigger data defined in JSON format. + |
+
last_updated_time + |
+Time when the trigger was last updated. + |
+
created_time + |
+Time when the trigger was created. + |
+
{ + "topic_urn":"string", + "subscription_status":"string" +}+
Table 3 describes the parameters of an SMN trigger.
+ + +{ + "queue_id":"string", + "consumer_group_id":"string", + "polling_interval":"int" +}+
Table 4 describes the parameters of a DMS trigger.
+ +Parameter + |
+Description + |
+
---|---|
queue_id + |
+Name of a DMS queue. This parameter is mandatory when you create a DMS trigger. + |
+
consumer_group_id + |
+Name of a DMS consumer group. This parameter is mandatory when you create a DMS trigger. + |
+
polling_interval + |
+Interval at which messages are polled. This parameter is mandatory when you create a DMS trigger. Default value: 30s. + |
+
{ + "bucket": "yourBucketName", + "events": ["s3:ObjectCreated:Put"], + "prefix": "yourPrefix", + "suffix": "yourSuffix" +}+ +
Parameter + |
+Description + |
+
---|---|
bucket + |
+Bucket name. This parameter is mandatory. + |
+
events + |
+Collection of OBS trigger events. Options: s3:ObjectCreated:*, s3:ObjectCreated:Put, s3:ObjectCreated:Post, s3:ObjectCreated:Copy, s3:ObjectCreated:CompleteMultipartUpload, s3:ObjectRemoved:*, s3:ObjectRemoved:DeleteMarkerCreated, and s3:ObjectRemoved:Delete. This parameter is mandatory. +Note that s3:objectcreated:* includes all events that start with s3:objectcreated, and s3:objectremoved:* includes all events that start with s3:objectremoved. + |
+
prefix + |
+Prefix of an OBS object. This parameter is optional. + |
+
suffix + |
+Suffix of an OBS object. This parameter is optional. + |
+
{ +"stream_name": "dis-qYPJ", +"polling_interval": 30, +"batch_size": 100, +"sharditerator_type": "TRIM_HORIZON" +}+
Table 6 describes the parameters of a DIS trigger.
+ +Parameter + |
+Description + |
+
---|---|
stream_name + |
+Name of a stream. This parameter is mandatory. + |
+
polling_interval + |
+Pull period. This parameter is optional. Value range: 1–60. Default value: 30. + |
+
batch_size + |
+Number of data records that can be pulled from a specified stream. This parameter is optional. Value range: 1–10000. Default value: 100. + |
+
sharditerator_type + |
+Options: TRIM_HORIZON (pulling data from the beginning of a stream) and LATEST (pulling data from the current position). This parameter is mandatory. + |
+
{ + "group_id":"string", + "env_id":"string", + "auth":"string", + "protocol":"string", + "name":"string", + "path":"string", + "match_mode":"string", + "req_method":"string" , + "backend_type":"string" , + "type": int , + "sl_domain":"string" +}+
Table 7 describes the parameters of an APIG trigger.
+ +Parameter + |
+Description + |
+
---|---|
group_id + |
+API group. This parameter is mandatory. + |
+
env_id + |
+API publishing environment. This parameter is mandatory. + |
+
auth + |
+API authentication mode. Options: NONE, IAM, and APP. This parameter is mandatory. + |
+
protocol + |
+Access protocol. Options: HTTP and HTTPS. This parameter is mandatory. + |
+
name + |
+API name. This parameter is mandatory. + |
+
path + |
+API access address, which must meet the URL rules, for example, /a/b. This parameter is mandatory. + |
+
match_mode + |
+Match mode. Currently, only the prefix match mode (corresponding to SWA) is supported. This parameter is mandatory. + |
+
req_method + |
+API request method, which is of enumerated type. Options: GET, POST, and PUT. This parameter is mandatory. + |
+
backend_type + |
+Backend type, which must be set to FUNCTION. This parameter is mandatory. + |
+
type + |
+API type. Currently, only open APIs (corresponding to value 1) are supported. This parameter is mandatory. + |
+
sl_domain + |
+Subdomain name. This parameter is mandatory. + |
+
{ + "name": "string", + "schedule_type": "string", + "schedule": "string", + "user_event": "string" +}+
Table 8 describes the parameters of a timer trigger.
+ +Parameter + |
+Description + |
+
---|---|
name + |
+Trigger name. This parameter is mandatory. + |
+
schedule_type + |
+Schedule type. Options: Rate or Cron. This parameter is mandatory. + |
+
schedule + |
+Schedule setting, which varies depending on the schedule type you choose. This parameter is mandatory. +When schedule_type is set to Rate, add unit m, h, or d behind a rate, for example, 3m for 3 minutes. + |
+
user_event + |
+Additional information for calling a function. This parameter is optional. + |
+
{ + "trigger_type_code": "LTS", + "event_type_code": "MessageCreated", + "trigger_status": "ACTIVE", + "event_data": { + "log_group_id": "3e4d3bf7-7bad-11e9-92c5-fa163e6216be", + "log_topic_id": "41d90375-7bad-11e9-8bcf-fa163ea23ac3", + "log_group_name": "lts-group-5b42", + "log_topic_name": "lts-topic-5f3e" + } +}+
Table 9 describes the parameters of an LTS trigger.
+ + +{ + "name": "eqwrwe", + "operations": ["AAD:addprotocolrule:addProtocolRule", "BCS:baas-apiserver:scalePeers", "ARS:ars:setConfigArs"] +}+
Table 10 describes the parameters of a CTS trigger.
+ + +{ + "instance_id": "string", + "collection_name": "string", + "db_name": "string", + "db_password": string, + "batch_size": int, +}+ +
Parameter + |
+Description + |
+
---|---|
instance_id + |
+DB instance ID. + |
+
collection_name + |
+Collection name. + |
+
db_name + |
+Database name. + |
+
db_password + |
+Password for logging in to the database. + |
+
batch_size + |
+Batch size. + |
+
{ + "instance_id": "string", + "db_name": "string", + "collection_name": "string", + "db_user": "string", + "db_password": string, + "batch_size": int, +}+ +
Parameter + |
+Description + |
+
---|---|
instance_id + |
+Kafka instance ID. + |
+
topic_id + |
+Topic ID. + |
+
kafka_user + |
+Username. + |
+
kafka_password + |
+Password. + |
+
kafka_ssl_enable + |
+Whether to enable SSL authentication. If SSL authentication is enabled, the kafka_user and kafka_password fields are mandatory. + |
+
batch_size + |
+Batch size. + |
+
This API is used to query all functions.
+GET /v2/{project_id}/fgs/functions
+ +Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. For details, see Obtaining a Project ID. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
marker + |
+No + |
+String + |
+Final record queried last time. + |
+
maxitems + |
+No + |
+String + |
+Maximum number of functions that can be queried each time. +Maximum value: 400. +If this parameter is not set or is 0 or greater than 400, the default value 400 is used. +If this parameter is less than 0, a message indicating parameter error is returned. + |
+
package_name + |
+No + |
+String + |
+Name of the group. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
X-Auth-Token + |
+Yes + |
+String + |
+User token. +It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. + |
+
Content-Type + |
+Yes + |
+String + |
+Message body type (format). + |
+
Status code: 200
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
functions + |
+Array of ListFunctionResult objects + |
+Function list. + |
+
next_marker + |
+Integer + |
+Next read location. + |
+
count + |
+Long + |
+Total number of functions that match the query conditions. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
resource_id + |
+String + |
+Resource ID. + |
+
func_urn + |
+String + |
+Function URN. + |
+
func_name + |
+String + |
+Function name. + |
+
domain_id + |
+String + |
+Domain ID. + |
+
namespace + |
+String + |
+Project ID. + |
+
project_name + |
+String + |
+Project name. + |
+
package + |
+String + |
+Group to which the function belongs. This field is defined to group functions. + |
+
runtime + |
+String + |
+Environment for executing a function. Options: Python2.7 Python 3.6 Python 3.9 Go 1.8 Go 1.x Java 8 Java 11 Node.js 6.10 Node.js 8.10 Node.js 10.16 Node.js 12.13 Node.js 14.18 C# (.NET Core 2.0) C# (.NET Core 2.1) C# (.NET Core 3.1) Custom PHP 7.3 HTTP Custom image-based functions +Enumeration values: +
|
+
timeout + |
+Integer + |
+Maximum duration the function can be executed. Value range: 3s–259,200s. + |
+
handler + |
+String + |
+Handler of a function in the format of "xx.xx". It must contain a period (.). +For example, for Node.js function myfunction.handler, the file name is myfunction.js, and the handler function is handler. + |
+
memory_size + |
+Integer + |
+Memory consumed by a function. +Unit: MB. +The value can be 128, 256, 512, 768, 1024, 1280, 1536, 1792, 2048, 2560, 3072, 3584 or 4096. +The value ranges from 128 to 4096. + |
+
gpu_memory + |
+Integer + |
+GPU memory. This parameter is available only for functions created with a custom runtime or image. Unit: MB. Options: 1024, 2048, 3072, 4096, 5120, 6144, 7168, 8192, 9216, 10,240, 11,264, 12,288, 13,312, 14,336, 15,360, and 16,384. Range: 1024 to 16,384. + |
+
cpu + |
+Integer + |
+CPU resources of a function. Unit: millicore (1 core = 1000 millicores). The value of this field is proportional to that of MemorySize. By default, 100 CPU millicores are required for 128 MB memory. + |
+
code_type + |
+String + |
+Function code type. Options: inline: inline code zip: ZIP file obs: function code stored in an OBS bucket jar: JAR file, mainly for Java functions Custom-Image-Swr: The function code comes from the SWR custom image. +Enumeration values: +
|
+
code_url + |
+String + |
+Address of the function code package in OBS. + |
+
code_filename + |
+String + |
+Function file name. + |
+
code_size + |
+Long + |
+Code size in bytes. + |
+
user_data + |
+String + |
+Name/Value information defined for the function. These are parameters used in the function. For example, if a function needs to access a host, define Host={host_ip}. You can define a maximum of 20 such parameters, and their total length cannot exceed 4 KB. + |
+
encrypted_user_data + |
+String + |
+User-defined name/value to be encrypted. + |
+
digest + |
+String + |
+SHA512 hash value of function code, which is used to determine whether the function has changed. + |
+
version + |
+String + |
+Function version. + |
+
image_name + |
+String + |
+Internal identifier of a function version. + |
+
xrole + |
+String + |
+Agency used by the function. You need to create an agency on the IAM console. This field is mandatory when a function needs to access other services. + |
+
app_xrole + |
+String + |
+Agency used by the function app. You need to create an agency on the IAM console. This field is mandatory when a function needs to access other services. + |
+
description + |
+String + |
+Function description. + |
+
last_modified + |
+String + |
+Time when the function was last updated. + |
+
func_vpc_id + |
+String + |
+VPC ID. + |
+
strategy_config + |
+StrategyConfig object + |
+Function policy configuration. + |
+
extend_config + |
+String + |
+Extended configuration. + |
+
initializer_handler + |
+String + |
+Initializer of the function in the format of "xx.xx". It must contain a period (.). This parameter is mandatory when the initialization function is configured. For example, for Node.js function myfunction.initializer, the file name is myfunction.js, and the initialization function is initializer. + |
+
initializer_timeout + |
+Integer + |
+Maximum duration the function can be initialized. Value range: 1s–300s. This parameter is mandatory when the initialization function is configured. + |
+
pre_stop_handler + |
+String + |
+The pre-stop handler of a function. The value must contain a period (.) in the format of xx.xx. For example, for Node.js function myfunction.pre_stop_handler, the file name is myfunction.js, and the initialization function is pre_stop_handler. + |
+
pre_stop_timeout + |
+Integer + |
+Maximum duration the function can be initialized. Value range: 1s–90s. + |
+
enterprise_project_id + |
+String + |
+Enterprise project ID. This parameter is mandatory if you create a function as an enterprise user. + |
+
long_time + |
+Boolean + |
+Whether to allow a long timeout. + |
+
log_group_id + |
+String + |
+Log group ID. + |
+
log_stream_id + |
+String + |
+Log stream ID. + |
+
type + |
+String + |
+v2 indicates an official version, and v1 indicates a deprecated version. +Enumeration values: +
|
+
is_bridge_function + |
+Boolean + |
+Whether this is a bridge function. + |
+
bind_bridge_funcUrns + |
+Array of strings + |
+URNs bound to the bridge function. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
concurrency + |
+Integer + |
+Maximum number of instances for a single function. For v1, the value can be 0 or –1; for v2, it ranges from –1 to 1000. +
|
+
concurrent_num + |
+Integer + |
+Number of concurrent requests per instance. This parameter is supported only by v2. The value ranges from 1 to 1,000. + |
+
Status code: 401
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 403
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 404
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 500
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Query functions of the current tenant.
+GET https://{Endpoint}/v2/{project_id}/fgs/functions?marker=0&maxitems=400+
Status code: 200
+ok
+{ + "functions" : [ { + "func_urn" : "urn:fss:xxxxxxxxx:7aad83af3e8d42e99ac194e8419e2c9b:function:default:test", + "resource_id" : "0d075978-5a54-4ee1-8e24-ff5bd070xxxx:test", + "func_name" : "test", + "domain_id" : "cff01_hk", + "namespace" : "7aad83af3e8d42e99ac194e8419e2c9b", + "project_name" : "xxxxxxxx", + "package" : "default", + "runtime" : "Node.js6.10", + "timeout" : 3, + "handler" : "test.handler", + "memory_size" : 128, + "cpu" : 300, + "code_type" : "inline", + "code_filename" : "index.js", + "code_size" : 272, + "digest" : "decbce6939297b0b5ec6d1a23bf9c725870f5e69fc338a89a6a4029264688dc26338f56d08b6535de47f15ad538e22ca66613b9a46f807d50b687bb53fded1c6", + "version" : "latest", + "xrole" : "cff", + "image_name" : "latest-191025153727@zehht", + "last_modified" : "2019-10-25 15:37:27", + "strategy_config" : { + "concurrency" : 0 + }, + "initializer_handler" : "index.initializer", + "initializer_timeout" : 3, + "pre_stop_handler" : "index.pre_stop_handler", + "pre_stop_timeout" : 3 + } ], + "next_marker" : 4 +}+
Status Code + |
+Description + |
+
---|---|
200 + |
+ok + |
+
401 + |
+Unauthorized. + |
+
403 + |
+Forbidden. + |
+
404 + |
+Not found. + |
+
500 + |
+Internal server error. + |
+
See Error Codes.
+This API is used to query the metadata of a function.
+GET /v2/{project_id}/fgs/functions/{function_urn}/config
+ +Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. For details, see Obtaining a Project ID. + |
+
function_urn + |
+Yes + |
+String + |
+Function URN. For details, see the function model description. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
X-Auth-Token + |
+Yes + |
+String + |
+User token. +It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. + |
+
Content-Type + |
+Yes + |
+String + |
+Message body type (format). + |
+
Status code: 200
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
func_id + |
+String + |
+Function ID, which uniquely identifies a function. + |
+
resource_id + |
+String + |
+Resource ID. + |
+
func_urn + |
+String + |
+Function URN. + |
+
func_name + |
+String + |
+Function name. + |
+
domain_id + |
+String + |
+Domain ID. + |
+
namespace + |
+String + |
+Project ID. + |
+
project_name + |
+String + |
+Project name. + |
+
package + |
+String + |
+Group to which the function belongs. This field is defined to group functions. + |
+
runtime + |
+String + |
+Environment for executing a function. Options: Python2.7 Python 3.6 Python 3.9 Go 1.8 Go 1.x Java 8 Java 11 Node.js 6.10 Node.js 8.10 Node.js 10.16 Node.js 12.13 Node.js 14.18 C# (.NET Core 2.0) C# (.NET Core 2.1) C# (.NET Core 3.1) Custom PHP 7.3 HTTP Custom image-based functions +Enumeration values: +
|
+
timeout + |
+Integer + |
+Maximum duration the function can be executed. Value range: 3s–259,200s. + |
+
handler + |
+String + |
+Handler of a function in the format of "xx.xx". It must contain a period (.). +For example, for Node.js function myfunction.handler, the file name is myfunction.js, and the handler function is handler. + |
+
memory_size + |
+Integer + |
+Memory consumed by a function. +Unit: MB. +The value can be 128, 256, 512, 768, 1024, 1280, 1536, 1792, 2048, 2560, 3072, 3584 or 4096. +The value ranges from 128 to 4096. + |
+
gpu_memory + |
+Integer + |
+GPU memory. This parameter is available only for functions created with a custom runtime or image. Unit: MB. Options: 1024, 2048, 3072, 4096, 5120, 6144, 7168, 8192, 9216, 10,240, 11,264, 12,288, 13,312, 14,336, 15,360, and 16,384. Range: 1024 to 16,384. + |
+
cpu + |
+Integer + |
+CPU resources of a function. Unit: millicore (1 core = 1000 millicores). The value of this field is proportional to that of MemorySize. By default, 100 CPU millicores are required for 128 MB memory. + |
+
code_type + |
+String + |
+Function code type. Options: inline: inline code zip: ZIP file obs: function code stored in an OBS bucket jar: JAR file, mainly for Java functions Custom-Image-Swr: The function code comes from the SWR custom image. +Enumeration values: +
|
+
code_url + |
+String + |
+If CodeType is set to obs, enter the OBS URL of the function code package. If CodeType is not set to obs, leave this parameter blank. + |
+
code_filename + |
+String + |
+Name of a function file. This parameter is mandatory only when CodeType is set to jar or zip. + |
+
code_size + |
+Long + |
+Code size in bytes. + |
+
user_data + |
+String + |
+Name/Value information defined for the function. These are parameters used in the function. For example, if a function needs to access a host, define Host={host_ip}. You can define a maximum of 20 such parameters, and their total length cannot exceed 4 KB. + |
+
encrypted_user_data + |
+String + |
+User-defined name/value to be encrypted. + |
+
digest + |
+String + |
+SHA512 hash value of function code, which is used to determine whether the function has changed. + |
+
version + |
+String + |
+Function version, which is automatically generated by the system. The version name is in the format of "vYYYYMMDD-HHMMSS" (v+year/month/day-hour/minute/second). + |
+
image_name + |
+String + |
+Internal identifier of a function version. + |
+
xrole + |
+String + |
+Agency used by the function. You need to create an agency on the IAM console. This field is mandatory when a function needs to access other services. After specifying a function execution agency, you can use the context method in the function handler to obtain a token, an AK, and an SK for accessing other cloud services. No agency is required if FunctionGraph does not access any cloud services. + |
+
app_xrole + |
+String + |
+Execution agency. You can optimize performance by configuring a separate agency for function execution, otherwise, the same agency is used for both execution and configuration. + |
+
description + |
+String + |
+Function description. + |
+
last_modified + |
+String + |
+Time when the function was last updated. + |
+
ephemeral_storage + |
+Integer + |
+Ephemeral storage. By default, the /tmp directory of each function is 512 MB. You can increase the size to 10,240 MB (10 GB) if necessary. +Enumeration values: +
|
+
func_vpc + |
+FuncVpc object + |
+VPC configuration. An agency with VPC permissions must be configured for the function. + |
+
mount_config + |
+MountConfig object + |
+Mounting configuration. + |
+
depend_version_list + |
+Array of strings + |
+Dependency version IDs. + |
+
strategy_config + |
+StrategyConfig object + |
+Function policy configuration. + |
+
dependencies + |
+Array of Dependency objects + |
+Dependency packages. + |
+
initializer_handler + |
+String + |
+Initializer of the function in the format of "xx.xx". It must contain a period (.). This parameter is mandatory when the initialization function is configured. For example, for Node.js function myfunction.initializer, the file name is myfunction.js, and the initialization function is initializer. + |
+
initializer_timeout + |
+Integer + |
+Maximum duration the function can be initialized. Value range: 1s–300s. This parameter is mandatory when the initialization function is configured. + |
+
pre_stop_handler + |
+String + |
+The pre-stop handler of a function. The value must contain a period (.) in the format of xx.xx. For example, for Node.js function myfunction.pre_stop_handler, the file name is myfunction.js, and the initialization function is pre_stop_handler. + |
+
pre_stop_timeout + |
+Integer + |
+Maximum duration the function can be initialized. Value range: 1s–90s. + |
+
enterprise_project_id + |
+String + |
+Enterprise project ID. This parameter is mandatory if you create a function as an enterprise user. + |
+
long_time + |
+Boolean + |
+Whether to allow a long timeout. + |
+
log_group_id + |
+String + |
+Log group ID. + |
+
log_stream_id + |
+String + |
+Log stream ID. + |
+
type + |
+String + |
+v2 indicates an official version, and v1 indicates a deprecated version. +Enumeration values: +
|
+
enable_cloud_debug + |
+String + |
+Whether to enable cloud debugging to adapt to the CloudDebug scenario. (discarded) + |
+
enable_dynamic_memory + |
+Boolean + |
+Whether to enable dynamic memory allocation. + |
+
is_stateful_function + |
+Boolean + |
+Whether stateful functions are supported. If they are supported, set this parameter to true. This parameter is supported in FunctionGraph v2. + |
+
is_bridge_function + |
+Boolean + |
+Whether this is a bridge function. + |
+
enable_auth_in_header + |
+Boolean + |
+Whether to add authentication information to request header for custom image-based functions. + |
+
custom_image + |
+CustomImage object + |
+Container image. + |
+
reserved_instance_idle_mode + |
+Boolean + |
+Whether to enable idle mode for reserved instances. + |
+
apig_route_enable + |
+Boolean + |
+Whether to configure gateway routing rules. + |
+
heartbeat_handler + |
+String + |
+Entry of the heartbeat function in the format of "xx.xx". It must contain a period (.).This parameter can be configured only in Java. The heartbeat function entry must be in the same file as your function handler. This parameter is mandatory when the heartbeat function is enabled. + |
+
enable_class_isolation + |
+Boolean + |
+Indicates whether to enable class isolation. This parameter can be configured only in Java. Enable to dump logs to Kafka and improve class loading efficiency. However, this may cause compatibility issues. + |
+
gpu_type + |
+String + |
+GPU type. + |
+
allow_ephemeral_storage + |
+Boolean + |
+Indicates whether ephemeral storage can be configured. + |
+
network_controller + |
+NetworkControlConfig object + |
+Network configuration. + |
+
is_return_stream + |
+Boolean + |
+Whether to return stream data. (discarded) + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
domain_id + |
+String + |
+Domain name ID. + |
+
namespace + |
+String + |
+Project ID. + |
+
vpc_name + |
+String + |
+VPC name. + |
+
vpc_id + |
+String + |
+VPC ID. + |
+
subnet_name + |
+String + |
+Subnet name. + |
+
subnet_id + |
+String + |
+Subnet ID. + |
+
cidr + |
+String + |
+Subnet mask. + |
+
gateway + |
+String + |
+Gateway. + |
+
security_groups + |
+Array of strings + |
+Security group. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
mount_user + |
+MountUser object + |
+User information. + |
+
func_mounts + |
+Array of FuncMount objects + |
+Mounted resources. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
user_id + |
+String + |
+User ID, a non-0 integer from –1 to 65534. + |
+
user_group_id + |
+String + |
+User group ID, a non-0 integer from –1 to 65534. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
mount_type + |
+String + |
+Mount type. The value can be sfs, sfsTurbo, or ecs. This parameter is mandatory when func_mounts is not empty. + |
+
mount_resource + |
+String + |
+ID of the mounted resource (cloud service ID). This parameter is mandatory when func_mounts is not empty. + |
+
mount_share_path + |
+String + |
+Remote mount path. For example, 192.168.0.12:/data. This parameter is mandatory if mount_type is set to ecs. + |
+
local_mount_path + |
+String + |
+Function access path. This parameter is mandatory when func_mounts is not empty. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
concurrency + |
+Integer + |
+Maximum number of instances for a single function. For v1, the value can be 0 or –1; for v2, it ranges from –1 to 1000. +
|
+
concurrent_num + |
+Integer + |
+Number of concurrent requests per instance. This parameter is supported only by v2. The value ranges from 1 to 1,000. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
id + |
+String + |
+Dependency version ID. + |
+
owner + |
+String + |
+Domain ID of the dependency owner. + |
+
link + |
+String + |
+URL of the dependency on OBS. + |
+
runtime + |
+String + |
+Environment for executing a function. Options: Python2.7 Python 3.6 Python 3.9 Go 1.8 Go 1.x Java 8 Java 11 Node.js 6.10 Node.js 8.10 Node.js 10.16 Node.js 12.13 Node.js 14.18 C# (.NET Core 2.0) C# (.NET Core 2.1) C# (.NET Core 3.1) Custom PHP 7.3 HTTP Custom image-based functions +Enumeration values: +
|
+
etag + |
+String + |
+MD5 value of a dependency. + |
+
size + |
+Long + |
+Dependency size. + |
+
name + |
+String + |
+Dependence name. + |
+
description + |
+String + |
+Dependency description. + |
+
file_name + |
+String + |
+File name of a dependency package (ZIP). + |
+
version + |
+Long + |
+Dependency version ID. + |
+
dep_id + |
+String + |
+Dependency ID. + |
+
last_modified + |
+String + |
+Time when the function was last updated. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
enabled + |
+Boolean + |
+Whether to enable this feature. + |
+
image + |
+String + |
+Image address. + |
+
command + |
+String + |
+Command for starting a container image. + |
+
args + |
+String + |
+Command line parameter for starting a container image. + |
+
working_dir + |
+String + |
+Working directory of an image container. + |
+
uid + |
+String + |
+User ID of an image container. + |
+
gid + |
+String + |
+User group ID of an image container. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
disable_public_network + |
+Boolean + |
+Disable public access. + |
+
trigger_access_vpcs + |
+Array of VpcConfig objects + |
+VPC access restriction. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
vpc_name + |
+String + |
+VPC name. + |
+
vpc_id + |
+String + |
+VPC ID. + |
+
Status code: 400
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 401
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 403
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 404
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 500
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Query the metadata of a function.
+GET https://{Endpoint}/v2/{project_id}/fgs/functions/{function_urn}/config+
Status code: 200
+OK
+{ + "func_id" : "0d075978-5a54-4ee1-8e24-ff5bd070xxxx", + "resource_id" : "0d075978-5a54-4ee1-8e24-ff5bd070xxxx:test", + "func_urn" : "urn:fss:xxxxxxxxxx:7aad83af3e8d42e99ac194e8419e2c9b:function:default:test:latest", + "func_name" : "test", + "domain_id" : "14ee2e3501124efcbca7998baa24xxxx", + "namespace" : "46b6f338fc3445b8846c71dfb1fbxxxx", + "project_name" : "xxxxxxxxx", + "package" : "default", + "runtime" : "Node.js6.10", + "timeout" : 3, + "handler" : "test.handler", + "memory_size" : 128, + "cpu" : 300, + "code_type" : "inline", + "code_filename" : "index.js", + "code_size" : 272, + "digest" : "faa825575c45437cddd4e369bea69893bcbe195d478178462ad90984fe72993f3f59d15f41c5373f807f3e05fb9af322c55dabeb16565c386e402413458e6068", + "version" : "latest", + "ephemeral_storage" : 512, + "image_name" : "latest-191025153727@zehht", + "last_modified" : "2019-10-25 15:37:27", + "strategy_config" : { + "concurrency" : 0 + } +}+
Status code: 404
+Not found.
+{ + "error_code" : "FSS.1051", + "error_msg" : "Not found the function" +}+
Status Code + |
+Description + |
+
---|---|
200 + |
+OK + |
+
400 + |
+Bad request. + |
+
401 + |
+Unauthorized. + |
+
403 + |
+Forbidden. + |
+
404 + |
+Not found. + |
+
500 + |
+Internal server error. + |
+
See Error Codes.
+This API is used to query the code of a function.
+GET /v2/{project_id}/fgs/functions/{function_urn}/code
+ +Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. For details, see Obtaining a Project ID. + |
+
function_urn + |
+Yes + |
+String + |
+Function URN. For details, see the function model description. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
X-Auth-Token + |
+Yes + |
+String + |
+User token. +It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. + |
+
Content-Type + |
+Yes + |
+String + |
+Message body type (format). + |
+
Status code: 200
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
func_urn + |
+String + |
+Function URN. + |
+
func_name + |
+String + |
+Function name. + |
+
domain_id + |
+String + |
+Domain ID. + |
+
runtime + |
+String + |
+Environment for executing a function. Options: Python2.7 Python 3.6 Python 3.9 Go 1.8 Go 1.x Java 8 Java 11 Node.js 6.10 Node.js 8.10 Node.js 10.16 Node.js 12.13 Node.js 14.18 C# (.NET Core 2.0) C# (.NET Core 2.1) C# (.NET Core 3.1) Custom PHP 7.3 HTTP Custom image-based functions +Enumeration values: +
|
+
code_type + |
+String + |
+Function code type. Options: inline: inline code zip: ZIP file obs: function code stored in an OBS bucket jar: JAR file, mainly for Java functions Custom-Image-Swr: The function code comes from the SWR custom image. +Enumeration values: +
|
+
code_url + |
+String + |
+If CodeType is set to obs, enter the OBS URL of the function code package. If CodeType is not set to obs, leave this parameter blank. + |
+
code_filename + |
+String + |
+Name of a function file. This parameter is mandatory only when CodeType is set to jar or zip. + |
+
code_size + |
+Long + |
+Code size in bytes. + |
+
digest + |
+String + |
+SHA512 hash value of function code, which is used to determine whether the function has changed. + |
+
last_modified + |
+String + |
+Time when the function was last updated. + |
+
func_code + |
+FuncCode object + |
+Response body of the FuncCode struct. + |
+
depend_version_list + |
+Array of strings + |
+Dependency version IDs. + |
+
strategy_config + |
+StrategyConfig object + |
+Function policy configuration. + |
+
dependencies + |
+Array of Dependency objects + |
+Dependency packages. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
file + |
+String + |
+Function code, which must be encoded using Base64. If this parameter is left blank, the default code is used. + |
+
link + |
+String + |
+Function code URL. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
concurrency + |
+Integer + |
+Maximum number of instances for a single function. For v1, the value can be 0 or –1; for v2, it ranges from –1 to 1000. +
|
+
concurrent_num + |
+Integer + |
+Number of concurrent requests per instance. This parameter is supported only by v2. The value ranges from 1 to 1,000. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
id + |
+String + |
+Dependency version ID. + |
+
owner + |
+String + |
+Domain ID of the dependency owner. + |
+
link + |
+String + |
+URL of the dependency on OBS. + |
+
runtime + |
+String + |
+Environment for executing a function. Options: Python2.7 Python 3.6 Python 3.9 Go 1.8 Go 1.x Java 8 Java 11 Node.js 6.10 Node.js 8.10 Node.js 10.16 Node.js 12.13 Node.js 14.18 C# (.NET Core 2.0) C# (.NET Core 2.1) C# (.NET Core 3.1) Custom PHP 7.3 HTTP Custom image-based functions +Enumeration values: +
|
+
etag + |
+String + |
+MD5 value of a dependency. + |
+
size + |
+Long + |
+Dependency size. + |
+
name + |
+String + |
+Dependence name. + |
+
description + |
+String + |
+Dependency description. + |
+
file_name + |
+String + |
+File name of a dependency package (ZIP). + |
+
version + |
+Long + |
+Dependency version ID. + |
+
dep_id + |
+String + |
+Dependency ID. + |
+
last_modified + |
+String + |
+Time when the function was last updated. + |
+
Status code: 400
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 401
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 403
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 404
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 500
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Query the code of a function.
+GET https://{Endpoint}/v2/{project_id}/fgs/functions/{function_urn}/code+
Status code: 200
+OK
+{ + "func_urn" : "urn:fss:xxxxxxxxxx:7aad83af3e8d42e99ac194e8419e2c9b:function:default:test:latest", + "func_name" : "test", + "domain_id" : "14ee2e3501124efcbca7998baa24xxxx", + "runtime" : "Node.js6.10", + "code_type" : "inline", + "code_filename" : "index.zip", + "code_size" : 245, + "digest" : "39d51ae334ffb239037e194159f4cc9cec31086719aa73db7d0a608343121a290f7115693e008bd01cb12b99a803856e83aa96173b26c528c41cfed18267e08f", + "last_modified" : "2019-10-31 11:37:58", + "func_code" : { + "file" : "", + "link" : "" + }, + "strategy_config" : { + "concurrency" : -1 + } +}+
Status code: 404
+Not found.
+{ + "error_code" : "FSS.1052", + "error_msg" : "Not found the function version" +}+
Status Code + |
+Description + |
+
---|---|
200 + |
+OK + |
+
400 + |
+Bad request. + |
+
401 + |
+Unauthorized. + |
+
403 + |
+Forbidden. + |
+
404 + |
+Not found. + |
+
500 + |
+Internal server error. + |
+
See Error Codes.
+This API is used to create a function.
+POST /v2/{project_id}/fgs/functions
+ +Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. For details, see Obtaining a Project ID. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
X-Auth-Token + |
+Yes + |
+String + |
+User token. +It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. + |
+
Content-Type + |
+Yes + |
+String + |
+Message body type (format). + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
func_name + |
+Yes + |
+String + |
+Function name.Max. 60 of letters, digits, hyphens (-), and underscores (_). Start with a letter, and end with a letter or digit. +Minimum length: 1 character. +Maximum length: 60 characters. + |
+
package + |
+Yes + |
+String + |
+Group to which the function belongs. This field is defined to group functions. + |
+
runtime + |
+Yes + |
+String + |
+Environment in which a FunctionGraph function is executed. Options: +
Enumeration values: +
|
+
timeout + |
+Yes + |
+Integer + |
+Maximum duration the function can be executed. Value range: 3s–259,200s. + |
+
handler + |
+Yes + |
+String + |
+Handler of the function. +It must be in the format of "xx.xx" and contain a period (.). For a function created with a custom image, the handler must be "-". +For example, for Node.js function myfunction.handler, the file name is myfunction.js, and the handler function is handler. + |
+
depend_version_list + |
+No + |
+Array of strings + |
+Dependency version IDs. + |
+
func_vpc + |
+No + |
+FuncVpc object + |
+VPC configuration. An agency with VPC permissions must be configured for the function. + |
+
memory_size + |
+Yes + |
+Integer + |
+Memory consumed by a function. +Unit: MB. +The value can be 128, 256, 512, 768, 1024, 1280, 1536, 1792, 2048, 2560, 3072, 3584 or 4096. +The value ranges from 128 to 4096. + |
+
gpu_memory + |
+No + |
+Integer + |
+GPU memory. This parameter is available only for functions created with a custom runtime or image. Unit: MB. Options: 1024, 2048, 3072, 4096, 5120, 6144, 7168, 8192, 9216, 10,240, 11,264, 12,288, 13,312, 14,336, 15,360, and 16,384. Range: 1024 to 16,384. + |
+
code_type + |
+Yes + |
+String + |
+Function code type. Options: inline: inline code zip: ZIP file obs: function code stored in an OBS bucket jar: JAR file, mainly for Java functions Custom-Image-Swr: The function code comes from the SWR custom image. +Enumeration values: +
|
+
code_url + |
+No + |
+String + |
+If CodeType is set to obs, enter the OBS URL of the function code package. If CodeType is not set to obs, leave this parameter blank. + |
+
code_filename + |
+No + |
+String + |
+Name of a function file. This parameter is mandatory only when CodeType is set to jar or zip. + |
+
custom_image + |
+No + |
+CustomImage object + |
+Container image. This parameter is mandatory only when CodeType is set to Custom-Image-Swr. + |
+
user_data + |
+No + |
+String + |
+Name/Value information defined for the function. These are parameters used in the function. For example, if a function needs to access a host, define Host={host_ip}. You can define a maximum of 20 such parameters, and their total length cannot exceed 4 KB. + |
+
encrypted_user_data + |
+No + |
+String + |
+Name/value information to be encrypted. For example, if a function needs an encryption password, define password={1234}. You can define a maximum of 20 such parameters, and their total length cannot exceed 4 KB. + |
+
xrole + |
+No + |
+String + |
+Configuration agency. You need to create an agency on the IAM console. This field is mandatory when a function needs to access other services. After specifying a function configuration agency, you can use the context method in the function handler to obtain a token, an AK, and an SK for accessing other cloud services. No agency is required if FunctionGraph does not access any cloud services. + |
+
app_xrole + |
+No + |
+String + |
+Execution agency. You can optimize performance by configuring a separate agency for function execution, otherwise, the same agency is used for both execution and configuration. + |
+
description + |
+No + |
+String + |
+Function description. + |
+
func_code + |
+No + |
+FuncCode object + |
+Response body of the FuncCode struct. + |
+
mount_config + |
+No + |
+MountConfig object + |
+Mounting configuration. + |
+
initializer_handler + |
+No + |
+String + |
+Initializer of the function in the format of "xx.xx". It must contain a period (.). This parameter is mandatory when the initialization function is configured. For example, for Node.js function myfunction.initializer, the file name is myfunction.js, and the initialization function is initializer. + |
+
initializer_timeout + |
+No + |
+Integer + |
+Maximum duration the function can be initialized. Value range: 1s–300s. This parameter is mandatory when the initialization function is configured. + |
+
pre_stop_handler + |
+No + |
+String + |
+The pre-stop handler of a function. The value must contain a period (.) in the format of xx.xx. For example, for Node.js function myfunction.pre_stop_handler, the file name is myfunction.js, and the initialization function is pre_stop_handler. + |
+
pre_stop_timeout + |
+No + |
+Integer + |
+Maximum duration the function can be initialized. Value range: 1s–90s. + |
+
enterprise_project_id + |
+No + |
+String + |
+Enterprise project ID. This parameter is mandatory if you create a function as an enterprise user. + |
+
type + |
+No + |
+String + |
+Function version. Some regions support only v1. The default value is v1. +Default: v2 +Enumeration values: +
|
+
log_config + |
+No + |
+FuncLogConfig object + |
+Function log configuration. + |
+
network_controller + |
+No + |
+NetworkControlConfig object + |
+Network configuration. + |
+
is_stateful_function + |
+No + |
+Boolean + |
+Whether stateful functions are supported. If they are supported, set this parameter to true. This parameter is supported in FunctionGraph v2. + |
+
enable_dynamic_memory + |
+No + |
+Boolean + |
+Whether to enable dynamic memory allocation. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
domain_id + |
+No + |
+String + |
+Domain name ID. + |
+
namespace + |
+No + |
+String + |
+Project ID. + |
+
vpc_name + |
+No + |
+String + |
+VPC name. + |
+
vpc_id + |
+Yes + |
+String + |
+VPC ID. + |
+
subnet_name + |
+No + |
+String + |
+Subnet name. + |
+
subnet_id + |
+Yes + |
+String + |
+Subnet ID. + |
+
cidr + |
+No + |
+String + |
+Subnet mask. + |
+
gateway + |
+No + |
+String + |
+Gateway. + |
+
security_groups + |
+No + |
+Array of strings + |
+Security group. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
enabled + |
+No + |
+Boolean + |
+Whether to enable this feature. + |
+
image + |
+No + |
+String + |
+Image address. + |
+
command + |
+No + |
+String + |
+Command for starting a container image. + |
+
args + |
+No + |
+String + |
+Command line parameter for starting a container image. + |
+
working_dir + |
+No + |
+String + |
+Working directory of an image container. + |
+
uid + |
+No + |
+String + |
+User ID of an image container. + |
+
gid + |
+No + |
+String + |
+User group ID of an image container. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
file + |
+No + |
+String + |
+Function code, which must be encoded using Base64. If this parameter is left blank, the default code is used. + |
+
link + |
+No + |
+String + |
+Function code URL. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
mount_user + |
+Yes + |
+MountUser object + |
+User information. + |
+
func_mounts + |
+Yes + |
+Array of FuncMount objects + |
+Mounted resources. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
user_id + |
+Yes + |
+String + |
+User ID, a non-0 integer from –1 to 65534. + |
+
user_group_id + |
+Yes + |
+String + |
+User group ID, a non-0 integer from –1 to 65534. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
mount_type + |
+Yes + |
+String + |
+Mount type. The value can be sfs, sfsTurbo, or ecs. This parameter is mandatory when func_mounts is not empty. + |
+
mount_resource + |
+Yes + |
+String + |
+ID of the mounted resource (cloud service ID). This parameter is mandatory when func_mounts is not empty. + |
+
mount_share_path + |
+No + |
+String + |
+Remote mount path. For example, 192.168.0.12:/data. This parameter is mandatory if mount_type is set to ecs. + |
+
local_mount_path + |
+Yes + |
+String + |
+Function access path. This parameter is mandatory when func_mounts is not empty. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
group_name + |
+No + |
+String + |
+Name of the log group bound to the function. + |
+
group_id + |
+No + |
+String + |
+ID of the log group bound to the function. + |
+
stream_name + |
+No + |
+String + |
+Name of the log stream bound to the function. + |
+
stream_id + |
+No + |
+String + |
+ID of the log stream bound to the function. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
disable_public_network + |
+No + |
+Boolean + |
+Disable public access. + |
+
trigger_access_vpcs + |
+No + |
+Array of VpcConfig objects + |
+VPC access restriction. + |
+
Status code: 200
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
func_id + |
+String + |
+Function ID, which uniquely identifies a function. + |
+
func_urn + |
+String + |
+Function URN. + |
+
func_name + |
+String + |
+Function name. + |
+
domain_id + |
+String + |
+Domain ID. + |
+
namespace + |
+String + |
+Project ID. + |
+
project_name + |
+String + |
+Project name. + |
+
package + |
+String + |
+Group to which the function belongs. This field is defined to group functions. + |
+
runtime + |
+String + |
+Environment for executing a function. Options: Python2.7 Python 3.6 Python 3.9 Go 1.8 Go 1.x Java 8 Java 11 Node.js 6.10 Node.js 8.10 Node.js 10.16 Node.js 12.13 Node.js 14.18 C# (.NET Core 2.0) C# (.NET Core 2.1) C# (.NET Core 3.1) Custom PHP 7.3 HTTP Custom image-based functions +Enumeration values: +
|
+
timeout + |
+Integer + |
+Maximum duration the function can be executed. Value range: 3s–259,200s. + |
+
handler + |
+String + |
+Handler of a function in the format of "xx.xx". It must contain a period (.). +For example, for Node.js function myfunction.handler, the file name is myfunction.js, and the handler function is handler. + |
+
memory_size + |
+Integer + |
+Memory consumed by a function. +Unit: MB. +The value can be 128, 256, 512, 768, 1024, 1280, 1536, 1792, 2048, 2560, 3072, 3584 or 4096. +The value ranges from 128 to 4096. + |
+
gpu_memory + |
+Integer + |
+GPU memory. This parameter is available only for functions created with a custom runtime or image. Unit: MB. Options: 1024, 2048, 3072, 4096, 5120, 6144, 7168, 8192, 9216, 10,240, 11,264, 12,288, 13,312, 14,336, 15,360, and 16,384. Range: 1024 to 16,384. + |
+
cpu + |
+Integer + |
+CPU resources of a function. Unit: millicore (1 core = 1000 millicores). The value of this field is proportional to that of MemorySize. By default, 100 CPU millicores are required for 128 MB memory. + |
+
code_type + |
+String + |
+Function code type. Options: inline: inline code zip: ZIP file obs: function code stored in an OBS bucket jar: JAR file, mainly for Java functions Custom-Image-Swr: The function code comes from the SWR custom image. +Enumeration values: +
|
+
code_url + |
+String + |
+If CodeType is set to obs, enter the OBS URL of the function code package. If CodeType is not set to obs, leave this parameter blank. + |
+
code_filename + |
+String + |
+Name of a function file. This parameter is mandatory only when CodeType is set to jar or zip. + |
+
code_size + |
+Long + |
+Code size in bytes. + |
+
domain_names + |
+String + |
+Private domain name configured for resolution. + |
+
user_data + |
+String + |
+Name/Value information defined for the function. +These are parameters used in a function. +For example, if a function needs to access a host, define Host={host_ip}. You can define a maximum of 20 such parameters, and their total length cannot exceed 4 KB. + |
+
encrypted_user_data + |
+String + |
+User-defined name/value to be encrypted. + |
+
digest + |
+String + |
+SHA512 hash value of function code, which is used to determine whether the function has changed. + |
+
version + |
+String + |
+Function version. + |
+
image_name + |
+String + |
+Internal identifier of a function version. + |
+
xrole + |
+String + |
+Agency used by the function. You need to create an agency on the IAM console. This field is mandatory when a function needs to access other services. + |
+
app_xrole + |
+String + |
+Agency used by the function app. You need to create an agency on the IAM console. This field is mandatory when a function needs to access other services. + |
+
description + |
+String + |
+Function description. + |
+
last_modified + |
+String + |
+Time when the function was last updated. + |
+
func_vpc + |
+FuncVpc object + |
+VPC configuration. An agency with VPC permissions must be configured for the function. + |
+
mount_config + |
+MountConfig object + |
+Mounting configuration. + |
+
reserved_instance_count + |
+Integer + |
+The number of instances reserved for a function. + |
+
depend_version_list + |
+Array of strings + |
+Dependency version IDs. + |
+
strategy_config + |
+StrategyConfig object + |
+Function policy configuration. + |
+
extend_config + |
+String + |
+Extended configuration. + |
+
dependencies + |
+Array of Dependency objects + |
+Dependency packages. + |
+
initializer_handler + |
+String + |
+Initializer of the function in the format of "xx.xx". It must contain a period (.). This parameter is mandatory when the initialization function is configured. For example, for Node.js function myfunction.initializer, the file name is myfunction.js, and the initialization function is initializer. + |
+
initializer_timeout + |
+Integer + |
+Maximum duration the function can be initialized. Value range: 1s–300s. This parameter is mandatory when the initialization function is configured. + |
+
pre_stop_handler + |
+String + |
+The pre-stop handler of a function. The value must contain a period (.) in the format of xx.xx. For example, for Node.js function myfunction.pre_stop_handler, the file name is myfunction.js, and the initialization function is pre_stop_handler. + |
+
pre_stop_timeout + |
+Integer + |
+Maximum duration the function can be initialized. Value range: 1s–90s. + |
+
enterprise_project_id + |
+String + |
+Enterprise project ID. This parameter is mandatory if you create a function as an enterprise user. + |
+
long_time + |
+Boolean + |
+Whether to allow a long timeout. + |
+
log_group_id + |
+String + |
+Log group ID. + |
+
log_stream_id + |
+String + |
+Log stream ID. + |
+
type + |
+String + |
+v2 indicates an official version, and v1 indicates a deprecated version. +Enumeration values: +
|
+
enable_cloud_debug + |
+String + |
+Whether to enable cloud debugging to adapt to the CloudDebug scenario. (discarded) + |
+
enable_dynamic_memory + |
+Boolean + |
+Whether to enable dynamic memory allocation. + |
+
is_stateful_function + |
+Boolean + |
+Whether stateful functions are supported. This parameter is supported in FunctionGraph v2. + |
+
custom_image + |
+CustomImage object + |
+Container image. + |
+
is_bridge_function + |
+Boolean + |
+Whether this is a bridge function. + |
+
apig_route_enable + |
+Boolean + |
+Whether to configure gateway routing rules. + |
+
heartbeat_handler + |
+String + |
+Entry of the heartbeat function in the format of "xx.xx". It must contain a period (.).This parameter can be configured only for Java functions. The heartbeat function entry must be in the same file as your function handler. This parameter is mandatory when the heartbeat function is enabled. + |
+
enable_class_isolation + |
+Boolean + |
+Indicates whether to enable class isolation. This parameter can be configured only for Java functions. Enable to dump logs to Kafka and improve class loading efficiency. However, this may cause compatibility issues. + |
+
gpu_type + |
+String + |
+GPU type. + |
+
allow_ephemeral_storage + |
+Boolean + |
+Indicates whether ephemeral storage can be configured. + |
+
ephemeral_storage + |
+Integer + |
+Ephemeral storage. By default, the /tmp directory of each function is 512 MB. You can increase the size to 10,240 MB (10 GB) if necessary. +Enumeration values: +
|
+
network_controller + |
+NetworkControlConfig object + |
+Network configuration. + |
+
resource_id + |
+String + |
+Resource ID. Unique ID of a function. + |
+
is_return_stream + |
+Boolean + |
+Whether to return stream data. (discarded) + |
+
enable_auth_in_header + |
+Boolean + |
+Whether to add authentication information to request header for custom image-based functions. (This parameter cannot be modified when creating a function.) + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
domain_id + |
+String + |
+Domain name ID. + |
+
namespace + |
+String + |
+Project ID. + |
+
vpc_name + |
+String + |
+VPC name. + |
+
vpc_id + |
+String + |
+VPC ID. + |
+
subnet_name + |
+String + |
+Subnet name. + |
+
subnet_id + |
+String + |
+Subnet ID. + |
+
cidr + |
+String + |
+Subnet mask. + |
+
gateway + |
+String + |
+Gateway. + |
+
security_groups + |
+Array of strings + |
+Security group. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
mount_user + |
+MountUser object + |
+User information. + |
+
func_mounts + |
+Array of FuncMount objects + |
+Mounted resources. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
user_id + |
+String + |
+User ID, a non-0 integer from –1 to 65534. + |
+
user_group_id + |
+String + |
+User group ID, a non-0 integer from –1 to 65534. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
mount_type + |
+String + |
+Mount type. The value can be sfs, sfsTurbo, or ecs. This parameter is mandatory when func_mounts is not empty. + |
+
mount_resource + |
+String + |
+ID of the mounted resource (cloud service ID). This parameter is mandatory when func_mounts is not empty. + |
+
mount_share_path + |
+String + |
+Remote mount path. For example, 192.168.0.12:/data. This parameter is mandatory if mount_type is set to ecs. + |
+
local_mount_path + |
+String + |
+Function access path. This parameter is mandatory when func_mounts is not empty. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
concurrency + |
+Integer + |
+Maximum number of instances for a single function. For v1, the value can be 0 or –1; for v2, it ranges from –1 to 1000. +
|
+
concurrent_num + |
+Integer + |
+Number of concurrent requests per instance. This parameter is supported only by v2. The value ranges from 1 to 1,000. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
id + |
+String + |
+Dependency version ID. + |
+
owner + |
+String + |
+Domain ID of the dependency owner. + |
+
link + |
+String + |
+URL of the dependency on OBS. + |
+
runtime + |
+String + |
+Environment for executing a function. Options: Python2.7 Python 3.6 Python 3.9 Go 1.8 Go 1.x Java 8 Java 11 Node.js 6.10 Node.js 8.10 Node.js 10.16 Node.js 12.13 Node.js 14.18 C# (.NET Core 2.0) C# (.NET Core 2.1) C# (.NET Core 3.1) Custom PHP 7.3 HTTP Custom image-based functions +Enumeration values: +
|
+
etag + |
+String + |
+MD5 value of a dependency. + |
+
size + |
+Long + |
+Dependency size. + |
+
name + |
+String + |
+Dependence name. + |
+
description + |
+String + |
+Dependency description. + |
+
file_name + |
+String + |
+File name of a dependency package (ZIP). + |
+
version + |
+Long + |
+Dependency version ID. + |
+
dep_id + |
+String + |
+Dependency ID. + |
+
last_modified + |
+String + |
+Time when the function was last updated. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
enabled + |
+Boolean + |
+Whether to enable this feature. + |
+
image + |
+String + |
+Image address. + |
+
command + |
+String + |
+Command for starting a container image. + |
+
args + |
+String + |
+Command line parameter for starting a container image. + |
+
working_dir + |
+String + |
+Working directory of an image container. + |
+
uid + |
+String + |
+User ID of an image container. + |
+
gid + |
+String + |
+User group ID of an image container. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
disable_public_network + |
+Boolean + |
+Disable public access. + |
+
trigger_access_vpcs + |
+Array of VpcConfig objects + |
+VPC access restriction. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
vpc_name + |
+String + |
+VPC name. + |
+
vpc_id + |
+String + |
+VPC ID. + |
+
Status code: 400
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 401
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 403
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 404
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 500
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 503
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
POST https://{Endpoint}/v2/{project_id}/fgs/functions + +{ + "func_name" : "xxx", + "package" : "xxx", + "runtime" : "Python2.7", + "handler" : "index.py", + "type" : "v2", + "memory_size" : 128, + "timeout" : 3, + "code_type" : "inline", + "mount_config" : { + "mount_user" : { + "user_id" : -1, + "user_group_id" : -1 + }, + "func_mounts" : [ { + "mount_resource" : "268xxx-d3xx-4cxx-98xx-d1dbxxx", + "local_mount_path" : "/mnt", + "mount_type" : "sfsTurbo" + } ] + }, + "encrypted_user_data" : "{\"password\":\"1234\"}", + "func_code" : { + "file" : "xxxxx", + "link" : "" + } +}+
POST https://{Endpoint}/v2/{project_id}/fgs/functions + +{ + "func_name" : "xxx", + "package" : "xxx", + "runtime" : "Python3.9", + "handler" : "index.py", + "type" : "v2", + "memory_size" : 128, + "timeout" : 3, + "code_type" : "obs", + "code_url" : "https:xxx" +}+
POST https://{Endpoint}/v2/{project_id}/fgs/functions + +{ + "func_name" : "xxx", + "package" : "xxx", + "runtime" : "Custom Image", + "handler" : "-", + "type" : "v2", + "memory_size" : 128, + "timeout" : 3, + "code_type" : "obs", + "code_url" : "https:xxx", + "xrole" : "xxx", + "custom_image" : { + "enabled" : true, + "image" : "swr.xxx" + } +}+
Status code: 200
+ok
+{ + "func_urn" : "urn:fss:xxxxxxxxx:c3b2459a6d5e4b548e6777e57852692d:function:default:TestCreateFunctionInPythonSdk:latest", + "func_name" : "TestCreateFunctionInPythonSdk", + "domain_id" : "14ee2e3501124efcbca7998baa24xxxx", + "namespace" : "46b6f338fc3445b8846c71dfb1fbxxxx", + "project_name" : "xxxxxxxxxx", + "package" : "default", + "runtime" : "Python3.6", + "timeout" : 3, + "handler" : "index.handler", + "memory_size" : 128, + "encrypted_user_data" : "{\"password\":\"\"}", + "mount_config" : { + "mount_user" : { + "user_id" : -1, + "user_group_id" : -1 + }, + "func_mounts" : [ { + "mount_resource" : "268xxx-d3xx-4cxx-98xx-d1dbxxx", + "local_mount_path" : "/mnt", + "mount_type" : "sfsTurbo" + } ] + }, + "cpu" : 300, + "code_type" : "inline", + "code_filename" : "index.py", + "code_size" : 100, + "digest" : "1c8610d1870731a818a037f1d2adf3223e8ac351aeb293fb1f8eabd2e9820069a61ed8b5d38182e760adc33a307d0e957afc357f415cd8c9c3ff6f0426fd85cd", + "version" : "latest", + "image_name" : "latest-191025153727@zehht", + "last_modified" : "2019-10-25 15:37:27", + "strategy_config" : { + "concurrency" : 0 + } +}+
Status code: 400
+Bad request.
+{ + "error_code" : "FSS.0401", + "error_msg" : "not permit" +}+
Status code: 401
+Unauthorized.
+{ + "error_code" : "FSS.0401", + "error_msg" : "not permit" +}+
Status code: 403
+Forbidden.
+{ + "error_code" : "FSS.0401", + "error_msg" : "not permit" +}+
Status Code + |
+Description + |
+
---|---|
200 + |
+ok + |
+
400 + |
+Bad request. + |
+
401 + |
+Unauthorized. + |
+
403 + |
+Forbidden. + |
+
404 + |
+Not found. + |
+
500 + |
+Internal server error. + |
+
503 + |
+Service unavailable. + |
+
See Error Codes.
+This API is used to import a function.
+POST /v2/{project_id}/fgs/functions/import
+ +Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. For details, see Obtaining a Project ID. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
X-Auth-Token + |
+Yes + |
+String + |
+User token. +It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. + |
+
Content-Type + |
+Yes + |
+String + |
+Message body type (format). + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
func_name + |
+Yes + |
+String + |
+Function name.Max. 60 of letters, digits, hyphens (-), and underscores (_). Start with a letter, and end with a letter or digit. +Minimum length: 1 character. +Maximum length: 60 characters. + |
+
file_name + |
+Yes + |
+String + |
+File name. + |
+
file_type + |
+Yes + |
+String + |
+File type. + |
+
file_code + |
+Yes + |
+String + |
+Function code. The code must be encoded using Base64. + |
+
package + |
+No + |
+String + |
+App name. The default value is default. + |
+
Status code: 200
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
func_urn + |
+String + |
+Function URN. + |
+
func_name + |
+String + |
+Function name. + |
+
domain_id + |
+String + |
+Domain ID. + |
+
namespace + |
+String + |
+Project ID. + |
+
project_name + |
+String + |
+Project name. + |
+
package + |
+String + |
+Group to which the function belongs. This field is defined to group functions. + |
+
runtime + |
+String + |
+Environment for executing a function. Options: Python2.7 Python 3.6 Python 3.9 Go 1.8 Go 1.x Java 8 Java 11 Node.js 6.10 Node.js 8.10 Node.js 10.16 Node.js 12.13 Node.js 14.18 C# (.NET Core 2.0) C# (.NET Core 2.1) C# (.NET Core 3.1) Custom PHP 7.3 HTTP Custom image-based functions +Enumeration values: +
|
+
timeout + |
+Integer + |
+Maximum duration the function can be executed. Value range: 3s–259,200s. + |
+
handler + |
+String + |
+Handler of a function in the format of "xx.xx". It must contain a period (.). +For example, for Node.js function myfunction.handler, the file name is myfunction.js, and the handler function is handler. + |
+
memory_size + |
+Integer + |
+Memory consumed by a function. +Unit: MB. +The value can be 128, 256, 512, 768, 1024, 1280, 1536, 1792, 2048, 2560, 3072, 3584 or 4096. +The value ranges from 128 to 4096. + |
+
gpu_memory + |
+Integer + |
+GPU memory. This parameter is available only for functions created with a custom runtime or image. Unit: MB. Options: 1024, 2048, 3072, 4096, 5120, 6144, 7168, 8192, 9216, 10,240, 11,264, 12,288, 13,312, 14,336, 15,360, and 16,384. Range: 1024 to 16,384. + |
+
cpu + |
+Integer + |
+CPU resources of a function. Unit: millicore (1 core = 1000 millicores). The value of this field is proportional to that of MemorySize. By default, 100 CPU millicores are required for 128 MB memory. + |
+
code_type + |
+String + |
+Function code type. Options: inline: inline code zip: ZIP file obs: function code stored in an OBS bucket jar: JAR file, mainly for Java functions Custom-Image-Swr: The function code comes from the SWR custom image. +Enumeration values: +
|
+
code_url + |
+String + |
+If CodeType is set to obs, enter the OBS URL of the function code package. If CodeType is not set to obs, leave this parameter blank. + |
+
code_filename + |
+String + |
+Name of a function file. This parameter is mandatory only when CodeType is set to jar or zip. + |
+
code_size + |
+Long + |
+Code size in bytes. + |
+
user_data + |
+String + |
+Name/Value information defined for the function. These are parameters used in the function. For example, if a function needs to access a host, define Host={host_ip}. You can define a maximum of 20 such parameters, and their total length cannot exceed 4 KB. + |
+
digest + |
+String + |
+SHA512 hash value of function code, which is used to determine whether the function has changed. + |
+
version + |
+String + |
+Function version, which is automatically generated by the system. The version name is in the format of "vYYYYMMDD-HHMMSS" (v+year/month/day-hour/minute/second). + |
+
image_name + |
+String + |
+Internal identifier of a function version. + |
+
xrole + |
+String + |
+Agency used by the function. You need to create an agency on the IAM console. This field is mandatory when a function needs to access other services. + |
+
app_xrole + |
+String + |
+Agency used by the function app. You need to create an agency on the IAM console. This field is mandatory when a function needs to access other services. + |
+
description + |
+String + |
+Function description. + |
+
version_description + |
+String + |
+Version description. + |
+
last_modified + |
+String + |
+Time when the function was last updated. + |
+
func_vpc + |
+FuncVpc object + |
+VPC configuration. An agency with VPC permissions must be configured for the function. + |
+
depend_version_list + |
+Array of strings + |
+Dependency versions. + |
+
strategy_config + |
+StrategyConfig object + |
+Function policy configuration. + |
+
extend_config + |
+String + |
+Extended configuration. + |
+
initializer_handler + |
+String + |
+Initializer of the function in the format of "xx.xx". It must contain a period (.). This parameter is mandatory when the initialization function is configured. For example, for Node.js function myfunction.initializer, the file name is myfunction.js, and the initialization function is initializer. + |
+
initializer_timeout + |
+Integer + |
+Maximum duration the function can be initialized. Value range: 1s–300s. This parameter is mandatory when the initialization function is configured. + |
+
pre_stop_handler + |
+String + |
+The pre-stop handler of a function. The value must contain a period (.) in the format of xx.xx. For example, for Node.js function myfunction.pre_stop_handler, the file name is myfunction.js, and the initialization function is pre_stop_handler. + |
+
pre_stop_timeout + |
+Integer + |
+Maximum duration the function can be initialized. Value range: 1s–90s. + |
+
enterprise_project_id + |
+String + |
+Enterprise project ID. This parameter is mandatory if you create a function as an enterprise user. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
domain_id + |
+String + |
+Domain name ID. + |
+
namespace + |
+String + |
+Project ID. + |
+
vpc_name + |
+String + |
+VPC name. + |
+
vpc_id + |
+String + |
+VPC ID. + |
+
subnet_name + |
+String + |
+Subnet name. + |
+
subnet_id + |
+String + |
+Subnet ID. + |
+
cidr + |
+String + |
+Subnet mask. + |
+
gateway + |
+String + |
+Gateway. + |
+
security_groups + |
+Array of strings + |
+Security group. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
concurrency + |
+Integer + |
+Maximum number of instances for a single function. For v1, the value can be 0 or –1; for v2, it ranges from –1 to 1000. +
|
+
concurrent_num + |
+Integer + |
+Number of concurrent requests per instance. This parameter is supported only by v2. The value ranges from 1 to 1,000. + |
+
Status code: 409
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 500
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Import a function from a Base64-encoded file test.zip.
+POST https://{Endpoint}/v2/{project_id}/fgs/functions/import + +{ + "func_name" : "test", + "file_name" : "test.zip", + "file_type" : "zip", + "file_code" : "xxxxxxxxxxxxxxxxxxxxx" +}+
Status code: 200
+ok
+{ + "func_urn" : "urn:fss:{region}:46b6f338fc3445b8846c71dfb1fbd9e8:function:default:test_v1_2", + "func_name" : "test_v1_2", + "domain_id" : "14ee2e35****a7998b******aa24cabf", + "namespace" : "46b6f338fc3445b8846c71dfb1fbd9e8", + "project_name" : "{region}", + "package" : "default", + "runtime" : "Node.js6.10", + "timeout" : 3, + "handler" : "index.handler", + "memory_size" : 128, + "cpu" : 300, + "code_type" : "zip", + "code_filename" : "index.zip", + "code_size" : 6709, + "digest" : "faa825575c45437cddd4e369bea69893bcbe195d478178462ad90984fe72993f3f59d15f41c5373f807f3e05fb9af322c55dabeb16565c386e402413458e6068", + "version" : "latest", + "image_name" : "latest-191025153727@zehht", + "last_modified" : "2019-10-25 15:37:27", + "strategy_config" : { + "concurrency" : -1 + }, + "enterprise_project_id" : "46b6f338fc3445b8846c71dfb1fbxxxx" +}+
Status code: 409
+Conflict
+{ + "error_code" : "FSS.1061", + "error_msg" : "The function has existed" +}+
Status Code + |
+Description + |
+
---|---|
200 + |
+ok + |
+
409 + |
+Conflict + |
+
500 + |
+Internal server error. + |
+
See Error Codes.
+This API is used to export a function.
+GET /v2/{project_id}/fgs/functions/{function_urn}/export
+ +Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. For details, see Obtaining a Project ID. + |
+
function_urn + |
+Yes + |
+String + |
+Function URN. For details, see the function model description. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
config + |
+No + |
+Boolean + |
+Whether to export function configuration. The default value is false. If the type parameter does not exist, at least one of code=true or config=true must be specified. +Default: false + |
+
code + |
+No + |
+Boolean + |
+Whether to export function code. The default value is false. If the type parameter does not exist, at least one of code=true or config=true must be specified. +Default: false + |
+
type + |
+No + |
+String + |
+This parameter cannot be used with code or config. type=code indicates exporting the code, and type=config indicates exporting the configuration. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
X-Auth-Token + |
+Yes + |
+String + |
+User token. +It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. + |
+
Content-Type + |
+Yes + |
+String + |
+Message body type (format). + |
+
Status code: 404
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 500
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Export function code only.
+GET /v2/{project_id}/fgs/functions/{func_urn}/export?type=code+
Export both function code and configuration.
+GET /v2/{project_id}/fgs/functions/{func_urn}/export?code=true&config=true+
Status code: 404
+Not found.
+{ + "error_code" : "FSS.1051", + "error_msg" : "Not found the function" +}+
Status Code + |
+Description + |
+
---|---|
200 + |
+ok + |
+
404 + |
+Not found. + |
+
500 + |
+Internal server error. + |
+
See Error Codes.
+This API is used to delete a function or a non-latest version of a function.
+If the URN contains a function version or alias, the function version or the version corresponding to the specified alias as well as associated triggers will be deleted.
+If the URN does not contain a function version or alias, the entire function (including all of its versions, aliases, and triggers) will be deleted.
+DELETE /v2/{project_id}/fgs/functions/{function_urn}
+ +Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. For details, see Obtaining a Project ID. + |
+
function_urn + |
+Yes + |
+String + |
+Function URN. For details, see the function model descriptions. +The latest version of a function cannot be deleted. To delete a function and all its versions, provide a URN without any version or alias. Example: +urn:fss:xxxxxxxx:7aad83af3e8d42e99ac194e8419e2c9b:function:default:test. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
X-Auth-Token + |
+Yes + |
+String + |
+User token. +It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. + |
+
Content-Type + |
+Yes + |
+String + |
+Message body type (format). + |
+
Status code: 401
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 403
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 404
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 500
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Delete a function or a function version.
+DELETE https://{Endpoint}/v2/{project_id}/fgs/functions/{func_urn}+
None
+Status Code + |
+Description + |
+
---|---|
204 + |
+No Content + |
+
401 + |
+Unauthorized. + |
+
403 + |
+Forbidden. + |
+
404 + |
+Not found. + |
+
500 + |
+Internal server error. + |
+
See Error Codes.
+This API is used to modify the code of a function.
+PUT /v2/{project_id}/fgs/functions/{function_urn}/code
+ +Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. For details, see Obtaining a Project ID. + |
+
function_urn + |
+Yes + |
+String + |
+Function URN. For details, see the function model description. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
X-Auth-Token + |
+Yes + |
+String + |
+User token. +It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. + |
+
Content-Type + |
+Yes + |
+String + |
+Message body type (format). + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
code_type + |
+Yes + |
+String + |
+Function code type. Options: inline: inline code zip: ZIP file obs: function code stored in an OBS bucket jar: JAR file, mainly for Java functions Custom-Image-Swr: The function code comes from the SWR custom image. +Enumeration values: +
|
+
code_url + |
+No + |
+String + |
+If CodeType is set to obs, enter the OBS URL of the function code package. If CodeType is not set to obs, leave this parameter blank. + |
+
code_filename + |
+No + |
+String + |
+Name of a function file. This parameter is mandatory only when CodeType is set to jar or zip. + |
+
func_code + |
+Yes + |
+FuncCode object + |
+Response body of the FuncCode struct. + |
+
depend_version_list + |
+No + |
+Array of strings + |
+Dependency version IDs. + |
+
Status code: 200
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
func_urn + |
+String + |
+Function URN. + |
+
func_name + |
+String + |
+Function name. + |
+
domain_id + |
+String + |
+Domain ID. + |
+
runtime + |
+String + |
+Environment for executing a function. Options: Python2.7 Python 3.6 Python 3.9 Go 1.8 Go 1.x Java 8 Java 11 Node.js 6.10 Node.js 8.10 Node.js 10.16 Node.js 12.13 Node.js 14.18 C# (.NET Core 2.0) C# (.NET Core 2.1) C# (.NET Core 3.1) Custom PHP 7.3 HTTP Custom image-based functions +Enumeration values: +
|
+
code_type + |
+String + |
+Function code type. Options: inline: inline code zip: ZIP file obs: function code stored in an OBS bucket jar: JAR file, mainly for Java functions Custom-Image-Swr: The function code comes from the SWR custom image. +Enumeration values: +
|
+
code_url + |
+String + |
+If CodeType is set to obs, enter the OBS URL of the function code package. If CodeType is not set to obs, leave this parameter blank. + |
+
code_filename + |
+String + |
+Name of a function file. This parameter is mandatory only when CodeType is set to jar or zip. + |
+
code_size + |
+Long + |
+Code size in bytes. + |
+
digest + |
+String + |
+SHA512 hash value of function code, which is used to determine whether the function has changed. + |
+
last_modified + |
+String + |
+Time when the function was last updated. + |
+
func_code + |
+FuncCode object + |
+Response body of the FuncCode struct. + |
+
depend_version_list + |
+Array of strings + |
+Dependency version IDs. + |
+
strategy_config + |
+StrategyConfig object + |
+Function policy configuration. + |
+
dependencies + |
+Array of Dependency objects + |
+Dependency packages. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
file + |
+String + |
+Function code, which must be encoded using Base64. If this parameter is left blank, the default code is used. + |
+
link + |
+String + |
+Function code URL. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
concurrency + |
+Integer + |
+Maximum number of instances for a single function. For v1, the value can be 0 or –1; for v2, it ranges from –1 to 1000. +
|
+
concurrent_num + |
+Integer + |
+Number of concurrent requests per instance. This parameter is supported only by v2. The value ranges from 1 to 1,000. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
id + |
+String + |
+Dependency version ID. + |
+
owner + |
+String + |
+Domain ID of the dependency owner. + |
+
link + |
+String + |
+URL of the dependency on OBS. + |
+
runtime + |
+String + |
+Environment for executing a function. Options: Python2.7 Python 3.6 Python 3.9 Go 1.8 Go 1.x Java 8 Java 11 Node.js 6.10 Node.js 8.10 Node.js 10.16 Node.js 12.13 Node.js 14.18 C# (.NET Core 2.0) C# (.NET Core 2.1) C# (.NET Core 3.1) Custom PHP 7.3 HTTP Custom image-based functions +Enumeration values: +
|
+
etag + |
+String + |
+MD5 value of a dependency. + |
+
size + |
+Long + |
+Dependency size. + |
+
name + |
+String + |
+Dependence name. + |
+
description + |
+String + |
+Dependency description. + |
+
file_name + |
+String + |
+File name of a dependency package (ZIP). + |
+
version + |
+Long + |
+Dependency version ID. + |
+
dep_id + |
+String + |
+Dependency ID. + |
+
last_modified + |
+String + |
+Time when the function was last updated. + |
+
Status code: 400
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 401
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 403
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 404
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 500
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
PUT https://{Endpoint}/v2/{project_id}/fgs/functions/{function_urn}/code + +{ + "code_filename" : "index.zip", + "code_type" : "inline", + "func_code" : { + "file" : "UEsDBAoAAAAIAPQ1M1gNImPLrAAAAAEBAAAIAAAAaW5kZXgucHlNjtEOgjAMRd/5igVfxDAlxhjDo0S/wB+YrMgMdMvWGYnh390wEfrU3nvb0xXjG85qLRU+Sk8NP0UhUb3RltjTaUwkNKwVKDuwbA0vQMrDAhK8KSsTFsoCeYvsMw2xUkeCvKu0hLRk+6LIZ0u5s3BwPFwwUEEG/yo6B4vEXcshyBG+lb437kfNFpEWhATrQmqGTkYVH0Pit8FEdCqM6VQtSGncxYPpPz5O3fgFUEsBAh4DCgAAAAgA9DUzWA0iY8usAAAAAQEAAAgAAAAAAAAAAAAAAPMCAAAAAGluZGV4LnB5UEsFBgAAAAABAAEANgAAANIAAAAAAA==" + } +}+
PUT https://{Endpoint}/v2/{project_id}/fgs/functions/{function_urn}/code + +{ + "code_filename" : "index.zip", + "code_type" : "zip", + "func_code" : { + "file" : "UEsDBAoAAAAIAPQ1M1gNImPLrAAAAAEBAAAIAAAAaW5kZXgucHlNjtEOgjAMRd/5igVfxDAlxhjDo0S/wB+YrMgMdMvWGYnh390wEfrU3nvb0xXjG85qLRU+Sk8NP0UhUb3RltjTaUwkNKwVKDuwbA0vQMrDAhK8KSsTFsoCeYvsMw2xUkeCvKu0hLRk+6LIZ0u5s3BwPFwwUEEG/yo6B4vEXcshyBG+lb437kfNFpEWhATrQmqGTkYVH0Pit8FEdCqM6VQtSGncxYPpPz5O3fgFUEsBAh4DCgAAAAgA9DUzWA0iY8usAAAAAQEAAAgAAAAAAAAAAAAAAPMCAAAAAGluZGV4LnB5UEsFBgAAAAABAAEANgAAANIAAAAAAA==" + } +}+
Status code: 200
+OK
+{ + "func_urn" : "urn:fss:xxxxxxxxxxxx:7aad83af3e8d42e99ac194e8419e2c9b:function:default:test:latest", + "func_name" : "test", + "domain_id" : "14ee2e3501124efcbca7998baa24xxxx", + "runtime" : "Node.js6.10", + "code_type" : "inline", + "code_filename" : "index.js", + "code_size" : 245, + "digest" : "39d51ae334ffb239037e194159f4cc9cec31086719aa73db7d0a608343121a290f7115693e008bd01cb12b99a803856e83aa96173b26c528c41cfed18267e08f", + "last_modified" : "2019-10-31 11:37:58", + "func_code" : { + "file" : "aW1wb3J0IGpzb24KZGVmIGhhbmRsZXIoZXZlbnQsIGNvbnRleHQpOgogICAgb3V0cHV0ID0gJ0hlbGxvIE1zZyBmb3IgbW9kaWZ5OiAnICsganNvbi5kdW1wcyhldmVudCkKICAgIGFrID0gY29udGV4dC5nZXRBY2Nlc3NLZXkoKQogICAgc2sgPSBjb250ZXh0LmdldFNlY3JldEtleSgpCiAgICB0b2tlbiA9IGNvbnRleHQuZ2V0VG9rZW4oKQogICAgcHJpbnQgJ2FrOicgKyBhawogICAgcHJpbnQgJ3NrOicgKyBzawogICAgcHJpbnQgJ3Rva2VuOicgKyB0b2tlbgogICAgcmV0dXJuIG91dHB1dAo+C0NLTqLwKImNCTgBMSn5SC+UbkysuKp1Bj7JQqxds+5p7La/ew4RBTp8IusZ/k2qmqvCDdoBY0ywYCl+RgctnLbTS6hLLj9sNyKoVXiXb1BLAQIeAwoAAAAIAAhYOU8ssPQsgwAAALYAAAAIAAAAAAAAAAAAAADzAgAAAABpbmRleC5weVBLBQYAAAAAAQABADYAAACpAAAAAAA=", + "link" : "" + }, + "strategy_config" : { + "concurrency" : -1 + } +}+
Status code: 404
+Not found.
+{ + "error_code" : "FSS.1052", + "error_msg" : "Not found the function version" +}+
Status Code + |
+Description + |
+
---|---|
200 + |
+OK + |
+
400 + |
+Bad request. + |
+
401 + |
+Unauthorized. + |
+
403 + |
+Forbidden. + |
+
404 + |
+Not found. + |
+
500 + |
+Internal server error. + |
+
See Error Codes.
+This API is used to modify the metadata of a function.
+PUT /v2/{project_id}/fgs/functions/{function_urn}/config
+ +Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. For details, see Obtaining a Project ID. + |
+
function_urn + |
+Yes + |
+String + |
+Function URN. For details, see the function model description. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
X-Auth-Token + |
+Yes + |
+String + |
+User token. +It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. + |
+
Content-Type + |
+Yes + |
+String + |
+Message body type (format). + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
func_name + |
+Yes + |
+String + |
+Function name. + |
+
runtime + |
+Yes + |
+String + |
+Environment in which a FunctionGraph function is executed. Options: +
Enumeration values: +
|
+
timeout + |
+Yes + |
+Integer + |
+Maximum duration the function can be executed. Value range: 3s–259,200s. + |
+
handler + |
+Yes + |
+String + |
+Handler of a function in the format of "xx.xx". It must contain a period (.). +For example, for Node.js function myfunction.handler, the file name is myfunction.js, and the handler function is handler. + |
+
memory_size + |
+Yes + |
+Integer + |
+Memory consumed by a function. +Unit: MB. +The value can be 128, 256, 512, 768, 1024, 1280, 1536, 1792, 2048, 2560, 3072, 3584 or 4096. +The value ranges from 128 to 4096. + |
+
gpu_memory + |
+No + |
+Integer + |
+GPU memory. This parameter is available only for functions created with a custom runtime or image. +Unit: MB. +Options: 1024, 2048, 3072, 4096, 5120, 6144, 7168, 8192, 9216, 10,240, 11,264, 12,288, 13,312, 14,336, 15,360, and 16,384. +Range: 1024 to 16,384. + |
+
user_data + |
+No + |
+String + |
+Name/Value information defined for the function. +These are parameters used in a function. +For example, if a function needs to access a host, define Host={host_ip}. You can define a maximum of 20 such parameters, and their total length cannot exceed 4 KB. + |
+
encrypted_user_data + |
+No + |
+String + |
+User-defined name/value to be encrypted. + |
+
xrole + |
+No + |
+String + |
+Agency used by the function. You need to create an agency on the IAM console. This field is mandatory when a function needs to access other services. After specifying a function execution agency, you can use the context method in the function handler to obtain a token, an AK, and an SK for accessing other cloud services. No agency is required if FunctionGraph does not access any cloud services. + |
+
app_xrole + |
+No + |
+String + |
+Execution agency. You can optimize performance by configuring a separate agency for function execution, otherwise, the same agency is used for both execution and configuration. + |
+
description + |
+No + |
+String + |
+Function description. + |
+
func_vpc + |
+No + |
+FuncVpc object + |
+VPC configuration. An agency with VPC permissions must be configured for the function. + |
+
mount_config + |
+No + |
+MountConfig object + |
+Mounting configuration. + |
+
strategy_config + |
+No + |
+StrategyConfig object + |
+Function policy configuration. + |
+
custom_image + |
+No + |
+CustomImage object + |
+Container image. + |
+
extend_config + |
+No + |
+String + |
+Extended configuration. + |
+
initializer_handler + |
+No + |
+String + |
+Initializer of the function in the format of "xx.xx". It must contain a period (.). This parameter is mandatory when the initialization function is configured. For example, for Node.js function myfunction.initializer, the file name is myfunction.js, and the initialization function is initializer. + |
+
initializer_timeout + |
+No + |
+Integer + |
+Maximum duration the function can be initialized. Value range: 1s–300s. This parameter is mandatory when the initialization function is configured. + |
+
pre_stop_handler + |
+No + |
+String + |
+The pre-stop handler of a function. The value must contain a period (.) in the format of xx.xx. For example, for Node.js function myfunction.pre_stop_handler, the file name is myfunction.js, and the initialization function is pre_stop_handler. + |
+
pre_stop_timeout + |
+No + |
+Integer + |
+Maximum duration the function can be initialized. Value range: 1s–90s. + |
+
ephemeral_storage + |
+No + |
+Integer + |
+Ephemeral storage. By default, the /tmp directory of each function is 512 MB. You can increase the size to 10,240 MB (10 GB) if necessary. +Enumeration values: +
|
+
enterprise_project_id + |
+No + |
+String + |
+Enterprise project ID. This parameter is mandatory if you create a function as an enterprise user. + |
+
log_config + |
+No + |
+FuncLogConfig object + |
+Function log configuration. + |
+
network_controller + |
+No + |
+NetworkControlConfig object + |
+Network configuration. + |
+
is_stateful_function + |
+No + |
+Boolean + |
+Whether stateful functions are supported. If they are supported, set this parameter to true. This parameter is supported in FunctionGraph v2. + |
+
enable_dynamic_memory + |
+No + |
+Boolean + |
+Whether to enable dynamic memory allocation. + |
+
enable_auth_in_header + |
+No + |
+Boolean + |
+Whether to allow authentication information in the request header. + |
+
domain_names + |
+No + |
+String + |
+Private domain name. + |
+
restore_hook_handler + |
+No + |
+String + |
+Restore Hook entry point for snapshot-based cold start in the format "xx.xx". The period (.) must be included. For example, com.xxx.demo.Test.restoreHook. + |
+
restore_hook_timeout + |
+No + |
+Integer + |
+Restore Hook timeout of snapshot-based cold start. Range: 1s to 300s. + |
+
heartbeat_handler + |
+No + |
+String + |
+Entry of the heartbeat function in the format of "xx.xx". It must contain a period (.).This parameter can be configured only in Java. The heartbeat function entry must be in the same file as your function handler. This parameter is mandatory when the heartbeat function is enabled. + |
+
enable_class_isolation + |
+No + |
+Boolean + |
+Indicates whether to enable class isolation. This parameter can be configured only in Java. Enable to dump logs to Kafka and improve class loading efficiency. However, this may cause compatibility issues. + |
+
gpu_type + |
+No + |
+String + |
+GPU type. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
domain_id + |
+No + |
+String + |
+Domain name ID. + |
+
namespace + |
+No + |
+String + |
+Project ID. + |
+
vpc_name + |
+No + |
+String + |
+VPC name. + |
+
vpc_id + |
+Yes + |
+String + |
+VPC ID. + |
+
subnet_name + |
+No + |
+String + |
+Subnet name. + |
+
subnet_id + |
+Yes + |
+String + |
+Subnet ID. + |
+
cidr + |
+No + |
+String + |
+Subnet mask. + |
+
gateway + |
+No + |
+String + |
+Gateway. + |
+
security_groups + |
+No + |
+Array of strings + |
+Security group. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
mount_user + |
+Yes + |
+MountUser object + |
+User information. + |
+
func_mounts + |
+Yes + |
+Array of FuncMount objects + |
+Mounted resources. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
user_id + |
+Yes + |
+String + |
+User ID, a non-0 integer from –1 to 65534. + |
+
user_group_id + |
+Yes + |
+String + |
+User group ID, a non-0 integer from –1 to 65534. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
mount_type + |
+Yes + |
+String + |
+Mount type. The value can be sfs, sfsTurbo, or ecs. This parameter is mandatory when func_mounts is not empty. + |
+
mount_resource + |
+Yes + |
+String + |
+ID of the mounted resource (cloud service ID). This parameter is mandatory when func_mounts is not empty. + |
+
mount_share_path + |
+No + |
+String + |
+Remote mount path. For example, 192.168.0.12:/data. This parameter is mandatory if mount_type is set to ecs. + |
+
local_mount_path + |
+Yes + |
+String + |
+Function access path. This parameter is mandatory when func_mounts is not empty. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
concurrency + |
+Yes + |
+Integer + |
+Maximum number of instances for a single function. For v1, the value can be 0 or –1; for v2, it ranges from –1 to 1000. +
|
+
concurrent_num + |
+Yes + |
+Integer + |
+Number of concurrent requests per instance. This parameter is supported only by v2. The value ranges from 1 to 1,000. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
enabled + |
+No + |
+Boolean + |
+Whether to enable this feature. + |
+
image + |
+No + |
+String + |
+Image address. + |
+
command + |
+No + |
+String + |
+Command for starting a container image. + |
+
args + |
+No + |
+String + |
+Command line parameter for starting a container image. + |
+
working_dir + |
+No + |
+String + |
+Working directory of an image container. + |
+
uid + |
+No + |
+String + |
+User ID of an image container. + |
+
gid + |
+No + |
+String + |
+User group ID of an image container. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
group_name + |
+No + |
+String + |
+Name of the log group bound to the function. + |
+
group_id + |
+No + |
+String + |
+ID of the log group bound to the function. + |
+
stream_name + |
+No + |
+String + |
+Name of the log stream bound to the function. + |
+
stream_id + |
+No + |
+String + |
+ID of the log stream bound to the function. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
disable_public_network + |
+No + |
+Boolean + |
+Disable public access. + |
+
trigger_access_vpcs + |
+No + |
+Array of VpcConfig objects + |
+VPC access restriction. + |
+
Status code: 200
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
func_id + |
+String + |
+Function ID, which uniquely identifies a function. + |
+
resource_id + |
+String + |
+Function resource ID. + |
+
func_urn + |
+String + |
+Function URN. + |
+
func_name + |
+String + |
+Function name. + |
+
domain_id + |
+String + |
+Domain ID. + |
+
namespace + |
+String + |
+Project ID. + |
+
project_name + |
+String + |
+Project name. + |
+
package + |
+String + |
+Group to which the function belongs. This field is defined to group functions. + |
+
runtime + |
+String + |
+Environment for executing a function. Options: Python2.7 Python 3.6 Python 3.9 Go 1.8 Go 1.x Java 8 Java 11 Node.js 6.10 Node.js 8.10 Node.js 10.16 Node.js 12.13 Node.js 14.18 C# (.NET Core 2.0) C# (.NET Core 2.1) C# (.NET Core 3.1) Custom PHP 7.3 HTTP Custom image-based functions +Enumeration values: +
|
+
timeout + |
+Integer + |
+Maximum duration the function can be executed. Value range: 3s–259,200s. + |
+
handler + |
+String + |
+Handler of a function in the format of "xx.xx". It must contain a period (.). +For example, for Node.js function myfunction.handler, the file name is myfunction.js, and the handler function is handler. + |
+
memory_size + |
+Integer + |
+Memory consumed by a function. +Unit: MB. +The value can be 128, 256, 512, 768, 1024, 1280, 1536, 1792, 2048, 2560, 3072, 3584 or 4096. +The value ranges from 128 to 4096. + |
+
gpu_memory + |
+Integer + |
+GPU memory. This parameter is available only for functions created with a custom runtime or image. +Unit: MB. +Options: 1024, 2048, 3072, 4096, 5120, 6144, 7168, 8192, 9216, 10,240, 11,264, 12,288, 13,312, 14,336, 15,360, and 16,384. +Range: 1024 to 16,384. + |
+
cpu + |
+Integer + |
+CPU resources of a function. Unit: millicore (1 core = 1000 millicores). The value of this field is proportional to that of MemorySize. By default, 100 CPU millicores are required for 128 MB memory. + |
+
code_type + |
+String + |
+Function code type. Options: inline: inline code zip: ZIP file obs: function code stored in an OBS bucket jar: JAR file, mainly for Java functions Custom-Image-Swr: The function code comes from the SWR custom image. +Enumeration values: +
|
+
code_url + |
+String + |
+If CodeType is set to obs, enter the OBS URL of the function code package. If CodeType is not set to obs, leave this parameter blank. + |
+
code_filename + |
+String + |
+Name of a function file. This parameter is mandatory only when CodeType is set to jar or zip. + |
+
code_size + |
+Long + |
+Code size in bytes. + |
+
user_data + |
+String + |
+Name/Value information defined for the function. +These are parameters used in a function. +For example, if a function needs to access a host, define Host={host_ip}. You can define a maximum of 20 such parameters, and their total length cannot exceed 4 KB. + |
+
encrypted_user_data + |
+String + |
+User-defined name/value to be encrypted. + |
+
digest + |
+String + |
+SHA512 hash value of function code, which is used to determine whether the function has changed. + |
+
version + |
+String + |
+Function version, which is automatically generated by the system. The version name is in the format of "vYYYYMMDD-HHMMSS" (v+year/month/day-hour/minute/second). + |
+
image_name + |
+String + |
+Internal identifier of a function version. + |
+
xrole + |
+String + |
+Agency used by the function. You need to create an agency on the IAM console. This field is mandatory when a function needs to access other services. After specifying a function execution agency, you can use the context method in the function handler to obtain a token, an AK, and an SK for accessing other cloud services. No agency is required if FunctionGraph does not access any cloud services. + |
+
app_xrole + |
+String + |
+Execution agency. You can optimize performance by configuring a separate agency for function execution, otherwise, the same agency is used for both execution and configuration. + |
+
description + |
+String + |
+Function description. + |
+
last_modified + |
+String + |
+Time when the function was last updated. + |
+
ephemeral_storage + |
+Integer + |
+Ephemeral storage. By default, the /tmp directory of each function is 512 MB. You can increase the size to 10,240 MB (10 GB) if necessary. +Enumeration values: +
|
+
func_vpc + |
+FuncVpc object + |
+VPC configuration. An agency with VPC permissions must be configured for the function. + |
+
mount_config + |
+MountConfig object + |
+Mounting configuration. + |
+
strategy_config + |
+StrategyConfig object + |
+Function policy configuration. + |
+
dependencies + |
+Array of Dependency objects + |
+Dependency packages. + |
+
initializer_handler + |
+String + |
+Initializer of the function in the format of "xx.xx". It must contain a period (.). This parameter is mandatory when the initialization function is configured. For example, for Node.js function myfunction.initializer, the file name is myfunction.js, and the initialization function is initializer. + |
+
initializer_timeout + |
+Integer + |
+Maximum duration the function can be initialized. Value range: 1s–300s. This parameter is mandatory when the initialization function is configured. + |
+
pre_stop_handler + |
+String + |
+The pre-stop handler of a function. The value must contain a period (.) in the format of xx.xx. For example, for Node.js function myfunction.pre_stop_handler, the file name is myfunction.js, and the initialization function is pre_stop_handler. + |
+
pre_stop_timeout + |
+Integer + |
+Maximum duration the function can be initialized. Value range: 1s–90s. + |
+
enterprise_project_id + |
+String + |
+Enterprise project ID. This parameter is mandatory if you create a function as an enterprise user. + |
+
long_time + |
+Boolean + |
+Whether to allow a long timeout. + |
+
log_group_id + |
+String + |
+Log group ID. + |
+
log_stream_id + |
+String + |
+Log stream ID. + |
+
type + |
+String + |
+v2 indicates an official version, and v1 indicates a deprecated version. +Enumeration values: +
|
+
enable_cloud_debug + |
+String + |
+Whether to enable cloud debugging to adapt to the CloudDebug scenario. (discarded) + |
+
enable_dynamic_memory + |
+Boolean + |
+Whether to enable dynamic memory allocation. + |
+
enable_auth_in_header + |
+Boolean + |
+Whether to add authentication information to request header for custom image-based functions. + |
+
is_stateful_function + |
+Boolean + |
+Whether stateful functions are supported. This parameter is supported in FunctionGraph v2. + |
+
domain_names + |
+String + |
+Private domain name configured for resolution. + |
+
custom_image + |
+CustomImage object + |
+Container image. + |
+
is_return_stream + |
+Boolean + |
+Whether to return stream data. (discarded) + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
domain_id + |
+String + |
+Domain name ID. + |
+
namespace + |
+String + |
+Project ID. + |
+
vpc_name + |
+String + |
+VPC name. + |
+
vpc_id + |
+String + |
+VPC ID. + |
+
subnet_name + |
+String + |
+Subnet name. + |
+
subnet_id + |
+String + |
+Subnet ID. + |
+
cidr + |
+String + |
+Subnet mask. + |
+
gateway + |
+String + |
+Gateway. + |
+
security_groups + |
+Array of strings + |
+Security group. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
mount_user + |
+MountUser object + |
+User information. + |
+
func_mounts + |
+Array of FuncMount objects + |
+Mounted resources. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
user_id + |
+String + |
+User ID, a non-0 integer from –1 to 65534. + |
+
user_group_id + |
+String + |
+User group ID, a non-0 integer from –1 to 65534. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
mount_type + |
+String + |
+Mount type. The value can be sfs, sfsTurbo, or ecs. This parameter is mandatory when func_mounts is not empty. + |
+
mount_resource + |
+String + |
+ID of the mounted resource (cloud service ID). This parameter is mandatory when func_mounts is not empty. + |
+
mount_share_path + |
+String + |
+Remote mount path. For example, 192.168.0.12:/data. This parameter is mandatory if mount_type is set to ecs. + |
+
local_mount_path + |
+String + |
+Function access path. This parameter is mandatory when func_mounts is not empty. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
concurrency + |
+Integer + |
+Maximum number of instances for a single function. For v1, the value can be 0 or –1; for v2, it ranges from –1 to 1000. +
|
+
concurrent_num + |
+Integer + |
+Number of concurrent requests per instance. This parameter is supported only by v2. The value ranges from 1 to 1,000. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
id + |
+String + |
+Dependency version ID. + |
+
owner + |
+String + |
+Domain ID of the dependency owner. + |
+
link + |
+String + |
+URL of the dependency on OBS. + |
+
runtime + |
+String + |
+Environment for executing a function. Options: Python2.7 Python 3.6 Python 3.9 Go 1.8 Go 1.x Java 8 Java 11 Node.js 6.10 Node.js 8.10 Node.js 10.16 Node.js 12.13 Node.js 14.18 C# (.NET Core 2.0) C# (.NET Core 2.1) C# (.NET Core 3.1) Custom PHP 7.3 HTTP Custom image-based functions +Enumeration values: +
|
+
etag + |
+String + |
+MD5 value of a dependency. + |
+
size + |
+Long + |
+Dependency size. + |
+
name + |
+String + |
+Dependence name. + |
+
description + |
+String + |
+Dependency description. + |
+
file_name + |
+String + |
+File name of a dependency package (ZIP). + |
+
version + |
+Long + |
+Dependency version ID. + |
+
dep_id + |
+String + |
+Dependency ID. + |
+
last_modified + |
+String + |
+Time when the function was last updated. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
enabled + |
+Boolean + |
+Whether to enable this feature. + |
+
image + |
+String + |
+Image address. + |
+
command + |
+String + |
+Command for starting a container image. + |
+
args + |
+String + |
+Command line parameter for starting a container image. + |
+
working_dir + |
+String + |
+Working directory of an image container. + |
+
uid + |
+String + |
+User ID of an image container. + |
+
gid + |
+String + |
+User group ID of an image container. + |
+
Status code: 400
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 401
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 403
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 404
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 500
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
PUT https://{Endpoint}/v2/{project_id}/fgs/functions/{function_urn}/config + +{ + "func_name" : "fgsTest", + "handler" : "index.handler", + "memory_size" : 768, + "user_data" : "{\"host\":\"192.168.0.1\"}", + "runtime" : "Node.js6.10", + "mount_config" : { + "mount_user" : { + "user_id" : -1, + "user_group_id" : -1 + }, + "func_mounts" : [ { + "mount_resource" : "268xxx-d3xx-4cxx-98xx-d1dbxxx", + "local_mount_path" : "/mnt", + "mount_type" : "sfsTurbo" + } ] + }, + "timeout" : 40 +}+
PUT https://{Endpoint}/v2/{project_id}/fgs/functions/{function_urn}/config + +{ + "func_name" : "test_GPU", + "handler" : "bootstrap", + "memory_size" : 4096, + "runtime" : "Custom", + "timeout" : 40, + "gpu_memory" : 1024 +}+
Status code: 200
+OK
+{ + "func_id" : "0d075978-5a54-4ee1-8e24-ff5bd070xxxx", + "resource_id" : "0d075978-5a54-4ee1-8e24-ff5bd070xxxx:test", + "func_urn" : "urn:fss:xxxxxxxx:7aad83af3e8d42e99ac194e8419e2c9b:function:default:test", + "func_name" : "test", + "domain_id" : "14ee2e3501124efcbca7998baa24xxxx", + "namespace" : "46b6f338fc3445b8846c71dfb1fbxxxx", + "project_name" : "xxxxxx", + "package" : "default", + "runtime" : "Node.js6.10", + "timeout" : 3, + "handler" : "fssExampleCsharp2.1::fssExampleCsharp21.Program::MyFunc", + "memory_size" : 128, + "cpu" : 300, + "code_type" : "inline", + "code_filename" : "index.js", + "code_size" : 272, + "user_data" : "{\"host\":\"192.168.0.1\"}", + "mount_config" : { + "mount_user" : { + "user_id" : -1, + "user_group_id" : -1 + }, + "func_mounts" : [ { + "mount_resource" : "268xxx-d3xx-4cxx-98xx-d1dbxxx", + "local_mount_path" : "/mnt", + "mount_type" : "sfsTurbo" + } ] + }, + "digest" : "faa825575c45437cddd4e369bea69893bcbe195d478178462ad90984fe72993f3f59d15f41c5373f807f3e05fb9af322c55dabeb16565c386e402413458e6068", + "version" : "latest", + "ephemeral_storage" : 512, + "image_name" : "latest-191025153727@zehht", + "last_modified" : "2019-10-25 15:37:27", + "strategy_config" : { + "concurrency" : 0 + } +}+
Status Code + |
+Description + |
+
---|---|
200 + |
+OK + |
+
400 + |
+Bad request. + |
+
401 + |
+Unauthorized. + |
+
403 + |
+Forbidden. + |
+
404 + |
+Not found. + |
+
500 + |
+Internal server error. + |
+
See Error Codes.
+This API is used to query the asynchronous invocation requests of a function.
+GET /v2/{project_id}/fgs/functions/{function_urn}/async-invocations
+ +Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. For details, see Obtaining a Project ID. + |
+
function_urn + |
+Yes + |
+String + |
+Function URN. For details, see the function model description. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
request_id + |
+No + |
+String + |
+ID of the asynchronous invocation request to be queried. If this parameter is not specified, all asynchronous invocation requests are queried by default. +Minimum: 0 +Maximum: 64 + |
+
marker + |
+No + |
+String + |
+Start position of the current query. The default value is 0. +Default: 0 +Minimum: 0 +Maximum: 64 + |
+
limit + |
+No + |
+String + |
+Maximum number of data records returned in a request. Max.: 500. Default: 100. +Default: 100 +Minimum: 0 +Maximum: 64 + |
+
status + |
+No + |
+String + |
+Asynchronous invocation status to be queried. Five statuses are supported. If this parameter is not specified, the invocation records of all statuses are queried. +
Minimum: 0 +Maximum: 64 + |
+
query_begin_time + |
+No + |
+String + |
+Start time of the query. The format is "YYYY-MM-DD'T'HH:mm:ss" (UTC time). If this parameter is not specified, the time starts from the last hour by default. + |
+
query_end_time + |
+No + |
+String + |
+End time of the query. The format is "YYYY-MM-DD'T'HH:mm:ss" (UTC time). If this parameter is not specified, the end time is the current time by default. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
X-Auth-Token + |
+Yes + |
+String + |
+User token. +It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. + |
+
Content-Type + |
+Yes + |
+String + |
+Message body type (format). + |
+
Status code: 200
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
invocations + |
+Array of ListFunctionAsyncInvocationsResult objects + |
+Asynchronous invocation records. + |
+
count + |
+Integer + |
+Total number of queried data records. + |
+
next_marker + |
+Integer + |
+Start position for querying records on the next page. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
request_id + |
+String + |
+Asynchronous invocation request ID. + |
+
status + |
+String + |
+Asynchronous invocation status. Options: +
Enumeration values: +
|
+
error_message + |
+String + |
+Asynchronous invocation error information. If the execution is successful, no value is returned. + |
+
error_code + |
+Integer + |
+Asynchronous invocation error code. If the execution is successful, 0 is returned. + |
+
start_time + |
+String + |
+Start time of the asynchronous invocation. The format is "YYYY-MM-DD'T'HH:mm:ss" (UTC time). + |
+
end_time + |
+String + |
+End time of the asynchronous invocation. The format is "YYYY-MM-DD'T'HH:mm:ss" (UTC time). + |
+
Status code: 403
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 404
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 500
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Query asynchronous invocation requests of a function.
+GET /v2/{project_id}/fgs/functions/{function_urn}/async-invocations+
Status code: 200
+OK
+{ + "invocations" : [ { + "request_id" : "403fcbd6-ec41-401f-9fa7-386f3d3d****", + "status" : "SUCCESS", + "error_message" : "", + "start_time" : "2019-10-25T15:37:27", + "end_time" : "2019-10-25T15:37:27", + "error_code" : 0 + } ] +}+
Status code: 403
+FORBIDDEN
+{ + "error_code" : "FSS.0403", + "error_msg" : "invalid token" +}+
Status code: 404
+Not Found
+{ + "error_code" : "FSS.0404", + "error_msg" : "can not find function" +}+
Status code: 500
+Internal error.
+{ + "error_code" : "FSS.0500", + "error_msg" : "xxx" +}+
Status Code + |
+Description + |
+
---|---|
200 + |
+OK + |
+
403 + |
+FORBIDDEN + |
+
404 + |
+Not Found + |
+
500 + |
+Internal error. + |
+
See Error Codes.
+This API is used to enable log reporting to LTS.
+POST /v2/{project_id}/fgs/functions/enable-lts-logs
+ +Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. For details, see Obtaining a Project ID. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
X-Auth-Token + |
+Yes + |
+String + |
+User token. +It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. + |
+
Content-Type + |
+Yes + |
+String + |
+Message body type (format). + |
+
Status code: 429
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Enable log reporting to LTS.
+POST /v2/{project_id}/fgs/functions/enable-lts-logs+
Status code: 429
+Too many requests.
+{ + "error_code" : "FSS.0429", + "error_msg" : "api is busy now" +}+
Status Code + |
+Description + |
+
---|---|
200 + |
+ok + |
+
429 + |
+Too many requests. + |
+
See Error Codes.
+This API is used to change the number of reserved instances.
+PUT /v2/{project_id}/fgs/functions/{function_urn}/reservedinstances
+ +Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. For details, see Obtaining a Project ID. + |
+
function_urn + |
+Yes + |
+String + |
+Function URN. For details, see the function model description. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
X-Auth-Token + |
+Yes + |
+String + |
+User token. +It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. + |
+
Content-Type + |
+Yes + |
+String + |
+Message body type (format). + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
count + |
+Yes + |
+Integer + |
+Number of reserved instances. + |
+
idle_mode + |
+No + |
+Boolean + |
+Whether to enable the idle mode. + |
+
tactics_config + |
+No + |
+TacticsConfig object + |
++ |
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
cron_configs + |
+No + |
+Array of CronConfig objects + |
+Scheduled configuration list. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
name + |
+No + |
+String + |
+Scheduled configuration name. + |
+
cron + |
+No + |
+String + |
+Cron expression. + |
+
count + |
+No + |
+Integer + |
+Number of started reserved instances. + |
+
start_time + |
+No + |
+Long + |
+Start time (epoch format). + |
+
expired_time + |
+No + |
+Long + |
+Expiry time (epoch format). + |
+
Status code: 200
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
count + |
+Integer + |
+Number of reserved instances. + |
+
idle_mode + |
+Boolean + |
+Whether to enable idle mode. + |
+
tactics_config + |
+TacticsConfig object + |
++ |
Parameter + |
+Type + |
+Description + |
+
---|---|---|
cron_configs + |
+Array of CronConfig objects + |
+Scheduled configuration list. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
name + |
+String + |
+Scheduled configuration name. + |
+
cron + |
+String + |
+Cron expression. + |
+
count + |
+Integer + |
+Number of started reserved instances. + |
+
start_time + |
+Long + |
+Start time (epoch format). + |
+
expired_time + |
+Long + |
+Expiry time (epoch format). + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
name + |
+String + |
+Flow control configuration name. + |
+
type + |
+String + |
+Flow control type. Currently, only reserved instance utilization is supported. +Enumeration values: +
|
+
threshold + |
+Integer + |
+Flow control threshold. + |
+
min + |
+Integer + |
+Minimum value. + |
+
Status code: 400
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 401
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 403
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 404
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 500
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Update the number of a function's reserved instances to 3.
+PUT https://{Endpoint}/v2/{project_id}/fgs/functions/{function_urn}/reservedinstances + +{ + "count" : 3 +}+
Status code: 200
+OK
+{ + "count" : 2 +}+
Status Code + |
+Description + |
+
---|---|
200 + |
+OK + |
+
400 + |
+Bad request. + |
+
401 + |
+Unauthorized. + |
+
403 + |
+Forbidden. + |
+
404 + |
+Not found. + |
+
500 + |
+Internal server error. + |
+
See Error Codes.
+This API is used to query reserved instances of a function.
+GET /v2/{project_id}/fgs/functions/reservedinstanceconfigs
+ +Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. For details, see Obtaining a Project ID. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
function_urn + |
+No + |
+String + |
+Function URN. For details, see the function model descriptions. + |
+
marker + |
+No + |
+String + |
+Start position of the current query. The default value is 0. +Default: 0 +Minimum: 1 +Maximum: 64 + |
+
limit + |
+No + |
+String + |
+Maximum number of data records returned in a request. Max.: 500. Default: 100. +Default: 100 +Minimum: 1 +Maximum: 64 + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
X-Auth-Token + |
+Yes + |
+String + |
+User token. +It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. + |
+
Content-Type + |
+Yes + |
+String + |
+Message body type (format). + |
+
Status code: 200
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
reserved_instances + |
+Array of ReservedInstanceConfigs objects + |
+Reserved instances. + |
+
page_info + |
+PageInfo object + |
++ |
count + |
+Long + |
+Number of functions. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
function_urn + |
+String + |
+Function URN. + |
+
qualifier_type + |
+String + |
+Limiting type. Options: version and alias. + |
+
qualifier_name + |
+String + |
+Limit value. + |
+
min_count + |
+Integer + |
+Number of reserved instances. + |
+
idle_mode + |
+Boolean + |
+Whether to enable the idle mode. + |
+
tactics_config + |
+TacticsConfig object + |
++ |
Parameter + |
+Type + |
+Description + |
+
---|---|---|
cron_configs + |
+Array of CronConfig objects + |
+Scheduled configuration list. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
name + |
+String + |
+Scheduled configuration name. + |
+
cron + |
+String + |
+Cron expression. + |
+
count + |
+Integer + |
+Number of started reserved instances. + |
+
start_time + |
+Long + |
+Start time (epoch format). + |
+
expired_time + |
+Long + |
+Expiry time (epoch format). + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
name + |
+String + |
+Flow control configuration name. + |
+
type + |
+String + |
+Flow control type. Currently, only reserved instance utilization is supported. +Enumeration values: +
|
+
threshold + |
+Integer + |
+Flow control threshold. + |
+
min + |
+Integer + |
+Minimum value. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
next_marker + |
+Long + |
+Next read location. + |
+
previous_marker + |
+Long + |
+Previous read location. + |
+
current_count + |
+Long + |
+Number of items on the current page. + |
+
Status code: 400
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 401
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 403
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 404
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 500
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Query reserved instances of a function.
+GET https://{Endpoint}/v2/{project_id}/fgs/functions/reservedinstanceconfigs+
Status code: 200
+OK
+{ + "reserved_instances": [ + { + "function_urn": "urn:fss:{region}:46b6f338fc3445b8846c71dfb1fbxxxx:function:default:xxxxx:latest", + "qualifier_type": "version", + "qualifier_name": "latest", + "min_count": 10, + "idle_mode": false, + "tactics_config": { + "cron_configs": [ + { + "name": "cronConfig", + "cron": "0 1 * * * *", + "count": 15, + "start_time": 1658073600, + "expired_time": 1658160000 + } + ] + } + } + ], + "page_info": { + "next_marker": 1, + "previous_marker": 0, + "current_count": 1 + }, + "count": 1 +}+
Status Code + |
+Description + |
+
---|---|
200 + |
+OK + |
+
400 + |
+Bad request. + |
+
401 + |
+Unauthorized. + |
+
403 + |
+Forbidden. + |
+
404 + |
+Not found. + |
+
500 + |
+Internal server error. + |
+
See Error Codes.
+This API is used to query the number of instances reserved for a function.
+GET /v2/{project_id}/fgs/functions/reservedinstances
+ +Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. For details, see Obtaining a Project ID. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
marker + |
+No + |
+String + |
+Final record queried last time. +Default: 0 + |
+
limit + |
+No + |
+String + |
+Maximum number of functions to obtain in a request. +Maximum value: 400 +The default value is 400, which is used when this parameter is not specified or is 0 or greater than 400. +If it is less than 0, an error is reported. +Default: 400 + |
+
urn + |
+No + |
+String + |
+URN of a function whose number of reserved instances is to be queried. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
X-Auth-Token + |
+Yes + |
+String + |
+User token. +It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. + |
+
Content-Type + |
+Yes + |
+String + |
+Message body type (format). + |
+
Status code: 200
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
reservedinstances + |
+Array of FuncReservedInstance objects + |
+Reserved instances. + |
+
page_info + |
+PageInfo object + |
++ |
count + |
+Long + |
+Number of functions. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
func_urn + |
+String + |
+Function URN. + |
+
count + |
+Long + |
+Number of reserved instances. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
next_marker + |
+Long + |
+Next read location. + |
+
previous_marker + |
+Long + |
+Previous read location. + |
+
current_count + |
+Long + |
+Number of items on the current page. + |
+
Status code: 400
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 401
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 403
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 404
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 500
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Query reserved instances.
+GET https://{Endpoint}/v2/{project_id}/fgs/functions/reservedinstances+
Status code: 200
+OK
+{ + "reservedinstances" : [ { + "func_urn" : "urn:fss:xxxxx:46b6f338fc3445b8846c71dfb1fbxxxx:function:csharp:test2-0:latest", + "count" : 2 + } ], + "page_info" : { + "next_marker" : 2, + "previous_marker" : 0, + "current_count" : 2 + } +}+
Status Code + |
+Description + |
+
---|---|
200 + |
+OK + |
+
400 + |
+Bad request. + |
+
401 + |
+Unauthorized. + |
+
403 + |
+Forbidden. + |
+
404 + |
+Not found. + |
+
500 + |
+Internal server error. + |
+
See Error Codes.
+This API is used to query the versions of a function.
+GET /v2/{project_id}/fgs/functions/{function_urn}/versions
+ +Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. For details, see Obtaining a Project ID. + |
+
function_urn + |
+Yes + |
+String + |
+Function URN. For details, see the function model description. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
marker + |
+No + |
+String + |
+Final record queried last time. + |
+
maxitems + |
+No + |
+String + |
+Maximum number of functions to obtain in a request. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
X-Auth-Token + |
+Yes + |
+String + |
+User token. +It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. + |
+
Content-Type + |
+Yes + |
+String + |
+Message body type (format). + |
+
Status code: 200
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
versions + |
+Array of ListFunctionVersionResult objects + |
+Version list. + |
+
next_marker + |
+Long + |
+Next record location. + |
+
count + |
+Long + |
+Total number of versions. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
func_urn + |
+String + |
+Function URN. + |
+
func_name + |
+String + |
+Function name. + |
+
domain_id + |
+String + |
+Domain ID. + |
+
namespace + |
+String + |
+Project ID. + |
+
project_name + |
+String + |
+Project name. + |
+
package + |
+String + |
+Group to which the function belongs. This field is defined to group functions. + |
+
runtime + |
+String + |
+Environment for executing a function. Options: Python2.7 Python 3.6 Python 3.9 Go 1.8 Go 1.x Java 8 Java 11 Node.js 6.10 Node.js 8.10 Node.js 10.16 Node.js 12.13 Node.js 14.18 C# (.NET Core 2.0) C# (.NET Core 2.1) C# (.NET Core 3.1) Custom PHP 7.3 HTTP Custom image-based functions +Enumeration values: +
|
+
timeout + |
+Integer + |
+Maximum duration the function can be executed. Value range: 3s–259,200s. + |
+
handler + |
+String + |
+Handler of a function in the format of "xx.xx". It must contain a period (.). +For example, for Node.js function myfunction.handler, the file name is myfunction.js, and the handler function is handler. + |
+
memory_size + |
+Integer + |
+Memory consumed by a function. +Unit: MB. +The value can be 128, 256, 512, 768, 1024, 1280, 1536, 1792, 2048, 2560, 3072, 3584 or 4096. +The value ranges from 128 to 4096. + |
+
cpu + |
+Integer + |
+CPU resources of a function. Unit: millicore (1 core = 1000 millicores). The value of this field is proportional to that of MemorySize. By default, 100 CPU millicores are required for 128 MB memory. + |
+
code_type + |
+String + |
+Function code type. Options: inline: inline code zip: ZIP file obs: function code stored in an OBS bucket jar: JAR file, mainly for Java functions Custom-Image-Swr: The function code comes from the SWR custom image. +Enumeration values: +
|
+
code_url + |
+String + |
+If CodeType is set to obs, enter the OBS URL of the function code package. If CodeType is not set to obs, leave this parameter blank. + |
+
code_filename + |
+String + |
+Name of a function file. This parameter is mandatory only when CodeType is set to jar or zip. + |
+
code_size + |
+Long + |
+Code size in bytes. + |
+
user_data + |
+String + |
+Name/Value information defined for the function. These are parameters used in the function. For example, if a function needs to access a host, define Host={host_ip}. You can define a maximum of 20 such parameters, and their total length cannot exceed 4 KB. + |
+
encrypted_user_data + |
+String + |
+User-defined name/value to be encrypted. + |
+
digest + |
+String + |
+SHA512 hash value of function code, which is used to determine whether the function has changed. + |
+
version + |
+String + |
+Function version, which is automatically generated by the system. The version name is in the format of "vYYYYMMDD-HHMMSS" (v+year/month/day-hour/minute/second). + |
+
image_name + |
+String + |
+Internal identifier of a function version. + |
+
xrole + |
+String + |
+Agency used by the function. You need to create an agency on the IAM console. This field is mandatory when a function needs to access other services. After specifying a function execution agency, you can use the context method in the function handler to obtain a token, an AK, and an SK for accessing other cloud services. No agency is required if FunctionGraph does not access any cloud services. + |
+
app_xrole + |
+String + |
+Execution agency. You can optimize performance by configuring a separate agency for function execution, otherwise, the same agency is used for both execution and configuration. + |
+
last_modified + |
+String + |
+Time when the function was last updated. + |
+
func_vpc_id + |
+String + |
+VPC ID. + |
+
concurrency + |
+Integer + |
+0: A function is disabled. -1: A function is enabled. + |
+
concurrent_num + |
+Integer + |
+Number of concurrent instances. + |
+
strategy_config + |
+StrategyConfig object + |
+Function policy configuration. + |
+
initializer_handler + |
+String + |
+Initializer of the function in the format of "xx.xx". It must contain a period (.). This parameter is mandatory when the initialization function is configured. For example, for Node.js function myfunction.initializer, the file name is myfunction.js, and the initialization function is initializer. + |
+
initializer_timeout + |
+Integer + |
+Maximum duration the function can be initialized. Value range: 1s–300s. This parameter is mandatory when the initialization function is configured. + |
+
pre_stop_handler + |
+String + |
+The pre-stop handler of a function. The value must contain a period (.) in the format of xx.xx. For example, for Node.js function myfunction.pre_stop_handler, the file name is myfunction.js, and the initialization function is pre_stop_handler. + |
+
pre_stop_timeout + |
+Integer + |
+Maximum duration the function can be initialized. Value range: 1s–90s. + |
+
long_time + |
+Boolean + |
+Whether long-term running is supported. + |
+
function_async_config + |
+FunctionAsyncConfig object + |
+Return struct of the asynchronous execution notification settings. + |
+
type + |
+String + |
+Function version. + |
+
enable_dynamic_memory + |
+Boolean + |
+Whether to enable dynamic memory allocation. + |
+
enterprise_project_id + |
+String + |
+Enterprise project ID. This parameter is mandatory if you create a function as an enterprise user. + |
+
is_stateful_function + |
+Boolean + |
+Whether stateful functions are supported. This parameter is supported in FunctionGraph v2. + |
+
enable_auth_in_header + |
+Boolean + |
+Whether to allow authentication information in the request header. + |
+
custom_image + |
+CustomImage object + |
+Container image. + |
+
reserved_instance_idle_mode + |
+Boolean + |
+Whether to enable idle mode for reserved instances. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
concurrency + |
+Integer + |
+Maximum number of instances for a single function. For v1, the value can be 0 or –1; for v2, it ranges from –1 to 1000. +
|
+
concurrent_num + |
+Integer + |
+Number of concurrent requests per instance. This parameter is supported only by v2. The value ranges from 1 to 1,000. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
max_async_event_age_in_seconds + |
+Integer + |
+Maximum validity period of a message. Value range: 60–86,400. Unit: second. + |
+
max_async_retry_attempts + |
+Integer + |
+Maximum number of retry attempts to be made if asynchronous invocation fails. Default value: 3. Value range: 0–8. + |
+
destination_config + |
+FuncAsyncDestinationConfig object + |
+Asynchronous invocation target. + |
+
created_time + |
+String + |
+Time when asynchronous execution notification was configured. + |
+
last_modified + |
+String + |
+Time when the asynchronous execution notification settings were last modified. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
on_success + |
+FuncDestinationConfig object + |
+Target to be invoked when a function is successfully executed. + |
+
on_failure + |
+FuncDestinationConfig object + |
+Target to be invoked when a function fails to be executed due to a system error or an internal error. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
destination + |
+String + |
+Object type. +
Enumeration values: +
|
+
param + |
+String + |
+Parameters (in JSON format) corresponding to the target service. +
|
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
enabled + |
+Boolean + |
+Whether to enable this feature. + |
+
image + |
+String + |
+Image address. + |
+
command + |
+String + |
+Command for starting a container image. + |
+
args + |
+String + |
+Command line parameter for starting a container image. + |
+
working_dir + |
+String + |
+Working directory of an image container. + |
+
uid + |
+String + |
+User ID of an image container. + |
+
gid + |
+String + |
+User group ID of an image container. + |
+
Status code: 400
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 401
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 403
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 404
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 500
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Query functions.
+GET https://{Endpoint}/v2/{project_id}/fgs/functions/{function_urn}/versions+
Status code: 200
+OK
+{ + "versions" : [ { + "func_urn" : "urn:fss:xxxxxxxxxxx:7aad83af3e8d42e99ac194e8419e2c9b:function:default:test", + "func_name" : "test", + "domain_id" : "14ee2e3501124efcbca7998baa24xxxx", + "namespace" : "46b6f338fc3445b8846c71dfb1fbxxxx", + "project_name" : "xxxxx", + "package" : "default", + "runtime" : "Node.js6.10", + "timeout" : 3, + "handler" : "test.handler", + "memory_size" : 128, + "cpu" : 300, + "code_type" : "inline", + "code_filename" : "index.js", + "code_size" : 272, + "digest" : "faa825575c45437cddd4e369bea69893bcbe195d478178462ad90984fe72993f3f59d15f41c5373f807f3e05fb9af322c55dabeb16565c386e402413458e6068", + "version" : "latest", + "image_name" : "latest-191025153727@zehht", + "last_modified" : "2019-10-25 15:37:27", + "strategy_config" : { + "concurrency" : 0 + } + } ], + "next_marker" : 5 +}+
Status code: 404
+Not found.
+{ + "error_code" : "FSS.1051", + "error_msg" : "Not found the function" +}+
Status Code + |
+Description + |
+
---|---|
200 + |
+OK + |
+
400 + |
+Bad request. + |
+
401 + |
+Unauthorized. + |
+
403 + |
+Forbidden. + |
+
404 + |
+Not found. + |
+
500 + |
+Internal server error. + |
+
See Error Codes.
+This API is used to create an alias for a function version.
+POST /v2/{project_id}/fgs/functions/{function_urn}/aliases
+ +Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. For details, see Obtaining a Project ID. + |
+
function_urn + |
+Yes + |
+String + |
+Function URN. For details, see the function model description. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
X-Auth-Token + |
+Yes + |
+String + |
+User token. +It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. + |
+
Content-Type + |
+Yes + |
+String + |
+Message body type (format). + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
name + |
+Yes + |
+String + |
+Alias.Max. 64 of letters, digits, hyphens (-), and underscores (_). Start with a letter, and end with a letter or digit. +Minimum length: 1 character. +Maximum length: 64 characters. + |
+
version + |
+Yes + |
+String + |
+Version corresponding to the alias. + |
+
description + |
+No + |
+String + |
+Description of the alias. + |
+
additional_version_weights + |
+No + |
+Map<String,Integer> + |
+Traffic shifting by percentage. + |
+
additional_version_strategy + |
+No + |
+Map<String,VersionStrategy> + |
+Traffic shifting by rule. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
rules + |
+No + |
+Array of VersionStrategyRules objects + |
+Rules. + |
+
combine_type + |
+No + |
+String + |
+Rule aggregation mode. and: All rules are met. or: Any rule is met. +Enumeration values: +
|
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
rule_type + |
+No + |
+String + |
+Parameter type. +Enumeration values: +
|
+
param + |
+No + |
+String + |
+Rule parameter name, which can contain only letters, digits, underscores (_), and hyphens (-). + |
+
op + |
+No + |
+String + |
+Rule matching operator. Currently, only = and in are supported. +Enumeration values: +
|
+
value + |
+No + |
+String + |
+Rule value. If op is set to in, the value is a multi-value character string separated by commas (,). + |
+
Status code: 200
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
name + |
+String + |
+Alias to be queried. + |
+
version + |
+String + |
+Version corresponding to the alias. + |
+
description + |
+String + |
+Description of the alias. + |
+
last_modified + |
+String + |
+Time when the alias was last modified. + |
+
alias_urn + |
+String + |
+URN of the alias. + |
+
additional_version_weights + |
+Map<String,Integer> + |
+Traffic shifting by percentage. + |
+
additional_version_strategy + |
+Map<String,VersionStrategy> + |
+Traffic shifting by rule. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
rules + |
+Array of VersionStrategyRules objects + |
+Rules. + |
+
combine_type + |
+String + |
+Rule aggregation mode. and: All rules are met. or: Any rule is met. +Enumeration values: +
|
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
rule_type + |
+String + |
+Parameter type. +Enumeration values: +
|
+
param + |
+String + |
+Rule parameter name, which can contain only letters, digits, underscores (_), and hyphens (-). + |
+
op + |
+String + |
+Rule matching operator. Currently, only = and in are supported. +Enumeration values: +
|
+
value + |
+String + |
+Rule value. If op is set to in, the value is a multi-value character string separated by commas (,). + |
+
Status code: 400
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 401
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 403
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 404
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 500
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
POST https://{Endpoint}/v2/{project_id}/fgs/functions/{function_urn}/aliases + +{ + "name" : "a1", + "version" : "v1" +}+
POST https://{Endpoint}/v2/{project_id}/fgs/functions/{function_urn}/aliases + +{ + "name" : "a1", + "version" : "v1", + "additional_version_weights" : { + "v2" : 50 + } +}+
POST https://{Endpoint}/v2/{project_id}/fgs/functions/{function_urn}/aliases + +{ + "name" : "a1", + "version" : "v1", + "additional_version_strategy" : { + "v2" : { + "combine_type" : "and", + "rules" : [ { + "rule_type" : "Header", + "param" : "version", + "op" : "=", + "value" : "v1" + } ] + } + } +}+
Status code: 200
+ok
+{ + "name" : "a1", + "version" : "latest", + "description" : "", + "last_modified" : "2019-10-31 11:37:58", + "alias_urn" : "urn:fss:{region}:46b6f338fc3445b8846c71dfb1fbxxxx:function:default:xxxxx:!a1" +}+
Status code: 404
+Not found.
+{ + "error_code" : "FSS.1051", + "error_msg" : "Not found the function" +}+
Status Code + |
+Description + |
+
---|---|
200 + |
+ok + |
+
400 + |
+Bad request. + |
+
401 + |
+Unauthorized. + |
+
403 + |
+Forbidden. + |
+
404 + |
+Not found. + |
+
500 + |
+Internal server error. + |
+
See Error Codes.
+This API is used to modify the alias of a function version.
+PUT /v2/{project_id}/fgs/functions/{function_urn}/aliases/{alias_name}
+ +Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. For details, see Obtaining a Project ID. + |
+
function_urn + |
+Yes + |
+String + |
+Function URN. For details, see the function model description. + |
+
alias_name + |
+Yes + |
+String + |
+Alias to be modified. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
X-Auth-Token + |
+Yes + |
+String + |
+User token. +It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. + |
+
Content-Type + |
+Yes + |
+String + |
+Message body type (format). + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
version + |
+Yes + |
+String + |
+Version corresponding to the alias. + |
+
description + |
+No + |
+String + |
+Description of the alias. + |
+
additional_version_weights + |
+No + |
+Map<String,Integer> + |
+Dark launch information. + |
+
additional_version_strategy + |
+No + |
+Map<String,VersionStrategy> + |
+Traffic shifting by Rule. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
rules + |
+No + |
+Array of VersionStrategyRules objects + |
+Rules. + |
+
combine_type + |
+No + |
+String + |
+Rule aggregation mode. and: All rules are met. or: Any rule is met. +Enumeration values: +
|
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
rule_type + |
+No + |
+String + |
+Parameter type. +Enumeration values: +
|
+
param + |
+No + |
+String + |
+Rule parameter name, which can contain only letters, digits, underscores (_), and hyphens (-). + |
+
op + |
+No + |
+String + |
+Rule matching operator. Currently, only = and in are supported. +Enumeration values: +
|
+
value + |
+No + |
+String + |
+Rule value. If op is set to in, the value is a multi-value character string separated by commas (,). + |
+
Status code: 200
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
name + |
+String + |
+Alias to be queried. + |
+
version + |
+String + |
+Version corresponding to the alias. + |
+
description + |
+String + |
+Description of the alias. + |
+
last_modified + |
+String + |
+Time when the alias was last modified. + |
+
alias_urn + |
+String + |
+URN of the alias. + |
+
additional_version_weights + |
+Map<String,Integer> + |
+Dark launch information. + |
+
Status code: 400
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 401
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 403
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 404
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 500
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Update the function version of alias {alias_name} to latest, and configure v1 as the additional version with a traffic ratio of 9:1.
+PUT https://{Endpoint}/v2/{project_id}/fgs/functions/{function_urn}/aliases/{alias_name} + +{ + "version" : "latest", + "description" : "", + "additional_version_weights" : { + "v1" : 10 + } +}+
Update the function version of alias {alias_name} to v1, enable Traffic Shifting and set version v2 to shift traffic by Rule.
+PUT https://{Endpoint}/v2/{project_id}/fgs/functions/{function_urn}/aliases/{alias_name} + +{ + "version" : "v1", + "description" : "", + "additional_version_strategy" : { + "v2" : { + "combine_type" : "and", + "rules" : [ { + "rule_type" : "Header", + "param" : "version", + "op" : "=", + "value" : "v1" + } ] + } + } +}+
Status code: 200
+ok
+{ + "name" : "dev", + "version" : "latest", + "description" : "", + "last_modified" : "2019-10-31 11:37:58", + "alias_urn" : "urn:fss:xxxxxxxx: 7aad83af3e8d42e99ac194e8419e2c9b:function:default:test:!dev", + "additional_version_weights" : { + "v1" : 10 + } +}+
Status code: 404
+Not found.
+{ + "error_code" : "FSS.1051", + "error_msg" : "Not found the function" +}+
Status Code + |
+Description + |
+
---|---|
200 + |
+ok + |
+
400 + |
+Bad request. + |
+
401 + |
+Unauthorized. + |
+
403 + |
+Forbidden. + |
+
404 + |
+Not found. + |
+
500 + |
+Internal server error. + |
+
See Error Codes.
+This API is used to delete an alias of a function version.
+DELETE /v2/{project_id}/fgs/functions/{function_urn}/aliases/{alias_name}
+ +Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. For details, see Obtaining a Project ID. + |
+
function_urn + |
+Yes + |
+String + |
+Function URN. For details, see the function model description. + |
+
alias_name + |
+Yes + |
+String + |
+Alias to be deleted. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
X-Auth-Token + |
+Yes + |
+String + |
+User token. +It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. + |
+
Content-Type + |
+Yes + |
+String + |
+Message body type (format). + |
+
Status code: 401
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 403
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 404
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 500
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Delete the alias of a function version.
+DELETE https://{Endpoint}/v2/{project_id}/fgs/functions/{function_urn}/aliases/{alias_name}+
None
+Status Code + |
+Description + |
+
---|---|
204 + |
+No Content + |
+
401 + |
+Unauthorized. + |
+
403 + |
+Forbidden. + |
+
404 + |
+Not found. + |
+
500 + |
+Internal server error. + |
+
See Error Codes.
+This API is used to query the alias of a function version.
+GET /v2/{project_id}/fgs/functions/{function_urn}/aliases/{alias_name}
+ +Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. For details, see Obtaining a Project ID. + |
+
function_urn + |
+Yes + |
+String + |
+Function URN. For details, see the function model description. + |
+
alias_name + |
+Yes + |
+String + |
+Alias to be queried. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
X-Auth-Token + |
+Yes + |
+String + |
+User token. +It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. + |
+
Content-Type + |
+Yes + |
+String + |
+Message body type (format). + |
+
Status code: 200
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
name + |
+String + |
+Alias to be queried. + |
+
version + |
+String + |
+Version corresponding to the alias. + |
+
description + |
+String + |
+Description of the alias. + |
+
last_modified + |
+String + |
+Time when the alias was last modified. + |
+
alias_urn + |
+String + |
+URN of the alias. + |
+
additional_version_weights + |
+Map<String,Integer> + |
+Traffic shifting by percentage. + |
+
additional_version_strategy + |
+Map<String,VersionStrategy> + |
+Traffic shifting by rule. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
rules + |
+Array of VersionStrategyRules objects + |
+Rules. + |
+
combine_type + |
+String + |
+Rule aggregation mode. and: All rules are met. or: Any rule is met. +Enumeration values: +
|
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
rule_type + |
+String + |
+Parameter type. +Enumeration values: +
|
+
param + |
+String + |
+Rule parameter name, which can contain only letters, digits, underscores (_), and hyphens (-). + |
+
op + |
+String + |
+Rule matching operator. Currently, only = and in are supported. +Enumeration values: +
|
+
value + |
+String + |
+Rule value. If op is set to in, the value is a multi-value character string separated by commas (,). + |
+
Status code: 401
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 403
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 404
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 500
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Query the alias of a function version.
+GET https://{Endpoint}/v2/{project_id}/fgs/functions/{function_urn}/aliases/{alias_name}+
Status code: 200
+OK
+{ + "name" : "dev", + "version" : "latest", + "description" : "my dev version", + "last_modified" : "2019-10-31 11:37:58", + "alias_urn" : "urn:fss:xxxxxxxxxx: 7aad83af3e8d42e99ac194e8419e2c9b:function:default:test:!dev", + "additional_version_weights" : { + "v1" : 10 + } +}+
Status code: 401
+Unauthorized.
+{ + "error_code" : "FSS.1053", + "error_msg" : "Not found the function alias" +}+
Status Code + |
+Description + |
+
---|---|
200 + |
+OK + |
+
401 + |
+Unauthorized. + |
+
403 + |
+Forbidden. + |
+
404 + |
+Not found. + |
+
500 + |
+Internal server error. + |
+
See Error Codes.
+This API is used to query the versions and aliases of a function.
+GET /v2/{project_id}/fgs/functions/{function_urn}/aliases
+ +Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. For details, see Obtaining a Project ID. + |
+
function_urn + |
+Yes + |
+String + |
+Function URN. For details, see the function model description. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
X-Auth-Token + |
+Yes + |
+String + |
+User token. +It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. + |
+
Content-Type + |
+Yes + |
+String + |
+Message body type (format). + |
+
Status code: 200
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
[items] + |
+Array of ListVersionAliasResult objects + |
+Function versions and aliases. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
name + |
+String + |
+Alias to be queried. + |
+
version + |
+String + |
+Version corresponding to the alias. + |
+
description + |
+String + |
+Description of the alias. + |
+
last_modified + |
+String + |
+Time when the alias was last modified. + |
+
alias_urn + |
+String + |
+URN of the alias. + |
+
additional_version_weights + |
+Map<String,Integer> + |
+Dark launch information. + |
+
Status code: 401
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 403
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 404
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 500
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 503
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Query aliases of a function.
+GET https://{Endpoint}/v2/{project_id}/fgs/functions/{function_urn}/aliases+
Status code: 200
+OK
+[ { + "name" : "a1", + "version" : "latest", + "description" : "", + "last_modified" : "2019-10-31 11:37:58", + "alias_urn" : "urn:fss:{region}:46b6f338fc3445b8846c71dfb1fbxxxx:function:default:xxxxx:!a1", + "additional_version_weights" : { + "v1" : 10 + } +} ]+
Status Code + |
+Description + |
+
---|---|
200 + |
+OK + |
+
401 + |
+Unauthorized. + |
+
403 + |
+Forbidden. + |
+
404 + |
+Not found. + |
+
500 + |
+Internal server error. + |
+
503 + |
+Service unavailable. + |
+
See Error Codes.
+This API is used to query all triggers of a function.
+GET /v2/{project_id}/fgs/triggers/{function_urn}
+ +Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. For details, see Obtaining a Project ID. + |
+
function_urn + |
+Yes + |
+String + |
+Function URN. For details, see the function model description. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
X-Auth-Token + |
+Yes + |
+String + |
+User token. +It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. + |
+
Content-Type + |
+Yes + |
+String + |
+Message body type (format). +Default: application/json + |
+
Status code: 200
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
[items] + |
+Array of ListFunctionTriggerResult objects + |
++ |
Parameter + |
+Type + |
+Description + |
+
---|---|---|
trigger_id + |
+String + |
+Trigger ID. + |
+
trigger_type_code + |
+String + |
+Trigger type. +
Enumeration values: +
|
+
trigger_status + |
+String + |
+Trigger status. +
Enumeration values: +
|
+
event_data + |
+TriggerEventDataResponseBody object + |
+Trigger source event. + |
+
last_updated_time + |
+String + |
+Latest update time. + |
+
created_time + |
+String + |
+Time when the trigger was created. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
name + |
+String + |
+Trigger name. + |
+
schedule_type + |
+String + |
+Timer trigger type (timer trigger parameter). +
Enumeration values: +
|
+
schedule + |
+String + |
+Triggering rule. (timer trigger parameter). +
|
+
user_event + |
+String + |
+Additional information (timer trigger parameter). When the timer trigger triggers the function, the execution event (the event parameter of the function) is {"version": "v1.0", "time": "2018-06-01T08:30:00+08:00", "trigger_type": "TIMER", "trigger_name": "Timer_001", "user_event": "Additional information you entered"}. + |
+
triggerid + |
+String + |
+APIG trigger ID (APIG trigger parameter). + |
+
type + |
+Integer + |
+The API type (APIG trigger parameter). +
|
+
path + |
+String + |
+Path of the API (APIG trigger parameter). + |
+
protocol + |
+String + |
+Request protocol of the API (APIG trigger parameter). +Enumeration values: +
|
+
req_method + |
+String + |
+Request mode of the API (APIG trigger parameter). +Enumeration values: +
|
+
group_id + |
+String + |
+ID of the group to which the API belongs (APIG trigger parameter). + |
+
group_name + |
+String + |
+Name of the group to which the API belongs (APIG trigger parameter). + |
+
match_mode + |
+String + |
+Matching mode of the API (APIG trigger parameter). +
Enumeration values: +
|
+
env_name + |
+String + |
+Environment in which the API is published (APIG trigger parameter). + |
+
env_id + |
+String + |
+ID of the environment in which the API has been published (APIG trigger parameter). + |
+
api_id + |
+String + |
+API ID (APIG trigger parameter). + |
+
api_name + |
+String + |
+API name (APIG trigger parameter). + |
+
auth + |
+String + |
+Security authentication (APIG trigger parameter). +
Enumeration values: +
|
+
invoke_url + |
+String + |
+API calling address (APIG trigger parameter). + |
+
func_info + |
+ApigTriggerFuncInfo object + |
+FunctionGraph backend details (APIG trigger parameter). This parameter is mandatory for APIG triggers. + |
+
sl_domain + |
+String + |
+Subdomain name allocated by the APIG system by default (APIG trigger parameter). +Minimum: 1 +Maximum: 255 + |
+
backend_type + |
+String + |
+Backend type of the API (APIG trigger parameter). +Enumeration values: +
|
+
instance_id + |
+String + |
+Instance ID. This parameter is mandatory for DDS, Kafka, and RabbitMQ triggers. +
|
+
roma_app_id + |
+String + |
+ID of the integration application to which the API belongs (APIG trigger parameter). + |
+
operations + |
+Array of strings + |
+Custom operations (CTS trigger parameter). CTS collects operation records of subscribed cloud resources. If you create a function with a CTS trigger, collected operation records of specified cloud services will be passed as a parameter to invoke the function. + |
+
collection_name + |
+String + |
+Collection name (DDS trigger parameter). + |
+
db_name + |
+String + |
+Database name (DDS trigger parameter). + |
+
db_password + |
+String + |
+DDS database password (DDS trigger parameter). + |
+
db_user + |
+String + |
+DDS database username (DDS trigger parameter). + |
+
instance_addrs + |
+Array of strings + |
+DDS database instance address (DDS trigger parameter). + |
+
mode + |
+String + |
+DDS database instance type (DDS trigger parameter). +
|
+
batch_size + |
+Integer + |
+Batch size: Maximum number of data records that can be processed by the function at a time. This parameter is mandatory for DIS, DDS, Kafka, and RabbitMQ triggers. +
|
+
queue_id + |
+String + |
+Queue ID (DMS trigger parameter). + |
+
consumer_group_id + |
+String + |
+Consumer group ID (DMS trigger parameter). + |
+
polling_interval + |
+Integer + |
+Pull period. + |
+
stream_name + |
+String + |
+Stream name (DIS trigger parameter). + |
+
sharditerator_type + |
+String + |
+Start position (DIS trigger parameter). +
Enumeration values: +
|
+
polling_unit + |
+String + |
+Unit of the pull period (DIS trigger parameter). +
Enumeration values: +
|
+
max_fetch_bytes + |
+Integer + |
+Maximum number of bytes to be extracted (DIS trigger parameter). +Minimum: 0 +Maximum: 4194304 + |
+
is_serial + |
+String + |
+Serial Data Processing: If this option is selected, FunctionGraph pulls data from the stream only after previous data is processed. If this option is not selected, FunctionGraph pulls data from the stream as long as the pull period ends. +Enumeration values: +
|
+
log_group_id + |
+String + |
+Log group ID (LTS trigger parameter). + |
+
log_topic_id + |
+String + |
+Log stream ID (LTS trigger parameter). + |
+
bucket + |
+String + |
+Bucket name (OBS trigger parameter). The name of the OBS bucket used as the event source cannot be the same as that of an existing bucket of the current user or another user. After being created, the bucket name cannot be modified. +Minimum: 1 +Maximum: 64 + |
+
prefix + |
+String + |
+Prefix (OBS trigger parameter). Enter a prefix to limit notifications to objects whose names start with the matching characters. +Minimum: 0 +Maximum: 1024 + |
+
suffix + |
+String + |
+Suffix (OBS trigger parameter). Enter a suffix to limit notifications to objects whose names end with the matching characters. +Minimum: 0 +Maximum: 1024 + |
+
events + |
+Array of strings + |
+Trigger event (OBS trigger parameter). +
|
+
topic_urn + |
+String + |
+Topic URN (SMN trigger parameter) +Minimum: 1 +Maximum: 255 + |
+
topic_ids + |
+Array of strings + |
+The Kafka topic ID list (Kafka trigger parameter). + |
+
kafka_user + |
+String + |
+Kafka account name (Kafka trigger parameter). + |
+
kafka_password + |
+String + |
+Kafka password (Kafka trigger parameter). + |
+
kafka_connect_address + |
+String + |
+Kafka instance connection address (Kafka trigger parameter). + |
+
kafka_ssl_enable + |
+Boolean + |
+Whether to enable SASL authentication(Kafka trigger parameter). + |
+
access_password + |
+String + |
+RabbitMQ account password (RabbitMQ trigger parameter). + |
+
access_user + |
+String + |
+RabbitMQ username (RabbitMQ trigger parameter). + |
+
connect_address + |
+String + |
+Instance IP address (RabbitMQ trigger parameter). + |
+
exchange_name + |
+String + |
+Switch name (RabbitMQ trigger parameter). + |
+
vhost + |
+String + |
+Virtual host (RabbitMQ trigger parameter). + |
+
ssl_enable + |
+Boolean + |
+Whether to enable SSL (RabbitMQ trigger parameter). + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
function_urn + |
+String + |
+Function URN. For details, see the function model descriptions. + |
+
invocation_type + |
+String + |
+Execution mode of a function. +
Enumeration values: +
|
+
timeout + |
+Integer + |
+Timeout allowed for APIG to request the FunctionGraph service. The unit is in millisecond. This parameter is mandatory for APIG triggers. +Minimum: 1 +Maximum: 60000 + |
+
version + |
+String + |
+Function version information. + |
+
Status code: 400
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 401
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 403
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 404
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 500
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Query all triggers of a function.
+GET https://{Endpoint}/v2/{project_id}/fgs/triggers/{function_urn}+
Status code: 200
+OK
+[ { + "trigger_id" : "1b3b264db3b849118d007884b9bc8a60", + "trigger_type_code" : "APIG", + "trigger_status" : "ACTIVE", + "event_data" : { + "api_id" : "4a59f6a7263c4d1dab3f69c34f98d949", + "api_name" : "API_test_triggers", + "auth" : "IAM", + "env_id" : "DEFAULT_ENVIRONMENT_RELEASE_ID", + "env_name" : "RELEASE", + "func_info" : { + "function_urn" : "urn:fss:xxxxx:46b6f338fc3445b8846c71dfb1fbxxxx:function:default:test_triggers", + "invocation_type" : "sync", + "timeout" : 5000, + "version" : "latest" + }, + "group_id" : "9205f83fe721481eb490870d380cf31d", + "group_name" : "APIGroup_2mbe", + "invoke_url" : "https://ed94ae9494ba4f70ac24224747202140.{apig_endpoint}/test_triggers", + "match_mode" : "SWA", + "name" : "API_test_triggers", + "path" : "/test_triggers", + "protocol" : "HTTPS", + "req_method" : "ANY", + "triggerid" : "1b3b264db3b849118d007884b9bc8a60", + "type" : 1 + }, + "last_updated_time" : "2022-11-09 16:37:24", + "created_time" : "2022-11-09 16:37:24" +} ]+
Status Code + |
+Description + |
+
---|---|
200 + |
+OK + |
+
400 + |
+Bad request. + |
+
401 + |
+Unauthorized. + |
+
403 + |
+Forbidden. + |
+
404 + |
+Not found. + |
+
500 + |
+Internal server error. + |
+
See Error Codes.
+This API is used to query a specified trigger.
+GET /v2/{project_id}/fgs/triggers/{function_urn}/{trigger_type_code}/{trigger_id}
+ +Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. For details, see Obtaining a Project ID. + |
+
function_urn + |
+Yes + |
+String + |
+Function URN. For details, see the function model description. + |
+
trigger_type_code + |
+Yes + |
+String + |
+Trigger type code. +Enumeration values: +
|
+
trigger_id + |
+Yes + |
+String + |
+Trigger ID. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
X-Auth-Token + |
+Yes + |
+String + |
+User token. +It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. + |
+
Content-Type + |
+Yes + |
+String + |
+Message body type (format). +Default: application/json + |
+
Status code: 200
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
trigger_id + |
+String + |
+Trigger ID. + |
+
trigger_type_code + |
+String + |
+Trigger type. +
Enumeration values: +
|
+
trigger_status + |
+String + |
+Trigger status. +
Enumeration values: +
|
+
event_data + |
+TriggerEventDataResponseBody object + |
+Trigger source event. + |
+
last_updated_time + |
+String + |
+Latest update time. + |
+
created_time + |
+String + |
+Time when the trigger was created. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
name + |
+String + |
+Trigger name. + |
+
schedule_type + |
+String + |
+Timer trigger type (timer trigger parameter). +
Enumeration values: +
|
+
schedule + |
+String + |
+Triggering rule. (timer trigger parameter). +
|
+
user_event + |
+String + |
+Additional information (timer trigger parameter). When the timer trigger triggers the function, the execution event (the event parameter of the function) is {"version": "v1.0", "time": "2018-06-01T08:30:00+08:00", "trigger_type": "TIMER", "trigger_name": "Timer_001", "user_event": "Additional information you entered"}. + |
+
triggerid + |
+String + |
+APIG trigger ID (APIG trigger parameter). + |
+
type + |
+Integer + |
+The API type (APIG trigger parameter). +
|
+
path + |
+String + |
+Path of the API (APIG trigger parameter). + |
+
protocol + |
+String + |
+Request protocol of the API (APIG trigger parameter). +Enumeration values: +
|
+
req_method + |
+String + |
+Request mode of the API (APIG trigger parameter). +Enumeration values: +
|
+
group_id + |
+String + |
+ID of the group to which the API belongs (APIG trigger parameter). + |
+
group_name + |
+String + |
+Name of the group to which the API belongs (APIG trigger parameter). + |
+
match_mode + |
+String + |
+Matching mode of the API (APIG trigger parameter). +
Enumeration values: +
|
+
env_name + |
+String + |
+Environment in which the API is published (APIG trigger parameter). + |
+
env_id + |
+String + |
+ID of the environment in which the API has been published (APIG trigger parameter). + |
+
api_id + |
+String + |
+API ID (APIG trigger parameter). + |
+
api_name + |
+String + |
+API name (APIG trigger parameter). + |
+
auth + |
+String + |
+Security authentication (APIG trigger parameter). +
Enumeration values: +
|
+
invoke_url + |
+String + |
+API calling address (APIG trigger parameter). + |
+
func_info + |
+ApigTriggerFuncInfo object + |
+FunctionGraph backend details (APIG trigger parameter). This parameter is mandatory for APIG triggers. + |
+
sl_domain + |
+String + |
+Subdomain name allocated by the APIG system by default (APIG trigger parameter). +Minimum: 1 +Maximum: 255 + |
+
backend_type + |
+String + |
+Backend type of the API (APIG trigger parameter). +Enumeration values: +
|
+
instance_id + |
+String + |
+Instance ID. This parameter is mandatory for DDS, Kafka, and RabbitMQ triggers. +
|
+
roma_app_id + |
+String + |
+ID of the integration application to which the API belongs (APIG trigger parameter). + |
+
operations + |
+Array of strings + |
+Custom operations (CTS trigger parameter). CTS collects operation records of subscribed cloud resources. If you create a function with a CTS trigger, collected operation records of specified cloud services will be passed as a parameter to invoke the function. + |
+
collection_name + |
+String + |
+Collection name (DDS trigger parameter). + |
+
db_name + |
+String + |
+Database name (DDS trigger parameter). + |
+
db_password + |
+String + |
+DDS database password (DDS trigger parameter). + |
+
db_user + |
+String + |
+DDS database username (DDS trigger parameter). + |
+
instance_addrs + |
+Array of strings + |
+DDS database instance address (DDS trigger parameter). + |
+
mode + |
+String + |
+DDS database instance type (DDS trigger parameter). +
|
+
batch_size + |
+Integer + |
+Batch size: Maximum number of data records that can be processed by the function at a time. This parameter is mandatory for DIS, DDS, Kafka, and RabbitMQ triggers. +
|
+
queue_id + |
+String + |
+Queue ID (DMS trigger parameter). + |
+
consumer_group_id + |
+String + |
+Consumer group ID (DMS trigger parameter). + |
+
polling_interval + |
+Integer + |
+Pull period. + |
+
stream_name + |
+String + |
+Stream name (DIS trigger parameter). + |
+
sharditerator_type + |
+String + |
+Start position (DIS trigger parameter). +
Enumeration values: +
|
+
polling_unit + |
+String + |
+Unit of the pull period (DIS trigger parameter). +
Enumeration values: +
|
+
max_fetch_bytes + |
+Integer + |
+Maximum number of bytes to be extracted (DIS trigger parameter). +Minimum: 0 +Maximum: 4194304 + |
+
is_serial + |
+String + |
+Serial Data Processing: If this option is selected, FunctionGraph pulls data from the stream only after previous data is processed. If this option is not selected, FunctionGraph pulls data from the stream as long as the pull period ends. +Enumeration values: +
|
+
log_group_id + |
+String + |
+Log group ID (LTS trigger parameter). + |
+
log_topic_id + |
+String + |
+Log stream ID (LTS trigger parameter). + |
+
bucket + |
+String + |
+Bucket name (OBS trigger parameter). The name of the OBS bucket used as the event source cannot be the same as that of an existing bucket of the current user or another user. After being created, the bucket name cannot be modified. +Minimum: 1 +Maximum: 64 + |
+
prefix + |
+String + |
+Prefix (OBS trigger parameter). Enter a prefix to limit notifications to objects whose names start with the matching characters. +Minimum: 0 +Maximum: 1024 + |
+
suffix + |
+String + |
+Suffix (OBS trigger parameter). Enter a suffix to limit notifications to objects whose names end with the matching characters. +Minimum: 0 +Maximum: 1024 + |
+
events + |
+Array of strings + |
+Trigger event (OBS trigger parameter). +
|
+
topic_urn + |
+String + |
+Topic URN (SMN trigger parameter) +Minimum: 1 +Maximum: 255 + |
+
topic_ids + |
+Array of strings + |
+The Kafka topic ID list (Kafka trigger parameter). + |
+
kafka_user + |
+String + |
+Kafka account name (Kafka trigger parameter). + |
+
kafka_password + |
+String + |
+Kafka password (Kafka trigger parameter). + |
+
kafka_connect_address + |
+String + |
+Kafka instance connection address (Kafka trigger parameter). + |
+
kafka_ssl_enable + |
+Boolean + |
+Whether to enable SASL authentication(Kafka trigger parameter). + |
+
access_password + |
+String + |
+RabbitMQ account password (RabbitMQ trigger parameter). + |
+
access_user + |
+String + |
+RabbitMQ username (RabbitMQ trigger parameter). + |
+
connect_address + |
+String + |
+Instance IP address (RabbitMQ trigger parameter). + |
+
exchange_name + |
+String + |
+Switch name (RabbitMQ trigger parameter). + |
+
vhost + |
+String + |
+Virtual host (RabbitMQ trigger parameter). + |
+
ssl_enable + |
+Boolean + |
+Whether to enable SSL (RabbitMQ trigger parameter). + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
function_urn + |
+String + |
+Function URN. For details, see the function model descriptions. + |
+
invocation_type + |
+String + |
+Execution mode of a function. +
Enumeration values: +
|
+
timeout + |
+Integer + |
+Timeout allowed for APIG to request the FunctionGraph service. The unit is in millisecond. This parameter is mandatory for APIG triggers. +Minimum: 1 +Maximum: 60000 + |
+
version + |
+String + |
+Function version information. + |
+
Status code: 400
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 401
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 403
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 404
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 500
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Query a trigger.
+GET https://{Endpoint}/v2/{project_id}/fgs/triggers/{function_urn}/{trigger_type_code}/{trigger_id}+
Status code: 200
+OK
+{ + "trigger_id" : "9a14fae1-78cf-4185-ac7a-429eb6dc41fb", + "trigger_type_code" : "TIMER", + "trigger_status" : "ACTIVE", + "event_data" : { + "name" : "Timer-cpg3", + "schedule" : "3m", + "schedule_type" : "Rate" + }, + "last_updated_time" : "2022-11-09 16:37:24", + "created_time" : "2019-10-29171553" +}+
Status Code + |
+Description + |
+
---|---|
200 + |
+OK + |
+
400 + |
+Bad request. + |
+
401 + |
+Unauthorized. + |
+
403 + |
+Forbidden. + |
+
404 + |
+Not found. + |
+
500 + |
+Internal server error. + |
+
See Error Codes.
+This API is used to delete all triggers of a function.
+If a non-latest function version is specified, all triggers corresponding to the version will be deleted.
+If an alias is specified, all triggers corresponding to the alias will be deleted.
+If neither function versions nor aliases are specified or the latest version is specified, all triggers of the function (including all versions and aliases) will be deleted.
+DELETE /v2/{project_id}/fgs/triggers/{function_urn}
+ +Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. For details, see Obtaining a Project ID. + |
+
function_urn + |
+Yes + |
+String + |
+Function URN. For details, see the function model description. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
X-Auth-Token + |
+Yes + |
+String + |
+User token. +It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. + |
+
Content-Type + |
+Yes + |
+String + |
+Message body type (format). +Default: application/json + |
+
Status code: 400
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 401
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 403
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 404
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 500
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Delete all triggers of a function.
+DELETE https://{Endpoint}/v2/{project_id}/fgs/triggers/{function_urn}+
None
+Status Code + |
+Description + |
+
---|---|
204 + |
+No Content + |
+
400 + |
+Bad request. + |
+
401 + |
+Unauthorized. + |
+
403 + |
+Forbidden. + |
+
404 + |
+Not found. + |
+
500 + |
+Internal server error. + |
+
See Error Codes.
+This API is used to create a trigger.
+Trigger types include timer, APIG, CTS, DDS, DMS, DIS, LTS, OBS, SMN, and Kafka.
+By default, DDS and Kafka triggers are in the DISABLED state, and other triggers are in the ACTIVE state.
+Only timer, DDS, DMS, Kafka, and LTS triggers can be disabled.
+POST /v2/{project_id}/fgs/triggers/{function_urn}
+ +Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. For details, see Obtaining a Project ID. + |
+
function_urn + |
+Yes + |
+String + |
+Function URN. For details, see the function model description. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
X-Auth-Token + |
+Yes + |
+String + |
+User token. +It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. + |
+
Content-Type + |
+Yes + |
+String + |
+Message body type (format). +Default: application/json + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
trigger_type_code + |
+Yes + |
+String + |
+Trigger type. +
Enumeration values: +
|
+
trigger_status + |
+No + |
+String + |
+Trigger status. Options: ACTIVE and DISABLED. +Enumeration values: +
|
+
event_type_code + |
+No + |
+String + |
+Message code. + |
+
event_data + |
+Yes + |
+TriggerEventDataRequestBody object + |
+Trigger source event. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
name + |
+No + |
+String + |
+Timer trigger: trigger name +
|
+
schedule_type + |
+No + |
+String + |
+Timer trigger type (timer trigger parameter). This parameter is mandatory for timer triggers. +
Enumeration values: +
|
+
schedule + |
+No + |
+String + |
+Triggering rule. (timer trigger parameter). This parameter is mandatory for timer triggers. +
|
+
user_event + |
+No + |
+String + |
+Additional information (timer trigger parameter). When the timer trigger triggers the function, the execution event (the event parameter of the function) is {"version": "v1.0", "time": "2018-06-01T08:30:00+08:00", "trigger_type": "TIMER", "trigger_name": "Timer_001", "user_event": "Additional information you entered"}. + |
+
type + |
+No + |
+Integer + |
+API visibility(APIG trigger parameter). This parameter is mandatory for APIG triggers. +
|
+
path + |
+No + |
+String + |
+Path of the API (APIG trigger parameter). This parameter is mandatory for APIG triggers. + |
+
protocol + |
+No + |
+String + |
+Request protocol of the API (APIG trigger parameter). This parameter is mandatory for APIG triggers. +Enumeration values: +
|
+
req_method + |
+No + |
+String + |
+Request method of the API (APIG trigger parameter). This parameter is mandatory for APIG triggers. +Enumeration values: +
|
+
group_id + |
+No + |
+String + |
+ID of the group to which the API belongs (APIG trigger parameter). This parameter is mandatory for APIG triggers. + |
+
group_name + |
+No + |
+String + |
+Name of the API group to which the API belongs. + |
+
match_mode + |
+No + |
+String + |
+Matching mode of the API (APIG trigger parameter). This parameter is mandatory for APIG triggers. +
Enumeration values: +
|
+
env_name + |
+No + |
+String + |
+Environment in which the API is published (APIG trigger parameter). This parameter is mandatory for APIG triggers. + |
+
env_id + |
+No + |
+String + |
+ID of the environment in which the API has been published (APIG trigger parameter) This parameter is mandatory for APIG triggers. + |
+
auth + |
+No + |
+String + |
+Security authentication (APIG trigger parameter). This parameter is mandatory for APIG triggers. +
Enumeration values: +
|
+
func_info + |
+No + |
+ApigTriggerFuncInfo object + |
+FunctionGraph backend details (APIG trigger parameter). This parameter is mandatory for APIG triggers. + |
+
sl_domain + |
+No + |
+String + |
+Subdomain name allocated by the APIG system by default (APIG trigger parameter). +Minimum: 1 +Maximum: 255 + |
+
backend_type + |
+No + |
+String + |
+Backend type of the API (APIG trigger parameter). +Enumeration values: +
|
+
operations + |
+No + |
+Array of strings + |
+Custom operations (CTS trigger parameter). This parameter is mandatory for CTS triggers. CTS collects operation records of subscribed cloud resources. If you create a function with a CTS trigger, collected operation records of specified cloud services will be passed as a parameter to invoke the function. + |
+
instance_id + |
+No + |
+String + |
+Instance ID. This parameter is mandatory for DDS, Kafka, and RabbitMQ triggers. +
|
+
collection_name + |
+No + |
+String + |
+Collection name (DDS trigger parameter). This parameter is mandatory for DDS triggers. + |
+
db_name + |
+No + |
+String + |
+Database name (DDS trigger parameter). This parameter is mandatory for DDS triggers. + |
+
db_password + |
+No + |
+String + |
+DDS database password (DDS trigger parameter). This parameter is mandatory for DDS triggers. + |
+
batch_size + |
+No + |
+Integer + |
+Batch size: Maximum number of data records that can be processed by the function at a time. This parameter is mandatory for DIS, DDS, Kafka, and RabbitMQ triggers. +
|
+
queue_id + |
+No + |
+String + |
+Queue ID (DMS trigger parameter). This parameter is mandatory for DMS triggers. + |
+
consumer_group_id + |
+No + |
+String + |
+Consumer group ID (DMS trigger parameter). This parameter is mandatory for DMS triggers. + |
+
polling_interval + |
+No + |
+Integer + |
+Pull period. This parameter is mandatory for DIS and DMS triggers. + |
+
stream_name + |
+No + |
+String + |
+Stream name (DIS trigger parameter). This parameter is mandatory for DIS triggers. + |
+
sharditerator_type + |
+No + |
+String + |
+Starting position (DIS trigger parameter). This parameter is mandatory for DIS triggers. +
Enumeration values: +
|
+
polling_unit + |
+No + |
+String + |
+Pull period unit (DIS trigger parameter). This parameter is mandatory for DIS triggers. +
Enumeration values: +
|
+
max_fetch_bytes + |
+No + |
+Integer + |
+Max. fetch bytes (DIS trigger parameter). +Minimum: 0 +Maximum: 4194304 + |
+
is_serial + |
+No + |
+String + |
+Serial data processing (DIS trigger parameter). If enabled, FunctionGraph pulls data from the stream only after previous data is processed. If disabled, FunctionGraph pulls data from the stream as long as the pull period ends. This parameter is mandatory for DIS triggers. +Enumeration values: +
|
+
log_group_id + |
+No + |
+String + |
+Log group ID (LTS trigger parameter). This parameter is mandatory for LTS triggers. + |
+
log_topic_id + |
+No + |
+String + |
+Log stream ID (LTS trigger parameter). This parameter is mandatory for LTS triggers. + |
+
bucket + |
+No + |
+String + |
+Bucket name (OBS trigger parameter). The name of the OBS bucket used as the event source cannot be the same as that of an existing bucket of the current user or another user. After being created, the bucket name cannot be modified. This parameter is mandatory for OBS triggers. +Minimum: 1 +Maximum: 64 + |
+
prefix + |
+No + |
+String + |
+Prefix (OBS trigger parameter). Enter a prefix to limit notifications to objects whose names start with the matching characters. +Minimum: 0 +Maximum: 1024 + |
+
suffix + |
+No + |
+String + |
+Suffix (OBS trigger parameter). Enter a suffix to limit notifications to objects whose names end with the matching characters. +Minimum: 0 +Maximum: 1024 + |
+
events + |
+No + |
+Array of strings + |
+Trigger event (OBS trigger parameter). This parameter is mandatory for OBS triggers. +
|
+
topic_urn + |
+No + |
+String + |
+Topic URN (SMN trigger parameter) This parameter is mandatory for SMN triggers. +Minimum: 1 +Maximum: 255 + |
+
topic_ids + |
+No + |
+Array of strings + |
+The Kafka topic ID list (Kafka trigger parameter). This parameter is mandatory for Kafka triggers. + |
+
kafka_user + |
+No + |
+String + |
+Kafka account name (Kafka trigger parameter). + |
+
kafka_password + |
+No + |
+String + |
+Kafka password (Kafka trigger parameter). + |
+
kafka_connect_address + |
+No + |
+String + |
+Kafka instance connection address (Kafka trigger parameter). + |
+
kafka_ssl_enable + |
+No + |
+Boolean + |
+Whether to enable SASL authentication(Kafka trigger parameter). + |
+
access_password + |
+No + |
+String + |
+RabbitMQ account password (RabbitMQ trigger parameter). This parameter is mandatory for RabbitMQ triggers. + |
+
access_user + |
+No + |
+String + |
+RabbitMQ username (RabbitMQ trigger parameter). + |
+
connect_address + |
+No + |
+String + |
+Instance IP address (RabbitMQ trigger parameter). + |
+
exchange_name + |
+No + |
+String + |
+Switch name (RabbitMQ trigger parameter). This parameter is mandatory for RabbitMQ triggers. + |
+
vhost + |
+No + |
+String + |
+Virtual host (RabbitMQ trigger parameter). + |
+
ssl_enable + |
+No + |
+Boolean + |
+Whether to enable SSL (RabbitMQ trigger parameter). + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
function_urn + |
+No + |
+String + |
+Function URN. For details, see the function model descriptions. + |
+
invocation_type + |
+No + |
+String + |
+Execution mode of a function. +
Enumeration values: +
|
+
timeout + |
+Yes + |
+Integer + |
+Timeout allowed for APIG to request the FunctionGraph service. The unit is in millisecond. This parameter is mandatory for APIG triggers. +Minimum: 1 +Maximum: 60000 + |
+
version + |
+No + |
+String + |
+Function version information. + |
+
Status code: 201
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
trigger_id + |
+String + |
+Trigger ID. + |
+
trigger_type_code + |
+String + |
+Trigger type. +
Enumeration values: +
|
+
trigger_status + |
+String + |
+Trigger status. +
Enumeration values: +
|
+
event_data + |
+TriggerEventDataResponseBody object + |
+Trigger source event. + |
+
last_updated_time + |
+String + |
+Latest update time. + |
+
created_time + |
+String + |
+Time when the trigger was created. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
name + |
+String + |
+Trigger name. + |
+
schedule_type + |
+String + |
+Timer trigger type (timer trigger parameter). +
Enumeration values: +
|
+
schedule + |
+String + |
+Triggering rule. (timer trigger parameter). +
|
+
user_event + |
+String + |
+Additional information (timer trigger parameter). When the timer trigger triggers the function, the execution event (the event parameter of the function) is {"version": "v1.0", "time": "2018-06-01T08:30:00+08:00", "trigger_type": "TIMER", "trigger_name": "Timer_001", "user_event": "Additional information you entered"}. + |
+
triggerid + |
+String + |
+APIG trigger ID (APIG trigger parameter). + |
+
type + |
+Integer + |
+The API type (APIG trigger parameter). +
|
+
path + |
+String + |
+Path of the API (APIG trigger parameter). + |
+
protocol + |
+String + |
+Request protocol of the API (APIG trigger parameter). +Enumeration values: +
|
+
req_method + |
+String + |
+Request mode of the API (APIG trigger parameter). +Enumeration values: +
|
+
group_id + |
+String + |
+ID of the group to which the API belongs (APIG trigger parameter). + |
+
group_name + |
+String + |
+Name of the group to which the API belongs (APIG trigger parameter). + |
+
match_mode + |
+String + |
+Matching mode of the API (APIG trigger parameter). +
Enumeration values: +
|
+
env_name + |
+String + |
+Environment in which the API is published (APIG trigger parameter). + |
+
env_id + |
+String + |
+ID of the environment in which the API has been published (APIG trigger parameter). + |
+
api_id + |
+String + |
+API ID (APIG trigger parameter). + |
+
api_name + |
+String + |
+API name (APIG trigger parameter). + |
+
auth + |
+String + |
+Security authentication (APIG trigger parameter). +
Enumeration values: +
|
+
invoke_url + |
+String + |
+API calling address (APIG trigger parameter). + |
+
func_info + |
+ApigTriggerFuncInfo object + |
+FunctionGraph backend details (APIG trigger parameter). This parameter is mandatory for APIG triggers. + |
+
sl_domain + |
+String + |
+Subdomain name allocated by the APIG system by default (APIG trigger parameter). +Minimum: 1 +Maximum: 255 + |
+
backend_type + |
+String + |
+Backend type of the API (APIG trigger parameter). +Enumeration values: +
|
+
instance_id + |
+String + |
+Instance ID. This parameter is mandatory for DDS, Kafka, and RabbitMQ triggers. +
|
+
roma_app_id + |
+String + |
+ID of the integration application to which the API belongs (APIG trigger parameter). + |
+
operations + |
+Array of strings + |
+Custom operations (CTS trigger parameter). CTS collects operation records of subscribed cloud resources. If you create a function with a CTS trigger, collected operation records of specified cloud services will be passed as a parameter to invoke the function. + |
+
collection_name + |
+String + |
+Collection name (DDS trigger parameter). + |
+
db_name + |
+String + |
+Database name (DDS trigger parameter). + |
+
db_password + |
+String + |
+DDS database password (DDS trigger parameter). + |
+
db_user + |
+String + |
+DDS database username (DDS trigger parameter). + |
+
instance_addrs + |
+Array of strings + |
+DDS database instance address (DDS trigger parameter). + |
+
mode + |
+String + |
+DDS database instance type (DDS trigger parameter). +
|
+
batch_size + |
+Integer + |
+Batch size: Maximum number of data records that can be processed by the function at a time. This parameter is mandatory for DIS, DDS, Kafka, and RabbitMQ triggers. +
|
+
queue_id + |
+String + |
+Queue ID (DMS trigger parameter). + |
+
consumer_group_id + |
+String + |
+Consumer group ID (DMS trigger parameter). + |
+
polling_interval + |
+Integer + |
+Pull period. + |
+
stream_name + |
+String + |
+Stream name (DIS trigger parameter). + |
+
sharditerator_type + |
+String + |
+Start position (DIS trigger parameter). +
Enumeration values: +
|
+
polling_unit + |
+String + |
+Unit of the pull period (DIS trigger parameter). +
Enumeration values: +
|
+
max_fetch_bytes + |
+Integer + |
+Maximum number of bytes to be extracted (DIS trigger parameter). +Minimum: 0 +Maximum: 4194304 + |
+
is_serial + |
+String + |
+Serial Data Processing: If this option is selected, FunctionGraph pulls data from the stream only after previous data is processed. If this option is not selected, FunctionGraph pulls data from the stream as long as the pull period ends. +Enumeration values: +
|
+
log_group_id + |
+String + |
+Log group ID (LTS trigger parameter). + |
+
log_topic_id + |
+String + |
+Log stream ID (LTS trigger parameter). + |
+
bucket + |
+String + |
+Bucket name (OBS trigger parameter). The name of the OBS bucket used as the event source cannot be the same as that of an existing bucket of the current user or another user. After being created, the bucket name cannot be modified. +Minimum: 1 +Maximum: 64 + |
+
prefix + |
+String + |
+Prefix (OBS trigger parameter). Enter a prefix to limit notifications to objects whose names start with the matching characters. +Minimum: 0 +Maximum: 1024 + |
+
suffix + |
+String + |
+Suffix (OBS trigger parameter). Enter a suffix to limit notifications to objects whose names end with the matching characters. +Minimum: 0 +Maximum: 1024 + |
+
events + |
+Array of strings + |
+Trigger event (OBS trigger parameter). +
|
+
topic_urn + |
+String + |
+Topic URN (SMN trigger parameter) +Minimum: 1 +Maximum: 255 + |
+
topic_ids + |
+Array of strings + |
+The Kafka topic ID list (Kafka trigger parameter). + |
+
kafka_user + |
+String + |
+Kafka account name (Kafka trigger parameter). + |
+
kafka_password + |
+String + |
+Kafka password (Kafka trigger parameter). + |
+
kafka_connect_address + |
+String + |
+Kafka instance connection address (Kafka trigger parameter). + |
+
kafka_ssl_enable + |
+Boolean + |
+Whether to enable SASL authentication(Kafka trigger parameter). + |
+
access_password + |
+String + |
+RabbitMQ account password (RabbitMQ trigger parameter). + |
+
access_user + |
+String + |
+RabbitMQ username (RabbitMQ trigger parameter). + |
+
connect_address + |
+String + |
+Instance IP address (RabbitMQ trigger parameter). + |
+
exchange_name + |
+String + |
+Switch name (RabbitMQ trigger parameter). + |
+
vhost + |
+String + |
+Virtual host (RabbitMQ trigger parameter). + |
+
ssl_enable + |
+Boolean + |
+Whether to enable SSL (RabbitMQ trigger parameter). + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
function_urn + |
+String + |
+Function URN. For details, see the function model descriptions. + |
+
invocation_type + |
+String + |
+Execution mode of a function. +
Enumeration values: +
|
+
timeout + |
+Integer + |
+Timeout allowed for APIG to request the FunctionGraph service. The unit is in millisecond. This parameter is mandatory for APIG triggers. +Minimum: 1 +Maximum: 60000 + |
+
version + |
+String + |
+Function version information. + |
+
Status code: 400
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 401
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 403
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 404
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 500
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Create an OBS trigger named obs-event-1ec7 with events of uploading files to the input-picture2 bucket.
+POST https://{Endpoint}/v2/{project_id}/fgs/triggers/{function_urn} + +{ + "trigger_type_code" : "OBS", + "trigger_status" : "ACTIVE", + "event_data" : { + "bucket" : "input-picture2", + "events" : [ "s3:ObjectCreated:*" ], + "name" : "obs-event-1ec7" + } +}+
Create a shared APIG trigger named API_test_function, with None authentication (temporary domain name) and 5000s timeout.
+POST https://{Endpoint}/v2/{project_id}/fgs/triggers/{function_urn} + +{ + "trigger_type_code" : "APIG", + "trigger_status" : "ACTIVE", + "event_data" : { + "func_info" : { + "timeout" : 5000 + }, + "name" : "API_test_function", + "env_id" : "DEFAULT_ENVIRONMENT_RELEASE_ID", + "env_name" : "RELEASE", + "protocol" : "HTTPS", + "auth" : "NONE", + "group_id" : "318b09eb214a41488c667ecd51667e3x", + "sl_domain" : "318b09eb214a41488c667ecd51667e3x.apig.{region}.xxx.com", + "match_mode" : "SWA", + "req_method" : "ANY", + "backend_type" : "FUNCTION", + "type" : 1, + "path" : "/test_gxz_v1_billing" + } +}+
Create a dedicated APIG trigger named API_test_function, with None authentication (temporary domain name) and 5000s timeout.
+POST https://{Endpoint}/v2/{project_id}/fgs/triggers/{function_urn} + +{ + "trigger_type_code" : "DEDICATEDGATEWAY", + "trigger_status" : "ACTIVE", + "event_data" : { + "func_info" : { + "timeout" : 5000 + }, + "name" : "API_test_function", + "env_id" : "DEFAULT_ENVIRONMENT_RELEASE_ID", + "env_name" : "RELEASE", + "protocol" : "HTTPS", + "auth" : "IAM", + "group_id" : "5106210cf79e4xxxx", + "sl_domain" : "5106210cf79e4xxxx.apic.{region_id}.xxx.com", + "match_mode" : "SWA", + "req_method" : "ANY", + "backend_type" : "FUNCTION", + "type" : 1, + "path" : "/test_gxz_v1_billing" + } +}+
Create a Kafka trigger named 86ad3efcxx to pull messages from the PUSH_TOKEN_RECORD consumer group.
+POST https://{Endpoint}/v2/{project_id}/fgs/triggers/{function_urn} + +{ + "trigger_type_code" : "KAFKA", + "trigger_status" : "DISABLED", + "event_data" : { + "instance_id" : "86ad3efc-c019-460e-91e7-317b1a89f95x", + "topic_ids" : [ "PUSH_TOKEN_RECORD" ], + "batch_size" : 100 + } +}+
Create a timer trigger to trigger a function every 3 minutes.
+POST https://{Endpoint}/v2/{project_id}/fgs/triggers/{function_urn} + +{ + "trigger_type_code" : "TIMER", + "trigger_status" : "ACTIVE", + "event_data" : { + "name" : "Timer-l8v2", + "schedule" : "3m", + "schedule_type" : "Rate" + } +}+
Create an LTS trigger. (An agency with LTS permissions is required.)
+POST https://{Endpoint}/v2/{project_id}/fgs/triggers/{function_urn} + +{ + "trigger_type_code" : "LTS", + "trigger_status" : "ACTIVE", + "event_data" : { + "log_group_id" : "ccd3fa30-7c86-4590-8a9d-XXX", + "log_topic_id" : "5b4944dd-9603-481d-9b91-XXX" + } +}+
Create an SMN trigger.
+POST https://{Endpoint}/v2/{project_id}/fgs/triggers/{function_urn} + +{ + "trigger_type_code" : "SMN", + "trigger_status" : "ACTIVE", + "event_data" : { + "topic_urn" : "urn:smn:{region}:{project_id}:Failed_times" + } +}+
Status code: 201
+Created
+{ + "trigger_id" : "9a14fae1-78cf-4185-ac7a-429eb6dc41fb", + "trigger_type_code" : "TIMER", + "trigger_status" : "ACTIVE", + "event_data" : { + "name" : "Timer-cpg3", + "schedule" : "3m", + "schedule_type" : "Rate" + }, + "last_updated_time" : "2022-11-09 16:37:24", + "created_time" : "2022-11-09 16:37:24" +}+
Status Code + |
+Description + |
+
---|---|
201 + |
+Created + |
+
400 + |
+Bad request. + |
+
401 + |
+Unauthorized. + |
+
403 + |
+Forbidden. + |
+
404 + |
+Not found. + |
+
500 + |
+Internal server error. + |
+
See Error Codes.
+This API is used to delete a trigger.
+DELETE /v2/{project_id}/fgs/triggers/{function_urn}/{trigger_type_code}/{trigger_id}
+ +Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. For details, see Obtaining a Project ID. + |
+
function_urn + |
+Yes + |
+String + |
+Function URN. For details, see the function model description. + |
+
trigger_type_code + |
+Yes + |
+String + |
+Trigger type code. +Enumeration values: +
|
+
trigger_id + |
+Yes + |
+String + |
+Trigger ID. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
X-Auth-Token + |
+Yes + |
+String + |
+User token. +It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. + |
+
Content-Type + |
+Yes + |
+String + |
+Message body type (format). +Default: application/json + |
+
Status code: 400
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 401
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 403
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 404
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 500
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Delete a trigger.
+DELETE https://{Endpoint}/v2/{project_id}/fgs/triggers/{function_urn}/{trigger_type_code}/{trigger_id}+
None
+Status Code + |
+Description + |
+
---|---|
204 + |
+No Content + |
+
400 + |
+Bad request. + |
+
401 + |
+Unauthorized. + |
+
403 + |
+Forbidden. + |
+
404 + |
+Not found. + |
+
500 + |
+Internal server error. + |
+
See Error Codes.
+This API is used to update a trigger.
+PUT /v2/{project_id}/fgs/triggers/{function_urn}/{trigger_type_code}/{trigger_id}
+ +Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. For details, see Obtaining a Project ID. + |
+
function_urn + |
+Yes + |
+String + |
+Function URN. For details, see the function model description. + |
+
trigger_type_code + |
+Yes + |
+String + |
+Trigger type code. +Enumeration values: +
|
+
trigger_id + |
+Yes + |
+String + |
+Trigger ID. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
X-Auth-Token + |
+Yes + |
+String + |
+User token. +It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. + |
+
Content-Type + |
+Yes + |
+String + |
+Message body type (format). +Default: application/json + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
trigger_status + |
+No + |
+String + |
+Trigger status. +Enumeration values: +
|
+
event_data + |
+No + |
+Array of UpdateriggerEventData objects + |
+Trigger update event. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
is_serial + |
+No + |
+Boolean + |
+Serial data processing. + |
+
max_fetch_bytes + |
+No + |
+Integer + |
+Max. bytes. + |
+
polling_interval + |
+No + |
+Integer + |
+Pull period. + |
+
polling_unit + |
+No + |
+String + |
+Pull period unit. +Enumeration values: +
|
+
Status code: 200
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
trigger_id + |
+String + |
+Trigger ID. + |
+
trigger_type_code + |
+String + |
+Trigger type. +
Enumeration values: +
|
+
trigger_status + |
+String + |
+Trigger status. +
Enumeration values: +
|
+
event_data + |
+TriggerEventDataResponseBody object + |
+Trigger source event. + |
+
last_updated_time + |
+String + |
+Latest update time. + |
+
created_time + |
+String + |
+Time when the trigger was created. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
name + |
+String + |
+Trigger name. + |
+
schedule_type + |
+String + |
+Timer trigger type (timer trigger parameter). +
Enumeration values: +
|
+
schedule + |
+String + |
+Triggering rule. (timer trigger parameter). +
|
+
user_event + |
+String + |
+Additional information (timer trigger parameter). When the timer trigger triggers the function, the execution event (the event parameter of the function) is {"version": "v1.0", "time": "2018-06-01T08:30:00+08:00", "trigger_type": "TIMER", "trigger_name": "Timer_001", "user_event": "Additional information you entered"}. + |
+
triggerid + |
+String + |
+APIG trigger ID (APIG trigger parameter). + |
+
type + |
+Integer + |
+The API type (APIG trigger parameter). +
|
+
path + |
+String + |
+Path of the API (APIG trigger parameter). + |
+
protocol + |
+String + |
+Request protocol of the API (APIG trigger parameter). +Enumeration values: +
|
+
req_method + |
+String + |
+Request mode of the API (APIG trigger parameter). +Enumeration values: +
|
+
group_id + |
+String + |
+ID of the group to which the API belongs (APIG trigger parameter). + |
+
group_name + |
+String + |
+Name of the group to which the API belongs (APIG trigger parameter). + |
+
match_mode + |
+String + |
+Matching mode of the API (APIG trigger parameter). +
Enumeration values: +
|
+
env_name + |
+String + |
+Environment in which the API is published (APIG trigger parameter). + |
+
env_id + |
+String + |
+ID of the environment in which the API has been published (APIG trigger parameter). + |
+
api_id + |
+String + |
+API ID (APIG trigger parameter). + |
+
api_name + |
+String + |
+API name (APIG trigger parameter). + |
+
auth + |
+String + |
+Security authentication (APIG trigger parameter). +
Enumeration values: +
|
+
invoke_url + |
+String + |
+API calling address (APIG trigger parameter). + |
+
func_info + |
+ApigTriggerFuncInfo object + |
+FunctionGraph backend details (APIG trigger parameter). This parameter is mandatory for APIG triggers. + |
+
sl_domain + |
+String + |
+Subdomain name allocated by the APIG system by default (APIG trigger parameter). +Minimum: 1 +Maximum: 255 + |
+
backend_type + |
+String + |
+Backend type of the API (APIG trigger parameter). +Enumeration values: +
|
+
instance_id + |
+String + |
+Instance ID. This parameter is mandatory for DDS, Kafka, and RabbitMQ triggers. +
|
+
roma_app_id + |
+String + |
+ID of the integration application to which the API belongs (APIG trigger parameter). + |
+
operations + |
+Array of strings + |
+Custom operations (CTS trigger parameter). CTS collects operation records of subscribed cloud resources. If you create a function with a CTS trigger, collected operation records of specified cloud services will be passed as a parameter to invoke the function. + |
+
collection_name + |
+String + |
+Collection name (DDS trigger parameter). + |
+
db_name + |
+String + |
+Database name (DDS trigger parameter). + |
+
db_password + |
+String + |
+DDS database password (DDS trigger parameter). + |
+
db_user + |
+String + |
+DDS database username (DDS trigger parameter). + |
+
instance_addrs + |
+Array of strings + |
+DDS database instance address (DDS trigger parameter). + |
+
mode + |
+String + |
+DDS database instance type (DDS trigger parameter). +
|
+
batch_size + |
+Integer + |
+Batch size: Maximum number of data records that can be processed by the function at a time. This parameter is mandatory for DIS, DDS, Kafka, and RabbitMQ triggers. +
|
+
queue_id + |
+String + |
+Queue ID (DMS trigger parameter). + |
+
consumer_group_id + |
+String + |
+Consumer group ID (DMS trigger parameter). + |
+
polling_interval + |
+Integer + |
+Pull period. + |
+
stream_name + |
+String + |
+Stream name (DIS trigger parameter). + |
+
sharditerator_type + |
+String + |
+Start position (DIS trigger parameter). +
Enumeration values: +
|
+
polling_unit + |
+String + |
+Unit of the pull period (DIS trigger parameter). +
Enumeration values: +
|
+
max_fetch_bytes + |
+Integer + |
+Maximum number of bytes to be extracted (DIS trigger parameter). +Minimum: 0 +Maximum: 4194304 + |
+
is_serial + |
+String + |
+Serial Data Processing: If this option is selected, FunctionGraph pulls data from the stream only after previous data is processed. If this option is not selected, FunctionGraph pulls data from the stream as long as the pull period ends. +Enumeration values: +
|
+
log_group_id + |
+String + |
+Log group ID (LTS trigger parameter). + |
+
log_topic_id + |
+String + |
+Log stream ID (LTS trigger parameter). + |
+
bucket + |
+String + |
+Bucket name (OBS trigger parameter). The name of the OBS bucket used as the event source cannot be the same as that of an existing bucket of the current user or another user. After being created, the bucket name cannot be modified. +Minimum: 1 +Maximum: 64 + |
+
prefix + |
+String + |
+Prefix (OBS trigger parameter). Enter a prefix to limit notifications to objects whose names start with the matching characters. +Minimum: 0 +Maximum: 1024 + |
+
suffix + |
+String + |
+Suffix (OBS trigger parameter). Enter a suffix to limit notifications to objects whose names end with the matching characters. +Minimum: 0 +Maximum: 1024 + |
+
events + |
+Array of strings + |
+Trigger event (OBS trigger parameter). +
|
+
topic_urn + |
+String + |
+Topic URN (SMN trigger parameter) +Minimum: 1 +Maximum: 255 + |
+
topic_ids + |
+Array of strings + |
+The Kafka topic ID list (Kafka trigger parameter). + |
+
kafka_user + |
+String + |
+Kafka account name (Kafka trigger parameter). + |
+
kafka_password + |
+String + |
+Kafka password (Kafka trigger parameter). + |
+
kafka_connect_address + |
+String + |
+Kafka instance connection address (Kafka trigger parameter). + |
+
kafka_ssl_enable + |
+Boolean + |
+Whether to enable SASL authentication(Kafka trigger parameter). + |
+
access_password + |
+String + |
+RabbitMQ account password (RabbitMQ trigger parameter). + |
+
access_user + |
+String + |
+RabbitMQ username (RabbitMQ trigger parameter). + |
+
connect_address + |
+String + |
+Instance IP address (RabbitMQ trigger parameter). + |
+
exchange_name + |
+String + |
+Switch name (RabbitMQ trigger parameter). + |
+
vhost + |
+String + |
+Virtual host (RabbitMQ trigger parameter). + |
+
ssl_enable + |
+Boolean + |
+Whether to enable SSL (RabbitMQ trigger parameter). + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
function_urn + |
+String + |
+Function URN. For details, see the function model descriptions. + |
+
invocation_type + |
+String + |
+Execution mode of a function. +
Enumeration values: +
|
+
timeout + |
+Integer + |
+Timeout allowed for APIG to request the FunctionGraph service. The unit is in millisecond. This parameter is mandatory for APIG triggers. +Minimum: 1 +Maximum: 60000 + |
+
version + |
+String + |
+Function version information. + |
+
Status code: 404
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Enable a trigger.
+PUT https://{Endpoint}/v2/{project_id}/fgs/triggers/{function_urn}/{trigger_type_code}/{trigger_id} + +{ + "trigger_status" : "ACTIVE" +}+
Status code: 200
+OK
+{ + "trigger_id" : "9a14fae1-78cf-4185-ac7a-429eb6dc41fb", + "trigger_type_code" : "TIMER", + "trigger_status" : "ACTIVE", + "event_data" : { + "name" : "Timer-cpg3", + "schedule" : "3m", + "schedule_type" : "Rate" + }, + "last_updated_time" : "2022-11-09 16:37:24", + "created_time" : "2019-10-29171553" +}+
Status code: 404
+Not Found
+{ + "error_code" : "FSS.0404", + "error_msg" : "not found" +}+
Status Code + |
+Description + |
+
---|---|
200 + |
+OK + |
+
404 + |
+Not Found + |
+
See Error Codes.
+This API is used to execute a function synchronously. Clients must wait for explicit responses to their requests from the function. Responses are returned only after function invocation is complete.
+POST /v2/{project_id}/fgs/functions/{function_urn}/invocations
+ +Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. For details, see Obtaining a Project ID. + |
+
function_urn + |
+Yes + |
+String + |
+Function URN. For details, see the function model description. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
X-Auth-Token + |
+Yes + |
+String + |
+User token. +It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. + |
+
Content-Type + |
+Yes + |
+String + |
+Message body type (format). + |
+
X-Cff-Log-Type + |
+No + |
+String + |
+Options: tail (4 KB logs will be returned) and null (no logs will be returned). + |
+
X-CFF-Request-Version + |
+No + |
+String + |
+Response body format. Options: v0 and v1. +
|
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
- + |
+Yes + |
+Object + |
+Request body for executing a function. + |
+
Status code: 200
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
X-Cff-Invoke-Summary + |
+String + |
+Execution summary of the synchronous invocation. + |
+
X-Cff-Request-Id + |
+String + |
+Request ID of the synchronous invocation. + |
+
X-Cff-Function-Log + |
+String + |
+User log of the synchronous invocation. Set X-Cff-Log-Type:tail in the request header. Intercept and encode the last 2,000 bytes of the log using Base64. + |
+
X-CFF-Billing-Duration + |
+String + |
+Billing information of the synchronous invocation. + |
+
X-Cff-Response-Version + |
+String + |
+Response format: +v0: text format +v1: JSON format + |
+
X-Func-Err-Code + |
+String + |
+Error code of the synchronous invocation. The value is 0 if the execution is successful. + |
+
X-Is-Func-Err + |
+String + |
+Indicates whether the error occurs in a user function. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
request_id + |
+String + |
+Request ID. + |
+
result + |
+String + |
+Function execution result. + |
+
log + |
+String + |
+Function execution log. + |
+
status + |
+Integer + |
+Function execution status. + |
+
Status code: 400
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 401
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 403
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 404
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 500
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 503
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Execute a function synchronously with the request parameter as a key pair ("k":"v").
+POST /v2/{project_id}/fgs/functions/{function_urn}/invocations + +{ + "k" : "v" +}+
Status code: 200
+OK
+{ + "result" : "{\"statusCode\": 200, \"isBase64Encoded\": false, \"body\": \"{\\\"key\\\": \\\"value\\\"}\", \"headers\": {\"Content-Type\": \"application/json\"}}", + "log" : "2022-09-20T11:43:57Z Start invoke request '1cbe80f3-3c65-475e-ad88-76ac518d386a', version: v1\nHello, World!\n\n2022-09-20T11:43:58Z Finish invoke request '1cbe80f3-3c65-475e-ad88-76ac518d386a', duration: 65.828ms, billing duration: 66ms, memory used: 21.473MB, billing memory: 128MB", + "status" : 200, + "request_id" : "1cbe80f3-3c65-475e-ad88-76ac518d386x" +}+
Status Code + |
+Description + |
+
---|---|
200 + |
+OK + |
+
400 + |
+Bad request. + |
+
401 + |
+Unauthorized. + |
+
403 + |
+Forbidden. + |
+
404 + |
+Not found. + |
+
500 + |
+Internal server error. + |
+
503 + |
+Service unavailable. + |
+
See Error Codes.
+This API is used to execute a function asynchronously.
+POST /v2/{project_id}/fgs/functions/{function_urn}/invocations-async
+ +Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. For details, see Obtaining a Project ID. + |
+
function_urn + |
+Yes + |
+String + |
+Function URN. For details, see the function model description. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
X-Auth-Token + |
+Yes + |
+String + |
+User token. +It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. + |
+
Content-Type + |
+Yes + |
+String + |
+Message body type (format). + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
{User defined key} + |
+Yes + |
+Object + |
+Request body for executing a function asynchronously. + |
+
Status code: 202
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
request_id + |
+String + |
+Request ID. + |
+
Status code: 400
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 401
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 403
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 404
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 500
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 503
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Execute a function asynchronously with the request parameter as a key pair ("k":"v").
+POST /v2/{project_id}/fgs/functions/{function_urn}/invocations-async + +{ + "body" : { + "k" : "v" + } +}+
Status code: 202
+Accepted
+{ + "request_id" : "1167bf8c-87b0-43ab-8f5f-26b16c64f252" +}+
Status Code + |
+Description + |
+
---|---|
202 + |
+Accepted + |
+
400 + |
+Bad request. + |
+
401 + |
+Unauthorized. + |
+
403 + |
+Forbidden. + |
+
404 + |
+Not found. + |
+
500 + |
+Internal server error. + |
+
503 + |
+Service unavailable. + |
+
See Error Codes.
+This API is used to query all dependencies.
+GET /v2/{project_id}/fgs/dependencies
+ +Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. For details, see Obtaining a Project ID. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
marker + |
+No + |
+String + |
+Final record queried last time. Default value: 0. + |
+
maxitems + |
+No + |
+String + |
+Maximum number of items to return in a request. + |
+
ispublic + |
+No + |
+String + |
+Whether a dependency is public. + |
+
dependency_type + |
+No + |
+String + |
+Dependency type. Options: public, private, and all. Default value: all. + |
+
runtime + |
+No + |
+String + |
+Environment in which a FunctionGraph function is executed. Options: +
|
+
name + |
+No + |
+String + |
+Dependence name. + |
+
limit + |
+No + |
+String + |
+Maximum number of dependencies that can be obtained in a query. Default value: 400. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
X-Auth-Token + |
+Yes + |
+String + |
+User token. +It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. + |
+
Content-Type + |
+Yes + |
+String + |
+Message body type (format). + |
+
Status code: 200
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
dependencies + |
+Array of ListDependenciesResult objects + |
+Dependency list. + |
+
next_marker + |
+Long + |
+Next read location. + |
+
count + |
+Long + |
+Total number of dependencies. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
id + |
+String + |
+Dependency ID. + |
+
owner + |
+String + |
+Dependency owner. public indicates a public dependency. + |
+
link + |
+String + |
+URL of the dependency in the OBS console. + |
+
runtime + |
+String + |
+Environment for executing a function. Options: Python2.7 Python 3.6 Python 3.9 Go 1.8 Go 1.x Java 8 Java 11 Node.js 6.10 Node.js 8.10 Node.js 10.16 Node.js 12.13 Node.js 14.18 C# (.NET Core 2.0) C# (.NET Core 2.1) C# (.NET Core 3.1) Custom PHP 7.3 HTTP Custom image-based functions +Enumeration values: +
|
+
etag + |
+String + |
+Dependency ID. + |
+
size + |
+Long + |
+Dependency size. + |
+
name + |
+String + |
+Dependency name. + |
+
file_name + |
+String + |
+Dependency file name. + |
+
description + |
+String + |
+Dependency description. + |
+
version + |
+Long + |
+Dependence version. + |
+
last_modified + |
+Long + |
+Time when the dependency was last updated. + |
+
Status code: 401
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 403
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 404
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 500
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Dependencies of the current tenant.
+GET https://{Endpoint}/v2/{project_id}/fgs/ListDependencies?marker=0&maxitems=400+
Status code: 200
+ok
+{ + "dependencies" : [ { + "id" : "6578de50-9a18-48fa-b84e-b2d36636e433", + "owner" : "public", + "link" : "https://{obs_endpoint}/functionstage-examples/fg_test_pandas_1.1.3.zip", + "runtime" : "Python3.6", + "etag" : "35a893d9495b3e22259b2773996bc94d-6", + "size" : 31009808, + "name" : "panda1.1.3" + } ], + "next_marker" : 43, + "count" : 43 +}+
Status Code + |
+Description + |
+
---|---|
200 + |
+ok + |
+
401 + |
+Unauthorized. + |
+
403 + |
+Forbidden. + |
+
404 + |
+Not found. + |
+
500 + |
+Internal server error. + |
+
See Error Codes.
+This API is used to delete a test event.
+DELETE /v2/{project_id}/fgs/functions/{function_urn}/events/{event_id}
+ +Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. For details, see Obtaining a Project ID. + |
+
function_urn + |
+Yes + |
+String + |
+Function URN. For details, see the function model description. + |
+
event_id + |
+Yes + |
+String + |
+Test event ID. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
X-Auth-Token + |
+Yes + |
+String + |
+User token. +It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. + |
+
Content-Type + |
+Yes + |
+String + |
+Message body type (format). + |
+
Status code: 400
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 401
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 403
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 404
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 500
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Delete a test event.
+DELETE https://{Endpoint}/v2/{project_id}/fgs/functions/{function_urn}/events/{event_id}+
None
+Status Code + |
+Description + |
+
---|---|
204 + |
+No Content + |
+
400 + |
+Bad request. + |
+
401 + |
+Unauthorized. + |
+
403 + |
+Forbidden. + |
+
404 + |
+Not found. + |
+
500 + |
+Internal server error. + |
+
See Error Codes.
+This API is used to query the test events of a function.
+GET /v2/{project_id}/fgs/functions/{function_urn}/events
+ +Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. For details, see Obtaining a Project ID. + |
+
function_urn + |
+Yes + |
+String + |
+Function URN. For details, see the function model description. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
X-Auth-Token + |
+Yes + |
+String + |
+User token. +It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. + |
+
Content-Type + |
+Yes + |
+String + |
+Message body type (format). + |
+
Status code: 200
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
count + |
+Integer + |
+Total number of test events. + |
+
events + |
+Array of ListEventsResult objects + |
+Test event list. + |
+
next_marker + |
+Long + |
+Next read location. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
id + |
+String + |
+Test event ID. + |
+
last_modified + |
+Number + |
+Last update time. + |
+
name + |
+String + |
+Test event name. + |
+
Status code: 400
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 401
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 403
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 404
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 500
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Query the test event list.
+GET https://{Endpoint}/v2/{project_id}/fgs/functions/{function_urn}/events+
Status code: 200
+OK
+{ + "events" : [ { + "id" : "3b659dc0-12fc-40dc-aa05-a321d9424cb3", + "name" : "event-k9r3", + "last_modified" : 1597374286 + } ], + "next_marker" : 1, + "count" : 1 +}+
Status Code + |
+Description + |
+
---|---|
200 + |
+OK + |
+
400 + |
+Bad request. + |
+
401 + |
+Unauthorized. + |
+
403 + |
+Forbidden. + |
+
404 + |
+Not found. + |
+
500 + |
+Internal server error. + |
+
See Error Codes.
+This API is used to create a test event.
+POST /v2/{project_id}/fgs/functions/{function_urn}/events
+ +Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. For details, see Obtaining a Project ID. + |
+
function_urn + |
+Yes + |
+String + |
+Function URN. For details, see the function model description. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
X-Auth-Token + |
+Yes + |
+String + |
+User token. +It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. + |
+
Content-Type + |
+Yes + |
+String + |
+Message body type (format). + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
name + |
+Yes + |
+String + |
+Test event name. Max. 25 of letters, digits, hyphens (-), and underscores (_). Start with a letter, and end with a letter or digit. +Minimum length: 1 character. +Maximum length: 25 characters. + |
+
content + |
+Yes + |
+String + |
+Test event content, which is a Base64-encoded JSON character string. + |
+
Status code: 200
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
id + |
+String + |
+Test event ID. + |
+
name + |
+String + |
+Test event name. + |
+
Status code: 400
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 401
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 403
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 404
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 500
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Create a test event named event-xx with content {"k":"v"}.
+POST https://{Endpoint}/v2/{project_id}/fgs/functions/{function_urn}/events + +{ + "name" : "event-xx", + "content" : "eyJrIjoidiJ9" +}+
Status code: 200
+OK
+{ + "id" : "3b659dc0-12fc-40dc-aa05-a321d9424cb3", + "name" : "event-k9r3" +}+
Status Code + |
+Description + |
+
---|---|
200 + |
+OK + |
+
400 + |
+Bad request. + |
+
401 + |
+Unauthorized. + |
+
403 + |
+Forbidden. + |
+
404 + |
+Not found. + |
+
500 + |
+Internal server error. + |
+
See Error Codes.
+This API is used to query the details of a test event.
+GET /v2/{project_id}/fgs/functions/{function_urn}/events/{event_id}
+ +Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. For details, see Obtaining a Project ID. + |
+
function_urn + |
+Yes + |
+String + |
+Function URN. For details, see the function model description. + |
+
event_id + |
+Yes + |
+String + |
+Test event ID. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
X-Auth-Token + |
+Yes + |
+String + |
+User token. +It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. + |
+
Content-Type + |
+Yes + |
+String + |
+Message body type (format). + |
+
Status code: 200
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
id + |
+String + |
+Test event ID. + |
+
name + |
+String + |
+Test event name. + |
+
content + |
+String + |
+Test event content. + |
+
last_modified + |
+Number + |
+Last update time. + |
+
Status code: 400
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 401
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 403
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 404
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 500
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Query a test event.
+GET https://{Endpoint}/v2/{project_id}/fgs/functions/{function_urn}/events/{event_id}+
Status code: 200
+OK
+{ + "id" : "3b659dc0-12fc-40dc-aa05-a321d9424cb3", + "name" : "event-k9r3", + "last_modified" : 1597374286, + "content" : "ewogICAgImJvZHkiOiAiIiwKICAgICJyZXF1ZXN0Q29udGV4d*****" +}+
Status Code + |
+Description + |
+
---|---|
200 + |
+OK + |
+
400 + |
+Bad request. + |
+
401 + |
+Unauthorized. + |
+
403 + |
+Forbidden. + |
+
404 + |
+Not found. + |
+
500 + |
+Internal server error. + |
+
See Error Codes.
+This API is used to update a test event.
+PUT /v2/{project_id}/fgs/functions/{function_urn}/events/{event_id}
+ +Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. For details, see Obtaining a Project ID. + |
+
function_urn + |
+Yes + |
+String + |
+Function URN. For details, see the function model description. + |
+
event_id + |
+Yes + |
+String + |
+Test event ID. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
X-Auth-Token + |
+Yes + |
+String + |
+User token. +It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. + |
+
Content-Type + |
+Yes + |
+String + |
+Message body type (format). + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
content + |
+Yes + |
+String + |
+Test event content, which is a Base64-encoded JSON character string. + |
+
Status code: 200
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
id + |
+String + |
+Test event ID. + |
+
name + |
+String + |
+Test event name. + |
+
Status code: 400
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 401
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 403
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 404
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 500
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Update the content of a specified test event to {"k":"v"}.
+PUT https://{Endpoint}/v2/{project_id}/fgs/functions/{function_urn}/events/{event_id} + +{ + "content" : "eyJrIjoidiJ9" +}+
Status code: 200
+OK
+{ + "id" : "3b659dc0-12fc-40dc-aa05-a321d9424cb3", + "name" : "event-k9r3" +}+
Status Code + |
+Description + |
+
---|---|
200 + |
+OK + |
+
400 + |
+Bad request. + |
+
401 + |
+Unauthorized. + |
+
403 + |
+Forbidden. + |
+
404 + |
+Not found. + |
+
500 + |
+Internal server error. + |
+
See Error Codes.
+This API is used to query tenant quotas.
+GET /v2/{project_id}/fgs/quotas
+ +Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. For details, see Obtaining a Project ID. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
X-Auth-Token + |
+Yes + |
+String + |
+User token. +It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. + |
+
Content-Type + |
+Yes + |
+String + |
+Message body type (format). + |
+
Status code: 200
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
quotas + |
+ListQuotasResult object + |
+Quota information. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
resources + |
+Array of Resources objects + |
+Quota list. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
quota + |
+Integer + |
+Function quota. + |
+
used + |
+Integer + |
+Used quota. + |
+
type + |
+String + |
+Resource type. +Enumeration values: +
|
+
unit + |
+String + |
+Resource unit. For fgs_func_code_size, the unit is MB. In other scenarios, there is no unit. + |
+
Status code: 400
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 401
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 403
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 500
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Query quotas.
+GET /v2/{project_id}/fgs/quotas+
Status code: 200
+Query successful.
+{ + "quotas" : { + "resources" : [ { + "quota" : 60, + "used" : 3, + "type" : "fgs_func_scale_down_timeout" + }, { + "quota" : 100, + "used" : 22, + "type" : "fgs_func_occurs" + }, { + "quota" : 100, + "used" : 22, + "type" : "fgs_func_pat_idle_time" + }, { + "quota" : 100, + "used" : 22, + "type" : "fgs_func_num" + }, { + "quota" : 10240, + "used" : 22, + "type" : "fgs_func_code_size", + "unit" : "MB" + }, { + "quota" : 512, + "used" : 22, + "type" : "fgs_workflow_num" + } ] + } +}+
Status Code + |
+Description + |
+
---|---|
200 + |
+Query successful. + |
+
400 + |
+Bad request. + |
+
401 + |
+Unauthorized. + |
+
403 + |
+Forbidden. + |
+
500 + |
+Internal server error. + |
+
See Error Codes.
+This API is used to query metrics of a function in a specified period.
+GET /v2/{project_id}/fgs/functions/{func_urn}/statistics/{period}
+ +Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. For details, see Obtaining a Project ID. + |
+
func_urn + |
+Yes + |
+String + |
+Function URN. For details, see the function model description. + |
+
period + |
+Yes + |
+String + |
+Time range specified to query function execution metrics. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
X-Auth-Token + |
+Yes + |
+String + |
+User token. +It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. + |
+
Content-Type + |
+Yes + |
+String + |
+Message body type (format). + |
+
Status code: 200
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
count + |
+Array of SlaReportsValue objects + |
+Function invocations. + |
+
duration + |
+Array of SlaReportsValue objects + |
+Average latency, in milliseconds. + |
+
fail_count + |
+Array of SlaReportsValue objects + |
+Number of errors. + |
+
max_duration + |
+Array of SlaReportsValue objects + |
+Maximum latency, in milliseconds. + |
+
min_duration + |
+Array of SlaReportsValue objects + |
+Minimum latency, in milliseconds. + |
+
reject_count + |
+Array of SlaReportsValue objects + |
+Number of throttles. + |
+
function_error_count + |
+Array of SlaReportsValue objects + |
+Number of function errors. + |
+
system_error_count + |
+Array of SlaReportsValue objects + |
+Number of system errors. + |
+
reserved_instance_num + |
+Array of SlaReportsValue objects + |
+Reserved instance metrics. + |
+
concurrency_num + |
+Array of SlaReportsValue objects + |
+Elastic instance metrics. + |
+
Query metrics of a function in a specified period.
+GET /v2/{project_id}/fgs/functions/{func_urn}/statistics/{period}+
Status code: 200
+ok
+{ + "count" : [ { + "timestamp" : 1596679200000, + "value" : -1 + }, { + "timestamp" : 1596682800000, + "value" : 2 + }, { + "timestamp" : 1596686400000, + "value" : -1 + } ], + "duration" : [ { + "timestamp" : 1596679200000, + "value" : -1 + }, { + "timestamp" : 1596682800000, + "value" : 950 + }, { + "timestamp" : 1596686400000, + "value" : -1 + } ], + "fail_count" : [ { + "timestamp" : 1596679200000, + "value" : -1 + }, { + "timestamp" : 1596682800000, + "value" : 0 + }, { + "timestamp" : 1596686400000, + "value" : -1 + } ], + "max_duration" : [ { + "timestamp" : 1596679200000, + "value" : -1 + }, { + "timestamp" : 1596682800000, + "value" : 740 + }, { + "timestamp" : 1596686400000, + "value" : -1 + } ], + "min_duration" : [ { + "timestamp" : 1596679200000, + "value" : -1 + }, { + "timestamp" : 1596682800000, + "value" : 210 + }, { + "timestamp" : 1596686400000, + "value" : -1 + } ], + "reject_count" : [ { + "timestamp" : 1596679200000, + "value" : -1 + }, { + "timestamp" : 1596682800000, + "value" : 0 + }, { + "timestamp" : 1596686400000, + "value" : -1 + } ] +}+
Status Code + |
+Description + |
+
---|---|
200 + |
+ok + |
+
See Error Codes.
+This API is used to query tenant-level function statistics.
+The statistics include function format, quota and usage, and traffic report.
+You can query data in a specific period using the filter and period parameters.
+GET /v2/{project_id}/fgs/functions/statistics
+ +Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. For details, see Obtaining a Project ID. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
filter + |
+Yes + |
+String + |
+Parameter filter. +
Enumeration values: +
|
+
period + |
+No + |
+String + |
+The unit is minute. This parameter must be used together with the filter parameter metric. + |
+
option + |
+No + |
+String + |
+Monthly statistical period. This parameter is valid only when filter is set to monthly_report. +If a value beyond the preceding range is specified, the default value 0 will be used. +
|
+
limit + |
+No + |
+String + |
+Maximum number of data records returned in a request. Max.: 500. Default: 100. +Default: 100 +Minimum: 1 +Maximum: 64 + |
+
marker + |
+No + |
+String + |
+Start position of the current query. The default value is 0. +Default: 0 +Minimum: 1 +Maximum: 64 + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
X-Auth-Token + |
+Yes + |
+String + |
+User token. +It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. + |
+
Content-Type + |
+Yes + |
+String + |
+Message body type (format). + |
+
Status code: 200
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
count + |
+Array of MonthUsed objects + |
+Number of monthly invocations. + |
+
gbs + |
+Array of MonthUsed objects + |
+Monthly resource usage. + |
+
gpu_gbs + |
+Array of MonthUsed objects + |
+Monthly GPU usage. + |
+
statistics + |
++ | +Function Metrics + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
date + |
+String + |
+Date. + |
+
value + |
+Number + |
+Usage. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
count + |
+Array of SlaReportsValue objects + |
+Function invocations. + |
+
duration + |
+Array of SlaReportsValue objects + |
+Average latency, in milliseconds. + |
+
fail_count + |
+Array of SlaReportsValue objects + |
+Number of errors. + |
+
max_duration + |
+Array of SlaReportsValue objects + |
+Maximum latency, in milliseconds. + |
+
min_duration + |
+Array of SlaReportsValue objects + |
+Minimum latency, in milliseconds. + |
+
reject_count + |
+Array of SlaReportsValue objects + |
+Number of throttles. + |
+
function_error_count + |
+Array of SlaReportsValue objects + |
+Number of function errors. + |
+
system_error_count + |
+Array of SlaReportsValue objects + |
+Number of system errors. + |
+
reserved_instance_num + |
+Array of SlaReportsValue objects + |
+Reserved instance metrics. + |
+
concurrency_num + |
+Array of SlaReportsValue objects + |
+Elastic instance metrics. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
timestamp + |
+Integer + |
+Timestamp. + |
+
value + |
+Double + |
+Value. If the value is -1, the metric has no data in the current period. The possible cause is that the function is not executed. + |
+
Status code: 400
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Query tenant-level function statistics.
+GET /v2/{project_id}/fgs/functions/statistics+
Status code: 200
+Query successful.
+{ + "statistics" : { + "count" : [ { + "timestamp" : 1596679200000, + "value" : -1 + }, { + "timestamp" : 1596682800000, + "value" : 2 + }, { + "timestamp" : 1596686400000, + "value" : -1 + } ], + "duration" : [ { + "timestamp" : 1596679200000, + "value" : -1 + }, { + "timestamp" : 1596682800000, + "value" : 950 + }, { + "timestamp" : 1596686400000, + "value" : -1 + } ], + "fail_count" : [ { + "timestamp" : 1596679200000, + "value" : -1 + }, { + "timestamp" : 1596682800000, + "value" : 0 + }, { + "timestamp" : 1596686400000, + "value" : -1 + } ], + "max_duration" : [ { + "timestamp" : 1596679200000, + "value" : -1 + }, { + "timestamp" : 1596682800000, + "value" : 740 + }, { + "timestamp" : 1596686400000, + "value" : -1 + } ], + "min_duration" : [ { + "timestamp" : 1596679200000, + "value" : -1 + }, { + "timestamp" : 1596682800000, + "value" : 210 + }, { + "timestamp" : 1596686400000, + "value" : -1 + } ], + "reject_count" : [ { + "timestamp" : 1596679200000, + "value" : -1 + }, { + "timestamp" : 1596682800000, + "value" : 0 + }, { + "timestamp" : 1596686400000, + "value" : -1 + } ] + } +}+
Status Code + |
+Description + |
+
---|---|
200 + |
+Query successful. + |
+
400 + |
+Bad Request + |
+
See Error Codes.
+This API is used to query the asynchronous invocation setting of a function version.
+GET /v2/{project_id}/fgs/functions/{function_urn}/async-invoke-config
+ +Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. For details, see Obtaining a Project ID. + |
+
function_urn + |
+Yes + |
+String + |
+Function URN. For details, see the function model description. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
X-Auth-Token + |
+Yes + |
+String + |
+User token. +It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. + |
+
Content-Type + |
+Yes + |
+String + |
+Message body type (format). + |
+
Status code: 200
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
func_urn + |
+String + |
+Function URN. +Minimum: 1 +Maximum: 269 + |
+
max_async_event_age_in_seconds + |
+Integer + |
+Maximum validity period of a message. Value range: 1–86,400. Unit: second. + |
+
max_async_retry_attempts + |
+Integer + |
+Maximum number of retry attempts to be made if asynchronous invocation fails. Default value: 3. Value range: 0–8. + |
+
destination_config + |
+FuncAsyncDestinationConfig object + |
+Asynchronous invocation target. + |
+
created_time + |
+String + |
+Time when asynchronous execution notification was configured. + |
+
last_modified + |
+String + |
+Time when the asynchronous execution notification settings were last modified. + |
+
enable_async_status_log + |
+Boolean + |
+Whether to enable asynchronous invocation status persistence. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
on_success + |
+FuncDestinationConfig object + |
+Target to be invoked when a function is successfully executed. + |
+
on_failure + |
+FuncDestinationConfig object + |
+Target to be invoked when a function fails to be executed due to a system error or an internal error. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
destination + |
+String + |
+Object type. +
Enumeration values: +
|
+
param + |
+String + |
+Parameters (in JSON format) corresponding to the target service. +
|
+
Status code: 404
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Query the asynchronous execution notification settings of a function version.
+GET /v2/{project_id}/fgs/functions/{function_urn}/async-invoke-config+
Status code: 200
+Ok
+{ + "func_urn" : "urn:fss:xxxxxxxxx:7aad83af3e8d42e99ac194xxxxxxxxxx:function:default:test:latest", + "max_async_event_age_in_seconds" : 60, + "max_async_retry_attempts" : 1, + "destination_config" : { + "on_success" : { + "destination" : "FunctionGraph", + "param" : "{\"func_urn\":\"urn:fss:{region}:5691ba790e2b46ceb38316xxxxxxxxxx:function:default:testPython:latest\"}" + }, + "on_failure" : { + "destination" : "FunctionGraph", + "param" : "{\"func_urn\":\"urn:fss:{region}:5691ba790e2b46ceb38316xxxxxxxxxx:function:default:testPython:latest\"}" + } + }, + "created_time" : "2021-03-04T14:50:02+08:00", + "last_modified" : "2021-03-04 14:50:02" +}+
Status Code + |
+Description + |
+
---|---|
200 + |
+Ok + |
+
404 + |
+Not Found + |
+
See Error Codes.
+This API is used to delete the asynchronous execution notification settings of a function.
+DELETE /v2/{project_id}/fgs/functions/{function_urn}/async-invoke-config
+ +Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. For details, see Obtaining a Project ID. + |
+
function_urn + |
+Yes + |
+String + |
+Function URN. For details, see the function model description. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
X-Auth-Token + |
+Yes + |
+String + |
+User token. +It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. + |
+
Content-Type + |
+Yes + |
+String + |
+Message body type (format). + |
+
Status code: 404
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Delete the asynchronous execution notification settings of a function.
+DELETE /v2/{project_id}/fgs/functions/{function_urn}/async-invoke-config+
None
+Status Code + |
+Description + |
+
---|---|
204 + |
+No Content + |
+
404 + |
+Not Found + |
+
See Error Codes.
+This API is used to configure asynchronous execution notification for a function.
+PUT /v2/{project_id}/fgs/functions/{function_urn}/async-invoke-config
+ +Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. For details, see Obtaining a Project ID. + |
+
function_urn + |
+Yes + |
+String + |
+Function URN. For details, see the function model description. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
X-Auth-Token + |
+Yes + |
+String + |
+User token. +It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. + |
+
Content-Type + |
+Yes + |
+String + |
+Message body type (format). + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
max_async_event_age_in_seconds + |
+No + |
+Integer + |
+Maximum validity period of a message. Value range: 1s to 86,400s. Default value: 3600s. +Minimum: 1 +Maximum: 86400 + |
+
max_async_retry_attempts + |
+No + |
+Integer + |
+Maximum number of retry attempts to be made if asynchronous invocation fails. Default value: 1. Value range: 0–3. +Minimum: 0 +Maximum: 3 + |
+
destination_config + |
+No + |
+FuncAsyncDestinationConfig object + |
+Asynchronous invocation target. + |
+
enable_async_status_log + |
+No + |
+Boolean + |
+Whether to enable asynchronous invocation status persistence. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
on_success + |
+No + |
+FuncDestinationConfig object + |
+Target to be invoked when a function is successfully executed. + |
+
on_failure + |
+No + |
+FuncDestinationConfig object + |
+Target to be invoked when a function fails to be executed due to a system error or an internal error. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
destination + |
+No + |
+String + |
+Object type. +
Enumeration values: +
|
+
param + |
+No + |
+String + |
+Parameters (in JSON format) corresponding to the target service. +
|
+
Status code: 200
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
func_urn + |
+String + |
+Function URN. +Minimum: 1 +Maximum: 269 + |
+
max_async_event_age_in_seconds + |
+Integer + |
+Maximum validity period of a message. Value range: 60–86,400. Unit: second. + |
+
max_async_retry_attempts + |
+Integer + |
+Maximum number of retry attempts to be made if asynchronous invocation fails. Default value: 3. Value range: 0–8. + |
+
destination_config + |
+FuncAsyncDestinationConfig object + |
+Asynchronous invocation target. + |
+
created_time + |
+String + |
+Time when asynchronous execution notification was configured. + |
+
last_modified + |
+String + |
+Time when the asynchronous execution notification settings were last modified. + |
+
enable_async_status_log + |
+Boolean + |
+Whether to enable asynchronous invocation status persistence. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
on_success + |
+FuncDestinationConfig object + |
+Target to be invoked when a function is successfully executed. + |
+
on_failure + |
+FuncDestinationConfig object + |
+Target to be invoked when a function fails to be executed due to a system error or an internal error. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
destination + |
+String + |
+Object type. +
Enumeration values: +
|
+
param + |
+String + |
+Parameters (in JSON format) corresponding to the target service. +
|
+
Status code: 400
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 404
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Configure asynchronous execution notification for a function with max. validity period of 10s and max. retries of 3, and enable asynchronous invocation status persistence.
+PUT /v2/{project_id}/fgs/functions/{function_urn}/async-invoke-config + +{ + "max_async_event_age_in_seconds" : 10, + "max_async_retry_attempts" : 3, + "enable_async_status_log" : true +}+
Status code: 200
+Ok
+{ + "func_urn" : "urn:fss:xxxxxxxxx:7aad83af3e8d42e99ac194xxxxxxxxxx:function:default:test:latest", + "max_async_event_age_in_seconds" : 60, + "max_async_retry_attempts" : 1, + "destination_config" : { + "on_success" : { + "destination" : "FunctionGraph", + "param" : "{\"func_urn\":\"urn:fss:{region}:5691ba790e2b46ceb38316xxxxxxxxxx:function:default:testPython:latest\"}" + }, + "on_failure" : { + "destination" : "FunctionGraph", + "param" : "{\"func_urn\":\"urn:fss:{region}:5691ba790e2b46ceb38316xxxxxxxxxx:function:default:testPython:latest\"}" + } + }, + "created_time" : "2021-03-04T14:50:02+08:00", + "last_modified" : "2021-03-04 14:50:02" +}+
Status Code + |
+Description + |
+
---|---|
200 + |
+Ok + |
+
400 + |
+Bad Request + |
+
404 + |
+Not Found + |
+
See Error Codes.
+This API is used to query the asynchronous execution notification settings of a function's all versions.
+GET /v2/{project_id}/fgs/functions/{function_urn}/async-invoke-configs
+ +Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. For details, see Obtaining a Project ID. + |
+
function_urn + |
+Yes + |
+String + |
+Function URN. For details, see the function model description. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
marker + |
+No + |
+String + |
+Final record queried last time. +Maximum: 64 + |
+
limit + |
+No + |
+String + |
+Number of items displayed on each page. +
Default: 10 + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
X-Auth-Token + |
+Yes + |
+String + |
+User token. +It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. + |
+
Content-Type + |
+Yes + |
+String + |
+Message body type (format). + |
+
Status code: 200
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
async_invoke_configs + |
+Array of ListFunctionAsyncInvokeConfigResult objects + |
+Asynchronous execution notification settings. + |
+
count + |
+Long + |
+Total number of items. +Minimum: 0 + |
+
page_info + |
+PageInfo object + |
++ |
Parameter + |
+Type + |
+Description + |
+
---|---|---|
func_urn + |
+String + |
+Function URN. +Minimum: 1 +Maximum: 269 + |
+
max_async_event_age_in_seconds + |
+Integer + |
+Maximum validity period of a message. Value range: 60–86,400. Unit: second. + |
+
max_async_retry_attempts + |
+Integer + |
+Maximum number of retry attempts to be made if asynchronous invocation fails. Default value: 3. Value range: 0–8. + |
+
destination_config + |
+FuncAsyncDestinationConfig object + |
+Asynchronous invocation target. + |
+
created_time + |
+String + |
+Time when asynchronous execution notification was configured. + |
+
last_modified + |
+String + |
+Time when the asynchronous execution notification settings were last modified. + |
+
enable_async_status_log + |
+Boolean + |
+Whether to enable asynchronous invocation status persistence. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
on_success + |
+FuncDestinationConfig object + |
+Target to be invoked when a function is successfully executed. + |
+
on_failure + |
+FuncDestinationConfig object + |
+Target to be invoked when a function fails to be executed due to a system error or an internal error. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
destination + |
+String + |
+Object type. +
Enumeration values: +
|
+
param + |
+String + |
+Parameters (in JSON format) corresponding to the target service. +
|
+
Query the asynchronous execution notification settings of a function's all versions.
+GET /v2/{project_id}/fgs/functions/{function_urn}/async-invoke-configs+
Status code: 200
+Ok
+{ + "async_invoke_configs" : [ { + "func_urn" : "urn:fss:{region}:5691ba790e2b46ceb38316xxxxxxxxxx:function:default:test_async:latest", + "max_async_event_age_in_seconds" : 60, + "max_async_retry_attempts" : 1, + "destination_config" : { + "on_success" : { + "destination" : "FunctionGraph", + "param" : "{\"func_urn\":\"urn:fss:{region}:5691ba790e2b46ceb38316xxxxxxxxxx:function:default:testPython:latest\"}" + }, + "on_failure" : { + "destination" : "FunctionGraph", + "param" : "{\"func_urn\":\"urn:fss:{region}:5691ba790e2b46ceb38316xxxxxxxxxx:function:default:testPython:latest\"}" + } + }, + "created_time" : "2021-03-04T14:50:02+08:00", + "last_modified" : "2021-03-04 14:50:02" + } ], + "count" : 2, + "page_info" : { + "next_marker" : 2, + "previous_marker" : 0, + "current_count" : 2 + } +}+
Status Code + |
+Description + |
+
---|---|
200 + |
+Ok + |
+
See Error Codes.
+This API is used to publish a function version.
+POST /v2/{project_id}/fgs/functions/{function_urn}/versions
+ +Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. For details, see Obtaining a Project ID. + |
+
function_urn + |
+Yes + |
+String + |
+Function URN. For details, see the function model description. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
X-Auth-Token + |
+Yes + |
+String + |
+User token. +It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. + |
+
Content-Type + |
+Yes + |
+String + |
+Message body type (format). + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
digest + |
+No + |
+String + |
+MD5 key. + |
+
version + |
+No + |
+String + |
+Function version. + |
+
description + |
+No + |
+String + |
+Version description. + |
+
Status code: 200
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
func_urn + |
+String + |
+Function URN. + |
+
func_name + |
+String + |
+Function name. + |
+
domain_id + |
+String + |
+Domain ID. + |
+
namespace + |
+String + |
+Project ID. + |
+
project_name + |
+String + |
+Project name. + |
+
package + |
+String + |
+Group to which the function belongs. This field is defined to group functions. + |
+
runtime + |
+String + |
+Environment for executing a function. Options: Python2.7 Python 3.6 Python 3.9 Go 1.8 Go 1.x Java 8 Java 11 Node.js 6.10 Node.js 8.10 Node.js 10.16 Node.js 12.13 Node.js 14.18 C# (.NET Core 2.0) C# (.NET Core 2.1) C# (.NET Core 3.1) Custom PHP 7.3 HTTP Custom image-based functions +Enumeration values: +
|
+
timeout + |
+Integer + |
+Maximum duration the function can be executed. Value range: 3s–259,200s. + |
+
handler + |
+String + |
+Handler of a function in the format of "xx.xx". It must contain a period (.). +For example, for Node.js function myfunction.handler, the file name is myfunction.js, and the handler function is handler. + |
+
memory_size + |
+Integer + |
+Memory consumed by a function. +Unit: MB. +The value can be 128, 256, 512, 768, 1024, 1280, 1536, 1792, 2048, 2560, 3072, 3584 or 4096. +The value ranges from 128 to 4096. + |
+
cpu + |
+Integer + |
+CPU resources of a function. Unit: millicore (1 core = 1000 millicores). The value of this field is proportional to that of MemorySize. By default, 100 CPU millicores are required for 128 MB memory. + |
+
code_type + |
+String + |
+Function code type. Options: inline: inline code zip: ZIP file obs: function code stored in an OBS bucket jar: JAR file, mainly for Java functions Custom-Image-Swr: The function code comes from the SWR custom image. +Enumeration values: +
|
+
code_url + |
+String + |
+If CodeType is set to obs, enter the OBS URL of the function code package. If CodeType is not set to obs, leave this parameter blank. + |
+
code_filename + |
+String + |
+Name of a function file. This parameter is mandatory only when CodeType is set to jar or zip. + |
+
code_size + |
+Long + |
+Code size in bytes. + |
+
user_data + |
+String + |
+Name/Value information defined for the function. These are parameters used in the function. For example, if a function needs to access a host, define Host={host_ip}. You can define a maximum of 20 such parameters, and their total length cannot exceed 4 KB. + |
+
encrypted_user_data + |
+String + |
+User-defined name/value to be encrypted. + |
+
digest + |
+String + |
+SHA512 hash value of function code, which is used to determine whether the function has changed. + |
+
version + |
+String + |
+Function version, which is automatically generated by the system. The version name is in the format of "vYYYYMMDD-HHMMSS" (v+year/month/day-hour/minute/second). + |
+
image_name + |
+String + |
+Internal identifier of a function version. + |
+
xrole + |
+String + |
+Agency used by the function. You need to create an agency on the IAM console. This field is mandatory when a function needs to access other services. After specifying a function execution agency, you can use the context method in the function handler to obtain a token, an AK, and an SK for accessing other cloud services. No agency is required if FunctionGraph does not access any cloud services. + |
+
app_xrole + |
+String + |
+Execution agency. You can optimize performance by configuring a separate agency for function execution, otherwise, the same agency is used for both execution and configuration. + |
+
description + |
+String + |
+Function description. + |
+
version_description + |
+String + |
+Version description. + |
+
last_modified + |
+String + |
+Time when the function was last updated. + |
+
func_vpc + |
+FuncVpc object + |
+VPC configuration. An agency with VPC permissions must be configured for the function. + |
+
mount_config + |
+MountConfig object + |
+Mounting configuration. + |
+
strategy_config + |
+StrategyConfig object + |
+Function policy configuration. + |
+
dependencies + |
+Array of Dependency objects + |
+Dependency packages. + |
+
initializer_handler + |
+String + |
+Initializer of the function in the format of "xx.xx". It must contain a period (.). This parameter is mandatory when the initialization function is configured. For example, for Node.js function myfunction.initializer, the file name is myfunction.js, and the initialization function is initializer. + |
+
initializer_timeout + |
+Integer + |
+Maximum duration the function can be initialized. Value range: 1s–300s. This parameter is mandatory when the initialization function is configured. + |
+
pre_stop_handler + |
+String + |
+The pre-stop handler of a function. The value must contain a period (.) in the format of xx.xx. For example, for Node.js function myfunction.pre_stop_handler, the file name is myfunction.js, and the initialization function is pre_stop_handler. + |
+
pre_stop_timeout + |
+Integer + |
+Maximum duration the function can be initialized. Value range: 1s–90s. + |
+
enterprise_project_id + |
+String + |
+Enterprise project ID. This parameter is mandatory if you create a function as an enterprise user. + |
+
long_time + |
+Boolean + |
+Whether to allow a long timeout. + |
+
log_group_id + |
+String + |
+Log group ID. + |
+
log_stream_id + |
+String + |
+Log stream ID. + |
+
type + |
+String + |
+v2 indicates an official version, and v1 indicates a deprecated version. +Enumeration values: +
|
+
enable_dynamic_memory + |
+Boolean + |
+Whether to enable dynamic memory allocation. + |
+
function_async_config + |
+FunctionAsyncConfig object + |
+Return struct of the asynchronous execution notification settings. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
domain_id + |
+String + |
+Domain name ID. + |
+
namespace + |
+String + |
+Project ID. + |
+
vpc_name + |
+String + |
+VPC name. + |
+
vpc_id + |
+String + |
+VPC ID. + |
+
subnet_name + |
+String + |
+Subnet name. + |
+
subnet_id + |
+String + |
+Subnet ID. + |
+
cidr + |
+String + |
+Subnet mask. + |
+
gateway + |
+String + |
+Gateway. + |
+
security_groups + |
+Array of strings + |
+Security group. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
mount_user + |
+MountUser object + |
+User information. + |
+
func_mounts + |
+Array of FuncMount objects + |
+Mounted resources. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
user_id + |
+String + |
+User ID, a non-0 integer from –1 to 65534. + |
+
user_group_id + |
+String + |
+User group ID, a non-0 integer from –1 to 65534. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
mount_type + |
+String + |
+Mount type. The value can be sfs, sfsTurbo, or ecs. This parameter is mandatory when func_mounts is not empty. + |
+
mount_resource + |
+String + |
+ID of the mounted resource (cloud service ID). This parameter is mandatory when func_mounts is not empty. + |
+
mount_share_path + |
+String + |
+Remote mount path. For example, 192.168.0.12:/data. This parameter is mandatory if mount_type is set to ecs. + |
+
local_mount_path + |
+String + |
+Function access path. This parameter is mandatory when func_mounts is not empty. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
concurrency + |
+Integer + |
+Maximum number of instances for a single function. For v1, the value can be 0 or –1; for v2, it ranges from –1 to 1000. +
|
+
concurrent_num + |
+Integer + |
+Number of concurrent requests per instance. This parameter is supported only by v2. The value ranges from 1 to 1,000. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
id + |
+String + |
+Dependency version ID. + |
+
owner + |
+String + |
+Domain ID of the dependency owner. + |
+
link + |
+String + |
+URL of the dependency on OBS. + |
+
runtime + |
+String + |
+Environment for executing a function. Options: Python2.7 Python 3.6 Python 3.9 Go 1.8 Go 1.x Java 8 Java 11 Node.js 6.10 Node.js 8.10 Node.js 10.16 Node.js 12.13 Node.js 14.18 C# (.NET Core 2.0) C# (.NET Core 2.1) C# (.NET Core 3.1) Custom PHP 7.3 HTTP Custom image-based functions +Enumeration values: +
|
+
etag + |
+String + |
+MD5 value of a dependency. + |
+
size + |
+Long + |
+Dependency size. + |
+
name + |
+String + |
+Dependence name. + |
+
description + |
+String + |
+Dependency description. + |
+
file_name + |
+String + |
+File name of a dependency package (ZIP). + |
+
version + |
+Long + |
+Dependency version ID. + |
+
dep_id + |
+String + |
+Dependency ID. + |
+
last_modified + |
+String + |
+Time when the function was last updated. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
max_async_event_age_in_seconds + |
+Integer + |
+Maximum validity period of a message. Value range: 60–86,400. Unit: second. + |
+
max_async_retry_attempts + |
+Integer + |
+Maximum number of retry attempts to be made if asynchronous invocation fails. Default value: 3. Value range: 0–8. + |
+
destination_config + |
+FuncAsyncDestinationConfig object + |
+Asynchronous invocation target. + |
+
created_time + |
+String + |
+Time when asynchronous execution notification was configured. + |
+
last_modified + |
+String + |
+Time when the asynchronous execution notification settings were last modified. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
on_success + |
+FuncDestinationConfig object + |
+Target to be invoked when a function is successfully executed. + |
+
on_failure + |
+FuncDestinationConfig object + |
+Target to be invoked when a function fails to be executed due to a system error or an internal error. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
destination + |
+String + |
+Object type. +
Enumeration values: +
|
+
param + |
+String + |
+Parameters (in JSON format) corresponding to the target service. +
|
+
Status code: 400
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 401
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 403
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 404
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 500
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Publish a function version.
+POST https://{Endpoint}/v2/{project_id}/fgs/functions/{function_urn}/versions + +{ + "version" : "v1", + "description" : "v1" +}+
Status code: 200
+OK
+{ + "func_urn" : "urn:fss:xxxxxxxxx:7aad83af3e8d42e99ac194e8419e2c9b:function:default:test", + "func_name" : "test", + "domain_id" : "14ee2e3501124efcbca7998baa24xxxx", + "namespace" : "46b6f338fc3445b8846c71dfb1fbxxxx", + "project_name" : "xxxxx", + "package" : "default", + "runtime" : "Node.js6.10", + "timeout" : 3, + "handler" : "test.handler", + "memory_size" : 128, + "cpu" : 300, + "code_type" : "inline", + "code_filename" : "inline.js", + "code_size" : 272, + "digest" : "faa825575c45437cddd4e369bea69893bcbe195d478178462ad90984fe72993f3f59d15f41c5373f807f3e05fb9af322c55dabeb16565c386e402413458e6068", + "version" : "latest", + "image_name" : "latest-191025153727@zehht", + "last_modified" : "2019-10-25 15:37:27", + "strategy_config" : { + "concurrency" : 0 + } +}+
Status code: 404
+Not found.
+{ + "error_code" : "FSS.1051", + "error_msg" : "Not found the function" +}+
Status Code + |
+Description + |
+
---|---|
200 + |
+OK + |
+
400 + |
+Bad request. + |
+
401 + |
+Unauthorized. + |
+
403 + |
+Forbidden. + |
+
404 + |
+Not found. + |
+
500 + |
+Internal server error. + |
+
See Error Codes.
+This API is used to query the LTS log group and stream settings of a function.
+GET /v2/{project_id}/fgs/functions/{function_urn}/lts-log-detail
+ +Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. For details, see Obtaining a Project ID. + |
+
function_urn + |
+Yes + |
+String + |
+Function URN. For details, see the function model description. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
X-Auth-Token + |
+Yes + |
+String + |
+User token. +It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. + |
+
Content-Type + |
+Yes + |
+String + |
+Message body type (format). + |
+
Status code: 200
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
group_name + |
+String + |
+Log group name. + |
+
group_id + |
+String + |
+Log group ID. + |
+
stream_id + |
+String + |
+Log stream ID. + |
+
stream_name + |
+String + |
+Log stream name. + |
+
Status code: 403
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Query the LTS log group and stream settings of a function.
+GET /v2/{project_id}/fgs/functions/{urn}/lts-log-detail+
Status code: 200
+Ok
+{ + "group_id" : "xxx", + "stream_id" : "xxx", + "stream_name" : "xxx" +}+
Status code: 403
+FORBIDDEN
+{ + "error_code" : "FSS.0403", + "error_msg" : "invalid token" +}+
Status Code + |
+Description + |
+
---|---|
200 + |
+Ok + |
+
403 + |
+FORBIDDEN + |
+
See Error Codes.
+This API is used to stop asynchronous invocation of a function with N concurrent instances. When calling this API, set recursive to false and force to true. The API will also stop the function's other concurrent requests and return "4208 function invocation canceled".
+POST /v2/{project_id}/fgs/functions/{function_urn}/cancel
+ +Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. For details, see Obtaining a Project ID. + |
+
function_urn + |
+Yes + |
+String + |
+Function URN. For details, see the function model description. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
X-Auth-Token + |
+Yes + |
+String + |
+User token. +It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. + |
+
Content-Type + |
+Yes + |
+String + |
+Message body type (format). + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
request_id + |
+Yes + |
+String + |
+ID of a stopped request. + |
+
type + |
+No + |
+String + |
+Stop mode. Options: recursive and force. recursive: The subfunction that is being invoked will be stopped. force: Terminate the runtime directly. +Enumeration values: +
|
+
Status code: 400
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 403
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 404
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 500
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Stop an asynchronous invocation request of a function.
+POST /v2/{project_id}/fgs/functions/{function_urn}/cancel + +{ + "request_id" : "xxxx" +}+
Status code: 200
+OK
+null+
Status code: 400
+Invalid RequestId
+{ + "error_code" : "FSS.0400", + "error_msg" : "Invalid RequestId" +}+
Status code: 403
+FORBIDDEN
+{ + "error_code" : "FSS.0403", + "error_msg" : "invalid token" +}+
Status code: 404
+Not Found
+{ + "error_code" : "FSS.0404", + "error_msg" : "can not find function" +}+
Status code: 500
+Internal error.
+{ + "error_code" : "FSS.0500", + "error_msg" : "xxx" +}+
Status Code + |
+Description + |
+
---|---|
200 + |
+OK + |
+
400 + |
+Invalid RequestId + |
+
403 + |
+FORBIDDEN + |
+
404 + |
+Not Found + |
+
500 + |
+Internal error. + |
+
See Error Codes.
+This API is used to create a dependency version.
+POST /v2/{project_id}/fgs/dependencies/version
+ +Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. For details, see Obtaining a Project ID. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
X-Auth-Token + |
+Yes + |
+String + |
+User token. +It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. + |
+
Content-Type + |
+Yes + |
+String + |
+Message body type (format). + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
depend_file + |
+No + |
+String + |
+This parameter is mandatory when depend_type is set to zip. It is in the file stream format and must be a ZIP file encoded using Base64. The size of the ZIP file cannot exceed 40 MB. For a larger file, upload it through OBS. + |
+
depend_link + |
+No + |
+String + |
+URL of the dependency in the OBS console when depend_type is set to obs. + |
+
depend_type + |
+Yes + |
+String + |
+Import mode. Options: obs and zip. + |
+
runtime + |
+Yes + |
+String + |
+Environment for executing a function. Options: Python2.7 Python 3.6 Python 3.9 Go 1.8 Go 1.x Java 8 Java 11 Node.js 6.10 Node.js 8.10 Node.js 10.16 Node.js 12.13 Node.js 14.18 C# (.NET Core 2.0) C# (.NET Core 2.1) C# (.NET Core 3.1) Custom PHP 7.3 HTTP Custom image-based functions +Enumeration values: +
|
+
name + |
+Yes + |
+String + |
+Dependence name. It can contain a maximum of 96 characters, and must start with a letter and end with a letter or digit. Only letters, digits, underscores (_), periods (.), and hyphens (-) are allowed. + |
+
description + |
+No + |
+String + |
+Description of the dependency, which can contain a maximum of 512 characters. + |
+
Status code: 200
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
id + |
+String + |
+Dependence version ID. + |
+
owner + |
+String + |
+Dependency owner. + |
+
link + |
+String + |
+URL of the dependency in OBS. + |
+
runtime + |
+String + |
+Environment for executing a function. Options: Python2.7 Python 3.6 Python 3.9 Go 1.8 Go 1.x Java 8 Java 11 Node.js 6.10 Node.js 8.10 Node.js 10.16 Node.js 12.13 Node.js 14.18 C# (.NET Core 2.0) C# (.NET Core 2.1) C# (.NET Core 3.1) Custom PHP 7.3 HTTP Custom image-based functions +Enumeration values: +
|
+
etag + |
+String + |
+Unique identifier of the dependency. + |
+
size + |
+Long + |
+Dependency size. + |
+
name + |
+String + |
+Dependency name. + |
+
description + |
+String + |
+Dependency description. + |
+
file_name + |
+String + |
+Dependency file name. + |
+
version + |
+Long + |
+Dependency version. + |
+
dep_id + |
+String + |
+Dependency ID. + |
+
last_modified + |
+Long + |
+Time when the dependency was last updated. + |
+
Status code: 401
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 403
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 404
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 500
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Create a dependency version by directly uploading a ZIP file.
+POST https://{Endpoint}/v2/{project_id}/fgs/dependencies/version + +{ + "depend_file" : "xxx", + "depend_type" : "zip", + "runtime" : "Node.js8.10", + "name" : "xxx" +}+
Create a dependency by uploading a ZIP file from OBS.
+POST https://{Endpoint}/v2/{project_id}/fgs/dependencies/version + +{ + "depend_link" : "https://{bucket}.{obs_endpoint}/depends/****/4f4ae4eb-dcdc-4dd3-bffd-79600bd972b3.zip", + "depend_type" : "obs", + "runtime" : "Node.js8.10", + "name" : "xxx" +}+
Status code: 200
+ok
+{ + "id" : "4f4ae4eb-dcdc-4dd3-bffd-79600bd972b3", + "owner" : "*****", + "link" : "https://{bucket}.{obs_endpoint}/depends/****/4f4ae4eb-dcdc-4dd3-bffd-79600bd972b3.zip", + "runtime" : "Python3.6", + "etag" : "83863be4b6c3a86aef995dbc83aae68f", + "size" : 577118, + "name" : "python-kafka", + "description" : "Python library for Kafka operations.", + "file_name" : "python-kafka.zip", + "version" : 0, + "dep_id" : "edbd67fa-f107-40b3-af75-a85f0577ad61", + "last_modified" : 1660029887 +}+
Status Code + |
+Description + |
+
---|---|
200 + |
+ok + |
+
401 + |
+Unauthorized. + |
+
403 + |
+Forbidden. + |
+
404 + |
+Not found. + |
+
500 + |
+Internal server error. + |
+
See Error Codes.
+This API is used to query dependency versions.
+GET /v2/{project_id}/fgs/dependencies/{depend_id}/version
+ +Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. For details, see Obtaining a Project ID. + |
+
depend_id + |
+Yes + |
+String + |
+Dependency ID. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
marker + |
+No + |
+String + |
+Final record queried last time. Default value: 0. + |
+
maxitems + |
+No + |
+String + |
+Maximum number of items to return in a request. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
X-Auth-Token + |
+Yes + |
+String + |
+User token. +It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. + |
+
Content-Type + |
+Yes + |
+String + |
+Message body type (format). + |
+
Status code: 200
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
dependencies + |
+Array of ListDependencyVersionsResult objects + |
+Dependency list. + |
+
next_marker + |
+Long + |
+Next read position. + |
+
count + |
+Long + |
+Total number of dependencies. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
id + |
+String + |
+Dependency version ID. + |
+
owner + |
+String + |
+Dependency owner. public indicates that the dependency is public. + |
+
link + |
+String + |
+URL of the dependency in OBS. + |
+
runtime + |
+String + |
+Environment for executing a function. Options: Python2.7 Python 3.6 Python 3.9 Go 1.8 Go 1.x Java 8 Java 11 Node.js 6.10 Node.js 8.10 Node.js 10.16 Node.js 12.13 Node.js 14.18 C# (.NET Core 2.0) C# (.NET Core 2.1) C# (.NET Core 3.1) Custom PHP 7.3 HTTP Custom image-based functions +Enumeration values: +
|
+
etag + |
+String + |
+Unique identifier of the dependency (MD5 verification value). + |
+
size + |
+Long + |
+Size of the dependency. + |
+
name + |
+String + |
+Dependency name. + |
+
file_name + |
+String + |
+Dependency file name. + |
+
description + |
+String + |
+Dependency description. + |
+
version + |
+Long + |
+Dependency version. + |
+
last_modified + |
+Long + |
+Time when the dependency was last updated. + |
+
dep_id + |
+String + |
+Dependency ID. + |
+
is_shared + |
+Boolean + |
+Whether to share the dependency version. (discarded) + |
+
Status code: 401
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 403
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 404
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 500
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Query dependencies of the current tenant.
+GET https://{Endpoint}/v2/{project_id}/fgs/ListDependencies?marker=0&maxitems=400+
Status code: 200
+ok
+{ + "dependencies" : [ { + "id" : "6578de50-9a18-48fa-b84e-b2d36636e433", + "owner" : "public", + "link" : "https://{obs_endpoint}/functionstage-examples/fg_test_pandas_1.1.3.zip", + "runtime" : "Python3.6", + "etag" : "35a893d9495b3e22259b2773996bc94d-6", + "size" : 31009808, + "name" : "panda1.1.3" + } ], + "next_marker" : 43, + "count" : 43 +}+
Status Code + |
+Description + |
+
---|---|
200 + |
+ok + |
+
401 + |
+Unauthorized. + |
+
403 + |
+Forbidden. + |
+
404 + |
+Not found. + |
+
500 + |
+Internal server error. + |
+
See Error Codes.
+This API is used to query the details about a dependency version.
+GET /v2/{project_id}/fgs/dependencies/{depend_id}/version/{version}
+ +Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. For details, see Obtaining a Project ID. + |
+
depend_id + |
+Yes + |
+String + |
+Dependency ID. + |
+
version + |
+Yes + |
+String + |
+Dependence version. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
X-Auth-Token + |
+Yes + |
+String + |
+User token. +It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. + |
+
Status code: 200
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
id + |
+String + |
+Dependency version ID. + |
+
owner + |
+String + |
+Dependency owner. + |
+
link + |
+String + |
+URL of the dependency in OBS. + |
+
runtime + |
+String + |
+Environment for executing a function. Options: Python2.7 Python 3.6 Python 3.9 Go 1.8 Go 1.x Java 8 Java 11 Node.js 6.10 Node.js 8.10 Node.js 10.16 Node.js 12.13 Node.js 14.18 C# (.NET Core 2.0) C# (.NET Core 2.1) C# (.NET Core 3.1) Custom PHP 7.3 HTTP Custom image-based functions +Enumeration values: +
|
+
etag + |
+String + |
+Unique identifier of the dependency (MD5 verification value). + |
+
size + |
+Long + |
+Dependency size. + |
+
name + |
+String + |
+Dependency name. + |
+
description + |
+String + |
+Dependency description. + |
+
file_name + |
+String + |
+Dependency file name. + |
+
version + |
+Long + |
+Dependency version. + |
+
last_modified + |
+Long + |
+Time when the dependency was last updated. + |
+
dep_id + |
+String + |
+Dependency ID. + |
+
download_link + |
+String + |
+Temporary download link of a dependency file. + |
+
is_shared + |
+Boolean + |
+Whether to share the dependency version. (discarded) + |
+
Status code: 401
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 403
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 404
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 500
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Query dependencies of the current tenant.
+GET https://{Endpoint}/v2/{project_id}/fgs/ListDependencies?marker=0&maxitems=400+
Status code: 200
+OK
+{ + "id" : "4f4ae4eb-dcdc-4dd3-bffd-79600bd972b3", + "owner" : "*****", + "link" : "https://{bucket}.{obs_endpoint}/depends/****/4f4ae4eb-dcdc-4dd3-bffd-79600bd972b3.zip", + "runtime" : "Python3.6", + "etag" : "83863be4b6c3a86aef995dbc83aae68f", + "size" : 577118, + "name" : "python-kafka", + "description" : "Python library for Kafka operations.", + "file_name" : "python-kafka.zip", + "version" : 0, + "last_modified" : 1660029887 +}+
Status Code + |
+Description + |
+
---|---|
200 + |
+OK + |
+
401 + |
+Unauthorized. + |
+
403 + |
+Forbidden. + |
+
404 + |
+Not found. + |
+
500 + |
+Internal server error. + |
+
See Error Codes.
+This API is used to delete a dependency version.
+DELETE /v2/{project_id}/fgs/dependencies/{depend_id}/version/{version}
+ +Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. For details, see Obtaining a Project ID. + |
+
depend_id + |
+Yes + |
+String + |
+Dependency ID. + |
+
version + |
+Yes + |
+String + |
+Dependence version. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
X-Auth-Token + |
+Yes + |
+String + |
+User token. +It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. + |
+
Content-Type + |
+Yes + |
+String + |
+Message body type (format). + |
+
Status code: 401
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 403
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 404
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 500
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Delete a dependency version.
+DELETE https://{Endpoint}/v2/{project_id}/fgs/dependencies/{depend_id}/version/{version}+
None
+Status Code + |
+Description + |
+
---|---|
204 + |
+No Content + |
+
401 + |
+Unauthorized. + |
+
403 + |
+Forbidden. + |
+
404 + |
+Not found. + |
+
500 + |
+Internal server error. + |
+
See Error Codes.
+This example guides you through the procedure for creating a Python 2.7 function and associating a timer trigger with it to periodically download files from an OBS bucket.
+For details about how to call APIs, see Calling APIs.
+Create a FunctionGraph function and associate a timer trigger with it to periodically download files from an OBS bucket. The procedure is as follows:
+URI: POST /v2/{project_id}/fgs/functions
+For details, see Creating a Function.
+POST https://{Endpoint}/v2/{project_id}/fgs/functions +{ + "code_filename": "index.zip", + "code_type": "inline", + "func_code": { + "file": "UEsDBAoAAAAIABESwlDHSM8cOQYAAJYRAAAIAAAAaW5kZXgucHm9V91v2zYQf9dfcXAeLKeKkrYZNgTQQ9JvpG2CJsOwJ4GWaJuLRGok5VT963dHUpZsJ82GofVDQh2Pd8e7333wAI4Oj6BQpZDLM2jt4ug3okQH8MeKS9CtlLgDdiUMGFY3FSdmDlYBKwpuDFxd3CTQqRbq1lgwDS/EogMmgS25LDq4F3YFy0rNWQWG67UoeH+04boWxgglDcRKA7NQcYZS3BkU/ADjLI0WWtVoRZ2quUmLSnBpaZn7JYi6UdrC1dy8coRt/hqtr0y65DZX8794YfMVZyXX/bF33F45+ntHfuqw5n+33Ni90188PQp005l+qUwUFa3WaFm+EBXPG4aXzZCe0iothZas5nH/rTmraBHnnj2fzTA652VpMCoYDS8KnBSMiuFMFyv3aeg7aMUA6vKoYdp2UIm5Zlpwk0Zol9fCmobLMt4zbBZFt28+Xedfrq5u8+vz2/do6eTY1s3xBPzvAF6re1kphgYxoIPgfEbhQ/0OOXgn9InSXRppvsQwopRpsRKSTWH7dwC3dAANRR9YDEupuAGpLEjOSxI4xzuvmFziF5MlQqWqiNYaJNwTZt+2srCo451mzSogiDuc4n053pCj9lvdctj7/WjtYimZ9QZM16c/+e4OBxmcnr6Eh34/WjuCKTe2qx72/g/WfkD1gZWlpmqCzneVQx5JdMnq6Ne07lb3RaXaEqmqng7ArpmQQOkIauHSjVAdqlgKvxvuiCVfsLaysGZVy9MI0/M9mljhLcKpRTAtQk5Yhb2YrzHVEiwu0vKvdnYWkdZKLZe4mfVkKjYfHS2ewaO/Ayx3Fm2lFEQJgCvLJNroZIbqO/KBI2/7ZKQP76VfM8vi6YhlOnOHjC4u2uKO28eObBims7F9byRFlZwxdufci8L4ae9KVtgWTXVlxAe9DNUFw0w9CKsIL9PeFCy2n0ncd4wJLBtrHjPle5oTWGB74l9dA0wcT2pRV+TsEIuRV9DGz0qiVD22L1B9iIcwp1xrpePJNbU9jsCywOVaaCVrqulrrNJsXiGIB/mE/UFwOpltRGqOpUXC/5QWeR/9iQ2dYUxYuRbGJ2Ab0D7GFzRarQXFZt7tJCCeKPm8XZInGi3QgBpRhEOBcVoptUdCsS6KNQ+Mfbqko4xIhVyoGCaHh4eD/WT0GUzg2UCa7Z3pj4RLngX28Ik3jnYzyHJqmkx3cH7pjL253B54UjjfzDcYWhoCsMOVI6YP55+89exuG5vnbv+Sd3HIp539G15gIP1+jy6SgW134kAV1o9B6S1DcJbb5iKYC0aelmrrbgleLCGhVt1hAV0xg5y4UM4TmGYwgtJmonsQcz9HbbQ3cEhom1AdtkaPUCEstlsqbpu5LB5VtGRATTJCRIL+xu+7We/+uBeTwYuTExeEEeH5bAiFqNHW3Ihv1OQKVuUDIR5DrudXrW1aqqSTW8wBP1KOC55pnTMXbVV1m6slDpKUNE4R4s8h2up40DZDygQuLya7KHEZ4dXuRdGTHRWn3EeLVW/fzqy3cAh4CBtPHaCG+d0ZknoaenM8RlIj3QoqDsQ6Cf3ER1HthPPMw+cWx3J8G6DTNy+E2GM2v+NdLsrM8bs0zIeNzNwl0U7XFSb3A2Xm/yVuNOA629izmfiyzSqBYRTKhmUCfjLO/L/EmCpHUfiWyt4yjAYew2Eloz97dtTsKz5ErO7yQrXSZr8kYEXNMZ7Zi5OQNR/V+F0yTolAil0Rwtnfdg3PpvggqETBqAwffxPNNMwpuF/hENYi0DLqaAl2xQbDYvxXBP/qV7BixXMSqFUV5PTiS2EaZQQp3tnBKuDeqf9JFfqQ3o0fSneqd4Z/821VBv/eizWNmNkU7ysWOb73xELwEnMKm10wB+mtfGynZrZYDZ8SFyNa32wI6TcWX3b1B/mJ14hotMSF2W1TAhB0r/3LcOcB9qxHduSzzDTE41FNHSTkxJAK2U5W4C72l2yTH31+krpsrPsJHy93EJRtYyyB4OWsd3fywMWzfVIIkpsF4il1702Q3HXPYJq4RWDsCw2xEzn15XlG3qY6sVOI+xuGuv2Us/v90HtesapoK2a5GUowTpChauFr4fIi9B7fBfpnPDprSzupm8ExPD95cTq+BTFF/wBQSwECHgMKAAAACAAREsJQx0jPHDkGAACWEQAACAAAAAAAAAAAAAAA8wIAAAAAaW5kZXgucHlQSwUGAAAAAAEAAQA2AAAAXwYAAAAA" + }, + "func_name": "download_file_from_obs", + "handler": "index.handler", + "memory_size": 256, + "package": "default", + "runtime": "Python2.7", + "timeout": 30 +}+
{ + "func_urn": "urn:fss:{project_name}:{project_id}:function:default:download_file_from_obs:latest", + "func_name": "download_file_from_obs", + "domain_id": "89fexxxd636", + "namespace": "{project_id}", + "project_name": "xxx", + "package": "default", + "runtime": "Python2.7", + "timeout": 30, + "handler": "index.handler", + "memory_size": 256, + "cpu": 400, + "code_type": "inline", + "code_filename": "index.zip", + "code_size": 1707, + "digest": "68891a6778848a78bd37a8c0798c91d75a5c87aee6e901303047a52edf05bf2170aac4149d79b3f6a40efe78406a83bf6d8683e7b25da4f0c07e7493aa4ccdcd", + "version": "latest", + "image_name": "latest-200603162219@zr2ym", + "last_modified": "2020-06-03T16:22:19+08:00", + "strategy_config": { + "concurrency": -1 + }, + "StrategyConfig": {}, + "enterprise_project_id": "0" +}+
Record the URN of the function, that is, the value of func_urn in the response.
+URI: PUT /v2/{project_id}/fgs/functions/{function_urn}/config
+For details, see Modifying the Metadata of a Function.
+PUT https://{Endpoint}/v2/{project_id}/fgs/functions/{function_urn}/config +{ + "func_name": "download_file_from_obs", + "handler": "index.handler", + "memory_size": 256, + "runtime": "Python2.7", + "timeout": 30, + "user_data": "{\"obs_address\":\"obs.xxx.xxx.com\",\"srcBucket\":\" xxx\",\"srcObjName\":\"xxx\"}", + "xrole": "xxx" +}+
function_urn indicates the function URN recorded in Step 1: Create a Function for Downloading Files from OBS; obs_address indicates the OBS address; srcBucket indicates the name of an OBS bucket, srcObjName indicates a file name, and xrole indicates an agency name.
+{ + "func_urn": "urn:fss:{project_name}:{project_id}:function:default:download_file_from_obs:latest", + "func_name": "download_file_from_obs", + "domain_id": "89fexxxd636", + "namespace": "{project_id}", + "project_name": "xxx", + "package": "default", + "runtime": "Python2.7", + "timeout": 30, + "handler": "index.handler", + "memory_size": 256, + "cpu": 400, + "code_type": "inline", + "code_filename": "index.zip", + "code_size": 1707, + "user_data": "{\"obs_address\":\"obs.xxx.xxx.com\",\"srcBucket\":\"xxx\",\"srcObjName\":\"xxx\"}", + "digest": "68891a6778848a78bd37a8c0798c91d75a5c87aee6e901303047a52edf05bf2170aac4149d79b3f6a40efe78406a83bf6d8683e7b25da4f0c07e7493aa4ccdcd", + "version": "latest", + "image_name": "latest-200603165355@varrp", + "xrole": "xxx", + "app_xrole": "xxx", + "last_modified": "2020-06-03T17:25:03+08:00", + "strategy_config": { + "concurrency": -1 + }, + "StrategyConfig": {}, + "enterprise_project_id": "0" +}+
URI: POST /v2/{project_id}/fgs/functions/{function_urn}/invocations
+For details, see Executing a Function Synchronously.
+POST https://{Endpoint}/v2/{project_id}/fgs/functions/{function_urn}/invocations +{ + "message": "download file" +}+
function_urn indicates the function URN recorded in Step 1: Create a Function for Downloading Files from OBS.
+"The object downloaded successfully from OBS, and the size is 14 KB"+
URI: POST /v2/{project_id}/fgs/triggers/{function_urn}
+For details, see Creating a Trigger.
+POST https://{Endpoint}/v2/{project_id}/fgs/triggers/{function_urn} +{ + "event_data": { + "name": "Timer-download", + "schedule_type": "Rate", + "schedule": "1d" + }, + "event_type_code": "MessageCreated", + "trigger_status": "ACTIVE", + "trigger_type_code": "TIMER" +}+
function_urn indicates the function URN recorded in Step 1: Create a Function for Downloading Files from OBS.
+The preceding example request is used to download files from the specified OBS bucket every day.
+{ + "trigger_id": "461bbe95-c85b-4dc9-a306-9701e77f1d66", + "trigger_type_code": "TIMER", + "trigger_status": "ACTIVE", + "event_data": { + "name": "Timer-download", + "schedule": "1d", + "schedule_type": "Rate" + }, + "last_updated_time": "2020-06-04T10:33:30+08:00", + "created_time": "2020-06-04T10:33:30+08:00" +}+
This example guides you through the procedure for creating a Python 2.7 function and associating an APIG trigger with it to obtain a static web page.
+For details about how to call APIs, see Calling APIs.
+You have created an API group in APIG, and have recorded the ID and subdomain name of the API group.
+Create a FunctionGraph function and associate an APIG trigger with it to obtain a static web page. The procedure is as follows:
+URI: POST /v2/{project_id}/fgs/functions
+For details, see Creating a Function.
+POST https://{Endpoint}/v2/{project_id}/fgs/functions +{ + "code_filename": "index.zip", + "code_type": "inline", + "func_code": { + "file": "UEsDBAoAAAAIABY7vFD7lxPkAgMAALoHAAAIAAAAaW5kZXgucHndVdtu00AQfc9XrMKDExQ7zqW50VYqFZRKIFUQhFBVobU9iU1tr9mdbRKqSHwNH8aXMLtxrgoS8ISIosg7c+bszNnjzRPmPnVZKKIkn440TtyBCVQcx6mMY2ATkaZiRjmWKMZzdnFzfcXgAXJkYsI4UzwrUoLpPMRE5B77KDQLCYigkGFMVescCxZMQQq0IDokcl4kruVyEYiGI5TU66VXqTxWGKvGiMUbwFhE1RGrXr0YVxsmXHCMTaBpNmvGQK1uEzdc8gwQpCKIYTFxKeYLU7HCUnBp8V80yMU7lNTYsbKcIqaKfjclMfBoDzR3FfKpxZl2bCMUfiXomWIz7GU5tNXw3oM5hBrBpfE9rdwZod22xzP+VeR8prxQZOvq9wqkezElTQxHqrkrCb1wjSBN32v5rPZa8zrLp/NPlG22fN8fbJsMRGTH/fHtO31X2kigaRVeihxhjtv+j3Zfgq+t7lHU7XT6nV479NthP+r328Mh9Af9QSuAoBu01kU016qg2wq6J8A7bt8PTtxWC3pu0A8itzcMTjiHgEiGZbNL67gkK4QkZ6n102cl8vVzwBX0upVKBBMW8zxKQdasXRpkXztMfWQbKOgckTl02CEoxcoZ2ESKzFiOvCeT6RSkU7FwlItVnfmQvIXIFYwXBbCzlR1vnaP+cO5unV24c2dZYB5Cgb9kdKh9rlMsN08mBwBCxJilzpbALN+WGCJ43CTMx6FjQ60uRQTOiLV9v7GfTtRzK9uLnF5xiAgzlhoOQKWXndEBuT1NaxTzilJ7K3vM6V2jnp6xMOZSAZ7Za6O6V7o82MI4kfhXZ+gFvS7YhmrOqaE6P41b5x8gJecDQ8E0TfqyvDauJC/i0yYBTu225059y73ckRm1zK1hvEhnhart6lZfqQ3pMb1NzY7eZvkP6c2LIk1CbqRomtb+UufH6j3Yu+CBpxqqy99VcVeNjYoKtnKVfv7fHXqTAmXMTaNQ6hDtH5iWKZslGDN7QbBiczfsmezMEDT2Q0bWP/TzgdD1n1BLAQIeAwoAAAAIABY7vFD7lxPkAgMAALoHAAAIAAAAAAAAAAAAAADzAgAAAABpbmRleC5weVBLBQYAAAAAAQABADYAAAAoAwAAAAA=" + }, + "func_name": "get_html", + "handler": "index.handler", + "memory_size": 256, + "package": "default", + "runtime": "Python2.7", + "timeout": 5 +}+
{ + "func_urn": "urn:fss:{project_name}:{project_id}:function:default:get_html:latest", + "func_name": "get_html", + "domain_id": "89fexxxd636", + "namespace": "{project_id}", + "project_name": "xxx", + "package": "default", + "runtime": "Python2.7", + "timeout": 5, + "handler": "index.handler", + "memory_size": 256, + "cpu": 400, + "code_type": "inline", + "code_filename": "index.zip", + "code_size": 884, + "digest": "b08fef5e97dd130037978db07f0e9109aa43a191517cd1196bcab822f17dddcf37f7506a15691177962f9803ba6d170a1c87aafb4fa1b9f0d07f9415642b26d2", + "version": "latest", + "image_name": "latest-200604105808@we0qo", + "last_modified": "2020-06-04T10:58:08+08:00", + "strategy_config": { + "concurrency": -1 + }, + "StrategyConfig": {}, + "enterprise_project_id": "0" +}+
Record the URN of the function, that is, the value of func_urn in the response.
+URI: POST /v2/{project_id}/fgs/triggers/{function_urn}
+For details, see Creating a Trigger.
+POST https://{Endpoint}/v2/{project_id}/fgs/triggers/{function_urn} +{ + "event_data": { + "group_id": "a9ad0d5df4d7475c9bc35a7c17d89304", + "env_id": "DEFAULT_ENVIRONMENT_RELEASE_ID", + "auth": "NONE", + "protocol": "HTTP", + "name": "API_GetHtml", + "path": "/test", + "match_mode": "SWA", + "req_method": "ANY", + "backend_type": "FUNCTION", + "sl_domain": "a9ad0d5df4d7475c9bc35a7c17d89304.apig.xxx.xxxapis.com", + "type": 1, + "env_name": "RELEASE" + }, + "event_type_code": "APICreated", + "trigger_status": "ACTIVE", + "trigger_type_code": "APIG" +}+
function_urn indicates the function URN recorded in Step 1: Create a Function to Return a Static Web Page, group_id indicates an API group ID, and sl_domain indicates the subdomain name that APIG allocates to the API group.
+{ + "trigger_id": "1b3ec74b86454aa39001a9f89cc70ee2", + "trigger_type_code": "APIG", + "trigger_status": "ACTIVE", + "event_data": { + "api_id": "cbc698153d1f4265bdd8384b5cf6e581", + "api_name": "API_GetHtml", + "auth": "NONE", + "env_id": "", + "env_name": "", + "func_info": { + "function_urn": "urn:fss:{project_name}:{project_id}:function:default:get_html", + "invocation_type": "sync", + "timeout": 5000, + "version": "latest" + }, + "group_id": "a9ad0d5df4d7475c9bc35a7c17d89304", + "group_name": "APIGroup_gethtml", + "invoke_url": "http://a9ad0d5df4d7475c9bc35a7c17d89304.apig.xxx.xxxapis.com/test", + "match_mode": "SWA", + "name": "API_GetHtml", + "path": "/test", + "protocol": "HTTP", + "req_method": "ANY", + "triggerid": "1b3ec74b86454aa39001a9f89cc70ee2", + "type": 1 + }, + "last_updated_time": "2020-06-04T17:14:32+08:00", + "created_time": "2020-06-04T17:14:32+08:00" +}+
Record the value of invoke_url.
+Enter the value of invoke_url in the address bar of a browser to obtain a static web page.
+This example guides you through the procedure for uploading local code to an OBS bucket and creating a Python 2.7 function using the link URL of the OBS bucket.
+For details about how to call APIs, see Calling APIs.
+An OBS bucket has been created.
+After writing function code in your local environment, upload the code file to an OBS bucket and use the link URL of the OBS bucket to create a function. The procedure is as follows:
+Open a text editor, compile a HelloWorld function, and save the code file as helloworld.py. The code is as follows:
+def printhello(): + print 'Hello world!'+
Open a text editor, define a function, and save the function file as index.py under the same directory as the helloworld.py file. The function code is as follows:
+import json +import helloworld + +def handler (event, context): + output =json.dumps(event) + helloworld.printhello() + return output+
URI: POST /v2/{project_id}/fgs/functions
+For details, see Creating a Function.
+POST https://{Endpoint}/v2/{project_id}/fgs/functions +{ + "code_type": "obs", + "code_url": "https://test.obs.xxx.xxx.com/fss_examples_python2.7.zip", + "func_name": "create_function_from_obs", + "handler": "index.handler", + "memory_size": 256, + "package": "default", + "runtime": "Python2.7", + "timeout": 30 +}+
code_url indicates the link URL of the OBS bucket recorded in 2.
+{ + "func_urn": "urn:fss:{project_name}:{project_id}:function:default:create_function_from_obs:latest", + "func_name": "create_function_from_obs", + "domain_id": "0503xxxa960", + "namespace": "{project_id}", + "project_name": "xxx", + "package": "default", + "runtime": "Python2.7", + "timeout": 30, + "handler": "index.handler", + "memory_size": 256, + "cpu": 400, + "code_type": "obs", + "code_url": "https://test.obs.xxx.xxx.com/fss_examples_python2.7.zip", + "code_filename": "fss_examples_python2.7.zip", + "code_size": 436, + "digest": "3af770ada27514564b1a20d964cba4b35f432fa40f9fc4f4f7c1f0d2f42eac6cb4db1358c195235966b05f66b4664e7bf31c3f384a9066b3d1fcc3e96b4c3f65", + "version": "latest", + "image_name": "latest-200619100734@gjf4p", + "last_modified": "2020-06-19T10:07:34+08:00", + "strategy_config": { + "concurrency": -1 + }, + "StrategyConfig": {}, + "enterprise_project_id": "0" +}+
This section describes the structure of a REST API request, and uses the Identity and Access Management (IAM) API for obtaining a user token as an example to demonstrate how to call an API. The obtained token can then be used to authenticate the calling of other APIs.
+A request URI is in the following format:
+{URI-scheme} :// {Endpoint} / {resource-path} ? {query-string}
+Although a request URI is included in the request header, most programming languages or frameworks require the request URI to be transmitted separately.
+ +Parameter + |
+Description + |
+
---|---|
URI-scheme + |
+Protocol used to transmit requests. All APIs use HTTPS. + |
+
Endpoint + |
+Domain name or IP address of the server bearing the REST service. The endpoint varies between services in different regions. It can be obtained from Regions and Endpoints. + |
+
resource-path + |
+Resource path, that is, an API access path. Obtain the path from the URI of an API. For example, the resource-path of the API used to obtain a user token is /v3/auth/tokens. + |
+
query-string + |
+Query parameter, which is optional. Ensure that a question mark (?) is included before each query parameter that is in the format of "Parameter name=Parameter value". For example, ?limit=10 indicates that a maximum of 10 data records will be displayed. + |
+
To simplify the URI display in this document, each API is provided only with a resource-path and a request method. The URI-scheme of all APIs is HTTPS, and the endpoints of all APIs in the same region are identical.
+The HTTP protocol defines the following request methods that can be used to send a request to the server:
+For example, in the case of the API used to obtain a user token, the request method is POST. The request is as follows:
+You can also add additional header fields to a request, such as the fields required by a specified URI or HTTP method. For example, to request for the authentication information, add Content-Type, which specifies the request body type.
+Common request header fields are as follows:
+In addition to supporting token-based authentication, public cloud APIs also support authentication using access key ID/secret access key (AK/SK). During AK/SK-based authentication, an SDK is used to sign the request, and the Authorization (signature information) and X-Sdk-Date (time when the request is sent) header fields are automatically added to the request.
+For more details, see .
+The API used to obtain a user token does not require authentication. Therefore, only the Content-Type field needs to be added to requests for calling the API. An example of such requests is as follows:
+The body of a request is often sent in a structured format as specified in the Content-Type header field. The request body transfers content except the request header.
+The request body varies between APIs. Some APIs do not require the request body, such as the APIs requested using the GET and DELETE methods.
+In the case of the API used to obtain a user token, the request parameters and parameter description can be obtained from the API request. The following provides an example request with a body included. Replace username, domainname, ******** (login password), and xxxxxx (project ID) with the actual values. To learn how to obtain a project ID, see Regions and Endpoints.
+The scope parameter specifies where a token takes effect. You can set scope to an account or a project under an account. In the following example, the token takes effect only for the resources in a specified project. For more information about this API, see section "Obtaining a User Token".
++ +Content-Type: application/json + +{ + "auth": { + "identity": { + "methods": [ + "password" + ], + "password": { + "user": { + "name": "username", + "password": "********", + "domain": { + "name": "domainname" + } + } + } + }, + "scope": { + "project": { + "name": "xxxxxxxxxxxxxxxxxx" + } + } + } +}+ +
If all data required for the API request is available, you can send the request to call the API through curl, Postman, or coding. In the response to the API used to obtain a user token, x-subject-token is the desired user token. This token can then be used to authenticate the calling of other APIs.
+After sending a request, you will receive a response, including a status code, response header, and response body.
+A status code is a group of digits, ranging from 1xx to 5xx. It indicates the status of a request. For more information, see Status Codes.
+For example, if status code 201 is returned for calling the API used to obtain a user token, the request is successful.
+Similar to a request, a response also has a header, for example, Content-Type.
+Figure 1 shows the response header fields for the API used to obtain a user token. The x-subject-token header field is the desired user token. This token can then be used to authenticate the calling of other APIs.
+ +The body of a response is often returned in structured format as specified in the Content-Type header field. The response body transfers content except the response header.
+The following is part of the response body for the API used to obtain a user token.
+{ + "token": { + "expires_at": "2019-02-13T06:52:13.855000Z", + "methods": [ + "password" + ], + "catalog": [ + { + "endpoints": [ + { + "region_id": "XXXXXXXX", +...... ++
If an error occurs during API calling, an error code and a message will be displayed. The following shows an error response body.
+{ + "error_code": "FGS.0111", + "error_msg": "xxxxxxxxx" +}+
In the response body, error_code is an error code, and error_msg provides information about the error.
+Requests for calling an API can be authenticated using either of the following methods:
+The validity period of a token is 24 hours. When using a token for authentication, cache it to prevent frequently calling the Identity and Access Management (IAM) API used to obtain a user token.
+A token specifies temporary permissions in a computer system. During API authentication using a token, the token is added to requests to get permissions for calling the API.
+In Making an API Request, the process of calling the API used to obtain a user token is described. After a token is obtained, the X-Auth-Token header field must be added to requests to specify the token when other APIs are called. For example, if the token is ABCDEFJ...., X-Auth-Token: ABCDEFJ.... can be added to a request as follows:
+When calling APIs, you need to enter a project ID in some URLs. To obtain a project ID, perform the following steps:
+On the My Credentials page, view the project ID.
+A project ID can also be obtained by calling a specific API. For details, see Querying Project Information.
+The API used to obtain a project ID is GET https://{Endpoint}/v3/projects, where {Endpoint} indicates the IAM endpoint. You can obtain the IAM endpoint from Regions and Endpoints. For details on API calling authentication, see Authentication.
+The following is an example response. The value of id in the projects section is the project ID.
+{ + "projects": [ + { + "domain_id": "65382450e8f64ac0870cd180d14e684b", + "is_domain": false, + "parent_id": "65382450e8f64ac0870cd180d14e684b", + "name": "xxx", + "description": "", + "links": { + "next": null, + "previous": null, + "self": "https://www.example.com/v3/projects/a4a5d4098fb4474fa22cd05f897d6b99" + }, + "id": "a4a5d4098fb4474fa22cd05f897d6b99", + "enabled": true + } + ], + "links": { + "next": null, + "previous": null, + "self": "https://www.example.com/v3/projects" + } +}+
This API is used to update the maximum number of instances of a function.
+PUT /v2/{project_id}/fgs/functions/{function_urn}/config-max-instance
+ +Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. For details, see Obtaining a Project ID. + |
+
function_urn + |
+Yes + |
+String + |
+Function URN. For details, see the function model description. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
X-Auth-Token + |
+Yes + |
+String + |
+User token. +It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. + |
+
Content-Type + |
+Yes + |
+String + |
+Message body type (format). + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
max_instance_num + |
+No + |
+Integer + |
+Maximum number of instances. -1 indicates that the number of instances is unlimited, and 0 indicates that the function is disabled. + |
+
Status code: 200
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
func_urn + |
+String + |
+Function URN. + |
+
func_name + |
+String + |
+Function name. + |
+
domain_id + |
+String + |
+Domain ID. + |
+
namespace + |
+String + |
+Project ID. + |
+
project_name + |
+String + |
+Project name. + |
+
package + |
+String + |
+Group to which the function belongs. This field is defined to group functions. + |
+
runtime + |
+String + |
+Environment for executing a function. Options: Python2.7 Python 3.6 Python 3.9 Go 1.8 Go 1.x Java 8 Java 11 Node.js 6.10 Node.js 8.10 Node.js 10.16 Node.js 12.13 Node.js 14.18 C# (.NET Core 2.0) C# (.NET Core 2.1) C# (.NET Core 3.1) Custom PHP 7.3 HTTP Custom image-based functions +Enumeration values: +
|
+
timeout + |
+Integer + |
+Maximum duration the function can be executed. Value range: 3s–259,200s. + |
+
handler + |
+String + |
+Handler of a function in the format of "xx.xx". It must contain a period (.). +For example, for Node.js function myfunction.handler, the file name is myfunction.js, and the handler function is handler. + |
+
memory_size + |
+Integer + |
+Memory consumed by a function. +Unit: MB. +The value can be 128, 256, 512, 768, 1024, 1280, 1536, 1792, 2048, 2560, 3072, 3584 or 4096. +The value ranges from 128 to 4096. + |
+
cpu + |
+Integer + |
+CPU resources of a function. Unit: millicore (1 core = 1000 millicores). The value of this field is proportional to that of MemorySize. By default, 100 CPU millicores are required for 128 MB memory. + |
+
code_type + |
+String + |
+Function code type. Options: inline: inline code zip: ZIP file obs: function code stored in an OBS bucket jar: JAR file, mainly for Java functions Custom-Image-Swr: The function code comes from the SWR custom image. +Enumeration values: +
|
+
code_url + |
+String + |
+If CodeType is set to obs, enter the OBS URL of the function code package. If CodeType is not set to obs, leave this parameter blank. + |
+
code_filename + |
+String + |
+Name of a function file. This parameter is mandatory only when CodeType is set to jar or zip. + |
+
code_size + |
+Long + |
+Code size in bytes. + |
+
user_data + |
+String + |
+Name/Value information defined for the function. +These are parameters used in a function. +For example, if a function needs to access a host, define Host={host_ip}. You can define a maximum of 20 such parameters, and their total length cannot exceed 4 KB. + |
+
encrypted_user_data + |
+String + |
+User-defined name/value to be encrypted. + |
+
digest + |
+String + |
+SHA512 hash value of function code, which is used to determine whether the function has changed. + |
+
version + |
+String + |
+Function version, which is automatically generated by the system. The version name is in the format of "vYYYYMMDD-HHMMSS" (v+year/month/day-hour/minute/second). + |
+
image_name + |
+String + |
+Internal identifier of a function version. + |
+
xrole + |
+String + |
+Agency used by the function. You need to create an agency on the IAM console. This field is mandatory when a function needs to access other services. After specifying a function execution agency, you can use the context method in the function handler to obtain a token, an AK, and an SK for accessing other cloud services. No agency is required if FunctionGraph does not access any cloud services. + |
+
app_xrole + |
+String + |
+Execution agency. You can optimize performance by configuring a separate agency for function execution, otherwise, the same agency is used for both execution and configuration. + |
+
description + |
+String + |
+Function description. + |
+
last_modified + |
+String + |
+Time when the function was last updated. + |
+
func_vpc + |
+FuncVpc object + |
+VPC configuration. An agency with VPC permissions must be configured for the function. + |
+
mount_config + |
+MountConfig object + |
+Mounting configuration. + |
+
strategy_config + |
+StrategyConfig object + |
+Function policy configuration. + |
+
dependencies + |
+Array of Dependency objects + |
+Dependency packages. + |
+
initializer_handler + |
+String + |
+Initializer of the function in the format of "xx.xx". It must contain a period (.). This parameter is mandatory when the initialization function is configured. For example, for Node.js function myfunction.initializer, the file name is myfunction.js, and the initialization function is initializer. + |
+
initializer_timeout + |
+Integer + |
+Maximum duration the function can be initialized. Value range: 1s–300s. This parameter is mandatory when the initialization function is configured. + |
+
pre_stop_handler + |
+String + |
+The pre-stop handler of a function. The value must contain a period (.) in the format of xx.xx. For example, for Node.js function myfunction.pre_stop_handler, the file name is myfunction.js, and the initialization function is pre_stop_handler. + |
+
pre_stop_timeout + |
+Integer + |
+Maximum duration the function can be initialized. Value range: 1s–90s. + |
+
enterprise_project_id + |
+String + |
+Enterprise project ID. This parameter is mandatory if you create a function as an enterprise user. + |
+
long_time + |
+Boolean + |
+Whether to allow a long timeout. + |
+
log_group_id + |
+String + |
+Log group ID. + |
+
log_stream_id + |
+String + |
+Log stream ID. + |
+
type + |
+String + |
+v2 indicates an official version, and v1 indicates a deprecated version. +Enumeration values: +
|
+
enable_cloud_debug + |
+String + |
+Whether to enable cloud debugging to adapt to the CloudDebug scenario. (discarded) + |
+
enable_dynamic_memory + |
+Boolean + |
+Whether to enable dynamic memory allocation. + |
+
is_stateful_function + |
+Boolean + |
+Whether stateful functions are supported. This parameter is supported in FunctionGraph v2. + |
+
domain_names + |
+String + |
+Private domain name configured for resolution. + |
+
is_return_stream + |
+Boolean + |
+Whether to return stream data. (discarded) + |
+
enable_auth_in_header + |
+Boolean + |
+Whether to add authentication information to request header for custom image-based functions. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
domain_id + |
+String + |
+Domain name ID. + |
+
namespace + |
+String + |
+Project ID. + |
+
vpc_name + |
+String + |
+VPC name. + |
+
vpc_id + |
+String + |
+VPC ID. + |
+
subnet_name + |
+String + |
+Subnet name. + |
+
subnet_id + |
+String + |
+Subnet ID. + |
+
cidr + |
+String + |
+Subnet mask. + |
+
gateway + |
+String + |
+Gateway. + |
+
security_groups + |
+Array of strings + |
+Security group. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
mount_user + |
+MountUser object + |
+User information. + |
+
func_mounts + |
+Array of FuncMount objects + |
+Mounted resources. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
user_id + |
+String + |
+User ID, a non-0 integer from –1 to 65534. + |
+
user_group_id + |
+String + |
+User group ID, a non-0 integer from –1 to 65534. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
mount_type + |
+String + |
+Mount type. The value can be sfs, sfsTurbo, or ecs. This parameter is mandatory when func_mounts is not empty. + |
+
mount_resource + |
+String + |
+ID of the mounted resource (cloud service ID). This parameter is mandatory when func_mounts is not empty. + |
+
mount_share_path + |
+String + |
+Remote mount path. For example, 192.168.0.12:/data. This parameter is mandatory if mount_type is set to ecs. + |
+
local_mount_path + |
+String + |
+Function access path. This parameter is mandatory when func_mounts is not empty. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
concurrency + |
+Integer + |
+Maximum number of instances for a single function. For v1, the value can be 0 or –1; for v2, it ranges from –1 to 1000. +
|
+
concurrent_num + |
+Integer + |
+Number of concurrent requests per instance. This parameter is supported only by v2. The value ranges from 1 to 1,000. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
id + |
+String + |
+Dependency version ID. + |
+
owner + |
+String + |
+Domain ID of the dependency owner. + |
+
link + |
+String + |
+URL of the dependency on OBS. + |
+
runtime + |
+String + |
+Environment for executing a function. Options: Python2.7 Python 3.6 Python 3.9 Go 1.8 Go 1.x Java 8 Java 11 Node.js 6.10 Node.js 8.10 Node.js 10.16 Node.js 12.13 Node.js 14.18 C# (.NET Core 2.0) C# (.NET Core 2.1) C# (.NET Core 3.1) Custom PHP 7.3 HTTP Custom image-based functions +Enumeration values: +
|
+
etag + |
+String + |
+MD5 value of a dependency. + |
+
size + |
+Long + |
+Dependency size. + |
+
name + |
+String + |
+Dependence name. + |
+
description + |
+String + |
+Dependency description. + |
+
file_name + |
+String + |
+File name of a dependency package (ZIP). + |
+
version + |
+Long + |
+Dependency version ID. + |
+
dep_id + |
+String + |
+Dependency ID. + |
+
last_modified + |
+String + |
+Time when the function was last updated. + |
+
Status code: 400
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 401
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 403
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 404
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 500
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Update the maximum number of instances of a function to 300.
+PUT https://{Endpoint}/v2/{project_id}/fgs/functions/{function_urn}/config-max-instance + +{ + "max_instance_num" : 300 +}+
Status code: 200
+OK
+{ + "func_urn" : "urn:fss:xxxxxxxx:7aad83af3e8d42e99ac194e8419e2c9b:function:default:test", + "func_name" : "test", + "domain_id" : "14ee2e3501124efcbca7998baa24xxxx", + "namespace" : "46b6f338fc3445b8846c71dfb1fbxxxx", + "project_name" : "xxxxxx", + "package" : "default", + "runtime" : "Node.js6.10", + "timeout" : 3, + "handler" : "fssExampleCsharp2.1::fssExampleCsharp21.Program::MyFunc", + "memory_size" : 128, + "cpu" : 300, + "code_type" : "inline", + "code_filename" : "index.js", + "code_size" : 272, + "digest" : "faa825575c45437cddd4e369bea69893bcbe195d478178462ad90984fe72993f3f59d15f41c5373f807f3e05fb9af322c55dabeb16565c386e402413458e6068", + "version" : "latest", + "image_name" : "latest-191025153727@zehht", + "last_modified" : "2019-10-25 15:37:27", + "strategy_config" : { + "concurrency" : 300, + "concurrent_num" : 1 + } +}+
Status Code + |
+Description + |
+
---|---|
200 + |
+OK + |
+
400 + |
+Bad request. + |
+
401 + |
+Unauthorized. + |
+
403 + |
+Forbidden. + |
+
404 + |
+Not found. + |
+
500 + |
+Internal server error. + |
+
See Error Codes.
+This API is used to query resources.
+POST /v2/{project_id}/{resource_type}/resource-instances/{action}
+ +Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. For details, see Obtaining a Project ID. + |
+
resource_type + |
+Yes + |
+String + |
+Resource type. Enter functions here. + |
+
action + |
+Yes + |
+String + |
+Filter or count. +Enumeration values: +
|
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
X-Auth-Token + |
+Yes + |
+String + |
+User token. +It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. + |
+
Content-Type + |
+Yes + |
+String + |
+Message body type (format). + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
without_any_tag + |
+No + |
+Boolean + |
+Whether to use tag-based filtering. + |
+
limit + |
+No + |
+String + |
+Number of records displayed on each page. + |
+
offset + |
+No + |
+String + |
+Query offset. + |
+
action + |
+No + |
+String + |
+Query an action. +Enumeration values: +
|
+
matches + |
+No + |
+Array of KvItem objects + |
+Query a key-value pair. + |
+
sys_tags + |
+No + |
+Array of TagItem objects + |
+Query system tags. + |
+
Status code: 200
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
resources + |
+Array of ListEnterpriseResourceResult objects + |
+Enterprise projects. + |
+
total_count + |
+Long + |
+Number of resources. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
resource_id + |
+String + |
+Resource ID. + |
+
resource_detail + |
+ListEnterpriseResourceDetail object + |
++ |
tags + |
+Array of KvItem objects + |
+Tag list. + |
+
sys_tags + |
+Array of KvItem objects + |
+System tags. + |
+
resource_name + |
+String + |
+Resource name. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
detailId + |
+String + |
+Function URN. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
key + |
+String + |
+Key. + |
+
value + |
+String + |
+Value. + |
+
Status code: 400
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 401
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 403
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 404
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 500
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Query resources.
+POST https://{Endpoint}/v2/{project_id}/{resource_type}/resource-instances/{action} + +{ + "without_any_tag" : true, + "limit" : 5, + "matches" : [ { + "key" : "resource_name", + "value" : "test_function" + } ] +}+
Status code: 200
+ok
+Example 1
+{ + "resources" : [ { + "resource_id" : "34e4516e-e324-412b-914e-c4e568c7d813", + "resource_detail" : { + "detailId" : "urn:fss:{region-id}:xxxx:function:default:test_xxx:latest" + }, + "tags" : [ ], + "sys_tags" : [ { + "key" : "_sys_enterprise_project_id", + "value" : "df5edab8-c458-4a4c-b87b-a4d3b0a757ce" + } ], + "resource_name" : "test_v2_1" + } ] +}+
Example 2
+1+
Status Code + |
+Description + |
+
---|---|
200 + |
+ok + |
+
400 + |
+Bad request. + |
+
401 + |
+Unauthorized. + |
+
403 + |
+Forbidden. + |
+
404 + |
+Not found. + |
+
500 + |
+Internal server error. + |
+
See Error Codes.
+This API is used to query resource tags.
+GET /v2/{project_id}/{resource_type}/tags
+ +Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. For details, see Obtaining a Project ID. + |
+
resource_type + |
+Yes + |
+String + |
+Resource type. Enter "functions" here. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
X-Auth-Token + |
+Yes + |
+String + |
+User token. +It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. + |
+
Content-Type + |
+Yes + |
+String + |
+Message body type (format). + |
+
Status code: 200
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
tags + |
+Array of TagItem objects + |
+Tag list. + |
+
sys_tags + |
+Array of TagItem objects + |
+System tags. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
key + |
+String + |
+Key. + |
+
values + |
+Array of strings + |
+Value. + |
+
Status code: 400
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 401
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 403
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 500
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Query resource tags.
+GET https://{Endpoint}/v2/{project_id}/{resource_type}/tags+
Status code: 200
+ok
+{ + "tags" : [ { + "key" : "xxx", + "values" : [ "yyy", "zzz" ] + } ], + "sys_tags" : [ { + "key" : "_sys_enterprise_project_id", + "values" : [ "5aa119a8-d25b-45a7-8d1b-88e127885635" ] + } ] +}+
Status Code + |
+Description + |
+
---|---|
200 + |
+ok + |
+
400 + |
+Bad request. + |
+
401 + |
+Unauthorized. + |
+
403 + |
+Forbidden. + |
+
500 + |
+Internal server error. + |
+
See Error Codes.
+This API is used to create resource tags.
+POST /v2/{project_id}/{resource_type}/{resource_id}/tags/create
+ +Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. For details, see Obtaining a Project ID. + |
+
resource_type + |
+Yes + |
+String + |
+Resource type. Enter functions here. + |
+
resource_id + |
+Yes + |
+String + |
+Resource ID. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
X-Auth-Token + |
+Yes + |
+String + |
+User token. +It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. + |
+
Content-Type + |
+Yes + |
+String + |
+Message body type (format). + |
+
Status code: 400
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Create resource tags testKey1:testValue1 and testKey2:testValue2.
+POST https://{Endpoint}/v2/{project_id}/{resource_type}/{resource_id}/tags/create + +{ + "tags" : [ { + "key" : "testKey1", + "value" : "testValue1" + }, { + "key" : "testKey2", + "value" : "testValue2" + } ], + "action" : "create" +}+
None
+Status Code + |
+Description + |
+
---|---|
204 + |
+No Content + |
+
400 + |
+Bad request. + |
+
See Error Codes.
+This API is used to delete resource tags.
+DELETE /v2/{project_id}/{resource_type}/{resource_id}/tags/delete
+ +Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. For details, see Obtaining a Project ID. + |
+
resource_type + |
+Yes + |
+String + |
+Resource type. Enter functions here. + |
+
resource_id + |
+Yes + |
+String + |
+Resource ID. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
X-Auth-Token + |
+Yes + |
+String + |
+User token. +It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. + |
+
Content-Type + |
+Yes + |
+String + |
+Message body type (format). + |
+
Status code: 400
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Delete resource tags.
+DELETE https://{Endpoint}/v2/{project_id}/{resource_type}/{resource_id}/tags/delete + +{ + "tags" : [ { + "key" : "testKey1", + "value" : "testValue1" + } ], + "action" : "delete" +}+
None
+Status Code + |
+Description + |
+
---|---|
204 + |
+No Content + |
+
400 + |
+Bad request. + |
+
See Error Codes.
+Table 1 describes the status codes.
+ +Status Code + |
+Message + |
+Description + |
+
---|---|---|
200 + |
+- + |
+The request has succeeded. + |
+
204 + |
+- + |
+The request has succeeded. + |
+
400 + |
+Bad Request + |
+The server failed to process the request. + |
+
401 + |
+Unauthorized + |
+The request requires user authentication. + |
+
403 + |
+Forbidden + |
+The server understood the request, but is refusing to fulfill it. + |
+
404 + |
+Not Found + |
+The server has not found anything matching the request URI. + |
+
405 + |
+Method Not Allowed + |
+The method specified in the request line is not allowed for the resource identified by the request URI. + |
+
406 + |
+Not Acceptable + |
+The response generated by the server cannot be accepted by the client. + |
+
407 + |
+Proxy Authentication Required + |
+The client must first authenticate itself with the proxy. + |
+
408 + |
+Request Timeout + |
+The client did not produce a request within the time that the server was prepared to wait. + |
+
409 + |
+Conflict + |
+The request could not be completed due to a conflict with the current state of the resource. + |
+
500 + |
+Internal Server Error + |
+The server encountered an unexpected condition which prevented it from fulfilling the request. + |
+
501 + |
+Not Implemented + |
+The server does not support the functionality required to fulfill the request. + |
+
502 + |
+Bad Gateway + |
+The server, while acting as a gateway or proxy, received an invalid response from the upstream server it accessed in attempting to fulfill the request. + |
+
503 + |
+Service Unavailable + |
+The server is currently unable to handle the request due to a temporary overloading or maintenance of the server. + |
+
504 + |
+Gateway Timeout + |
+Gateway timed out. + |
+
This section describes the function metrics reported to Cloud Eye.
+Their namespace and dimension are also included. You can view monitoring graphs and alarm messages on the Cloud Eye console.
+SYS.FunctionGraph
+Metric + |
+Display Name + |
+Description + |
+Unit + |
+Upper Limit + |
+Lower Limit + |
+Recommended Threshold + |
+Value Type + |
+Meaning + |
+Dimension + |
+
---|---|---|---|---|---|---|---|---|---|
count + |
+Invocations + |
+Number of times a function is invoked + |
+Count + |
+- + |
+0 + |
+- + |
+Int + |
+Number of times a function is invoked + |
+package-functionname + |
+
failcount + |
+Errors + |
+Number of errors that occur when a function is invoked + |
+Count + |
+- + |
+0 + |
+- + |
+Int + |
+Number of errors that occur when a function is invoked + |
+package-functionname + |
+
rejectcount + |
+Throttles + |
+Number of times a function is throttled when invoked + |
+Count + |
+- + |
+0 + |
+- + |
+Int + |
+Number of times a function is throttled when invoked + |
+package-functionname + |
+
duration + |
+Average Duration + |
+Average time a function is invoked + |
+ms + |
+- + |
+0 + |
+- + |
+Int + |
+Average time a function is invoked + |
+package-functionname + |
+
maxDuration + |
+Maximum Duration + |
+Maximum time a function is invoked + |
+ms + |
+- + |
+0 + |
+- + |
+Int + |
+Maximum time a function is invoked + |
+package-functionname + |
+
minDuration + |
+Minimum Duration + |
+Minimum time a function is invoked + |
+ms + |
+- + |
+0 + |
+- + |
+Int + |
+Minimum time a function is invoked + |
+package-functionname + |
+
Key + |
+Value + |
+
---|---|
package-functionname + |
+App_name-Function_name + |
+
FunctionGraph provides developers and partners with open APIs for development, deployment, hosting, and O&M, helping users quickly implement service innovations at low costs and shorten the rollout period of applications.
+FunctionGraph provides the following types of APIs:
+ +Type + |
+Description + |
+
---|---|
+ | +Execute functions synchronously or asynchronously and return reserved instance IDs. + |
+
+ | +Query quotas. + |
+
+ | +Create, delete, query, and update dependencies. + |
+
+ | +Create, delete, query, and update test events. + |
+
+ | +Create and delete functions. + |
+
+ | +Create and delete function versions and aliases. + |
+
+ | +Query function statistics, top functions for a specified metric, and metrics in a specified period. + |
+
+ | +Query a function's log group and log stream, and enable log reporting to LTS. + |
+
+ | +Query reserved instances and change their number. + |
+
+ | +Import and export functions. + |
+
+ | +Create, delete, and update triggers. + |
+
+ | +Query, delete, and configure asynchronous invocation notification settings. + |
+
FunctionGraph supports Representational State Transfer (REST) APIs, allowing you to call APIs using HTTPS. For details about API calling, see Calling APIs.
+An endpoint is the request address for calling an API. Endpoints vary depending on services and regions. For the endpoints of all services, see Regions and Endpoints.
+An account is created upon successful registration with the cloud system. The account has full access permissions for all of its cloud services and resources. It can be used to reset user passwords and grant user permissions. The account is a payment entity and should not be used directly to perform routine management. For security purposes, create Identity and Access Management (IAM) users and grant them permissions for routine management.
+An IAM user is created using an account to use cloud services. Each IAM user has its own identity credentials (password and access keys).
+The account name, username, and password will be required for API authentication.
+Regions are geographic areas isolated from each other. Resources are region-specific and cannot be used across regions through internal network connections. For low network latency and quick resource access, select the nearest region.
+An AZ comprises of one or more physical data centers equipped with independent ventilation, fire, water, and electricity facilities. Computing, network, storage, and other resources in an AZ are logically divided into multiple clusters. AZs within a region are interconnected using high-speed optical fibers to support cross-AZ high-availability systems.
+Projects group and isolate resources (including compute, storage, and network resources) across physical regions. A default project is provided for each region, and subprojects can be created under each default project. Users can be granted permissions to access all resources in a specific project. For more refined access control, create subprojects under a project and purchase resources in the subprojects. Users can then be assigned permissions to access only specific resources in the subprojects.
+This API is used to query function tags.
+GET /v2/{project_id}/{resource_type}/{resource_id}/tags
+ +Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. For details, see Obtaining a Project ID. + |
+
resource_type + |
+Yes + |
+String + |
+Resource type. Enter functions here. + |
+
resource_id + |
+Yes + |
+String + |
+Resource ID, function URN. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
X-Auth-Token + |
+Yes + |
+String + |
+User token. +It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. + |
+
Content-Type + |
+Yes + |
+String + |
+Message body type (format). + |
+
Status code: 200
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
tags + |
+Array of KvItem objects + |
+Tag list. + |
+
sys_tags + |
+Array of KvItem objects + |
+System tags. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
key + |
+String + |
+Key. + |
+
value + |
+String + |
+Value. + |
+
Status code: 400
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 401
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 403
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 500
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
This API is used to query all resource tags.
+GET /v2/{project_id}/{resource_type}/{resource_id}/tags+
Status code: 200
+ok
+{ + "tags" : [ { + "key" : "xxx", + "value" : "yyy" + } ], + "sys_tags" : [ { + "key" : "_sys_enterprise_project_id", + "value" : "5aa119a8-d25b-45a7-8d1b-88e127885635" + } ] +}+
Status Code + |
+Description + |
+
---|---|
200 + |
+ok + |
+
400 + |
+Bad request. + |
+
401 + |
+Unauthorized. + |
+
403 + |
+Forbidden. + |
+
500 + |
+Internal server error. + |
+
See Error Codes.
+This API is used to query ServiceBridge functions bound to a specified function.
+GET /v2/{project_id}/fgs/functions/{function_urn}/servicebridge/relation
+ +Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. For details, see Obtaining a Project ID. + |
+
function_urn + |
+Yes + |
+String + |
+Function URN. For details, see the function model description. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
type + |
+No + |
+String + |
+ServiceBridge type. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
X-Auth-Token + |
+Yes + |
+String + |
+User token. +It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. + |
+
Content-Type + |
+Yes + |
+String + |
+Message body type (format). + |
+
Status code: 200
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
[items] + |
+Array of ListFunctionResult objects + |
+Bridge functions bound to the function. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
resource_id + |
+String + |
+Resource ID. + |
+
func_urn + |
+String + |
+Function URN. + |
+
func_name + |
+String + |
+Function name. + |
+
domain_id + |
+String + |
+Domain ID. + |
+
namespace + |
+String + |
+Project ID. + |
+
project_name + |
+String + |
+Project name. + |
+
package + |
+String + |
+Group to which the function belongs. This field is defined to group functions. + |
+
runtime + |
+String + |
+Environment for executing a function. Options: Python2.7 Python 3.6 Python 3.9 Go 1.8 Go 1.x Java 8 Java 11 Node.js 6.10 Node.js 8.10 Node.js 10.16 Node.js 12.13 Node.js 14.18 C# (.NET Core 2.0) C# (.NET Core 2.1) C# (.NET Core 3.1) Custom PHP 7.3 HTTP Custom image-based functions +Enumeration values: +
|
+
timeout + |
+Integer + |
+Maximum duration the function can be executed. Value range: 3s–259,200s. + |
+
handler + |
+String + |
+Handler of a function in the format of "xx.xx". It must contain a period (.). +For example, for Node.js function myfunction.handler, the file name is myfunction.js, and the handler function is handler. + |
+
memory_size + |
+Integer + |
+Memory consumed by a function. +Unit: MB. +The value can be 128, 256, 512, 768, 1024, 1280, 1536, 1792, 2048, 2560, 3072, 3584 or 4096. +The value ranges from 128 to 4096. + |
+
gpu_memory + |
+Integer + |
+GPU memory. This parameter is available only for functions created with a custom runtime or image. Unit: MB. Options: 1024, 2048, 3072, 4096, 5120, 6144, 7168, 8192, 9216, 10,240, 11,264, 12,288, 13,312, 14,336, 15,360, and 16,384. Range: 1024 to 16,384. + |
+
cpu + |
+Integer + |
+CPU resources of a function. Unit: millicore (1 core = 1000 millicores). The value of this field is proportional to that of MemorySize. By default, 100 CPU millicores are required for 128 MB memory. + |
+
code_type + |
+String + |
+Function code type. Options: inline: inline code zip: ZIP file obs: function code stored in an OBS bucket jar: JAR file, mainly for Java functions Custom-Image-Swr: The function code comes from the SWR custom image. +Enumeration values: +
|
+
code_url + |
+String + |
+If CodeType is set to obs, enter the OBS URL of the function code package. If CodeType is not set to obs, leave this parameter blank. + |
+
code_filename + |
+String + |
+Name of a function file. This parameter is mandatory only when CodeType is set to jar or zip. + |
+
code_size + |
+Long + |
+Code size in bytes. + |
+
user_data + |
+String + |
+Name/Value information defined for the function. These are parameters used in the function. For example, if a function needs to access a host, define Host={host_ip}. You can define a maximum of 20 such parameters, and their total length cannot exceed 4 KB. + |
+
encrypted_user_data + |
+String + |
+User-defined name/value to be encrypted. + |
+
digest + |
+String + |
+SHA512 hash value of function code, which is used to determine whether the function has changed. + |
+
version + |
+String + |
+Function version. + |
+
image_name + |
+String + |
+Internal identifier of a function version. + |
+
xrole + |
+String + |
+Agency used by the function. You need to create an agency on the IAM console. This field is mandatory when a function needs to access other services. + |
+
app_xrole + |
+String + |
+Agency used by the function app. You need to create an agency on the IAM console. This field is mandatory when a function needs to access other services. + |
+
description + |
+String + |
+Function description. + |
+
last_modified + |
+String + |
+Time when the function was last updated. + |
+
func_vpc_id + |
+String + |
+VPC ID. + |
+
strategy_config + |
+StrategyConfig object + |
+Function policy configuration. + |
+
extend_config + |
+String + |
+Extended configuration. + |
+
initializer_handler + |
+String + |
+Initializer of the function in the format of "xx.xx". It must contain a period (.). This parameter is mandatory when the initialization function is configured. For example, for Node.js function myfunction.initializer, the file name is myfunction.js, and the initialization function is initializer. + |
+
initializer_timeout + |
+Integer + |
+Maximum duration the function can be initialized. Value range: 1s–300s. This parameter is mandatory when the initialization function is configured. + |
+
pre_stop_handler + |
+String + |
+The pre-stop handler of a function. The value must contain a period (.) in the format of xx.xx. For example, for Node.js function myfunction.pre_stop_handler, the file name is myfunction.js, and the initialization function is pre_stop_handler. + |
+
pre_stop_timeout + |
+Integer + |
+Maximum duration the function can be initialized. Value range: 1s–90s. + |
+
enterprise_project_id + |
+String + |
+Enterprise project ID. This parameter is mandatory if you create a function as an enterprise user. + |
+
long_time + |
+Boolean + |
+Whether to allow a long timeout. + |
+
log_group_id + |
+String + |
+Log group ID. + |
+
log_stream_id + |
+String + |
+Log stream ID. + |
+
type + |
+String + |
+v2 indicates an official version, and v1 indicates a deprecated version. +Enumeration values: +
|
+
is_bridge_function + |
+Boolean + |
+Whether this is a bridge function. + |
+
bind_bridge_funcUrns + |
+Array of strings + |
+URNs bound to the bridge function. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
concurrency + |
+Integer + |
+Maximum number of instances for a single function. For v1, the value can be 0 or –1; for v2, it ranges from –1 to 1000. +
|
+
concurrent_num + |
+Integer + |
+Number of concurrent requests per instance. This parameter is supported only by v2. The value ranges from 1 to 1,000. + |
+
Status code: 401
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 403
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 404
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 500
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Query ServiceBridge functions bound to a specified function.
+GET https://{Endpoint}/v2/{project_id}/fgs/functions/{function_urn}/servicebridge/relation?type=rds+
Status code: 200
+ok
+[ { + "func_urn" : "urn:fss:xxxxxxxxx:7aad83af3e8d42e99ac194e8419e2c9b:function:default:test", + "func_name" : "bridge-test", + "domain_id" : "cff01_hk", + "namespace" : "7aad83af3e8d42e99ac194e8419e2c9b", + "project_name" : "xxxxxxxx", + "package" : "default", + "runtime" : "Node.js6.10", + "timeout" : 3, + "handler" : "test.handler", + "memory_size" : 128, + "cpu" : 300, + "code_type" : "inline", + "code_filename" : "index.js", + "code_size" : 272, + "digest" : "decbce6939297b0b5ec6d1a23bf9c725870f5e69fc338a89a6a4029264688dc26338f56d08b6535de47f15ad538e22ca66613b9a46f807d50b687bb53fded1c6", + "version" : "latest", + "xrole" : "cff", + "image_name" : "latest-191025153727@zehht", + "last_modified" : "2019-10-25 15:37:27", + "strategy_config" : { + "concurrency" : 0 + }, + "initializer_handler" : "index.initializer", + "initializer_timeout" : 3, + "pre_stop_handler" : "index.pre_stop_handler", + "pre_stop_timeout" : 3 +} ]+
Status Code + |
+Description + |
+
---|---|
200 + |
+ok + |
+
401 + |
+Unauthorized. + |
+
403 + |
+Forbidden. + |
+
404 + |
+Not found. + |
+
500 + |
+Internal server error. + |
+
See Error Codes.
+This API is used to query the available ServiceBridge version.
+GET /v2/{project_id}/fgs/servicebridge/version
+ +Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. For details, see Obtaining a Project ID. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
type + |
+Yes + |
+String + |
+ServiceBridge type. The value can be rds, mqs, or cache. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
X-Auth-Token + |
+Yes + |
+String + |
+User token. +It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. + |
+
Content-Type + |
+Yes + |
+String + |
+Message body type (format). + |
+
Status code: 200
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
[items] + |
+Array of ServiceBridgeVersion objects + |
++ |
Parameter + |
+Type + |
+Description + |
+
---|---|---|
name + |
+String + |
+Code package name. + |
+
version + |
+String + |
+Code version. + |
+
code_url + |
+String + |
+OBS path where the code is stored. + |
+
Status code: 400
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 401
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 403
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 500
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Query the available version of the ServiceBridge function of the rds type.
+GET https://{Endpoint}/v2/{project_id}/fgs/servicebridge/version?type=rds+
Status code: 200
+ok
+[ { + "name" : "xxx", + "version" : "xxx", + "code_url" : "xxx" +} ]+
Status Code + |
+Description + |
+
---|---|
200 + |
+ok + |
+
400 + |
+Bad request. + |
+
401 + |
+Unauthorized. + |
+
403 + |
+Forbidden. + |
+
500 + |
+Internal server error. + |
+
See Error Codes.
+This API is used to update the pinning status of a function.
+PUT /v2/{project_id}/fgs/functions/{func_urn}/collect/{state}
+ +Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. For details, see Obtaining a Project ID. + |
+
func_urn + |
+Yes + |
+String + |
+Function URN. + |
+
state + |
+Yes + |
+String + |
+Pinning status. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
X-Auth-Token + |
+Yes + |
+String + |
+User token. +It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. + |
+
Content-Type + |
+Yes + |
+String + |
+Message body type (format). + |
+
Status code: 500
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Update the pinning status of a function.
+PUT https://{Endpoint}/v2/{project_id}/fgs/functions/{function_urn}/collect/true+
None
+Status Code + |
+Description + |
+
---|---|
200 + |
+ok + |
+
500 + |
+Internal server error. + |
+
See Error Codes.
+This API is used to query a specified function template.
+GET /v2/{project_id}/fgs/templates/{template_id}
+ +Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. For details, see Obtaining a Project ID. + |
+
template_id + |
+Yes + |
+String + |
+Template ID. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
X-Auth-Token + |
+Yes + |
+String + |
+User token. +It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. + |
+
Content-Type + |
+Yes + |
+String + |
+Message body type (format). + |
+
Status code: 200
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
id + |
+String + |
+Template ID. + |
+
type + |
+Integer + |
+Template type. + |
+
title + |
+String + |
+Template title. + |
+
template_name + |
+String + |
+Template name. + |
+
description + |
+String + |
+Template description. + |
+
runtime + |
+String + |
+Template runtime. + |
+
handler + |
+String + |
+Template handler. + |
+
code_type + |
+String + |
+Code type. + |
+
code + |
+String + |
+Code file. + |
+
timeout + |
+Integer + |
+Maximum duration the function can be executed. Value range: 3s–259,200s. + |
+
memory_size + |
+Integer + |
+Memory size. + |
+
trigger_metadata_list + |
+Array of TriggerMetadataList objects + |
+Trigger information. + |
+
temp_detail + |
+TempDetail object + |
++ |
user_data + |
+String + |
+User data. + |
+
encrypted_user_data + |
+String + |
+Encrypted user data. + |
+
dependencies + |
+Array of strings + |
+Dependencies required by the template. + |
+
scene + |
+String + |
+Template application scenarios. + |
+
service + |
+String + |
+Cloud service associated with the template. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
trigger_name + |
+String + |
+Trigger name. + |
+
trigger_type + |
+String + |
+Trigger type. + |
+
event_type + |
+String + |
+Event type. + |
+
event_data + |
+String + |
+Event data. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
input + |
+String + |
+Template input. + |
+
output + |
+String + |
+Template output. + |
+
warning + |
+String + |
+Warning. + |
+
Status code: 400
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 401
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 403
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 404
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Status code: 500
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code. + |
+
error_msg + |
+String + |
+Error message. + |
+
Query a specified function template.
+GET /v2/{project_id}/fgs/templates/{template_id}+
Status code: 200
+OK
+{ + "id" : "d3aa6e4c-xxxx-xxxx-9c09-5c50c4xxxxxx", + "type" : 1, + "title" : "access-service-with-http", + "template_name" : "access-service-with-http-php", + "description" : "access service with http.", + "runtime" : "PHP7.3", + "handler" : "index.handler", + "code_type" : "inline", + "code" : "xxxxx", + "timeout" : 30, + "memory_size" : 256, + "trigger_metadata_list" : [ ], + "temp_detail" : { + "input" : "None", + "output" : "execution succeed: Return to access service information through http/https,", + "warning" : "1. configure the serveraddress environment variables." + }, + "user_data" : "", + "encrypted_user_data" : "", + "dependencies" : [ ], + "scene" : "basic_function_usage", + "service" : "FunctionGraph" +}+
Status code: 404
+Not found.
+{ + "error_code" : "FSS.1059", + "error_msg" : "The function template does not exist." +}+
Status Code + |
+Description + |
+
---|---|
200 + |
+OK + |
+
400 + |
+Bad request. + |
+
401 + |
+Unauthorized. + |
+
403 + |
+Forbidden. + |
+
404 + |
+Not found. + |
+
500 + |
+Internal server error. + |
+
See Error Codes.
+