Skip to content

Commit 3a74d59

Browse files
Add tags to template resource and data source (#105)
1 parent 1af2d08 commit 3a74d59

25 files changed

+1975
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
## 0.1.10 (unreleased)
22

3+
- Add `assign_templates_to_tag` resource and data source
4+
- Add `tag` resource and data source
35
- Add `pnp_import_devices` resource
46
- Add `fabric_device` resource and data source, this resource now only works with Catalyst Center version 2.3.7.5+ `/sda/fabricDevices`
57
- Add `fabric_l3_handoff_ip_transit` resource and data source
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "catalystcenter_assign_templates_to_tag Data Source - terraform-provider-catalystcenter"
4+
subcategory: "Tags"
5+
description: |-
6+
This data source can read the Assign Templates to Tag.
7+
---
8+
9+
# catalystcenter_assign_templates_to_tag (Data Source)
10+
11+
This data source can read the Assign Templates to Tag.
12+
13+
## Example Usage
14+
15+
```terraform
16+
data "catalystcenter_assign_templates_to_tag" "example" {
17+
tag_id = "ea505070-6bb8-493f-bff0-8058e8e03ee5"
18+
}
19+
```
20+
21+
<!-- schema generated by tfplugindocs -->
22+
## Schema
23+
24+
### Required
25+
26+
- `tag_id` (String) Tag Id to be associated with the template
27+
28+
### Read-Only
29+
30+
- `id` (String) The id of the object
31+
- `template_ids` (Set of String) Template Ids List

docs/data-sources/tag.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "catalystcenter_tag Data Source - terraform-provider-catalystcenter"
4+
subcategory: "Tags"
5+
description: |-
6+
This data source can read the Tag.
7+
---
8+
9+
# catalystcenter_tag (Data Source)
10+
11+
This data source can read the Tag.
12+
13+
## Example Usage
14+
15+
```terraform
16+
data "catalystcenter_tag" "example" {
17+
name = "Tag1"
18+
}
19+
```
20+
21+
<!-- schema generated by tfplugindocs -->
22+
## Schema
23+
24+
### Required
25+
26+
- `name` (String)
27+
28+
### Read-Only
29+
30+
- `description` (String) Description of the tag
31+
- `dynamic_rules` (Attributes List) Dynamic rules details (see [below for nested schema](#nestedatt--dynamic_rules))
32+
- `id` (String) The id of the object
33+
- `system_tag` (Boolean) true for system created tags, false for user defined tag
34+
35+
<a id="nestedatt--dynamic_rules"></a>
36+
### Nested Schema for `dynamic_rules`
37+
38+
Read-Only:
39+
40+
- `items` (Attributes List) items details, multiple rules can be defined by items (see [below for nested schema](#nestedatt--dynamic_rules--items))
41+
- `member_type` (String) memberType of the tag
42+
- `name` (String) Name of the parameter (e.g. for interface:portName,adminStatus,speed,status,description. for networkdevice:family,series,hostname,managementIpAddress,groupNameHierarchy,softwareVersion)
43+
- `operation` (String) Operation of the rule
44+
- `value` (String) Value of the parameter (e.g. for portName:1/0/1,for adminStatus,status:up/down, for speed: any integer value, for description: any valid string, for family:switches, for series:C3650, for managementIpAddress:10.197.124.90, groupNameHierarchy:Global, softwareVersion: 16.9.1)
45+
- `values` (List of String) values of the parameter,Only one of the value or values can be used for the given parameter. (for managementIpAddress e.g. ["10.197.124.90","10.197.124.91"])
46+
47+
<a id="nestedatt--dynamic_rules--items"></a>
48+
### Nested Schema for `dynamic_rules.items`
49+
50+
Read-Only:
51+
52+
- `name` (String) Name of the parameter (e.g. managementIpAddress,hostname)
53+
- `operation` (String) Operation of the rule
54+
- `value` (String) Value of the parameter (e.g. %10%,%NA%)

docs/guides/changelog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ description: |-
99

1010
## 0.1.10 (unreleased)
1111

12+
- Add `assign_templates_to_tag` resource and data source
13+
- Add `tag` resource and data source
1214
- Add `pnp_import_devices` resource
1315
- Add `fabric_device` resource and data source, this resource now only works with Catalyst Center version 2.3.7.5+ `/sda/fabricDevices`
1416
- Add `fabric_l3_handoff_ip_transit` resource and data source
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "catalystcenter_assign_templates_to_tag Resource - terraform-provider-catalystcenter"
4+
subcategory: "Tags"
5+
description: |-
6+
This resource is responsible for assigning templates to a specified tag during creation and removing the template from the tag during destroy operation.
7+
---
8+
9+
# catalystcenter_assign_templates_to_tag (Resource)
10+
11+
This resource is responsible for assigning templates to a specified tag during creation and removing the template from the tag during destroy operation.
12+
13+
## Example Usage
14+
15+
```terraform
16+
resource "catalystcenter_assign_templates_to_tag" "example" {
17+
tag_id = "ea505070-6bb8-493f-bff0-8058e8e03ee5"
18+
template_ids = ["75b0f85a-8157-4db3-ae2d-9807c893319a"]
19+
}
20+
```
21+
22+
<!-- schema generated by tfplugindocs -->
23+
## Schema
24+
25+
### Required
26+
27+
- `tag_id` (String) Tag Id to be associated with the template
28+
29+
### Optional
30+
31+
- `template_ids` (Set of String) Template Ids List
32+
33+
### Read-Only
34+
35+
- `id` (String) The id of the object

docs/resources/tag.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "catalystcenter_tag Resource - terraform-provider-catalystcenter"
4+
subcategory: "Tags"
5+
description: |-
6+
This resource can manage a Tag.
7+
---
8+
9+
# catalystcenter_tag (Resource)
10+
11+
This resource can manage a Tag.
12+
13+
## Example Usage
14+
15+
```terraform
16+
resource "catalystcenter_tag" "example" {
17+
name = "Tag1"
18+
description = "Tag1 Description"
19+
system_tag = false
20+
}
21+
```
22+
23+
<!-- schema generated by tfplugindocs -->
24+
## Schema
25+
26+
### Required
27+
28+
- `name` (String)
29+
30+
### Optional
31+
32+
- `description` (String) Description of the tag
33+
- `dynamic_rules` (Attributes List) Dynamic rules details (see [below for nested schema](#nestedatt--dynamic_rules))
34+
- `system_tag` (Boolean) true for system created tags, false for user defined tag
35+
36+
### Read-Only
37+
38+
- `id` (String) The id of the object
39+
40+
<a id="nestedatt--dynamic_rules"></a>
41+
### Nested Schema for `dynamic_rules`
42+
43+
Optional:
44+
45+
- `items` (Attributes List) items details, multiple rules can be defined by items (see [below for nested schema](#nestedatt--dynamic_rules--items))
46+
- `member_type` (String) memberType of the tag
47+
- Choices: `networkdevice`, `interface`
48+
- `name` (String) Name of the parameter (e.g. for interface:portName,adminStatus,speed,status,description. for networkdevice:family,series,hostname,managementIpAddress,groupNameHierarchy,softwareVersion)
49+
- `operation` (String) Operation of the rule
50+
- Choices: `OR`, `IN`, `EQ`, `LIKE`, `ILIKE`, `AND`
51+
- `value` (String) Value of the parameter (e.g. for portName:1/0/1,for adminStatus,status:up/down, for speed: any integer value, for description: any valid string, for family:switches, for series:C3650, for managementIpAddress:10.197.124.90, groupNameHierarchy:Global, softwareVersion: 16.9.1)
52+
- `values` (List of String) values of the parameter,Only one of the value or values can be used for the given parameter. (for managementIpAddress e.g. ["10.197.124.90","10.197.124.91"])
53+
54+
<a id="nestedatt--dynamic_rules--items"></a>
55+
### Nested Schema for `dynamic_rules.items`
56+
57+
Optional:
58+
59+
- `name` (String) Name of the parameter (e.g. managementIpAddress,hostname)
60+
- `operation` (String) Operation of the rule
61+
- Choices: `OR`, `IN`, `EQ`, `LIKE`, `ILIKE`, `AND`
62+
- `value` (String) Value of the parameter (e.g. %10%,%NA%)
63+
64+
## Import
65+
66+
Import is supported using the following syntax:
67+
68+
```shell
69+
terraform import catalystcenter_tag.example "<name>"
70+
```
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
data "catalystcenter_assign_templates_to_tag" "example" {
2+
tag_id = "ea505070-6bb8-493f-bff0-8058e8e03ee5"
3+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
data "catalystcenter_tag" "example" {
2+
name = "Tag1"
3+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
resource "catalystcenter_assign_templates_to_tag" "example" {
2+
tag_id = "ea505070-6bb8-493f-bff0-8058e8e03ee5"
3+
template_ids = ["75b0f85a-8157-4db3-ae2d-9807c893319a"]
4+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
terraform import catalystcenter_tag.example "<name>"

0 commit comments

Comments
 (0)