Skip to content

Commit d901d6d

Browse files
Bulk update policy (#121)
* update policies rank * fix get * fix policy drifts
1 parent b6487ed commit d901d6d

14 files changed

+1253
-4
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "ise_device_admin_policy_set_update_ranks Resource - terraform-provider-ise"
4+
subcategory: "Device Administration"
5+
description: |-
6+
This resource is used to bulk update rank field in device admin policy set. It serves as a workaround for the ISE API/Backend limitation which restricts rank assignments to a strictly incremental sequence. By utilizing this resource and device_admin_policy_set resource, you can bypass the APIs limitation. Creation of this resource is performing PUT operation (Update) and it only tracks rank field. When this resource is destroyed, no action is performed on ISE and resource is just removed from state.
7+
---
8+
9+
# ise_device_admin_policy_set_update_ranks (Resource)
10+
11+
This resource is used to bulk update rank field in device admin policy set. It serves as a workaround for the ISE API/Backend limitation which restricts rank assignments to a strictly incremental sequence. By utilizing this resource and device_admin_policy_set resource, you can bypass the APIs limitation. Creation of this resource is performing PUT operation (Update) and it only tracks rank field. When this resource is destroyed, no action is performed on ISE and resource is just removed from state.
12+
13+
## Example Usage
14+
15+
```terraform
16+
resource "ise_device_admin_policy_set_update_ranks" "example" {
17+
policies = [
18+
{
19+
id = "d82952cb-b901-4b09-b363-5ebf39bdbaf9"
20+
rank = 0
21+
}
22+
]
23+
}
24+
```
25+
26+
<!-- schema generated by tfplugindocs -->
27+
## Schema
28+
29+
### Optional
30+
31+
- `policies` (Attributes List) (see [below for nested schema](#nestedatt--policies))
32+
33+
### Read-Only
34+
35+
- `id` (String) The id of the object
36+
37+
<a id="nestedatt--policies"></a>
38+
### Nested Schema for `policies`
39+
40+
Required:
41+
42+
- `rank` (Number) The rank (priority) in relation to other rules. Lower rank is higher priority.
43+
44+
Optional:
45+
46+
- `id` (String) Policy set ID
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "ise_network_access_policy_set_update_ranks Resource - terraform-provider-ise"
4+
subcategory: "Network Access"
5+
description: |-
6+
This resource is used to bulk update rank field in network access policy set. It serves as a workaround for the ISE API/Backend limitation which restricts rank assignments to a strictly incremental sequence. By utilizing this resource and network_access_policy_set resource, you can bypass the APIs limitation. Creation of this resource is performing PUT operation (Update) and it only tracks rank field. When this resource is destroyed, no action is performed on ISE and resource is just removed from state.
7+
---
8+
9+
# ise_network_access_policy_set_update_ranks (Resource)
10+
11+
This resource is used to bulk update rank field in network access policy set. It serves as a workaround for the ISE API/Backend limitation which restricts rank assignments to a strictly incremental sequence. By utilizing this resource and network_access_policy_set resource, you can bypass the APIs limitation. Creation of this resource is performing PUT operation (Update) and it only tracks rank field. When this resource is destroyed, no action is performed on ISE and resource is just removed from state.
12+
13+
## Example Usage
14+
15+
```terraform
16+
resource "ise_network_access_policy_set_update_ranks" "example" {
17+
policies = [
18+
{
19+
id = "d82952cb-b901-4b09-b363-5ebf39bdbaf9"
20+
rank = 0
21+
}
22+
]
23+
}
24+
```
25+
26+
<!-- schema generated by tfplugindocs -->
27+
## Schema
28+
29+
### Optional
30+
31+
- `policies` (Attributes List) (see [below for nested schema](#nestedatt--policies))
32+
33+
### Read-Only
34+
35+
- `id` (String) The id of the object
36+
37+
<a id="nestedatt--policies"></a>
38+
### Nested Schema for `policies`
39+
40+
Required:
41+
42+
- `rank` (Number) The rank (priority) in relation to other rules. Lower rank is higher priority.
43+
44+
Optional:
45+
46+
- `id` (String) Policy set ID
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
resource "ise_device_admin_policy_set_update_ranks" "example" {
2+
policies = [
3+
{
4+
id = "d82952cb-b901-4b09-b363-5ebf39bdbaf9"
5+
rank = 0
6+
}
7+
]
8+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
resource "ise_network_access_policy_set_update_ranks" "example" {
2+
policies = [
3+
{
4+
id = "d82952cb-b901-4b09-b363-5ebf39bdbaf9"
5+
rank = 0
6+
}
7+
]
8+
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
name: Device Admin Policy Set Update Ranks
3+
res_description:
4+
'This resource is used to bulk update rank field in device admin policy set. It serves as a workaround for the
5+
ISE API/Backend limitation which restricts rank assignments to a strictly incremental sequence.
6+
By utilizing this resource and device_admin_policy_set resource, you can bypass the APIs limitation.
7+
Creation of this resource is performing PUT operation (Update) and it only tracks rank field.
8+
When this resource is destroyed, no action is performed on ISE and resource is just removed from state.'
9+
rest_endpoint: /api/v1/policy/device-admin/policy-set
10+
put_create: true
11+
no_delete: true
12+
no_import: true
13+
no_data_source: true
14+
skip_minimum_test: true
15+
doc_category: Device Administration
16+
attributes:
17+
- model_name: policies
18+
type: List
19+
id: true
20+
attributes:
21+
- model_name: id
22+
type: String
23+
description: Policy set ID
24+
example: d82952cb-b901-4b09-b363-5ebf39bdbaf9
25+
test_value: ise_device_admin_policy_set.test.id
26+
- model_name: rank
27+
mandatory: true
28+
type: Int64
29+
description: The rank (priority) in relation to other rules. Lower rank is higher priority.
30+
example: 0
31+
32+
test_prerequisites: |
33+
resource "ise_device_admin_policy_set" "test" {
34+
name = "PolicySet1"
35+
description = "My description"
36+
is_proxy = false
37+
service_name = "Default Device Admin"
38+
state = "enabled"
39+
condition_type = "ConditionAttributes"
40+
condition_is_negate = false
41+
condition_attribute_name = "Location"
42+
condition_attribute_value = "All Locations"
43+
condition_dictionary_name = "DEVICE"
44+
condition_operator = "equals"
45+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
name: Network Access Policy Set Update Ranks
3+
res_description:
4+
'This resource is used to bulk update rank field in network access policy set. It serves as a workaround for the
5+
ISE API/Backend limitation which restricts rank assignments to a strictly incremental sequence.
6+
By utilizing this resource and network_access_policy_set resource, you can bypass the APIs limitation.
7+
Creation of this resource is performing PUT operation (Update) and it only tracks rank field.
8+
When this resource is destroyed, no action is performed on ISE and resource is just removed from state.'
9+
rest_endpoint: /api/v1/policy/network-access/policy-set
10+
put_create: true
11+
no_delete: true
12+
no_import: true
13+
no_data_source: true
14+
skip_minimum_test: true
15+
doc_category: Network Access
16+
attributes:
17+
- model_name: policies
18+
type: List
19+
id: true
20+
attributes:
21+
- model_name: id
22+
type: String
23+
description: Policy set ID
24+
example: d82952cb-b901-4b09-b363-5ebf39bdbaf9
25+
test_value: ise_network_access_policy_set.test.id
26+
- model_name: rank
27+
mandatory: true
28+
type: Int64
29+
description: The rank (priority) in relation to other rules. Lower rank is higher priority.
30+
example: 0
31+
test_prerequisites: |
32+
resource "ise_network_access_policy_set" "test" {
33+
name = "PolicySet1"
34+
service_name = "Default Network Access"
35+
condition_type = "ConditionAttributes"
36+
condition_is_negate = false
37+
condition_attribute_name = "Location"
38+
condition_attribute_value = "All Locations"
39+
condition_dictionary_name = "DEVICE"
40+
condition_operator = "equals"
41+
}

gen/templates/resource.go

Lines changed: 30 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)