Skip to content

Commit

Permalink
Refactor preferred color group policy object resource and data source
Browse files Browse the repository at this point in the history
  • Loading branch information
danischm committed Jul 25, 2023
1 parent c26d7c2 commit 3b8faa9
Show file tree
Hide file tree
Showing 14 changed files with 283 additions and 310 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- BREAKING CHANGE: Remove `entries` attribute of `sdwan_app_probe_class_policy_object` resource and data source
- BREAKING CHANGE: Remove `entries` attribute of `sdwan_mirror_policy_object` resource and data source
- BREAKING CHANGE: Remove `entries` attribute of `sdwan_policer_policy_object` resource and data source
- BREAKING CHANGE: Remove `entries` attribute of `sdwan_preferred_color_group_policy_object` resource and data source

## 0.2.1

Expand Down
15 changes: 4 additions & 11 deletions docs/data-sources/preferred_color_group_policy_object.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
page_title: "sdwan_preferred_color_group_policy_object Data Source - terraform-provider-sdwan"
subcategory: "Policy Objects"
description: |-
This data source can read the Preferred Color Group policy object.
This data source can read the Preferred Color Group Policy Object .
---

# sdwan_preferred_color_group_policy_object (Data Source)

This data source can read the Preferred Color Group policy object.
This data source can read the Preferred Color Group Policy Object .

## Example Usage

Expand All @@ -23,22 +23,15 @@ data "sdwan_preferred_color_group_policy_object" "example" {

### Required

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

### Read-Only

- `entries` (Attributes List) List of entries, only 1 entry supported (see [below for nested schema](#nestedatt--entries))
- `name` (String) The name of the policy object
- `version` (Number) The version of the policy object

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

Read-Only:

- `primary_color_preference` (String) Color or space separated list of colors
- `primary_path_preference` (String) Path preference
- `secondary_color_preference` (String) Color or space separated list of colors
- `secondary_path_preference` (String) Path preference
- `tertiary_color_preference` (String) Color or space separated list of colors
- `tertiary_path_preference` (String) Path preference
- `version` (Number) The version of the object
1 change: 1 addition & 0 deletions docs/guides/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ description: |-
- BREAKING CHANGE: Remove `entries` attribute of `sdwan_app_probe_class_policy_object` resource and data source
- BREAKING CHANGE: Remove `entries` attribute of `sdwan_mirror_policy_object` resource and data source
- BREAKING CHANGE: Remove `entries` attribute of `sdwan_policer_policy_object` resource and data source
- BREAKING CHANGE: Remove `entries` attribute of `sdwan_preferred_color_group_policy_object` resource and data source

## 0.2.1

Expand Down
41 changes: 15 additions & 26 deletions docs/resources/preferred_color_group_policy_object.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,24 @@
page_title: "sdwan_preferred_color_group_policy_object Resource - terraform-provider-sdwan"
subcategory: "Policy Objects"
description: |-
This resource can manage a Preferred Color Group policy object.
This resource can manage a Preferred Color Group Policy Object .
---

# sdwan_preferred_color_group_policy_object (Resource)

This resource can manage a Preferred Color Group policy object.
This resource can manage a Preferred Color Group Policy Object .

## Example Usage

```terraform
resource "sdwan_preferred_color_group_policy_object" "example" {
name = "Example"
entries = [
{
primary_color_preference = "blue bronze"
primary_path_preference = "direct-path"
secondary_color_preference = "3g"
secondary_path_preference = "multi-hop-path"
tertiary_color_preference = "custom1"
tertiary_path_preference = "all-paths"
}
]
name = "Example"
primary_color_preference = "blue bronze"
primary_path_preference = "direct-path"
secondary_color_preference = "3g"
secondary_path_preference = "multi-hop-path"
tertiary_color_preference = "custom1"
tertiary_path_preference = "all-paths"
}
```

Expand All @@ -33,22 +29,10 @@ resource "sdwan_preferred_color_group_policy_object" "example" {

### Required

- `entries` (Attributes List) List of entries, only 1 entry supported (see [below for nested schema](#nestedatt--entries))
- `name` (String) The name of the policy object

### Read-Only

- `id` (String) The id of the policy object
- `version` (Number) The version of the feature template

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

Required:

- `primary_color_preference` (String) Color or space separated list of colors

Optional:
### Optional

- `primary_path_preference` (String) Path preference
- Choices: `direct-path`, `multi-hop-path`, `all-paths`
Expand All @@ -59,6 +43,11 @@ Optional:
- `tertiary_path_preference` (String) Path preference
- Choices: `direct-path`, `multi-hop-path`, `all-paths`

### Read-Only

- `id` (String) The id of the object
- `version` (Number) The version of the object

## Import

Import is supported using the following syntax:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
resource "sdwan_preferred_color_group_policy_object" "example" {
name = "Example"
entries = [
{
primary_color_preference = "blue bronze"
primary_path_preference = "direct-path"
secondary_color_preference = "3g"
secondary_path_preference = "multi-hop-path"
tertiary_color_preference = "custom1"
tertiary_path_preference = "all-paths"
}
]
name = "Example"
primary_color_preference = "blue bronze"
primary_path_preference = "direct-path"
secondary_color_preference = "3g"
secondary_path_preference = "multi-hop-path"
tertiary_color_preference = "custom1"
tertiary_path_preference = "all-paths"
}
55 changes: 55 additions & 0 deletions gen/definitions/generic/preferred_color_group_policy_object.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
name: Preferred Color Group Policy Object
rest_endpoint: /template/policy/list/preferredcolorgroup/
has_version: true
id_attribute: listId
doc_category: Policy Objects
attributes:
- model_name: type
value: preferredColorGroup
- model_name: name
tf_name: name
type: String
mandatory: true
description: The name of the policy object
example: Example
- model_name: colorPreference
data_path: [entries.0, primaryPreference]
tf_name: primary_color_preference
type: String
mandatory: true
description: Color or space separated list of colors
example: blue bronze
- model_name: pathPreference
data_path: [entries.0, primaryPreference]
tf_name: primary_path_preference
type: String
enum_values: [direct-path, multi-hop-path, all-paths]
description: Path preference
example: direct-path
- model_name: colorPreference
data_path: [entries.0, secondaryPreference]
tf_name: secondary_color_preference
type: String
description: Color or space separated list of colors
example: 3g
- model_name: pathPreference
data_path: [entries.0, secondaryPreference]
tf_name: secondary_path_preference
type: String
enum_values: [direct-path, multi-hop-path, all-paths]
description: Path preference
example: multi-hop-path
- model_name: colorPreference
data_path: [entries.0, tertiaryPreference]
tf_name: tertiary_color_preference
type: String
description: Color or space separated list of colors
example: custom1
- model_name: pathPreference
data_path: [entries.0, tertiaryPreference]
tf_name: tertiary_path_preference
type: String
enum_values: [direct-path, multi-hop-path, all-paths]
description: Path preference
example: all-paths
51 changes: 0 additions & 51 deletions gen/definitions/policy_objects/preferred_color_group.yaml

This file was deleted.

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.

Loading

0 comments on commit 3b8faa9

Please sign in to comment.