Skip to content

Commit

Permalink
Update schema descriptions, attr behaviors, and refactor common schem…
Browse files Browse the repository at this point in the history
…a package name
  • Loading branch information
thogarty authored and ctreatma committed Feb 2, 2024
1 parent edc81d6 commit 1ff8a47
Show file tree
Hide file tree
Showing 19 changed files with 97 additions and 96 deletions.
25 changes: 11 additions & 14 deletions docs/data-sources/equinix_fabric_cloud_router.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ data "equinix_fabric_cloud_router" "cloud_router_data_name" {
<!-- schema generated by tfplugindocs -->
## Schema

### Optional
### Required

- `project` (Block Set) Project information (see [below for nested schema](#nestedblock--project))
- `uuid` (String) Equinix-assigned Fabric Cloud Router identifier

### Read-Only
Expand All @@ -44,21 +43,10 @@ data "equinix_fabric_cloud_router" "cloud_router_data_name" {
- `notifications` (List of Object) Preferences for notifications on Fabric Cloud Router configuration or status changes (see [below for nested schema](#nestedatt--notifications))
- `order` (Set of Object) Order information related to this Fabric Cloud Router (see [below for nested schema](#nestedatt--order))
- `package` (Set of Object) Fabric Cloud Router package information (see [below for nested schema](#nestedatt--package))
- `project` (Set of Object) Project information (see [below for nested schema](#nestedatt--project))
- `state` (String) Fabric Cloud Router overall state
- `type` (String) Defines the Fabric Cloud Router type like XF_GATEWAY

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

Optional:

- `project_id` (String) Project Id

Read-Only:

- `href` (String) Unique Resource URL


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

Expand Down Expand Up @@ -130,3 +118,12 @@ Read-Only:
Read-Only:

- `code` (String)


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

Read-Only:

- `href` (String)
- `project_id` (String)
6 changes: 3 additions & 3 deletions docs/data-sources/equinix_fabric_connection.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ data "equinix_fabric_connection" "connection_data_name" {
- `project` (Set of Object) Project information (see [below for nested schema](#nestedatt--project))
- `redundancy` (Set of Object) Connection Redundancy Configuration (see [below for nested schema](#nestedatt--redundancy))
- `state` (String) Connection overall state
- `type` (String) Defines the connection type like EVPL_VC, EPL_VC, IPWAN_VC, ACCESS_EPL_VC, EVPLAN_VC, EPLAN_VC
- `type` (String) Defines the connection type like EVPL_VC, EPL_VC, IPWAN_VC, IP_VC, ACCESS_EPL_VC, EVPLAN_VC, EPLAN_VC, EIA_VC, EC_VC
- `z_side` (Set of Object) Destination or Provider side connection configuration object of the multi-segment connection (see [below for nested schema](#nestedatt--z_side))

<a id="nestedatt--a_side"></a>
Expand All @@ -63,7 +63,7 @@ Read-Only:

- `account` (Set of Object) (see [below for nested schema](#nestedobjatt--a_side--access_point--account))
- `authentication_key` (String)
- `gateway` (Set of Object) (see [below for nested schema](#nestedobjatt--a_side--access_point--gateway))
- `gateway` (Set of Object, Deprecated) **Deprecated** `gateway` Use `router` attribute instead (see [below for nested schema](#nestedobjatt--a_side--access_point--gateway))
- `interface` (Set of Object) (see [below for nested schema](#nestedobjatt--a_side--access_point--interface))
- `link_protocol` (Set of Object) (see [below for nested schema](#nestedobjatt--a_side--access_point--link_protocol))
- `location` (Set of Object) (see [below for nested schema](#nestedobjatt--a_side--access_point--location))
Expand Down Expand Up @@ -346,7 +346,7 @@ Read-Only:

- `account` (Set of Object) (see [below for nested schema](#nestedobjatt--z_side--access_point--account))
- `authentication_key` (String)
- `gateway` (Set of Object) (see [below for nested schema](#nestedobjatt--z_side--access_point--gateway))
- `gateway` (Set of Object, Deprecated) **Deprecated** `gateway` Use `router` attribute instead (see [below for nested schema](#nestedobjatt--z_side--access_point--gateway))
- `interface` (Set of Object) (see [below for nested schema](#nestedobjatt--z_side--access_point--interface))
- `link_protocol` (Set of Object) (see [below for nested schema](#nestedobjatt--z_side--access_point--link_protocol))
- `location` (Set of Object) (see [below for nested schema](#nestedobjatt--z_side--access_point--location))
Expand Down
8 changes: 4 additions & 4 deletions docs/resources/equinix_fabric_connection.md
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ resource "equinix_fabric_connection" "epl" {
- `name` (String) Connection name. An alpha-numeric 24 characters string which can include only hyphens and underscores
- `notifications` (Block List, Min: 1) Preferences for notifications on connection configuration or status changes (see [below for nested schema](#nestedblock--notifications))
- `order` (Block Set, Min: 1, Max: 1) Order details (see [below for nested schema](#nestedblock--order))
- `type` (String) Defines the connection type like EVPL_VC, EPL_VC, IPWAN_VC, ACCESS_EPL_VC, EVPLAN_VC, EPLAN_VC
- `type` (String) Defines the connection type like EVPL_VC, EPL_VC, IPWAN_VC, IP_VC, ACCESS_EPL_VC, EVPLAN_VC, EPLAN_VC, EIA_VC, EC_VC
- `z_side` (Block Set, Min: 1, Max: 1) Destination or Provider side connection configuration object of the multi-segment connection (see [below for nested schema](#nestedblock--z_side))

### Optional
Expand All @@ -572,7 +572,7 @@ resource "equinix_fabric_connection" "epl" {
- `redundancy` (Block Set, Max: 1) Connection Redundancy Configuration (see [below for nested schema](#nestedblock--redundancy))
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

~> **NOTE:** Port to IBM Connections could be modified from IBM Service Provider Side by using parameters passed to additional_info field: `{"key": "ASN", "value": "1111"}` `{"key": "Global", "value": "false"}` `{"key": "BGP_IBM_CIDR", "value": "172.16.0.18/30"}` `{"key": "BGP_CER_CIDR", "value": "172.16.0.19/30"}`
-~> **NOTE:** Port to IBM Connections could be modified from IBM Service Provider Side by using parameters passed to additional_info field: `{"key": "ASN", "value": "1111"}` `{"key": "Global", "value": "false"}` `{"key": "BGP_IBM_CIDR", "value": "172.16.0.18/30"}` `{"key": "BGP_CER_CIDR", "value": "172.16.0.19/30"}`

### Read-Only

Expand Down Expand Up @@ -828,7 +828,7 @@ Optional:
Optional:

- `authentication_key` (String) Authentication key for provider based connections
- `gateway` (Block Set, Max: 1, Deprecated) Cloud Router access point information (see [below for nested schema](#nestedblock--z_side--access_point--gateway))
- `gateway` (Block Set, Max: 1, Deprecated) **Deprecated** `gateway` Use `router` attribute instead (see [below for nested schema](#nestedblock--z_side--access_point--gateway))
- `interface` (Block Set, Max: 1) Virtual device interface (see [below for nested schema](#nestedblock--z_side--access_point--interface))
- `link_protocol` (Block Set, Max: 1) Connection link protocol (see [below for nested schema](#nestedblock--z_side--access_point--link_protocol))
- `location` (Block Set, Max: 1) Access point location (see [below for nested schema](#nestedblock--z_side--access_point--location))
Expand All @@ -837,7 +837,7 @@ Optional:
- `port` (Block Set, Max: 1) Port access point information (see [below for nested schema](#nestedblock--z_side--access_point--port))
- `profile` (Block Set, Max: 1) Service Profile (see [below for nested schema](#nestedblock--z_side--access_point--profile))
- `provider_connection_id` (String) Provider assigned Connection Id
- `router` (Block Set, Max: 1) Cloud Router access point information (see [below for nested schema](#nestedblock--z_side--access_point--router))
- `router` (Block Set, Max: 1) Cloud Router access point information that replaces `gateway` (see [below for nested schema](#nestedblock--z_side--access_point--router))
- `seller_region` (String) Access point seller region
- `type` (String) Access point type - COLO, VD, VG, SP, IGW, SUBNET, CLOUD_ROUTER, NETWORK
- `virtual_device` (Block Set, Max: 1) Virtual device (see [below for nested schema](#nestedblock--z_side--access_point--virtual_device))
Expand Down
2 changes: 1 addition & 1 deletion equinix/data_source_fabric_connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
)

func readFabricConnectionResourceSchema() map[string]*schema.Schema {
sch := FabricConnectionResourceSchema()
sch := fabricConnectionResourceSchema()
for key, _ := range sch {
if key == "uuid" {
sch[key].Required = true
Expand Down
5 changes: 2 additions & 3 deletions equinix/fabric_cloud_router_read_schema.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package equinix

import (
equinix_schema "github.com/equinix/terraform-provider-equinix/internal/schema"
equinix_schema "github.com/equinix/terraform-provider-equinix/internal/fabric/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)

Expand All @@ -19,7 +19,7 @@ func readCloudRouterResourceSchema() map[string]*schema.Schema {
return map[string]*schema.Schema{
"uuid": {
Type: schema.TypeString,
Optional: true,
Required: true,
Description: "Equinix-assigned Fabric Cloud Router identifier",
},
"href": {
Expand Down Expand Up @@ -93,7 +93,6 @@ func readCloudRouterResourceSchema() map[string]*schema.Schema {
},
"project": {
Type: schema.TypeSet,
Optional: true,
Computed: true,
Description: "Project information",
Elem: &schema.Resource{
Expand Down
2 changes: 1 addition & 1 deletion equinix/fabric_cloud_router_schema.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package equinix

import (
equinix_schema "github.com/equinix/terraform-provider-equinix/internal/schema"
equinix_schema "github.com/equinix/terraform-provider-equinix/internal/fabric/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
)
Expand Down
2 changes: 1 addition & 1 deletion equinix/fabric_mapping_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package equinix

import (
"fmt"
equinix_schema "github.com/equinix/terraform-provider-equinix/internal/schema"
equinix_schema "github.com/equinix/terraform-provider-equinix/internal/fabric/schema"
"log"

v4 "github.com/equinix-labs/fabric-go/fabric/v4"
Expand Down
2 changes: 1 addition & 1 deletion equinix/fabric_mapping_service_profile_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package equinix
import (
v4 "github.com/equinix-labs/fabric-go/fabric/v4"
"github.com/equinix/terraform-provider-equinix/internal/converters"
equinix_schema "github.com/equinix/terraform-provider-equinix/internal/schema"
equinix_schema "github.com/equinix/terraform-provider-equinix/internal/fabric/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)

Expand Down
2 changes: 1 addition & 1 deletion equinix/fabric_routing_protocol_read_schema.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package equinix

import (
equinix_schema "github.com/equinix/terraform-provider-equinix/internal/schema"
equinix_schema "github.com/equinix/terraform-provider-equinix/internal/fabric/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"golang.org/x/exp/maps"
)
Expand Down
2 changes: 1 addition & 1 deletion equinix/fabric_routing_protocol_schema.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package equinix

import (
equinix_schema "github.com/equinix/terraform-provider-equinix/internal/schema"
equinix_schema "github.com/equinix/terraform-provider-equinix/internal/fabric/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
"golang.org/x/exp/maps"
Expand Down
4 changes: 2 additions & 2 deletions equinix/fabric_service_profile_read_schema.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package equinix

import (
equinix_schema "github.com/equinix/terraform-provider-equinix/internal/schema"
equinix_schema "github.com/equinix/terraform-provider-equinix/internal/fabric/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)

Expand Down Expand Up @@ -50,7 +50,7 @@ func readFabricServiceProfileSchema() map[string]*schema.Schema {
Computed: true,
Description: "Access point config information",
Elem: &schema.Resource{
Schema: AccessPointTypeConfigSch(),
Schema: serviceProfileAccessPointTypeConfigSch(),
},
},

Expand Down
2 changes: 1 addition & 1 deletion equinix/fabric_service_profile_schema.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package equinix

import (
equinix_schema "github.com/equinix/terraform-provider-equinix/internal/schema"
equinix_schema "github.com/equinix/terraform-provider-equinix/internal/fabric/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)

Expand Down
19 changes: 10 additions & 9 deletions equinix/resource_fabric_cloud_router.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"time"

equinix_errors "github.com/equinix/terraform-provider-equinix/internal/errors"
equinix_fabric_schema "github.com/equinix/terraform-provider-equinix/internal/fabric/schema"
equinix_schema "github.com/equinix/terraform-provider-equinix/internal/schema"

"github.com/equinix/terraform-provider-equinix/internal/config"
Expand Down Expand Up @@ -43,15 +44,15 @@ func resourceCloudRouterCreate(ctx context.Context, d *schema.ResourceData, meta
client := meta.(*config.Config).FabricClient
ctx = context.WithValue(ctx, v4.ContextAccessToken, meta.(*config.Config).FabricAuthToken)
schemaNotifications := d.Get("notifications").([]interface{})
notifications := equinix_schema.NotificationsToFabric(schemaNotifications)
notifications := equinix_fabric_schema.NotificationsToFabric(schemaNotifications)
schemaAccount := d.Get("account").(*schema.Set).List()
account := accountToCloudRouter(schemaAccount)
schemaLocation := d.Get("location").(*schema.Set).List()
location := equinix_schema.LocationWithoutIBXToFabric(schemaLocation)
location := equinix_fabric_schema.LocationWithoutIBXToFabric(schemaLocation)
project := v4.Project{}
schemaProject := d.Get("project").(*schema.Set).List()
if len(schemaProject) != 0 {
project = equinix_schema.ProjectToFabric(schemaProject)
project = equinix_fabric_schema.ProjectToFabric(schemaProject)
}
schemaPackage := d.Get("package").(*schema.Set).List()
packages := packageToCloudRouter(schemaPackage)
Expand All @@ -67,7 +68,7 @@ func resourceCloudRouterCreate(ctx context.Context, d *schema.ResourceData, meta
}

if v, ok := d.GetOk("order"); ok {
order := equinix_schema.OrderToFabric(v.(*schema.Set).List())
order := equinix_fabric_schema.OrderToFabric(v.(*schema.Set).List())
createRequest.Order = &order
}

Expand Down Expand Up @@ -107,16 +108,16 @@ func setCloudRouterMap(d *schema.ResourceData, fcr v4.CloudRouter) diag.Diagnost
"type": fcr.Type_,
"state": fcr.State,
"package": cloudRouterPackageToTerra(fcr.Package_),
"location": equinix_schema.LocationWithoutIBXToTerra(fcr.Location),
"change_log": equinix_schema.ChangeLogToTerra(fcr.ChangeLog),
"location": equinix_fabric_schema.LocationWithoutIBXToTerra(fcr.Location),
"change_log": equinix_fabric_schema.ChangeLogToTerra(fcr.ChangeLog),
"account": accountCloudRouterToTerra(fcr.Account),
"notifications": equinix_schema.NotificationsToTerra(fcr.Notifications),
"project": equinix_schema.ProjectToTerra(fcr.Project),
"notifications": equinix_fabric_schema.NotificationsToTerra(fcr.Notifications),
"project": equinix_fabric_schema.ProjectToTerra(fcr.Project),
"equinix_asn": fcr.EquinixAsn,
"bgp_ipv4_routes_count": fcr.BgpIpv4RoutesCount,
"bgp_ipv6_routes_count": fcr.BgpIpv6RoutesCount,
"connections_count": fcr.ConnectionsCount,
"order": equinix_schema.OrderToTerra(fcr.Order),
"order": equinix_fabric_schema.OrderToTerra(fcr.Order),
})
if err != nil {
return diag.FromErr(err)
Expand Down
Loading

0 comments on commit 1ff8a47

Please sign in to comment.