Skip to content

Commit

Permalink
dms_branch
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhukun-Huawei committed Nov 2, 2023
1 parent c14dba5 commit c9259f2
Show file tree
Hide file tree
Showing 4 changed files with 837 additions and 0 deletions.
34 changes: 34 additions & 0 deletions docs/data-sources/dms_maintainwindow.md
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.
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
}
`
Loading

0 comments on commit c9259f2

Please sign in to comment.