Skip to content

Commit e908b0d

Browse files
committed
Allow updating default policy sets and rules
1 parent a0a4801 commit e908b0d

22 files changed

+318
-67
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 0.1.13 (unreleased)
2+
3+
- Add `default` attribute to `ise_network_access_policy_set` resource
4+
- Add `default` attribute to `ise_device_admin_policy_set` resource
5+
- Allow updating default policy sets and rules
6+
17
## 0.1.12
28

39
- Ignore error messages when attempting to delete default policy sets or rules

docs/data-sources/device_admin_policy_set.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ data "ise_device_admin_policy_set" "example" {
3737
- `condition_is_negate` (Boolean) Indicates whereas this condition is in negate mode
3838
- `condition_operator` (String) Equality operator
3939
- `condition_type` (String) Indicates whether the record is the condition itself or a logical aggregation. Logical aggreation indicates that additional conditions are present under the children attribute.
40+
- `default` (Boolean) Indicates if this policy set is the default one
4041
- `description` (String) The description of the policy set
4142
- `is_proxy` (Boolean) Flag which indicates if the policy set service is of type 'Proxy Sequence' or 'Allowed Protocols'
4243
- `rank` (Number) The rank (priority) in relation to other policy sets. Lower rank is higher priority.

docs/data-sources/network_access_policy_set.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ data "ise_network_access_policy_set" "example" {
3737
- `condition_is_negate` (Boolean) Indicates whereas this condition is in negate mode
3838
- `condition_operator` (String) Equality operator
3939
- `condition_type` (String) Indicates whether the record is the condition itself or a logical aggregation. Logical aggreation indicates that additional conditions are present under the children attribute.
40+
- `default` (Boolean) Indicates if this policy set is the default one
4041
- `description` (String) The description of the policy set
4142
- `is_proxy` (Boolean) Flag which indicates if the policy set service is of type 'Proxy Sequence' or 'Allowed Protocols'
4243
- `rank` (Number) The rank (priority) in relation to other policy sets. Lower rank is higher priority.

docs/guides/changelog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ description: |-
77

88
# Changelog
99

10+
## 0.1.13 (unreleased)
11+
12+
- Add `default` attribute to `ise_network_access_policy_set` resource
13+
- Add `default` attribute to `ise_device_admin_policy_set` resource
14+
- Allow updating default policy sets and rules
15+
1016
## 0.1.12
1117

1218
- Ignore error messages when attempting to delete default policy sets or rules

docs/resources/device_admin_policy_set.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ resource "ise_device_admin_policy_set" "example" {
3434

3535
### Required
3636

37-
- `condition_type` (String) Indicates whether the record is the condition itself or a logical aggregation. Logical aggreation indicates that additional conditions are present under the children attribute.
38-
- Choices: `ConditionAndBlock`, `ConditionAttributes`, `ConditionOrBlock`, `ConditionReference`
3937
- `name` (String) Given name for the policy set, [Valid characters are alphanumerics, underscore, hyphen, space, period, parentheses]
4038
- `service_name` (String) Policy set service identifier. 'Allowed Protocols' or 'Server Sequence'.
4139

@@ -50,6 +48,9 @@ resource "ise_device_admin_policy_set" "example" {
5048
- `condition_is_negate` (Boolean) Indicates whereas this condition is in negate mode
5149
- `condition_operator` (String) Equality operator
5250
- Choices: `contains`, `endsWith`, `equals`, `greaterOrEquals`, `greaterThan`, `in`, `ipEquals`, `ipGreaterThan`, `ipLessThan`, `ipNotEquals`, `lessOrEquals`, `lessThan`, `matches`, `notContains`, `notEndsWith`, `notEquals`, `notIn`, `notStartsWith`, `startsWith`
51+
- `condition_type` (String) Indicates whether the record is the condition itself or a logical aggregation. Logical aggreation indicates that additional conditions are present under the children attribute.
52+
- Choices: `ConditionAndBlock`, `ConditionAttributes`, `ConditionOrBlock`, `ConditionReference`
53+
- `default` (Boolean) Indicates if this policy set is the default one
5354
- `description` (String) The description of the policy set
5455
- `is_proxy` (Boolean) Flag which indicates if the policy set service is of type 'Proxy Sequence' or 'Allowed Protocols'
5556
- `rank` (Number) The rank (priority) in relation to other policy sets. Lower rank is higher priority.

docs/resources/network_access_policy_set.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ resource "ise_network_access_policy_set" "example" {
3434

3535
### Required
3636

37-
- `condition_type` (String) Indicates whether the record is the condition itself or a logical aggregation. Logical aggreation indicates that additional conditions are present under the children attribute.
38-
- Choices: `ConditionAndBlock`, `ConditionAttributes`, `ConditionOrBlock`, `ConditionReference`
3937
- `name` (String) Given name for the policy set, [Valid characters are alphanumerics, underscore, hyphen, space, period, parentheses]
4038
- `service_name` (String) Policy set service identifier. 'Allowed Protocols' or 'Server Sequence'.
4139

@@ -50,6 +48,9 @@ resource "ise_network_access_policy_set" "example" {
5048
- `condition_is_negate` (Boolean) Indicates whereas this condition is in negate mode
5149
- `condition_operator` (String) Equality operator
5250
- Choices: `contains`, `endsWith`, `equals`, `greaterOrEquals`, `greaterThan`, `in`, `ipEquals`, `ipGreaterThan`, `ipLessThan`, `ipNotEquals`, `lessOrEquals`, `lessThan`, `matches`, `notContains`, `notEndsWith`, `notEquals`, `notIn`, `notStartsWith`, `startsWith`
51+
- `condition_type` (String) Indicates whether the record is the condition itself or a logical aggregation. Logical aggreation indicates that additional conditions are present under the children attribute.
52+
- Choices: `ConditionAndBlock`, `ConditionAttributes`, `ConditionOrBlock`, `ConditionReference`
53+
- `default` (Boolean) Indicates if this policy set is the default one
5354
- `description` (String) The description of the policy set
5455
- `is_proxy` (Boolean) Flag which indicates if the policy set service is of type 'Proxy Sequence' or 'Allowed Protocols'
5556
- `rank` (Number) The rank (priority) in relation to other policy sets. Lower rank is higher priority.

gen/definitions/device_admin_policy_set.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ attributes:
1313
example: PolicySet1
1414
- model_name: description
1515
type: String
16+
computed: true
1617
description: The description of the policy set
1718
example: My description
1819
- model_name: isProxy
@@ -21,6 +22,7 @@ attributes:
2122
example: false
2223
- model_name: rank
2324
type: Int64
25+
computed: true
2426
description: The rank (priority) in relation to other policy sets. Lower rank is higher priority.
2527
example: 0
2628
- model_name: serviceName
@@ -33,9 +35,13 @@ attributes:
3335
enum_values: [disabled, enabled, monitor]
3436
description: The state that the policy set is in. A disabled policy set cannot be matched.
3537
example: enabled
38+
- model_name: default
39+
type: Bool
40+
description: Indicates if this policy set is the default one
41+
example: false
42+
exclude_test: true
3643
- model_name: conditionType
3744
data_path: [condition]
38-
mandatory: true
3945
type: String
4046
enum_values:
4147
[

gen/definitions/network_access_policy_set.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ attributes:
1313
example: PolicySet1
1414
- model_name: description
1515
type: String
16+
computed: true
1617
description: The description of the policy set
1718
example: My description
1819
- model_name: isProxy
@@ -21,6 +22,7 @@ attributes:
2122
example: false
2223
- model_name: rank
2324
type: Int64
25+
computed: true
2426
description: The rank (priority) in relation to other policy sets. Lower rank is higher priority.
2527
example: 0
2628
- model_name: serviceName
@@ -33,9 +35,13 @@ attributes:
3335
enum_values: [disabled, enabled, monitor]
3436
description: The state that the policy set is in. A disabled policy set cannot be matched.
3537
example: enabled
38+
- model_name: default
39+
type: Bool
40+
description: Indicates if this policy set is the default one
41+
example: false
42+
exclude_test: true
3643
- model_name: conditionType
3744
data_path: [condition]
38-
mandatory: true
3945
type: String
4046
enum_values:
4147
[

gen/generator.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ type YamlConfigAttribute struct {
135135
Reference bool `yaml:"reference"`
136136
DataSourceQuery bool `yaml:"data_source_query"`
137137
Mandatory bool `yaml:"mandatory"`
138+
Computed bool `yaml:"computed"`
138139
WriteOnly bool `yaml:"write_only"`
139140
WriteChangesOnly bool `yaml:"write_changes_only"`
140141
ExcludeTest bool `yaml:"exclude_test"`

gen/schema/schema.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ attribute:
3939
reference: bool(required=False) # Set to true if the attribute is a reference being used in the path (URL) of the REST endpoint
4040
data_source_query: bool(required=False) # Set to true if the attribute is an alternative query parameter for the data source
4141
mandatory: bool(required=False) # Set to true if the attribute is mandatory
42+
computed: bool(required=False) # Set to true if the attribute is computed
4243
write_only: bool(required=False) # Set to true if the attribute is write-only, meaning we cannot read the value
4344
write_changes_only: bool(required=False) # Set to true if the attribute should only be written (included in PUT payload) if it has changed
4445
exclude_test: bool(required=False) # Exclude attribute from example (documentation) and acceptance test
@@ -55,7 +56,6 @@ attribute:
5556
string_patterns: list(str(), required=False) # List of regular expressions that the string must match, only relevant if type is "String"
5657
string_min_length: int(required=False) # Minimum length of a string, only relevant if type is "String"
5758
string_max_length: int(required=False) # Maximum length of a string, only relevant if type is "String"
58-
requires_replace: bool(required=False) # Set to true if the attribute requires a replace operation
5959
default_value: any(str(), int(), bool(), required=False) # Default value for the attribute
6060
value: any(str(), int(), bool(), required=False) # Hardcoded value for the attribute
6161
test_value: str(required=False) # Value used for acceptance test

0 commit comments

Comments
 (0)