Skip to content

Commit

Permalink
misc: resolving merge conflict in provider.go file
Browse files Browse the repository at this point in the history
  • Loading branch information
srushti-patl committed Feb 13, 2024
2 parents a2797d8 + df3c52d commit bd7ec3e
Show file tree
Hide file tree
Showing 8 changed files with 885 additions and 0 deletions.
100 changes: 100 additions & 0 deletions docs/data-sources/equinix_fabric_network.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "equinix_fabric_network Data Source - terraform-provider-equinix"
subcategory: "Fabric"
description: |-
Fabric V4 API compatible data resource that allow user to fetch Fabric Network for a given UUID
---

# equinix_fabric_network (Data Source)

Fabric V4 API compatible data resource that allow user to fetch Fabric Network for a given UUID

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `uuid` (String) Equinix-assigned network identifier

### Read-Only

- `change` (Set of Object) Information on asset change operation (see [below for nested schema](#nestedatt--change))
- `change_log` (Set of Object) A permanent record of asset creation, modification, or deletion (see [below for nested schema](#nestedatt--change_log))
- `connections_count` (Number) Number of connections associated with this network
- `href` (String) Fabric Network URI information
- `id` (String) The ID of this resource.
- `location` (Set of Object) Fabric Network location (see [below for nested schema](#nestedatt--location))
- `name` (String) Fabric Network name. An alpha-numeric 24 characters string which can include only hyphens and underscores
- `notifications` (List of Object) Preferences for notifications on Fabric Network configuration or status changes (see [below for nested schema](#nestedatt--notifications))
- `operation` (Set of Object) Network operation information that is associated with this Fabric Network (see [below for nested schema](#nestedatt--operation))
- `project` (Set of Object) Fabric Network project (see [below for nested schema](#nestedatt--project))
- `scope` (String) Fabric Network scope
- `state` (String) Fabric Network overall state
- `type` (String) Supported Network types - EVPLAN, EPLAN, IPWAN

<a id="nestedatt--change"></a>
### Nested Schema for `change`

Read-Only:

- `href` (String)
- `type` (String)
- `uuid` (String)


<a id="nestedatt--change_log"></a>
### Nested Schema for `change_log`

Read-Only:

- `created_by` (String)
- `created_by_email` (String)
- `created_by_full_name` (String)
- `created_date_time` (String)
- `deleted_by` (String)
- `deleted_by_email` (String)
- `deleted_by_full_name` (String)
- `deleted_date_time` (String)
- `updated_by` (String)
- `updated_by_email` (String)
- `updated_by_full_name` (String)
- `updated_date_time` (String)


<a id="nestedatt--location"></a>
### Nested Schema for `location`

Read-Only:

- `ibx` (String)
- `metro_code` (String)
- `metro_name` (String)
- `region` (String)


<a id="nestedatt--notifications"></a>
### Nested Schema for `notifications`

Read-Only:

- `emails` (List of String)
- `send_interval` (String)
- `type` (String)


<a id="nestedatt--operation"></a>
### Nested Schema for `operation`

Read-Only:

- `equinix_status` (String)


<a id="nestedatt--project"></a>
### Nested Schema for `project`

Read-Only:

- `project_id` (String)

117 changes: 117 additions & 0 deletions docs/resources/equinix_fabric_network.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "equinix_fabric_network Resource - terraform-provider-equinix"
subcategory: "Fabric"
description: |-
Fabric V4 API compatible resource allows creation and management of Equinix Fabric Network
---

# equinix_fabric_network (Resource)

Fabric V4 API compatible resource allows creation and management of Equinix Fabric Network

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `name` (String) Fabric Network name. An alpha-numeric 24 characters string which can include only hyphens and underscores
- `notifications` (Block List, Min: 1) Preferences for notifications on Fabric Network configuration or status changes (see [below for nested schema](#nestedblock--notifications))
- `project` (Block Set, Min: 1) Fabric Network project (see [below for nested schema](#nestedblock--project))
- `scope` (String) Fabric Network scope
- `type` (String) Supported Network types - EVPLAN, EPLAN, IPWAN

### Optional

- `location` (Block Set, Max: 1) Fabric Network location (see [below for nested schema](#nestedblock--location))
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

### Read-Only

- `change` (Set of Object) Information on asset change operation (see [below for nested schema](#nestedatt--change))
- `change_log` (Set of Object) A permanent record of asset creation, modification, or deletion (see [below for nested schema](#nestedatt--change_log))
- `connections_count` (Number) Number of connections associated with this network
- `href` (String) Fabric Network URI information
- `id` (String) The ID of this resource.
- `operation` (Set of Object) Network operation information that is associated with this Fabric Network (see [below for nested schema](#nestedatt--operation))
- `state` (String) Fabric Network overall state
- `uuid` (String) Equinix-assigned network identifier

<a id="nestedblock--notifications"></a>
### Nested Schema for `notifications`

Required:

- `emails` (List of String) Array of contact emails
- `type` (String) Notification Type - ALL,CONNECTION_APPROVAL,SALES_REP_NOTIFICATIONS, NOTIFICATIONS

Optional:

- `send_interval` (String) Send interval


<a id="nestedblock--project"></a>
### Nested Schema for `project`

Required:

- `project_id` (String) Customer project identifier


<a id="nestedblock--location"></a>
### Nested Schema for `location`

Optional:

- `ibx` (String) IBX Code
- `metro_code` (String) Access point metro code
- `metro_name` (String) Access point metro name
- `region` (String) Access point region


<a id="nestedblock--timeouts"></a>
### Nested Schema for `timeouts`

Optional:

- `create` (String)
- `delete` (String)
- `read` (String)
- `update` (String)


<a id="nestedatt--change"></a>
### Nested Schema for `change`

Read-Only:

- `href` (String)
- `type` (String)
- `uuid` (String)


<a id="nestedatt--change_log"></a>
### Nested Schema for `change_log`

Read-Only:

- `created_by` (String)
- `created_by_email` (String)
- `created_by_full_name` (String)
- `created_date_time` (String)
- `deleted_by` (String)
- `deleted_by_email` (String)
- `deleted_by_full_name` (String)
- `deleted_date_time` (String)
- `updated_by` (String)
- `updated_by_email` (String)
- `updated_by_full_name` (String)
- `updated_date_time` (String)


<a id="nestedatt--operation"></a>
### Nested Schema for `operation`

Read-Only:

- `equinix_status` (String)
39 changes: 39 additions & 0 deletions equinix/data_source_fabric_network.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package equinix

import (
"context"

"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)

func readFabricNetworkResourceSchema() map[string]*schema.Schema {
sch := fabricNetworkResourceSchema()
for key, _ := range sch {
if key == "uuid" {
sch[key].Required = true
sch[key].Optional = false
sch[key].Computed = false
} else {
sch[key].Required = false
sch[key].Optional = false
sch[key].Computed = true
sch[key].MaxItems = 0
sch[key].ValidateFunc = nil
}
}
return sch
}
func dataSourceFabricNetwork() *schema.Resource {
return &schema.Resource{
ReadContext: dataSourceFabricNetworkRead,
Schema: readFabricNetworkResourceSchema(),
Description: "Fabric V4 API compatible data resource that allow user to fetch Fabric Network for a given UUID",
}
}

func dataSourceFabricNetworkRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics {
uuid, _ := d.Get("uuid").(string)
d.SetId(uuid)
return resourceFabricNetworkRead(ctx, d, meta)
}
59 changes: 59 additions & 0 deletions equinix/data_source_fabric_network_acc_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
package equinix_test

import (
"fmt"
"github.com/equinix/terraform-provider-equinix/internal/acceptance"
"github.com/hashicorp/terraform-plugin-testing/helper/resource"
_ "github.com/hashicorp/terraform-plugin-testing/terraform"
"testing"
)

func TestAccDataSourceFabricNetwork_PFCR(t *testing.T) {
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { acceptance.TestAccPreCheck(t) },
ExternalProviders: acceptance.TestExternalProviders,
Providers: acceptance.TestAccProviders,
Steps: []resource.TestStep{
{
Config: configCreateNetworkResource_PFCR(),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttrSet("data.equinix_fabric_network.example", "href"),
resource.TestCheckResourceAttrSet("data.equinix_fabric_network.example", "uuid"),
resource.TestCheckResourceAttr("data.equinix_fabric_network.example", "name", "Test_Network_PFCR"),
resource.TestCheckResourceAttrSet("data.equinix_fabric_network.example", "state"),
resource.TestCheckResourceAttr("data.equinix_fabric_network.example", "connections_count", "0"),
resource.TestCheckResourceAttr("data.equinix_fabric_network.example", "type", "EVPLAN"),
resource.TestCheckResourceAttr("data.equinix_fabric_network.example", "notifications.0.type", "ALL"),
resource.TestCheckResourceAttr("data.equinix_fabric_network.example", "notifications.0.emails.0", "[email protected]"),
resource.TestCheckResourceAttr("data.equinix_fabric_network.example", "scope", "GLOBAL"),
resource.TestCheckResourceAttrSet("data.equinix_fabric_network.example", "change_log.0.created_by"),
resource.TestCheckResourceAttrSet("data.equinix_fabric_network.example", "change_log.0.created_by_full_name"),
resource.TestCheckResourceAttrSet("data.equinix_fabric_network.example", "change_log.0.created_by_email"),
resource.TestCheckResourceAttrSet("data.equinix_fabric_network.example", "change_log.0.created_date_time"),
resource.TestCheckResourceAttrSet("data.equinix_fabric_network.example", "operation.0.equinix_status"),
),
ExpectNonEmptyPlan: false,
},
},
})
}

func configCreateNetworkResource_PFCR() string {
return fmt.Sprintf(`
resource "equinix_fabric_network" "example" {
type = "EVPLAN"
name = "Test_Network_PFCR"
scope = "GLOBAL"
notifications {
type = "ALL"
emails = ["[email protected]","[email protected]"]
}
project{
project_id = "291639000636552"
}
}
data "equinix_fabric_network" "example"{
uuid = equinix_fabric_network.example.id
}
`)
}
2 changes: 2 additions & 0 deletions equinix/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ func Provider() *schema.Provider {
"equinix_fabric_routing_protocol": dataSourceRoutingProtocol(),
"equinix_fabric_connection": dataSourceFabricConnection(),
"equinix_fabric_cloud_router": dataSourceFabricCloudRouter(),
"equinix_fabric_network": dataSourceFabricNetwork(),
"equinix_fabric_port": dataSourceFabricPort(),
"equinix_fabric_ports": dataSourceFabricGetPortsByName(),
"equinix_fabric_service_profile": dataSourceFabricServiceProfileReadByUuid(),
Expand Down Expand Up @@ -119,6 +120,7 @@ func Provider() *schema.Provider {
"equinix_ecx_l2_connection": resourceECXL2Connection(),
"equinix_ecx_l2_connection_accepter": resourceECXL2ConnectionAccepter(),
"equinix_ecx_l2_serviceprofile": resourceECXL2ServiceProfile(),
"equinix_fabric_network": resourceFabricNetwork(),
"equinix_fabric_cloud_router": resourceFabricCloudRouter(),
"equinix_fabric_connection": resourceFabricConnection(),
"equinix_fabric_routing_protocol": resourceFabricRoutingProtocol(),
Expand Down
Loading

0 comments on commit bd7ec3e

Please sign in to comment.