> For the complete documentation index, see [llms.txt](https://smallso.gitbook.io/tencent-cloud-sdk/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://smallso.gitbook.io/tencent-cloud-sdk/python-docs/serverless-functions/class-and-method/client/get-function-result-by-request-id.md).

# get\_function\_result\_by\_request\_id 方法

## 简要

获取给定无服务器云函数指定 Request ID 的运行结果。

```python
def get_function_result_by_request_id(self,
    region_id: str,
    namespace_name: str,
    function_name: str,
    function_request_id: str,
    function_version: str = None
) -> dict
```

## 参数

该方法的参数和参数描述如下：

| 参数                    | 类型  | 必选 | 描述                                         |
| --------------------- | --- | -- | ------------------------------------------ |
| region\_id            | str | 是  | 获取的无服务器云函数所在数据中心的唯一标识符。                    |
| namespace\_name       | str | 是  | 获取的无服务器云函数所在命名空间的名称。                       |
| function\_name        | str | 是  | 获取的无服务器云函数名称。                              |
| function\_request\_id | str | 是  | 获取的无服务器云函数 Request ID 字符串。                 |
| function\_version     | str | 否  | 获取的无服务器云函数的版本名称。如果该参数被忽略或设置为 None，默认为最新版本。 |

## 返回值

该方法返回给定无服务器云函数指定 Request ID 的运行结果字典实例，其数据类型为 [FunctionResult](https://smallso.gitbook.io/tencent-cloud-sdk/python-docs/serverless-functions/data-types/function-result)。

## 异常

该方法可能会主动引发以下异常：

#### ValueError

参数值或类型不符合预期。

#### ActionError

Tencent Cloud API 错误。例如访问凭据无效、给定无服务器云函数不存在等均会引发该异常。

#### NotFoundError

给定无服务器云函数的 Request ID 无效或未找到运行结果。如果 Request ID 有效，则给定无服务器云函数可能还在运行或运行结果仍未完成收集。

## 示例

下面我们将通过一段 Python 代码向您演示如何使用该方法：

```python
function_client.get_function_result_by_request_id(
    region_id = 'ap-shanghai',
    namespace_name = 'default',
    function_name = 'addend',
    function_request_id = 'effae55e-480e-11ea-b078-5254007aa7a1',
    function_version = '1'
)
```

## 适用于

#### Tencent Cloud SDK for Python

产品软件包：tencent-cloud-sdk-serverless-functions >= 0.1.1
