-
Notifications
You must be signed in to change notification settings - Fork 140
feat(teo): [122612515] support zone datasource #3248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
```release-note:new-data-source | ||
tencentcloud_teo_zones | ||
``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
Use this data source to query detailed information of teo zoneAvailablePlans | ||
|
||
Example Usage | ||
|
||
```hcl | ||
data "tencentcloud_teo_zones" "teo_zones" { | ||
filters { | ||
name = "zone-id" | ||
values = ["zone-39quuimqg8r6"] | ||
} | ||
|
||
filters { | ||
name = "tag-key" | ||
values = ["createdBy"] | ||
} | ||
|
||
filters { | ||
name = "tag-value" | ||
values = ["terraform"] | ||
} | ||
} | ||
``` |
1 change: 1 addition & 0 deletions
1
tencentcloud/services/teo/data_source_tc_teo_zones_extension.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
package teo |
36 changes: 36 additions & 0 deletions
36
tencentcloud/services/teo/data_source_tc_teo_zones_test.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package teo_test | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" | ||
tcacctest "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/acctest" | ||
) | ||
|
||
func TestAccTencentCloudTeoZonesDataSource_basic(t *testing.T) { | ||
t.Parallel() | ||
resource.Test(t, resource.TestCase{ | ||
PreCheck: func() { | ||
tcacctest.AccPreCheck(t) | ||
}, | ||
Providers: tcacctest.AccProviders, | ||
Steps: []resource.TestStep{ | ||
{ | ||
Config: testAccTeoZonesDataSource, | ||
Check: resource.ComposeTestCheckFunc( | ||
tcacctest.AccCheckTencentCloudDataSourceID("data.tencentcloud_teo_zones.teo_zones"), | ||
), | ||
}, | ||
}, | ||
}) | ||
} | ||
|
||
const testAccTeoZonesDataSource = ` | ||
|
||
data "tencentcloud_teo_zones" "teo_zones" { | ||
filters { | ||
name = "tag-value" | ||
values = ["terraform"] | ||
} | ||
} | ||
` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
--- | ||
subcategory: "TencentCloud EdgeOne(TEO)" | ||
layout: "tencentcloud" | ||
page_title: "TencentCloud: tencentcloud_teo_zones" | ||
sidebar_current: "docs-tencentcloud-datasource-teo_zones" | ||
description: |- | ||
Use this data source to query detailed information of teo zoneAvailablePlans | ||
--- | ||
|
||
# tencentcloud_teo_zones | ||
|
||
Use this data source to query detailed information of teo zoneAvailablePlans | ||
|
||
## Example Usage | ||
|
||
```hcl | ||
data "tencentcloud_teo_zones" "teo_zones" { | ||
filters { | ||
name = "zone-id" | ||
values = ["zone-39quuimqg8r6"] | ||
} | ||
|
||
filters { | ||
name = "tag-key" | ||
values = ["createdBy"] | ||
} | ||
|
||
filters { | ||
name = "tag-value" | ||
values = ["terraform"] | ||
} | ||
} | ||
``` | ||
|
||
## Argument Reference | ||
|
||
The following arguments are supported: | ||
|
||
* `direction` - (Optional, String) Sort direction. If the field value is a number, sort by the numeric value. If the field value is text, sort by the ascill code. Values include: `asc`: From the smallest to largest; `desc`: From the largest to smallest. Default value: `desc`. | ||
* `filters` - (Optional, List) Filter criteria. the maximum value of Filters.Values is 20. if this parameter is left empty, all site information authorized under the current appid will be returned. detailed filter criteria are as follows: zone-name: filter by site name; zone-id: filter by site id. the site id is in the format of zone-2noz78a8ev6k; status: filter by site status; tag-key: filter by tag key; tag-value: filter by tag value; alias-zone-name: filter by identical site identifier. when performing a fuzzy query, the fields that support filtering are named zone-name or alias-zone-name. | ||
* `order` - (Optional, String) Sort the returned results according to this field. Values include: `type`: Connection mode; `area`: Acceleration region; `create-time`: Creation time; `zone-name`: Site name; `use-time`: Last used time; `active-status` Effective status. Default value: `create-time`. | ||
* `result_output_file` - (Optional, String) Used to save results. | ||
|
||
The `filters` object supports the following: | ||
|
||
* `name` - (Required, String) Field to be filtered. | ||
* `values` - (Required, Set) Value of the filtered field. | ||
* `fuzzy` - (Optional, Bool) Whether to enable fuzzy query. | ||
|
||
## Attributes Reference | ||
|
||
In addition to all arguments above, the following attributes are exported: | ||
|
||
* `zones` - Details of sites. | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
加个重试?