@@ -205,6 +205,58 @@ Format: 'projects/{{projectId}}/locations/{{location}}/backupVaults/{{backupVaul
205205 },
206206 },
207207 },
208+ "hybrid_replication_parameters" : {
209+ Type : schema .TypeList ,
210+ Optional : true ,
211+ Description : `The Hybrid Replication parameters for the volume.` ,
212+ MaxItems : 1 ,
213+ Elem : & schema.Resource {
214+ Schema : map [string ]* schema.Schema {
215+ "cluster_location" : {
216+ Type : schema .TypeString ,
217+ Optional : true ,
218+ Description : `Optional. Name of source cluster location associated with the Hybrid replication. This is a free-form field for the display purpose only.` ,
219+ },
220+ "description" : {
221+ Type : schema .TypeString ,
222+ Optional : true ,
223+ Description : `Optional. Description of the replication.` ,
224+ },
225+ "labels" : {
226+ Type : schema .TypeMap ,
227+ Optional : true ,
228+ Description : `Optional. Labels to be added to the replication as the key value pairs.
229+ An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.` ,
230+ Elem : & schema.Schema {Type : schema .TypeString },
231+ },
232+ "peer_cluster_name" : {
233+ Type : schema .TypeString ,
234+ Optional : true ,
235+ Description : `Required. Name of the user's local source cluster to be peered with the destination cluster.` ,
236+ },
237+ "peer_ip_addresses" : {
238+ Type : schema .TypeString ,
239+ Optional : true ,
240+ Description : `Required. List of node ip addresses to be peered with.` ,
241+ },
242+ "peer_svm_name" : {
243+ Type : schema .TypeString ,
244+ Optional : true ,
245+ Description : `Required. Name of the user's local source vserver svm to be peered with the destination vserver svm.` ,
246+ },
247+ "peer_volume_name" : {
248+ Type : schema .TypeString ,
249+ Optional : true ,
250+ Description : `Required. Name of the user's local source volume to be peered with the destination volume.` ,
251+ },
252+ "replication" : {
253+ Type : schema .TypeString ,
254+ Optional : true ,
255+ Description : `Required. Desired name for the replication of this volume.` ,
256+ },
257+ },
258+ },
259+ },
208260 "kerberos_enabled" : {
209261 Type : schema .TypeBool ,
210262 Optional : true ,
@@ -713,6 +765,12 @@ func resourceNetappVolumeCreate(d *schema.ResourceData, meta interface{}) error
713765 } else if v , ok := d .GetOkExists ("tiering_policy" ); ! tpgresource .IsEmptyValue (reflect .ValueOf (tieringPolicyProp )) && (ok || ! reflect .DeepEqual (v , tieringPolicyProp )) {
714766 obj ["tieringPolicy" ] = tieringPolicyProp
715767 }
768+ hybridReplicationParametersProp , err := expandNetappVolumeHybridReplicationParameters (d .Get ("hybrid_replication_parameters" ), d , config )
769+ if err != nil {
770+ return err
771+ } else if v , ok := d .GetOkExists ("hybrid_replication_parameters" ); ! tpgresource .IsEmptyValue (reflect .ValueOf (hybridReplicationParametersProp )) && (ok || ! reflect .DeepEqual (v , hybridReplicationParametersProp )) {
772+ obj ["hybridReplicationParameters" ] = hybridReplicationParametersProp
773+ }
716774 labelsProp , err := expandNetappVolumeEffectiveLabels (d .Get ("effective_labels" ), d , config )
717775 if err != nil {
718776 return err
@@ -926,6 +984,9 @@ func resourceNetappVolumeRead(d *schema.ResourceData, meta interface{}) error {
926984 if err := d .Set ("tiering_policy" , flattenNetappVolumeTieringPolicy (res ["tieringPolicy" ], d , config )); err != nil {
927985 return fmt .Errorf ("Error reading Volume: %s" , err )
928986 }
987+ if err := d .Set ("hybrid_replication_parameters" , flattenNetappVolumeHybridReplicationParameters (res ["hybridReplicationParameters" ], d , config )); err != nil {
988+ return fmt .Errorf ("Error reading Volume: %s" , err )
989+ }
929990 if err := d .Set ("terraform_labels" , flattenNetappVolumeTerraformLabels (res ["labels" ], d , config )); err != nil {
930991 return fmt .Errorf ("Error reading Volume: %s" , err )
931992 }
@@ -1030,6 +1091,12 @@ func resourceNetappVolumeUpdate(d *schema.ResourceData, meta interface{}) error
10301091 } else if v , ok := d .GetOkExists ("tiering_policy" ); ! tpgresource .IsEmptyValue (reflect .ValueOf (v )) && (ok || ! reflect .DeepEqual (v , tieringPolicyProp )) {
10311092 obj ["tieringPolicy" ] = tieringPolicyProp
10321093 }
1094+ hybridReplicationParametersProp , err := expandNetappVolumeHybridReplicationParameters (d .Get ("hybrid_replication_parameters" ), d , config )
1095+ if err != nil {
1096+ return err
1097+ } else if v , ok := d .GetOkExists ("hybrid_replication_parameters" ); ! tpgresource .IsEmptyValue (reflect .ValueOf (v )) && (ok || ! reflect .DeepEqual (v , hybridReplicationParametersProp )) {
1098+ obj ["hybridReplicationParameters" ] = hybridReplicationParametersProp
1099+ }
10331100 labelsProp , err := expandNetappVolumeEffectiveLabels (d .Get ("effective_labels" ), d , config )
10341101 if err != nil {
10351102 return err
@@ -1101,6 +1168,10 @@ func resourceNetappVolumeUpdate(d *schema.ResourceData, meta interface{}) error
11011168 "tiering_policy.tier_action" )
11021169 }
11031170
1171+ if d .HasChange ("hybrid_replication_parameters" ) {
1172+ updateMask = append (updateMask , "hybridReplicationParameters" )
1173+ }
1174+
11041175 if d .HasChange ("effective_labels" ) {
11051176 updateMask = append (updateMask , "labels" )
11061177 }
@@ -1836,6 +1907,65 @@ func flattenNetappVolumeTieringPolicyTierAction(v interface{}, d *schema.Resourc
18361907 return v
18371908}
18381909
1910+ func flattenNetappVolumeHybridReplicationParameters (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
1911+ if v == nil {
1912+ return nil
1913+ }
1914+ original := v .(map [string ]interface {})
1915+ if len (original ) == 0 {
1916+ return nil
1917+ }
1918+ transformed := make (map [string ]interface {})
1919+ transformed ["replication" ] =
1920+ flattenNetappVolumeHybridReplicationParametersReplication (original ["replication" ], d , config )
1921+ transformed ["peer_volume_name" ] =
1922+ flattenNetappVolumeHybridReplicationParametersPeerVolumeName (original ["peerVolumeName" ], d , config )
1923+ transformed ["peer_cluster_name" ] =
1924+ flattenNetappVolumeHybridReplicationParametersPeerClusterName (original ["peerClusterName" ], d , config )
1925+ transformed ["peer_svm_name" ] =
1926+ flattenNetappVolumeHybridReplicationParametersPeerSvmName (original ["peerSvmName" ], d , config )
1927+ transformed ["peer_ip_addresses" ] =
1928+ flattenNetappVolumeHybridReplicationParametersPeerIpAddresses (original ["peerIpAddresses" ], d , config )
1929+ transformed ["cluster_location" ] =
1930+ flattenNetappVolumeHybridReplicationParametersClusterLocation (original ["clusterLocation" ], d , config )
1931+ transformed ["description" ] =
1932+ flattenNetappVolumeHybridReplicationParametersDescription (original ["description" ], d , config )
1933+ transformed ["labels" ] =
1934+ flattenNetappVolumeHybridReplicationParametersLabels (original ["labels" ], d , config )
1935+ return []interface {}{transformed }
1936+ }
1937+ func flattenNetappVolumeHybridReplicationParametersReplication (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
1938+ return v
1939+ }
1940+
1941+ func flattenNetappVolumeHybridReplicationParametersPeerVolumeName (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
1942+ return v
1943+ }
1944+
1945+ func flattenNetappVolumeHybridReplicationParametersPeerClusterName (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
1946+ return v
1947+ }
1948+
1949+ func flattenNetappVolumeHybridReplicationParametersPeerSvmName (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
1950+ return v
1951+ }
1952+
1953+ func flattenNetappVolumeHybridReplicationParametersPeerIpAddresses (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
1954+ return v
1955+ }
1956+
1957+ func flattenNetappVolumeHybridReplicationParametersClusterLocation (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
1958+ return v
1959+ }
1960+
1961+ func flattenNetappVolumeHybridReplicationParametersDescription (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
1962+ return v
1963+ }
1964+
1965+ func flattenNetappVolumeHybridReplicationParametersLabels (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
1966+ return v
1967+ }
1968+
18391969func flattenNetappVolumeTerraformLabels (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
18401970 if v == nil {
18411971 return v
@@ -2417,6 +2547,113 @@ func expandNetappVolumeTieringPolicyTierAction(v interface{}, d tpgresource.Terr
24172547 return v , nil
24182548}
24192549
2550+ func expandNetappVolumeHybridReplicationParameters (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
2551+ l := v .([]interface {})
2552+ if len (l ) == 0 || l [0 ] == nil {
2553+ return nil , nil
2554+ }
2555+ raw := l [0 ]
2556+ original := raw .(map [string ]interface {})
2557+ transformed := make (map [string ]interface {})
2558+
2559+ transformedReplication , err := expandNetappVolumeHybridReplicationParametersReplication (original ["replication" ], d , config )
2560+ if err != nil {
2561+ return nil , err
2562+ } else if val := reflect .ValueOf (transformedReplication ); val .IsValid () && ! tpgresource .IsEmptyValue (val ) {
2563+ transformed ["replication" ] = transformedReplication
2564+ }
2565+
2566+ transformedPeerVolumeName , err := expandNetappVolumeHybridReplicationParametersPeerVolumeName (original ["peer_volume_name" ], d , config )
2567+ if err != nil {
2568+ return nil , err
2569+ } else if val := reflect .ValueOf (transformedPeerVolumeName ); val .IsValid () && ! tpgresource .IsEmptyValue (val ) {
2570+ transformed ["peerVolumeName" ] = transformedPeerVolumeName
2571+ }
2572+
2573+ transformedPeerClusterName , err := expandNetappVolumeHybridReplicationParametersPeerClusterName (original ["peer_cluster_name" ], d , config )
2574+ if err != nil {
2575+ return nil , err
2576+ } else if val := reflect .ValueOf (transformedPeerClusterName ); val .IsValid () && ! tpgresource .IsEmptyValue (val ) {
2577+ transformed ["peerClusterName" ] = transformedPeerClusterName
2578+ }
2579+
2580+ transformedPeerSvmName , err := expandNetappVolumeHybridReplicationParametersPeerSvmName (original ["peer_svm_name" ], d , config )
2581+ if err != nil {
2582+ return nil , err
2583+ } else if val := reflect .ValueOf (transformedPeerSvmName ); val .IsValid () && ! tpgresource .IsEmptyValue (val ) {
2584+ transformed ["peerSvmName" ] = transformedPeerSvmName
2585+ }
2586+
2587+ transformedPeerIpAddresses , err := expandNetappVolumeHybridReplicationParametersPeerIpAddresses (original ["peer_ip_addresses" ], d , config )
2588+ if err != nil {
2589+ return nil , err
2590+ } else if val := reflect .ValueOf (transformedPeerIpAddresses ); val .IsValid () && ! tpgresource .IsEmptyValue (val ) {
2591+ transformed ["peerIpAddresses" ] = transformedPeerIpAddresses
2592+ }
2593+
2594+ transformedClusterLocation , err := expandNetappVolumeHybridReplicationParametersClusterLocation (original ["cluster_location" ], d , config )
2595+ if err != nil {
2596+ return nil , err
2597+ } else if val := reflect .ValueOf (transformedClusterLocation ); val .IsValid () && ! tpgresource .IsEmptyValue (val ) {
2598+ transformed ["clusterLocation" ] = transformedClusterLocation
2599+ }
2600+
2601+ transformedDescription , err := expandNetappVolumeHybridReplicationParametersDescription (original ["description" ], d , config )
2602+ if err != nil {
2603+ return nil , err
2604+ } else if val := reflect .ValueOf (transformedDescription ); val .IsValid () && ! tpgresource .IsEmptyValue (val ) {
2605+ transformed ["description" ] = transformedDescription
2606+ }
2607+
2608+ transformedLabels , err := expandNetappVolumeHybridReplicationParametersLabels (original ["labels" ], d , config )
2609+ if err != nil {
2610+ return nil , err
2611+ } else if val := reflect .ValueOf (transformedLabels ); val .IsValid () && ! tpgresource .IsEmptyValue (val ) {
2612+ transformed ["labels" ] = transformedLabels
2613+ }
2614+
2615+ return transformed , nil
2616+ }
2617+
2618+ func expandNetappVolumeHybridReplicationParametersReplication (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
2619+ return v , nil
2620+ }
2621+
2622+ func expandNetappVolumeHybridReplicationParametersPeerVolumeName (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
2623+ return v , nil
2624+ }
2625+
2626+ func expandNetappVolumeHybridReplicationParametersPeerClusterName (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
2627+ return v , nil
2628+ }
2629+
2630+ func expandNetappVolumeHybridReplicationParametersPeerSvmName (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
2631+ return v , nil
2632+ }
2633+
2634+ func expandNetappVolumeHybridReplicationParametersPeerIpAddresses (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
2635+ return v , nil
2636+ }
2637+
2638+ func expandNetappVolumeHybridReplicationParametersClusterLocation (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
2639+ return v , nil
2640+ }
2641+
2642+ func expandNetappVolumeHybridReplicationParametersDescription (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
2643+ return v , nil
2644+ }
2645+
2646+ func expandNetappVolumeHybridReplicationParametersLabels (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (map [string ]string , error ) {
2647+ if v == nil {
2648+ return map [string ]string {}, nil
2649+ }
2650+ m := make (map [string ]string )
2651+ for k , val := range v .(map [string ]interface {}) {
2652+ m [k ] = val .(string )
2653+ }
2654+ return m , nil
2655+ }
2656+
24202657func expandNetappVolumeEffectiveLabels (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (map [string ]string , error ) {
24212658 if v == nil {
24222659 return map [string ]string {}, nil
0 commit comments