Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: updating data sources and resources for fabric cloud router #531

Merged
merged 15 commits into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions docs/data-sources/equinix_fabric_cloud_router.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,29 +23,31 @@ data "equinix_fabric_cloud_router" "cloud_router_data_name" {
<!-- schema generated by tfplugindocs -->
thogarty marked this conversation as resolved.
Show resolved Hide resolved
## Schema

### Optional
### Required

- `uuid` (String) Equinix-assigned Fabric Cloud Router identifier

### Read-Only

- `account` (Set of Object) Customer account information that is associated with this Fabric Cloud Router (see [below for nested schema](#nestedatt--account))
- `bgp_ipv4_routes_count` (Number)
- `bgp_ipv6_routes_count` (Number)
- `bgp_ipv4_routes_count` (Number) Access point used and maximum number of IPv4 BGP routes
- `bgp_ipv6_routes_count` (Number) Access point used and maximum number of IPv6 BGP routes
- `change_log` (Set of Object) Captures Fabric Cloud Router lifecycle change information (see [below for nested schema](#nestedatt--change_log))
- `connections_count` (Number)
- `connections_count` (Number) Number of connections associated with this Access point
- `description` (String) Customer-provided Fabric Cloud Router description
- `distinct_ipv4_prefixes_count` (Number) Number of distinct ipv4 routes
thogarty marked this conversation as resolved.
Show resolved Hide resolved
- `distinct_ipv6_prefixes_count` (Number) Number of distinct ipv6 routes
- `equinix_asn` (Number) Equinix ASN
- `href` (String) Fabric Cloud Router URI information
- `id` (String) The ID of this resource.
- `location` (Set of Object) Fabric Cloud Router location (see [below for nested schema](#nestedatt--location))
- `name` (String) Fabric Cloud Router name. An alpha-numeric 24 characters string which can include only hyphens and underscores
- `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` (Block Set) Project information (see [below for nested schema](#nestedblock--project))
- `package` (Set of Object) Fabric Cloud Router Package Type (see [below for nested schema](#nestedatt--package))
- `project` (Set of Object) Fabric Cloud Router project (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
- `type` (String) Defines the FCR type like XF_ROUTER

<a id="nestedatt--account"></a>
### Nested Schema for `account`
Expand Down Expand Up @@ -85,7 +87,6 @@ Read-Only:

Read-Only:

- `href` (String)
- `ibx` (String)
- `metro_code` (String)
- `metro_name` (String)
Expand Down Expand Up @@ -121,12 +122,11 @@ Read-Only:
- `code` (String)


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

Read-Only:

- `href` (String) Unique Resource URL
- `project_id` (String) Project Id

- `href` (String)
- `project_id` (String)

63 changes: 38 additions & 25 deletions docs/resources/equinix_fabric_cloud_router.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,28 +45,48 @@ resource "equinix_fabric_cloud_router" "new_cloud_router"{

### Required

- `account` (Block Set, Min: 1, Max: 1) Customer account information that is associated with this Fabric Cloud Router (see [below for nested schema](#nestedblock--account))
- `location` (Block Set, Min: 1, Max: 1) Fabric Cloud Router location (see [below for nested schema](#nestedblock--location))
- `name` (String) Fabric Cloud Router name. An alpha-numeric 24 characters string which can include only hyphens and underscores
- `notifications` (Block List, Min: 1) Preferences for notifications on Fabric Cloud Router configuration or status changes (see [below for nested schema](#nestedblock--notifications))
- `package` (Block Set, Min: 1, Max: 1) Fabric Cloud Router package (see [below for nested schema](#nestedblock--package))
- `type` (String) Defines the FCR type like XF_GATEWAY
- `order` (Block Set, Min: 1, Max: 1) Order information related to this Fabric Cloud Router (see [below for nested schema](#nestedblock--order))
- `package` (Block Set, Min: 1, Max: 1) Fabric Cloud Router Package Type (see [below for nested schema](#nestedblock--package))
- `project` (Block Set, Min: 1, Max: 1) Fabric Cloud Router project (see [below for nested schema](#nestedblock--project))
- `type` (String) Defines the FCR type like XF_ROUTER

### Optional

- `account` (Block Set, Max: 1) Customer account information that is associated with this Fabric Cloud Router (see [below for nested schema](#nestedblock--account))
- `description` (String) Customer-provided Fabric Cloud Router description
- `order` (Block Set, Max: 1) Order information related to this Fabric Cloud Router (see [below for nested schema](#nestedblock--order))
- `project` (Block Set) Fabric Cloud Router project (see [below for nested schema](#nestedblock--project))
- `href` (String) Fabric Cloud Router URI information
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))
- `uuid` (String) Equinix-assigned Fabric Cloud Router identifier

### Read-Only

- `bgp_ipv4_routes_count` (Number) Access point used and maximum number of IPv4 BGP routes
- `bgp_ipv6_routes_count` (Number) Access point used and maximum number of IPv6 BGP routes
- `change_log` (Set of Object) Captures Fabric Cloud Router lifecycle change information (see [below for nested schema](#nestedatt--change_log))
- `connections_count` (Number) Number of connections associated with this Access point
- `distinct_ipv4_prefixes_count` (Number) Number of distinct ipv4 routes
- `distinct_ipv6_prefixes_count` (Number) Number of distinct ipv6 routes
- `equinix_asn` (Number) Equinix ASN
- `href` (String) Fabric Cloud Router URI information
- `id` (String) The ID of this resource.
- `state` (String) Fabric Cloud Router overall state

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

Read-Only:

- `account_name` (String) Account Name
- `account_number` (Number) Account Number
- `global_cust_id` (String) Global Customer organization identifier
- `global_org_id` (String) Global organization identifier
- `global_organization_name` (String) Global organization name
- `org_id` (Number) Customer organization identifier
- `organization_name` (String) Customer organization name


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

Expand All @@ -91,22 +111,6 @@ Optional:
- `send_interval` (String) Send interval


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

Required:

- `code` (String) Fabric Cloud Router package code


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

Optional:

- `account_number` (Number) Account Number


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

Expand All @@ -121,14 +125,25 @@ Read-Only:
- `order_number` (String) Order Reference Number


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

Required:

- `code` (String) Fabric Cloud Router package code


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

Optional:

- `href` (String) Unique Resource URL
- `project_id` (String) Project Id

Read-Only:

- `href` (String) Unique Resource URL


<a id="nestedblock--timeouts"></a>
### Nested Schema for `timeouts`
Expand Down Expand Up @@ -158,5 +173,3 @@ Read-Only:
- `updated_by_email` (String)
- `updated_by_full_name` (String)
- `updated_date_time` (String)


20 changes: 19 additions & 1 deletion equinix/data_source_fabric_cloud_router.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,28 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)

func dataSourcesCloudRouterResourceSchema() map[string]*schema.Schema {
sch := resourcesFabricCloudRouterResourceSchema()
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 dataSourceCloudRouter() *schema.Resource {
return &schema.Resource{
ReadContext: dataSourceCloudRouterRead,
Schema: readCloudRouterResourceSchema(),
Schema: dataSourcesCloudRouterResourceSchema(),
Description: "Fabric V4 API compatible data resource that allow user to fetch Fabric Cloud Router for a given UUID\n\n~> **Note** Equinix Fabric v4 resources and datasources are currently in Beta. The interfaces related to `equinix_fabric_` resources and datasources may change ahead of general availability. Please, do not hesitate to report any problems that you experience by opening a new [issue](https://github.com/equinix/terraform-provider-equinix/issues/new?template=bug.md)",
}
}
Expand Down
125 changes: 0 additions & 125 deletions equinix/fabric_cloud_router_read_schema.go

This file was deleted.

Loading
Loading