
# 获取事件详情 - ShowIncident
#### 功能介绍
获取事件详情
#### 调用方法
请参见[如何调用API](https://support.huaweicloud.com/api-secmaster/secmaster_03_0008.html)。
#### 授权信息
账号具备所有API的调用权限，如果使用账号下的IAM用户调用当前API，该IAM用户需具备调用API所需的权限，具体权限要求请参见[权限和授权项](https://support.huaweicloud.com/api-secmaster/secmaster_03_0023.html)。
#### URI
GET /v1/{project_id}/workspaces/{workspace_id}/soc/incidents/{incident_id}
表1路径参数 
| 参数           | 是否必选 | 参数类型   | 描述                                                                                                                                                                                                                                                                                                                                                                                                                      |
|:---|:---|:---|:---|
| project_id   | 是    | String | **参数解释：** 项目ID，用于明确项目归属，配置后可通过该ID查询项目下资产，可以通过调用API获取，也可以从控制台获取。[获取项目ID](https://support.huaweicloud.com/api-secmaster/secmaster_03_0014.html) **约束限制：** 不涉及 **取值范围：** 不涉及 **默认取值：** 不涉及 |
| workspace_id | 是    | String | **参数解释：** 工作空间id。 **约束限制：** 不涉及 **取值范围：** 不涉及 **默认取值：** 不涉及                                                                                                                             |
| incident_id  | 是    | String | 事件ID                                                                                                                                                                                                                                                                                                                                                                                                                    |
   
#### 请求参数
表2请求Header参数 
| 参数           | 是否必选 | 参数类型   | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
|:---|:---|:---|:---|
| X-Auth-Token | 是    | String | **参数解释：** 用户Token，通过调用IAM服务获取用户Token接口获取（响应消息头中X-Subject-Token的值）。[获取用户Token](https://support.huaweicloud.com/api-secmaster/secmaster_03_0010.html) **约束限制：** 不涉及 **取值范围：** 不涉及 **默认取值：** 不涉及                                                                                                                                                                                                               |
| content-type | 是    | String | **参数解释：** 内容类型 - application/json;charset=UTF-8 普通API请求的类型    **约束限制：** 不涉及 **取值范围：** - application/json;charset=UTF-8    **默认取值：** 不涉及 |
   
#### 响应参数
**状态码：200**
表3响应Body参数 
| 参数      | 参数类型                                                            | 描述     |
|:---|:---|:---|
| code    | String                                                          | 错误码    |
| message | String                                                          | 错误信息   |
| data    | [IncidentDetail] object | 事件详情对象 |
   
 表4IncidentDetail 
| 参数             | 参数类型                                                          | 描述                                                                            |
|:---|:---|:---|
| create_time    | String                                                        | 记录时间，格式ISO8601：YYYY-MM-DDTHH:mm:ss.ms+timezone。时区信息为事件发生时区，无法解析时区的时间，默认时区填东八区 |
| data_object    | [Incident] object           | 事件实体信息                                                                        |
| dataclass_ref  | [dataclass_ref] object | 数据类对象                                                                         |
| format_version | Integer                                                       | 格式版本                                                                          |
| id             | String                                                        | 事件唯一标识，UUID格式，最大36个字符                                                         |
| project_id     | String                                                        | 当前项目的id                                                                       |
| update_time    | String                                                        | 更新时间，格式ISO8601：YYYY-MM-DDTHH:mm:ss.ms+timezone。时区信息为告警发生时区，无法解析时区的时间，默认时区填东八区 |
| version        | Integer                                                       | 版本                                                                            |
| workspace_id   | String                                                        | 当前的工作空间id                                                                     |
| type           | String                                                        | 数据类型（SIMULATION--告警, PLAYBOOK--剧本, MANUAL--手动触发,DATA_SOURCE--数据源）             |
   
 表5Incident 
| 参数                  | 参数类型                                                                    | 描述                                                                                                                                                                                                                                                                                                                                                                                |
|:---|:---|:---|
| version             | String                                                                  | 事件对象的版本，该字段的值必须为云SSA服务确定的官方发布版本之一                                                                                                                                                                                                                                                                                                                                                 |
| id                  | String                                                                  | 事件唯一标识，UUID格式，最大36个字符                                                                                                                                                                                                                                                                                                                                                             |
| domain_id           | String                                                                  | 数据投递后，被委托用户的domain_id                                                                                                                                                                                                                                                                                                                                                             |
| region_id           | String                                                                  | 数据投递后，被委托用户的region_id                                                                                                                                                                                                                                                                                                                                                             |
| workspace_id        | String                                                                  | 当前的工作空间id                                                                                                                                                                                                                                                                                                                                                                         |
| labels              | String                                                                  | 标签，仅展示                                                                                                                                                                                                                                                                                                                                                                            |
| environment         | [environment] object               | 事件产生的环境坐标信息                                                                                                                                                                                                                                                                                                                                                                       |
| data_source         | [data_source] object               | 首次上报数据源                                                                                                                                                                                                                                                                                                                                                                           |
| first_observed_time | String                                                                  | 首次发现时间，格式ISO8601：YYYY-MM-DDTHH:mm:ss.ms+timezone。时区信息为事件发生时区，无法解析时区的时间，默认时区填东八区                                                                                                                                                                                                                                                                                                   |
| last_observed_time  | String                                                                  | 最近发现时间，格式ISO8601：YYYY-MM-DDTHH:mm:ss.ms+timezone。时区信息为事件发生时区，无法解析时区的时间，默认时区填东八区                                                                                                                                                                                                                                                                                                   |
| create_time         | String                                                                  | 记录时间，格式ISO8601：YYYY-MM-DDTHH:mm:ss.ms+timezone。时区信息为事件发生时区，无法解析时区的时间，默认时区填东八区                                                                                                                                                                                                                                                                                                     |
| arrive_time         | String                                                                  | 接收时间，格式ISO8601：YYYY-MM-DDTHH:mm:ss.ms+timezone。时区信息为事件发生时区，无法解析时区的时间，默认时区填东八区                                                                                                                                                                                                                                                                                                     |
| title               | String                                                                  | 事件标题                                                                                                                                                                                                                                                                                                                                                                              |
| description         | String                                                                  | 事件描述信息                                                                                                                                                                                                                                                                                                                                                                            |
| source_url          | String                                                                  | 事件URL链接，指向数据源产品中有关当前事件说明的页面                                                                                                                                                                                                                                                                                                                                                       |
| count               | Integer                                                                 | 事件发生次数                                                                                                                                                                                                                                                                                                                                                                            |
| confidence          | Integer                                                                 | 事件的置信度。置信度的定义旨在说明识别的行为或问题的可能性。 取值范围：0-100，0表示置信度为0%，100表示置信度为100%                                                                                                                                                                                                                                                                                 |
| severity            | String                                                                  | 严重性等级，取值范围：Tips \| Low \| Medium \| High \| Fatal 说明： 0: Tips -- 未发现任何问题。 1: Low -- 无需针对问题执行任何操作。 2: Medium -- 问题需要处理，但不紧急。 3: High -- 问题必须优先处理。 4: Fatal -- 问题必须立即处理，以防止产生进一步的损害 |
| criticality         | Integer                                                                 | 关键性，是指事件涉及的资产的重要性级别。 取值范围：0-100，0表示资产不关键，100表示最关键资产                                                                                                                                                                                                                                                                                               |
| incident_type       | [incident_type] object           | 事件分类，详细定义参考《告警事件类型定义》                                                                                                                                                                                                                                                                                                                                                             |
| network_list        | Array of [network_list] objects   | 网络信息                                                                                                                                                                                                                                                                                                                                                                              |
| resource_list       | Array of [resource_list] objects | 受影响资产                                                                                                                                                                                                                                                                                                                                                                             |
| remediation         | [remediation] object               | 补救措施                                                                                                                                                                                                                                                                                                                                                                              |
| verification_state  | String                                                                  | 验证状态，标识事件的准确性。可选类型如下： Unknown -- 未知 True_Positive -- 确认 False_Positive -- 误报 默认填写Unknown                                                                                                                                                          |
| handle_status       | String                                                                  | 事件处理状态，可选类型如下： Open -- 打开，默认 Block -- 阻塞 Closed -- 关闭 默认填写Open                                                                                                                                                                                    |
| sla                 | String                                                                  | 约束闭环时间：设置风险接受持续时间。格式ISO8601：YYYY-MM-DDTHH:mm:ss.ms+timezone。时区信息为事件发生时区，无法解析时区的时间，默认时区填东八区                                                                                                                                                                                                                                                                                        |
| update_time         | String                                                                  | 更新时间，格式ISO8601：YYYY-MM-DDTHH:mm:ss.ms+timezone。时区信息为事件发生时区，无法解析时区的时间，默认时区填东八区                                                                                                                                                                                                                                                                                                     |
| close_time          | String                                                                  | 关闭时间，格式ISO8601：YYYY-MM-DDTHH:mm:ss.ms+timezone。时区信息为事件发生时区，无法解析时区的时间，默认时区填东八区                                                                                                                                                                                                                                                                                                     |
| ipdrr_phase         | String                                                                  | 周期/处置阶段编号 Preparation\|Detection and Analysis\|Contain，Eradication\& Recovery\|Post-Incident-Activity                                                                                                                                                                                                                                             |
| simulation          | String                                                                  | 调试字段                                                                                                                                                                                                                                                                                                                                                                              |
| actor               | String                                                                  | 事件调查员                                                                                                                                                                                                                                                                                                                                                                             |
| owner               | String                                                                  | 责任人、服务责任人                                                                                                                                                                                                                                                                                                                                                                         |
| creator             | String                                                                  | 创建人                                                                                                                                                                                                                                                                                                                                                                               |
| close_reason        | String                                                                  | 关闭原因: 误检 - False detection 已解决 - Resolved 重复 - Repeated 其他 - Other                                                                                                                                                                                |
| close_comment       | String                                                                  | 关闭评论                                                                                                                                                                                                                                                                                                                                                                              |
| malware             | [malware] object                       | 恶意软件                                                                                                                                                                                                                                                                                                                                                                              |
| system_info         | Object                                                                  | 系统信息                                                                                                                                                                                                                                                                                                                                                                              |
| process             | Array of [process] objects             | 进程信息                                                                                                                                                                                                                                                                                                                                                                              |
| user_info           | Array of [user_info] objects         | 用户信息                                                                                                                                                                                                                                                                                                                                                                              |
| file_info           | Array of [file_info] objects         | 文件信息                                                                                                                                                                                                                                                                                                                                                                              |
| system_alert_table  | Object                                                                  | 事件管理列表的布局字段                                                                                                                                                                                                                                                                                                                                                                       |
   
 表6environment 
| 参数                 | 参数类型   | 描述                                     |
|:---|:---|:---|
| vendor_type        | String | 环境供应商                                  |
| domain_id          | String | 租户id                                   |
| region_id          | String | 区域id，全局服务global                        |
| cross_workspace_id | String | 数据投递前的源工作空间id，在源空间下值为null，投递后为被委托用户的id |
| project_id         | String | 项目id， 全局服务默认null                       |
   
 表7data_source 
| 参数              | 参数类型    | 描述                                                                                                                                          |
|:---|:---|:---|
| source_type     | Integer | 数据源类型，取值范围如下： 1 - 云上产品 2 - 第三方产品 3 - 租户私有产品 |
| domain_id       | String  | 数据源产品所属账号的id                                                                                                                                |
| project_id      | String  | 数据源产品所属项目的id                                                                                                                                |
| region_id       | String  | 数据源产品所在区域，具体取值范围查看云地区和终端节点定义                                                                                                                |
| company_name    | String  | 数据源产品所属公司的名称                                                                                                                                |
| product_name    | String  | 数据源产品的名称                                                                                                                                    |
| product_feature | String  | 产品功能特性名称，用来指明检测到当前事件的产品的功能特性                                                                                                                |
| product_module  | String  | 检测模块列表                                                                                                                                      |
   
 表8incident_type 
| 参数            | 参数类型   | 描述   |
|:---|:---|:---|
| category      | String | 类别   |
| incident_type | String | 事件类型 |
   
 表9network_list 
| 参数          | 参数类型                                                | 描述                                                                                                                                                                             |
|:---|:---|:---|
| direction   | String                                              | 方向，取值范围：IN \| OUT                                                                                                                                                              |
| protocol    | String                                              | 协议，包含7层和4层的协议 参考：IANA registered name https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml |
| src_ip      | String                                              | 源IP地址                                                                                                                                                                          |
| src_port    | Integer                                             | 源端口，0--65535                                                                                                                                                                   |
| src_domain  | String                                              | 源域名                                                                                                                                                                            |
| src_geo     | [src_geo] object   | 源IP的地理位置信息                                                                                                                                                                     |
| dest_ip     | String                                              | 目的IP地址                                                                                                                                                                         |
| dest_port   | String                                              | 目的端口，0--65535                                                                                                                                                                  |
| dest_domain | String                                              | 目的域名                                                                                                                                                                           |
| dest_geo    | [dest_geo] object | 目标IP的地理位置信息                                                                                                                                                                    |
   
 表10src_geo 
| 参数           | 参数类型   | 描述                                                      |
|:---|:---|:---|
| latitude     | Number | 纬度                                                      |
| longitude    | Number | 经度                                                      |
| city_code    | String | 城市编码                                                    |
| country_code | String | 国家编码，参考ISO 3166-1 alpha-2，例如：CN \| US \| DE \| IT \| SG |
   
 表11dest_geo 
| 参数           | 参数类型   | 描述                                                      |
|:---|:---|:---|
| latitude     | Number | 纬度                                                      |
| longitude    | Number | 经度                                                      |
| city_code    | String | 城市编码                                                    |
| country_code | String | 国家编码，参考ISO 3166-1 alpha-2，例如：CN \| US \| DE \| IT \| SG |
   
 表12resource_list 
| 参数         | 参数类型   | 描述                                                                                                                                          |
|:---|:---|:---|
| id         | String | 云服务资产id                                                                                                                                     |
| name       | String | 资产名称                                                                                                                                        |
| type       | String | 资产类型(cloudservers;servers;vm;pm;instances;publicips;ip;website;vpcs;securityGroups;device)                                                  |
| provider   | String | 云服务名称；引用云RMS provider字段                                                                                                                     |
| region_id  | String | 区域；按照云regionId填写                                                                                                                            |
| domain_id  | String | 资产所属账号ID，UUID格式                                                                                                                             |
| project_id | String | 资产所属项目ID，UUID格式                                                                                                                             |
| ep_id      | String | 企业项目id                                                                                                                                      |
| ep_name    | String | 企业项目名称                                                                                                                                      |
| tags       | String | 资产标签 1、最多50个key/values对 2、values：最大255字符，取值范围：字母数字,空格,+, -, =, ., _, :, /,@ |
   
 表13remediation 
| 参数             | 参数类型   | 描述                                    |
|:---|:---|:---|
| recommendation | String | 推荐处理方法                                |
| url            | String | 链接，指向该事件的一般修复信息。该URL必须可以从公网访问，不需要提供凭证 |
   
 表14malware 
| 参数             | 参数类型   | 描述     |
|:---|:---|:---|
| malware_family | String | 恶意家族   |
| malware_class  | String | 恶意软件分类 |
   
 表15process 
| 参数                     | 参数类型    | 描述                                                                              |
|:---|:---|:---|
| process_name           | String  | 进程名                                                                             |
| process_path           | String  | 进程执行文件路径                                                                        |
| process_pid            | Integer | 进程id                                                                            |
| process_uid            | Integer | 进程用户id                                                                          |
| process_cmdline        | String  | 进程命令行                                                                           |
| process_parent_name    | String  | 父进程名称                                                                           |
| process_parent_path    | String  | 父进程执行文件路径                                                                       |
| process_parent_pid     | Integer | 父进程id                                                                           |
| process_parent_uid     | Integer | 父进程用户id                                                                         |
| process_parent_cmdline | String  | 父进程命令行                                                                          |
| process_child_name     | String  | 子进程名称                                                                           |
| process_child_path     | String  | 子进程执行文件路径                                                                       |
| process_child_pid      | Integer | 子进程id                                                                           |
| process_child_uid      | Integer | 子进程用户id                                                                         |
| process_child_cmdline  | String  | 子进程命令行                                                                          |
| process_launche_time   | String  | 进程启动时间，格式ISO8601：YYYY-MM-DDTHH:mm:ss.ms+timezone。时区信息为事件发生时区，无法解析时区的时间，默认时区填东八区 |
| process_terminate_time | String  | 进程结束时间，格式ISO8601：YYYY-MM-DDTHH:mm:ss.ms+timezone。时区信息为事件发生时区，无法解析时区的时间，默认时区填东八区 |
   
 表16user_info 
| 参数        | 参数类型   | 描述    |
|:---|:---|:---|
| user_id   | String | 用户uid |
| user_name | String | 用户名称  |
   
 表17file_info 
| 参数            | 参数类型   | 描述       |
|:---|:---|:---|
| file_path     | String | 文件路径/名称  |
| file_content  | String | 文件内容     |
| file_new_path | String | 文件新路径/名称 |
| file_hash     | String | 文件hash   |
| file_md5      | String | 文件md5    |
| file_sha256   | String | 文件sha256 |
| file_attr     | String | 文件属性     |
   
 表18dataclass_ref 
| 参数   | 参数类型   | 描述                     |
|:---|:---|:---|
| id   | String | 数据类唯一标识，UUID格式，最大36个字符 |
| name | String | 数据类名称                  |
   
**状态码：400**
表19响应Body参数 
| 参数      | 参数类型   | 描述                                                                                                                                                                                                                                                                                                |
|:---|:---|:---|
| code    | String | **参数解释:** 错误码 **约束限制:** 不涉及 **取值范围:** 长度为0-64个字符 **默认取值:** 不涉及    |
| message | String | **参数解释:** 错误描述 **约束限制:** 不涉及 **取值范围:** 长度为0-1024个字符 **默认取值:** 不涉及 |
   
#### 请求示例
无
#### 响应示例
**状态码：200**
获取事件详情返回body体
```
{
  "code" : "00000000",
  "message" : "message",
  "data" : {
    "data_object" : {
      "version" : "1.0",
      "domain_id" : "909494e3-558e-46b6-a9eb-07a8e18ca62f",
      "region_id" : "909494e3-558e-46b6-a9eb-07a8e18ca62f",
      "environment" : {
        "vendor_type" : "demo_vendor",
        "domain_id" : "909494e3-558e-46b6-a9eb-07a8e18ca62f",
        "region_id" : "909494e3-558e-46b6-a9eb-07a8e18ca62f",
        "project_id" : "909494e3-558e-46b6-a9eb-07a8e18ca62f"
      },
      "data_source" : {
        "source_type" : 3,
        "domain_id" : "909494e3-558e-46b6-a9eb-07a8e18ca62f",
        "project_id" : "909494e3-558e-46b6-a9eb-07a8e18ca62f",
        "region_id" : "909494e3-558e-46b6-a9eb-07a8e18ca62f"
      },
      "first_observed_time" : "2021-01-07T12:20:38.861Z+0800",
      "last_observed_time" : "2021-01-07T12:20:38.861Z+0800",
      "create_time" : "2021-01-07T12:20:38.861Z+0800",
      "arrive_time" : "2021-01-07T12:20:38.861Z+0800",
      "sla" : "2021-01-07T12:20:38.861Z+0800",
      "title" : "demo_title",
      "description" : "This is a demo incident",
      "source_url" : "http://xxx",
      "count" : 4,
      "confidence" : 4,
      "severity" : "Medium",
      "criticality" : 4,
      "incident_type" : {
        "category" : "Malware",
        "incident_type" : "Rootkit"
      },
      "network_list" : [ {
        "direction" : "IN",
        "protocol" : "TCP",
        "src_ip" : "192.168.0.1",
        "src_port" : "1",
        "src_domain" : "xxx",
        "dest_ip" : "192.168.0.1",
        "dest_port" : "1",
        "dest_domain" : "xxx",
        "src_geo" : {
          "latitude" : 90,
          "longitude" : 180
        },
        "dest_geo" : {
          "latitude" : 90,
          "longitude" : 180
        }
      } ],
      "resource_list" : [ {
        "id" : "909494e3-558e-46b6-a9eb-07a8e18ca62f",
        "name" : "demo_resource_name",
        "type" : "cloudservers",
        "domain_id" : "909494e3-558e-46b6-a9eb-07a8e18ca62f",
        "project_id" : "909494e3-558e-46b6-a9eb-07a8e18ca62f",
        "region_id" : "909494e3-558e-46b6-a9eb-07a8e18ca62f",
        "ep_id" : "909494e3-558e-46b6-a9eb-07a8e18ca62f",
        "ep_name" : "demo_ep_name",
        "tags" : {
          "demo_key" : "demo_value"
        }
      } ],
      "remediation" : {
        "recommendation" : "demo_recommendation",
        "url" : "https://xxx"
      },
      "verification_state" : "True_Positive",
      "handle_status" : "Open",
      "update_time" : "2021-01-07T12:20:38.861Z+0800",
      "close_time" : "2021-01-07T12:20:38.861Z+0800",
      "ipdrr_phase" : "Preparation",
      "simulation" : "false",
      "actor" : "demo_user_name",
      "owner" : "demo_user_name",
      "creator" : "demo_user_name",
      "close_reason" : "False detection",
      "close_comment" : "no danger",
      "malware" : {
        "malware_family" : "demo_family",
        "malware_class" : "demo_class"
      },
      "system_info" : { },
      "process" : [ {
        "process_name" : "test.sh",
        "process_path" : "/home/",
        "process_pid" : 123,
        "process_uid" : 123,
        "process_cmdline" : "sh /home/test.sh"
      } ],
      "user_info" : [ {
        "user_id" : "909494e3-558e-46b6-a9eb-07a8e18ca62f",
        "user_name" : "demo_user_name"
      } ],
      "file_info" : [ {
        "file_path" : "/home/",
        "file_content" : "this is test",
        "file_new_path" : "/home/test",
        "file_hash" : "demo_hash",
        "file_md5" : "demo_md5",
        "file_sha256" : "demo_sha256",
        "file_attr" : "demo_attr"
      } ],
      "labels" : "xxx",
      "id" : "909494e3-558e-46b6-a9eb-07a8e18ca62f",
      "workspace_id" : "909494e3-558e-46b6-a9eb-07a8e18ca620"
    },
    "create_time" : "2021-01-07T12:20:38.861Z+0800",
    "update_time" : "2021-01-07T12:20:38.861Z+0800",
    "project_id" : "909494e3-558e-46b6-a9eb-07a8e18ca62f",
    "workspace_id" : "909494e3-558e-46b6-a9eb-07a8e18ca62f",
    "id" : "909494e3-558e-46b6-a9eb-07a8e18ca62f",
    "version" : 0,
    "format_version" : 0,
    "dataclass_ref" : {
      "id" : "909494e3-558e-46b6-a9eb-07a8e18ca62f",
      "name" : "Incident"
    }
  }
}
```
#### 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.secmaster.v1.region.SecMasterRegion;
  import com.huaweicloud.sdk.secmaster.v1.*;
  import com.huaweicloud.sdk.secmaster.v1.model.*;
  public class ShowIncidentSolution {
      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);
          SecMasterClient client = SecMasterClient.newBuilder()
                  .withCredential(auth)
                  .withRegion(SecMasterRegion.valueOf("<YOUR REGION>"))
                  .build();
          ShowIncidentRequest request = new ShowIncidentRequest();
          request.withWorkspaceId("{workspace_id}");
          request.withIncidentId("{incident_id}");
          try {
              ShowIncidentResponse response = client.showIncident(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 huaweicloudsdksecmaster.v1.region.secmaster_region import SecMasterRegion
  from huaweicloudsdkcore.exceptions import exceptions
  from huaweicloudsdksecmaster.v1 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 = SecMasterClient.new_builder() \
          .with_credentials(credentials) \
          .with_region(SecMasterRegion.value_of("<YOUR REGION>")) \
          .build()
      try:
          request = ShowIncidentRequest()
          request.workspace_id = "{workspace_id}"
          request.incident_id = "{incident_id}"
          response = client.show_incident(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"
      secmaster "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/secmaster/v1"
  "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/secmaster/v1/model"
      region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/secmaster/v1/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 := secmaster.SecMasterClientBuilder().
           WithRegion(region.ValueOf("<YOUR REGION>")).
           WithCredential(auth).
           SafeBuild()
      if err != nil {
          fmt.Println(err)
          return
      }
      client := secmaster.NewSecMasterClient(hcClient)
      request := &model.ShowIncidentRequest{}
  request.WorkspaceId = "{workspace_id}"
  request.IncidentId = "{incident_id}"
  response, err := client.ShowIncident(request)
  if err == nil {
          fmt.Printf("%+v\n", response)
      } else {
          fmt.Println(err)
      }
  }
  ```
- [更多]
  更多编程语言的SDK代码示例，请参见[API Explorer](https://console.huaweicloud.com/apiexplorer/#/openapi/SecMaster/sdk?api=ShowIncident&version=v1)的代码示例页签，可生成自动对应的SDK代码示例。
#### 状态码
| 状态码 | 描述              |
|:---|:---|
| 200 | 获取事件详情返回body体   |
| 400 | 获取事件详情错误返回body体 |
   
#### 错误码
请参见[错误码](https://support.huaweicloud.com/api-secmaster/ErrorCode.html)。
