Skip to content

Commit bd7f2f3

Browse files
Yamini PriyaMaxrovr
authored andcommitted
Added - Support for FC Redundancy Project
1 parent f000974 commit bd7f2f3

File tree

7 files changed

+69
-0
lines changed

7 files changed

+69
-0
lines changed

internal/integrationtest/core_virtual_circuit_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -654,6 +654,7 @@ func TestCoreVirtualCircuitResource_basic(t *testing.T) {
654654
resource.TestCheckResourceAttrSet(datasourceName, "virtual_circuits.0.time_created"),
655655
resource.TestCheckResourceAttr(datasourceName, "virtual_circuits.0.state", "PROVISIONED"),
656656
resource.TestCheckResourceAttr(datasourceName, "virtual_circuits.0.type", "PRIVATE"),
657+
resource.TestCheckResourceAttr(datasourceName, "virtual_circuits.0.virtual_circuit_redundancy_metadata.#", "0"),
657658
),
658659
},
659660
// verify singular datasource
@@ -690,6 +691,7 @@ func TestCoreVirtualCircuitResource_basic(t *testing.T) {
690691
resource.TestCheckResourceAttr(singularDatasourceName, "state", "PROVISIONED"),
691692
resource.TestCheckResourceAttrSet(singularDatasourceName, "time_created"),
692693
resource.TestCheckResourceAttr(singularDatasourceName, "type", "PRIVATE"),
694+
resource.TestCheckResourceAttrSet(singularDatasourceName, "virtual_circuit_redundancy_metadata.#"),
693695
),
694696
},
695697
// verify resource import

internal/service/core/core_virtual_circuit_data_source.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,5 +161,11 @@ func (s *CoreVirtualCircuitDataSourceCrud) SetData() error {
161161

162162
s.D.Set("type", s.Res.Type)
163163

164+
if s.Res.VirtualCircuitRedundancyMetadata != nil {
165+
s.D.Set("virtual_circuit_redundancy_metadata", []interface{}{VirtualCircuitRedundancyMetadataToMap(s.Res.VirtualCircuitRedundancyMetadata)})
166+
} else {
167+
s.D.Set("virtual_circuit_redundancy_metadata", nil)
168+
}
169+
164170
return nil
165171
}

internal/service/core/core_virtual_circuit_resource.go

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,31 @@ func CoreVirtualCircuitResource() *schema.Resource {
240240
Type: schema.TypeString,
241241
Computed: true,
242242
},
243+
"virtual_circuit_redundancy_metadata": {
244+
Type: schema.TypeList,
245+
Computed: true,
246+
Elem: &schema.Resource{
247+
Schema: map[string]*schema.Schema{
248+
// Required
249+
250+
// Optional
251+
252+
// Computed
253+
"configured_redundancy_level": {
254+
Type: schema.TypeString,
255+
Computed: true,
256+
},
257+
"ipv4bgp_session_redundancy_status": {
258+
Type: schema.TypeString,
259+
Computed: true,
260+
},
261+
"ipv6bgp_session_redundancy_status": {
262+
Type: schema.TypeString,
263+
Computed: true,
264+
},
265+
},
266+
},
267+
},
243268
},
244269
}
245270
}
@@ -826,6 +851,12 @@ func (s *CoreVirtualCircuitResourceCrud) SetData() error {
826851

827852
s.D.Set("type", s.Res.Type)
828853

854+
if s.Res.VirtualCircuitRedundancyMetadata != nil {
855+
s.D.Set("virtual_circuit_redundancy_metadata", []interface{}{VirtualCircuitRedundancyMetadataToMap(s.Res.VirtualCircuitRedundancyMetadata)})
856+
} else {
857+
s.D.Set("virtual_circuit_redundancy_metadata", nil)
858+
}
859+
829860
return nil
830861
}
831862

@@ -965,6 +996,18 @@ func CrossConnectMappingToMap(obj oci_core.CrossConnectMapping) map[string]inter
965996
return result
966997
}
967998

999+
func VirtualCircuitRedundancyMetadataToMap(obj *oci_core.VirtualCircuitRedundancyMetadata) map[string]interface{} {
1000+
result := map[string]interface{}{}
1001+
1002+
result["configured_redundancy_level"] = string(obj.ConfiguredRedundancyLevel)
1003+
1004+
result["ipv4bgp_session_redundancy_status"] = string(obj.Ipv4bgpSessionRedundancyStatus)
1005+
1006+
result["ipv6bgp_session_redundancy_status"] = string(obj.Ipv6bgpSessionRedundancyStatus)
1007+
1008+
return result
1009+
}
1010+
9681011
func publicPrefixesHashCodeForSets(v interface{}) int {
9691012
var buf bytes.Buffer
9701013
m := v.(map[string]interface{})

internal/service/core/core_virtual_circuits_data_source.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,12 @@ func (s *CoreVirtualCircuitsDataSourceCrud) SetData() error {
205205

206206
virtualCircuit["type"] = r.Type
207207

208+
if r.VirtualCircuitRedundancyMetadata != nil {
209+
virtualCircuit["virtual_circuit_redundancy_metadata"] = []interface{}{VirtualCircuitRedundancyMetadataToMap(r.VirtualCircuitRedundancyMetadata)}
210+
} else {
211+
virtualCircuit["virtual_circuit_redundancy_metadata"] = nil
212+
}
213+
208214
resources = append(resources, virtualCircuit)
209215
}
210216

website/docs/d/core_virtual_circuit.html.markdown

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,8 @@ The following attributes are exported:
8888
* `state` - The virtual circuit's current state. For information about the different states, see [FastConnect Overview](https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/fastconnect.htm).
8989
* `time_created` - The date and time the virtual circuit was created, in the format defined by [RFC3339](https://tools.ietf.org/html/rfc3339). Example: `2016-08-25T21:10:29.600Z`
9090
* `type` - Whether the virtual circuit supports private or public peering. For more information, see [FastConnect Overview](https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/fastconnect.htm).
91+
* `virtual_circuit_redundancy_metadata` - Redundancy level details of the virtual circuit
92+
* `configured_redundancy_level` - The configured redundancy level of the virtual circuit
93+
* `ipv4bgp_session_redundancy_status` - IPV4 BGP redundancy status indicates if the configured redundancy level is met
94+
* `ipv6bgp_session_redundancy_status` - IPV6 BGP redundancy status indicates if the configured redundancy level is met
9195

website/docs/d/core_virtual_circuits.html.markdown

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,4 +101,8 @@ The following attributes are exported:
101101
* `state` - The virtual circuit's current state. For information about the different states, see [FastConnect Overview](https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/fastconnect.htm).
102102
* `time_created` - The date and time the virtual circuit was created, in the format defined by [RFC3339](https://tools.ietf.org/html/rfc3339). Example: `2016-08-25T21:10:29.600Z`
103103
* `type` - Whether the virtual circuit supports private or public peering. For more information, see [FastConnect Overview](https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/fastconnect.htm).
104+
* `virtual_circuit_redundancy_metadata` - Redundancy level details of the virtual circuit
105+
* `configured_redundancy_level` - The configured redundancy level of the virtual circuit
106+
* `ipv4bgp_session_redundancy_status` - IPV4 BGP redundancy status indicates if the configured redundancy level is met
107+
* `ipv6bgp_session_redundancy_status` - IPV6 BGP redundancy status indicates if the configured redundancy level is met
104108

website/docs/r/core_virtual_circuit.html.markdown

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,10 @@ The following attributes are exported:
191191
* `state` - The virtual circuit's current state. For information about the different states, see [FastConnect Overview](https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/fastconnect.htm).
192192
* `time_created` - The date and time the virtual circuit was created, in the format defined by [RFC3339](https://tools.ietf.org/html/rfc3339). Example: `2016-08-25T21:10:29.600Z`
193193
* `type` - Whether the virtual circuit supports private or public peering. For more information, see [FastConnect Overview](https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/fastconnect.htm).
194+
* `virtual_circuit_redundancy_metadata` - Redundancy level details of the virtual circuit
195+
* `configured_redundancy_level` - The configured redundancy level of the virtual circuit
196+
* `ipv4bgp_session_redundancy_status` - IPV4 BGP redundancy status indicates if the configured redundancy level is met
197+
* `ipv6bgp_session_redundancy_status` - IPV6 BGP redundancy status indicates if the configured redundancy level is met
194198

195199
## Timeouts
196200

0 commit comments

Comments
 (0)