Skip to content

Commit

Permalink
region attribute change
Browse files Browse the repository at this point in the history
  • Loading branch information
anton-sidelnikov committed Apr 24, 2024
1 parent 7a40d85 commit 1f54fb7
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 20 deletions.
11 changes: 6 additions & 5 deletions docs/data-sources/apigw_api_history_v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ data "opentelekomcloud_apigw_api_history_v2" "hist" {

The following arguments are supported:

* `region` - (Optional, String) Specifies the region in which to query the APIG environment list.
If omitted, the provider-level region will be used.

* `gateway_id` - (Required, String) Specifies an ID of the APIGW dedicated instance to which the API
environment belongs.

Expand All @@ -51,8 +48,12 @@ In addition to all arguments above, the following attributes are exported:

* `id` - Data source ID.

* `history` - List of APIG history details. The structure is documented below.
* `history` - List of APIGW history details.
The [object](#history) structure is documented below.

* `region` - The region in which to APIs was published.

<a name="publishment_history"></a>
The `history` block supports:

* `id` - API version ID.
Expand All @@ -61,7 +62,7 @@ The `history` block supports:

* `description` - The description about the API publication.

* `publish_time` - Time when the APIG publication was created, in RFC-3339 format.
* `publish_time` - Time when the APIGW publication was created, in RFC-3339 format.

* `status` - Version status.
Values:
Expand Down
8 changes: 3 additions & 5 deletions docs/resources/apigw_api_publishment.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@ resource "opentelekomcloud_apigw_api_publishment_v2" "default" {

The following arguments are supported:

* `region` - (Optional, String, ForceNew) Specifies the region in which to publish APIs.
If omitted, the provider-level region will be used.
Changing this will create a new resource.

* `instance_id` - (Required, String, ForceNew) Specifies an ID of the APIGW dedicated instance to which the API belongs
to. Changing this will create a new resource.

Expand Down Expand Up @@ -78,8 +74,10 @@ In addition to all arguments above, the following attributes are exported:
* `history` - All publish history of the API.
The [object](#publishment_history) structure is documented below.

* `region` - The region in which to APIs was published.

<a name="publishment_history"></a>
The `histories` block supports:
The `history` block supports:

* `version_id` - The version ID of the API publish.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ func DataSourceApigwApiHistory() *schema.Resource {
ReadContext: dataSourceEnvironmentsRead,

Schema: map[string]*schema.Schema{
"region": {
Type: schema.TypeString,
Optional: true,
},
"gateway_id": {
Type: schema.TypeString,
Required: true,
Expand All @@ -39,6 +35,10 @@ func DataSourceApigwApiHistory() *schema.Resource {
Type: schema.TypeString,
Optional: true,
},
"region": {
Type: schema.TypeString,
Computed: true,
},
"history": {
Type: schema.TypeList,
Computed: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@ func ResourceAPIApiPublishmentV2() *schema.Resource {
},

Schema: map[string]*schema.Schema{
"region": {
Type: schema.TypeString,
Optional: true,
Computed: true,
ForceNew: true,
},
"gateway_id": {
Type: schema.TypeString,
Required: true,
Expand Down Expand Up @@ -91,6 +85,10 @@ func ResourceAPIApiPublishmentV2() *schema.Resource {
},
},
},
"region": {
Type: schema.TypeString,
Computed: true,
},
},
}
}
Expand Down Expand Up @@ -171,6 +169,7 @@ func ResourceApiPublishmentV2Read(ctx context.Context, d *schema.ResourceData, m
d.Set("description", publishInfo.Description),
d.Set("published_at", publishInfo.PublishTime),
d.Set("environment_name", publishInfo.EnvName),
d.Set("region", config.GetRegion(d)),
setApiPublishHistory(d, resp),
)

Expand Down

0 comments on commit 1f54fb7

Please sign in to comment.