Skip to content

Commit

Permalink
Merge pull request #758 from ovh/dev/aamstutz/fix-cloud-project-volumes
Browse files Browse the repository at this point in the history
fix: d/ovh_cloud_project_volumes had inconsistent fields and tests were wrong
  • Loading branch information
amstuta authored Oct 18, 2024
2 parents 98acfe3 + 8127b31 commit 0f5644b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion ovh/data_cloud_project_volumes.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func (d *cloudProjectVolumesDataSource) Read(ctx context.Context, req datasource
b = append(b, a)
}

data.CloudProjectVolumes = ovhtypes.TfListNestedValue[CloudProjectVolumesValue]{
data.Volumes = ovhtypes.TfListNestedValue[CloudProjectVolumesValue]{
ListValue: basetypes.NewListValueMust(CloudProjectVolumesValue{}.Type(ctx), b),
}

Expand Down
12 changes: 6 additions & 6 deletions ovh/data_cloud_project_volumes_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ovh/data_cloud_project_volumes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func TestAccDataSourceCloudProjectVolumes_basic(t *testing.T) {
Check: resource.ComposeAggregateTestCheckFunc(
resource.TestCheckResourceAttr("data.ovh_cloud_project_volumes.volume", "region_name", os.Getenv("OVH_CLOUD_PROJECT_REGION_TEST")),
resource.TestCheckResourceAttrSet("data.ovh_cloud_project_volumes.volume", "volumes.0.name"),
resource.TestCheckResourceAttrSet("data.ovh_cloud_project_volumes.volume", "volumes.0.volume_id"),
resource.TestCheckResourceAttrSet("data.ovh_cloud_project_volumes.volume", "volumes.0.id"),
),
},
},
Expand Down
6 changes: 2 additions & 4 deletions website/docs/d/cloud_project_volumes.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,18 @@ Get all the volume from a region of a public cloud project
data "ovh_cloud_project_volume" "volume" {
region_name = "xxx"
service_name = "yyy"
volume_id = "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"
}
```

## Argument Reference

* `service_name` - (Required) The id of the public cloud project.
* `region_name` - (Required) A valid OVHcloud public cloud region name in which the volume is available. Ex.: "GRA11".
* `volume_id` - (Required) Volume id to get the informations
* `region_name` - (Required) A valid OVHcloud public cloud region name in which the volumes are available. Ex.: "GRA11".

## Attributes Reference
* `volumes` -
* `name` - The name of the volume
* `size` - The size of the volume
* `id` - The id of the volume
* `region_name` - The region name where volume is available
* `region_name` - The region name where volumes are available
* `service_name` - The id of the public cloud project.

0 comments on commit 0f5644b

Please sign in to comment.