Skip to content

Commit

Permalink
Refactor mesh topology policy definition
Browse files Browse the repository at this point in the history
  • Loading branch information
danischm committed Jul 23, 2023
1 parent 8f554ba commit 4b6c4c2
Show file tree
Hide file tree
Showing 10 changed files with 103 additions and 103 deletions.
9 changes: 4 additions & 5 deletions docs/data-sources/mesh_topology_policy_definition.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
page_title: "sdwan_mesh_topology_policy_definition Data Source - terraform-provider-sdwan"
subcategory: "Centralized Policies"
description: |-
This data source can read the Mesh Topology policy definition.
This data source can read the Mesh Topology Policy Definition .
---

# sdwan_mesh_topology_policy_definition (Data Source)

This data source can read the Mesh Topology policy definition.
This data source can read the Mesh Topology Policy Definition .

## Example Usage

Expand All @@ -23,15 +23,14 @@ data "sdwan_mesh_topology_policy_definition" "example" {

### Required

- `id` (String) The id of the policy definition
- `id` (String) The id of the object

### Read-Only

- `description` (String) The description of the policy definition
- `name` (String) The name of the policy definition
- `regions` (Attributes List) List of regions (see [below for nested schema](#nestedatt--regions))
- `type` (String) The policy definition type
- `version` (Number) The version of the policy definition
- `version` (Number) The version of the object
- `vpn_list_id` (String) VPN list ID
- `vpn_list_version` (Number) VPN list version

Expand Down
9 changes: 4 additions & 5 deletions docs/resources/mesh_topology_policy_definition.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
page_title: "sdwan_mesh_topology_policy_definition Resource - terraform-provider-sdwan"
subcategory: "Centralized Policies"
description: |-
This resource can manage a Mesh Topology policy definition.
This resource can manage a Mesh Topology Policy Definition .
---

# sdwan_mesh_topology_policy_definition (Resource)

This resource can manage a Mesh Topology policy definition.
This resource can manage a Mesh Topology Policy Definition .

## Example Usage

Expand Down Expand Up @@ -42,9 +42,8 @@ resource "sdwan_mesh_topology_policy_definition" "example" {

### Read-Only

- `id` (String) The id of the policy definition
- `type` (String) The policy defintion type
- `version` (Number) The version of the policy definition
- `id` (String) The id of the object
- `version` (Number) The version of the object

<a id="nestedatt--regions"></a>
### Nested Schema for `regions`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,37 @@
---
name: Mesh Topology
type: mesh
root_element: definition
name: Mesh Topology Policy Definition
rest_endpoint: /template/policy/definition/mesh/
has_version: true
id_attribute: definitionId
doc_category: Centralized Policies
skip_templates: [model.go, resource.go, data_source.go]
attributes:
- model_name: type
value: mesh
- model_name: name
tf_name: name
type: String
mandatory: true
description: The name of the policy definition
example: Example
- model_name: description
tf_name: description
type: String
mandatory: true
description: The description of the policy definition
example: My description
- model_name: vpnList
data_path: [definition]
tf_name: vpn_list_id
type: String
description: VPN list ID
example: 04fcbb0b-efbf-43d2-a04b-847d3a7b104e
- tf_name: vpn_list_version
tf_only: true
type: Int64
type: Version
description: VPN list version
exclude_test: true
- model_name: regions
data_path: [definition]
tf_name: regions
type: List
mandatory: true
Expand All @@ -24,6 +40,7 @@ attributes:
- model_name: name
tf_name: name
type: String
id: true
mandatory: true
description: Region name
example: Region1
Expand All @@ -34,6 +51,6 @@ attributes:
example: '["e858e1c4-6aa8-4de7-99df-c3adbf80290d"]'
- tf_name: site_list_versions
tf_only: true
type: ListString
type: Versions
description: Site list versions
exclude_test: true
2 changes: 1 addition & 1 deletion gen/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ func BuildPath(s []string) string {
// Templating helper function to determine if attributes list contains one or more version attributes
func HasVersionAttribute(attributes []YamlConfigAttribute) bool {
for _, attr := range attributes {
if attr.Type == "Version" {
if attr.Type == "Version" || attr.Type == "Versions" {
return true
} else if attr.Type == "List" {
if HasVersionAttribute(attr.Attributes) {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

93 changes: 47 additions & 46 deletions internal/provider/model_sdwan_mesh_topology_policy_definition.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions internal/provider/provider.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 4b6c4c2

Please sign in to comment.