> 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/other-products/class-and-method/universal-client/set-product-id.md).

# set\_product\_id 方法

## 简要

为当前通用产品客户端设置（绑定）一个新的 Tencent Cloud 产品 ID。

```python
def set_product_id(self,
    product_id: str
)
```

请注意，使用该方法设置一个新的 Tencent Cloud 产品 ID 后当前客户端所设置的 Tencent Cloud API 请求端点将被对应的默认 Tencent Cloud API 请求端点覆盖。

例如对于无服务器云函数（产品 ID：`scf`）产品的请求端点为：`scf.tencentcloudapi.com`

## 参数

该方法具有以下参数，其参数、参数类型和参数描述如下：

| 参数          | 类型  | 必选 | 描述                                                                             |
| ----------- | --- | -- | ------------------------------------------------------------------------------ |
| product\_id | str | 是  | <p>新的 Tencent Cloud 产品 ID。</p><p>例如：<code>cvm</code> <code>scf</code> 等...</p> |

## 返回值

该方法没有返回值。

## 异常

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

#### ValueError

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

## 示例

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

```python
virtual_machine_client.set_product_id(
    product_id = 'scf'
)
```

## 适用于

#### Tencent Cloud SDK for Python

基础软件包：tencent-cloud-sdk-core >= 0.1.1
