diff --git a/ovh/data_cloud_project_volumes.go b/ovh/data_cloud_project_volumes.go index df75f052..5fda96c4 100644 --- a/ovh/data_cloud_project_volumes.go +++ b/ovh/data_cloud_project_volumes.go @@ -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), } diff --git a/ovh/data_cloud_project_volumes_gen.go b/ovh/data_cloud_project_volumes_gen.go index 26663bcc..cd2d8009 100644 --- a/ovh/data_cloud_project_volumes_gen.go +++ b/ovh/data_cloud_project_volumes_gen.go @@ -19,7 +19,7 @@ import ( func CloudProjectVolumesDataSourceSchema(ctx context.Context) schema.Schema { attrs := map[string]schema.Attribute{ - "cloud_project_volumes": schema.SetNestedAttribute{ + "volumes": schema.SetNestedAttribute{ NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ @@ -70,15 +70,15 @@ func CloudProjectVolumesDataSourceSchema(ctx context.Context) schema.Schema { } type CloudProjectVolumesModel struct { - CloudProjectVolumes ovhtypes.TfListNestedValue[CloudProjectVolumesValue] `tfsdk:"cloud_project_volumes" json:"cloudProjectVolumes"` - RegionName ovhtypes.TfStringValue `tfsdk:"region_name" json:"regionName"` - ServiceName ovhtypes.TfStringValue `tfsdk:"service_name" json:"serviceName"` + Volumes ovhtypes.TfListNestedValue[CloudProjectVolumesValue] `tfsdk:"volumes" json:"cloudProjectVolumes"` + RegionName ovhtypes.TfStringValue `tfsdk:"region_name" json:"regionName"` + ServiceName ovhtypes.TfStringValue `tfsdk:"service_name" json:"serviceName"` } func (v *CloudProjectVolumesModel) MergeWith(other *CloudProjectVolumesModel) { - if (v.CloudProjectVolumes.IsUnknown() || v.CloudProjectVolumes.IsNull()) && !other.CloudProjectVolumes.IsUnknown() { - v.CloudProjectVolumes = other.CloudProjectVolumes + if (v.Volumes.IsUnknown() || v.Volumes.IsNull()) && !other.Volumes.IsUnknown() { + v.Volumes = other.Volumes } if (v.RegionName.IsUnknown() || v.RegionName.IsNull()) && !other.RegionName.IsUnknown() { diff --git a/ovh/data_cloud_project_volumes_test.go b/ovh/data_cloud_project_volumes_test.go index 28656ad9..ccdda79a 100644 --- a/ovh/data_cloud_project_volumes_test.go +++ b/ovh/data_cloud_project_volumes_test.go @@ -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"), ), }, }, diff --git a/website/docs/d/cloud_project_volumes.html.markdown b/website/docs/d/cloud_project_volumes.html.markdown index baa8285e..5d5deae2 100644 --- a/website/docs/d/cloud_project_volumes.html.markdown +++ b/website/docs/d/cloud_project_volumes.html.markdown @@ -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.