
# 设置Landing Zone - SetupLandingZone
#### 功能介绍
在当前区域创建或者更新Landing Zone。
#### 授权信息
账号根用户具备所有API的调用权限，如果使用账号下的IAM用户调用当前API，该IAM用户需具备如下身份策略权限，更多的权限说明请参见[权限和授权项](https://support.huaweicloud.com/api-rgc/rgc_02_0016.html)。
| 授权项                   | 访问级别  | 资源类型（\*为必须） | 条件键 | 别名 | 依赖的授权项 |
|:---|:---|:---|:---|:---|:---|
| rgc:landingZone:setup | Write | -           | -   | -  | -      |
   
#### URI
POST /v1/landing-zone/setup
#### 请求参数
表1请求Body参数 
| 参数                             | 是否必选 | 参数类型                                                                                                       | 描述                                                     |
|:---|:---|:---|:---|
| identity_store_email           | 否    | String                                                                                                     | 管理员纳管账号创建Identity Center用户所用邮箱。                        |
| home_region                    | 是    | String                                                                                                     | 主区域。                                                   |
| setup_landing_zone_action_type | 是    | String                                                                                                     | 设置Landing Zone的类型。CREATE:创建；REPAIR:修复；UPDATE:更新。       |
| region_configuration_list      | 是    | Array of [RegionConfigurationList] objects             | 当前纳管账号纳管的区域。                                           |
| identity_center_status         | 否    | String                                                                                                     | 是否设置Landing Zone的identity center。ENABLE:启用；DISABLE:禁用。 |
| organization_structure_type    | 否    | String                                                                                                     | 设置organization的类型。STANDARD:标准；NON_STANDARD:非标准。        |
| organization_structure         | 是    | Array of [OrganizationStructureBaseLine] objects | 基础环境的纳管账号体系。                                           |
| deny_ungoverned_regions        | 否    | Boolean                                                                                                    | 是否允许区域拒绝，默认false。                                      |
| cloud_trail_type               | 否    | Boolean                                                                                                    | 是否允许设置组织汇聚。                                            |
| kms_key_id                     | 否    | String                                                                                                     | 加密字段。                                                  |
| logging_configuration          | 是    | [LoggingConfiguration] object                             | Landing Zone日志配置。                                      |
| baseline_version               | 否    | String                                                                                                     | 基线版本                                                   |
   
 表2RegionConfigurationList 
| 参数                          | 是否必选 | 参数类型   | 描述                       |
|:---|:---|:---|:---|
| region                      | 是    | String | 区域名字。                    |
| region_configuration_status | 是    | String | 区域状态，ENABLE启用，DISABLE禁用。 |
   
 表3OrganizationStructureBaseLine 
| 参数                       | 是否必选 | 参数类型                                                                           | 描述                                                  |
|:---|:---|:---|:---|
| organizational_unit_name | 否    | String                                                                         | 注册OU名称。                                             |
| organizational_unit_type | 是    | String                                                                         | 可设置的注册OU类型。包括核心注册OU和自定义注册OU。CORE:核心注册；CUSTOM:自定义注册。 |
| accounts                 | 否    | Array of [AccountBaseline] objects | 纳管账号基本信息。                                           |
   
 表4AccountBaseline 
| 参数            | 是否必选 | 参数类型   | 描述                                                        |
|:---|:---|:---|:---|
| account_name  | 是    | String | 纳管账号名称。                                                   |
| account_id    | 否    | String | 纳管账号的唯一标识符（ID）。                                           |
| phone         | 否    | String | 手机号码。                                                     |
| account_email | 否    | String | 纳管账号邮箱。                                                   |
| account_type  | 是    | String | 纳管账号类型。类型包括LOGGING，SECURITY。LOGGING:日志记录账号；SECURITY:安全账号。 |
   
 表5LoggingConfiguration 
| 参数                    | 是否必选 | 参数类型                                                                                         | 描述        |
|:---|:---|:---|:---|
| logging_bucket_name   | 否    | String                                                                                       | 日志桶名称。    |
| access_logging_bucket | 否    | [AccessLoggingBucketBaseline] object | 访问日志基础设置。 |
| logging_bucket        | 否    | [LoggingBucketBaseline] object             | 日志基础设置。   |
   
 表6AccessLoggingBucketBaseline 
| 参数              | 是否必选 | 参数类型    | 描述         |
|:---|:---|:---|:---|
| retention_days  | 是    | Integer | 桶保留天数。     |
| enable_multi_az | 否    | Boolean | 是否允许多AZ存储。 |
   
 表7LoggingBucketBaseline 
| 参数              | 是否必选 | 参数类型    | 描述         |
|:---|:---|:---|:---|
| retention_days  | 是    | Integer | 桶保留天数。     |
| enable_multi_az | 否    | Boolean | 是否允许多AZ存储。 |
   
#### 响应参数
**状态码：200**
请求成功。
**状态码：403**
表8响应Body参数 
| 参数                            | 参数类型                                                                                      | 描述           |
|:---|:---|:---|
| error_code                    | String                                                                                    | 错误码          |
| error_msg                     | String                                                                                    | 错误信息         |
| request_id                    | String                                                                                    | 请求唯一标识       |
| encoded_authorization_message | String                                                                                    | 加密的错误信息      |
| details                       | Array of [ForbiddenErrorDetail] objects | 跨服务调用无权限错误信息 |
   
 表9ForbiddenErrorDetail 
| 参数         | 参数类型   | 描述   |
|:---|:---|:---|
| error_code | String | 错误码  |
| error_msg  | String | 错误信息 |
   
#### 请求示例
在当前区域创建或者更新Landing Zone。
```
POST https://{endpoint}/v1/landing-zone/setup
{
  "identity_store_email" : "string",
  "home_region" : "string",
  "setup_landing_zone_action_type" : "string",
  "region_configuration_list" : [ {
    "region" : "string",
    "region_configuration_status" : "ENABLED"
  } ],
  "organization_structure" : [ {
    "organizational_unit_name" : "string",
    "organizational_unit_type" : "CORE",
    "accounts" : [ {
      "account_name" : "string",
      "account_id" : "string",
      "phone" : "string",
      "account_email" : "string",
      "account_type" : "LOGGING"
    } ]
  } ],
  "deny_ungoverned_regions" : false,
  "cloud_trail_type" : true,
  "kms_key_id" : "",
  "logging_configuration" : {
    "logging_bucket" : {
      "retention_days" : 5475
    },
    "access_logging_bucket" : {
      "retention_days" : 5475
    }
  }
}
```
#### 响应示例
无
#### 状态码
| 状态码 | 描述     |
|:---|:---|
| 200 | 请求成功。  |
| 403 | 请求无权限。 |
   
#### 错误码
请参见[错误码](https://support.huaweicloud.com/api-rgc/ErrorCode.html)。
