-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c14dba5
commit c9259f2
Showing
4 changed files
with
837 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,34 @@ | ||
--- | ||
subcategory: "Distributed Message Service (DMS)" | ||
--- | ||
|
||
# flexibleengine_dms_maintainwindow | ||
|
||
Use this data source to get the ID of an available FlexibleEngine dms maintainwindow. | ||
|
||
## Example Usage | ||
|
||
```hcl | ||
data "flexibleengine_dms_maintainwindow" "maintainwindow1" { | ||
seq = 1 | ||
} | ||
``` | ||
|
||
## Argument Reference | ||
|
||
* `region` - (Optional, String) The region in which to obtain the dms maintainwindows. If omitted, the provider-level | ||
region will be used. | ||
|
||
* `seq` - (Optional, Int) Indicates the sequential number of a maintenance time window. | ||
|
||
* `begin` - (Optional, String) Indicates the time at which a maintenance time window starts. | ||
|
||
* `end` - (Optional, String) Indicates the time at which a maintenance time window ends. | ||
|
||
* `default` - (Optional, Bool) Indicates whether a maintenance time window is set to the default time segment. | ||
|
||
## Attribute Reference | ||
|
||
In addition to all arguments above, the following attributes are exported: | ||
|
||
* `id` - Specifies a data source ID in UUID format. |
35 changes: 35 additions & 0 deletions
35
flexibleengine/acceptance/data_source_flexibleengine_dms_maintainwindow_test.go
This file contains 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,35 @@ | ||
package acceptance | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" | ||
|
||
"github.com/huaweicloud/terraform-provider-huaweicloud/huaweicloud/services/acceptance" | ||
) | ||
|
||
func TestAccDmsMaintainWindowDataSource_basic(t *testing.T) { | ||
dataSourceName := "data.flexibleengine_dms_maintainwindow.maintainwindow1" | ||
dc := acceptance.InitDataSourceCheck(dataSourceName) | ||
|
||
resource.ParallelTest(t, resource.TestCase{ | ||
PreCheck: func() { testAccPreCheck(t) }, | ||
ProviderFactories: TestAccProviderFactories, | ||
Steps: []resource.TestStep{ | ||
{ | ||
Config: testAccDmsMaintainWindowDataSource_basic, | ||
Check: resource.ComposeTestCheckFunc( | ||
dc.CheckResourceExists(), | ||
resource.TestCheckResourceAttr(dataSourceName, "seq", "1"), | ||
resource.TestCheckResourceAttr(dataSourceName, "begin", "22:00:00"), | ||
), | ||
}, | ||
}, | ||
}) | ||
} | ||
|
||
var testAccDmsMaintainWindowDataSource_basic = ` | ||
data "flexibleengine_dms_maintainwindow" "maintainwindow1" { | ||
seq = 1 | ||
} | ||
` |
Oops, something went wrong.