Skip to content

Commit

Permalink
Refactor sla class 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 1686b46 commit 04d3b46
Show file tree
Hide file tree
Showing 14 changed files with 411 additions and 399 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@
- Add `sdwan_application_aware_routing_policy_definition` resource and data source
- Add `sdwan_cflowd_policy_definition` resource and data source
- Add `sdwan_traffic_data_policy_definition` resource and data source
- Add `set_parameters` to `sdwan_acl_policy_definition` resource and data source
- Add `set_parameters` attribute to `sdwan_acl_policy_definition` resource and data source
- BREAKING CHANGE: Remove `dscp` and `next_hop` attributes of `sdwan_acl_policy_definition` resource and data source
- BREAKING CHANGE: Rename `layer2cos` attribute of `sdwan_rewrite_rule_policy_definition` resource and data source to `layer2_cos`
- BREAKING CHANGE: Remove `entries` attribute of `sdwan_class_map_policy_object` resource and data source
- 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
- BREAKING CHANGE: Remove `entries` attribute of `sdwan_sla_class_policy_object` resource and data source
- Add `app_probe_class_version` attribute to `sdwan_sla_class_policy_object` resource and data source

## 0.2.1

Expand Down
18 changes: 6 additions & 12 deletions docs/data-sources/sla_class_policy_object.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
page_title: "sdwan_sla_class_policy_object Data Source - terraform-provider-sdwan"
subcategory: "Policy Objects"
description: |-
This data source can read the SLA Class policy object.
This data source can read the SLA Class Policy Object .
---

# sdwan_sla_class_policy_object (Data Source)

This data source can read the SLA Class policy object.
This data source can read the SLA Class Policy Object .

## Example Usage

Expand All @@ -23,24 +23,18 @@ data "sdwan_sla_class_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:

- `app_probe_class_id` (String) App Probe Class Policy Object ID
- `app_probe_class_version` (Number) App Probe Class Policy Object version
- `fallback_best_tunnel_criteria` (String)
- `fallback_best_tunnel_jitter` (Number) Jitter variance in ms
- `fallback_best_tunnel_latency` (Number) Latency variance in ms
- `fallback_best_tunnel_loss` (Number) Loss variance in percent
- `jitter` (Number) Jitter in ms
- `latency` (Number) Latency in ms
- `loss` (Number) Loss in percent
- `name` (String) The name of the policy object
- `version` (Number) The version of the object
4 changes: 3 additions & 1 deletion docs/guides/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,16 @@ description: |-
- Add `sdwan_application_aware_routing_policy_definition` resource and data source
- Add `sdwan_cflowd_policy_definition` resource and data source
- Add `sdwan_traffic_data_policy_definition` resource and data source
- Add `set_parameters` to `sdwan_acl_policy_definition` resource and data source
- Add `set_parameters` attribute to `sdwan_acl_policy_definition` resource and data source
- BREAKING CHANGE: Remove `dscp` and `next_hop` attributes of `sdwan_acl_policy_definition` resource and data source
- BREAKING CHANGE: Rename `layer2cos` attribute of `sdwan_rewrite_rule_policy_definition` resource and data source to `layer2_cos`
- BREAKING CHANGE: Remove `entries` attribute of `sdwan_class_map_policy_object` resource and data source
- 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
- BREAKING CHANGE: Remove `entries` attribute of `sdwan_sla_class_policy_object` resource and data source
- Add `app_probe_class_version` attribute to `sdwan_sla_class_policy_object` resource and data source

## 0.2.1

Expand Down
41 changes: 17 additions & 24 deletions docs/resources/sla_class_policy_object.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,25 @@
page_title: "sdwan_sla_class_policy_object Resource - terraform-provider-sdwan"
subcategory: "Policy Objects"
description: |-
This resource can manage a SLA Class policy object.
This resource can manage a SLA Class Policy Object .
---

# sdwan_sla_class_policy_object (Resource)

This resource can manage a SLA Class policy object.
This resource can manage a SLA Class Policy Object .

## Example Usage

```terraform
resource "sdwan_sla_class_policy_object" "example" {
name = "Example"
entries = [
{
jitter = 100
latency = 10
loss = 1
fallback_best_tunnel_criteria = "jitter-loss-latency"
fallback_best_tunnel_jitter = 100
fallback_best_tunnel_latency = 10
fallback_best_tunnel_loss = 1
}
]
name = "Example"
jitter = 100
latency = 10
loss = 1
fallback_best_tunnel_criteria = "jitter-loss-latency"
fallback_best_tunnel_jitter = 100
fallback_best_tunnel_latency = 10
fallback_best_tunnel_loss = 1
}
```

Expand All @@ -34,20 +30,12 @@ resource "sdwan_sla_class_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`

Optional:
### Optional

- `app_probe_class_id` (String) App Probe Class Policy Object ID
- `app_probe_class_version` (Number) App Probe Class Policy Object version
- `fallback_best_tunnel_criteria` (String) - Choices: `loss`, `latency`, `jitter`, `loss-latency`, `loss-jitter`, `latency-loss`, `latency-jitter`, `jitter-latency`, `jitter-loss`, `loss-latency-jitter`, `loss-jitter-latency`, `latency-loss-jitter`, `latency-jitter-loss`, `jitter-latency-loss`, `jitter-loss-latency`
- `fallback_best_tunnel_jitter` (Number) Jitter variance in ms
- Range: `1`-`1000`
Expand All @@ -62,6 +50,11 @@ Optional:
- `loss` (Number) Loss in percent
- Range: `1`-`100`

### 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
20 changes: 8 additions & 12 deletions examples/resources/sdwan_sla_class_policy_object/resource.tf
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
resource "sdwan_sla_class_policy_object" "example" {
name = "Example"
entries = [
{
jitter = 100
latency = 10
loss = 1
fallback_best_tunnel_criteria = "jitter-loss-latency"
fallback_best_tunnel_jitter = 100
fallback_best_tunnel_latency = 10
fallback_best_tunnel_loss = 1
}
]
name = "Example"
jitter = 100
latency = 10
loss = 1
fallback_best_tunnel_criteria = "jitter-loss-latency"
fallback_best_tunnel_jitter = 100
fallback_best_tunnel_latency = 10
fallback_best_tunnel_loss = 1
}
101 changes: 101 additions & 0 deletions gen/definitions/generic/sla_class_policy_object.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
---
name: SLA Class Policy Object
rest_endpoint: /template/policy/list/sla/
has_version: true
id_attribute: listId
doc_category: Policy Objects
attributes:
- model_name: type
value: sla
- model_name: name
tf_name: name
type: String
mandatory: true
description: The name of the policy object
example: Example
- model_name: appProbeClass
data_path: [entries.0]
tf_name: app_probe_class_id
type: String
description: App Probe Class Policy Object ID
exclude_test: true
example: 2081c2f4-3f9f-4fee-8078-dcc8904e368d
- tf_name: app_probe_class_version
tf_only: true
type: Version
description: App Probe Class Policy Object version
exclude_test: true
- model_name: jitter
data_path: [entries.0]
type: Int64
model_type_string: true
min_int: 1
max_int: 1000
description: Jitter in ms
example: 100
- model_name: latency
data_path: [entries.0]
type: Int64
model_type_string: true
min_int: 1
max_int: 1000
description: Latency in ms
example: 10
- model_name: loss
data_path: [entries.0]
type: Int64
model_type_string: true
min_int: 1
max_int: 100
description: Loss in percent
example: 1
- model_name: criteria
tf_name: fallback_best_tunnel_criteria
data_path: [entries.0, fallbackBestTunnel]
type: String
enum_values:
[
loss,
latency,
jitter,
loss-latency,
loss-jitter,
latency-loss,
latency-jitter,
jitter-latency,
jitter-loss,
loss-latency-jitter,
loss-jitter-latency,
latency-loss-jitter,
latency-jitter-loss,
jitter-latency-loss,
jitter-loss-latency,
]
example: jitter-loss-latency
- model_name: jitterVariance
tf_name: fallback_best_tunnel_jitter
data_path: [entries.0, fallbackBestTunnel]
type: Int64
model_type_string: true
min_int: 1
max_int: 1000
description: Jitter variance in ms
example: 100
- model_name: latencyVariance
tf_name: fallback_best_tunnel_latency
data_path: [entries.0, fallbackBestTunnel]
type: Int64
model_type_string: true
min_int: 1
max_int: 1000
description: Latency variance in ms
example: 10
- model_name: lossVariance
tf_name: fallback_best_tunnel_loss
data_path: [entries.0, fallbackBestTunnel]
type: Int64
model_type_string: true
min_int: 1
max_int: 100
description: Loss variance in percent
example: 1
88 changes: 0 additions & 88 deletions gen/definitions/policy_objects/sla_class.yaml

This file was deleted.

Loading

0 comments on commit 04d3b46

Please sign in to comment.