Skip to content

Commit

Permalink
Add sp profile resource
Browse files Browse the repository at this point in the history
  • Loading branch information
danischm committed Oct 31, 2023
1 parent 68aa007 commit 7e319e9
Show file tree
Hide file tree
Showing 19 changed files with 773 additions and 6 deletions.
32 changes: 32 additions & 0 deletions docs/data-sources/sp_profile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "catalystcenter_sp_profile Data Source - terraform-provider-catalystcenter"
subcategory: "Network Settings"
description: |-
This data source can read the SP Profile.
---

# catalystcenter_sp_profile (Data Source)

This data source can read the SP Profile.

## Example Usage

```terraform
data "catalystcenter_sp_profile" "example" {
id = "Profile1"
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `id` (String) The id of the object

### Read-Only

- `model` (String) The model
- `name` (String) The name of the SP profile
- `wan_provider` (String) The WAN provider
2 changes: 2 additions & 0 deletions docs/resources/network.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ resource "catalystcenter_network" "example" {
- `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
- `endpoint_aaa_server_shared_secret` (String) Only relevant for type `ISE`, shared secret
- `endpoint_aaa_server_type` (String) Type of network AAA server
- Choices: `AAA`, `ISE`
- `netflow_collector` (String) Netflow collector IP
- `netflow_collector_port` (Number) Netflow collector port
- `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
Expand All @@ -58,6 +59,7 @@ resource "catalystcenter_network" "example" {
- `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
- `network_aaa_server_shared_secret` (String) Only relevant for type `ISE`, shared secret
- `network_aaa_server_type` (String) Type of network AAA server
- Choices: `AAA`, `ISE`
- `ntp_servers` (List of String) List of NTP server IPs
- `primary_dns_server` (String) Primary DNS server IP
- `secondary_dns_server` (String) Secondary DNS server IP
Expand Down
43 changes: 43 additions & 0 deletions docs/resources/sp_profile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "catalystcenter_sp_profile Resource - terraform-provider-catalystcenter"
subcategory: "Network Settings"
description: |-
This resource can manage a SP Profile.
---

# catalystcenter_sp_profile (Resource)

This resource can manage a SP Profile.

## Example Usage

```terraform
resource "catalystcenter_sp_profile" "example" {
name = "Profile1"
model = "4-class-model"
wan_provider = "Provider1"
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `model` (String) The model
- Choices: `4-class-model`, `5-class-model`, `6-class-model`, `8-class-model`
- `name` (String) The name of the SP profile
- `wan_provider` (String) The WAN provider

### Read-Only

- `id` (String) The id of the object

## Import

Import is supported using the following syntax:

```shell
terraform import catalystcenter_sp_profile.example "Profile1"
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
data "catalystcenter_sp_profile" "example" {
id = "Profile1"
}
1 change: 1 addition & 0 deletions examples/resources/catalystcenter_sp_profile/import.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
terraform import catalystcenter_sp_profile.example "Profile1"
5 changes: 5 additions & 0 deletions examples/resources/catalystcenter_sp_profile/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
resource "catalystcenter_sp_profile" "example" {
name = "Profile1"
model = "4-class-model"
wan_provider = "Provider1"
}
4 changes: 2 additions & 2 deletions gen/definitions/network.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ attributes:
tf_name: network_aaa_server_type
type: String
write_only: true
enum_value: [AAA, ISE]
enum_values: [AAA, ISE]
description: Type of network AAA server
example: AAA
exclude_test: true
Expand Down Expand Up @@ -143,7 +143,7 @@ attributes:
tf_name: endpoint_aaa_server_type
type: String
write_only: true
enum_value: [AAA, ISE]
enum_values: [AAA, ISE]
description: Type of network AAA server
example: AAA
exclude_test: true
Expand Down
33 changes: 33 additions & 0 deletions gen/definitions/sp_profile.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: SP Profile
rest_endpoint: /dna/intent/api/v2/service-provider
delete_rest_endpoint: /dna/intent/api/v2/sp-profile
get_from_all: true
id_from_query_path: response.0.value
id_from_attribute: true
doc_category: Network Settings
attributes:
- model_name: profileName
response_model_name: spProfileName
tf_name: name
data_path: settings.qos.0
response_data_path: spProfileName
type: String
id: true
description: The name of the SP profile
example: Profile1
- model_name: model
data_path: settings.qos.0
response_data_path: slaProfileName
type: String
enum_values: [4-class-model, 5-class-model, 6-class-model, 8-class-model]
mandatory: true
description: The model
example: 4-class-model
- model_name: wanProvider
data_path: settings.qos.0
response_data_path: wanProvider
type: String
mandatory: true
description: The WAN provider
example: Provider1
2 changes: 2 additions & 0 deletions gen/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ type YamlConfig struct {
Name string `yaml:"name"`
RestEndpoint string `yaml:"rest_endpoint"`
GetRestEndpoint string `yaml:"get_rest_endpoint"`
DeleteRestEndpoint string `yaml:"delete_rest_endpoint"`
GetNoId bool `yaml:"get_no_id"`
GetFromAll bool `yaml:"get_from_all"`
GetRequiresId bool `yaml:"get_requires_id"`
Expand All @@ -107,6 +108,7 @@ type YamlConfig struct {
IdPath string `yaml:"id_path"`
IdFromQueryPath string `yaml:"id_from_query_path"`
IdQueryParam string `yaml:"id_query_param"`
IdFromAttribute string `yaml:"id_from_attribute"`
PutIdIncludePath string `yaml:"put_id_include_path"`
PutIdQueryParam string `yaml:"put_id_query_param"`
DataSourceNameQuery bool `yaml:"data_source_name_query"`
Expand Down
2 changes: 2 additions & 0 deletions gen/schema/schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name: str() # Name of the resource
rest_endpoint: str() # REST endpoint path
get_rest_endpoint: str(required=False) # Override GET REST endpoint path
delete_rest_endpoint: str(required=False) # Override DELETE REST endpoint path
get_no_id: bool(required=False) # Set to true if the GET request does not require an ID
get_from_all: bool(required=False) # Set to true if GET does not support querying individual objects
get_requires_id: bool(required=False) # Set to true if the GET request requires an ID in the URL path
Expand All @@ -12,6 +13,7 @@ no_read_prefix: bool(required=False) # Set to true if it is an Open API endpoint
id_path: str(required=False) # Path to the ID in the response (use "." to access nested elements)
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
id_query_param: str(required=False) # Query parameter used to specify the ID
id_from_attribute: bool(required=False) # Set to true if the ID is derived from an attribute
put_id_include_path: str(required=False) # If PUT needs to have specific JSON path where ID should be inserted
put_id_query_param: str(required=False) # If PUT needs to have specific query parameter where ID should be inserted
data_source_name_query: bool(required=False) # Set to true if the data source supports name queries
Expand Down
5 changes: 5 additions & 0 deletions gen/templates/data_source.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 10 additions & 2 deletions gen/templates/resource.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

120 changes: 120 additions & 0 deletions internal/provider/data_source_catalystcenter_sp_profile.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 7e319e9

Please sign in to comment.