Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,8 @@ golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200523222454-059865788121 h1:rITEj+UZHYC927n8GT97eC3zrpzXdb/voyeOuVKS46o=
golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f h1:v4INt8xihDGvnrfjMDVXGxw9wrfxYyCjk0KbXjhR55s=
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
Expand Down
16 changes: 16 additions & 0 deletions tencentcloud/data_source_tc_cfs_file_systems.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ func dataSourceTencentCloudCfsFileSystems() *schema.Resource {
Computed: true,
Description: "Size used of the file system.",
},
"mount_ip": {
Type: schema.TypeString,
Computed: true,
Description: "IP of the file system.",
},
},
},
},
Expand Down Expand Up @@ -185,6 +190,17 @@ func dataSourceTencentCloudCfsFileSystemsRead(d *schema.ResourceData, meta inter
"size_limit": fileSystem.SizeLimit,
"size_used": fileSystem.SizeByte,
}
targets, err := cfsService.DescribeMountTargets(ctx, *fileSystem.FileSystemId)
if err != nil {
return err
}
var mountTarget *cfs.MountInfo
if len(targets) > 0 {
mountTarget = targets[0]
}
if mountTarget != nil {
mapping["mount_ip"] = mountTarget.IpAddress
}
fileSystemList = append(fileSystemList, mapping)
ids = append(ids, *fileSystem.FileSystemId)
}
Expand Down
1 change: 1 addition & 0 deletions tencentcloud/data_source_tc_cfs_file_systems_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ func TestAccTencentCloudCfsFileSystemsDataSource(t *testing.T) {
resource.TestCheckResourceAttrSet("data.tencentcloud_cfs_file_systems.file_systems", "file_system_list.0.access_group_id"),
resource.TestCheckResourceAttrSet("data.tencentcloud_cfs_file_systems.file_systems", "file_system_list.0.status"),
resource.TestCheckResourceAttrSet("data.tencentcloud_cfs_file_systems.file_systems", "file_system_list.0.create_time"),
resource.TestCheckResourceAttrSet("data.tencentcloud_cfs_file_systems.file_systems", "file_system_list.0.mount_ip"),
),
},
},
Expand Down
1 change: 1 addition & 0 deletions website/docs/d/cfs_file_systems.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ In addition to all arguments above, the following attributes are exported:
* `availability_zone` - The available zone that the file system locates at.
* `create_time` - Creation time of the file system.
* `file_system_id` - ID of the file system.
* `mount_ip` - IP of the file system.
* `name` - Name of the file system.
* `protocol` - Protocol of the file system.
* `size_limit` - Size limit of the file system.
Expand Down