Skip to content

Commit

Permalink
modifications for deployment of composite templates
Browse files Browse the repository at this point in the history
  • Loading branch information
kuba-mazurkiewicz committed Nov 12, 2024
1 parent 5b0583a commit 072e65d
Show file tree
Hide file tree
Showing 17 changed files with 59 additions and 274 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.1.16 (unreleased)

- Modify `catalystcenter_deploy_template` resource to support deploying composite templates
- Modify `catalystcenter_template_version` resource to use versioned template id as `id` and remove data_source

## 0.1.15

- Fix issue in `catalystcenter_fabric_l3_handoff_ip_transit` resource, [link](https://github.com/CiscoDevNet/terraform-provider-catalystcenter/issues/146)
Expand Down
31 changes: 0 additions & 31 deletions docs/data-sources/template_version.md

This file was deleted.

4 changes: 4 additions & 0 deletions docs/guides/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ description: |-

# Changelog

## 0.1.16 (unreleased)

- Modify `catalystcenter_template_version` resource to use versioned template id as `id` and remove data_source

## 0.1.15

- Fix issue in `catalystcenter_fabric_l3_handoff_ip_transit` resource, [link](https://github.com/CiscoDevNet/terraform-provider-catalystcenter/issues/146)
Expand Down
9 changes: 5 additions & 4 deletions docs/resources/deploy_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ Required:

- `type` (String) Target type of device
- Choices: `MANAGED_DEVICE_IP`, `MANAGED_DEVICE_UUID`, `PRE_PROVISIONED_SERIAL`, `PRE_PROVISIONED_MAC`, `DEFAULT`, `MANAGED_DEVICE_HOSTNAME`
- `versioned_template_id` (String) Versioned template ID to be provisioned

Optional:

- `host_name` (String) Hostname of device is required if targetType is MANAGED_DEVICE_HOSTNAME
- `id` (String) ID of device is required if `type` is MANAGED_DEVICE_UUID
- `params` (Map of String) Template params/values to be provisioned
- `resource_params` (Attributes List) Resource params to be provisioned (see [below for nested schema](#nestedatt--target_info--resource_params))
- `versioned_template_id` (String) Versioned template ID to be provisioned

<a id="nestedatt--target_info--resource_params"></a>
### Nested Schema for `target_info.resource_params`
Expand All @@ -80,13 +80,14 @@ Optional:
Required:

- `target_info` (Attributes List) Target info to deploy template (see [below for nested schema](#nestedatt--member_template_deployment_info--target_info))
- `template_id` (String) ID of template to be provisioned
- `template_id` (String) Versioned Template ID

Optional:

- `copying_config` (Boolean) Copying Config
- `force_push_template` (Boolean) Force Push Template
- `is_composite` (Boolean) Composite template flag
- `main_template_id` (String) Composite Template ID
- `main_template_id` (String) Template ID

<a id="nestedatt--member_template_deployment_info--target_info"></a>
### Nested Schema for `member_template_deployment_info.target_info`
Expand All @@ -95,14 +96,14 @@ Required:

- `type` (String) Target type of device
- Choices: `MANAGED_DEVICE_IP`, `MANAGED_DEVICE_UUID`, `PRE_PROVISIONED_SERIAL`, `PRE_PROVISIONED_MAC`, `DEFAULT`, `MANAGED_DEVICE_HOSTNAME`
- `versioned_template_id` (String) Versioned template ID to be provisioned

Optional:

- `host_name` (String) Hostname of device is required if targetType is MANAGED_DEVICE_HOSTNAME
- `id` (String) ID of device is required if targetType is MANAGED_DEVICE_UUID
- `params` (Map of String) Template params/values to be provisioned
- `resource_params` (Attributes List) Resource params to be provisioned (see [below for nested schema](#nestedatt--member_template_deployment_info--target_info--resource_params))
- `versioned_template_id` (String) Versioned template ID to be provisioned

<a id="nestedatt--member_template_deployment_info--target_info--resource_params"></a>
### Nested Schema for `member_template_deployment_info.target_info.resource_params`
Expand Down
5 changes: 1 addition & 4 deletions docs/resources/template_version.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,10 @@ resource "catalystcenter_template_version" "example" {
<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `template_id` (String) UUID of template

### Optional

- `comments` (String) Template version comments
- `template_id` (String) UUID of template

### Read-Only

Expand Down

This file was deleted.

9 changes: 5 additions & 4 deletions gen/definitions/deploy_template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,19 @@ attributes:
- model_name: templateId
type: String
id: true
description: ID of template to be provisioned
description: Versioned Template ID
- model_name: forcePushTemplate
type: Bool
description: Force Push Template
- model_name: isComposite
type: Bool
description: Composite template flag
- model_name: copyingConfig
type: Bool
description: Copying Config
- model_name: mainTemplateId
type: String
description: Composite Template ID
description: Template ID
- model_name: targetInfo
type: List
mandatory: true
Expand Down Expand Up @@ -93,7 +96,6 @@ attributes:
description: Target type of device
- model_name: versionedTemplateId
type: String
mandatory: true
description: Versioned template ID to be provisioned
- model_name: targetInfo
type: List
Expand Down Expand Up @@ -147,7 +149,6 @@ attributes:
example: MANAGED_DEVICE_HOSTNAME
- model_name: versionedTemplateId
type: String
mandatory: true
description: Versioned template ID to be provisioned
example: 12345678-1234-1234-1234-123456789012
test_value: catalystcenter_template_version.example.id
Expand Down
5 changes: 4 additions & 1 deletion gen/definitions/template_version.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
---
name: Template Version
# Manual modifications in Create and Read functions to read Template Version Id
rest_endpoint: /dna/intent/api/v1/template-programmer/template/version
no_delete: true
no_data_source: true
id_from_attribute: true
doc_category: Templates
attributes:
- model_name: templateId
type: String
id: true
query_param: true
data_source_query: true
response_data_path: 0.templateId
description: UUID of template
example: 12345678-1234-1234-1234-123456789012
Expand Down
115 changes: 0 additions & 115 deletions internal/provider/data_source_catalystcenter_template_version.go

This file was deleted.

This file was deleted.

Loading

0 comments on commit 072e65d

Please sign in to comment.