
# 查询实例详情 - ShowInstance
#### 功能介绍
查询设备接入实例详情。
#### 调用方法
请参见[如何调用API](https://support.huaweicloud.com/api-iothub/iot_06_v5_0004.html)。
#### 授权信息
账号具备所有API的调用权限，如果使用账号下的IAM用户调用当前API，该IAM用户需具备调用API所需的权限。
- 如果使用角色与策略授权，具体权限要求请参见[权限和授权项](https://support.huaweicloud.com/api-iothub/iot_06_v5_0201.html)。
- 如果使用身份策略授权，需具备如下身份策略权限。
  
  | 授权项                  | 访问级别 | 资源类型（\*为必须） | 条件键                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | 别名 | 依赖的授权项 |
  |:---|:---|:---|:---|:---|:---|
  | iotda:instance:query | Read | instance \* | - g:EnterpriseProjectId   - g:ResourceTag/\<tag-key\>    | -  | -      |
     
  
 
#### URI
GET /v5/iot/{project_id}/iotda-instances/{instance_id}
表1路径参数 
| 参数          | 是否必选 | 参数类型   | 描述                                                                                                                                      |
|:---|:---|:---|:---|
| project_id  | 是    | String | **参数说明** ：项目ID。获取方法请参见 [获取项目ID](https://support.huaweicloud.com/api-iothub/iot_06_v5_1001.html)。                                        |
| instance_id | 是    | String | **参数说明**：实例ID。 **取值范围**：长度不超过36，由小写字母\[a-f\]、数字、连接符（-）的组成。 |
   
#### 请求参数
无
#### 响应参数
**状态码：200**
表2响应Body参数 
| 参数                    | 参数类型                                                                                                                     | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
|:---|:---|:---|
| instance_type         | String                                                                                                                   | **参数说明**：实例类型。 **取值范围**： - standard：标准版实例   - enterprise：企业版实例                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| instance_id           | String                                                                                                                   | **参数说明**：实例ID。 **取值范围**：长度不超过36，由小写字母\[a-f\]、数字、连接符（-）的组成。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| charge_mode           | String                                                                                                                   | **参数说明**：实例的付费方式。 **取值范围**： - prePaid：包年/包月   - postPaid：按需计费                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| name                  | String                                                                                                                   | **参数说明**：实例名称。 **取值范围**：由中文字符，英文字母、数字及"_"、"-"组成，且长度为\[1-64\]个字符。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| flavor                | [Flavor] object                             | **参数说明**：设备接入实例的规格参数。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| status                | String                                                                                                                   | **参数说明**：实例状态。 **取值范围**： - CREATING：实例正在创建   - ACTIVE：实例正常   - FROZEN：实例冻结   - TRADING: 实例正在进行交易   - MODIFYING：实例正在变更规格   - MODIFY_FAILED: 实例变更失败   - FAILED：实例创建失败    |
| region_id             | String                                                                                                                   | **参数说明**：实例所属region。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| description           | String                                                                                                                   | **参数说明**：设备接入实例的描述信息。 **取值范围**：长度不超过256，只允许中文、字母、数字、以及_，,.。、\&-等字符的组合。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| access_infos          | Array of [AccessInfo] objects           | **参数说明**：设备接入实例的接入信息。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| create_time           | String                                                                                                                   | **参数说明**：实例的创建时间。时间格式例如：2023-01-28T06:57:52Z。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| update_time           | String                                                                                                                   | **参数说明**：实例的最近一次更新的时间。时间格式例如：2023-01-28T06:57:52Z。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| enterprise_project_id | String                                                                                                                   | **参数说明**：企业项目Id。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| tags                  | Array of [Tag] objects                         | **参数说明**: 设备接入实例的标签信息。如果实例有标签，则会有该字段，否则该字段为空。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| order_id              | String                                                                                                                   | **参数说明** ：订单号。创建包年包月实例时返回该参数。查看订单详情请参考[查询订单详情](https://support.huaweicloud.com/api-bpconsole/api_order_00014.html)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| operate_window        | [OperateWindow] object               | 实例维护时间窗，用户在变更实例规格时，可以指定在该时间窗内进行变更。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| additional_params     | [AdditionalParamsResp] object | 企业版附加参数信息。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
   
 表3Flavor 
| 参数   | 参数类型    | 描述                                                                                                                                                       |
|:---|:---|:---|
| type | String  | **参数说明** ：待创建设备接入实例的规格名称。详情请参见[产品规格说明](https://support.huaweicloud.com/productdesc-iothub/iot_04_0014.html)中的规格编码。                                       |
| size | Integer | **参数说明** ：待创建设备接入标准版实例的单元数量，企业版不支持该参数。详情请参见[产品规格说明](https://support.huaweicloud.com/productdesc-iothub/iot_04_0014.html)。当instance_type是standard时，该参数必填。 |
   
 表4AccessInfo 
| 参数                | 参数类型                                                                                                   | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
|:---|:---|:---|
| type              | String                                                                                                 | **参数说明**：接入地址的类型，如应用接入的HTTPS协议的取值为：APP_HTTPS，设备接入的MQTT协议的取值为：DEVICE_MQTT。 **取值范围**： - APP_HTTPS：应用接入HTTPS协议   - APP_AMQP：应用接入AMQP协议   - APP_MQTT：应用接入MQTT协议   - DEVICE_COAP：设备接入COAP协议   - DEVICE_MQTT：设备接入MQTT协议   - DEVICE_HTTPS：设备接入HTTPS协议    |
| port              | Integer                                                                                                | **参数说明**：实例的应用/设备的安全接入端口。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| non_tls_port      | Integer                                                                                                | **参数说明**：实例的应用/设备的非安全接入端口。返回null时表示该类型的接入地址不支持非安全端口接入。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| websocket_port    | Integer                                                                                                | **参数说明**：基于WebSocket的MQTT接入端口。返回null时表示该类型的接入地址不支持WebSocket端口接入。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| domain_name       | String                                                                                                 | **参数说明**：实例的接入域名。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| private_addresses | Array of strings                                                                                       | **参数说明**：实例的私网接入地址列表。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| public_address    | Array of strings                                                                                       | **参数说明**：实例的公网接入地址。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ipv6_address      | Array of strings                                                                                       | **参数说明**：实例的ipv6接入地址列表。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ip_whitelist      | [IPWhiteList] object | IP白名单 约束：只有企业版实例的APP_HTTPS/APP_AMQP/APP_MQTT协议支持配置IP白名单。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
   
 表5IPWhiteList 
| 参数         | 参数类型                                                                                                             | 描述                         |
|:---|:---|:---|
| enable     | Boolean                                                                                                          | **参数说明**：启用Ip白名单访问控制。      |
| allow_list | Array of [IpAllowList] objects | **参数说明**：允许访问企业版实例的IP地址列表。 |
   
 表6IpAllowList 
| 参数          | 参数类型   | 描述                |
|:---|:---|:---|
| address     | String | **参数说明**：白名单ip地址。 |
| description | String | **参数说明**：描述。      |
   
 表7Tag 
| 参数    | 参数类型   | 描述                                                                                     |
|:---|:---|:---|
| key   | String | **参数说明**：标签键，标签的键可用字母(包含中文)、数字、空格和以下字符：下划线(_)点(.)冒号(:)等号(=)加号(+)中划线(-)以及@，首尾不能有空格字符。   |
| value | String | **参数说明**：标签值，可为空字符串和null，标签的值可用字母(包含中文)、数字、空格和以下字符：下划线(_)点(.)冒号(:)等号(=)加号(+)中划线(-)以及@。 |
   
 表8OperateWindow 
| 参数         | 参数类型   | 描述                                   |
|:---|:---|:---|
| start_time | String | **参数说明**：变更时间窗开始时间，UTC时间，格式为："HH:mm" |
| end_time   | String | **参数说明**：变更时间窗结束时间，UTC时间，格式为："HH:mm" |
   
 表9AdditionalParamsResp 
| 参数                  | 参数类型                                                                                                         | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
|:---|:---|:---|
| vpc_id              | String                                                                                                       | **参数说明**：企业版实例的VPCID。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| subnet_id           | String                                                                                                       | **参数说明**：企业版实例的子网ID。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| security_group_id   | String                                                                                                       | **参数说明**：企业版实例的安全组ID。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| ciphering_algorithm | String                                                                                                       | **参数说明**：实例支持的加密算法。 **取值范围**： - COMMON_ALGORITHM: 通用加密算法（支持RSA，SHA256等国际通用的密码算法）   - SM_ALGORITHM: 支持SM系列商密算法（支持SM2，SM3，SM4等国密算法）    |
| forwarding_info     | [ForwardingInfo] object | 企业版实例的SNAT配置信息。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
   
 表10ForwardingInfo 
| 参数          | 参数类型    | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
|:---|:---|:---|
| eip         | String  | **参数说明**：NAT网关绑定的EIP。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| enable_snat | Boolean | **参数说明**：是否启用SNAT配置。 **取值范围**： - true: SNAT配置已启用   - false: SNAT配置未启用    |
   
#### 请求示例
查询指定实例。
```
GET https://{endpoint}/v5/iot/{project_id}/iotda-instances/{instance_id}
```
#### 响应示例
**状态码：200**
OK
```
{
  "instance_type" : "standard",
  "instance_id" : "8561675c-d8a3-4956-9884-9cf9cbdd3134",
  "charge_mode" : "prePaid",
  "name" : "iotda_instance",
  "flavor" : {
    "type" : "iotda.standard.s1",
    "size" : 1
  },
  "status" : "ACTIVE",
  "region_id" : "cn-north-4",
  "create_time" : "2023-01-28T06:57:52Z",
  "update_time" : "2023-01-28T06:58:52Z",
  "description" : "IoTDA instance for production.",
  "access_infos" : [ {
    "type" : "APP_AMQP",
    "port" : 5671,
    "non_tls_port" : null,
    "websocket_port" : null,
    "domain_name" : "example.xxxx.com",
    "public_address" : [ ],
    "ipv6_address" : [ ],
    "ip_whitelist" : null
  }, {
    "type" : "APP_HTTPS",
    "port" : 443,
    "non_tls_port" : null,
    "websocket_port" : null,
    "domain_name" : "example1.xxxx.com",
    "public_address" : [ ],
    "ipv6_address" : [ ],
    "ip_whitelist" : null
  }, {
    "type" : "DEVICE_MQTT",
    "port" : 8883,
    "non_tls_port" : 1883,
    "websocket_port" : 443,
    "domain_name" : "example2.xxxx.com",
    "public_address" : [ ],
    "ipv6_address" : [ ],
    "ip_whitelist" : null
  }, {
    "type" : "DEVICE_COAP",
    "port" : 5684,
    "non_tls_port" : 5683,
    "websocket_port" : null,
    "domain_name" : "example3.xxxx.com",
    "public_address" : [ ],
    "ipv6_address" : [ ],
    "ip_whitelist" : null
  } ],
  "enterprise_project_id" : "d22e47e9-cfad-4254-8a29-d2a56a07681d",
  "tags" : [ {
    "key" : "testTagName",
    "value" : "testTagValue"
  } ],
  "order_id" : "CS22121614500ABCD",
  "operate_window" : {
    "start_time" : "22:00",
    "end_time" : "24:00"
  },
  "additional_params" : null
}
```
#### SDK代码示例
SDK代码示例如下。
- [Java]
  ```
  package com.huaweicloud.sdk.test;
  import com.huaweicloud.sdk.core.auth.ICredential;
  import com.huaweicloud.sdk.core.auth.BasicCredentials;
  import com.huaweicloud.sdk.core.exception.ConnectionException;
  import com.huaweicloud.sdk.core.exception.RequestTimeoutException;
  import com.huaweicloud.sdk.core.exception.ServiceResponseException;
  import com.huaweicloud.sdk.iotdm.v5.region.IoTDMRegion;
  import com.huaweicloud.sdk.iotdm.v5.*;
  import com.huaweicloud.sdk.iotdm.v5.model.*;
  public class ShowInstanceSolution {
      public static void main(String[] args) {
          // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
          // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
          String ak = System.getenv("CLOUD_SDK_AK");
          String sk = System.getenv("CLOUD_SDK_SK");
          String projectId = "{project_id}";
          ICredential auth = new BasicCredentials()
                  .withProjectId(projectId)
                  .withAk(ak)
                  .withSk(sk);
          IoTDMClient client = IoTDMClient.newBuilder()
                  .withCredential(auth)
                  .withRegion(IoTDMRegion.valueOf("<YOUR REGION>"))
                  .build();
          ShowInstanceRequest request = new ShowInstanceRequest();
          request.withInstanceId("{instance_id}");
          try {
              ShowInstanceResponse response = client.showInstance(request);
              System.out.println(response.toString());
          } catch (ConnectionException e) {
              e.printStackTrace();
          } catch (RequestTimeoutException e) {
              e.printStackTrace();
          } catch (ServiceResponseException e) {
              e.printStackTrace();
              System.out.println(e.getHttpStatusCode());
              System.out.println(e.getRequestId());
              System.out.println(e.getErrorCode());
              System.out.println(e.getErrorMsg());
          }
      }
  }
  ```
- [Python]
  ```
  # coding: utf-8
  import os
  from huaweicloudsdkcore.auth.credentials import BasicCredentials
  from huaweicloudsdkiotdm.v5.region.iotdm_region import IoTDMRegion
  from huaweicloudsdkcore.exceptions import exceptions
  from huaweicloudsdkiotdm.v5 import *
  if __name__ == "__main__":
      # The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
      # In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
      ak = os.environ["CLOUD_SDK_AK"]
      sk = os.environ["CLOUD_SDK_SK"]
      projectId = "{project_id}"
      credentials = BasicCredentials(ak, sk, projectId)
      client = IoTDMClient.new_builder() \
          .with_credentials(credentials) \
          .with_region(IoTDMRegion.value_of("<YOUR REGION>")) \
          .build()
      try:
          request = ShowInstanceRequest()
          request.instance_id = "{instance_id}"
          response = client.show_instance(request)
          print(response)
      except exceptions.ClientRequestException as e:
          print(e.status_code)
          print(e.request_id)
          print(e.error_code)
          print(e.error_msg)
  ```
- [Go]
  ```
  package main
  import (
  "fmt"
  "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic"
      iotdm "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/iotdm/v5"
  "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/iotdm/v5/model"
      region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/iotdm/v5/region"
  )
  func main() {
      // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
      // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
      ak := os.Getenv("CLOUD_SDK_AK")
      sk := os.Getenv("CLOUD_SDK_SK")
      projectId := "{project_id}"
      auth, err := basic.NewCredentialsBuilder().
          WithAk(ak).
          WithSk(sk).
          WithProjectId(projectId).
          SafeBuild()
      if err != nil {
          fmt.Println(err)
          return
      }
      hcClient, err := iotdm.IoTDMClientBuilder().
           WithRegion(region.ValueOf("<YOUR REGION>")).
           WithCredential(auth).
           SafeBuild()
      if err != nil {
          fmt.Println(err)
          return
      }
      client := iotdm.NewIoTDMClient(hcClient)
      request := &model.ShowInstanceRequest{}
  request.InstanceId = "{instance_id}"
  response, err := client.ShowInstance(request)
  if err == nil {
          fmt.Printf("%+v\n", response)
      } else {
          fmt.Println(err)
      }
  }
  ```
- [更多]
  更多编程语言的SDK代码示例，请参见[API Explorer](https://console.huaweicloud.com/apiexplorer/#/openapi/IoTDM/sdk?api=ShowInstance)的代码示例页签，可生成自动对应的SDK代码示例。
#### 状态码
| 状态码 | 描述           |
|:---|:---|
| 200 | OK           |
| 400 | Bad Request  |
| 401 | Unauthorized |
   
#### 错误码
请参见[错误码](https://support.huaweicloud.com/api-iothub/ErrorCode.html)。
