Skip to content

Commit 7e319e9

Browse files
committed
Add sp profile resource
1 parent 68aa007 commit 7e319e9

19 files changed

+773
-6
lines changed

docs/data-sources/sp_profile.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "catalystcenter_sp_profile Data Source - terraform-provider-catalystcenter"
4+
subcategory: "Network Settings"
5+
description: |-
6+
This data source can read the SP Profile.
7+
---
8+
9+
# catalystcenter_sp_profile (Data Source)
10+
11+
This data source can read the SP Profile.
12+
13+
## Example Usage
14+
15+
```terraform
16+
data "catalystcenter_sp_profile" "example" {
17+
id = "Profile1"
18+
}
19+
```
20+
21+
<!-- schema generated by tfplugindocs -->
22+
## Schema
23+
24+
### Required
25+
26+
- `id` (String) The id of the object
27+
28+
### Read-Only
29+
30+
- `model` (String) The model
31+
- `name` (String) The name of the SP profile
32+
- `wan_provider` (String) The WAN provider

docs/resources/network.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ resource "catalystcenter_network" "example" {
5050
- `endpoint_aaa_server_secondary_ip` (String) In case of `ISE` server type, this is the PSN IP address, in case of `AAA` this is a secondary IP address
5151
- `endpoint_aaa_server_shared_secret` (String) Only relevant for type `ISE`, shared secret
5252
- `endpoint_aaa_server_type` (String) Type of network AAA server
53+
- Choices: `AAA`, `ISE`
5354
- `netflow_collector` (String) Netflow collector IP
5455
- `netflow_collector_port` (Number) Netflow collector port
5556
- `network_aaa_server_primary_ip` (String) In case of `ISE` server type, this is the PAN IP address, in case of `AAA` this is the primary IP address
@@ -58,6 +59,7 @@ resource "catalystcenter_network" "example" {
5859
- `network_aaa_server_secondary_ip` (String) In case of `ISE` server type, this is the PSN IP address, in case of `AAA` this is a secondary IP address
5960
- `network_aaa_server_shared_secret` (String) Only relevant for type `ISE`, shared secret
6061
- `network_aaa_server_type` (String) Type of network AAA server
62+
- Choices: `AAA`, `ISE`
6163
- `ntp_servers` (List of String) List of NTP server IPs
6264
- `primary_dns_server` (String) Primary DNS server IP
6365
- `secondary_dns_server` (String) Secondary DNS server IP

docs/resources/sp_profile.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "catalystcenter_sp_profile Resource - terraform-provider-catalystcenter"
4+
subcategory: "Network Settings"
5+
description: |-
6+
This resource can manage a SP Profile.
7+
---
8+
9+
# catalystcenter_sp_profile (Resource)
10+
11+
This resource can manage a SP Profile.
12+
13+
## Example Usage
14+
15+
```terraform
16+
resource "catalystcenter_sp_profile" "example" {
17+
name = "Profile1"
18+
model = "4-class-model"
19+
wan_provider = "Provider1"
20+
}
21+
```
22+
23+
<!-- schema generated by tfplugindocs -->
24+
## Schema
25+
26+
### Required
27+
28+
- `model` (String) The model
29+
- Choices: `4-class-model`, `5-class-model`, `6-class-model`, `8-class-model`
30+
- `name` (String) The name of the SP profile
31+
- `wan_provider` (String) The WAN provider
32+
33+
### Read-Only
34+
35+
- `id` (String) The id of the object
36+
37+
## Import
38+
39+
Import is supported using the following syntax:
40+
41+
```shell
42+
terraform import catalystcenter_sp_profile.example "Profile1"
43+
```
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
data "catalystcenter_sp_profile" "example" {
2+
id = "Profile1"
3+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
terraform import catalystcenter_sp_profile.example "Profile1"
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
resource "catalystcenter_sp_profile" "example" {
2+
name = "Profile1"
3+
model = "4-class-model"
4+
wan_provider = "Provider1"
5+
}

gen/definitions/network.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ attributes:
101101
tf_name: network_aaa_server_type
102102
type: String
103103
write_only: true
104-
enum_value: [AAA, ISE]
104+
enum_values: [AAA, ISE]
105105
description: Type of network AAA server
106106
example: AAA
107107
exclude_test: true
@@ -143,7 +143,7 @@ attributes:
143143
tf_name: endpoint_aaa_server_type
144144
type: String
145145
write_only: true
146-
enum_value: [AAA, ISE]
146+
enum_values: [AAA, ISE]
147147
description: Type of network AAA server
148148
example: AAA
149149
exclude_test: true

gen/definitions/sp_profile.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
name: SP Profile
3+
rest_endpoint: /dna/intent/api/v2/service-provider
4+
delete_rest_endpoint: /dna/intent/api/v2/sp-profile
5+
get_from_all: true
6+
id_from_query_path: response.0.value
7+
id_from_attribute: true
8+
doc_category: Network Settings
9+
attributes:
10+
- model_name: profileName
11+
response_model_name: spProfileName
12+
tf_name: name
13+
data_path: settings.qos.0
14+
response_data_path: spProfileName
15+
type: String
16+
id: true
17+
description: The name of the SP profile
18+
example: Profile1
19+
- model_name: model
20+
data_path: settings.qos.0
21+
response_data_path: slaProfileName
22+
type: String
23+
enum_values: [4-class-model, 5-class-model, 6-class-model, 8-class-model]
24+
mandatory: true
25+
description: The model
26+
example: 4-class-model
27+
- model_name: wanProvider
28+
data_path: settings.qos.0
29+
response_data_path: wanProvider
30+
type: String
31+
mandatory: true
32+
description: The WAN provider
33+
example: Provider1

gen/generator.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ type YamlConfig struct {
9797
Name string `yaml:"name"`
9898
RestEndpoint string `yaml:"rest_endpoint"`
9999
GetRestEndpoint string `yaml:"get_rest_endpoint"`
100+
DeleteRestEndpoint string `yaml:"delete_rest_endpoint"`
100101
GetNoId bool `yaml:"get_no_id"`
101102
GetFromAll bool `yaml:"get_from_all"`
102103
GetRequiresId bool `yaml:"get_requires_id"`
@@ -107,6 +108,7 @@ type YamlConfig struct {
107108
IdPath string `yaml:"id_path"`
108109
IdFromQueryPath string `yaml:"id_from_query_path"`
109110
IdQueryParam string `yaml:"id_query_param"`
111+
IdFromAttribute string `yaml:"id_from_attribute"`
110112
PutIdIncludePath string `yaml:"put_id_include_path"`
111113
PutIdQueryParam string `yaml:"put_id_query_param"`
112114
DataSourceNameQuery bool `yaml:"data_source_name_query"`

gen/schema/schema.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
name: str() # Name of the resource
33
rest_endpoint: str() # REST endpoint path
44
get_rest_endpoint: str(required=False) # Override GET REST endpoint path
5+
delete_rest_endpoint: str(required=False) # Override DELETE REST endpoint path
56
get_no_id: bool(required=False) # Set to true if the GET request does not require an ID
67
get_from_all: bool(required=False) # Set to true if GET does not support querying individual objects
78
get_requires_id: bool(required=False) # Set to true if the GET request requires an ID in the URL path
@@ -12,6 +13,7 @@ no_read_prefix: bool(required=False) # Set to true if it is an Open API endpoint
1213
id_path: str(required=False) # Path to the ID in the response (use "." to access nested elements)
1314
id_from_query_path: str(required=False) # Specify path to ID container if ID is not included in POST response and needs to be resolved via separate GET request
1415
id_query_param: str(required=False) # Query parameter used to specify the ID
16+
id_from_attribute: bool(required=False) # Set to true if the ID is derived from an attribute
1517
put_id_include_path: str(required=False) # If PUT needs to have specific JSON path where ID should be inserted
1618
put_id_query_param: str(required=False) # If PUT needs to have specific query parameter where ID should be inserted
1719
data_source_name_query: bool(required=False) # Set to true if the data source supports name queries

0 commit comments

Comments
 (0)