From 52daaca14ecc8bcf87dcefee4323ea4d242cb86a Mon Sep 17 00:00:00 2001 From: Shreyas Date: Fri, 22 Mar 2024 11:05:54 -0400 Subject: [PATCH] [minor_change] Addition of recursive logic in the templates to incorporate grand children of the parent class as nested children within the immediate child of the parent --- .../data-sources/access_interface_override.md | 16 +- docs/data-sources/annotation.md | 2 +- docs/data-sources/application_epg.md | 116 +- docs/data-sources/bridge_domain.md | 93 +- docs/data-sources/certificate_authority.md | 2 - docs/data-sources/custom_qos_policy.md | 2 - .../data_plane_policing_policy.md | 2 - docs/data-sources/endpoint_security_group.md | 46 +- docs/data-sources/endpoint_tag_ip.md | 2 - docs/data-sources/endpoint_tag_mac.md | 2 - .../epg_useg_ad_group_attribute.md | 2 - docs/data-sources/epg_useg_block_statement.md | 2 - docs/data-sources/epg_useg_dns_attribute.md | 2 - docs/data-sources/epg_useg_ip_attribute.md | 2 - docs/data-sources/epg_useg_mac_attribute.md | 2 - .../epg_useg_sub_block_statement.md | 2 - docs/data-sources/epg_useg_vm_attribute.md | 2 - ...nal_management_network_instance_profile.md | 9 +- .../external_management_network_subnet.md | 2 - .../data-sources/first_hop_security_policy.md | 9 +- docs/data-sources/igmp_snooping_policy.md | 2 - docs/data-sources/key_ring.md | 2 - docs/data-sources/l3out_consumer_label.md | 16 +- docs/data-sources/l3out_node_sid_profile.md | 2 - docs/data-sources/l3out_provider_label.md | 2 - .../data-sources/l3out_redistribute_policy.md | 2 - docs/data-sources/management_access_policy.md | 175 + docs/data-sources/mld_snooping_policy.md | 2 - .../neighbor_discovery_interface_policy.md | 2 - docs/data-sources/netflow_exporter_policy.md | 16 +- docs/data-sources/netflow_monitor_policy.md | 16 +- docs/data-sources/netflow_record_policy.md | 2 - docs/data-sources/out_of_band_contract.md | 2 - docs/data-sources/pim_route_map_entry.md | 2 - docs/data-sources/pim_route_map_policy.md | 2 - ...lation_from_bridge_domain_to_l3_outside.md | 2 - ...bridge_domain_to_netflow_monitor_policy.md | 2 - ...om_l3out_consumer_label_to_external_epg.md | 2 - ...consumer_label_to_route_control_profile.md | 2 - .../relation_to_consumed_contract.md | 2 - ...lation_to_consumed_out_of_band_contract.md | 2 - .../relation_to_contract_master.md | 2 - docs/data-sources/relation_to_domain.md | 2 - .../relation_to_fibre_channel_path.md | 2 - .../relation_to_imported_contract.md | 2 - .../relation_to_intra_epg_contract.md | 2 - .../relation_to_netflow_exporter.md | 2 - .../relation_to_provided_contract.md | 2 - docs/data-sources/relation_to_static_leaf.md | 2 - docs/data-sources/relation_to_static_path.md | 2 - .../relation_to_taboo_contract.md | 2 - .../relation_to_vrf_fallback_route_group.md | 2 - docs/data-sources/rogue_coop_exception.md | 2 - docs/data-sources/route_control_profile.md | 2 - docs/data-sources/tag.md | 2 +- docs/data-sources/trust_control_policy.md | 2 - docs/data-sources/vrf_fallback_route.md | 2 - docs/data-sources/vrf_fallback_route_group.md | 16 +- .../vrf_fallback_route_group_member.md | 2 - docs/resources/access_interface_override.md | 70 +- docs/resources/annotation.md | 2 +- docs/resources/application_epg.md | 568 +- docs/resources/bridge_domain.md | 411 +- docs/resources/certificate_authority.md | 60 +- docs/resources/custom_qos_policy.md | 12 +- docs/resources/data_plane_policing_policy.md | 12 +- docs/resources/endpoint_security_group.md | 194 +- docs/resources/endpoint_tag_ip.md | 12 +- docs/resources/endpoint_tag_mac.md | 12 +- docs/resources/epg_useg_ad_group_attribute.md | 12 +- docs/resources/epg_useg_block_statement.md | 12 +- docs/resources/epg_useg_dns_attribute.md | 12 +- docs/resources/epg_useg_ip_attribute.md | 12 +- docs/resources/epg_useg_mac_attribute.md | 12 +- .../resources/epg_useg_sub_block_statement.md | 12 +- docs/resources/epg_useg_vm_attribute.md | 12 +- ...nal_management_network_instance_profile.md | 43 +- .../external_management_network_subnet.md | 12 +- docs/resources/first_hop_security_policy.md | 63 +- docs/resources/igmp_snooping_policy.md | 12 +- docs/resources/key_ring.md | 60 +- docs/resources/l3out_consumer_label.md | 72 +- docs/resources/l3out_node_sid_profile.md | 12 +- docs/resources/l3out_provider_label.md | 12 +- docs/resources/l3out_redistribute_policy.md | 12 +- docs/resources/management_access_policy.md | 524 ++ docs/resources/mld_snooping_policy.md | 12 +- .../neighbor_discovery_interface_policy.md | 12 +- docs/resources/netflow_exporter_policy.md | 70 +- docs/resources/netflow_monitor_policy.md | 70 +- docs/resources/netflow_record_policy.md | 12 +- docs/resources/out_of_band_contract.md | 12 +- docs/resources/pim_route_map_entry.md | 12 +- docs/resources/pim_route_map_policy.md | 12 +- ...lation_from_bridge_domain_to_l3_outside.md | 12 +- ...bridge_domain_to_netflow_monitor_policy.md | 12 +- ...om_l3out_consumer_label_to_external_epg.md | 12 +- ...consumer_label_to_route_control_profile.md | 12 +- .../relation_to_consumed_contract.md | 12 +- ...lation_to_consumed_out_of_band_contract.md | 12 +- docs/resources/relation_to_contract_master.md | 12 +- docs/resources/relation_to_domain.md | 12 +- .../relation_to_fibre_channel_path.md | 12 +- .../relation_to_imported_contract.md | 12 +- .../relation_to_intra_epg_contract.md | 12 +- .../resources/relation_to_netflow_exporter.md | 12 +- .../relation_to_provided_contract.md | 12 +- docs/resources/relation_to_static_leaf.md | 12 +- docs/resources/relation_to_static_path.md | 12 +- docs/resources/relation_to_taboo_contract.md | 12 +- .../relation_to_vrf_fallback_route_group.md | 12 +- docs/resources/rogue_coop_exception.md | 12 +- docs/resources/route_control_profile.md | 12 +- docs/resources/tag.md | 2 +- docs/resources/trust_control_policy.md | 12 +- docs/resources/vrf_fallback_route.md | 12 +- docs/resources/vrf_fallback_route_group.md | 82 +- .../vrf_fallback_route_group_member.md | 12 +- .../data-source.tf | 4 + .../aci_management_access_policy/provider.tf | 14 + .../resource-all-attributes.tf | 24 + .../resource-all-attributes.tf | 192 + .../resource-all-attributes.tf | 156 + .../resource-all-attributes.tf | 48 + .../resource-all-attributes.tf | 72 + .../resource-all-attributes.tf | 12 + .../resource-all-attributes.tf | 12 + .../aci_key_ring/resource-all-attributes.tf | 48 + .../resource-all-attributes.tf | 24 + .../aci_management_access_policy/provider.tf | 14 + .../resource-all-attributes.tf | 187 + .../aci_management_access_policy/resource.tf | 4 + .../resource-all-attributes.tf | 24 + .../resource-all-attributes.tf | 24 + .../resource-all-attributes.tf | 24 + gen/definitions/classes.yaml | 10 + gen/definitions/properties.yaml | 141 +- gen/generator.go | 513 +- gen/meta/commHttp.json | 1649 +++++ gen/meta/commHttps.json | 1798 ++++++ gen/meta/commPol.json | 800 +++ gen/meta/commRsClientCertCA.json | 912 +++ gen/meta/commRsKeyRing.json | 1010 ++++ gen/meta/commShellinabox.json | 775 +++ gen/meta/commSsh.json | 1068 ++++ gen/meta/commTelnet.json | 775 +++ gen/templates/datasource.go.tmpl | 99 +- gen/templates/datasource.md.tmpl | 34 +- gen/templates/datasource_test.go.tmpl | 4 +- gen/templates/resource.go.tmpl | 1522 +++-- gen/templates/resource.md.tmpl | 95 +- .../resource_example_all_attributes.tf.tmpl | 162 +- gen/templates/resource_test.go.tmpl | 1313 +++- gen/templates/testvars.yaml.tmpl | 238 +- gen/testvars/commPol.yaml | 264 + gen/testvars/fhsBDPol.yaml | 15 + gen/testvars/fvAEPg.yaml | 393 +- gen/testvars/fvBD.yaml | 243 +- gen/testvars/fvCrtrn.yaml | 3 +- gen/testvars/fvESg.yaml | 168 +- gen/testvars/fvFBRGroup.yaml | 45 + gen/testvars/fvRsDomAtt.yaml | 3 +- gen/testvars/igmpSnoopPol.yaml | 3 +- gen/testvars/infraHPathS.yaml | 40 + gen/testvars/l3extConsLbl.yaml | 60 + gen/testvars/mgmtInstP.yaml | 31 + gen/testvars/mldSnoopPol.yaml | 3 +- gen/testvars/ndIfPol.yaml | 3 +- gen/testvars/netflowExporterPol.yaml | 30 + gen/testvars/netflowMonitorPol.yaml | 45 + gen/testvars/pkiKeyRing.yaml | 3 +- gen/testvars/rtctrlProfile.yaml | 3 +- gen/testvars/vzOOBBrCP.yaml | 4 +- ...ta_source_aci_access_interface_override.go | 64 + .../data_source_aci_application_epg.go | 512 ++ .../data_source_aci_application_epg_test.go | 2 +- .../provider/data_source_aci_bridge_domain.go | 416 ++ .../data_source_aci_bridge_domain_test.go | 8 +- ...data_source_aci_endpoint_security_group.go | 192 + ...source_aci_endpoint_security_group_test.go | 2 +- ...ource_aci_epg_useg_block_statement_test.go | 2 +- ...nal_management_network_instance_profile.go | 32 + ...ta_source_aci_first_hop_security_policy.go | 32 + ...ta_source_aci_igmp_snooping_policy_test.go | 2 +- .../provider/data_source_aci_key_ring_test.go | 4 +- .../data_source_aci_l3out_consumer_label.go | 64 + ...ata_source_aci_management_access_policy.go | 705 +++ ...ource_aci_management_access_policy_test.go | 49 + ...ata_source_aci_mld_snooping_policy_test.go | 2 +- ...eighbor_discovery_interface_policy_test.go | 2 +- ...data_source_aci_netflow_exporter_policy.go | 64 + .../data_source_aci_netflow_monitor_policy.go | 64 + ...ta_source_aci_out_of_band_contract_test.go | 2 +- ...data_source_aci_relation_to_domain_test.go | 4 +- ...a_source_aci_route_control_profile_test.go | 4 +- ...ata_source_aci_vrf_fallback_route_group.go | 64 + internal/provider/provider.go | 2 + .../resource_aci_access_interface_override.go | 589 +- ...urce_aci_access_interface_override_test.go | 105 +- .../provider/resource_aci_application_epg.go | 5353 +++++++++++++++-- .../resource_aci_application_epg_test.go | 1408 ++++- .../provider/resource_aci_bridge_domain.go | 3808 +++++++++++- .../resource_aci_bridge_domain_test.go | 850 ++- .../resource_aci_certificate_authority.go | 75 +- ...resource_aci_certificate_authority_test.go | 64 +- .../resource_aci_custom_qos_policy.go | 75 +- .../resource_aci_custom_qos_policy_test.go | 32 +- ...resource_aci_data_plane_policing_policy.go | 75 +- ...rce_aci_data_plane_policing_policy_test.go | 32 +- .../resource_aci_endpoint_security_group.go | 2074 ++++++- ...source_aci_endpoint_security_group_test.go | 590 +- .../provider/resource_aci_endpoint_tag_ip.go | 75 +- .../resource_aci_endpoint_tag_ip_test.go | 32 +- .../provider/resource_aci_endpoint_tag_mac.go | 75 +- .../resource_aci_endpoint_tag_mac_test.go | 32 +- ...esource_aci_epg_useg_ad_group_attribute.go | 75 +- ...ce_aci_epg_useg_ad_group_attribute_test.go | 32 +- .../resource_aci_epg_useg_block_statement.go | 75 +- ...ource_aci_epg_useg_block_statement_test.go | 42 +- .../resource_aci_epg_useg_dns_attribute.go | 75 +- ...esource_aci_epg_useg_dns_attribute_test.go | 32 +- .../resource_aci_epg_useg_ip_attribute.go | 75 +- ...resource_aci_epg_useg_ip_attribute_test.go | 32 +- .../resource_aci_epg_useg_mac_attribute.go | 75 +- ...esource_aci_epg_useg_mac_attribute_test.go | 32 +- ...source_aci_epg_useg_sub_block_statement.go | 75 +- ...e_aci_epg_useg_sub_block_statement_test.go | 64 +- .../resource_aci_epg_useg_vm_attribute.go | 75 +- ...resource_aci_epg_useg_vm_attribute_test.go | 64 +- ...nal_management_network_instance_profile.go | 343 +- ...anagement_network_instance_profile_test.go | 98 + ..._aci_external_management_network_subnet.go | 75 +- ...external_management_network_subnet_test.go | 32 +- .../resource_aci_first_hop_security_policy.go | 363 +- ...urce_aci_first_hop_security_policy_test.go | 66 +- .../resource_aci_igmp_snooping_policy.go | 75 +- .../resource_aci_igmp_snooping_policy_test.go | 44 +- internal/provider/resource_aci_key_ring.go | 75 +- .../provider/resource_aci_key_ring_test.go | 88 +- .../resource_aci_l3out_consumer_label.go | 630 +- .../resource_aci_l3out_consumer_label_test.go | 224 +- .../resource_aci_l3out_node_sid_profile.go | 75 +- ...esource_aci_l3out_node_sid_profile_test.go | 32 +- .../resource_aci_l3out_provider_label.go | 75 +- .../resource_aci_l3out_provider_label_test.go | 32 +- .../resource_aci_l3out_redistribute_policy.go | 75 +- ...urce_aci_l3out_redistribute_policy_test.go | 32 +- .../resource_aci_management_access_policy.go | 4280 +++++++++++++ ...ource_aci_management_access_policy_test.go | 1301 ++++ .../resource_aci_mld_snooping_policy.go | 75 +- .../resource_aci_mld_snooping_policy_test.go | 44 +- ...aci_neighbor_discovery_interface_policy.go | 75 +- ...eighbor_discovery_interface_policy_test.go | 44 +- .../resource_aci_netflow_exporter_policy.go | 587 +- ...source_aci_netflow_exporter_policy_test.go | 116 +- .../resource_aci_netflow_monitor_policy.go | 580 +- ...esource_aci_netflow_monitor_policy_test.go | 186 +- .../resource_aci_netflow_record_policy.go | 75 +- ...resource_aci_netflow_record_policy_test.go | 32 +- .../resource_aci_out_of_band_contract.go | 75 +- .../resource_aci_out_of_band_contract_test.go | 20 +- .../resource_aci_pim_route_map_entry.go | 75 +- .../resource_aci_pim_route_map_entry_test.go | 32 +- .../resource_aci_pim_route_map_policy.go | 75 +- .../resource_aci_pim_route_map_policy_test.go | 32 +- ...lation_from_bridge_domain_to_l3_outside.go | 75 +- ...n_from_bridge_domain_to_l3_outside_test.go | 32 +- ...bridge_domain_to_netflow_monitor_policy.go | 75 +- ...e_domain_to_netflow_monitor_policy_test.go | 32 +- ...om_l3out_consumer_label_to_external_epg.go | 75 +- ...out_consumer_label_to_external_epg_test.go | 32 +- ...consumer_label_to_route_control_profile.go | 75 +- ...mer_label_to_route_control_profile_test.go | 32 +- ...ource_aci_relation_to_consumed_contract.go | 75 +- ..._aci_relation_to_consumed_contract_test.go | 64 +- ...lation_to_consumed_out_of_band_contract.go | 75 +- ...n_to_consumed_out_of_band_contract_test.go | 32 +- ...esource_aci_relation_to_contract_master.go | 75 +- ...ce_aci_relation_to_contract_master_test.go | 64 +- .../resource_aci_relation_to_domain.go | 75 +- .../resource_aci_relation_to_domain_test.go | 56 +- ...urce_aci_relation_to_fibre_channel_path.go | 75 +- ...aci_relation_to_fibre_channel_path_test.go | 32 +- ...ource_aci_relation_to_imported_contract.go | 75 +- ..._aci_relation_to_imported_contract_test.go | 64 +- ...urce_aci_relation_to_intra_epg_contract.go | 75 +- ...aci_relation_to_intra_epg_contract_test.go | 64 +- ...source_aci_relation_to_netflow_exporter.go | 75 +- ...e_aci_relation_to_netflow_exporter_test.go | 32 +- ...ource_aci_relation_to_provided_contract.go | 75 +- ..._aci_relation_to_provided_contract_test.go | 64 +- .../resource_aci_relation_to_static_leaf.go | 75 +- ...source_aci_relation_to_static_leaf_test.go | 32 +- .../resource_aci_relation_to_static_path.go | 75 +- ...source_aci_relation_to_static_path_test.go | 32 +- ...resource_aci_relation_to_taboo_contract.go | 75 +- ...rce_aci_relation_to_taboo_contract_test.go | 32 +- ...ci_relation_to_vrf_fallback_route_group.go | 75 +- ...lation_to_vrf_fallback_route_group_test.go | 32 +- .../resource_aci_rogue_coop_exception.go | 75 +- .../resource_aci_rogue_coop_exception_test.go | 32 +- .../resource_aci_route_control_profile.go | 75 +- ...resource_aci_route_control_profile_test.go | 88 +- .../resource_aci_trust_control_policy.go | 75 +- .../resource_aci_trust_control_policy_test.go | 32 +- .../resource_aci_vrf_fallback_route.go | 75 +- .../resource_aci_vrf_fallback_route_group.go | 631 +- ...rce_aci_vrf_fallback_route_group_member.go | 75 +- ...ci_vrf_fallback_route_group_member_test.go | 32 +- ...ource_aci_vrf_fallback_route_group_test.go | 172 +- .../resource_aci_vrf_fallback_route_test.go | 32 +- internal/provider/utils.go | 13 + 312 files changed, 44453 insertions(+), 6159 deletions(-) create mode 100644 docs/data-sources/management_access_policy.md create mode 100644 docs/resources/management_access_policy.md create mode 100644 examples/data-sources/aci_management_access_policy/data-source.tf create mode 100644 examples/data-sources/aci_management_access_policy/provider.tf create mode 100644 examples/resources/aci_management_access_policy/provider.tf create mode 100644 examples/resources/aci_management_access_policy/resource-all-attributes.tf create mode 100644 examples/resources/aci_management_access_policy/resource.tf create mode 100644 gen/meta/commHttp.json create mode 100644 gen/meta/commHttps.json create mode 100644 gen/meta/commPol.json create mode 100644 gen/meta/commRsClientCertCA.json create mode 100644 gen/meta/commRsKeyRing.json create mode 100644 gen/meta/commShellinabox.json create mode 100644 gen/meta/commSsh.json create mode 100644 gen/meta/commTelnet.json create mode 100644 gen/testvars/commPol.yaml create mode 100644 internal/provider/data_source_aci_management_access_policy.go create mode 100644 internal/provider/data_source_aci_management_access_policy_test.go create mode 100644 internal/provider/resource_aci_management_access_policy.go create mode 100644 internal/provider/resource_aci_management_access_policy_test.go diff --git a/docs/data-sources/access_interface_override.md b/docs/data-sources/access_interface_override.md index deb3c0574..9e5f507a4 100644 --- a/docs/data-sources/access_interface_override.md +++ b/docs/data-sources/access_interface_override.md @@ -60,19 +60,27 @@ data "aci_access_interface_override" "example" { * `name_alias` (nameAlias) - (string) The name alias of the Access Interface Override object. * `owner_key` (ownerKey) - (string) The key for enabling clients to own their data for entity correlation. * `owner_tag` (ownerTag) - (string) A tag for enabling clients to add their own data. For example, to indicate who created this object. - * `relation_to_host_path` - (map) A map of Relation To Host Path (ACI object [infraRsHPathAtt](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/infraRsHPathAtt/overview)) pointing to Fabric Path Endpoint (ACI Object [fabricPathEp](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fabricPathEp/overview)). * `annotation` (annotation) - (string) The annotation of the Relation To Host Path object. * `target_dn` (tDn) - (string) The distinguished name of the target. - + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `relation_to_access_interface_policy_group` - (map) A map of Relation To Access Interface Policy Group (ACI object [infraRsPathToAccBaseGrp](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/infraRsPathToAccBaseGrp/overview)) pointing to Access Interface Policy Group (ACI Object [infraAccBaseGrp](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/infraAccBaseGrp/overview)). * `annotation` (annotation) - (string) The annotation of the Relation To Access Interface Policy Group object. * `target_dn` (tDn) - (string) The distinguished name of the target. - + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. - * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. diff --git a/docs/data-sources/annotation.md b/docs/data-sources/annotation.md index 8f4d88e9c..329dce7fb 100644 --- a/docs/data-sources/annotation.md +++ b/docs/data-sources/annotation.md @@ -57,6 +57,7 @@ data "aci_annotation" "example_application_epg" { - [aci_cloud_epg](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/cloud_epg) ([cloudEPg](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/cloudEPg/overview)) - [aci_cloud_external_epg](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/cloud_external_epg) ([cloudExtEPg](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/cloudExtEPg/overview)) - [aci_cloud_service_epg](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/cloud_service_epg) ([cloudSvcEPg](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/cloudSvcEPg/overview)) + - [aci_management_access_policy](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/management_access_policy) ([commPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/commPol/overview)) - [aci_dhcp_relay_policy](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/dhcp_relay_policy) ([dhcpRelayP](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/dhcpRelayP/overview)) - [aci_first_hop_security_policy](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/first_hop_security_policy) ([fhsBDPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fhsBDPol/overview)) - [aci_trust_control_policy](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/trust_control_policy) ([fhsTrustCtrlPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fhsTrustCtrlPol/overview)) @@ -73,7 +74,6 @@ data "aci_annotation" "example_application_epg" { - [aci_vrf_fallback_route_group](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/vrf_fallback_route_group) ([fvFBRGroup](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvFBRGroup/overview)) - [aci_vrf_fallback_route_group_member](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/vrf_fallback_route_group_member) ([fvFBRMember](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvFBRMember/overview)) - [aci_vrf_fallback_route](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/vrf_fallback_route) ([fvFBRoute](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvFBRoute/overview)) - - [aci_epg_useg_ad_group_attribute](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/epg_useg_ad_group_attribute) ([fvIdGroupAttr](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvIdGroupAttr/overview)) * `key` (key) - (string) The key used to uniquely identify this configuration object. ### Read-Only ### diff --git a/docs/data-sources/application_epg.md b/docs/data-sources/application_epg.md index d5a60f09e..7a2a43d57 100644 --- a/docs/data-sources/application_epg.md +++ b/docs/data-sources/application_epg.md @@ -62,7 +62,6 @@ data "aci_application_epg" "example_application_profile" { * `preferred_group_member` (prefGrMemb) - (string) Parameter used to determine whether the EPG is part of the preferred group. Members of this group are allowed to communicate without contracts. * `priority` (prio) - (string) The Quality of Service (QoS) priority class ID. QoS refers to the capability of a network to provide better service to selected network traffic over various technologies. The primary goal of QoS is to provide priority including dedicated bandwidth, controlled jitter and latency (required by some real-time and interactive traffic), and improved loss characteristics. You can configure the bandwidth of each QoS level using QoS profiles. * `admin_state` (shutdown) - (string) Withdraw AEPg Configuration from all Nodes in the Fabric. - * `epg_useg_block_statement` - (map) A map of EPG uSeg Block Statement (ACI object [fvCrtrn](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvCrtrn/overview)). This attribute is supported in ACI versions: 1.1(1j) and later. * `annotation` (annotation) - (string) The annotation of the EPG uSeg Block Statement object. * `description` (descr) - (string) The description of the EPG uSeg Block Statement object. @@ -73,29 +72,59 @@ data "aci_application_epg" "example_application_profile" { * `owner_tag` (ownerTag) - (string) A tag for enabling clients to add their own data. For example, to indicate who created this object. * `precedence` (prec) - (string) The precedence of the EPG uSeg Block Statement object. * `scope` (scope) - (string) The scope of the EPG uSeg Block Statement object. - + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `relation_to_application_epg_monitoring_policy` - (map) A map of Relation To Application EPG Monitoring Policy (ACI object [fvRsAEPgMonPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsAEPgMonPol/overview)) pointing to Monitoring Policy (ACI Object [monEPGPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/monEPGPol/overview)). * `annotation` (annotation) - (string) The annotation of the Relation To Application EPG Monitoring Policy object. * `monitoring_policy_name` (tnMonEPGPolName) - (string) The name of the monitoring policy. - + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `relation_to_bridge_domain` - (map) A map of Relation To Bridge Domain (ACI object [fvRsBd](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsBd/overview)) pointing to Bridge Domain (ACI Object [fvBD](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvBD/overview)). * `annotation` (annotation) - (string) The annotation of the Relation To Bridge Domain object. * `bridge_domain_name` (tnFvBDName) - (string) The name of the bridge domain associated with this EPG. - + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `relation_to_consumed_contracts` - (list) A list of Relation To Consumed Contracts (ACI object [fvRsCons](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsCons/overview)) pointing to Contract (ACI Object [vzBrCP](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/vzBrCP/overview)). * `annotation` (annotation) - (string) The annotation of the Relation To Consumed Contract object. * `priority` (prio) - (string) The Quality of Service (QoS) priority class ID. QoS refers to the capability of a network to provide better service to selected network traffic over various technologies. The primary goal of QoS is to provide priority including dedicated bandwidth, controlled jitter and latency (required by some real-time and interactive traffic), and improved loss characteristics. You can configure the bandwidth of each QoS level using QoS profiles. * `contract_name` (tnVzBrCPName) - (string) The consumer contract name. - + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `relation_to_imported_contracts` - (list) A list of Relation To Imported Contracts (ACI object [fvRsConsIf](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsConsIf/overview)) pointing to Imported Contract (ACI Object [vzCPIf](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/vzCPIf/overview)). * `annotation` (annotation) - (string) The annotation of the Relation To Imported Contract object. * `priority` (prio) - (string) The Quality of Service (QoS) priority class ID. QoS refers to the capability of a network to provide better service to selected network traffic over various technologies. The primary goal of QoS is to provide priority including dedicated bandwidth, controlled jitter and latency (required by some real-time and interactive traffic), and improved loss characteristics. You can configure the bandwidth of each QoS level using QoS profiles. * `imported_contract_name` (tnVzCPIfName) - (string) The contract interface name. - + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `relation_to_custom_qos_policy` - (map) A map of Relation To Custom Qos Policy (ACI object [fvRsCustQosPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsCustQosPol/overview)) pointing to Custom Qos Policy (ACI Object [qosCustomPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/qosCustomPol/overview)). * `annotation` (annotation) - (string) The annotation of the Relation To Custom Qos Policy object. * `custom_qos_policy_name` (tnQosCustomPolName) - (string) The Custom QoS traffic policy name. - + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `relation_to_domains` - (list) A list of Relation To Domains (ACI object [fvRsDomAtt](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsDomAtt/overview)). This relation can point to multiple ACI objects: - [vmmDomP](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/vmmDomP/overview). @@ -127,22 +156,42 @@ data "aci_application_epg" "example_application_profile" { * `switching_mode` (switchingMode) - (string) The switching mode of the Relation To Domain object. * `target_dn` (tDn) - (string) The distinguished name of the target Domain object. * `untagged` (untagged) - (string) The untagged status of the Relation To Domain object. - + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `relation_to_data_plane_policing_policy` - (map) A map of Relation To Data Plane Policing Policy (ACI object [fvRsDppPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsDppPol/overview)) pointing to Data Plane Policing Policy (ACI Object [qosDppPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/qosDppPol/overview)). This attribute is supported in ACI versions: 3.0(1k) and later. * `annotation` (annotation) - (string) The annotation of the Relation To Data Plane Policing Policy object. * `data_plane_policing_policy_name` (tnQosDppPolName) - (string) Name. - + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `relation_to_fibre_channel_paths` - (list) A list of Relation To Fibre Channel Paths (ACI object [fvRsFcPathAtt](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsFcPathAtt/overview)) pointing to Fabric Path Endpoint (ACI Object [fabricPathEp](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fabricPathEp/overview)). This attribute is supported in ACI versions: 2.0(1m) and later. * `annotation` (annotation) - (string) The annotation of the Relation To Fibre Channel Path object. * `description` (descr) - (string) The description of the Relation To Fibre Channel Path object. * `target_dn` (tDn) - (string) The distinguished name of the target. * `vsan` (vsan) - (string) The virtual storage area network (VSAN) of the Relation To Fibre Channel Path object. * `vsan_mode` (vsanMode) - (string) The virtual storage area network (VSAN) mode of the Relation To Fibre Channel Path object. - + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `relation_to_intra_epg_contracts` - (list) A list of Relation To Intra EPG Contracts (ACI object [fvRsIntraEpg](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsIntraEpg/overview)) pointing to Contract (ACI Object [vzBrCP](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/vzBrCP/overview)). This attribute is supported in ACI versions: 3.0(1k) and later. * `annotation` (annotation) - (string) The annotation of the Relation To Intra EPG Contract object. * `contract_name` (tnVzBrCPName) - (string) The contract name. - + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `relation_to_static_leafs` - (list) A list of Relation To Static Leafs (ACI object [fvRsNodeAtt](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsNodeAtt/overview)) pointing to (ACI Object [fabricNode](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fabricNode/overview)). * `annotation` (annotation) - (string) The annotation of the Relation To Static Leaf object. * `description` (descr) - (string) The description of the Relation To Static Leaf object. @@ -150,7 +199,12 @@ data "aci_application_epg" "example_application_profile" { * `deployment_immediacy` (instrImedcy) - (string) The deployment immediacy of the Relation To Static Leaf object. Specifies when the policy is pushed into the hardware policy content-addressable memory (CAM). * `mode` (mode) - (string) The static association mode with the path of the Relation To Static Leaf object. * `target_dn` (tDn) - (string) The distinguished name of the target of this static binding. - + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `relation_to_static_paths` - (list) A list of Relation To Static Paths (ACI object [fvRsPathAtt](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsPathAtt/overview)) pointing to Fabric Path Endpoint (ACI Object [fabricPathEp](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fabricPathEp/overview)). * `annotation` (annotation) - (string) The annotation of the Relation To Static Path object. * `description` (descr) - (string) The description of the Relation To Static Path object. @@ -159,29 +213,53 @@ data "aci_application_epg" "example_application_profile" { * `mode` (mode) - (string) The static association mode of the Relation To Static Path object. * `primary_encapsulation` (primaryEncap) - (string) The primary VLAN encapsulation of the Relation To Static Path object. * `target_dn` (tDn) - (string) null. - + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `relation_to_taboo_contracts` - (list) A list of Relation To Taboo Contracts (ACI object [fvRsProtBy](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsProtBy/overview)) pointing to Taboo Contract (ACI Object [vzTaboo](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/vzTaboo/overview)). * `annotation` (annotation) - (string) The annotation of the Relation To Taboo Contract object. * `taboo_contract_name` (tnVzTabooName) - (string) A contract for denying specific classes of traffic. Taboo rules are applied in the hardware before applying the rules of regular contracts. Without a contract, the default forwarding policy is to not allow any communication between EPGs. - + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `relation_to_provided_contracts` - (list) A list of Relation To Provided Contracts (ACI object [fvRsProv](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsProv/overview)) pointing to Contract (ACI Object [vzBrCP](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/vzBrCP/overview)). * `annotation` (annotation) - (string) The annotation of the Relation To Provided Contract object. * `match_criteria` (matchT) - (string) The provider label match criteria. * `priority` (prio) - (string) The Quality of Service (QoS) priority class ID. QoS refers to the capability of a network to provide better service to selected network traffic over various technologies. The primary goal of QoS is to provide priority including dedicated bandwidth, controlled jitter and latency (required by some real-time and interactive traffic), and improved loss characteristics. You can configure the bandwidth of each QoS level using QoS profiles. * `contract_name` (tnVzBrCPName) - (string) The provider contract name. - -* `relation_to_contract_masters` - (list) A list of Relation To Contract Masters (ACI object [fvRsSecInherited](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsSecInherited/overview)) pointing to Application EPG (ACI Object [fvAEPg](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvAEPg/overview)). This attribute is supported in ACI versions: 2.3(1e) and later. + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. +* `relation_to_contract_masters` - (list) A list of Relation To Contract Masters (ACI object [fvRsSecInherited](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsSecInherited/overview)) pointing to . This attribute is supported in ACI versions: 2.3(1e) and later. * `annotation` (annotation) - (string) The annotation of the Relation To Contract Master object. * `target_dn` (tDn) - (string) The distinguished name of the target. - + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `relation_to_trust_control_policy` - (map) A map of Relation To Trust Control Policy (ACI object [fvRsTrustCtrl](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsTrustCtrl/overview)) pointing to Trust Control Policy (ACI Object [fhsTrustCtrlPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fhsTrustCtrlPol/overview)). This attribute is supported in ACI versions: 3.0(1k) and later. * `annotation` (annotation) - (string) The annotation of the Relation To Trust Control Policy object. * `trust_control_policy_name` (tnFhsTrustCtrlPolName) - (string) Name. - + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. - * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. diff --git a/docs/data-sources/bridge_domain.md b/docs/data-sources/bridge_domain.md index 066cf5f98..e1ffeef3f 100644 --- a/docs/data-sources/bridge_domain.md +++ b/docs/data-sources/bridge_domain.md @@ -75,7 +75,6 @@ data "aci_bridge_domain" "example_tenant" { * `l3_unknown_multicast_flooding` (unkMcastAct) - (string) The forwarding method for unknown layer 3 multicast destinations. * `ipv6_l3_unknown_multicast_flooding` (v6unkMcastAct) - (string) The forwarding method for unknown IPv6 multicast destinations. * `virtual_mac_address` (vmac) - (string) The virtual MAC address of the Bridge Domain object. This is used when the the BD/SVI is extended to multiple sites using a L2 Outside. - * `legacy_mode` - (map) A map of Legacy Mode (ACI object [fvAccP](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvAccP/overview)). * `annotation` (annotation) - (string) The annotation of the Legacy Mode object. * `description` (descr) - (string) The description of the Legacy Mode object. @@ -84,65 +83,129 @@ data "aci_bridge_domain" "example_tenant" { * `name_alias` (nameAlias) - (string) The name alias of the Legacy Mode object. * `owner_key` (ownerKey) - (string) The key for enabling clients to own their data for entity correlation. * `owner_tag` (ownerTag) - (string) A tag for enabling clients to add their own data. For example, to indicate who created this object. - + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `rogue_coop_exceptions` - (list) A list of Rogue Coop Exceptions (ACI object [fvRogueExceptionMac](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRogueExceptionMac/overview)). This attribute is supported in ACI versions: 5.2(3e) and later. * `annotation` (annotation) - (string) The annotation of the Rogue Coop Exception object. * `description` (descr) - (string) The description of the Rogue Coop Exception object. * `mac` (mac) - (string) The MAC address of the Rogue Coop Exception object. * `name` (name) - (string) The name of the Rogue Coop Exception object. * `name_alias` (nameAlias) - (string) The name alias of the Rogue Coop Exception object. - + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `relation_to_monitor_policy` - (map) A map of Relation From Bridge Domain To Monitoring Policy (ACI object [fvRsABDPolMonPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsABDPolMonPol/overview)) pointing to Monitoring Policy (ACI Object [monEPGPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/monEPGPol/overview)). * `annotation` (annotation) - (string) The annotation of the Relation From Bridge Domain To Monitoring Policy object. * `monitoring_policy_name` (tnMonEPGPolName) - (string) The name of the Monitoring Policy object. - + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `relation_to_first_hop_security_policy` - (map) A map of Relation From Bridge Domain To First Hop Security Policy (ACI object [fvRsBDToFhs](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsBDToFhs/overview)) pointing to First Hop Security Policy (ACI Object [fhsBDPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fhsBDPol/overview)). This attribute is supported in ACI versions: 3.0(1k) and later. * `annotation` (annotation) - (string) The annotation of the Relation From Bridge Domain To First Hop Security Policy object. * `first_hop_security_policy_name` (tnFhsBDPolName) - (string) The name of the First Hop Security Policy object. - + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `relation_to_neighbor_discovery_interface_policy` - (map) A map of Relation From Bridge Domain To Neighbor Discovery Interface Policy (ACI object [fvRsBDToNdP](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsBDToNdP/overview)) pointing to Neighbor Discovery Interface Policy (ACI Object [ndIfPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/ndIfPol/overview)). This attribute is supported in ACI versions: 1.1(1j) and later. * `annotation` (annotation) - (string) The annotation of the Relation From Bridge Domain To Neighbor Discovery Interface Policy object. * `neighbor_discovery_interface_policy_name` (tnNdIfPolName) - (string) The name of the Neighbor Discovery Interface Policy object. - + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `relation_to_netflow_monitor_policies` - (list) A list of Relation From Bridge Domain To NetFlow Monitor Policys (ACI object [fvRsBDToNetflowMonitorPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsBDToNetflowMonitorPol/overview)) pointing to NetFlow Monitor Policy (ACI Object [netflowMonitorPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/netflowMonitorPol/overview)). This attribute is supported in ACI versions: 2.2(1k) and later. * `annotation` (annotation) - (string) The annotation of the Relation From Bridge Domain To NetFlow Monitor Policy object. * `filter_type` (fltType) - (string) The filter type of the NetFlow Monitor Policy object. * `netflow_monitor_policy_name` (tnNetflowMonitorPolName) - (string) The name of the NetFlow Monitor Policy object. - + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `relation_to_l3_outsides` - (list) A list of Relation From Bridge Domain To L3 Outsides (ACI object [fvRsBDToOut](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsBDToOut/overview)) pointing to L3 Outside (ACI Object [l3extOut](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/l3extOut/overview)). * `annotation` (annotation) - (string) The annotation of the Relation From Bridge Domain To L3 Outside object. * `l3_outside_name` (tnL3extOutName) - (string) The name of the L3 Outside object. - + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `relation_to_route_control_profile` - (map) A map of Relation From Bridge Domain To Route Control Profile (ACI object [fvRsBDToProfile](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsBDToProfile/overview)) pointing to Route Control Profile (ACI Object [rtctrlProfile](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/rtctrlProfile/overview)). * `annotation` (annotation) - (string) The annotation of the Relation From Bridge Domain To Route Control Profile object. * `l3_outside_name` (tnL3extOutName) - (string) The name of the L3 Outside object. * `route_control_profile_name` (tnRtctrlProfileName) - (string) The name of the Route Control Profile object. - + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `relation_to_dhcp_relay_policy` - (map) A map of Relation From Bridge Domain To Dhcp Relay Policy (ACI object [fvRsBDToRelayP](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsBDToRelayP/overview)) pointing to Dhcp Relay Policy (ACI Object [dhcpRelayP](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/dhcpRelayP/overview)). * `annotation` (annotation) - (string) The annotation of the Relation From Bridge Domain To Dhcp Relay Policy object. * `dhcp_relay_policy_name` (tnDhcpRelayPName) - (string) The name of the DHCP Relay Policy object. - + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `relation_to_end_point_retention_policy` - (map) A map of Relation From Bridge Domain To End Point Retention Policy (ACI object [fvRsBdToEpRet](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsBdToEpRet/overview)) pointing to End Point Retention Policy (ACI Object [fvEpRetPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvEpRetPol/overview)). * `annotation` (annotation) - (string) The annotation of the Relation From Bridge Domain To End Point Retention Policy object. * `resolve_action` (resolveAct) - (string) The action to take for resolving the Endpoint Retention Policy object. * `end_point_retention_policy_name` (tnFvEpRetPolName) - (string) The name of the Endpoint Retention Policy object. - + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `relation_to_vrf` - (map) A map of Relation To VRF (ACI object [fvRsCtx](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsCtx/overview)) pointing to VRF (ACI Object [fvCtx](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvCtx/overview)). * `annotation` (annotation) - (string) The annotation of the Relation To VRF object. * `vrf_name` (tnFvCtxName) - (string) The name of the VRF object. - + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `relation_to_igmp_snooping_policy` - (map) A map of Relation To IGMP Snooping Policy (ACI object [fvRsIgmpsn](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsIgmpsn/overview)) pointing to IGMP Snooping Policy (ACI Object [igmpSnoopPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/igmpSnoopPol/overview)). * `annotation` (annotation) - (string) The annotation of the Relation To IGMP Snooping Policy object. * `igmp_snooping_policy_name` (tnIgmpSnoopPolName) - (string) The name of the IGMP Snooping Policy object. - + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `relation_to_mld_snooping_policy` - (map) A map of Relation To MLD Snooping Policy (ACI object [fvRsMldsn](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsMldsn/overview)) pointing to MLD Snooping Policy (ACI Object [mldSnoopPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/mldSnoopPol/overview)). This attribute is supported in ACI versions: 4.1(1i) and later. * `annotation` (annotation) - (string) The annotation of the Relation To MLD Snooping Policy object. * `mld_snooping_policy_name` (tnMldSnoopPolName) - (string) The name of the MLD Snooping Policy object. - + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. - * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. diff --git a/docs/data-sources/certificate_authority.md b/docs/data-sources/certificate_authority.md index d9ed7d901..e23489cef 100644 --- a/docs/data-sources/certificate_authority.md +++ b/docs/data-sources/certificate_authority.md @@ -67,11 +67,9 @@ data "aci_certificate_authority" "example_tenant" { * `name_alias` (nameAlias) - (string) The name alias of the Certificate Authority object. * `owner_key` (ownerKey) - (string) The key for enabling clients to own their data for entity correlation. * `owner_tag` (ownerTag) - (string) A tag for enabling clients to add their own data. For example, to indicate who created this object. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. - * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. diff --git a/docs/data-sources/custom_qos_policy.md b/docs/data-sources/custom_qos_policy.md index 76f8f20de..77203dead 100644 --- a/docs/data-sources/custom_qos_policy.md +++ b/docs/data-sources/custom_qos_policy.md @@ -53,11 +53,9 @@ data "aci_custom_qos_policy" "example_tenant" { * `name_alias` (nameAlias) - (string) The name alias of the Custom Qos Policy object. * `owner_key` (ownerKey) - (string) The key for enabling clients to own their data for entity correlation. * `owner_tag` (ownerTag) - (string) A tag for enabling clients to add their own data. For example, to indicate who created this object. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. - * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. diff --git a/docs/data-sources/data_plane_policing_policy.md b/docs/data-sources/data_plane_policing_policy.md index 8b86f521e..36c938598 100644 --- a/docs/data-sources/data_plane_policing_policy.md +++ b/docs/data-sources/data_plane_policing_policy.md @@ -83,11 +83,9 @@ data "aci_data_plane_policing_policy" "example_tenant" { * `violate_action` (violateAction) - (string) The violate action of the Data Plane Policing Policy object. * `violate_mark_cos` (violateMarkCos) - (string) The violate mark class of service (CoS) of the Data Plane Policing Policy object. * `violate_mark_dscp` (violateMarkDscp) - (string) The violate mark differentiated services code point (DSCP) of the Data Plane Policing Policy object. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. - * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. diff --git a/docs/data-sources/endpoint_security_group.md b/docs/data-sources/endpoint_security_group.md index ff4d898e8..1017da309 100644 --- a/docs/data-sources/endpoint_security_group.md +++ b/docs/data-sources/endpoint_security_group.md @@ -57,39 +57,67 @@ data "aci_endpoint_security_group" "example_application_profile" { * `pc_tag` (pcTag) - (string) The classification tag used for policy enforcement and zoning. * `preferred_group_member` (prefGrMemb) - (string) Parameter used to determine whether the ESG is part of the preferred group. Members of this group are allowed to communicate without contracts. * `admin_state` (shutdown) - (string) Withdraw the ESG configuration from all nodes in the fabric. - * `relation_to_consumed_contracts` - (list) A list of Relation To Consumed Contracts (ACI object [fvRsCons](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsCons/overview)) pointing to Contract (ACI Object [vzBrCP](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/vzBrCP/overview)). This attribute is supported in ACI versions: 1.0(1e) and later. * `annotation` (annotation) - (string) The annotation of the Relation To Consumed Contract object. * `priority` (prio) - (string) The Quality of Service (QoS) priority class ID. QoS refers to the capability of a network to provide better service to selected network traffic over various technologies. The primary goal of QoS is to provide priority including dedicated bandwidth, controlled jitter and latency (required by some real-time and interactive traffic), and improved loss characteristics. You can configure the bandwidth of each QoS level using QoS profiles. * `contract_name` (tnVzBrCPName) - (string) The consumer contract name. - + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `relation_to_imported_contracts` - (list) A list of Relation To Imported Contracts (ACI object [fvRsConsIf](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsConsIf/overview)) pointing to Imported Contract (ACI Object [vzCPIf](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/vzCPIf/overview)). This attribute is supported in ACI versions: 1.0(1e) and later. * `annotation` (annotation) - (string) The annotation of the Relation To Imported Contract object. * `priority` (prio) - (string) The Quality of Service (QoS) priority class ID. QoS refers to the capability of a network to provide better service to selected network traffic over various technologies. The primary goal of QoS is to provide priority including dedicated bandwidth, controlled jitter and latency (required by some real-time and interactive traffic), and improved loss characteristics. You can configure the bandwidth of each QoS level using QoS profiles. * `imported_contract_name` (tnVzCPIfName) - (string) The contract interface name. - + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `relation_to_intra_epg_contracts` - (list) A list of Relation To Intra EPG Contracts (ACI object [fvRsIntraEpg](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsIntraEpg/overview)) pointing to Contract (ACI Object [vzBrCP](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/vzBrCP/overview)). This attribute is supported in ACI versions: 3.0(1k) and later. * `annotation` (annotation) - (string) The annotation of the Relation To Intra EPG Contract object. * `contract_name` (tnVzBrCPName) - (string) The contract name. - + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `relation_to_provided_contracts` - (list) A list of Relation To Provided Contracts (ACI object [fvRsProv](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsProv/overview)) pointing to Contract (ACI Object [vzBrCP](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/vzBrCP/overview)). This attribute is supported in ACI versions: 1.0(1e) and later. * `annotation` (annotation) - (string) The annotation of the Relation To Provided Contract object. * `match_criteria` (matchT) - (string) The provider label match criteria. * `priority` (prio) - (string) The Quality of Service (QoS) priority class ID. QoS refers to the capability of a network to provide better service to selected network traffic over various technologies. The primary goal of QoS is to provide priority including dedicated bandwidth, controlled jitter and latency (required by some real-time and interactive traffic), and improved loss characteristics. You can configure the bandwidth of each QoS level using QoS profiles. * `contract_name` (tnVzBrCPName) - (string) The provider contract name. - + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `relation_to_vrf` - (map) A map of Relation To VRF (ACI object [fvRsScope](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsScope/overview)) pointing to VRF (ACI Object [fvCtx](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvCtx/overview)). * `annotation` (annotation) - (string) The annotation of the Relation To VRF object. * `vrf_name` (tnFvCtxName) - (string) The name of the VRF object. - -* `relation_to_contract_masters` - (list) A list of Relation To Contract Masters (ACI object [fvRsSecInherited](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsSecInherited/overview)) pointing to Endpoint Security Group (ACI Object [fvESg](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvESg/overview)). This attribute is supported in ACI versions: 2.3(1e) and later. + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. +* `relation_to_contract_masters` - (list) A list of Relation To Contract Masters (ACI object [fvRsSecInherited](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsSecInherited/overview)) pointing to . This attribute is supported in ACI versions: 2.3(1e) and later. * `annotation` (annotation) - (string) The annotation of the Relation To Contract Master object. * `target_dn` (tDn) - (string) The distinguished name of the target. - + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. - * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. diff --git a/docs/data-sources/endpoint_tag_ip.md b/docs/data-sources/endpoint_tag_ip.md index 8a61d627a..1ec990968 100644 --- a/docs/data-sources/endpoint_tag_ip.md +++ b/docs/data-sources/endpoint_tag_ip.md @@ -54,11 +54,9 @@ data "aci_endpoint_tag_ip" "example_tenant" { * `id_attribute` (id) - (string) The identifier of the Endpoint Tag IP object. * `name` (name) - (string) The name of the Endpoint Tag IP object. * `name_alias` (nameAlias) - (string) The name alias of the Endpoint Tag IP object. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. - * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. diff --git a/docs/data-sources/endpoint_tag_mac.md b/docs/data-sources/endpoint_tag_mac.md index 84eeaba1d..fd783fc82 100644 --- a/docs/data-sources/endpoint_tag_mac.md +++ b/docs/data-sources/endpoint_tag_mac.md @@ -54,11 +54,9 @@ data "aci_endpoint_tag_mac" "example_tenant" { * `id_attribute` (id) - (string) The identifier of the Endpoint Tag MAC object. * `name` (name) - (string) The name of the Endpoint Tag MAC object. * `name_alias` (nameAlias) - (string) The name alias of the Endpoint Tag MAC object. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. - * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. diff --git a/docs/data-sources/epg_useg_ad_group_attribute.md b/docs/data-sources/epg_useg_ad_group_attribute.md index c08edc09b..333af2a38 100644 --- a/docs/data-sources/epg_useg_ad_group_attribute.md +++ b/docs/data-sources/epg_useg_ad_group_attribute.md @@ -54,11 +54,9 @@ data "aci_epg_useg_ad_group_attribute" "example_epg_useg_block_statement" { * `name_alias` (nameAlias) - (string) The name alias of the EPG uSeg AD Group Attribute object. * `owner_key` (ownerKey) - (string) The key for enabling clients to own their data for entity correlation. * `owner_tag` (ownerTag) - (string) A tag for enabling clients to add their own data. For example, to indicate who created this object. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. - * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. diff --git a/docs/data-sources/epg_useg_block_statement.md b/docs/data-sources/epg_useg_block_statement.md index 03e85d2dc..01900e3ff 100644 --- a/docs/data-sources/epg_useg_block_statement.md +++ b/docs/data-sources/epg_useg_block_statement.md @@ -55,11 +55,9 @@ data "aci_epg_useg_block_statement" "example_application_epg" { * `owner_tag` (ownerTag) - (string) A tag for enabling clients to add their own data. For example, to indicate who created this object. * `precedence` (prec) - (string) The precedence of the EPG uSeg Block Statement object. * `scope` (scope) - (string) The scope of the EPG uSeg Block Statement object. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. - * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. diff --git a/docs/data-sources/epg_useg_dns_attribute.md b/docs/data-sources/epg_useg_dns_attribute.md index 4757ec858..8c5df69b6 100644 --- a/docs/data-sources/epg_useg_dns_attribute.md +++ b/docs/data-sources/epg_useg_dns_attribute.md @@ -54,11 +54,9 @@ data "aci_epg_useg_dns_attribute" "example_epg_useg_block_statement" { * `name_alias` (nameAlias) - (string) The name alias of the EPG uSeg DNS Attribute object. * `owner_key` (ownerKey) - (string) The key for enabling clients to own their data for entity correlation. * `owner_tag` (ownerTag) - (string) A tag for enabling clients to add their own data. For example, to indicate who created this object. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. - * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. diff --git a/docs/data-sources/epg_useg_ip_attribute.md b/docs/data-sources/epg_useg_ip_attribute.md index 608168fa8..2824d8e40 100644 --- a/docs/data-sources/epg_useg_ip_attribute.md +++ b/docs/data-sources/epg_useg_ip_attribute.md @@ -55,11 +55,9 @@ data "aci_epg_useg_ip_attribute" "example_epg_useg_block_statement" { * `owner_key` (ownerKey) - (string) The key for enabling clients to own their data for entity correlation. * `owner_tag` (ownerTag) - (string) A tag for enabling clients to add their own data. For example, to indicate who created this object. * `use_epg_subnet` (usefvSubnet) - (string) Parameter used to determine whether a previously configured subnet address should be used as the IP filter. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. - * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. diff --git a/docs/data-sources/epg_useg_mac_attribute.md b/docs/data-sources/epg_useg_mac_attribute.md index d631b180b..9cf3a2472 100644 --- a/docs/data-sources/epg_useg_mac_attribute.md +++ b/docs/data-sources/epg_useg_mac_attribute.md @@ -54,11 +54,9 @@ data "aci_epg_useg_mac_attribute" "example_epg_useg_block_statement" { * `name_alias` (nameAlias) - (string) The name alias of the EPG uSeg MAC Attribute object. * `owner_key` (ownerKey) - (string) The key for enabling clients to own their data for entity correlation. * `owner_tag` (ownerTag) - (string) A tag for enabling clients to add their own data. For example, to indicate who created this object. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. - * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. diff --git a/docs/data-sources/epg_useg_sub_block_statement.md b/docs/data-sources/epg_useg_sub_block_statement.md index 07d84ccab..db19a6290 100644 --- a/docs/data-sources/epg_useg_sub_block_statement.md +++ b/docs/data-sources/epg_useg_sub_block_statement.md @@ -60,11 +60,9 @@ data "aci_epg_useg_sub_block_statement" "example_epg_useg_sub_block_statement" { * `name_alias` (nameAlias) - (string) The name alias of the EPG uSeg Sub Block Statement object. * `owner_key` (ownerKey) - (string) The key for enabling clients to own their data for entity correlation. * `owner_tag` (ownerTag) - (string) A tag for enabling clients to add their own data. For example, to indicate who created this object. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. - * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. diff --git a/docs/data-sources/epg_useg_vm_attribute.md b/docs/data-sources/epg_useg_vm_attribute.md index 7c397358a..e414ab3af 100644 --- a/docs/data-sources/epg_useg_vm_attribute.md +++ b/docs/data-sources/epg_useg_vm_attribute.md @@ -66,11 +66,9 @@ data "aci_epg_useg_vm_attribute" "example_epg_useg_sub_block_statement" { * `owner_tag` (ownerTag) - (string) A tag for enabling clients to add their own data. For example, to indicate who created this object. * `type` (type) - (string) The type of the EPG uSeg VM Attribute object. * `value` (value) - (string) The value of the EPG uSeg VM Attribute object. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. - * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. diff --git a/docs/data-sources/external_management_network_instance_profile.md b/docs/data-sources/external_management_network_instance_profile.md index d3908e6c6..b8c106441 100644 --- a/docs/data-sources/external_management_network_instance_profile.md +++ b/docs/data-sources/external_management_network_instance_profile.md @@ -49,16 +49,19 @@ data "aci_external_management_network_instance_profile" "example" { * `description` (descr) - (string) The description of the External Management Network Instance Profile object. * `name_alias` (nameAlias) - (string) The name alias of the External Management Network Instance Profile object. * `priority` (prio) - (string) The Quality of Service (QoS) priority class ID. QoS refers to the capability of a network to provide better service to selected network traffic over various technologies. The primary goal of QoS is to provide priority including dedicated bandwidth, controlled jitter and latency (required by some real-time and interactive traffic), and improved loss characteristics. You can configure the bandwidth of each QoS level using QoS profiles. - * `relation_to_consumed_out_of_band_contracts` - (list) A list of Relation To Consumed Out Of Band Contracts (ACI object [mgmtRsOoBCons](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/mgmtRsOoBCons/overview)) pointing to Out Of Band Contract (ACI Object [vzOOBBrCP](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/vzOOBBrCP/overview)). * `annotation` (annotation) - (string) The annotation of the Relation To Consumed Out Of Band Contract object. * `priority` (prio) - (string) The Quality of Service (QoS) priority class ID. QoS refers to the capability of a network to provide better service to selected network traffic over various technologies. The primary goal of QoS is to provide priority including dedicated bandwidth, controlled jitter and latency (required by some real-time and interactive traffic), and improved loss characteristics. You can configure the bandwidth of each QoS level using QoS profiles. * `out_of_band_contract_name` (tnVzOOBBrCPName) - (string) The name of the Out Of Band Contract object. - + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. - * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. diff --git a/docs/data-sources/external_management_network_subnet.md b/docs/data-sources/external_management_network_subnet.md index 152707b4c..cdd77275d 100644 --- a/docs/data-sources/external_management_network_subnet.md +++ b/docs/data-sources/external_management_network_subnet.md @@ -52,11 +52,9 @@ data "aci_external_management_network_subnet" "example_external_management_netwo * `description` (descr) - (string) The description of the External Management Network Subnet object. * `name` (name) - (string) The name of the External Management Network Subnet object. * `name_alias` (nameAlias) - (string) The name alias of the External Management Network Subnet object. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. - * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. diff --git a/docs/data-sources/first_hop_security_policy.md b/docs/data-sources/first_hop_security_policy.md index 8f1846efe..0e7e090a7 100644 --- a/docs/data-sources/first_hop_security_policy.md +++ b/docs/data-sources/first_hop_security_policy.md @@ -56,7 +56,6 @@ data "aci_first_hop_security_policy" "example_tenant" { * `owner_tag` (ownerTag) - (string) A tag for enabling clients to add their own data. For example, to indicate who created this object. * `router_advertisement` (raGuardAdminSt) - (string) Enable Router Advertisement Guard for the First Hop Security Policy object. * `source_guard` (srcGuardAdminSt) - (string) The Source Guard Status for IPv4 and IPv6 traffic of the First Hop Security Policy object. - * `route_advertisement_guard_policy` - (map) A map of Route Advertisement Guard Policy (ACI object [fhsRaGuardPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fhsRaGuardPol/overview)). * `annotation` (annotation) - (string) The annotation of the Route Advertisement Guard Policy object. * `description` (descr) - (string) The description of the Route Advertisement Guard Policy object. @@ -71,11 +70,15 @@ data "aci_first_hop_security_policy" "example_tenant" { * `other_config_flag` (otherConfigFlag) - (string) The other configuration flag setting for the Route Advertisement Guard Policy object. * `owner_key` (ownerKey) - (string) The key for enabling clients to own their data for entity correlation. * `owner_tag` (ownerTag) - (string) A tag for enabling clients to add their own data. For example, to indicate who created this object. - + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. - * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. diff --git a/docs/data-sources/igmp_snooping_policy.md b/docs/data-sources/igmp_snooping_policy.md index 821c90f88..699a1999e 100644 --- a/docs/data-sources/igmp_snooping_policy.md +++ b/docs/data-sources/igmp_snooping_policy.md @@ -63,11 +63,9 @@ data "aci_igmp_snooping_policy" "example_tenant" { * `start_query_count` (startQueryCnt) - (string) The start query count of the IGMP Snooping Policy object. * `start_query_interval` (startQueryIntvl) - (string) The query interval (seconds) of the IGMP Snooping Policy object at start-up. * `querier_version` (ver) - (string) The version of the IGMP querier. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. - * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. diff --git a/docs/data-sources/key_ring.md b/docs/data-sources/key_ring.md index d08d85844..4b89452b9 100644 --- a/docs/data-sources/key_ring.md +++ b/docs/data-sources/key_ring.md @@ -74,11 +74,9 @@ data "aci_key_ring" "example_tenant" { * `owner_tag` (ownerTag) - (string) A tag for enabling clients to add their own data. For example, to indicate who created this object. * `regenerate` (regen) - (string) Forces regeneration of the keypair. Each PKI device holds a pair of asymmetric Rivest-Shamir-Adleman (RSA) or Elliptic Curve Cryptography (ECC) encryption keys, one kept private and one made public, stored in an internal key ring. * `certificate_authority` (tp) - (string) The certificate of the Certificate Authority (CA) that issued the certificate provided in the 'certificate' attribute. The CA can be a root CA, an intermediate CA, or a trust anchor in a chain of trust leading to a root CA. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. - * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. diff --git a/docs/data-sources/l3out_consumer_label.md b/docs/data-sources/l3out_consumer_label.md index 5c46d01e6..6612799a9 100644 --- a/docs/data-sources/l3out_consumer_label.md +++ b/docs/data-sources/l3out_consumer_label.md @@ -57,20 +57,28 @@ data "aci_l3out_consumer_label" "example_l3_outside" { * `owner_key` (ownerKey) - (string) The key for enabling clients to own their data for entity correlation. * `owner_tag` (ownerTag) - (string) A tag for enabling clients to add their own data. For example, to indicate who created this object. * `tag` (tag) - (string) Specifies the color of a policy label. - * `relation_to_external_epgs` - (list) A list of Relation From L3Out Consumer Label To External EPGs (ACI object [l3extRsLblToInstP](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/l3extRsLblToInstP/overview)) pointing to External EPG (ACI Object [l3extInstP](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/l3extInstP/overview)). This attribute is supported in ACI versions: 5.0(1k) and later. * `annotation` (annotation) - (string) The annotation of the Relation From L3Out Consumer Label To External EPG object. * `target_dn` (tDn) - (string) The distinguished name (DN) of the External EPG object. - + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `relation_to_route_control_profiles` - (list) A list of Relation From L3Out Consumer Label To Route Control Profiles (ACI object [l3extRsLblToProfile](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/l3extRsLblToProfile/overview)) pointing to Route Control Profile (ACI Object [rtctrlProfile](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/rtctrlProfile/overview)). This attribute is supported in ACI versions: 5.0(1k) and later. * `annotation` (annotation) - (string) The annotation of the Relation From L3Out Consumer Label To Route Control Profile object. * `direction` (direction) - (string) The connector direction. * `target_dn` (tDn) - (string) The distinguished name (DN) of the Route Control Profile object. - + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. - * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. diff --git a/docs/data-sources/l3out_node_sid_profile.md b/docs/data-sources/l3out_node_sid_profile.md index d70e24e06..cc99cd712 100644 --- a/docs/data-sources/l3out_node_sid_profile.md +++ b/docs/data-sources/l3out_node_sid_profile.md @@ -53,11 +53,9 @@ data "aci_l3out_node_sid_profile" "example_l3out_loopback_interface_profile" { * `loopback_address` (loopbackAddr) - (string) The loopback address of the L3Out Node SR-MPLS Segment ID Profile object. * `name` (name) - (string) The name of the L3Out Node SR-MPLS Segment ID Profile object. * `name_alias` (nameAlias) - (string) The name alias of the L3Out Node SR-MPLS Segment ID Profile object. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. - * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. diff --git a/docs/data-sources/l3out_provider_label.md b/docs/data-sources/l3out_provider_label.md index 83edbf76b..743b51bbe 100644 --- a/docs/data-sources/l3out_provider_label.md +++ b/docs/data-sources/l3out_provider_label.md @@ -54,11 +54,9 @@ data "aci_l3out_provider_label" "example_l3_outside" { * `owner_key` (ownerKey) - (string) The key for enabling clients to own their data for entity correlation. * `owner_tag` (ownerTag) - (string) A tag for enabling clients to add their own data. For example, to indicate who created this object. * `tag` (tag) - (string) Specifies the color of a policy label. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. - * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. diff --git a/docs/data-sources/l3out_redistribute_policy.md b/docs/data-sources/l3out_redistribute_policy.md index c0bfda726..609b0bda4 100644 --- a/docs/data-sources/l3out_redistribute_policy.md +++ b/docs/data-sources/l3out_redistribute_policy.md @@ -52,11 +52,9 @@ data "aci_l3out_redistribute_policy" "example_l3_outside" { * `id` - (string) The distinguished name (DN) of the L3Out Redistribute Policy object. * `annotation` (annotation) - (string) The annotation of the L3Out Redistribute Policy object. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. - * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. diff --git a/docs/data-sources/management_access_policy.md b/docs/data-sources/management_access_policy.md new file mode 100644 index 000000000..4dc149b1c --- /dev/null +++ b/docs/data-sources/management_access_policy.md @@ -0,0 +1,175 @@ +--- +# Documentation generated by "gen/generator.go"; DO NOT EDIT. +# In order to regenerate this file execute `go generate` from the repository root. +# More details can be found in the [README](https://github.com/CiscoDevNet/terraform-provider-aci/blob/master/README.md). +subcategory: "Generic" +layout: "aci" +page_title: "ACI: aci_management_access_policy" +sidebar_current: "docs-aci-data-source-aci_management_access_policy" +description: |- + Data source for ACI Management Access Policy +--- + +# aci_management_access_policy # + +Data source for ACI Management Access Policy + +## API Information ## + +* Class: [commPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/commPol/overview) + +* Supported in ACI versions: 1.0(1e) and later. + +* Distinguished Name Format: `uni/fabric/comm-{name}` + +## GUI Information ## + +* Location: `Fabric -> Fabric Policies -> Policies -> Pod -> Management Access` + +## Example Usage ## + +```hcl + +data "aci_management_access_policy" "example" { + name = "test_name" +} + +``` + +## Schema ## + +### Required ### + +* `name` (name) - (string) The name of the Management Access Policy object. + +### Read-Only ### + +* `id` - (string) The distinguished name (DN) of the Management Access Policy object. +* `annotation` (annotation) - (string) The annotation of the Management Access Policy object. +* `description` (descr) - (string) The description of the Management Access Policy object. +* `name_alias` (nameAlias) - (string) The name alias of the Management Access Policy object. +* `owner_key` (ownerKey) - (string) The key for enabling clients to own their data for entity correlation. +* `owner_tag` (ownerTag) - (string) A tag for enabling clients to add their own data. For example, to indicate who created this object. +* `strict_security_on_apic_oob_subnet` (strictSecurityOnApicOOBSubnet) - (string) Removes implicit access permissions from any APIC out-of-band (OOB) subnet IP address. +* `http_service` - (map) A map of HTTP (Hypertext Transfer Protocol) Service (ACI object [commHttp](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/commHttp/overview)). + * `access_control_allow_credential` (accessControlAllowCredential) - (string) Determines if credentials are allowed in HTTP (Hypertext Transfer Protocol) responses. + * `access_control_allow_origins` (accessControlAllowOrigins) - (string) Determines which origins can access the resource. For example, inputting http://127.0.0.1:8000 would allow access from a source device with that IP address and port. + * `admin_state` (adminSt) - (string) The administrative state of the HTTP (Hypertext Transfer Protocol) Service. + * `annotation` (annotation) - (string) The annotation of the HTTP (Hypertext Transfer Protocol) Service object. + * `cli_only_mode` (cliOnlyMode) - (string) Determines if CLI-only mode is enabled. + * `description` (descr) - (string) The description of the HTTP (Hypertext Transfer Protocol) Service object. + * `global_throttle_rate` (globalThrottleRate) - (string) Maximum API calls allowed per unit time. + * `global_throttle_state` (globalThrottleSt) - (string) The throttle state for all clients without specific identifier in their headers. + * `global_throttle_unit` (globalThrottleUnit) - (string) The unit of measurement for rate limiting. + * `max_request_status_count` (maxRequestStatusCount) - (string) The maximum number of request status objects to keep. + * `name` (name) - (string) The name of the HTTP (Hypertext Transfer Protocol) Service object. + * `name_alias` (nameAlias) - (string) The name alias of the HTTP (Hypertext Transfer Protocol) Service object. + * `node_exporter` (nodeExporter) - (string) Node Exporter service status. + * `port` (port) - (string) The port used for HTTP communication service. + * `redirect_state` (redirectSt) - (string) The state of HTTP (Hypertext Transfer Protocol) communication service. + * `server_header` (serverHeader) - (string) Determines if the server header is included in responses. + * `throttle_rate` (throttleRate) - (string) The maximum login/refresh allowed per second. + * `throttle_state` (throttleSt) - (string) The state of login and refresh throttling. + * `visore_access` (visoreAccess) - (string) Grants permissions for accessing the Visore tool in Cisco ACI. + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. +* `http_ssl_configuration` - (map) A map of HTTP (Hypertext Transfer Protocol) SSL (Secure Sockets Layer) Configuration (ACI object [commHttps](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/commHttps/overview)). + * `access_control_allow_credential` (accessControlAllowCredential) - (string) Determines if credentials are allowed in HTTP (Hypertext Transfer Protocol) SSL (Secure Sockets Layer) responses. + * `access_control_allow_origins` (accessControlAllowOrigins) - (string) Determines which origins can access the resource. For example, inputting http://127.0.0.1:8000 would allow access from a source device with that IP address and port. + * `admin_state` (adminSt) - (string) The administrative state of the HTTP (Hypertext Transfer Protocol) SSL (Secure Sockets Layer) Service. + * `annotation` (annotation) - (string) The annotation of the HTTP (Hypertext Transfer Protocol) SSL (Secure Sockets Layer) Configuration object. + * `cli_only_mode` (cliOnlyMode) - (string) Determines if CLI-only mode is enabled. + * `client_cert_auth_state` (clientCertAuthState) - (string) State of client certificate authentication. + * `description` (descr) - (string) The description of the HTTP (Hypertext Transfer Protocol) SSL (Secure Sockets Layer) Configuration object. + * `dh_param` (dhParam) - (string) Determines the settings for DH (Diffie-Hellman) parameters. + * `global_throttle_rate` (globalThrottleRate) - (string) Maximum API calls allowed per unit time. + * `global_throttle_state` (globalThrottleSt) - (string) The throttle state for all clients without specific identifier in their headers. + * `global_throttle_unit` (globalThrottleUnit) - (string) The unit of measurement for rate limiting. + * `max_request_status_count` (maxRequestStatusCount) - (string) The maximum number of request status objects to keep. + * `name` (name) - (string) The name of the HTTP (Hypertext Transfer Protocol) SSL (Secure Sockets Layer) Configuration object. + * `name_alias` (nameAlias) - (string) The name alias of the HTTP (Hypertext Transfer Protocol) SSL (Secure Sockets Layer) Configuration object. + * `node_exporter` (nodeExporter) - (string) Node Exporter service status. + * `port` (port) - (string) The port used for HTTPS communication service. + * `referer` (referer) - (string) Allowed HTTP referers. + * `server_header` (serverHeader) - (string) Determines if the server header is included in responses. + * `ssl_protocols` (sslProtocols) - (list) The Secure Socket Layer (SSL) protocol. + * `throttle_rate` (throttleRate) - (string) The maximum login/refresh allowed per second. + * `throttle_state` (throttleSt) - (string) The state of login and refresh throttling. + * `visore_access` (visoreAccess) - (string) Grants permissions for accessing the Visore tool in Cisco ACI. + * `certificate_authority` - (map) A map of Certificate Authority (ACI object [commRsClientCertCA](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/commRsClientCertCA/overview)) pointing to Certificate Authority (ACI Object [pkiTP](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/pkiTP/overview)). This attribute is supported in ACI versions: 4.0(1h) and later. + * `annotation` (annotation) - (string) The annotation of the Certificate Authority object. + * `target_dn` (tDn) - (string) The distinguished name of the target. + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `key_ring` - (map) A map of Key Ring (ACI object [commRsKeyRing](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/commRsKeyRing/overview)) pointing to Key Ring (ACI Object [pkiKeyRing](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/pkiKeyRing/overview)). + * `annotation` (annotation) - (string) The annotation of the Key Ring object. + * `key_ring_name` (tnPkiKeyRingName) - (string) The HTTP connection key ring. Each PKI device holds a pair of asymmetric Rivest-Shamir-Adleman (RSA) or Elliptic Curve Cryptography (ECC) encryption keys, one kept private and one made public, stored in an internal key ring. + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. +* `ssh_access_via_web` - (map) A map of SSH (Secure Shell) access via WEB (ACI object [commShellinabox](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/commShellinabox/overview)). This attribute is supported in ACI versions: 1.2(1i) and later. + * `admin_state` (adminSt) - (string) The administrative state of the SSH (Secure Shell) access via WEB object. + * `annotation` (annotation) - (string) The annotation of the SSH (Secure Shell) access via WEB object. + * `description` (descr) - (string) The description of the SSH (Secure Shell) access via WEB object. + * `name` (name) - (string) The name of the SSH (Secure Shell) access via WEB object. + * `name_alias` (nameAlias) - (string) The name alias of the SSH (Secure Shell) access via WEB object. + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. +* `ssh_service` - (map) A map of SSH (Secure Shell) Service (ACI object [commSsh](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/commSsh/overview)). + * `admin_state` (adminSt) - (string) The administrative state of the SSH (Secure Shell) Service object. + * `annotation` (annotation) - (string) The annotation of the SSH (Secure Shell) Service object. + * `description` (descr) - (string) The description of the SSH (Secure Shell) Service object. + * `host_key_algorithms` (hostkeyAlgos) - (list) The supported algorithms for the host key. + * `key_exchange_algorithms` (kexAlgos) - (list) The supported algorithms for key exchange. + * `name` (name) - (string) The name of the SSH (Secure Shell) Service object. + * `name_alias` (nameAlias) - (string) The name alias of the SSH (Secure Shell) Service object. + * `password_auth` (passwordAuth) - (string) State of password authentication. + * `port` (port) - (string) The SSH port. + * `ssh_ciphers` (sshCiphers) - (list) Ciphers supported for SSH. + * `ssh_macs` (sshMacs) - (list) Message authentication codes (MACs) supported for SSH. + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. +* `telnet_service` - (map) A map of Telnet Service (ACI object [commTelnet](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/commTelnet/overview)). + * `admin_state` (adminSt) - (string) The administrative state of the Telnet Service object. + * `annotation` (annotation) - (string) The annotation of the Telnet Service object. + * `description` (descr) - (string) The description of the Telnet Service object. + * `name` (name) - (string) The name of the Telnet Service object. + * `name_alias` (nameAlias) - (string) The name alias of the Telnet Service object. + * `port` (port) - (string) The port used for Telnet communication service. + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. +* `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. +* `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. diff --git a/docs/data-sources/mld_snooping_policy.md b/docs/data-sources/mld_snooping_policy.md index 8aaf1f062..f7493ef45 100644 --- a/docs/data-sources/mld_snooping_policy.md +++ b/docs/data-sources/mld_snooping_policy.md @@ -63,11 +63,9 @@ data "aci_mld_snooping_policy" "example_tenant" { * `start_query_count` (startQueryCnt) - (string) The start query count of the MLD Snooping Policy object. * `start_query_interval` (startQueryIntvl) - (string) The query interval (seconds) of the MLD Snooping Policy object at start-up. * `version` (ver) - (string) The MLD version. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. - * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. diff --git a/docs/data-sources/neighbor_discovery_interface_policy.md b/docs/data-sources/neighbor_discovery_interface_policy.md index a878a5552..1cc39dd61 100644 --- a/docs/data-sources/neighbor_discovery_interface_policy.md +++ b/docs/data-sources/neighbor_discovery_interface_policy.md @@ -65,11 +65,9 @@ data "aci_neighbor_discovery_interface_policy" "example_tenant" { * `router_advertisement_lifetime` (raLifetime) - (string) The default router lifetime (seconds). * `reachable_time` (reachableTime) - (string) The time (milliseconds) for which a neighbor is considered reachable after receiving reachability confirmation. * `retransmit_timer` (retransTimer) - (string) The retransmission time (milliseconds) for sending neighbor solicitation messages. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. - * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. diff --git a/docs/data-sources/netflow_exporter_policy.md b/docs/data-sources/netflow_exporter_policy.md index a1d5a265f..8158ea036 100644 --- a/docs/data-sources/netflow_exporter_policy.md +++ b/docs/data-sources/netflow_exporter_policy.md @@ -70,11 +70,15 @@ data "aci_netflow_exporter_policy" "example_tenant" { * `source_ip_type` (sourceIpType) - (string) The type of the source IP address for the NetFlow Exporter Policy object. * `source_ip_address` (srcAddr) - (string) The source IP address. * `version` (ver) - (string) The NetFlow Exporter Version of the NetFlow Exporter Policy object. - * `relation_to_vrf` - (map) A map of Relation From NetFlow Exporter To VRF (ACI object [netflowRsExporterToCtx](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/netflowRsExporterToCtx/overview)) pointing to VRF (ACI Object [fvCtx](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvCtx/overview)). * `annotation` (annotation) - (string) The annotation of the Relation From NetFlow Exporter To VRF object. * `target_dn` (tDn) - (string) The distinguished name of the target. - + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `relation_to_epg` - (list) A list of Relation From NetFlow Exporter To EPG (ACI object [netflowRsExporterToEPg](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/netflowRsExporterToEPg/overview)). This relation can point to multiple ACI objects: - [fvAEPg](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvAEPg/overview). @@ -82,11 +86,15 @@ data "aci_netflow_exporter_policy" "example_tenant" { - [l2extInstP](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/l2extInstP/overview). * `annotation` (annotation) - (string) The annotation of the Relation From NetFlow Exporter To EPG object. * `target_dn` (tDn) - (string) The distinguished name of the target. - + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. - * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. diff --git a/docs/data-sources/netflow_monitor_policy.md b/docs/data-sources/netflow_monitor_policy.md index 718547255..b9d94b4bd 100644 --- a/docs/data-sources/netflow_monitor_policy.md +++ b/docs/data-sources/netflow_monitor_policy.md @@ -64,19 +64,27 @@ data "aci_netflow_monitor_policy" "example_tenant" { * `name_alias` (nameAlias) - (string) The name alias of the NetFlow Monitor Policy object. * `owner_key` (ownerKey) - (string) The key for enabling clients to own their data for entity correlation. * `owner_tag` (ownerTag) - (string) A tag for enabling clients to add their own data. For example, to indicate who created this object. - * `relation_to_netflow_exporters` - (list) A list of Relation To NetFlow Exporters (ACI object [netflowRsMonitorToExporter](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/netflowRsMonitorToExporter/overview)) pointing to NetFlow Exporter Policy (ACI Object [netflowExporterPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/netflowExporterPol/overview)). * `annotation` (annotation) - (string) The annotation of the Relation To NetFlow Exporter object. * `netflow_exporter_policy_name` (tnNetflowExporterPolName) - (string) Name. - + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `relation_to_netflow_record` - (map) A map of Relation To NetFlow Record (ACI object [netflowRsMonitorToRecord](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/netflowRsMonitorToRecord/overview)) pointing to NetFlow Record Policy (ACI Object [netflowRecordPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/netflowRecordPol/overview)). * `annotation` (annotation) - (string) The annotation of the Relation To NetFlow Record object. * `netflow_record_policy_name` (tnNetflowRecordPolName) - (string) Name. - + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. - * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. diff --git a/docs/data-sources/netflow_record_policy.md b/docs/data-sources/netflow_record_policy.md index 132c20189..b26cf5baa 100644 --- a/docs/data-sources/netflow_record_policy.md +++ b/docs/data-sources/netflow_record_policy.md @@ -66,11 +66,9 @@ data "aci_netflow_record_policy" "example_tenant" { * `name_alias` (nameAlias) - (string) The name alias of the NetFlow Record Policy object. * `owner_key` (ownerKey) - (string) The key for enabling clients to own their data for entity correlation. * `owner_tag` (ownerTag) - (string) A tag for enabling clients to add their own data. For example, to indicate who created this object. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. - * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. diff --git a/docs/data-sources/out_of_band_contract.md b/docs/data-sources/out_of_band_contract.md index 49aadec57..01d7a0391 100644 --- a/docs/data-sources/out_of_band_contract.md +++ b/docs/data-sources/out_of_band_contract.md @@ -54,11 +54,9 @@ data "aci_out_of_band_contract" "example" { * `priority` (prio) - (string) The Quality of Service (QoS) priority class ID. QoS refers to the capability of a network to provide better service to selected network traffic over various technologies. The primary goal of QoS is to provide priority including dedicated bandwidth, controlled jitter and latency (required by some real-time and interactive traffic), and improved loss characteristics. You can configure the bandwidth of each QoS level using QoS profiles. * `scope` (scope) - (string) Represents the scope of this contract. If the scope is set as application-profile, the epg can only communicate with epgs in the same application-profile. * `target_dscp` (targetDscp) - (string) The target DSCP value of the Out Of Band Contract object. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. - * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. diff --git a/docs/data-sources/pim_route_map_entry.md b/docs/data-sources/pim_route_map_entry.md index 930ac608c..7a8f5637f 100644 --- a/docs/data-sources/pim_route_map_entry.md +++ b/docs/data-sources/pim_route_map_entry.md @@ -56,11 +56,9 @@ data "aci_pim_route_map_entry" "example_pim_route_map_policy" { * `name_alias` (nameAlias) - (string) The name alias of the Pim Route Map Entry object. * `rendezvous_point_ip` (rp) - (string) The rendezvous point ip of the Pim Route Map Entry object. * `source_ip` (src) - (string) The source ip of the Pim Route Map Entry object. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. - * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. diff --git a/docs/data-sources/pim_route_map_policy.md b/docs/data-sources/pim_route_map_policy.md index e85f7f041..8ce6a18ec 100644 --- a/docs/data-sources/pim_route_map_policy.md +++ b/docs/data-sources/pim_route_map_policy.md @@ -53,11 +53,9 @@ data "aci_pim_route_map_policy" "example_tenant" { * `name_alias` (nameAlias) - (string) The name alias of the Pim Route Map Policy object. * `owner_key` (ownerKey) - (string) The key for enabling clients to own their data for entity correlation. * `owner_tag` (ownerTag) - (string) A tag for enabling clients to add their own data. For example, to indicate who created this object. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. - * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. diff --git a/docs/data-sources/relation_from_bridge_domain_to_l3_outside.md b/docs/data-sources/relation_from_bridge_domain_to_l3_outside.md index 75210d145..b00c77362 100644 --- a/docs/data-sources/relation_from_bridge_domain_to_l3_outside.md +++ b/docs/data-sources/relation_from_bridge_domain_to_l3_outside.md @@ -55,11 +55,9 @@ data "aci_relation_from_bridge_domain_to_l3_outside" "example_bridge_domain" { * `id` - (string) The distinguished name (DN) of the Relation From Bridge Domain To L3 Outside object. * `annotation` (annotation) - (string) The annotation of the Relation From Bridge Domain To L3 Outside object. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. - * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. diff --git a/docs/data-sources/relation_from_bridge_domain_to_netflow_monitor_policy.md b/docs/data-sources/relation_from_bridge_domain_to_netflow_monitor_policy.md index 4308c80c1..ce6baaf93 100644 --- a/docs/data-sources/relation_from_bridge_domain_to_netflow_monitor_policy.md +++ b/docs/data-sources/relation_from_bridge_domain_to_netflow_monitor_policy.md @@ -58,11 +58,9 @@ data "aci_relation_from_bridge_domain_to_netflow_monitor_policy" "example_bridge * `id` - (string) The distinguished name (DN) of the Relation From Bridge Domain To NetFlow Monitor Policy object. * `annotation` (annotation) - (string) The annotation of the Relation From Bridge Domain To NetFlow Monitor Policy object. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. - * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. diff --git a/docs/data-sources/relation_from_l3out_consumer_label_to_external_epg.md b/docs/data-sources/relation_from_l3out_consumer_label_to_external_epg.md index 622a614b5..63f576126 100644 --- a/docs/data-sources/relation_from_l3out_consumer_label_to_external_epg.md +++ b/docs/data-sources/relation_from_l3out_consumer_label_to_external_epg.md @@ -52,11 +52,9 @@ data "aci_relation_from_l3out_consumer_label_to_external_epg" "example_l3out_con * `id` - (string) The distinguished name (DN) of the Relation From L3Out Consumer Label To External EPG object. * `annotation` (annotation) - (string) The annotation of the Relation From L3Out Consumer Label To External EPG object. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. - * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. diff --git a/docs/data-sources/relation_from_l3out_consumer_label_to_route_control_profile.md b/docs/data-sources/relation_from_l3out_consumer_label_to_route_control_profile.md index 19d56afd9..94b3bf55e 100644 --- a/docs/data-sources/relation_from_l3out_consumer_label_to_route_control_profile.md +++ b/docs/data-sources/relation_from_l3out_consumer_label_to_route_control_profile.md @@ -55,11 +55,9 @@ data "aci_relation_from_l3out_consumer_label_to_route_control_profile" "example_ * `id` - (string) The distinguished name (DN) of the Relation From L3Out Consumer Label To Route Control Profile object. * `annotation` (annotation) - (string) The annotation of the Relation From L3Out Consumer Label To Route Control Profile object. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. - * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. diff --git a/docs/data-sources/relation_to_consumed_contract.md b/docs/data-sources/relation_to_consumed_contract.md index dbcbc54d0..bb4bda17a 100644 --- a/docs/data-sources/relation_to_consumed_contract.md +++ b/docs/data-sources/relation_to_consumed_contract.md @@ -85,11 +85,9 @@ data "aci_relation_to_consumed_contract" "example_endpoint_security_group" { * `id` - (string) The distinguished name (DN) of the Relation To Consumed Contract object. * `annotation` (annotation) - (string) The annotation of the Relation To Consumed Contract object. * `priority` (prio) - (string) The Quality of Service (QoS) priority class ID. QoS refers to the capability of a network to provide better service to selected network traffic over various technologies. The primary goal of QoS is to provide priority including dedicated bandwidth, controlled jitter and latency (required by some real-time and interactive traffic), and improved loss characteristics. You can configure the bandwidth of each QoS level using QoS profiles. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. - * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. diff --git a/docs/data-sources/relation_to_consumed_out_of_band_contract.md b/docs/data-sources/relation_to_consumed_out_of_band_contract.md index 5ead3a4fa..4e9e881c5 100644 --- a/docs/data-sources/relation_to_consumed_out_of_band_contract.md +++ b/docs/data-sources/relation_to_consumed_out_of_band_contract.md @@ -50,11 +50,9 @@ data "aci_relation_to_consumed_out_of_band_contract" "example_external_managemen * `id` - (string) The distinguished name (DN) of the Relation To Consumed Out Of Band Contract object. * `annotation` (annotation) - (string) The annotation of the Relation To Consumed Out Of Band Contract object. * `priority` (prio) - (string) The Quality of Service (QoS) priority class ID. QoS refers to the capability of a network to provide better service to selected network traffic over various technologies. The primary goal of QoS is to provide priority including dedicated bandwidth, controlled jitter and latency (required by some real-time and interactive traffic), and improved loss characteristics. You can configure the bandwidth of each QoS level using QoS profiles. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. - * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. diff --git a/docs/data-sources/relation_to_contract_master.md b/docs/data-sources/relation_to_contract_master.md index ac55dbbb5..0d2697bc0 100644 --- a/docs/data-sources/relation_to_contract_master.md +++ b/docs/data-sources/relation_to_contract_master.md @@ -84,11 +84,9 @@ data "aci_relation_to_contract_master" "example_endpoint_security_group" { * `id` - (string) The distinguished name (DN) of the Relation To Contract Master object. * `annotation` (annotation) - (string) The annotation of the Relation To Contract Master object. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. - * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. diff --git a/docs/data-sources/relation_to_domain.md b/docs/data-sources/relation_to_domain.md index 0a27de9a0..234c077dd 100644 --- a/docs/data-sources/relation_to_domain.md +++ b/docs/data-sources/relation_to_domain.md @@ -72,11 +72,9 @@ data "aci_relation_to_domain" "example_application_epg" { * `secondary_encapsulation_inner` (secondaryEncapInner) - (string) The secondary inner encapsulation of the Relation To Domain object. This is used for the portgroup at the VMWare Distributed Virtual Switch (DVS). This VLAN is internal to the DVS and is used for communication between the other VMs and the AVE VM at a host. Traffic is not forwarded to the fabric over the VLAN. Only applicable for Cisco ACI Virtual Edge (AVE) domains. * `switching_mode` (switchingMode) - (string) The switching mode of the Relation To Domain object. * `untagged` (untagged) - (string) The untagged status of the Relation To Domain object. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. - * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. diff --git a/docs/data-sources/relation_to_fibre_channel_path.md b/docs/data-sources/relation_to_fibre_channel_path.md index 33e799411..81e3a7a82 100644 --- a/docs/data-sources/relation_to_fibre_channel_path.md +++ b/docs/data-sources/relation_to_fibre_channel_path.md @@ -52,11 +52,9 @@ data "aci_relation_to_fibre_channel_path" "example_application_epg" { * `description` (descr) - (string) The description of the Relation To Fibre Channel Path object. * `vsan` (vsan) - (string) The virtual storage area network (VSAN) of the Relation To Fibre Channel Path object. * `vsan_mode` (vsanMode) - (string) The virtual storage area network (VSAN) mode of the Relation To Fibre Channel Path object. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. - * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. diff --git a/docs/data-sources/relation_to_imported_contract.md b/docs/data-sources/relation_to_imported_contract.md index 0121d2bba..3dc50771a 100644 --- a/docs/data-sources/relation_to_imported_contract.md +++ b/docs/data-sources/relation_to_imported_contract.md @@ -85,11 +85,9 @@ data "aci_relation_to_imported_contract" "example_endpoint_security_group" { * `id` - (string) The distinguished name (DN) of the Relation To Imported Contract object. * `annotation` (annotation) - (string) The annotation of the Relation To Imported Contract object. * `priority` (prio) - (string) The Quality of Service (QoS) priority class ID. QoS refers to the capability of a network to provide better service to selected network traffic over various technologies. The primary goal of QoS is to provide priority including dedicated bandwidth, controlled jitter and latency (required by some real-time and interactive traffic), and improved loss characteristics. You can configure the bandwidth of each QoS level using QoS profiles. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. - * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. diff --git a/docs/data-sources/relation_to_intra_epg_contract.md b/docs/data-sources/relation_to_intra_epg_contract.md index cc6cad5db..910a791ee 100644 --- a/docs/data-sources/relation_to_intra_epg_contract.md +++ b/docs/data-sources/relation_to_intra_epg_contract.md @@ -82,11 +82,9 @@ data "aci_relation_to_intra_epg_contract" "example_endpoint_security_group" { * `id` - (string) The distinguished name (DN) of the Relation To Intra EPG Contract object. * `annotation` (annotation) - (string) The annotation of the Relation To Intra EPG Contract object. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. - * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. diff --git a/docs/data-sources/relation_to_netflow_exporter.md b/docs/data-sources/relation_to_netflow_exporter.md index 8b0b9c30b..d9d78723c 100644 --- a/docs/data-sources/relation_to_netflow_exporter.md +++ b/docs/data-sources/relation_to_netflow_exporter.md @@ -53,11 +53,9 @@ data "aci_relation_to_netflow_exporter" "example_netflow_monitor_policy" { * `id` - (string) The distinguished name (DN) of the Relation To NetFlow Exporter object. * `annotation` (annotation) - (string) The annotation of the Relation To NetFlow Exporter object. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. - * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. diff --git a/docs/data-sources/relation_to_provided_contract.md b/docs/data-sources/relation_to_provided_contract.md index 9e385f3dc..1d325502c 100644 --- a/docs/data-sources/relation_to_provided_contract.md +++ b/docs/data-sources/relation_to_provided_contract.md @@ -86,11 +86,9 @@ data "aci_relation_to_provided_contract" "example_endpoint_security_group" { * `annotation` (annotation) - (string) The annotation of the Relation To Provided Contract object. * `match_criteria` (matchT) - (string) The provider label match criteria. * `priority` (prio) - (string) The Quality of Service (QoS) priority class ID. QoS refers to the capability of a network to provide better service to selected network traffic over various technologies. The primary goal of QoS is to provide priority including dedicated bandwidth, controlled jitter and latency (required by some real-time and interactive traffic), and improved loss characteristics. You can configure the bandwidth of each QoS level using QoS profiles. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. - * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. diff --git a/docs/data-sources/relation_to_static_leaf.md b/docs/data-sources/relation_to_static_leaf.md index 34e8a4550..46bb65552 100644 --- a/docs/data-sources/relation_to_static_leaf.md +++ b/docs/data-sources/relation_to_static_leaf.md @@ -53,11 +53,9 @@ data "aci_relation_to_static_leaf" "example_application_epg" { * `encapsulation` (encap) - (string) The VLAN encapsulation of the Relation To Static Leaf object. * `deployment_immediacy` (instrImedcy) - (string) The deployment immediacy of the Relation To Static Leaf object. Specifies when the policy is pushed into the hardware policy content-addressable memory (CAM). * `mode` (mode) - (string) The static association mode with the path of the Relation To Static Leaf object. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. - * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. diff --git a/docs/data-sources/relation_to_static_path.md b/docs/data-sources/relation_to_static_path.md index 83832d542..cd29e8a95 100644 --- a/docs/data-sources/relation_to_static_path.md +++ b/docs/data-sources/relation_to_static_path.md @@ -54,11 +54,9 @@ data "aci_relation_to_static_path" "example_application_epg" { * `deployment_immediacy` (instrImedcy) - (string) The deployment immediacy of the Relation To Static Path object. Specifies when the policy is pushed into the hardware policy content-addressable memory (CAM). * `mode` (mode) - (string) The static association mode of the Relation To Static Path object. * `primary_encapsulation` (primaryEncap) - (string) The primary VLAN encapsulation of the Relation To Static Path object. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. - * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. diff --git a/docs/data-sources/relation_to_taboo_contract.md b/docs/data-sources/relation_to_taboo_contract.md index bd231d699..d4a024485 100644 --- a/docs/data-sources/relation_to_taboo_contract.md +++ b/docs/data-sources/relation_to_taboo_contract.md @@ -77,11 +77,9 @@ data "aci_relation_to_taboo_contract" "example_application_epg" { * `id` - (string) The distinguished name (DN) of the Relation To Taboo Contract object. * `annotation` (annotation) - (string) The annotation of the Relation To Taboo Contract object. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. - * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. diff --git a/docs/data-sources/relation_to_vrf_fallback_route_group.md b/docs/data-sources/relation_to_vrf_fallback_route_group.md index 4201829a1..02dffb546 100644 --- a/docs/data-sources/relation_to_vrf_fallback_route_group.md +++ b/docs/data-sources/relation_to_vrf_fallback_route_group.md @@ -49,11 +49,9 @@ data "aci_relation_to_vrf_fallback_route_group" "example_l3_outside" { * `id` - (string) The distinguished name (DN) of the Relation To VRF Fallback Route Group object. * `annotation` (annotation) - (string) The annotation of the Relation To VRF Fallback Route Group object. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. - * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. diff --git a/docs/data-sources/rogue_coop_exception.md b/docs/data-sources/rogue_coop_exception.md index 009dca580..e615e9c89 100644 --- a/docs/data-sources/rogue_coop_exception.md +++ b/docs/data-sources/rogue_coop_exception.md @@ -52,11 +52,9 @@ data "aci_rogue_coop_exception" "example_bridge_domain" { * `description` (descr) - (string) The description of the Rogue Coop Exception object. * `name` (name) - (string) The name of the Rogue Coop Exception object. * `name_alias` (nameAlias) - (string) The name alias of the Rogue Coop Exception object. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. - * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. diff --git a/docs/data-sources/route_control_profile.md b/docs/data-sources/route_control_profile.md index cdf395177..18b986454 100644 --- a/docs/data-sources/route_control_profile.md +++ b/docs/data-sources/route_control_profile.md @@ -65,11 +65,9 @@ data "aci_route_control_profile" "example_l3_outside" { * `owner_key` (ownerKey) - (string) The key for enabling clients to own their data for entity correlation. * `owner_tag` (ownerTag) - (string) A tag for enabling clients to add their own data. For example, to indicate who created this object. * `route_control_profile_type` (type) - (string) The type of the Route Control Profile object. Use combinable when pervasive subnets (fvSubnet) and external subnets (l3extSubnet) should be combined with a route profile and merged into a single route map or route map entry. Use global when the route profile is the only source of information to generate a route map, this will overwrite other policy attributes. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. - * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. diff --git a/docs/data-sources/tag.md b/docs/data-sources/tag.md index 1fe9f1e50..f9d52f392 100644 --- a/docs/data-sources/tag.md +++ b/docs/data-sources/tag.md @@ -57,6 +57,7 @@ data "aci_tag" "example_application_epg" { - [aci_cloud_epg](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/cloud_epg) ([cloudEPg](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/cloudEPg/overview)) - [aci_cloud_external_epg](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/cloud_external_epg) ([cloudExtEPg](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/cloudExtEPg/overview)) - [aci_cloud_service_epg](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/cloud_service_epg) ([cloudSvcEPg](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/cloudSvcEPg/overview)) + - [aci_management_access_policy](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/management_access_policy) ([commPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/commPol/overview)) - [aci_dhcp_relay_policy](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/dhcp_relay_policy) ([dhcpRelayP](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/dhcpRelayP/overview)) - [aci_first_hop_security_policy](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/first_hop_security_policy) ([fhsBDPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fhsBDPol/overview)) - [aci_trust_control_policy](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/trust_control_policy) ([fhsTrustCtrlPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fhsTrustCtrlPol/overview)) @@ -73,7 +74,6 @@ data "aci_tag" "example_application_epg" { - [aci_vrf_fallback_route_group](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/vrf_fallback_route_group) ([fvFBRGroup](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvFBRGroup/overview)) - [aci_vrf_fallback_route_group_member](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/vrf_fallback_route_group_member) ([fvFBRMember](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvFBRMember/overview)) - [aci_vrf_fallback_route](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/vrf_fallback_route) ([fvFBRoute](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvFBRoute/overview)) - - [aci_epg_useg_ad_group_attribute](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/epg_useg_ad_group_attribute) ([fvIdGroupAttr](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvIdGroupAttr/overview)) * `key` (key) - (string) The key used to uniquely identify this configuration object. ### Read-Only ### diff --git a/docs/data-sources/trust_control_policy.md b/docs/data-sources/trust_control_policy.md index 4c5594bb2..a9a79b8ec 100644 --- a/docs/data-sources/trust_control_policy.md +++ b/docs/data-sources/trust_control_policy.md @@ -59,11 +59,9 @@ data "aci_trust_control_policy" "example_tenant" { * `trust_arp` (trustArp) - (string) The address resolution protocol (ARP) trust status of the Trust Control Policy object. * `trust_nd` (trustNd) - (string) The neighbor discovery (ND) trust status of the Trust Control Policy object. * `trust_ra` (trustRa) - (string) The router advertisement (RA) trust status of the Trust Control Policy object. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. - * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. diff --git a/docs/data-sources/vrf_fallback_route.md b/docs/data-sources/vrf_fallback_route.md index 0622bb655..9fd1b9f31 100644 --- a/docs/data-sources/vrf_fallback_route.md +++ b/docs/data-sources/vrf_fallback_route.md @@ -52,11 +52,9 @@ data "aci_vrf_fallback_route" "example_vrf_fallback_route_group" { * `description` (descr) - (string) The description of the VRF Fallback Route object. * `name` (name) - (string) The name of the VRF Fallback Route object. * `name_alias` (nameAlias) - (string) The name alias of the VRF Fallback Route object. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. - * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. diff --git a/docs/data-sources/vrf_fallback_route_group.md b/docs/data-sources/vrf_fallback_route_group.md index fcd7829e2..e766ea5b3 100644 --- a/docs/data-sources/vrf_fallback_route_group.md +++ b/docs/data-sources/vrf_fallback_route_group.md @@ -51,25 +51,33 @@ data "aci_vrf_fallback_route_group" "example_vrf" { * `annotation` (annotation) - (string) The annotation of the VRF Fallback Route Group object. * `description` (descr) - (string) The description of the VRF Fallback Route Group object. * `name_alias` (nameAlias) - (string) The name alias of the VRF Fallback Route Group object. - * `vrf_fallback_route_group_members` - (list) A list of VRF Fallback Route Group Members (ACI object [fvFBRMember](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvFBRMember/overview)). * `annotation` (annotation) - (string) The annotation of the VRF Fallback Route Group Member object. * `description` (descr) - (string) The description of the VRF Fallback Route Group Member object. * `name` (name) - (string) The name of the VRF Fallback Route Group Member object. * `name_alias` (nameAlias) - (string) The name alias of the VRF Fallback Route Group Member object. * `fallback_member` (rnhAddr) - (string) The address of the VRF Fallback Route Group Member object. - + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `vrf_fallback_route` - (map) A map of VRF Fallback Route (ACI object [fvFBRoute](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvFBRoute/overview)). * `annotation` (annotation) - (string) The annotation of the VRF Fallback Route object. * `description` (descr) - (string) The description of the VRF Fallback Route object. * `prefix_address` (fbrPrefix) - (string) The prefix address of the VRF Fallback Route object. * `name` (name) - (string) The name of the VRF Fallback Route object. * `name_alias` (nameAlias) - (string) The name alias of the VRF Fallback Route object. - + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. - * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. diff --git a/docs/data-sources/vrf_fallback_route_group_member.md b/docs/data-sources/vrf_fallback_route_group_member.md index 052d4f624..8427b5c45 100644 --- a/docs/data-sources/vrf_fallback_route_group_member.md +++ b/docs/data-sources/vrf_fallback_route_group_member.md @@ -52,11 +52,9 @@ data "aci_vrf_fallback_route_group_member" "example_vrf_fallback_route_group" { * `description` (descr) - (string) The description of the VRF Fallback Route Group Member object. * `name` (name) - (string) The name of the VRF Fallback Route Group Member object. * `name_alias` (nameAlias) - (string) The name alias of the VRF Fallback Route Group Member object. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. - * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. diff --git a/docs/resources/access_interface_override.md b/docs/resources/access_interface_override.md index 5aabf0170..9d1622b74 100644 --- a/docs/resources/access_interface_override.md +++ b/docs/resources/access_interface_override.md @@ -57,10 +57,34 @@ resource "aci_access_interface_override" "full_example" { relation_to_host_path = { annotation = "annotation_1" target_dn = "topology/pod-1/paths-101/pathep-[eth1/1]" + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } relation_to_access_interface_policy_group = { annotation = "annotation_1" target_dn = "uni/infra/funcprof/accportgrp-access_interface_policy_group" + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } annotations = [ { @@ -103,40 +127,50 @@ All examples for the Access Interface Override resource can be found in the [exa * `name_alias` (nameAlias) - (string) The name alias of the Access Interface Override object. * `owner_key` (ownerKey) - (string) The key for enabling clients to own their data for entity correlation. * `owner_tag` (ownerTag) - (string) A tag for enabling clients to add their own data. For example, to indicate who created this object. - * `relation_to_host_path` - (map) A map of Relation To Host Path (ACI object [infraRsHPathAtt](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/infraRsHPathAtt/overview)) pointing to Fabric Path Endpoint (ACI Object [fabricPathEp](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fabricPathEp/overview)). - #### Required #### - * `target_dn` (tDn) - (string) The distinguished name of the target. - + * `target_dn` (tDn) - (string) The distinguished name of the target. #### Optional #### - * `annotation` (annotation) - (string) The annotation of the Relation To Host Path object. + * `annotation` (annotation) - (string) The annotation of the Relation To Host Path object. - Default: `orchestrator:terraform` - -* `relation_to_access_interface_policy_group` - (map) A map of Relation To Access Interface Policy Group (ACI object [infraRsPathToAccBaseGrp](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/infraRsPathToAccBaseGrp/overview)) pointing to Access Interface Policy Group (ACI Object [infraAccBaseGrp](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/infraAccBaseGrp/overview)) which can be configured using the [aci_access_interface_policy_group](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/access_interface_policy_group) resource. + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. +* `relation_to_access_interface_policy_group` - (map) A map of Relation To Access Interface Policy Group (ACI object [infraRsPathToAccBaseGrp](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/infraRsPathToAccBaseGrp/overview)) pointing to Access Interface Policy Group (ACI Object [infraAccBaseGrp](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/infraAccBaseGrp/overview)) which can be configured using the [aci_access_interface_policy_group](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/access_interface_policy_group) resource. #### Optional #### - * `annotation` (annotation) - (string) The annotation of the Relation To Access Interface Policy Group object. + * `annotation` (annotation) - (string) The annotation of the Relation To Access Interface Policy Group object. - Default: `orchestrator:terraform` - * `target_dn` (tDn) - (string) The distinguished name of the target. - -* `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + * `target_dn` (tDn) - (string) The distinguished name of the target. + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. +* `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. ## Importing diff --git a/docs/resources/annotation.md b/docs/resources/annotation.md index 437de855f..01843a77f 100644 --- a/docs/resources/annotation.md +++ b/docs/resources/annotation.md @@ -66,6 +66,7 @@ All examples for the Annotation resource can be found in the [examples](https:// - [aci_cloud_epg](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/cloud_epg) ([cloudEPg](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/cloudEPg/overview)) - [aci_cloud_external_epg](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/cloud_external_epg) ([cloudExtEPg](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/cloudExtEPg/overview)) - [aci_cloud_service_epg](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/cloud_service_epg) ([cloudSvcEPg](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/cloudSvcEPg/overview)) + - [aci_management_access_policy](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/management_access_policy) ([commPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/commPol/overview)) - [aci_dhcp_relay_policy](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/dhcp_relay_policy) ([dhcpRelayP](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/dhcpRelayP/overview)) - [aci_first_hop_security_policy](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/first_hop_security_policy) ([fhsBDPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fhsBDPol/overview)) - [aci_trust_control_policy](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/trust_control_policy) ([fhsTrustCtrlPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fhsTrustCtrlPol/overview)) @@ -82,7 +83,6 @@ All examples for the Annotation resource can be found in the [examples](https:// - [aci_vrf_fallback_route_group](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/vrf_fallback_route_group) ([fvFBRGroup](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvFBRGroup/overview)) - [aci_vrf_fallback_route_group_member](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/vrf_fallback_route_group_member) ([fvFBRMember](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvFBRMember/overview)) - [aci_vrf_fallback_route](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/vrf_fallback_route) ([fvFBRoute](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvFBRoute/overview)) - - [aci_epg_useg_ad_group_attribute](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/epg_useg_ad_group_attribute) ([fvIdGroupAttr](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvIdGroupAttr/overview)) * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. diff --git a/docs/resources/application_epg.md b/docs/resources/application_epg.md index e3885cf62..01b0f102d 100644 --- a/docs/resources/application_epg.md +++ b/docs/resources/application_epg.md @@ -72,20 +72,68 @@ resource "aci_application_epg" "full_example_application_profile" { owner_tag = "owner_tag_1" precedence = "1" scope = "scope-bd" + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } relation_to_application_epg_monitoring_policy = { annotation = "annotation_1" monitoring_policy_name = aci_monitoring_policy.example.name + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } relation_to_bridge_domain = { annotation = "annotation_1" bridge_domain_name = aci_bridge_domain.example.name + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } relation_to_consumed_contracts = [ { annotation = "annotation_1" priority = "level1" contract_name = aci_contract.example.name + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } ] relation_to_imported_contracts = [ @@ -93,11 +141,35 @@ resource "aci_application_epg" "full_example_application_profile" { annotation = "annotation_1" priority = "level1" imported_contract_name = aci_imported_contract.example.name + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } ] relation_to_custom_qos_policy = { annotation = "annotation_1" custom_qos_policy_name = aci_custom_qos_policy.example.name + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } relation_to_domains = [ { @@ -126,11 +198,35 @@ resource "aci_application_epg" "full_example_application_profile" { switching_mode = "AVE" target_dn = "uni/vmmp-VMware/dom-domain_1" untagged = "no" + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } ] relation_to_data_plane_policing_policy = { annotation = "annotation_1" data_plane_policing_policy_name = aci_data_plane_policing_policy.example.name + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } relation_to_fibre_channel_paths = [ { @@ -139,12 +235,36 @@ resource "aci_application_epg" "full_example_application_profile" { target_dn = "topology/pod-1/paths-101/pathep-[eth1/1]" vsan = "vsan-10" vsan_mode = "native" + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } ] relation_to_intra_epg_contracts = [ { annotation = "annotation_1" contract_name = aci_contract.example.name + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } ] relation_to_static_leafs = [ @@ -155,6 +275,18 @@ resource "aci_application_epg" "full_example_application_profile" { deployment_immediacy = "immediate" mode = "native" target_dn = "topology/pod-1/node-101" + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } ] relation_to_static_paths = [ @@ -166,12 +298,36 @@ resource "aci_application_epg" "full_example_application_profile" { mode = "native" primary_encapsulation = "vlan-203" target_dn = "topology/pod-1/paths-101/pathep-[eth1/1]" + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } ] relation_to_taboo_contracts = [ { annotation = "annotation_1" taboo_contract_name = aci_taboo_contract.example.name + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } ] relation_to_provided_contracts = [ @@ -180,17 +336,53 @@ resource "aci_application_epg" "full_example_application_profile" { match_criteria = "All" priority = "level1" contract_name = aci_contract.example.name + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } ] relation_to_contract_masters = [ { annotation = "annotation_1" target_dn = aci_application_epg.test_application_epg_0.id + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } ] relation_to_trust_control_policy = { annotation = "annotation_1" trust_control_policy_name = aci_trust_control_policy.example.name + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } annotations = [ { @@ -257,284 +449,392 @@ All examples for the Application EPG resource can be found in the [examples](htt * `admin_state` (shutdown) - (string) Withdraw AEPg Configuration from all Nodes in the Fabric. - Default: `no` - Valid Values: `no`, `yes`. - * `epg_useg_block_statement` - (map) A map of EPG uSeg Block Statement (ACI object [fvCrtrn](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvCrtrn/overview)). EPG uSeg Block Statement can also be configured using a separate [aci_epg_useg_block_statement](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/epg_useg_block_statement) resource. This attribute is supported in ACI versions: 1.1(1j) and later. - - #### Optional #### - * `annotation` (annotation) - (string) The annotation of the EPG uSeg Block Statement object. + * `annotation` (annotation) - (string) The annotation of the EPG uSeg Block Statement object. - Default: `orchestrator:terraform` - * `description` (descr) - (string) The description of the EPG uSeg Block Statement object. - * `match` (match) - (string) The Matching Rule Type of the EPG uSeg Block Statement object. + * `description` (descr) - (string) The description of the EPG uSeg Block Statement object. + * `match` (match) - (string) The Matching Rule Type of the EPG uSeg Block Statement object. - Default: `any` - Valid Values: `all`, `any`. - * `name` (name) - (string) The name of the EPG uSeg Block Statement object. - * `name_alias` (nameAlias) - (string) The name alias of the EPG uSeg Block Statement object. - * `owner_key` (ownerKey) - (string) The key for enabling clients to own their data for entity correlation. - * `owner_tag` (ownerTag) - (string) A tag for enabling clients to add their own data. For example, to indicate who created this object. - * `precedence` (prec) - (string) The precedence of the EPG uSeg Block Statement object. - * `scope` (scope) - (string) The scope of the EPG uSeg Block Statement object. + * `name` (name) - (string) The name of the EPG uSeg Block Statement object. + * `name_alias` (nameAlias) - (string) The name alias of the EPG uSeg Block Statement object. + * `owner_key` (ownerKey) - (string) The key for enabling clients to own their data for entity correlation. + * `owner_tag` (ownerTag) - (string) A tag for enabling clients to add their own data. For example, to indicate who created this object. + * `precedence` (prec) - (string) The precedence of the EPG uSeg Block Statement object. + * `scope` (scope) - (string) The scope of the EPG uSeg Block Statement object. - Default: `scope-bd` - Valid Values: `scope-bd`, `scope-vrf`. - -* `relation_to_application_epg_monitoring_policy` - (map) A map of Relation To Application EPG Monitoring Policy (ACI object [fvRsAEPgMonPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsAEPgMonPol/overview)) pointing to Monitoring Policy (ACI Object [monEPGPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/monEPGPol/overview)) which can be configured using the [aci_monitoring_policy](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/monitoring_policy) resource. + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. +* `relation_to_application_epg_monitoring_policy` - (map) A map of Relation To Application EPG Monitoring Policy (ACI object [fvRsAEPgMonPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsAEPgMonPol/overview)) pointing to Monitoring Policy (ACI Object [monEPGPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/monEPGPol/overview)) which can be configured using the [aci_monitoring_policy](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/monitoring_policy) resource. #### Optional #### - * `annotation` (annotation) - (string) The annotation of the Relation To Application EPG Monitoring Policy object. + * `annotation` (annotation) - (string) The annotation of the Relation To Application EPG Monitoring Policy object. - Default: `orchestrator:terraform` - * `monitoring_policy_name` (tnMonEPGPolName) - (string) The name of the monitoring policy. - -* `relation_to_bridge_domain` - (map) A map of Relation To Bridge Domain (ACI object [fvRsBd](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsBd/overview)) pointing to Bridge Domain (ACI Object [fvBD](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvBD/overview)) which can be configured using the [aci_bridge_domain](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/bridge_domain) resource. + * `monitoring_policy_name` (tnMonEPGPolName) - (string) The name of the monitoring policy. + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. +* `relation_to_bridge_domain` - (map) A map of Relation To Bridge Domain (ACI object [fvRsBd](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsBd/overview)) pointing to Bridge Domain (ACI Object [fvBD](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvBD/overview)) which can be configured using the [aci_bridge_domain](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/bridge_domain) resource. #### Optional #### - * `annotation` (annotation) - (string) The annotation of the Relation To Bridge Domain object. + * `annotation` (annotation) - (string) The annotation of the Relation To Bridge Domain object. - Default: `orchestrator:terraform` - * `bridge_domain_name` (tnFvBDName) - (string) The name of the bridge domain associated with this EPG. - -* `relation_to_consumed_contracts` - (list) A list of Relation To Consumed Contracts (ACI object [fvRsCons](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsCons/overview)) pointing to Contract (ACI Object [vzBrCP](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/vzBrCP/overview)) which can be configured using the [aci_contract](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/contract) resource. + * `bridge_domain_name` (tnFvBDName) - (string) The name of the bridge domain associated with this EPG. + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. +* `relation_to_consumed_contracts` - (list) A list of Relation To Consumed Contracts (ACI object [fvRsCons](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsCons/overview)) pointing to Contract (ACI Object [vzBrCP](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/vzBrCP/overview)) which can be configured using the [aci_contract](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/contract) resource. #### Required #### - * `contract_name` (tnVzBrCPName) - (string) The consumer contract name. This attribute can be referenced from a [resource](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/contract) with `aci_contract.example.name` or from a [datasource](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/data-sources/contract) with `data.aci_contract.example.name`. - + * `contract_name` (tnVzBrCPName) - (string) The consumer contract name. This attribute can be referenced from a [resource](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/contract) with `aci_contract.example.name` or from a [datasource](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/data-sources/contract) with `data.aci_contract.example.name`. #### Optional #### - * `annotation` (annotation) - (string) The annotation of the Relation To Consumed Contract object. + * `annotation` (annotation) - (string) The annotation of the Relation To Consumed Contract object. - Default: `orchestrator:terraform` - * `priority` (prio) - (string) The Quality of Service (QoS) priority class ID. QoS refers to the capability of a network to provide better service to selected network traffic over various technologies. The primary goal of QoS is to provide priority including dedicated bandwidth, controlled jitter and latency (required by some real-time and interactive traffic), and improved loss characteristics. You can configure the bandwidth of each QoS level using QoS profiles. + * `priority` (prio) - (string) The Quality of Service (QoS) priority class ID. QoS refers to the capability of a network to provide better service to selected network traffic over various technologies. The primary goal of QoS is to provide priority including dedicated bandwidth, controlled jitter and latency (required by some real-time and interactive traffic), and improved loss characteristics. You can configure the bandwidth of each QoS level using QoS profiles. - Default: `unspecified` - Valid Values: `level1`, `level2`, `level3`, `level4`, `level5`, `level6`, `unspecified`. - -* `relation_to_imported_contracts` - (list) A list of Relation To Imported Contracts (ACI object [fvRsConsIf](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsConsIf/overview)) pointing to Imported Contract (ACI Object [vzCPIf](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/vzCPIf/overview)) which can be configured using the [aci_imported_contract](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/imported_contract) resource. + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. +* `relation_to_imported_contracts` - (list) A list of Relation To Imported Contracts (ACI object [fvRsConsIf](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsConsIf/overview)) pointing to Imported Contract (ACI Object [vzCPIf](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/vzCPIf/overview)) which can be configured using the [aci_imported_contract](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/imported_contract) resource. #### Required #### - * `imported_contract_name` (tnVzCPIfName) - (string) The contract interface name. This attribute can be referenced from a [resource](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/imported_contract) with `aci_imported_contract.example.name` or from a [datasource](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/data-sources/imported_contract) with `data.aci_imported_contract.example.name`. - + * `imported_contract_name` (tnVzCPIfName) - (string) The contract interface name. This attribute can be referenced from a [resource](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/imported_contract) with `aci_imported_contract.example.name` or from a [datasource](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/data-sources/imported_contract) with `data.aci_imported_contract.example.name`. #### Optional #### - * `annotation` (annotation) - (string) The annotation of the Relation To Imported Contract object. + * `annotation` (annotation) - (string) The annotation of the Relation To Imported Contract object. - Default: `orchestrator:terraform` - * `priority` (prio) - (string) The Quality of Service (QoS) priority class ID. QoS refers to the capability of a network to provide better service to selected network traffic over various technologies. The primary goal of QoS is to provide priority including dedicated bandwidth, controlled jitter and latency (required by some real-time and interactive traffic), and improved loss characteristics. You can configure the bandwidth of each QoS level using QoS profiles. + * `priority` (prio) - (string) The Quality of Service (QoS) priority class ID. QoS refers to the capability of a network to provide better service to selected network traffic over various technologies. The primary goal of QoS is to provide priority including dedicated bandwidth, controlled jitter and latency (required by some real-time and interactive traffic), and improved loss characteristics. You can configure the bandwidth of each QoS level using QoS profiles. - Default: `unspecified` - Valid Values: `level1`, `level2`, `level3`, `level4`, `level5`, `level6`, `unspecified`. - -* `relation_to_custom_qos_policy` - (map) A map of Relation To Custom Qos Policy (ACI object [fvRsCustQosPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsCustQosPol/overview)) pointing to Custom Qos Policy (ACI Object [qosCustomPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/qosCustomPol/overview)) which can be configured using the [aci_custom_qos_policy](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/custom_qos_policy) resource. + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. +* `relation_to_custom_qos_policy` - (map) A map of Relation To Custom Qos Policy (ACI object [fvRsCustQosPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsCustQosPol/overview)) pointing to Custom Qos Policy (ACI Object [qosCustomPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/qosCustomPol/overview)) which can be configured using the [aci_custom_qos_policy](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/custom_qos_policy) resource. #### Optional #### - * `annotation` (annotation) - (string) The annotation of the Relation To Custom Qos Policy object. + * `annotation` (annotation) - (string) The annotation of the Relation To Custom Qos Policy object. - Default: `orchestrator:terraform` - * `custom_qos_policy_name` (tnQosCustomPolName) - (string) The Custom QoS traffic policy name. - + * `custom_qos_policy_name` (tnQosCustomPolName) - (string) The Custom QoS traffic policy name. + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `relation_to_domains` - (list) A list of Relation To Domains (ACI object [fvRsDomAtt](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsDomAtt/overview)). This relation can point to multiple ACI objects: - [vmmDomP](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/vmmDomP/overview) which can be configured using the [aci_vmm_domain](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/vmm_domain) resource. - [physDomP](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/physDomP/overview) which can be configured using the [aci_physical_domain](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/physical_domain) resource. - [fcDomP](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fcDomP/overview). Currently there is no resource available to configure this ACI object. - [l2extDomP](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/l2extDomP/overview). Currently there is no resource available to configure this ACI object. - #### Required #### - * `target_dn` (tDn) - (string) The distinguished name of the target Domain object. - + * `target_dn` (tDn) - (string) The distinguished name of the target Domain object. #### Optional #### - * `annotation` (annotation) - (string) The annotation of the Relation To Domain object. + * `annotation` (annotation) - (string) The annotation of the Relation To Domain object. - Default: `orchestrator:terraform` - * `binding_type` (bindingType) - (string) The binding type of the Relation To Domain object. + * `binding_type` (bindingType) - (string) The binding type of the Relation To Domain object. - Default: `none` - Valid Values: `dynamicBinding`, `ephemeral`, `none`, `staticBinding`. - * `class_preference` (classPref) - (string) The class preference of the Relation To Domain object. Set 'useg' to allow microsegmentation. + * `class_preference` (classPref) - (string) The class preference of the Relation To Domain object. Set 'useg' to allow microsegmentation. - Default: `encap` - Valid Values: `encap`, `useg`. - * `custom_epg_name` (customEpgName) - (string) The display name of the user configured port-group. - * `delimiter` (delimiter) - (string) The delimiter of the Relation To Domain object. - * `encapsulation` (encap) - (string) The encapsulation of the Relation To Domain object. The encapsulation refers to the EPG VLAN when class preference is set to 'encap, or to the Secondary VLAN when class preference is set to 'useg'. - * `encapsulation_mode` (encapMode) - (string) The encapsulation mode of the Relation To Domain object. + * `custom_epg_name` (customEpgName) - (string) The display name of the user configured port-group. + * `delimiter` (delimiter) - (string) The delimiter of the Relation To Domain object. + * `encapsulation` (encap) - (string) The encapsulation of the Relation To Domain object. The encapsulation refers to the EPG VLAN when class preference is set to 'encap, or to the Secondary VLAN when class preference is set to 'useg'. + * `encapsulation_mode` (encapMode) - (string) The encapsulation mode of the Relation To Domain object. - Default: `auto` - Valid Values: `auto`, `vlan`, `vxlan`. - * `epg_cos` (epgCos) - (string) The class of service (CoS) of the Relation To Domain object. + * `epg_cos` (epgCos) - (string) The class of service (CoS) of the Relation To Domain object. - Default: `Cos0` - Valid Values: `Cos0`, `Cos1`, `Cos2`, `Cos3`, `Cos4`, `Cos5`, `Cos6`, `Cos7`. - * `epg_cos_pref` (epgCosPref) - (string) The class of service (CoS) preference of the Relation To Domain object. + * `epg_cos_pref` (epgCosPref) - (string) The class of service (CoS) preference of the Relation To Domain object. - Default: `disabled` - Valid Values: `disabled`, `enabled`. - * `deployment_immediacy` (instrImedcy) - (string) The deployment immediacy of the Relation To Domain object. Specifies when the policy is pushed into the hardware policy content-addressable memory (CAM). + * `deployment_immediacy` (instrImedcy) - (string) The deployment immediacy of the Relation To Domain object. Specifies when the policy is pushed into the hardware policy content-addressable memory (CAM). - Default: `lazy` - Valid Values: `immediate`, `lazy`. - * `ipam_dhcp_override` (ipamDhcpOverride) - (string) The IP address management (IPAM) DHCP override of the Relation To Domain object. Only applicable for Nutanix domains. - * `ipam_enabled` (ipamEnabled) - (string) The IP address management (IPAM) enabled status of the Relation To Domain object. Only applicable for Nutanix domains. + * `ipam_dhcp_override` (ipamDhcpOverride) - (string) The IP address management (IPAM) DHCP override of the Relation To Domain object. Only applicable for Nutanix domains. + * `ipam_enabled` (ipamEnabled) - (string) The IP address management (IPAM) enabled status of the Relation To Domain object. Only applicable for Nutanix domains. - Default: `no` - Valid Values: `no`, `yes`. - * `ipam_gateway` (ipamGateway) - (string) The IP address management (IPAM) gateway of the Relation To Domain object. Only applicable for Nutanix domains. - * `lag_policy_name` (lagPolicyName) - (string) The link aggregation group (LAG) policy name of the Relation To Domain object. - * `netflow_direction` (netflowDir) - (string) The NetFlow monitoring direction of the Relation To Domain object. + * `ipam_gateway` (ipamGateway) - (string) The IP address management (IPAM) gateway of the Relation To Domain object. Only applicable for Nutanix domains. + * `lag_policy_name` (lagPolicyName) - (string) The link aggregation group (LAG) policy name of the Relation To Domain object. + * `netflow_direction` (netflowDir) - (string) The NetFlow monitoring direction of the Relation To Domain object. - Default: `both` - Valid Values: `both`, `egress`, `ingress`. - * `enable_netflow` (netflowPref) - (string) The Netflow enabled status for the Relation To Domain object. + * `enable_netflow` (netflowPref) - (string) The Netflow enabled status for the Relation To Domain object. - Default: `disabled` - Valid Values: `disabled`, `enabled`. - * `number_of_ports` (numPorts) - (string) The number of ports of the Relation To Domain object. - * `port_allocation` (portAllocation) - (string) Port allocation for ports. + * `number_of_ports` (numPorts) - (string) The number of ports of the Relation To Domain object. + * `port_allocation` (portAllocation) - (string) Port allocation for ports. - Default: `none` - Valid Values: `elastic`, `fixed`, `none`. - * `primary_encapsulation` (primaryEncap) - (string) The primary encapsulation of the Relation To Domain object. This is used when the class preference is set to 'useg'. - * `primary_encapsulation_inner` (primaryEncapInner) - (string) The primary inner encapsulation of the Relation To Domain object. This is used for the portgroup at the VMWare Distributed Virtual Switch (DVS). This VLAN is internal to the DVS and is used for communication between the other VMs and the AVE VM at a host. Traffic is not forwarded to the fabric over the VLAN. Only applicable for Cisco ACI Virtual Edge (AVE) domains. - * `resolution_immediacy` (resImedcy) - (string) The resolution immediacy of the Relation To Domain object. Specifies if policies are resolved immmediately or when needed. + * `primary_encapsulation` (primaryEncap) - (string) The primary encapsulation of the Relation To Domain object. This is used when the class preference is set to 'useg'. + * `primary_encapsulation_inner` (primaryEncapInner) - (string) The primary inner encapsulation of the Relation To Domain object. This is used for the portgroup at the VMWare Distributed Virtual Switch (DVS). This VLAN is internal to the DVS and is used for communication between the other VMs and the AVE VM at a host. Traffic is not forwarded to the fabric over the VLAN. Only applicable for Cisco ACI Virtual Edge (AVE) domains. + * `resolution_immediacy` (resImedcy) - (string) The resolution immediacy of the Relation To Domain object. Specifies if policies are resolved immmediately or when needed. - Default: `lazy` - Valid Values: `immediate`, `lazy`, `pre-provision`. - * `secondary_encapsulation_inner` (secondaryEncapInner) - (string) The secondary inner encapsulation of the Relation To Domain object. This is used for the portgroup at the VMWare Distributed Virtual Switch (DVS). This VLAN is internal to the DVS and is used for communication between the other VMs and the AVE VM at a host. Traffic is not forwarded to the fabric over the VLAN. Only applicable for Cisco ACI Virtual Edge (AVE) domains. - * `switching_mode` (switchingMode) - (string) The switching mode of the Relation To Domain object. + * `secondary_encapsulation_inner` (secondaryEncapInner) - (string) The secondary inner encapsulation of the Relation To Domain object. This is used for the portgroup at the VMWare Distributed Virtual Switch (DVS). This VLAN is internal to the DVS and is used for communication between the other VMs and the AVE VM at a host. Traffic is not forwarded to the fabric over the VLAN. Only applicable for Cisco ACI Virtual Edge (AVE) domains. + * `switching_mode` (switchingMode) - (string) The switching mode of the Relation To Domain object. - Default: `native` - Valid Values: `AVE`, `native`. - * `untagged` (untagged) - (string) The untagged status of the Relation To Domain object. + * `untagged` (untagged) - (string) The untagged status of the Relation To Domain object. - Default: `no` - Valid Values: `no`, `yes`. - -* `relation_to_data_plane_policing_policy` - (map) A map of Relation To Data Plane Policing Policy (ACI object [fvRsDppPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsDppPol/overview)) pointing to Data Plane Policing Policy (ACI Object [qosDppPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/qosDppPol/overview)) which can be configured using the [aci_data_plane_policing_policy](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/data_plane_policing_policy) resource. This attribute is supported in ACI versions: 3.0(1k) and later. + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. +* `relation_to_data_plane_policing_policy` - (map) A map of Relation To Data Plane Policing Policy (ACI object [fvRsDppPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsDppPol/overview)) pointing to Data Plane Policing Policy (ACI Object [qosDppPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/qosDppPol/overview)) which can be configured using the [aci_data_plane_policing_policy](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/data_plane_policing_policy) resource. This attribute is supported in ACI versions: 3.0(1k) and later. #### Optional #### - * `annotation` (annotation) - (string) The annotation of the Relation To Data Plane Policing Policy object. + * `annotation` (annotation) - (string) The annotation of the Relation To Data Plane Policing Policy object. - Default: `orchestrator:terraform` - * `data_plane_policing_policy_name` (tnQosDppPolName) - (string) Name. - -* `relation_to_fibre_channel_paths` - (list) A list of Relation To Fibre Channel Paths (ACI object [fvRsFcPathAtt](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsFcPathAtt/overview)) pointing to Fabric Path Endpoint (ACI Object [fabricPathEp](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fabricPathEp/overview)). This attribute is supported in ACI versions: 2.0(1m) and later. + * `data_plane_policing_policy_name` (tnQosDppPolName) - (string) Name. + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. +* `relation_to_fibre_channel_paths` - (list) A list of Relation To Fibre Channel Paths (ACI object [fvRsFcPathAtt](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsFcPathAtt/overview)) pointing to Fabric Path Endpoint (ACI Object [fabricPathEp](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fabricPathEp/overview)). This attribute is supported in ACI versions: 2.0(1m) and later. #### Required #### - * `target_dn` (tDn) - (string) The distinguished name of the target. - + * `target_dn` (tDn) - (string) The distinguished name of the target. #### Optional #### - * `annotation` (annotation) - (string) The annotation of the Relation To Fibre Channel Path object. + * `annotation` (annotation) - (string) The annotation of the Relation To Fibre Channel Path object. - Default: `orchestrator:terraform` - * `description` (descr) - (string) The description of the Relation To Fibre Channel Path object. - * `vsan` (vsan) - (string) The virtual storage area network (VSAN) of the Relation To Fibre Channel Path object. + * `description` (descr) - (string) The description of the Relation To Fibre Channel Path object. + * `vsan` (vsan) - (string) The virtual storage area network (VSAN) of the Relation To Fibre Channel Path object. - Default: `unknown` - * `vsan_mode` (vsanMode) - (string) The virtual storage area network (VSAN) mode of the Relation To Fibre Channel Path object. + * `vsan_mode` (vsanMode) - (string) The virtual storage area network (VSAN) mode of the Relation To Fibre Channel Path object. - Default: `regular` - Valid Values: `native`, `regular`. - -* `relation_to_intra_epg_contracts` - (list) A list of Relation To Intra EPG Contracts (ACI object [fvRsIntraEpg](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsIntraEpg/overview)) pointing to Contract (ACI Object [vzBrCP](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/vzBrCP/overview)) which can be configured using the [aci_contract](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/contract) resource. This attribute is supported in ACI versions: 3.0(1k) and later. + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. +* `relation_to_intra_epg_contracts` - (list) A list of Relation To Intra EPG Contracts (ACI object [fvRsIntraEpg](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsIntraEpg/overview)) pointing to Contract (ACI Object [vzBrCP](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/vzBrCP/overview)) which can be configured using the [aci_contract](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/contract) resource. This attribute is supported in ACI versions: 3.0(1k) and later. #### Required #### - * `contract_name` (tnVzBrCPName) - (string) The contract name. This attribute can be referenced from a [resource](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/contract) with `aci_contract.example.name` or from a [datasource](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/data-sources/contract) with `data.aci_contract.example.name`. - + * `contract_name` (tnVzBrCPName) - (string) The contract name. This attribute can be referenced from a [resource](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/contract) with `aci_contract.example.name` or from a [datasource](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/data-sources/contract) with `data.aci_contract.example.name`. #### Optional #### - * `annotation` (annotation) - (string) The annotation of the Relation To Intra EPG Contract object. + * `annotation` (annotation) - (string) The annotation of the Relation To Intra EPG Contract object. - Default: `orchestrator:terraform` - -* `relation_to_static_leafs` - (list) A list of Relation To Static Leafs (ACI object [fvRsNodeAtt](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsNodeAtt/overview)) pointing to (ACI Object [fabricNode](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fabricNode/overview)). + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. +* `relation_to_static_leafs` - (list) A list of Relation To Static Leafs (ACI object [fvRsNodeAtt](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsNodeAtt/overview)) pointing to (ACI Object [fabricNode](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fabricNode/overview)). #### Required #### - * `encapsulation` (encap) - (string) The VLAN encapsulation of the Relation To Static Leaf object. - * `target_dn` (tDn) - (string) The distinguished name of the target of this static binding. - + * `encapsulation` (encap) - (string) The VLAN encapsulation of the Relation To Static Leaf object. + * `target_dn` (tDn) - (string) The distinguished name of the target of this static binding. #### Optional #### - * `annotation` (annotation) - (string) The annotation of the Relation To Static Leaf object. + * `annotation` (annotation) - (string) The annotation of the Relation To Static Leaf object. - Default: `orchestrator:terraform` - * `description` (descr) - (string) The description of the Relation To Static Leaf object. - * `deployment_immediacy` (instrImedcy) - (string) The deployment immediacy of the Relation To Static Leaf object. Specifies when the policy is pushed into the hardware policy content-addressable memory (CAM). + * `description` (descr) - (string) The description of the Relation To Static Leaf object. + * `deployment_immediacy` (instrImedcy) - (string) The deployment immediacy of the Relation To Static Leaf object. Specifies when the policy is pushed into the hardware policy content-addressable memory (CAM). - Default: `lazy` - Valid Values: `immediate`, `lazy`. - * `mode` (mode) - (string) The static association mode with the path of the Relation To Static Leaf object. + * `mode` (mode) - (string) The static association mode with the path of the Relation To Static Leaf object. - Default: `regular` - Valid Values: `native`, `regular`, `untagged`. - -* `relation_to_static_paths` - (list) A list of Relation To Static Paths (ACI object [fvRsPathAtt](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsPathAtt/overview)) pointing to Fabric Path Endpoint (ACI Object [fabricPathEp](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fabricPathEp/overview)). + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. +* `relation_to_static_paths` - (list) A list of Relation To Static Paths (ACI object [fvRsPathAtt](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsPathAtt/overview)) pointing to Fabric Path Endpoint (ACI Object [fabricPathEp](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fabricPathEp/overview)). #### Required #### - * `encapsulation` (encap) - (string) The VLAN encapsulation of the Relation To Static Path object. - * `target_dn` (tDn) - (string) null. - + * `encapsulation` (encap) - (string) The VLAN encapsulation of the Relation To Static Path object. + * `target_dn` (tDn) - (string) null. #### Optional #### - * `annotation` (annotation) - (string) The annotation of the Relation To Static Path object. + * `annotation` (annotation) - (string) The annotation of the Relation To Static Path object. - Default: `orchestrator:terraform` - * `description` (descr) - (string) The description of the Relation To Static Path object. - * `deployment_immediacy` (instrImedcy) - (string) The deployment immediacy of the Relation To Static Path object. Specifies when the policy is pushed into the hardware policy content-addressable memory (CAM). + * `description` (descr) - (string) The description of the Relation To Static Path object. + * `deployment_immediacy` (instrImedcy) - (string) The deployment immediacy of the Relation To Static Path object. Specifies when the policy is pushed into the hardware policy content-addressable memory (CAM). - Default: `lazy` - Valid Values: `immediate`, `lazy`. - * `mode` (mode) - (string) The static association mode of the Relation To Static Path object. + * `mode` (mode) - (string) The static association mode of the Relation To Static Path object. - Default: `regular` - Valid Values: `native`, `regular`, `untagged`. - * `primary_encapsulation` (primaryEncap) - (string) The primary VLAN encapsulation of the Relation To Static Path object. - -* `relation_to_taboo_contracts` - (list) A list of Relation To Taboo Contracts (ACI object [fvRsProtBy](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsProtBy/overview)) pointing to Taboo Contract (ACI Object [vzTaboo](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/vzTaboo/overview)) which can be configured using the [aci_taboo_contract](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/taboo_contract) resource. + * `primary_encapsulation` (primaryEncap) - (string) The primary VLAN encapsulation of the Relation To Static Path object. + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. +* `relation_to_taboo_contracts` - (list) A list of Relation To Taboo Contracts (ACI object [fvRsProtBy](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsProtBy/overview)) pointing to Taboo Contract (ACI Object [vzTaboo](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/vzTaboo/overview)) which can be configured using the [aci_taboo_contract](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/taboo_contract) resource. #### Required #### - * `taboo_contract_name` (tnVzTabooName) - (string) A contract for denying specific classes of traffic. Taboo rules are applied in the hardware before applying the rules of regular contracts. Without a contract, the default forwarding policy is to not allow any communication between EPGs. This attribute can be referenced from a [resource](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/taboo_contract) with `aci_taboo_contract.example.name` or from a [datasource](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/data-sources/taboo_contract) with `data.aci_taboo_contract.example.name`. - + * `taboo_contract_name` (tnVzTabooName) - (string) A contract for denying specific classes of traffic. Taboo rules are applied in the hardware before applying the rules of regular contracts. Without a contract, the default forwarding policy is to not allow any communication between EPGs. This attribute can be referenced from a [resource](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/taboo_contract) with `aci_taboo_contract.example.name` or from a [datasource](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/data-sources/taboo_contract) with `data.aci_taboo_contract.example.name`. #### Optional #### - * `annotation` (annotation) - (string) The annotation of the Relation To Taboo Contract object. + * `annotation` (annotation) - (string) The annotation of the Relation To Taboo Contract object. - Default: `orchestrator:terraform` - -* `relation_to_provided_contracts` - (list) A list of Relation To Provided Contracts (ACI object [fvRsProv](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsProv/overview)) pointing to Contract (ACI Object [vzBrCP](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/vzBrCP/overview)) which can be configured using the [aci_contract](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/contract) resource. + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. +* `relation_to_provided_contracts` - (list) A list of Relation To Provided Contracts (ACI object [fvRsProv](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsProv/overview)) pointing to Contract (ACI Object [vzBrCP](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/vzBrCP/overview)) which can be configured using the [aci_contract](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/contract) resource. #### Required #### - * `contract_name` (tnVzBrCPName) - (string) The provider contract name. This attribute can be referenced from a [resource](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/contract) with `aci_contract.example.name` or from a [datasource](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/data-sources/contract) with `data.aci_contract.example.name`. - + * `contract_name` (tnVzBrCPName) - (string) The provider contract name. This attribute can be referenced from a [resource](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/contract) with `aci_contract.example.name` or from a [datasource](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/data-sources/contract) with `data.aci_contract.example.name`. #### Optional #### - * `annotation` (annotation) - (string) The annotation of the Relation To Provided Contract object. + * `annotation` (annotation) - (string) The annotation of the Relation To Provided Contract object. - Default: `orchestrator:terraform` - * `match_criteria` (matchT) - (string) The provider label match criteria. + * `match_criteria` (matchT) - (string) The provider label match criteria. - Default: `AtleastOne` - Valid Values: `All`, `AtleastOne`, `AtmostOne`, `None`. - * `priority` (prio) - (string) The Quality of Service (QoS) priority class ID. QoS refers to the capability of a network to provide better service to selected network traffic over various technologies. The primary goal of QoS is to provide priority including dedicated bandwidth, controlled jitter and latency (required by some real-time and interactive traffic), and improved loss characteristics. You can configure the bandwidth of each QoS level using QoS profiles. + * `priority` (prio) - (string) The Quality of Service (QoS) priority class ID. QoS refers to the capability of a network to provide better service to selected network traffic over various technologies. The primary goal of QoS is to provide priority including dedicated bandwidth, controlled jitter and latency (required by some real-time and interactive traffic), and improved loss characteristics. You can configure the bandwidth of each QoS level using QoS profiles. - Default: `unspecified` - Valid Values: `level1`, `level2`, `level3`, `level4`, `level5`, `level6`, `unspecified`. - -* `relation_to_contract_masters` - (list) A list of Relation To Contract Masters (ACI object [fvRsSecInherited](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsSecInherited/overview)) pointing to Application EPG (ACI Object [fvAEPg](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvAEPg/overview)) which can be configured using the [aci_application_epg](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/application_epg) resource. This attribute is supported in ACI versions: 2.3(1e) and later. + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. +* `relation_to_contract_masters` - (list) A list of Relation To Contract Masters (ACI object [fvRsSecInherited](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsSecInherited/overview)) pointing to . This attribute is supported in ACI versions: 2.3(1e) and later. #### Required #### - * `target_dn` (tDn) - (string) The distinguished name of the target. - + * `target_dn` (tDn) - (string) The distinguished name of the target. #### Optional #### - * `annotation` (annotation) - (string) The annotation of the Relation To Contract Master object. + * `annotation` (annotation) - (string) The annotation of the Relation To Contract Master object. - Default: `orchestrator:terraform` - -* `relation_to_trust_control_policy` - (map) A map of Relation To Trust Control Policy (ACI object [fvRsTrustCtrl](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsTrustCtrl/overview)) pointing to Trust Control Policy (ACI Object [fhsTrustCtrlPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fhsTrustCtrlPol/overview)) which can be configured using the [aci_trust_control_policy](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/trust_control_policy) resource. This attribute is supported in ACI versions: 3.0(1k) and later. + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. +* `relation_to_trust_control_policy` - (map) A map of Relation To Trust Control Policy (ACI object [fvRsTrustCtrl](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsTrustCtrl/overview)) pointing to Trust Control Policy (ACI Object [fhsTrustCtrlPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fhsTrustCtrlPol/overview)) which can be configured using the [aci_trust_control_policy](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/trust_control_policy) resource. This attribute is supported in ACI versions: 3.0(1k) and later. #### Optional #### - * `annotation` (annotation) - (string) The annotation of the Relation To Trust Control Policy object. + * `annotation` (annotation) - (string) The annotation of the Relation To Trust Control Policy object. - Default: `orchestrator:terraform` - * `trust_control_policy_name` (tnFhsTrustCtrlPolName) - (string) Name. - -* `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + * `trust_control_policy_name` (tnFhsTrustCtrlPolName) - (string) Name. + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. +* `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. ## Importing diff --git a/docs/resources/bridge_domain.md b/docs/resources/bridge_domain.md index 662d5b3f0..390af04bf 100644 --- a/docs/resources/bridge_domain.md +++ b/docs/resources/bridge_domain.md @@ -84,6 +84,18 @@ resource "aci_bridge_domain" "full_example_tenant" { name_alias = "name_alias_1" owner_key = "owner_key_1" owner_tag = "owner_tag_1" + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } rogue_coop_exceptions = [ { @@ -92,58 +104,202 @@ resource "aci_bridge_domain" "full_example_tenant" { mac = "00:00:00:00:00:00" name = "name_1" name_alias = "name_alias_1" + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } ] relation_to_monitor_policy = { annotation = "annotation_1" monitoring_policy_name = aci_monitoring_policy.example.name + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } relation_to_first_hop_security_policy = { annotation = "annotation_1" first_hop_security_policy_name = aci_first_hop_security_policy.example.name + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } relation_to_neighbor_discovery_interface_policy = { annotation = "annotation_1" neighbor_discovery_interface_policy_name = aci_neighbor_discovery_interface_policy.example.name + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } relation_to_netflow_monitor_policies = [ { annotation = "annotation_1" filter_type = "ce" netflow_monitor_policy_name = aci_netflow_monitor_policy.example.name + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } ] relation_to_l3_outsides = [ { annotation = "annotation_1" l3_outside_name = aci_l3_outside.example.name + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } ] relation_to_route_control_profile = { annotation = "annotation_1" l3_outside_name = aci_l3_outside.example.name route_control_profile_name = aci_route_control_profile.example.name + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } relation_to_dhcp_relay_policy = { annotation = "annotation_1" dhcp_relay_policy_name = aci_dhcp_relay_policy.example.name + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } relation_to_end_point_retention_policy = { annotation = "annotation_1" resolve_action = "inherit" end_point_retention_policy_name = aci_end_point_retention_policy.example.name + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } relation_to_vrf = { annotation = "annotation_1" vrf_name = aci_vrf.example.name + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } relation_to_igmp_snooping_policy = { annotation = "annotation_1" igmp_snooping_policy_name = aci_igmp_snooping_policy.example.name + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } relation_to_mld_snooping_policy = { annotation = "annotation_1" mld_snooping_policy_name = aci_mld_snooping_policy.example.name + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } annotations = [ { @@ -244,158 +400,245 @@ All examples for the Bridge Domain resource can be found in the [examples](https - Valid Values: `flood`, `opt-flood`. * `virtual_mac_address` (vmac) - (string) The virtual MAC address of the Bridge Domain object. This is used when the the BD/SVI is extended to multiple sites using a L2 Outside. - Default: `not-applicable` - * `legacy_mode` - (map) A map of Legacy Mode (ACI object [fvAccP](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvAccP/overview)). - #### Required #### - * `encapsulation` (encap) - (string) The VLAN or VXLAN encapsulation of the Legacy Mode object. - + * `encapsulation` (encap) - (string) The VLAN or VXLAN encapsulation of the Legacy Mode object. #### Optional #### - * `annotation` (annotation) - (string) The annotation of the Legacy Mode object. + * `annotation` (annotation) - (string) The annotation of the Legacy Mode object. - Default: `orchestrator:terraform` - * `description` (descr) - (string) The description of the Legacy Mode object. - * `name` (name) - (string) The name of the Legacy Mode object. - * `name_alias` (nameAlias) - (string) The name alias of the Legacy Mode object. - * `owner_key` (ownerKey) - (string) The key for enabling clients to own their data for entity correlation. - * `owner_tag` (ownerTag) - (string) A tag for enabling clients to add their own data. For example, to indicate who created this object. - -* `rogue_coop_exceptions` - (list) A list of Rogue Coop Exceptions (ACI object [fvRogueExceptionMac](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRogueExceptionMac/overview)). Rogue Coop Exceptions can also be configured using a separate [aci_rogue_coop_exception](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/rogue_coop_exception) resource. This attribute is supported in ACI versions: 5.2(3e) and later. + * `description` (descr) - (string) The description of the Legacy Mode object. + * `name` (name) - (string) The name of the Legacy Mode object. + * `name_alias` (nameAlias) - (string) The name alias of the Legacy Mode object. + * `owner_key` (ownerKey) - (string) The key for enabling clients to own their data for entity correlation. + * `owner_tag` (ownerTag) - (string) A tag for enabling clients to add their own data. For example, to indicate who created this object. + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. +* `rogue_coop_exceptions` - (list) A list of Rogue Coop Exceptions (ACI object [fvRogueExceptionMac](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRogueExceptionMac/overview)). Rogue Coop Exceptions can also be configured using a separate [aci_rogue_coop_exception](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/rogue_coop_exception) resource. This attribute is supported in ACI versions: 5.2(3e) and later. #### Required #### - * `mac` (mac) - (string) The MAC address of the Rogue Coop Exception object. - + * `mac` (mac) - (string) The MAC address of the Rogue Coop Exception object. #### Optional #### - * `annotation` (annotation) - (string) The annotation of the Rogue Coop Exception object. + * `annotation` (annotation) - (string) The annotation of the Rogue Coop Exception object. - Default: `orchestrator:terraform` - * `description` (descr) - (string) The description of the Rogue Coop Exception object. - * `name` (name) - (string) The name of the Rogue Coop Exception object. - * `name_alias` (nameAlias) - (string) The name alias of the Rogue Coop Exception object. - -* `relation_to_monitor_policy` - (map) A map of Relation From Bridge Domain To Monitoring Policy (ACI object [fvRsABDPolMonPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsABDPolMonPol/overview)) pointing to Monitoring Policy (ACI Object [monEPGPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/monEPGPol/overview)) which can be configured using the [aci_monitoring_policy](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/monitoring_policy) resource. + * `description` (descr) - (string) The description of the Rogue Coop Exception object. + * `name` (name) - (string) The name of the Rogue Coop Exception object. + * `name_alias` (nameAlias) - (string) The name alias of the Rogue Coop Exception object. + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. +* `relation_to_monitor_policy` - (map) A map of Relation From Bridge Domain To Monitoring Policy (ACI object [fvRsABDPolMonPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsABDPolMonPol/overview)) pointing to Monitoring Policy (ACI Object [monEPGPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/monEPGPol/overview)) which can be configured using the [aci_monitoring_policy](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/monitoring_policy) resource. #### Optional #### - * `annotation` (annotation) - (string) The annotation of the Relation From Bridge Domain To Monitoring Policy object. + * `annotation` (annotation) - (string) The annotation of the Relation From Bridge Domain To Monitoring Policy object. - Default: `orchestrator:terraform` - * `monitoring_policy_name` (tnMonEPGPolName) - (string) The name of the Monitoring Policy object. - -* `relation_to_first_hop_security_policy` - (map) A map of Relation From Bridge Domain To First Hop Security Policy (ACI object [fvRsBDToFhs](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsBDToFhs/overview)) pointing to First Hop Security Policy (ACI Object [fhsBDPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fhsBDPol/overview)) which can be configured using the [aci_first_hop_security_policy](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/first_hop_security_policy) resource. This attribute is supported in ACI versions: 3.0(1k) and later. + * `monitoring_policy_name` (tnMonEPGPolName) - (string) The name of the Monitoring Policy object. + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. +* `relation_to_first_hop_security_policy` - (map) A map of Relation From Bridge Domain To First Hop Security Policy (ACI object [fvRsBDToFhs](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsBDToFhs/overview)) pointing to First Hop Security Policy (ACI Object [fhsBDPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fhsBDPol/overview)) which can be configured using the [aci_first_hop_security_policy](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/first_hop_security_policy) resource. This attribute is supported in ACI versions: 3.0(1k) and later. #### Optional #### - * `annotation` (annotation) - (string) The annotation of the Relation From Bridge Domain To First Hop Security Policy object. + * `annotation` (annotation) - (string) The annotation of the Relation From Bridge Domain To First Hop Security Policy object. - Default: `orchestrator:terraform` - * `first_hop_security_policy_name` (tnFhsBDPolName) - (string) The name of the First Hop Security Policy object. - -* `relation_to_neighbor_discovery_interface_policy` - (map) A map of Relation From Bridge Domain To Neighbor Discovery Interface Policy (ACI object [fvRsBDToNdP](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsBDToNdP/overview)) pointing to Neighbor Discovery Interface Policy (ACI Object [ndIfPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/ndIfPol/overview)) which can be configured using the [aci_neighbor_discovery_interface_policy](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/neighbor_discovery_interface_policy) resource. This attribute is supported in ACI versions: 1.1(1j) and later. + * `first_hop_security_policy_name` (tnFhsBDPolName) - (string) The name of the First Hop Security Policy object. + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. +* `relation_to_neighbor_discovery_interface_policy` - (map) A map of Relation From Bridge Domain To Neighbor Discovery Interface Policy (ACI object [fvRsBDToNdP](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsBDToNdP/overview)) pointing to Neighbor Discovery Interface Policy (ACI Object [ndIfPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/ndIfPol/overview)) which can be configured using the [aci_neighbor_discovery_interface_policy](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/neighbor_discovery_interface_policy) resource. This attribute is supported in ACI versions: 1.1(1j) and later. #### Optional #### - * `annotation` (annotation) - (string) The annotation of the Relation From Bridge Domain To Neighbor Discovery Interface Policy object. + * `annotation` (annotation) - (string) The annotation of the Relation From Bridge Domain To Neighbor Discovery Interface Policy object. - Default: `orchestrator:terraform` - * `neighbor_discovery_interface_policy_name` (tnNdIfPolName) - (string) The name of the Neighbor Discovery Interface Policy object. - -* `relation_to_netflow_monitor_policies` - (list) A list of Relation From Bridge Domain To NetFlow Monitor Policys (ACI object [fvRsBDToNetflowMonitorPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsBDToNetflowMonitorPol/overview)) pointing to NetFlow Monitor Policy (ACI Object [netflowMonitorPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/netflowMonitorPol/overview)) which can be configured using the [aci_netflow_monitor_policy](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/netflow_monitor_policy) resource. This attribute is supported in ACI versions: 2.2(1k) and later. + * `neighbor_discovery_interface_policy_name` (tnNdIfPolName) - (string) The name of the Neighbor Discovery Interface Policy object. + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. +* `relation_to_netflow_monitor_policies` - (list) A list of Relation From Bridge Domain To NetFlow Monitor Policys (ACI object [fvRsBDToNetflowMonitorPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsBDToNetflowMonitorPol/overview)) pointing to NetFlow Monitor Policy (ACI Object [netflowMonitorPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/netflowMonitorPol/overview)) which can be configured using the [aci_netflow_monitor_policy](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/netflow_monitor_policy) resource. This attribute is supported in ACI versions: 2.2(1k) and later. #### Required #### - * `filter_type` (fltType) - (string) The filter type of the NetFlow Monitor Policy object. - * `netflow_monitor_policy_name` (tnNetflowMonitorPolName) - (string) The name of the NetFlow Monitor Policy object. This attribute can be referenced from a [resource](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/netflow_monitor_policy) with `aci_netflow_monitor_policy.example.name` or from a [datasource](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/data-sources/netflow_monitor_policy) with `data.aci_netflow_monitor_policy.example.name`. - + * `filter_type` (fltType) - (string) The filter type of the NetFlow Monitor Policy object. + * `netflow_monitor_policy_name` (tnNetflowMonitorPolName) - (string) The name of the NetFlow Monitor Policy object. This attribute can be referenced from a [resource](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/netflow_monitor_policy) with `aci_netflow_monitor_policy.example.name` or from a [datasource](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/data-sources/netflow_monitor_policy) with `data.aci_netflow_monitor_policy.example.name`. #### Optional #### - * `annotation` (annotation) - (string) The annotation of the Relation From Bridge Domain To NetFlow Monitor Policy object. + * `annotation` (annotation) - (string) The annotation of the Relation From Bridge Domain To NetFlow Monitor Policy object. - Default: `orchestrator:terraform` - -* `relation_to_l3_outsides` - (list) A list of Relation From Bridge Domain To L3 Outsides (ACI object [fvRsBDToOut](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsBDToOut/overview)) pointing to L3 Outside (ACI Object [l3extOut](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/l3extOut/overview)) which can be configured using the [aci_l3_outside](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/l3_outside) resource. + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. +* `relation_to_l3_outsides` - (list) A list of Relation From Bridge Domain To L3 Outsides (ACI object [fvRsBDToOut](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsBDToOut/overview)) pointing to L3 Outside (ACI Object [l3extOut](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/l3extOut/overview)) which can be configured using the [aci_l3_outside](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/l3_outside) resource. #### Required #### - * `l3_outside_name` (tnL3extOutName) - (string) The name of the L3 Outside object. This attribute can be referenced from a [resource](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/l3_outside) with `aci_l3_outside.example.name` or from a [datasource](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/data-sources/l3_outside) with `data.aci_l3_outside.example.name`. - + * `l3_outside_name` (tnL3extOutName) - (string) The name of the L3 Outside object. This attribute can be referenced from a [resource](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/l3_outside) with `aci_l3_outside.example.name` or from a [datasource](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/data-sources/l3_outside) with `data.aci_l3_outside.example.name`. #### Optional #### - * `annotation` (annotation) - (string) The annotation of the Relation From Bridge Domain To L3 Outside object. + * `annotation` (annotation) - (string) The annotation of the Relation From Bridge Domain To L3 Outside object. - Default: `orchestrator:terraform` - -* `relation_to_route_control_profile` - (map) A map of Relation From Bridge Domain To Route Control Profile (ACI object [fvRsBDToProfile](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsBDToProfile/overview)) pointing to Route Control Profile (ACI Object [rtctrlProfile](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/rtctrlProfile/overview)) which can be configured using the [aci_route_control_profile](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/route_control_profile) resource. + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. +* `relation_to_route_control_profile` - (map) A map of Relation From Bridge Domain To Route Control Profile (ACI object [fvRsBDToProfile](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsBDToProfile/overview)) pointing to Route Control Profile (ACI Object [rtctrlProfile](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/rtctrlProfile/overview)) which can be configured using the [aci_route_control_profile](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/route_control_profile) resource. #### Optional #### - * `annotation` (annotation) - (string) The annotation of the Relation From Bridge Domain To Route Control Profile object. + * `annotation` (annotation) - (string) The annotation of the Relation From Bridge Domain To Route Control Profile object. - Default: `orchestrator:terraform` - * `l3_outside_name` (tnL3extOutName) - (string) The name of the L3 Outside object. - * `route_control_profile_name` (tnRtctrlProfileName) - (string) The name of the Route Control Profile object. - -* `relation_to_dhcp_relay_policy` - (map) A map of Relation From Bridge Domain To Dhcp Relay Policy (ACI object [fvRsBDToRelayP](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsBDToRelayP/overview)) pointing to Dhcp Relay Policy (ACI Object [dhcpRelayP](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/dhcpRelayP/overview)) which can be configured using the [aci_dhcp_relay_policy](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/dhcp_relay_policy) resource. + * `l3_outside_name` (tnL3extOutName) - (string) The name of the L3 Outside object. + * `route_control_profile_name` (tnRtctrlProfileName) - (string) The name of the Route Control Profile object. + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. +* `relation_to_dhcp_relay_policy` - (map) A map of Relation From Bridge Domain To Dhcp Relay Policy (ACI object [fvRsBDToRelayP](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsBDToRelayP/overview)) pointing to Dhcp Relay Policy (ACI Object [dhcpRelayP](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/dhcpRelayP/overview)) which can be configured using the [aci_dhcp_relay_policy](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/dhcp_relay_policy) resource. #### Optional #### - * `annotation` (annotation) - (string) The annotation of the Relation From Bridge Domain To Dhcp Relay Policy object. + * `annotation` (annotation) - (string) The annotation of the Relation From Bridge Domain To Dhcp Relay Policy object. - Default: `orchestrator:terraform` - * `dhcp_relay_policy_name` (tnDhcpRelayPName) - (string) The name of the DHCP Relay Policy object. - -* `relation_to_end_point_retention_policy` - (map) A map of Relation From Bridge Domain To End Point Retention Policy (ACI object [fvRsBdToEpRet](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsBdToEpRet/overview)) pointing to End Point Retention Policy (ACI Object [fvEpRetPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvEpRetPol/overview)) which can be configured using the [aci_end_point_retention_policy](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/end_point_retention_policy) resource. + * `dhcp_relay_policy_name` (tnDhcpRelayPName) - (string) The name of the DHCP Relay Policy object. + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. +* `relation_to_end_point_retention_policy` - (map) A map of Relation From Bridge Domain To End Point Retention Policy (ACI object [fvRsBdToEpRet](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsBdToEpRet/overview)) pointing to End Point Retention Policy (ACI Object [fvEpRetPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvEpRetPol/overview)) which can be configured using the [aci_end_point_retention_policy](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/end_point_retention_policy) resource. #### Optional #### - * `annotation` (annotation) - (string) The annotation of the Relation From Bridge Domain To End Point Retention Policy object. + * `annotation` (annotation) - (string) The annotation of the Relation From Bridge Domain To End Point Retention Policy object. - Default: `orchestrator:terraform` - * `resolve_action` (resolveAct) - (string) The action to take for resolving the Endpoint Retention Policy object. + * `resolve_action` (resolveAct) - (string) The action to take for resolving the Endpoint Retention Policy object. - Default: `resolve` - Valid Values: `inherit`, `resolve`. - * `end_point_retention_policy_name` (tnFvEpRetPolName) - (string) The name of the Endpoint Retention Policy object. - -* `relation_to_vrf` - (map) A map of Relation To VRF (ACI object [fvRsCtx](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsCtx/overview)) pointing to VRF (ACI Object [fvCtx](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvCtx/overview)) which can be configured using the [aci_vrf](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/vrf) resource. + * `end_point_retention_policy_name` (tnFvEpRetPolName) - (string) The name of the Endpoint Retention Policy object. + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. +* `relation_to_vrf` - (map) A map of Relation To VRF (ACI object [fvRsCtx](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsCtx/overview)) pointing to VRF (ACI Object [fvCtx](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvCtx/overview)) which can be configured using the [aci_vrf](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/vrf) resource. #### Optional #### - * `annotation` (annotation) - (string) The annotation of the Relation To VRF object. + * `annotation` (annotation) - (string) The annotation of the Relation To VRF object. - Default: `orchestrator:terraform` - * `vrf_name` (tnFvCtxName) - (string) The name of the VRF object. - -* `relation_to_igmp_snooping_policy` - (map) A map of Relation To IGMP Snooping Policy (ACI object [fvRsIgmpsn](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsIgmpsn/overview)) pointing to IGMP Snooping Policy (ACI Object [igmpSnoopPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/igmpSnoopPol/overview)) which can be configured using the [aci_igmp_snooping_policy](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/igmp_snooping_policy) resource. + * `vrf_name` (tnFvCtxName) - (string) The name of the VRF object. + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. +* `relation_to_igmp_snooping_policy` - (map) A map of Relation To IGMP Snooping Policy (ACI object [fvRsIgmpsn](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsIgmpsn/overview)) pointing to IGMP Snooping Policy (ACI Object [igmpSnoopPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/igmpSnoopPol/overview)) which can be configured using the [aci_igmp_snooping_policy](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/igmp_snooping_policy) resource. #### Optional #### - * `annotation` (annotation) - (string) The annotation of the Relation To IGMP Snooping Policy object. + * `annotation` (annotation) - (string) The annotation of the Relation To IGMP Snooping Policy object. - Default: `orchestrator:terraform` - * `igmp_snooping_policy_name` (tnIgmpSnoopPolName) - (string) The name of the IGMP Snooping Policy object. - -* `relation_to_mld_snooping_policy` - (map) A map of Relation To MLD Snooping Policy (ACI object [fvRsMldsn](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsMldsn/overview)) pointing to MLD Snooping Policy (ACI Object [mldSnoopPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/mldSnoopPol/overview)) which can be configured using the [aci_mld_snooping_policy](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/mld_snooping_policy) resource. This attribute is supported in ACI versions: 4.1(1i) and later. + * `igmp_snooping_policy_name` (tnIgmpSnoopPolName) - (string) The name of the IGMP Snooping Policy object. + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. +* `relation_to_mld_snooping_policy` - (map) A map of Relation To MLD Snooping Policy (ACI object [fvRsMldsn](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsMldsn/overview)) pointing to MLD Snooping Policy (ACI Object [mldSnoopPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/mldSnoopPol/overview)) which can be configured using the [aci_mld_snooping_policy](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/mld_snooping_policy) resource. This attribute is supported in ACI versions: 4.1(1i) and later. #### Optional #### - * `annotation` (annotation) - (string) The annotation of the Relation To MLD Snooping Policy object. + * `annotation` (annotation) - (string) The annotation of the Relation To MLD Snooping Policy object. - Default: `orchestrator:terraform` - * `mld_snooping_policy_name` (tnMldSnoopPolName) - (string) The name of the MLD Snooping Policy object. - -* `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + * `mld_snooping_policy_name` (tnMldSnoopPolName) - (string) The name of the MLD Snooping Policy object. + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. +* `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. ## Importing diff --git a/docs/resources/certificate_authority.md b/docs/resources/certificate_authority.md index bcf2c27e8..9428d2f9d 100644 --- a/docs/resources/certificate_authority.md +++ b/docs/resources/certificate_authority.md @@ -114,12 +114,36 @@ EOT { key = "key_0" value = "value_1" + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } ] tags = [ { key = "key_0" value = "value_1" + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } ] } @@ -153,12 +177,36 @@ EOT { key = "key_0" value = "value_1" + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } ] tags = [ { key = "key_0" value = "value_1" + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } ] } @@ -189,20 +237,16 @@ All examples for the Certificate Authority resource can be found in the [example * `name_alias` (nameAlias) - (string) The name alias of the Certificate Authority object. * `owner_key` (ownerKey) - (string) The key for enabling clients to own their data for entity correlation. * `owner_tag` (ownerTag) - (string) A tag for enabling clients to add their own data. For example, to indicate who created this object. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. ## Importing diff --git a/docs/resources/custom_qos_policy.md b/docs/resources/custom_qos_policy.md index 66b81f063..6ef6c1ed2 100644 --- a/docs/resources/custom_qos_policy.md +++ b/docs/resources/custom_qos_policy.md @@ -92,20 +92,16 @@ All examples for the Custom Qos Policy resource can be found in the [examples](h * `name_alias` (nameAlias) - (string) The name alias of the Custom Qos Policy object. * `owner_key` (ownerKey) - (string) The key for enabling clients to own their data for entity correlation. * `owner_tag` (ownerTag) - (string) A tag for enabling clients to add their own data. For example, to indicate who created this object. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. ## Importing diff --git a/docs/resources/data_plane_policing_policy.md b/docs/resources/data_plane_policing_policy.md index dabc951c8..c112097d5 100644 --- a/docs/resources/data_plane_policing_policy.md +++ b/docs/resources/data_plane_policing_policy.md @@ -196,20 +196,16 @@ All examples for the Data Plane Policing Policy resource can be found in the [ex - Valid Values: * `unspecified`. * Or a value in the range of `0` to `63`. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. ## Importing diff --git a/docs/resources/endpoint_security_group.md b/docs/resources/endpoint_security_group.md index 8cf9b225c..03805e419 100644 --- a/docs/resources/endpoint_security_group.md +++ b/docs/resources/endpoint_security_group.md @@ -62,6 +62,18 @@ resource "aci_endpoint_security_group" "full_example_application_profile" { annotation = "annotation_1" priority = "level1" contract_name = aci_contract.example.name + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } ] relation_to_imported_contracts = [ @@ -69,12 +81,36 @@ resource "aci_endpoint_security_group" "full_example_application_profile" { annotation = "annotation_1" priority = "level1" imported_contract_name = aci_imported_contract.example.name + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } ] relation_to_intra_epg_contracts = [ { annotation = "annotation_1" contract_name = aci_contract.example.name + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } ] relation_to_provided_contracts = [ @@ -83,16 +119,52 @@ resource "aci_endpoint_security_group" "full_example_application_profile" { match_criteria = "All" priority = "level1" contract_name = aci_contract.example.name + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } ] relation_to_vrf = { annotation = "annotation_1" vrf_name = aci_vrf.example.name + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } relation_to_contract_masters = [ { annotation = "annotation_1" target_dn = aci_endpoint_security_group.test_endpoint_security_group_0.id + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } ] annotations = [ @@ -145,96 +217,134 @@ All examples for the Endpoint Security Group resource can be found in the [examp * `admin_state` (shutdown) - (string) Withdraw the ESG configuration from all nodes in the fabric. - Default: `no` - Valid Values: `no`, `yes`. - * `relation_to_consumed_contracts` - (list) A list of Relation To Consumed Contracts (ACI object [fvRsCons](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsCons/overview)) pointing to Contract (ACI Object [vzBrCP](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/vzBrCP/overview)) which can be configured using the [aci_contract](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/contract) resource. This attribute is supported in ACI versions: 1.0(1e) and later. - #### Required #### - * `contract_name` (tnVzBrCPName) - (string) The consumer contract name. This attribute can be referenced from a [resource](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/contract) with `aci_contract.example.name` or from a [datasource](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/data-sources/contract) with `data.aci_contract.example.name`. - + * `contract_name` (tnVzBrCPName) - (string) The consumer contract name. This attribute can be referenced from a [resource](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/contract) with `aci_contract.example.name` or from a [datasource](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/data-sources/contract) with `data.aci_contract.example.name`. #### Optional #### - * `annotation` (annotation) - (string) The annotation of the Relation To Consumed Contract object. + * `annotation` (annotation) - (string) The annotation of the Relation To Consumed Contract object. - Default: `orchestrator:terraform` - * `priority` (prio) - (string) The Quality of Service (QoS) priority class ID. QoS refers to the capability of a network to provide better service to selected network traffic over various technologies. The primary goal of QoS is to provide priority including dedicated bandwidth, controlled jitter and latency (required by some real-time and interactive traffic), and improved loss characteristics. You can configure the bandwidth of each QoS level using QoS profiles. + * `priority` (prio) - (string) The Quality of Service (QoS) priority class ID. QoS refers to the capability of a network to provide better service to selected network traffic over various technologies. The primary goal of QoS is to provide priority including dedicated bandwidth, controlled jitter and latency (required by some real-time and interactive traffic), and improved loss characteristics. You can configure the bandwidth of each QoS level using QoS profiles. - Default: `unspecified` - Valid Values: `level1`, `level2`, `level3`, `level4`, `level5`, `level6`, `unspecified`. - -* `relation_to_imported_contracts` - (list) A list of Relation To Imported Contracts (ACI object [fvRsConsIf](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsConsIf/overview)) pointing to Imported Contract (ACI Object [vzCPIf](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/vzCPIf/overview)) which can be configured using the [aci_imported_contract](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/imported_contract) resource. This attribute is supported in ACI versions: 1.0(1e) and later. + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. +* `relation_to_imported_contracts` - (list) A list of Relation To Imported Contracts (ACI object [fvRsConsIf](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsConsIf/overview)) pointing to Imported Contract (ACI Object [vzCPIf](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/vzCPIf/overview)) which can be configured using the [aci_imported_contract](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/imported_contract) resource. This attribute is supported in ACI versions: 1.0(1e) and later. #### Required #### - * `imported_contract_name` (tnVzCPIfName) - (string) The contract interface name. This attribute can be referenced from a [resource](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/imported_contract) with `aci_imported_contract.example.name` or from a [datasource](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/data-sources/imported_contract) with `data.aci_imported_contract.example.name`. - + * `imported_contract_name` (tnVzCPIfName) - (string) The contract interface name. This attribute can be referenced from a [resource](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/imported_contract) with `aci_imported_contract.example.name` or from a [datasource](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/data-sources/imported_contract) with `data.aci_imported_contract.example.name`. #### Optional #### - * `annotation` (annotation) - (string) The annotation of the Relation To Imported Contract object. + * `annotation` (annotation) - (string) The annotation of the Relation To Imported Contract object. - Default: `orchestrator:terraform` - * `priority` (prio) - (string) The Quality of Service (QoS) priority class ID. QoS refers to the capability of a network to provide better service to selected network traffic over various technologies. The primary goal of QoS is to provide priority including dedicated bandwidth, controlled jitter and latency (required by some real-time and interactive traffic), and improved loss characteristics. You can configure the bandwidth of each QoS level using QoS profiles. + * `priority` (prio) - (string) The Quality of Service (QoS) priority class ID. QoS refers to the capability of a network to provide better service to selected network traffic over various technologies. The primary goal of QoS is to provide priority including dedicated bandwidth, controlled jitter and latency (required by some real-time and interactive traffic), and improved loss characteristics. You can configure the bandwidth of each QoS level using QoS profiles. - Default: `unspecified` - Valid Values: `level1`, `level2`, `level3`, `level4`, `level5`, `level6`, `unspecified`. - -* `relation_to_intra_epg_contracts` - (list) A list of Relation To Intra EPG Contracts (ACI object [fvRsIntraEpg](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsIntraEpg/overview)) pointing to Contract (ACI Object [vzBrCP](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/vzBrCP/overview)) which can be configured using the [aci_contract](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/contract) resource. This attribute is supported in ACI versions: 3.0(1k) and later. + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. +* `relation_to_intra_epg_contracts` - (list) A list of Relation To Intra EPG Contracts (ACI object [fvRsIntraEpg](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsIntraEpg/overview)) pointing to Contract (ACI Object [vzBrCP](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/vzBrCP/overview)) which can be configured using the [aci_contract](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/contract) resource. This attribute is supported in ACI versions: 3.0(1k) and later. #### Required #### - * `contract_name` (tnVzBrCPName) - (string) The contract name. This attribute can be referenced from a [resource](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/contract) with `aci_contract.example.name` or from a [datasource](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/data-sources/contract) with `data.aci_contract.example.name`. - + * `contract_name` (tnVzBrCPName) - (string) The contract name. This attribute can be referenced from a [resource](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/contract) with `aci_contract.example.name` or from a [datasource](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/data-sources/contract) with `data.aci_contract.example.name`. #### Optional #### - * `annotation` (annotation) - (string) The annotation of the Relation To Intra EPG Contract object. + * `annotation` (annotation) - (string) The annotation of the Relation To Intra EPG Contract object. - Default: `orchestrator:terraform` - -* `relation_to_provided_contracts` - (list) A list of Relation To Provided Contracts (ACI object [fvRsProv](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsProv/overview)) pointing to Contract (ACI Object [vzBrCP](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/vzBrCP/overview)) which can be configured using the [aci_contract](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/contract) resource. This attribute is supported in ACI versions: 1.0(1e) and later. + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. +* `relation_to_provided_contracts` - (list) A list of Relation To Provided Contracts (ACI object [fvRsProv](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsProv/overview)) pointing to Contract (ACI Object [vzBrCP](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/vzBrCP/overview)) which can be configured using the [aci_contract](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/contract) resource. This attribute is supported in ACI versions: 1.0(1e) and later. #### Required #### - * `contract_name` (tnVzBrCPName) - (string) The provider contract name. This attribute can be referenced from a [resource](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/contract) with `aci_contract.example.name` or from a [datasource](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/data-sources/contract) with `data.aci_contract.example.name`. - + * `contract_name` (tnVzBrCPName) - (string) The provider contract name. This attribute can be referenced from a [resource](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/contract) with `aci_contract.example.name` or from a [datasource](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/data-sources/contract) with `data.aci_contract.example.name`. #### Optional #### - * `annotation` (annotation) - (string) The annotation of the Relation To Provided Contract object. + * `annotation` (annotation) - (string) The annotation of the Relation To Provided Contract object. - Default: `orchestrator:terraform` - * `match_criteria` (matchT) - (string) The provider label match criteria. + * `match_criteria` (matchT) - (string) The provider label match criteria. - Default: `AtleastOne` - Valid Values: `All`, `AtleastOne`, `AtmostOne`, `None`. - * `priority` (prio) - (string) The Quality of Service (QoS) priority class ID. QoS refers to the capability of a network to provide better service to selected network traffic over various technologies. The primary goal of QoS is to provide priority including dedicated bandwidth, controlled jitter and latency (required by some real-time and interactive traffic), and improved loss characteristics. You can configure the bandwidth of each QoS level using QoS profiles. + * `priority` (prio) - (string) The Quality of Service (QoS) priority class ID. QoS refers to the capability of a network to provide better service to selected network traffic over various technologies. The primary goal of QoS is to provide priority including dedicated bandwidth, controlled jitter and latency (required by some real-time and interactive traffic), and improved loss characteristics. You can configure the bandwidth of each QoS level using QoS profiles. - Default: `unspecified` - Valid Values: `level1`, `level2`, `level3`, `level4`, `level5`, `level6`, `unspecified`. - -* `relation_to_vrf` - (map) A map of Relation To VRF (ACI object [fvRsScope](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsScope/overview)) pointing to VRF (ACI Object [fvCtx](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvCtx/overview)) which can be configured using the [aci_vrf](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/vrf) resource. + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. +* `relation_to_vrf` - (map) A map of Relation To VRF (ACI object [fvRsScope](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsScope/overview)) pointing to VRF (ACI Object [fvCtx](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvCtx/overview)) which can be configured using the [aci_vrf](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/vrf) resource. #### Optional #### - * `annotation` (annotation) - (string) The annotation of the Relation To VRF object. + * `annotation` (annotation) - (string) The annotation of the Relation To VRF object. - Default: `orchestrator:terraform` - * `vrf_name` (tnFvCtxName) - (string) The name of the VRF object. - -* `relation_to_contract_masters` - (list) A list of Relation To Contract Masters (ACI object [fvRsSecInherited](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsSecInherited/overview)) pointing to Endpoint Security Group (ACI Object [fvESg](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvESg/overview)) which can be configured using the [aci_endpoint_security_group](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/endpoint_security_group) resource. This attribute is supported in ACI versions: 2.3(1e) and later. + * `vrf_name` (tnFvCtxName) - (string) The name of the VRF object. + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. +* `relation_to_contract_masters` - (list) A list of Relation To Contract Masters (ACI object [fvRsSecInherited](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsSecInherited/overview)) pointing to . This attribute is supported in ACI versions: 2.3(1e) and later. #### Required #### - * `target_dn` (tDn) - (string) The distinguished name of the target. - + * `target_dn` (tDn) - (string) The distinguished name of the target. #### Optional #### - * `annotation` (annotation) - (string) The annotation of the Relation To Contract Master object. + * `annotation` (annotation) - (string) The annotation of the Relation To Contract Master object. - Default: `orchestrator:terraform` - -* `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. +* `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. ## Importing diff --git a/docs/resources/endpoint_tag_ip.md b/docs/resources/endpoint_tag_ip.md index ab994442e..3ec16c79a 100644 --- a/docs/resources/endpoint_tag_ip.md +++ b/docs/resources/endpoint_tag_ip.md @@ -93,20 +93,16 @@ All examples for the Endpoint Tag IP resource can be found in the [examples](htt * `id_attribute` (id) - (string) The identifier of the Endpoint Tag IP object. * `name` (name) - (string) The name of the Endpoint Tag IP object. * `name_alias` (nameAlias) - (string) The name alias of the Endpoint Tag IP object. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. ## Importing diff --git a/docs/resources/endpoint_tag_mac.md b/docs/resources/endpoint_tag_mac.md index 2f12d0bac..e7ed97277 100644 --- a/docs/resources/endpoint_tag_mac.md +++ b/docs/resources/endpoint_tag_mac.md @@ -93,20 +93,16 @@ All examples for the Endpoint Tag MAC resource can be found in the [examples](ht * `id_attribute` (id) - (string) The identifier of the Endpoint Tag MAC object. * `name` (name) - (string) The name of the Endpoint Tag MAC object. * `name_alias` (nameAlias) - (string) The name alias of the Endpoint Tag MAC object. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. ## Importing diff --git a/docs/resources/epg_useg_ad_group_attribute.md b/docs/resources/epg_useg_ad_group_attribute.md index bc8b9b31c..8de0a09a0 100644 --- a/docs/resources/epg_useg_ad_group_attribute.md +++ b/docs/resources/epg_useg_ad_group_attribute.md @@ -94,20 +94,16 @@ All examples for the EPG uSeg AD Group Attribute resource can be found in the [e * `name_alias` (nameAlias) - (string) The name alias of the EPG uSeg AD Group Attribute object. * `owner_key` (ownerKey) - (string) The key for enabling clients to own their data for entity correlation. * `owner_tag` (ownerTag) - (string) A tag for enabling clients to add their own data. For example, to indicate who created this object. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. ## Importing diff --git a/docs/resources/epg_useg_block_statement.md b/docs/resources/epg_useg_block_statement.md index 7f12481b0..fff15ee49 100644 --- a/docs/resources/epg_useg_block_statement.md +++ b/docs/resources/epg_useg_block_statement.md @@ -101,20 +101,16 @@ All examples for the EPG uSeg Block Statement resource can be found in the [exam * `scope` (scope) - (string) The scope of the EPG uSeg Block Statement object. - Default: `scope-bd` - Valid Values: `scope-bd`, `scope-vrf`. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. ## Importing diff --git a/docs/resources/epg_useg_dns_attribute.md b/docs/resources/epg_useg_dns_attribute.md index 4b3002602..c18481d98 100644 --- a/docs/resources/epg_useg_dns_attribute.md +++ b/docs/resources/epg_useg_dns_attribute.md @@ -94,20 +94,16 @@ All examples for the EPG uSeg DNS Attribute resource can be found in the [exampl * `name_alias` (nameAlias) - (string) The name alias of the EPG uSeg DNS Attribute object. * `owner_key` (ownerKey) - (string) The key for enabling clients to own their data for entity correlation. * `owner_tag` (ownerTag) - (string) A tag for enabling clients to add their own data. For example, to indicate who created this object. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. ## Importing diff --git a/docs/resources/epg_useg_ip_attribute.md b/docs/resources/epg_useg_ip_attribute.md index 8a5f8961d..803a41901 100644 --- a/docs/resources/epg_useg_ip_attribute.md +++ b/docs/resources/epg_useg_ip_attribute.md @@ -99,20 +99,16 @@ All examples for the EPG uSeg IP Attribute resource can be found in the [example * `use_epg_subnet` (usefvSubnet) - (string) Parameter used to determine whether a previously configured subnet address should be used as the IP filter. - Default: `no` - Valid Values: `no`, `yes`. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. ## Importing diff --git a/docs/resources/epg_useg_mac_attribute.md b/docs/resources/epg_useg_mac_attribute.md index 08737ccfe..dc6509223 100644 --- a/docs/resources/epg_useg_mac_attribute.md +++ b/docs/resources/epg_useg_mac_attribute.md @@ -95,20 +95,16 @@ All examples for the EPG uSeg MAC Attribute resource can be found in the [exampl * `name_alias` (nameAlias) - (string) The name alias of the EPG uSeg MAC Attribute object. * `owner_key` (ownerKey) - (string) The key for enabling clients to own their data for entity correlation. * `owner_tag` (ownerTag) - (string) A tag for enabling clients to add their own data. For example, to indicate who created this object. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. ## Importing diff --git a/docs/resources/epg_useg_sub_block_statement.md b/docs/resources/epg_useg_sub_block_statement.md index 091456aa3..61126b353 100644 --- a/docs/resources/epg_useg_sub_block_statement.md +++ b/docs/resources/epg_useg_sub_block_statement.md @@ -126,20 +126,16 @@ All examples for the EPG uSeg Sub Block Statement resource can be found in the [ * `name_alias` (nameAlias) - (string) The name alias of the EPG uSeg Sub Block Statement object. * `owner_key` (ownerKey) - (string) The key for enabling clients to own their data for entity correlation. * `owner_tag` (ownerTag) - (string) A tag for enabling clients to add their own data. For example, to indicate who created this object. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. ## Importing diff --git a/docs/resources/epg_useg_vm_attribute.md b/docs/resources/epg_useg_vm_attribute.md index 9ebe26261..9144f81d9 100644 --- a/docs/resources/epg_useg_vm_attribute.md +++ b/docs/resources/epg_useg_vm_attribute.md @@ -143,20 +143,16 @@ All examples for the EPG uSeg VM Attribute resource can be found in the [example * `type` (type) - (string) The type of the EPG uSeg VM Attribute object. - Default: `vm-name` - Valid Values: `custom-label`, `domain`, `guest-os`, `hv`, `rootContName`, `tag`, `vm`, `vm-folder`, `vm-name`, `vmfolder-path`, `vnic`. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. ## Importing diff --git a/docs/resources/external_management_network_instance_profile.md b/docs/resources/external_management_network_instance_profile.md index 2ea7f99cd..5855a9936 100644 --- a/docs/resources/external_management_network_instance_profile.md +++ b/docs/resources/external_management_network_instance_profile.md @@ -56,6 +56,18 @@ resource "aci_external_management_network_instance_profile" "full_example" { annotation = "annotation_1" priority = "level1" out_of_band_contract_name = aci_out_of_band_contract.example.name + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } ] annotations = [ @@ -95,34 +107,37 @@ All examples for the External Management Network Instance Profile resource can b * `priority` (prio) - (string) The Quality of Service (QoS) priority class ID. QoS refers to the capability of a network to provide better service to selected network traffic over various technologies. The primary goal of QoS is to provide priority including dedicated bandwidth, controlled jitter and latency (required by some real-time and interactive traffic), and improved loss characteristics. You can configure the bandwidth of each QoS level using QoS profiles. - Default: `unspecified` - Valid Values: `level1`, `level2`, `level3`, `level4`, `level5`, `level6`, `unspecified`. - * `relation_to_consumed_out_of_band_contracts` - (list) A list of Relation To Consumed Out Of Band Contracts (ACI object [mgmtRsOoBCons](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/mgmtRsOoBCons/overview)) pointing to Out Of Band Contract (ACI Object [vzOOBBrCP](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/vzOOBBrCP/overview)) which can be configured using the [aci_out_of_band_contract](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/out_of_band_contract) resource. - #### Required #### - * `out_of_band_contract_name` (tnVzOOBBrCPName) - (string) The name of the Out Of Band Contract object. This attribute can be referenced from a [resource](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/out_of_band_contract) with `aci_out_of_band_contract.example.name` or from a [datasource](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/data-sources/out_of_band_contract) with `data.aci_out_of_band_contract.example.name`. - + * `out_of_band_contract_name` (tnVzOOBBrCPName) - (string) The name of the Out Of Band Contract object. This attribute can be referenced from a [resource](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/out_of_band_contract) with `aci_out_of_band_contract.example.name` or from a [datasource](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/data-sources/out_of_band_contract) with `data.aci_out_of_band_contract.example.name`. #### Optional #### - * `annotation` (annotation) - (string) The annotation of the Relation To Consumed Out Of Band Contract object. + * `annotation` (annotation) - (string) The annotation of the Relation To Consumed Out Of Band Contract object. - Default: `orchestrator:terraform` - * `priority` (prio) - (string) The Quality of Service (QoS) priority class ID. QoS refers to the capability of a network to provide better service to selected network traffic over various technologies. The primary goal of QoS is to provide priority including dedicated bandwidth, controlled jitter and latency (required by some real-time and interactive traffic), and improved loss characteristics. You can configure the bandwidth of each QoS level using QoS profiles. + * `priority` (prio) - (string) The Quality of Service (QoS) priority class ID. QoS refers to the capability of a network to provide better service to selected network traffic over various technologies. The primary goal of QoS is to provide priority including dedicated bandwidth, controlled jitter and latency (required by some real-time and interactive traffic), and improved loss characteristics. You can configure the bandwidth of each QoS level using QoS profiles. - Default: `unspecified` - Valid Values: `level1`, `level2`, `level3`, `level4`, `level5`, `level6`, `unspecified`. - -* `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. +* `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. ## Importing diff --git a/docs/resources/external_management_network_subnet.md b/docs/resources/external_management_network_subnet.md index d806137da..5c4d80003 100644 --- a/docs/resources/external_management_network_subnet.md +++ b/docs/resources/external_management_network_subnet.md @@ -90,20 +90,16 @@ All examples for the External Management Network Subnet resource can be found in * `description` (descr) - (string) The description of the External Management Network Subnet object. * `name` (name) - (string) The name of the External Management Network Subnet object. * `name_alias` (nameAlias) - (string) The name alias of the External Management Network Subnet object. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. ## Importing diff --git a/docs/resources/first_hop_security_policy.md b/docs/resources/first_hop_security_policy.md index 3ecaf6d42..68ff35874 100644 --- a/docs/resources/first_hop_security_policy.md +++ b/docs/resources/first_hop_security_policy.md @@ -71,6 +71,18 @@ resource "aci_first_hop_security_policy" "full_example_tenant" { other_config_flag = "no" owner_key = "owner_key_1" owner_tag = "owner_tag_1" + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } annotations = [ { @@ -119,52 +131,55 @@ All examples for the First Hop Security Policy resource can be found in the [exa * `source_guard` (srcGuardAdminSt) - (string) The Source Guard Status for IPv4 and IPv6 traffic of the First Hop Security Policy object. - Default: `enabled-both` - Valid Values: `disabled`, `enabled-both`, `enabled-ipv4`, `enabled-ipv6`. - * `route_advertisement_guard_policy` - (map) A map of Route Advertisement Guard Policy (ACI object [fhsRaGuardPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fhsRaGuardPol/overview)). - - #### Optional #### - * `annotation` (annotation) - (string) The annotation of the Route Advertisement Guard Policy object. + * `annotation` (annotation) - (string) The annotation of the Route Advertisement Guard Policy object. - Default: `orchestrator:terraform` - * `description` (descr) - (string) The description of the Route Advertisement Guard Policy object. - * `managed_config_check` (managedConfigCheck) - (string) Perform a managed configuration check for the Route Advertisement Guard Policy object. + * `description` (descr) - (string) The description of the Route Advertisement Guard Policy object. + * `managed_config_check` (managedConfigCheck) - (string) Perform a managed configuration check for the Route Advertisement Guard Policy object. - Default: `no` - Valid Values: `no`, `yes`. - * `managed_config_flag` (managedConfigFlag) - (string) The managed configuration flag setting for the Route Advertisement Guard Policy object. + * `managed_config_flag` (managedConfigFlag) - (string) The managed configuration flag setting for the Route Advertisement Guard Policy object. - Default: `no` - Valid Values: `no`, `yes`. - * `max_hop_limit` (maxHopLimit) - (string) The maximum hop limit for the Route Advertisement Guard Policy object. + * `max_hop_limit` (maxHopLimit) - (string) The maximum hop limit for the Route Advertisement Guard Policy object. - Default: `0` - * `max_router_preference` (maxRouterPref) - (string) The allowed maximum router preference for the Route Advertisement Guard Policy object. + * `max_router_preference` (maxRouterPref) - (string) The allowed maximum router preference for the Route Advertisement Guard Policy object. - Default: `disabled` - Valid Values: `disabled`, `high`, `low`, `medium`. - * `min_hop_limit` (minHopLimit) - (string) The minimum hop limit for the Route Advertisement Guard Policy object. + * `min_hop_limit` (minHopLimit) - (string) The minimum hop limit for the Route Advertisement Guard Policy object. - Default: `0` - * `name` (name) - (string) The name of the Route Advertisement Guard Policy object. - * `name_alias` (nameAlias) - (string) The name alias of the Route Advertisement Guard Policy object. - * `other_config_check` (otherConfigCheck) - (string) Perform other configuration checks for the Route Advertisement Guard Policy object. + * `name` (name) - (string) The name of the Route Advertisement Guard Policy object. + * `name_alias` (nameAlias) - (string) The name alias of the Route Advertisement Guard Policy object. + * `other_config_check` (otherConfigCheck) - (string) Perform other configuration checks for the Route Advertisement Guard Policy object. - Default: `no` - Valid Values: `no`, `yes`. - * `other_config_flag` (otherConfigFlag) - (string) The other configuration flag setting for the Route Advertisement Guard Policy object. + * `other_config_flag` (otherConfigFlag) - (string) The other configuration flag setting for the Route Advertisement Guard Policy object. - Default: `no` - Valid Values: `no`, `yes`. - * `owner_key` (ownerKey) - (string) The key for enabling clients to own their data for entity correlation. - * `owner_tag` (ownerTag) - (string) A tag for enabling clients to add their own data. For example, to indicate who created this object. - -* `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + * `owner_key` (ownerKey) - (string) The key for enabling clients to own their data for entity correlation. + * `owner_tag` (ownerTag) - (string) A tag for enabling clients to add their own data. For example, to indicate who created this object. + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. +* `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. ## Importing diff --git a/docs/resources/igmp_snooping_policy.md b/docs/resources/igmp_snooping_policy.md index 4b9c18210..f29275592 100644 --- a/docs/resources/igmp_snooping_policy.md +++ b/docs/resources/igmp_snooping_policy.md @@ -120,20 +120,16 @@ All examples for the IGMP Snooping Policy resource can be found in the [examples * `querier_version` (ver) - (string) The version of the IGMP querier. - Default: `v3` - Valid Values: `unspecified`, `v1`, `v2`, `v3`. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. ## Importing diff --git a/docs/resources/key_ring.md b/docs/resources/key_ring.md index f3673aaeb..bd9e65caa 100644 --- a/docs/resources/key_ring.md +++ b/docs/resources/key_ring.md @@ -106,12 +106,36 @@ EOT { key = "key_0" value = "value_1" + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } ] tags = [ { key = "key_0" value = "value_1" + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } ] } @@ -169,12 +193,36 @@ EOT { key = "key_0" value = "value_1" + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } ] tags = [ { key = "key_0" value = "value_1" + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } ] } @@ -221,20 +269,16 @@ All examples for the Key Ring resource can be found in the [examples](https://gi - Default: `no` - Valid Values: `no`, `yes`. * `certificate_authority` (tp) - (string) The certificate of the Certificate Authority (CA) that issued the certificate provided in the 'certificate' attribute. The CA can be a root CA, an intermediate CA, or a trust anchor in a chain of trust leading to a root CA. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. ## Importing diff --git a/docs/resources/l3out_consumer_label.md b/docs/resources/l3out_consumer_label.md index 81f9b4cee..4f14b6393 100644 --- a/docs/resources/l3out_consumer_label.md +++ b/docs/resources/l3out_consumer_label.md @@ -62,6 +62,18 @@ resource "aci_l3out_consumer_label" "full_example_l3_outside" { { annotation = "annotation_1" target_dn = aci_external_network_instance_profile.example.id + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } ] relation_to_route_control_profiles = [ @@ -69,6 +81,18 @@ resource "aci_l3out_consumer_label" "full_example_l3_outside" { annotation = "annotation_1" direction = "export" target_dn = aci_route_control_profile.example.id + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } ] annotations = [ @@ -114,43 +138,53 @@ All examples for the L3Out Consumer Label resource can be found in the [examples * `owner_tag` (ownerTag) - (string) A tag for enabling clients to add their own data. For example, to indicate who created this object. * `tag` (tag) - (string) Specifies the color of a policy label. - Valid Values: `alice-blue`, `antique-white`, `aqua`, `aquamarine`, `azure`, `beige`, `bisque`, `black`, `blanched-almond`, `blue`, `blue-violet`, `brown`, `burlywood`, `cadet-blue`, `chartreuse`, `chocolate`, `coral`, `cornflower-blue`, `cornsilk`, `crimson`, `cyan`, `dark-blue`, `dark-cyan`, `dark-goldenrod`, `dark-gray`, `dark-green`, `dark-khaki`, `dark-magenta`, `dark-olive-green`, `dark-orange`, `dark-orchid`, `dark-red`, `dark-salmon`, `dark-sea-green`, `dark-slate-blue`, `dark-slate-gray`, `dark-turquoise`, `dark-violet`, `deep-pink`, `deep-sky-blue`, `dim-gray`, `dodger-blue`, `fire-brick`, `floral-white`, `forest-green`, `fuchsia`, `gainsboro`, `ghost-white`, `gold`, `goldenrod`, `gray`, `green`, `green-yellow`, `honeydew`, `hot-pink`, `indian-red`, `indigo`, `ivory`, `khaki`, `lavender`, `lavender-blush`, `lawn-green`, `lemon-chiffon`, `light-blue`, `light-coral`, `light-cyan`, `light-goldenrod-yellow`, `light-gray`, `light-green`, `light-pink`, `light-salmon`, `light-sea-green`, `light-sky-blue`, `light-slate-gray`, `light-steel-blue`, `light-yellow`, `lime`, `lime-green`, `linen`, `magenta`, `maroon`, `medium-aquamarine`, `medium-blue`, `medium-orchid`, `medium-purple`, `medium-sea-green`, `medium-slate-blue`, `medium-spring-green`, `medium-turquoise`, `medium-violet-red`, `midnight-blue`, `mint-cream`, `misty-rose`, `moccasin`, `navajo-white`, `navy`, `old-lace`, `olive`, `olive-drab`, `orange`, `orange-red`, `orchid`, `pale-goldenrod`, `pale-green`, `pale-turquoise`, `pale-violet-red`, `papaya-whip`, `peachpuff`, `peru`, `pink`, `plum`, `powder-blue`, `purple`, `red`, `rosy-brown`, `royal-blue`, `saddle-brown`, `salmon`, `sandy-brown`, `sea-green`, `seashell`, `sienna`, `silver`, `sky-blue`, `slate-blue`, `slate-gray`, `snow`, `spring-green`, `steel-blue`, `tan`, `teal`, `thistle`, `tomato`, `turquoise`, `violet`, `wheat`, `white`, `white-smoke`, `yellow`, `yellow-green`. - * `relation_to_external_epgs` - (list) A list of Relation From L3Out Consumer Label To External EPGs (ACI object [l3extRsLblToInstP](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/l3extRsLblToInstP/overview)) pointing to External EPG (ACI Object [l3extInstP](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/l3extInstP/overview)) which can be configured using the [aci_external_network_instance_profile](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/external_network_instance_profile) resource. This attribute is supported in ACI versions: 5.0(1k) and later. - #### Required #### - * `target_dn` (tDn) - (string) The distinguished name (DN) of the External EPG object. - + * `target_dn` (tDn) - (string) The distinguished name (DN) of the External EPG object. #### Optional #### - * `annotation` (annotation) - (string) The annotation of the Relation From L3Out Consumer Label To External EPG object. + * `annotation` (annotation) - (string) The annotation of the Relation From L3Out Consumer Label To External EPG object. - Default: `orchestrator:terraform` - -* `relation_to_route_control_profiles` - (list) A list of Relation From L3Out Consumer Label To Route Control Profiles (ACI object [l3extRsLblToProfile](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/l3extRsLblToProfile/overview)) pointing to Route Control Profile (ACI Object [rtctrlProfile](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/rtctrlProfile/overview)) which can be configured using the [aci_route_control_profile](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/route_control_profile) resource. This attribute is supported in ACI versions: 5.0(1k) and later. + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. +* `relation_to_route_control_profiles` - (list) A list of Relation From L3Out Consumer Label To Route Control Profiles (ACI object [l3extRsLblToProfile](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/l3extRsLblToProfile/overview)) pointing to Route Control Profile (ACI Object [rtctrlProfile](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/rtctrlProfile/overview)) which can be configured using the [aci_route_control_profile](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/route_control_profile) resource. This attribute is supported in ACI versions: 5.0(1k) and later. #### Required #### - * `direction` (direction) - (string) The connector direction. - * `target_dn` (tDn) - (string) The distinguished name (DN) of the Route Control Profile object. - + * `direction` (direction) - (string) The connector direction. + * `target_dn` (tDn) - (string) The distinguished name (DN) of the Route Control Profile object. #### Optional #### - * `annotation` (annotation) - (string) The annotation of the Relation From L3Out Consumer Label To Route Control Profile object. + * `annotation` (annotation) - (string) The annotation of the Relation From L3Out Consumer Label To Route Control Profile object. - Default: `orchestrator:terraform` - -* `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. +* `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. ## Importing diff --git a/docs/resources/l3out_node_sid_profile.md b/docs/resources/l3out_node_sid_profile.md index 28071a538..7ebc518f6 100644 --- a/docs/resources/l3out_node_sid_profile.md +++ b/docs/resources/l3out_node_sid_profile.md @@ -92,20 +92,16 @@ All examples for the L3Out Node SR-MPLS Segment ID Profile resource can be found * `loopback_address` (loopbackAddr) - (string) The loopback address of the L3Out Node SR-MPLS Segment ID Profile object. * `name` (name) - (string) The name of the L3Out Node SR-MPLS Segment ID Profile object. * `name_alias` (nameAlias) - (string) The name alias of the L3Out Node SR-MPLS Segment ID Profile object. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. ## Importing diff --git a/docs/resources/l3out_provider_label.md b/docs/resources/l3out_provider_label.md index 107b076db..88bf6a0c0 100644 --- a/docs/resources/l3out_provider_label.md +++ b/docs/resources/l3out_provider_label.md @@ -95,20 +95,16 @@ All examples for the L3Out Provider Label resource can be found in the [examples * `owner_tag` (ownerTag) - (string) A tag for enabling clients to add their own data. For example, to indicate who created this object. * `tag` (tag) - (string) Specifies the color of a policy label. - Valid Values: `alice-blue`, `antique-white`, `aqua`, `aquamarine`, `azure`, `beige`, `bisque`, `black`, `blanched-almond`, `blue`, `blue-violet`, `brown`, `burlywood`, `cadet-blue`, `chartreuse`, `chocolate`, `coral`, `cornflower-blue`, `cornsilk`, `crimson`, `cyan`, `dark-blue`, `dark-cyan`, `dark-goldenrod`, `dark-gray`, `dark-green`, `dark-khaki`, `dark-magenta`, `dark-olive-green`, `dark-orange`, `dark-orchid`, `dark-red`, `dark-salmon`, `dark-sea-green`, `dark-slate-blue`, `dark-slate-gray`, `dark-turquoise`, `dark-violet`, `deep-pink`, `deep-sky-blue`, `dim-gray`, `dodger-blue`, `fire-brick`, `floral-white`, `forest-green`, `fuchsia`, `gainsboro`, `ghost-white`, `gold`, `goldenrod`, `gray`, `green`, `green-yellow`, `honeydew`, `hot-pink`, `indian-red`, `indigo`, `ivory`, `khaki`, `lavender`, `lavender-blush`, `lawn-green`, `lemon-chiffon`, `light-blue`, `light-coral`, `light-cyan`, `light-goldenrod-yellow`, `light-gray`, `light-green`, `light-pink`, `light-salmon`, `light-sea-green`, `light-sky-blue`, `light-slate-gray`, `light-steel-blue`, `light-yellow`, `lime`, `lime-green`, `linen`, `magenta`, `maroon`, `medium-aquamarine`, `medium-blue`, `medium-orchid`, `medium-purple`, `medium-sea-green`, `medium-slate-blue`, `medium-spring-green`, `medium-turquoise`, `medium-violet-red`, `midnight-blue`, `mint-cream`, `misty-rose`, `moccasin`, `navajo-white`, `navy`, `old-lace`, `olive`, `olive-drab`, `orange`, `orange-red`, `orchid`, `pale-goldenrod`, `pale-green`, `pale-turquoise`, `pale-violet-red`, `papaya-whip`, `peachpuff`, `peru`, `pink`, `plum`, `powder-blue`, `purple`, `red`, `rosy-brown`, `royal-blue`, `saddle-brown`, `salmon`, `sandy-brown`, `sea-green`, `seashell`, `sienna`, `silver`, `sky-blue`, `slate-blue`, `slate-gray`, `snow`, `spring-green`, `steel-blue`, `tan`, `teal`, `thistle`, `tomato`, `turquoise`, `violet`, `wheat`, `white`, `white-smoke`, `yellow`, `yellow-green`. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. ## Importing diff --git a/docs/resources/l3out_redistribute_policy.md b/docs/resources/l3out_redistribute_policy.md index 9528b3492..9a025597b 100644 --- a/docs/resources/l3out_redistribute_policy.md +++ b/docs/resources/l3out_redistribute_policy.md @@ -88,20 +88,16 @@ All examples for the L3Out Redistribute Policy resource can be found in the [exa * `annotation` (annotation) - (string) The annotation of the L3Out Redistribute Policy object. - Default: `orchestrator:terraform` - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. ## Importing diff --git a/docs/resources/management_access_policy.md b/docs/resources/management_access_policy.md new file mode 100644 index 000000000..647f5eae0 --- /dev/null +++ b/docs/resources/management_access_policy.md @@ -0,0 +1,524 @@ +--- +# Documentation generated by "gen/generator.go"; DO NOT EDIT. +# In order to regenerate this file execute `go generate` from the repository root. +# More details can be found in the [README](https://github.com/CiscoDevNet/terraform-provider-aci/blob/master/README.md). +subcategory: "Generic" +layout: "aci" +page_title: "ACI: aci_management_access_policy" +sidebar_current: "docs-aci-resource-aci_management_access_policy" +description: |- + Manages ACI Management Access Policy +--- + +# aci_management_access_policy # + +Manages ACI Management Access Policy + + + +## API Information ## + +* Class: [commPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/commPol/overview) + +* Supported in ACI versions: 1.0(1e) and later. + +* Distinguished Name Format: `uni/fabric/comm-{name}` + +## GUI Information ## + +* Location: `Fabric -> Fabric Policies -> Policies -> Pod -> Management Access` + +## Example Usage ## + +The configuration snippet below creates a Management Access Policy with only required attributes. + +```hcl + +resource "aci_management_access_policy" "example" { + name = "test_name" +} + +``` +The configuration snippet below shows all possible attributes of the Management Access Policy. + +!> This example might not be valid configuration and is only used to show all possible attributes. + +```hcl + +resource "aci_management_access_policy" "full_example" { + annotation = "annotation" + description = "description_1" + name = "test_name" + name_alias = "name_alias_1" + owner_key = "owner_key_1" + owner_tag = "owner_tag_1" + strict_security_on_apic_oob_subnet = "no" + http_service = { + access_control_allow_credential = "disabled" + access_control_allow_origins = "access_control_allow_origins_1" + admin_state = "disabled" + annotation = "annotation_1" + cli_only_mode = "disabled" + description = "description_1" + global_throttle_rate = "10000" + global_throttle_state = "disabled" + global_throttle_unit = "r/s" + max_request_status_count = "0" + name = "name_1" + name_alias = "name_alias_1" + node_exporter = "disabled" + port = "80" + redirect_state = "disabled" + server_header = "disabled" + throttle_rate = "2" + throttle_state = "disabled" + visore_access = "disabled" + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] + } + http_ssl_configuration = { + access_control_allow_credential = "disabled" + access_control_allow_origins = "access_control_allow_origins_1" + admin_state = "enabled" + annotation = "annotation_1" + cli_only_mode = "disabled" + client_cert_auth_state = "disabled" + description = "description_1" + dh_param = "1024" + global_throttle_rate = "10000" + global_throttle_state = "disabled" + global_throttle_unit = "r/s" + max_request_status_count = "0" + name = "name_1" + name_alias = "name_alias_1" + node_exporter = "disabled" + port = "443" + referer = "referer_1" + server_header = "disabled" + ssl_protocols = ["TLSv1"] + throttle_rate = "2" + throttle_state = "disabled" + visore_access = "disabled" + certificate_authority = { + annotation = "annotation_1" + target_dn = "uni/userext/pkiext/tp-test_name" + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] + } + key_ring = { + annotation = "annotation_1" + key_ring_name = aci_key_ring.example.name + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] + } + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] + } + ssh_access_via_web = { + admin_state = "disabled" + annotation = "annotation_1" + description = "description_1" + name = "name_1" + name_alias = "name_alias_1" + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] + } + ssh_service = { + admin_state = "disabled" + annotation = "annotation_1" + description = "description_1" + host_key_algorithms = ["rsa-sha2-256"] + key_exchange_algorithms = ["curve25519-sha256"] + name = "name_1" + name_alias = "name_alias_1" + password_auth = "disabled" + port = "22" + ssh_ciphers = ["aes192-ctr"] + ssh_macs = ["hmac-sha1"] + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] + } + telnet_service = { + admin_state = "disabled" + annotation = "annotation_1" + description = "description_1" + name = "name_1" + name_alias = "name_alias_1" + port = "23" + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] + } + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] +} + +``` + +All examples for the Management Access Policy resource can be found in the [examples](https://github.com/CiscoDevNet/terraform-provider-aci/tree/master/examples/resources/aci_management_access_policy) folder. + +## Schema ## + +### Required ### + +* `name` (name) - (string) The name of the Management Access Policy object. + +### Read-Only ### + +* `id` - (string) The distinguished name (DN) of the Management Access Policy object. + +### Optional ### + +* `annotation` (annotation) - (string) The annotation of the Management Access Policy object. + - Default: `orchestrator:terraform` +* `description` (descr) - (string) The description of the Management Access Policy object. +* `name_alias` (nameAlias) - (string) The name alias of the Management Access Policy object. +* `owner_key` (ownerKey) - (string) The key for enabling clients to own their data for entity correlation. +* `owner_tag` (ownerTag) - (string) A tag for enabling clients to add their own data. For example, to indicate who created this object. +* `strict_security_on_apic_oob_subnet` (strictSecurityOnApicOOBSubnet) - (string) Removes implicit access permissions from any APIC out-of-band (OOB) subnet IP address. + - Default: `false` + - Valid Values: `no`, `yes`. +* `http_service` - (map) A map of HTTP (Hypertext Transfer Protocol) Service (ACI object [commHttp](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/commHttp/overview)). + #### Optional #### + + * `access_control_allow_credential` (accessControlAllowCredential) - (string) Determines if credentials are allowed in HTTP (Hypertext Transfer Protocol) responses. + - Default: `disabled` + - Valid Values: `disabled`, `enabled`. + * `access_control_allow_origins` (accessControlAllowOrigins) - (string) Determines which origins can access the resource. For example, inputting http://127.0.0.1:8000 would allow access from a source device with that IP address and port. + * `admin_state` (adminSt) - (string) The administrative state of the HTTP (Hypertext Transfer Protocol) Service. + - Default: `disabled` + - Valid Values: `disabled`, `enabled`. + * `annotation` (annotation) - (string) The annotation of the HTTP (Hypertext Transfer Protocol) Service object. + - Default: `orchestrator:terraform` + * `cli_only_mode` (cliOnlyMode) - (string) Determines if CLI-only mode is enabled. + - Default: `disabled` + - Valid Values: `disabled`, `enabled`. + * `description` (descr) - (string) The description of the HTTP (Hypertext Transfer Protocol) Service object. + * `global_throttle_rate` (globalThrottleRate) - (string) Maximum API calls allowed per unit time. + - Default: `10000` + * `global_throttle_state` (globalThrottleSt) - (string) The throttle state for all clients without specific identifier in their headers. + - Default: `disabled` + - Valid Values: `disabled`, `enabled`. + * `global_throttle_unit` (globalThrottleUnit) - (string) The unit of measurement for rate limiting. + - Default: `r/s` + * `max_request_status_count` (maxRequestStatusCount) - (string) The maximum number of request status objects to keep. + * `name` (name) - (string) The name of the HTTP (Hypertext Transfer Protocol) Service object. + - Default: `http` + * `name_alias` (nameAlias) - (string) The name alias of the HTTP (Hypertext Transfer Protocol) Service object. + * `node_exporter` (nodeExporter) - (string) Node Exporter service status. + - Default: `disabled` + - Valid Values: `disabled`, `enabled`. + * `port` (port) - (string) The port used for HTTP communication service. + - Default: `80` + * `redirect_state` (redirectSt) - (string) The state of HTTP (Hypertext Transfer Protocol) communication service. + - Default: `disabled` + - Valid Values: `disabled`, `enabled`, `tested`. + * `server_header` (serverHeader) - (string) Determines if the server header is included in responses. + - Default: `enabled` + - Valid Values: `disabled`, `enabled`. + * `throttle_rate` (throttleRate) - (string) The maximum login/refresh allowed per second. + - Default: `2` + * `throttle_state` (throttleSt) - (string) The state of login and refresh throttling. + - Default: `enabled` + - Valid Values: `disabled`, `enabled`. + * `visore_access` (visoreAccess) - (string) Grants permissions for accessing the Visore tool in Cisco ACI. + - Default: `enabled` + - Valid Values: `disabled`, `enabled`. + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. +* `http_ssl_configuration` - (map) A map of HTTP (Hypertext Transfer Protocol) SSL (Secure Sockets Layer) Configuration (ACI object [commHttps](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/commHttps/overview)). + #### Optional #### + + * `access_control_allow_credential` (accessControlAllowCredential) - (string) Determines if credentials are allowed in HTTP (Hypertext Transfer Protocol) SSL (Secure Sockets Layer) responses. + - Default: `disabled` + - Valid Values: `disabled`, `enabled`. + * `access_control_allow_origins` (accessControlAllowOrigins) - (string) Determines which origins can access the resource. For example, inputting http://127.0.0.1:8000 would allow access from a source device with that IP address and port. + * `admin_state` (adminSt) - (string) The administrative state of the HTTP (Hypertext Transfer Protocol) SSL (Secure Sockets Layer) Service. + - Default: `enabled` + - Valid Values: `enabled`. + * `annotation` (annotation) - (string) The annotation of the HTTP (Hypertext Transfer Protocol) SSL (Secure Sockets Layer) Configuration object. + - Default: `orchestrator:terraform` + * `cli_only_mode` (cliOnlyMode) - (string) Determines if CLI-only mode is enabled. + - Default: `disabled` + - Valid Values: `disabled`, `enabled`. + * `client_cert_auth_state` (clientCertAuthState) - (string) State of client certificate authentication. + - Default: `disabled` + - Valid Values: `disabled`, `enabled`. + * `description` (descr) - (string) The description of the HTTP (Hypertext Transfer Protocol) SSL (Secure Sockets Layer) Configuration object. + * `dh_param` (dhParam) - (string) Determines the settings for DH (Diffie-Hellman) parameters. + - Default: `none` + - Valid Values: `1024`, `2048`, `4096`, `none`. + * `global_throttle_rate` (globalThrottleRate) - (string) Maximum API calls allowed per unit time. + - Default: `10000` + * `global_throttle_state` (globalThrottleSt) - (string) The throttle state for all clients without specific identifier in their headers. + - Default: `disabled` + - Valid Values: `disabled`, `enabled`. + * `global_throttle_unit` (globalThrottleUnit) - (string) The unit of measurement for rate limiting. + - Default: `r/s` + * `max_request_status_count` (maxRequestStatusCount) - (string) The maximum number of request status objects to keep. + * `name` (name) - (string) The name of the HTTP (Hypertext Transfer Protocol) SSL (Secure Sockets Layer) Configuration object. + - Default: `https` + * `name_alias` (nameAlias) - (string) The name alias of the HTTP (Hypertext Transfer Protocol) SSL (Secure Sockets Layer) Configuration object. + * `node_exporter` (nodeExporter) - (string) Node Exporter service status. + - Default: `disabled` + - Valid Values: `disabled`, `enabled`. + * `port` (port) - (string) The port used for HTTPS communication service. + - Default: `443` + * `referer` (referer) - (string) Allowed HTTP referers. + * `server_header` (serverHeader) - (string) Determines if the server header is included in responses. + - Default: `enabled` + - Valid Values: `disabled`, `enabled`. + * `ssl_protocols` (sslProtocols) - (list) The Secure Socket Layer (SSL) protocol. + - Default: `TLSv1.1,TLSv1.2` + - Valid Values: `TLSv1`, `TLSv1.1`, `TLSv1.2`, `TLSv1.3`. + * `throttle_rate` (throttleRate) - (string) The maximum login/refresh allowed per second. + - Default: `2` + * `throttle_state` (throttleSt) - (string) The state of login and refresh throttling. + - Default: `enabled` + - Valid Values: `disabled`, `enabled`. + * `visore_access` (visoreAccess) - (string) Grants permissions for accessing the Visore tool in Cisco ACI. + - Default: `enabled` + - Valid Values: `disabled`, `enabled`. + * `certificate_authority` - (map) A map of Certificate Authority (ACI object [commRsClientCertCA](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/commRsClientCertCA/overview)) pointing to Certificate Authority (ACI Object [pkiTP](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/pkiTP/overview)) which can be configured using the [aci_certificate_authority](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/certificate_authority) resource. This attribute is supported in ACI versions: 4.0(1h) and later. + #### Optional #### + + * `annotation` (annotation) - (string) The annotation of the Certificate Authority object. + - Default: `orchestrator:terraform` + * `target_dn` (tDn) - (string) The distinguished name of the target. + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `key_ring` - (map) A map of Key Ring (ACI object [commRsKeyRing](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/commRsKeyRing/overview)) pointing to Key Ring (ACI Object [pkiKeyRing](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/pkiKeyRing/overview)) which can be configured using the [aci_key_ring](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/key_ring) resource. + #### Optional #### + + * `annotation` (annotation) - (string) The annotation of the Key Ring object. + - Default: `orchestrator:terraform` + * `key_ring_name` (tnPkiKeyRingName) - (string) The HTTP connection key ring. Each PKI device holds a pair of asymmetric Rivest-Shamir-Adleman (RSA) or Elliptic Curve Cryptography (ECC) encryption keys, one kept private and one made public, stored in an internal key ring. + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. +* `ssh_access_via_web` - (map) A map of SSH (Secure Shell) access via WEB (ACI object [commShellinabox](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/commShellinabox/overview)). This attribute is supported in ACI versions: 1.2(1i) and later. + #### Optional #### + + * `admin_state` (adminSt) - (string) The administrative state of the SSH (Secure Shell) access via WEB object. + - Default: `disabled` + - Valid Values: `disabled`, `enabled`. + * `annotation` (annotation) - (string) The annotation of the SSH (Secure Shell) access via WEB object. + - Default: `orchestrator:terraform` + * `description` (descr) - (string) The description of the SSH (Secure Shell) access via WEB object. + - Default: `Shellinabox server` + * `name` (name) - (string) The name of the SSH (Secure Shell) access via WEB object. + - Default: `shellinabox` + * `name_alias` (nameAlias) - (string) The name alias of the SSH (Secure Shell) access via WEB object. + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. +* `ssh_service` - (map) A map of SSH (Secure Shell) Service (ACI object [commSsh](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/commSsh/overview)). + #### Optional #### + + * `admin_state` (adminSt) - (string) The administrative state of the SSH (Secure Shell) Service object. + - Default: `enabled` + - Valid Values: `disabled`, `enabled`. + * `annotation` (annotation) - (string) The annotation of the SSH (Secure Shell) Service object. + - Default: `orchestrator:terraform` + * `description` (descr) - (string) The description of the SSH (Secure Shell) Service object. + * `host_key_algorithms` (hostkeyAlgos) - (list) The supported algorithms for the host key. + - Default: `rsa-sha2-256,rsa-sha2-512,ssh-ed25519` + - Valid Values: `rsa-sha2-256`, `rsa-sha2-512`, `ssh-ed25519`. + * `key_exchange_algorithms` (kexAlgos) - (list) The supported algorithms for key exchange. + - Default: `diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,curve25519-sha256@libssh.org,ecdh-sha2-nistp521,ecdh-sha2-nistp384,ecdh-sha2-nistp256,curve25519-sha256` + - Valid Values: `curve25519-sha256`, `curve25519-sha256@libssh.org`, `diffie-hellman-group1-sha1`, `diffie-hellman-group14-sha1`, `diffie-hellman-group14-sha256`, `diffie-hellman-group16-sha512`, `ecdh-sha2-nistp256`, `ecdh-sha2-nistp384`, `ecdh-sha2-nistp521`. + * `name` (name) - (string) The name of the SSH (Secure Shell) Service object. + - Default: `ssh` + * `name_alias` (nameAlias) - (string) The name alias of the SSH (Secure Shell) Service object. + * `password_auth` (passwordAuth) - (string) State of password authentication. + - Default: `enabled` + - Valid Values: `disabled`, `enabled`. + * `port` (port) - (string) The SSH port. + - Default: `22` + * `ssh_ciphers` (sshCiphers) - (list) Ciphers supported for SSH. + - Default: `aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,chacha20-poly1305@openssh.com` + - Valid Values: `aes128-ctr`, `aes128-gcm@openssh.com`, `aes192-ctr`, `aes256-ctr`, `aes256-gcm@openssh.com`, `chacha20-poly1305@openssh.com`. + * `ssh_macs` (sshMacs) - (list) Message authentication codes (MACs) supported for SSH. + - Default: `hmac-sha2-256,hmac-sha2-512,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com` + - Valid Values: `hmac-sha1`, `hmac-sha2-256`, `hmac-sha2-256-etm@openssh.com`, `hmac-sha2-512`, `hmac-sha2-512-etm@openssh.com`. + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. +* `telnet_service` - (map) A map of Telnet Service (ACI object [commTelnet](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/commTelnet/overview)). + #### Optional #### + + * `admin_state` (adminSt) - (string) The administrative state of the Telnet Service object. + - Default: `disabled` + - Valid Values: `disabled`, `enabled`. + * `annotation` (annotation) - (string) The annotation of the Telnet Service object. + - Default: `orchestrator:terraform` + * `description` (descr) - (string) The description of the Telnet Service object. + * `name` (name) - (string) The name of the Telnet Service object. + - Default: `telnet` + * `name_alias` (nameAlias) - (string) The name alias of the Telnet Service object. + * `port` (port) - (string) The port used for Telnet communication service. + - Default: `23` + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. +* `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. +* `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + +## Importing + +An existing Management Access Policy can be [imported](https://www.terraform.io/docs/import/index.html) into this resource with its distinguished name (DN), via the following command: + +``` +terraform import aci_management_access_policy.example uni/fabric/comm-{name} +``` + +Starting in Terraform version 1.5, an existing Management Access Policy can be imported +using [import blocks](https://developer.hashicorp.com/terraform/language/import) via the following configuration: + +``` +import { + id = "uni/fabric/comm-{name}" + to = aci_management_access_policy.example +} +``` diff --git a/docs/resources/mld_snooping_policy.md b/docs/resources/mld_snooping_policy.md index 315dab06c..8f01f4d19 100644 --- a/docs/resources/mld_snooping_policy.md +++ b/docs/resources/mld_snooping_policy.md @@ -120,20 +120,16 @@ All examples for the MLD Snooping Policy resource can be found in the [examples] * `version` (ver) - (string) The MLD version. - Default: `v2` - Valid Values: `unspecified`, `v1`, `v2`. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. ## Importing diff --git a/docs/resources/neighbor_discovery_interface_policy.md b/docs/resources/neighbor_discovery_interface_policy.md index c568f5af2..703edab3e 100644 --- a/docs/resources/neighbor_discovery_interface_policy.md +++ b/docs/resources/neighbor_discovery_interface_policy.md @@ -129,20 +129,16 @@ All examples for the Neighbor Discovery Interface Policy resource can be found i - Default: `0` * `retransmit_timer` (retransTimer) - (string) The retransmission time (milliseconds) for sending neighbor solicitation messages. - Default: `0` - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. ## Importing diff --git a/docs/resources/netflow_exporter_policy.md b/docs/resources/netflow_exporter_policy.md index cfe4486cc..74cdd9e55 100644 --- a/docs/resources/netflow_exporter_policy.md +++ b/docs/resources/netflow_exporter_policy.md @@ -69,10 +69,34 @@ resource "aci_netflow_exporter_policy" "full_example_tenant" { relation_to_vrf = { annotation = "annotation_1" target_dn = aci_vrf.example.id + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } relation_to_epg = { annotation = "annotation_1" target_dn = aci_application_epg.example.id + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } annotations = [ { @@ -133,42 +157,52 @@ All examples for the NetFlow Exporter Policy resource can be found in the [examp * `version` (ver) - (string) The NetFlow Exporter Version of the NetFlow Exporter Policy object. - Default: `v9` - Valid Values: `cisco-v1`, `v5`, `v9`. - * `relation_to_vrf` - (map) A map of Relation From NetFlow Exporter To VRF (ACI object [netflowRsExporterToCtx](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/netflowRsExporterToCtx/overview)) pointing to VRF (ACI Object [fvCtx](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvCtx/overview)) which can be configured using the [aci_vrf](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/vrf) resource. - - #### Optional #### - * `annotation` (annotation) - (string) The annotation of the Relation From NetFlow Exporter To VRF object. + * `annotation` (annotation) - (string) The annotation of the Relation From NetFlow Exporter To VRF object. - Default: `orchestrator:terraform` - * `target_dn` (tDn) - (string) The distinguished name of the target. - + * `target_dn` (tDn) - (string) The distinguished name of the target. + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `relation_to_epg` - (list) A list of Relation From NetFlow Exporter To EPG (ACI object [netflowRsExporterToEPg](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/netflowRsExporterToEPg/overview)). This relation can point to multiple ACI objects: - [fvAEPg](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvAEPg/overview) which can be configured using the [aci_application_epg](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/application_epg) resource. - [l3extInstP](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/l3extInstP/overview) which can be configured using the [aci_external_network_instance_profile](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/external_network_instance_profile) resource. - [l2extInstP](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/l2extInstP/overview) which can be configured using the [aci_l2out_extepg](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/l2out_extepg) resource. - - #### Optional #### - * `annotation` (annotation) - (string) The annotation of the Relation From NetFlow Exporter To EPG object. + * `annotation` (annotation) - (string) The annotation of the Relation From NetFlow Exporter To EPG object. - Default: `orchestrator:terraform` - * `target_dn` (tDn) - (string) The distinguished name of the target. - -* `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + * `target_dn` (tDn) - (string) The distinguished name of the target. + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. +* `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. ## Importing diff --git a/docs/resources/netflow_monitor_policy.md b/docs/resources/netflow_monitor_policy.md index 46af0d7ff..33b176bb2 100644 --- a/docs/resources/netflow_monitor_policy.md +++ b/docs/resources/netflow_monitor_policy.md @@ -62,11 +62,35 @@ resource "aci_netflow_monitor_policy" "full_example_tenant" { { annotation = "annotation_1" netflow_exporter_policy_name = aci_netflow_exporter_policy.example.name + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } ] relation_to_netflow_record = { annotation = "annotation_1" netflow_record_policy_name = aci_netflow_record_policy.example.name + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } annotations = [ { @@ -110,40 +134,50 @@ All examples for the NetFlow Monitor Policy resource can be found in the [exampl * `name_alias` (nameAlias) - (string) The name alias of the NetFlow Monitor Policy object. * `owner_key` (ownerKey) - (string) The key for enabling clients to own their data for entity correlation. * `owner_tag` (ownerTag) - (string) A tag for enabling clients to add their own data. For example, to indicate who created this object. - * `relation_to_netflow_exporters` - (list) A list of Relation To NetFlow Exporters (ACI object [netflowRsMonitorToExporter](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/netflowRsMonitorToExporter/overview)) pointing to NetFlow Exporter Policy (ACI Object [netflowExporterPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/netflowExporterPol/overview)) which can be configured using the [aci_netflow_exporter_policy](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/netflow_exporter_policy) resource. - #### Required #### - * `netflow_exporter_policy_name` (tnNetflowExporterPolName) - (string) Name. This attribute can be referenced from a [resource](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/netflow_exporter_policy) with `aci_netflow_exporter_policy.example.name` or from a [datasource](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/data-sources/netflow_exporter_policy) with `data.aci_netflow_exporter_policy.example.name`. - + * `netflow_exporter_policy_name` (tnNetflowExporterPolName) - (string) Name. This attribute can be referenced from a [resource](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/netflow_exporter_policy) with `aci_netflow_exporter_policy.example.name` or from a [datasource](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/data-sources/netflow_exporter_policy) with `data.aci_netflow_exporter_policy.example.name`. #### Optional #### - * `annotation` (annotation) - (string) The annotation of the Relation To NetFlow Exporter object. + * `annotation` (annotation) - (string) The annotation of the Relation To NetFlow Exporter object. - Default: `orchestrator:terraform` - -* `relation_to_netflow_record` - (map) A map of Relation To NetFlow Record (ACI object [netflowRsMonitorToRecord](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/netflowRsMonitorToRecord/overview)) pointing to NetFlow Record Policy (ACI Object [netflowRecordPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/netflowRecordPol/overview)) which can be configured using the [aci_netflow_record_policy](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/netflow_record_policy) resource. + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. +* `relation_to_netflow_record` - (map) A map of Relation To NetFlow Record (ACI object [netflowRsMonitorToRecord](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/netflowRsMonitorToRecord/overview)) pointing to NetFlow Record Policy (ACI Object [netflowRecordPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/netflowRecordPol/overview)) which can be configured using the [aci_netflow_record_policy](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/netflow_record_policy) resource. #### Optional #### - * `annotation` (annotation) - (string) The annotation of the Relation To NetFlow Record object. + * `annotation` (annotation) - (string) The annotation of the Relation To NetFlow Record object. - Default: `orchestrator:terraform` - * `netflow_record_policy_name` (tnNetflowRecordPolName) - (string) Name. - -* `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + * `netflow_record_policy_name` (tnNetflowRecordPolName) - (string) Name. + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. +* `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. ## Importing diff --git a/docs/resources/netflow_record_policy.md b/docs/resources/netflow_record_policy.md index cf08bf9c6..489414bd7 100644 --- a/docs/resources/netflow_record_policy.md +++ b/docs/resources/netflow_record_policy.md @@ -108,20 +108,16 @@ All examples for the NetFlow Record Policy resource can be found in the [example * `name_alias` (nameAlias) - (string) The name alias of the NetFlow Record Policy object. * `owner_key` (ownerKey) - (string) The key for enabling clients to own their data for entity correlation. * `owner_tag` (ownerTag) - (string) A tag for enabling clients to add their own data. For example, to indicate who created this object. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. ## Importing diff --git a/docs/resources/out_of_band_contract.md b/docs/resources/out_of_band_contract.md index 3b7685214..53982e962 100644 --- a/docs/resources/out_of_band_contract.md +++ b/docs/resources/out_of_band_contract.md @@ -108,20 +108,16 @@ All examples for the Out Of Band Contract resource can be found in the [examples - Valid Values: * `AF11`, `AF12`, `AF13`, `AF21`, `AF22`, `AF23`, `AF31`, `AF32`, `AF33`, `AF41`, `AF42`, `AF43`, `CS0`, `CS1`, `CS2`, `CS3`, `CS4`, `CS5`, `CS6`, `CS7`, `EF`, `VA`, `unspecified`. * Or a value in the range of `0` to `64`. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. ## Importing diff --git a/docs/resources/pim_route_map_entry.md b/docs/resources/pim_route_map_entry.md index 243cb3ede..ffe2f9ecb 100644 --- a/docs/resources/pim_route_map_entry.md +++ b/docs/resources/pim_route_map_entry.md @@ -100,20 +100,16 @@ All examples for the Pim Route Map Entry resource can be found in the [examples] * `name_alias` (nameAlias) - (string) The name alias of the Pim Route Map Entry object. * `rendezvous_point_ip` (rp) - (string) The rendezvous point ip of the Pim Route Map Entry object. * `source_ip` (src) - (string) The source ip of the Pim Route Map Entry object. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. ## Importing diff --git a/docs/resources/pim_route_map_policy.md b/docs/resources/pim_route_map_policy.md index eb90cc683..7b278bc6b 100644 --- a/docs/resources/pim_route_map_policy.md +++ b/docs/resources/pim_route_map_policy.md @@ -92,20 +92,16 @@ All examples for the Pim Route Map Policy resource can be found in the [examples * `name_alias` (nameAlias) - (string) The name alias of the Pim Route Map Policy object. * `owner_key` (ownerKey) - (string) The key for enabling clients to own their data for entity correlation. * `owner_tag` (ownerTag) - (string) A tag for enabling clients to add their own data. For example, to indicate who created this object. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. ## Importing diff --git a/docs/resources/relation_from_bridge_domain_to_l3_outside.md b/docs/resources/relation_from_bridge_domain_to_l3_outside.md index 9555f1b9f..737875907 100644 --- a/docs/resources/relation_from_bridge_domain_to_l3_outside.md +++ b/docs/resources/relation_from_bridge_domain_to_l3_outside.md @@ -90,20 +90,16 @@ All examples for the Relation From Bridge Domain To L3 Outside resource can be f * `annotation` (annotation) - (string) The annotation of the Relation From Bridge Domain To L3 Outside object. - Default: `orchestrator:terraform` - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. ## Importing diff --git a/docs/resources/relation_from_bridge_domain_to_netflow_monitor_policy.md b/docs/resources/relation_from_bridge_domain_to_netflow_monitor_policy.md index dc88d95d6..438d52a82 100644 --- a/docs/resources/relation_from_bridge_domain_to_netflow_monitor_policy.md +++ b/docs/resources/relation_from_bridge_domain_to_netflow_monitor_policy.md @@ -94,20 +94,16 @@ All examples for the Relation From Bridge Domain To NetFlow Monitor Policy resou * `annotation` (annotation) - (string) The annotation of the Relation From Bridge Domain To NetFlow Monitor Policy object. - Default: `orchestrator:terraform` - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. ## Importing diff --git a/docs/resources/relation_from_l3out_consumer_label_to_external_epg.md b/docs/resources/relation_from_l3out_consumer_label_to_external_epg.md index aa966c7a2..dfeb5a356 100644 --- a/docs/resources/relation_from_l3out_consumer_label_to_external_epg.md +++ b/docs/resources/relation_from_l3out_consumer_label_to_external_epg.md @@ -88,20 +88,16 @@ All examples for the Relation From L3Out Consumer Label To External EPG resource * `annotation` (annotation) - (string) The annotation of the Relation From L3Out Consumer Label To External EPG object. - Default: `orchestrator:terraform` - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. ## Importing diff --git a/docs/resources/relation_from_l3out_consumer_label_to_route_control_profile.md b/docs/resources/relation_from_l3out_consumer_label_to_route_control_profile.md index a89cc4841..0fedb6f4a 100644 --- a/docs/resources/relation_from_l3out_consumer_label_to_route_control_profile.md +++ b/docs/resources/relation_from_l3out_consumer_label_to_route_control_profile.md @@ -92,20 +92,16 @@ All examples for the Relation From L3Out Consumer Label To Route Control Profile * `annotation` (annotation) - (string) The annotation of the Relation From L3Out Consumer Label To Route Control Profile object. - Default: `orchestrator:terraform` - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. ## Importing diff --git a/docs/resources/relation_to_consumed_contract.md b/docs/resources/relation_to_consumed_contract.md index 12aa93f9f..8e07059c9 100644 --- a/docs/resources/relation_to_consumed_contract.md +++ b/docs/resources/relation_to_consumed_contract.md @@ -142,20 +142,16 @@ All examples for the Relation To Consumed Contract resource can be found in the * `priority` (prio) - (string) The Quality of Service (QoS) priority class ID. QoS refers to the capability of a network to provide better service to selected network traffic over various technologies. The primary goal of QoS is to provide priority including dedicated bandwidth, controlled jitter and latency (required by some real-time and interactive traffic), and improved loss characteristics. You can configure the bandwidth of each QoS level using QoS profiles. - Default: `unspecified` - Valid Values: `level1`, `level2`, `level3`, `level4`, `level5`, `level6`, `unspecified`. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. ## Importing diff --git a/docs/resources/relation_to_consumed_out_of_band_contract.md b/docs/resources/relation_to_consumed_out_of_band_contract.md index bafff1882..a83be8d21 100644 --- a/docs/resources/relation_to_consumed_out_of_band_contract.md +++ b/docs/resources/relation_to_consumed_out_of_band_contract.md @@ -88,20 +88,16 @@ All examples for the Relation To Consumed Out Of Band Contract resource can be f * `priority` (prio) - (string) The Quality of Service (QoS) priority class ID. QoS refers to the capability of a network to provide better service to selected network traffic over various technologies. The primary goal of QoS is to provide priority including dedicated bandwidth, controlled jitter and latency (required by some real-time and interactive traffic), and improved loss characteristics. You can configure the bandwidth of each QoS level using QoS profiles. - Default: `unspecified` - Valid Values: `level1`, `level2`, `level3`, `level4`, `level5`, `level6`, `unspecified`. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. ## Importing diff --git a/docs/resources/relation_to_contract_master.md b/docs/resources/relation_to_contract_master.md index 7237a01f0..2c19c0244 100644 --- a/docs/resources/relation_to_contract_master.md +++ b/docs/resources/relation_to_contract_master.md @@ -137,20 +137,16 @@ All examples for the Relation To Contract Master resource can be found in the [e * `annotation` (annotation) - (string) The annotation of the Relation To Contract Master object. - Default: `orchestrator:terraform` - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. ## Importing diff --git a/docs/resources/relation_to_domain.md b/docs/resources/relation_to_domain.md index 9c88e4ff8..3feae58e3 100644 --- a/docs/resources/relation_to_domain.md +++ b/docs/resources/relation_to_domain.md @@ -156,20 +156,16 @@ All examples for the Relation To Domain resource can be found in the [examples]( * `untagged` (untagged) - (string) The untagged status of the Relation To Domain object. - Default: `no` - Valid Values: `no`, `yes`. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. ## Importing diff --git a/docs/resources/relation_to_fibre_channel_path.md b/docs/resources/relation_to_fibre_channel_path.md index 8132e13f8..de519a855 100644 --- a/docs/resources/relation_to_fibre_channel_path.md +++ b/docs/resources/relation_to_fibre_channel_path.md @@ -93,20 +93,16 @@ All examples for the Relation To Fibre Channel Path resource can be found in the * `vsan_mode` (vsanMode) - (string) The virtual storage area network (VSAN) mode of the Relation To Fibre Channel Path object. - Default: `regular` - Valid Values: `native`, `regular`. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. ## Importing diff --git a/docs/resources/relation_to_imported_contract.md b/docs/resources/relation_to_imported_contract.md index a0c8febba..59bfd865f 100644 --- a/docs/resources/relation_to_imported_contract.md +++ b/docs/resources/relation_to_imported_contract.md @@ -142,20 +142,16 @@ All examples for the Relation To Imported Contract resource can be found in the * `priority` (prio) - (string) The Quality of Service (QoS) priority class ID. QoS refers to the capability of a network to provide better service to selected network traffic over various technologies. The primary goal of QoS is to provide priority including dedicated bandwidth, controlled jitter and latency (required by some real-time and interactive traffic), and improved loss characteristics. You can configure the bandwidth of each QoS level using QoS profiles. - Default: `unspecified` - Valid Values: `level1`, `level2`, `level3`, `level4`, `level5`, `level6`, `unspecified`. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. ## Importing diff --git a/docs/resources/relation_to_intra_epg_contract.md b/docs/resources/relation_to_intra_epg_contract.md index 906fa314e..42388f069 100644 --- a/docs/resources/relation_to_intra_epg_contract.md +++ b/docs/resources/relation_to_intra_epg_contract.md @@ -135,20 +135,16 @@ All examples for the Relation To Intra EPG Contract resource can be found in the * `annotation` (annotation) - (string) The annotation of the Relation To Intra EPG Contract object. - Default: `orchestrator:terraform` - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. ## Importing diff --git a/docs/resources/relation_to_netflow_exporter.md b/docs/resources/relation_to_netflow_exporter.md index 6fae9ae09..a0ef2f60f 100644 --- a/docs/resources/relation_to_netflow_exporter.md +++ b/docs/resources/relation_to_netflow_exporter.md @@ -88,20 +88,16 @@ All examples for the Relation To NetFlow Exporter resource can be found in the [ * `annotation` (annotation) - (string) The annotation of the Relation To NetFlow Exporter object. - Default: `orchestrator:terraform` - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. ## Importing diff --git a/docs/resources/relation_to_provided_contract.md b/docs/resources/relation_to_provided_contract.md index 65be9158f..fef8994fd 100644 --- a/docs/resources/relation_to_provided_contract.md +++ b/docs/resources/relation_to_provided_contract.md @@ -147,20 +147,16 @@ All examples for the Relation To Provided Contract resource can be found in the * `priority` (prio) - (string) The Quality of Service (QoS) priority class ID. QoS refers to the capability of a network to provide better service to selected network traffic over various technologies. The primary goal of QoS is to provide priority including dedicated bandwidth, controlled jitter and latency (required by some real-time and interactive traffic), and improved loss characteristics. You can configure the bandwidth of each QoS level using QoS profiles. - Default: `unspecified` - Valid Values: `level1`, `level2`, `level3`, `level4`, `level5`, `level6`, `unspecified`. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. ## Importing diff --git a/docs/resources/relation_to_static_leaf.md b/docs/resources/relation_to_static_leaf.md index 47e384f2b..8246a3f31 100644 --- a/docs/resources/relation_to_static_leaf.md +++ b/docs/resources/relation_to_static_leaf.md @@ -97,20 +97,16 @@ All examples for the Relation To Static Leaf resource can be found in the [examp * `mode` (mode) - (string) The static association mode with the path of the Relation To Static Leaf object. - Default: `regular` - Valid Values: `native`, `regular`, `untagged`. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. ## Importing diff --git a/docs/resources/relation_to_static_path.md b/docs/resources/relation_to_static_path.md index d0702aa14..50a096f51 100644 --- a/docs/resources/relation_to_static_path.md +++ b/docs/resources/relation_to_static_path.md @@ -99,20 +99,16 @@ All examples for the Relation To Static Path resource can be found in the [examp - Default: `regular` - Valid Values: `native`, `regular`, `untagged`. * `primary_encapsulation` (primaryEncap) - (string) The primary VLAN encapsulation of the Relation To Static Path object. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. ## Importing diff --git a/docs/resources/relation_to_taboo_contract.md b/docs/resources/relation_to_taboo_contract.md index 915a49b05..11f322dd5 100644 --- a/docs/resources/relation_to_taboo_contract.md +++ b/docs/resources/relation_to_taboo_contract.md @@ -112,20 +112,16 @@ All examples for the Relation To Taboo Contract resource can be found in the [ex * `annotation` (annotation) - (string) The annotation of the Relation To Taboo Contract object. - Default: `orchestrator:terraform` - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. ## Importing diff --git a/docs/resources/relation_to_vrf_fallback_route_group.md b/docs/resources/relation_to_vrf_fallback_route_group.md index f3963db97..728a80f82 100644 --- a/docs/resources/relation_to_vrf_fallback_route_group.md +++ b/docs/resources/relation_to_vrf_fallback_route_group.md @@ -84,20 +84,16 @@ All examples for the Relation To VRF Fallback Route Group resource can be found * `annotation` (annotation) - (string) The annotation of the Relation To VRF Fallback Route Group object. - Default: `orchestrator:terraform` - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. ## Importing diff --git a/docs/resources/rogue_coop_exception.md b/docs/resources/rogue_coop_exception.md index 31af1f457..59c848d2b 100644 --- a/docs/resources/rogue_coop_exception.md +++ b/docs/resources/rogue_coop_exception.md @@ -90,20 +90,16 @@ All examples for the Rogue Coop Exception resource can be found in the [examples * `description` (descr) - (string) The description of the Rogue Coop Exception object. * `name` (name) - (string) The name of the Rogue Coop Exception object. * `name_alias` (nameAlias) - (string) The name alias of the Rogue Coop Exception object. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. ## Importing diff --git a/docs/resources/route_control_profile.md b/docs/resources/route_control_profile.md index b24c08ef1..edb816e9b 100644 --- a/docs/resources/route_control_profile.md +++ b/docs/resources/route_control_profile.md @@ -134,20 +134,16 @@ All examples for the Route Control Profile resource can be found in the [example * `route_control_profile_type` (type) - (string) The type of the Route Control Profile object. Use combinable when pervasive subnets (fvSubnet) and external subnets (l3extSubnet) should be combined with a route profile and merged into a single route map or route map entry. Use global when the route profile is the only source of information to generate a route map, this will overwrite other policy attributes. - Default: `combinable` - Valid Values: `combinable`, `global`. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. ## Importing diff --git a/docs/resources/tag.md b/docs/resources/tag.md index 8c3b2682c..a256dfa87 100644 --- a/docs/resources/tag.md +++ b/docs/resources/tag.md @@ -66,6 +66,7 @@ All examples for the Tag resource can be found in the [examples](https://github. - [aci_cloud_epg](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/cloud_epg) ([cloudEPg](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/cloudEPg/overview)) - [aci_cloud_external_epg](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/cloud_external_epg) ([cloudExtEPg](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/cloudExtEPg/overview)) - [aci_cloud_service_epg](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/cloud_service_epg) ([cloudSvcEPg](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/cloudSvcEPg/overview)) + - [aci_management_access_policy](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/management_access_policy) ([commPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/commPol/overview)) - [aci_dhcp_relay_policy](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/dhcp_relay_policy) ([dhcpRelayP](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/dhcpRelayP/overview)) - [aci_first_hop_security_policy](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/first_hop_security_policy) ([fhsBDPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fhsBDPol/overview)) - [aci_trust_control_policy](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/trust_control_policy) ([fhsTrustCtrlPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fhsTrustCtrlPol/overview)) @@ -82,7 +83,6 @@ All examples for the Tag resource can be found in the [examples](https://github. - [aci_vrf_fallback_route_group](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/vrf_fallback_route_group) ([fvFBRGroup](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvFBRGroup/overview)) - [aci_vrf_fallback_route_group_member](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/vrf_fallback_route_group_member) ([fvFBRMember](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvFBRMember/overview)) - [aci_vrf_fallback_route](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/vrf_fallback_route) ([fvFBRoute](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvFBRoute/overview)) - - [aci_epg_useg_ad_group_attribute](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/epg_useg_ad_group_attribute) ([fvIdGroupAttr](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvIdGroupAttr/overview)) * `key` (key) - (string) The key used to uniquely identify this configuration object. * `value` (value) - (string) The value of the property. diff --git a/docs/resources/trust_control_policy.md b/docs/resources/trust_control_policy.md index 73195be04..e7bbc8656 100644 --- a/docs/resources/trust_control_policy.md +++ b/docs/resources/trust_control_policy.md @@ -116,20 +116,16 @@ All examples for the Trust Control Policy resource can be found in the [examples * `trust_ra` (trustRa) - (string) The router advertisement (RA) trust status of the Trust Control Policy object. - Default: `no` - Valid Values: `no`, `yes`. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. ## Importing diff --git a/docs/resources/vrf_fallback_route.md b/docs/resources/vrf_fallback_route.md index 5128a7ebb..56e9ef920 100644 --- a/docs/resources/vrf_fallback_route.md +++ b/docs/resources/vrf_fallback_route.md @@ -91,20 +91,16 @@ All examples for the VRF Fallback Route resource can be found in the [examples]( * `description` (descr) - (string) The description of the VRF Fallback Route object. * `name` (name) - (string) The name of the VRF Fallback Route object. * `name_alias` (nameAlias) - (string) The name alias of the VRF Fallback Route object. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. ## Importing diff --git a/docs/resources/vrf_fallback_route_group.md b/docs/resources/vrf_fallback_route_group.md index 0c6eece17..cb8aafe1c 100644 --- a/docs/resources/vrf_fallback_route_group.md +++ b/docs/resources/vrf_fallback_route_group.md @@ -59,6 +59,18 @@ resource "aci_vrf_fallback_route_group" "full_example_vrf" { name = "name_1" name_alias = "name_alias_1" fallback_member = "2.2.2.2" + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } ] vrf_fallback_route = { @@ -67,6 +79,18 @@ resource "aci_vrf_fallback_route_group" "full_example_vrf" { prefix_address = "2.2.2.2/24" name = "name_1" name_alias = "name_alias_1" + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } annotations = [ { @@ -104,48 +128,58 @@ All examples for the VRF Fallback Route Group resource can be found in the [exam - Default: `orchestrator:terraform` * `description` (descr) - (string) The description of the VRF Fallback Route Group object. * `name_alias` (nameAlias) - (string) The name alias of the VRF Fallback Route Group object. - * `vrf_fallback_route_group_members` - (list) A list of VRF Fallback Route Group Members (ACI object [fvFBRMember](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvFBRMember/overview)). VRF Fallback Route Group Members can also be configured using a separate [aci_vrf_fallback_route_group_member](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/vrf_fallback_route_group_member) resource. - #### Required #### - * `fallback_member` (rnhAddr) - (string) The address of the VRF Fallback Route Group Member object. - + * `fallback_member` (rnhAddr) - (string) The address of the VRF Fallback Route Group Member object. #### Optional #### - * `annotation` (annotation) - (string) The annotation of the VRF Fallback Route Group Member object. + * `annotation` (annotation) - (string) The annotation of the VRF Fallback Route Group Member object. - Default: `orchestrator:terraform` - * `description` (descr) - (string) The description of the VRF Fallback Route Group Member object. - * `name` (name) - (string) The name of the VRF Fallback Route Group Member object. - * `name_alias` (nameAlias) - (string) The name alias of the VRF Fallback Route Group Member object. - -* `vrf_fallback_route` - (map) A map of VRF Fallback Route (ACI object [fvFBRoute](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvFBRoute/overview)). VRF Fallback Route can also be configured using a separate [aci_vrf_fallback_route](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/vrf_fallback_route) resource. + * `description` (descr) - (string) The description of the VRF Fallback Route Group Member object. + * `name` (name) - (string) The name of the VRF Fallback Route Group Member object. + * `name_alias` (nameAlias) - (string) The name alias of the VRF Fallback Route Group Member object. + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. +* `vrf_fallback_route` - (map) A map of VRF Fallback Route (ACI object [fvFBRoute](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvFBRoute/overview)). VRF Fallback Route can also be configured using a separate [aci_vrf_fallback_route](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/vrf_fallback_route) resource. #### Required #### - * `prefix_address` (fbrPrefix) - (string) The prefix address of the VRF Fallback Route object. - + * `prefix_address` (fbrPrefix) - (string) The prefix address of the VRF Fallback Route object. #### Optional #### - * `annotation` (annotation) - (string) The annotation of the VRF Fallback Route object. + * `annotation` (annotation) - (string) The annotation of the VRF Fallback Route object. - Default: `orchestrator:terraform` - * `description` (descr) - (string) The description of the VRF Fallback Route object. - * `name` (name) - (string) The name of the VRF Fallback Route object. - * `name_alias` (nameAlias) - (string) The name alias of the VRF Fallback Route object. - -* `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + * `description` (descr) - (string) The description of the VRF Fallback Route object. + * `name` (name) - (string) The name of the VRF Fallback Route object. + * `name_alias` (nameAlias) - (string) The name alias of the VRF Fallback Route object. + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. + * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. + #### Required #### + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. +* `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. ## Importing diff --git a/docs/resources/vrf_fallback_route_group_member.md b/docs/resources/vrf_fallback_route_group_member.md index 9b759aae9..5944ecbfd 100644 --- a/docs/resources/vrf_fallback_route_group_member.md +++ b/docs/resources/vrf_fallback_route_group_member.md @@ -91,20 +91,16 @@ All examples for the VRF Fallback Route Group Member resource can be found in th * `description` (descr) - (string) The description of the VRF Fallback Route Group Member object. * `name` (name) - (string) The name of the VRF Fallback Route Group Member object. * `name_alias` (nameAlias) - (string) The name alias of the VRF Fallback Route Group Member object. - * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. - + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. * `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later. - #### Required #### - * `key` (key) - (string) The key used to uniquely identify this configuration object. - * `value` (value) - (string) The value of the property. + * `key` (key) - (string) The key used to uniquely identify this configuration object. + * `value` (value) - (string) The value of the property. ## Importing diff --git a/examples/data-sources/aci_management_access_policy/data-source.tf b/examples/data-sources/aci_management_access_policy/data-source.tf new file mode 100644 index 000000000..0a70c6b03 --- /dev/null +++ b/examples/data-sources/aci_management_access_policy/data-source.tf @@ -0,0 +1,4 @@ + +data "aci_management_access_policy" "example" { + name = "test_name" +} diff --git a/examples/data-sources/aci_management_access_policy/provider.tf b/examples/data-sources/aci_management_access_policy/provider.tf new file mode 100644 index 000000000..975fca093 --- /dev/null +++ b/examples/data-sources/aci_management_access_policy/provider.tf @@ -0,0 +1,14 @@ +terraform { + required_providers { + aci = { + source = "ciscodevnet/aci" + } + } +} + +provider "aci" { + username = "" + password = "" + url = "" + insecure = true +} \ No newline at end of file diff --git a/examples/resources/aci_access_interface_override/resource-all-attributes.tf b/examples/resources/aci_access_interface_override/resource-all-attributes.tf index 234ac4369..bd7c595fc 100644 --- a/examples/resources/aci_access_interface_override/resource-all-attributes.tf +++ b/examples/resources/aci_access_interface_override/resource-all-attributes.tf @@ -9,10 +9,34 @@ resource "aci_access_interface_override" "full_example" { relation_to_host_path = { annotation = "annotation_1" target_dn = "topology/pod-1/paths-101/pathep-[eth1/1]" + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } relation_to_access_interface_policy_group = { annotation = "annotation_1" target_dn = "uni/infra/funcprof/accportgrp-access_interface_policy_group" + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } annotations = [ { diff --git a/examples/resources/aci_application_epg/resource-all-attributes.tf b/examples/resources/aci_application_epg/resource-all-attributes.tf index 227971430..3ef7dbc82 100644 --- a/examples/resources/aci_application_epg/resource-all-attributes.tf +++ b/examples/resources/aci_application_epg/resource-all-attributes.tf @@ -25,20 +25,68 @@ resource "aci_application_epg" "full_example_application_profile" { owner_tag = "owner_tag_1" precedence = "1" scope = "scope-bd" + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } relation_to_application_epg_monitoring_policy = { annotation = "annotation_1" monitoring_policy_name = aci_monitoring_policy.example.name + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } relation_to_bridge_domain = { annotation = "annotation_1" bridge_domain_name = aci_bridge_domain.example.name + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } relation_to_consumed_contracts = [ { annotation = "annotation_1" priority = "level1" contract_name = aci_contract.example.name + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } ] relation_to_imported_contracts = [ @@ -46,11 +94,35 @@ resource "aci_application_epg" "full_example_application_profile" { annotation = "annotation_1" priority = "level1" imported_contract_name = aci_imported_contract.example.name + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } ] relation_to_custom_qos_policy = { annotation = "annotation_1" custom_qos_policy_name = aci_custom_qos_policy.example.name + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } relation_to_domains = [ { @@ -79,11 +151,35 @@ resource "aci_application_epg" "full_example_application_profile" { switching_mode = "AVE" target_dn = "uni/vmmp-VMware/dom-domain_1" untagged = "no" + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } ] relation_to_data_plane_policing_policy = { annotation = "annotation_1" data_plane_policing_policy_name = aci_data_plane_policing_policy.example.name + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } relation_to_fibre_channel_paths = [ { @@ -92,12 +188,36 @@ resource "aci_application_epg" "full_example_application_profile" { target_dn = "topology/pod-1/paths-101/pathep-[eth1/1]" vsan = "vsan-10" vsan_mode = "native" + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } ] relation_to_intra_epg_contracts = [ { annotation = "annotation_1" contract_name = aci_contract.example.name + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } ] relation_to_static_leafs = [ @@ -108,6 +228,18 @@ resource "aci_application_epg" "full_example_application_profile" { deployment_immediacy = "immediate" mode = "native" target_dn = "topology/pod-1/node-101" + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } ] relation_to_static_paths = [ @@ -119,12 +251,36 @@ resource "aci_application_epg" "full_example_application_profile" { mode = "native" primary_encapsulation = "vlan-203" target_dn = "topology/pod-1/paths-101/pathep-[eth1/1]" + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } ] relation_to_taboo_contracts = [ { annotation = "annotation_1" taboo_contract_name = aci_taboo_contract.example.name + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } ] relation_to_provided_contracts = [ @@ -133,17 +289,53 @@ resource "aci_application_epg" "full_example_application_profile" { match_criteria = "All" priority = "level1" contract_name = aci_contract.example.name + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } ] relation_to_contract_masters = [ { annotation = "annotation_1" target_dn = aci_application_epg.test_application_epg_0.id + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } ] relation_to_trust_control_policy = { annotation = "annotation_1" trust_control_policy_name = aci_trust_control_policy.example.name + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } annotations = [ { diff --git a/examples/resources/aci_bridge_domain/resource-all-attributes.tf b/examples/resources/aci_bridge_domain/resource-all-attributes.tf index b98787ec3..22c91c4ef 100644 --- a/examples/resources/aci_bridge_domain/resource-all-attributes.tf +++ b/examples/resources/aci_bridge_domain/resource-all-attributes.tf @@ -37,6 +37,18 @@ resource "aci_bridge_domain" "full_example_tenant" { name_alias = "name_alias_1" owner_key = "owner_key_1" owner_tag = "owner_tag_1" + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } rogue_coop_exceptions = [ { @@ -45,58 +57,202 @@ resource "aci_bridge_domain" "full_example_tenant" { mac = "00:00:00:00:00:00" name = "name_1" name_alias = "name_alias_1" + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } ] relation_to_monitor_policy = { annotation = "annotation_1" monitoring_policy_name = aci_monitoring_policy.example.name + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } relation_to_first_hop_security_policy = { annotation = "annotation_1" first_hop_security_policy_name = aci_first_hop_security_policy.example.name + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } relation_to_neighbor_discovery_interface_policy = { annotation = "annotation_1" neighbor_discovery_interface_policy_name = aci_neighbor_discovery_interface_policy.example.name + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } relation_to_netflow_monitor_policies = [ { annotation = "annotation_1" filter_type = "ce" netflow_monitor_policy_name = aci_netflow_monitor_policy.example.name + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } ] relation_to_l3_outsides = [ { annotation = "annotation_1" l3_outside_name = aci_l3_outside.example.name + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } ] relation_to_route_control_profile = { annotation = "annotation_1" l3_outside_name = aci_l3_outside.example.name route_control_profile_name = aci_route_control_profile.example.name + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } relation_to_dhcp_relay_policy = { annotation = "annotation_1" dhcp_relay_policy_name = aci_dhcp_relay_policy.example.name + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } relation_to_end_point_retention_policy = { annotation = "annotation_1" resolve_action = "inherit" end_point_retention_policy_name = aci_end_point_retention_policy.example.name + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } relation_to_vrf = { annotation = "annotation_1" vrf_name = aci_vrf.example.name + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } relation_to_igmp_snooping_policy = { annotation = "annotation_1" igmp_snooping_policy_name = aci_igmp_snooping_policy.example.name + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } relation_to_mld_snooping_policy = { annotation = "annotation_1" mld_snooping_policy_name = aci_mld_snooping_policy.example.name + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } annotations = [ { diff --git a/examples/resources/aci_certificate_authority/resource-all-attributes.tf b/examples/resources/aci_certificate_authority/resource-all-attributes.tf index 8e4be0d42..c1bba41c4 100644 --- a/examples/resources/aci_certificate_authority/resource-all-attributes.tf +++ b/examples/resources/aci_certificate_authority/resource-all-attributes.tf @@ -26,12 +26,36 @@ EOT { key = "key_0" value = "value_1" + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } ] tags = [ { key = "key_0" value = "value_1" + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } ] } @@ -65,12 +89,36 @@ EOT { key = "key_0" value = "value_1" + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } ] tags = [ { key = "key_0" value = "value_1" + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } ] } diff --git a/examples/resources/aci_endpoint_security_group/resource-all-attributes.tf b/examples/resources/aci_endpoint_security_group/resource-all-attributes.tf index 8166af5b7..93d1d2598 100644 --- a/examples/resources/aci_endpoint_security_group/resource-all-attributes.tf +++ b/examples/resources/aci_endpoint_security_group/resource-all-attributes.tf @@ -15,6 +15,18 @@ resource "aci_endpoint_security_group" "full_example_application_profile" { annotation = "annotation_1" priority = "level1" contract_name = aci_contract.example.name + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } ] relation_to_imported_contracts = [ @@ -22,12 +34,36 @@ resource "aci_endpoint_security_group" "full_example_application_profile" { annotation = "annotation_1" priority = "level1" imported_contract_name = aci_imported_contract.example.name + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } ] relation_to_intra_epg_contracts = [ { annotation = "annotation_1" contract_name = aci_contract.example.name + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } ] relation_to_provided_contracts = [ @@ -36,16 +72,52 @@ resource "aci_endpoint_security_group" "full_example_application_profile" { match_criteria = "All" priority = "level1" contract_name = aci_contract.example.name + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } ] relation_to_vrf = { annotation = "annotation_1" vrf_name = aci_vrf.example.name + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } relation_to_contract_masters = [ { annotation = "annotation_1" target_dn = aci_endpoint_security_group.test_endpoint_security_group_0.id + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } ] annotations = [ diff --git a/examples/resources/aci_external_management_network_instance_profile/resource-all-attributes.tf b/examples/resources/aci_external_management_network_instance_profile/resource-all-attributes.tf index f15a51c8b..7d1ee4e53 100644 --- a/examples/resources/aci_external_management_network_instance_profile/resource-all-attributes.tf +++ b/examples/resources/aci_external_management_network_instance_profile/resource-all-attributes.tf @@ -10,6 +10,18 @@ resource "aci_external_management_network_instance_profile" "full_example" { annotation = "annotation_1" priority = "level1" out_of_band_contract_name = aci_out_of_band_contract.example.name + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } ] annotations = [ diff --git a/examples/resources/aci_first_hop_security_policy/resource-all-attributes.tf b/examples/resources/aci_first_hop_security_policy/resource-all-attributes.tf index c68f1290a..717437378 100644 --- a/examples/resources/aci_first_hop_security_policy/resource-all-attributes.tf +++ b/examples/resources/aci_first_hop_security_policy/resource-all-attributes.tf @@ -24,6 +24,18 @@ resource "aci_first_hop_security_policy" "full_example_tenant" { other_config_flag = "no" owner_key = "owner_key_1" owner_tag = "owner_tag_1" + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } annotations = [ { diff --git a/examples/resources/aci_key_ring/resource-all-attributes.tf b/examples/resources/aci_key_ring/resource-all-attributes.tf index 3275ac4cf..74b3988de 100644 --- a/examples/resources/aci_key_ring/resource-all-attributes.tf +++ b/examples/resources/aci_key_ring/resource-all-attributes.tf @@ -50,12 +50,36 @@ EOT { key = "key_0" value = "value_1" + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } ] tags = [ { key = "key_0" value = "value_1" + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } ] } @@ -113,12 +137,36 @@ EOT { key = "key_0" value = "value_1" + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } ] tags = [ { key = "key_0" value = "value_1" + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } ] } diff --git a/examples/resources/aci_l3out_consumer_label/resource-all-attributes.tf b/examples/resources/aci_l3out_consumer_label/resource-all-attributes.tf index a48ae8b83..4b465da09 100644 --- a/examples/resources/aci_l3out_consumer_label/resource-all-attributes.tf +++ b/examples/resources/aci_l3out_consumer_label/resource-all-attributes.tf @@ -13,6 +13,18 @@ resource "aci_l3out_consumer_label" "full_example_l3_outside" { { annotation = "annotation_1" target_dn = aci_external_network_instance_profile.example.id + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } ] relation_to_route_control_profiles = [ @@ -20,6 +32,18 @@ resource "aci_l3out_consumer_label" "full_example_l3_outside" { annotation = "annotation_1" direction = "export" target_dn = aci_route_control_profile.example.id + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } ] annotations = [ diff --git a/examples/resources/aci_management_access_policy/provider.tf b/examples/resources/aci_management_access_policy/provider.tf new file mode 100644 index 000000000..975fca093 --- /dev/null +++ b/examples/resources/aci_management_access_policy/provider.tf @@ -0,0 +1,14 @@ +terraform { + required_providers { + aci = { + source = "ciscodevnet/aci" + } + } +} + +provider "aci" { + username = "" + password = "" + url = "" + insecure = true +} \ No newline at end of file diff --git a/examples/resources/aci_management_access_policy/resource-all-attributes.tf b/examples/resources/aci_management_access_policy/resource-all-attributes.tf new file mode 100644 index 000000000..044e35ca9 --- /dev/null +++ b/examples/resources/aci_management_access_policy/resource-all-attributes.tf @@ -0,0 +1,187 @@ + +resource "aci_management_access_policy" "full_example" { + annotation = "annotation" + description = "description_1" + name = "test_name" + name_alias = "name_alias_1" + owner_key = "owner_key_1" + owner_tag = "owner_tag_1" + strict_security_on_apic_oob_subnet = "no" + http_service = { + access_control_allow_credential = "disabled" + access_control_allow_origins = "access_control_allow_origins_1" + admin_state = "disabled" + annotation = "annotation_1" + cli_only_mode = "disabled" + description = "description_1" + global_throttle_rate = "10000" + global_throttle_state = "disabled" + global_throttle_unit = "r/s" + max_request_status_count = "0" + name = "name_1" + name_alias = "name_alias_1" + node_exporter = "disabled" + port = "80" + redirect_state = "disabled" + server_header = "disabled" + throttle_rate = "2" + throttle_state = "disabled" + visore_access = "disabled" + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] + } + http_ssl_configuration = { + access_control_allow_credential = "disabled" + access_control_allow_origins = "access_control_allow_origins_1" + admin_state = "enabled" + annotation = "annotation_1" + cli_only_mode = "disabled" + client_cert_auth_state = "disabled" + description = "description_1" + dh_param = "1024" + global_throttle_rate = "10000" + global_throttle_state = "disabled" + global_throttle_unit = "r/s" + max_request_status_count = "0" + name = "name_1" + name_alias = "name_alias_1" + node_exporter = "disabled" + port = "443" + referer = "referer_1" + server_header = "disabled" + ssl_protocols = ["TLSv1"] + throttle_rate = "2" + throttle_state = "disabled" + visore_access = "disabled" + certificate_authority = { + annotation = "annotation_1" + target_dn = "uni/userext/pkiext/tp-test_name" + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] + } + key_ring = { + annotation = "annotation_1" + key_ring_name = aci_key_ring.example.name + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] + } + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] + } + ssh_access_via_web = { + admin_state = "disabled" + annotation = "annotation_1" + description = "description_1" + name = "name_1" + name_alias = "name_alias_1" + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] + } + ssh_service = { + admin_state = "disabled" + annotation = "annotation_1" + description = "description_1" + host_key_algorithms = ["rsa-sha2-256"] + key_exchange_algorithms = ["curve25519-sha256"] + name = "name_1" + name_alias = "name_alias_1" + password_auth = "disabled" + port = "22" + ssh_ciphers = ["aes192-ctr"] + ssh_macs = ["hmac-sha1"] + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] + } + telnet_service = { + admin_state = "disabled" + annotation = "annotation_1" + description = "description_1" + name = "name_1" + name_alias = "name_alias_1" + port = "23" + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] + } + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] +} diff --git a/examples/resources/aci_management_access_policy/resource.tf b/examples/resources/aci_management_access_policy/resource.tf new file mode 100644 index 000000000..80aa42059 --- /dev/null +++ b/examples/resources/aci_management_access_policy/resource.tf @@ -0,0 +1,4 @@ + +resource "aci_management_access_policy" "example" { + name = "test_name" +} diff --git a/examples/resources/aci_netflow_exporter_policy/resource-all-attributes.tf b/examples/resources/aci_netflow_exporter_policy/resource-all-attributes.tf index 6bf1e2e71..2fa72ee79 100644 --- a/examples/resources/aci_netflow_exporter_policy/resource-all-attributes.tf +++ b/examples/resources/aci_netflow_exporter_policy/resource-all-attributes.tf @@ -16,10 +16,34 @@ resource "aci_netflow_exporter_policy" "full_example_tenant" { relation_to_vrf = { annotation = "annotation_1" target_dn = aci_vrf.example.id + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } relation_to_epg = { annotation = "annotation_1" target_dn = aci_application_epg.example.id + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } annotations = [ { diff --git a/examples/resources/aci_netflow_monitor_policy/resource-all-attributes.tf b/examples/resources/aci_netflow_monitor_policy/resource-all-attributes.tf index 199f3e68f..900881131 100644 --- a/examples/resources/aci_netflow_monitor_policy/resource-all-attributes.tf +++ b/examples/resources/aci_netflow_monitor_policy/resource-all-attributes.tf @@ -11,11 +11,35 @@ resource "aci_netflow_monitor_policy" "full_example_tenant" { { annotation = "annotation_1" netflow_exporter_policy_name = aci_netflow_exporter_policy.example.name + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } ] relation_to_netflow_record = { annotation = "annotation_1" netflow_record_policy_name = aci_netflow_record_policy.example.name + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } annotations = [ { diff --git a/examples/resources/aci_vrf_fallback_route_group/resource-all-attributes.tf b/examples/resources/aci_vrf_fallback_route_group/resource-all-attributes.tf index 002eca544..ac869d22c 100644 --- a/examples/resources/aci_vrf_fallback_route_group/resource-all-attributes.tf +++ b/examples/resources/aci_vrf_fallback_route_group/resource-all-attributes.tf @@ -12,6 +12,18 @@ resource "aci_vrf_fallback_route_group" "full_example_vrf" { name = "name_1" name_alias = "name_alias_1" fallback_member = "2.2.2.2" + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } ] vrf_fallback_route = { @@ -20,6 +32,18 @@ resource "aci_vrf_fallback_route_group" "full_example_vrf" { prefix_address = "2.2.2.2/24" name = "name_1" name_alias = "name_alias_1" + annotations = [ + { + key = "key_0" + value = "value_1" + } + ] + tags = [ + { + key = "key_0" + value = "value_1" + } + ] } annotations = [ { diff --git a/gen/definitions/classes.yaml b/gen/definitions/classes.yaml index b2b19aa11..f8f123813 100644 --- a/gen/definitions/classes.yaml +++ b/gen/definitions/classes.yaml @@ -661,6 +661,7 @@ pkiTP: test_type: "cloud" pkiKeyRing: + resource_name: "key_ring" sub_category: "AAA" ui_locations: - "Admin -> AAA -> Security -> Key Rings" @@ -806,3 +807,12 @@ fvRogueExceptionMac: fhsRaGuardPol: resource_name: "route_advertisement_guard_policy" + +commPol: + resource_name: "management_access_policy" + ui_locations: + - "Fabric -> Fabric Policies -> Policies -> Pod -> Management Access" + class_version: "6.0(2h)" + contained_by: + - "polUni" + rn_prepend: "fabric" diff --git a/gen/definitions/properties.yaml b/gen/definitions/properties.yaml index 6a117cd0b..52e7855e4 100644 --- a/gen/definitions/properties.yaml +++ b/gen/definitions/properties.yaml @@ -63,6 +63,11 @@ global: Nd: "Neighbor Discovery (ND)" Mld: "MLD" Igmp: "IGMP" + Ssh Service: "SSH (Secure Shell) Service" + Shellinabox Service: "SSH (Secure Shell) access via WEB" + Tp: "Certificate Authority" + Http Ssl Configuration: "HTTP (Hypertext Transfer Protocol) SSL (Secure Sockets Layer) Configuration" + Http Service: "HTTP (Hypertext Transfer Protocol) Service" ignores: - "userdom" @@ -1291,7 +1296,6 @@ pkiKeyRing: name: "test_name" certificate_chain: -----BEGIN CERTIFICATE-----\\nMIICODCCAaGgAwIBAgIJAIt8XMntue0VMA0GCSqGSIb3DQEBCwUAMDQxDjAMBgNV\\nBAMMBUFkbWluMRUwEwYDVQQKDAxZb3VyIENvbXBhbnkxCzAJBgNVBAYTAlVTMCAX\\nDTE4MDEwOTAwNTk0NFoYDzIxMTcxMjE2MDA1OTQ0WjA0MQ4wDAYDVQQDDAVBZG1p\\nbjEVMBMGA1UECgwMWW91ciBDb21wYW55MQswCQYDVQQGEwJVUzCBnzANBgkqhkiG\\n9w0BAQEFAAOBjQAwgYkCgYEAohG/7axtt7CbSaMP7r+2mhTKbNgh0Ww36C7Ta14i\\nv+VmLyKkQHnXinKGhp6uy3Nug+15a+eIu7CrgpBVMQeCiWfsnwRocKcQJWIYDrWl\\nXHxGQn31yYKR6mylE7Dcj3rMFybnyhezr5D8GcP85YRPmwG9H2hO/0Y1FUnWu9Iw\\nAQkCAwEAAaNQME4wHQYDVR0OBBYEFD0jLXfpkrU/ChzRvfruRs/fy1VXMB8GA1Ud\\nIwQYMBaAFD0jLXfpkrU/ChzRvfruRs/fy1VXMAwGA1UdEwQFMAMBAf8wDQYJKoZI\\nhvcNAQELBQADgYEAOmvre+5tgZ0+F3DgsfxNQqLTrGiBgGCIymPkP/cBXXkNuJyl\\n3ac7tArHQc7WEA4U2R2rZbEq8FC3UJJm4nUVtCPvEh3G9OhN2xwYev79yt6pIn/l\\nKU0Td2OpVyo0eLqjoX5u2G90IBWzhyjFbo+CcKMrSVKj1YOdG0E3OuiJf00=\\n-----END CERTIFICATE----- test_values: - test_values: default: regenerate : "no" elliptic_curve: "none" @@ -1631,3 +1635,138 @@ fhsRaGuardPol: max_hop_limit: "10" min_hop_limit: "1" +commPol: + documentation: + strictSecurityOnApicOOBSubnet: "Removes implicit access permissions from any APIC out-of-band (OOB) subnet IP address." + ignore_properties_in_test: + "strictSecurityOnApicOOBSubnet": "no" + +commHttp: + documentation: + accessControlAllowCredential: "Determines if credentials are allowed in HTTP (Hypertext Transfer Protocol) responses." + accessControlAllowOrigins: "Determines which origins can access the resource. For example, inputting http://127.0.0.1:8000 would allow access from a source device with that IP address and port." + adminSt: "The administrative state of the HTTP (Hypertext Transfer Protocol) Service." + cliOnlyMode: "Determines if CLI-only mode is enabled." + globalThrottleRate: "Maximum API calls allowed per unit time." + globalThrottleUnit: "The unit of measurement for rate limiting." + globalThrottleSt: "The throttle state for all clients without specific identifier in their headers." + nodeExporter: "Node Exporter service status." + redirectSt: "The state of HTTP (Hypertext Transfer Protocol) communication service." + serverHeader: "Determines if the server header is included in responses." + throttleSt: "The state of login and refresh throttling." + visoreAccess: "Grants permissions for accessing the Visore tool in Cisco ACI." + overwrites: + admin_st: "admin_state" + redirect_st: "redirect_state" + global_throttle_st: "global_throttle_state" + throttle_st: "throttle_state" + test_values: + all: + description: "description_1" + global_throttle_rate: "10000" + global_throttle_st: "disabled" + global_throttle_unit: "r/s" + max_request_status_count: "0" + name: "name_1" + name_alias: "name_alias_1" + node_exporter: "disabled" + port: "80" + referer: "referer_1" + server_header: "disabled" + throttle_rate: "2" + +commHttps: + documentation: + accessControlAllowCredential: "Determines if credentials are allowed in HTTP (Hypertext Transfer Protocol) SSL (Secure Sockets Layer) responses." + accessControlAllowOrigins: "Determines which origins can access the resource. For example, inputting http://127.0.0.1:8000 would allow access from a source device with that IP address and port." + adminSt: "The administrative state of the HTTP (Hypertext Transfer Protocol) SSL (Secure Sockets Layer) Service." + cliOnlyMode: "Determines if CLI-only mode is enabled." + globalThrottleRate: "Maximum API calls allowed per unit time." + globalThrottleUnit: "The unit of measurement for rate limiting." + globalThrottleSt: "The throttle state for all clients without specific identifier in their headers." + nodeExporter: "Node Exporter service status." + serverHeader: "Determines if the server header is included in responses." + throttleSt: "The state of login and refresh throttling." + visoreAccess: "Grants permissions for accessing the Visore tool in Cisco ACI." + clientCertAuthState: "State of client certificate authentication." + dhParam: "Determines the settings for DH (Diffie-Hellman) parameters." + referer: "Allowed HTTP referers." + overwrites: + admin_st: "admin_state" + global_throttle_st: "global_throttle_state" + throttle_st: "throttle_state" + remove_valid_values: + adminSt: + - "disabled" + targets: + - class_name: "pkiTP" + properties: + name: "test_name" + certificate_chain: -----BEGIN CERTIFICATE-----\\nMIICODCCAaGgAwIBAgIJAIt8XMntue0VMA0GCSqGSIb3DQEBCwUAMDQxDjAMBgNV\\nBAMMBUFkbWluMRUwEwYDVQQKDAxZb3VyIENvbXBhbnkxCzAJBgNVBAYTAlVTMCAX\\nDTE4MDEwOTAwNTk0NFoYDzIxMTcxMjE2MDA1OTQ0WjA0MQ4wDAYDVQQDDAVBZG1p\\nbjEVMBMGA1UECgwMWW91ciBDb21wYW55MQswCQYDVQQGEwJVUzCBnzANBgkqhkiG\\n9w0BAQEFAAOBjQAwgYkCgYEAohG/7axtt7CbSaMP7r+2mhTKbNgh0Ww36C7Ta14i\\nv+VmLyKkQHnXinKGhp6uy3Nug+15a+eIu7CrgpBVMQeCiWfsnwRocKcQJWIYDrWl\\nXHxGQn31yYKR6mylE7Dcj3rMFybnyhezr5D8GcP85YRPmwG9H2hO/0Y1FUnWu9Iw\\nAQkCAwEAAaNQME4wHQYDVR0OBBYEFD0jLXfpkrU/ChzRvfruRs/fy1VXMB8GA1Ud\\nIwQYMBaAFD0jLXfpkrU/ChzRvfruRs/fy1VXMAwGA1UdEwQFMAMBAf8wDQYJKoZI\\nhvcNAQELBQADgYEAOmvre+5tgZ0+F3DgsfxNQqLTrGiBgGCIymPkP/cBXXkNuJyl\\n3ac7tArHQc7WEA4U2R2rZbEq8FC3UJJm4nUVtCPvEh3G9OhN2xwYev79yt6pIn/l\\nKU0Td2OpVyo0eLqjoX5u2G90IBWzhyjFbo+CcKMrSVKj1YOdG0E3OuiJf00=\\n-----END CERTIFICATE----- + test_values: + all: + cli_only_mode: "disabled" + client_cert_auth_state: "disabled" + description: "description_1" + global_throttle_rate: "10000" + global_throttle_st: "disabled" + global_throttle_unit: "r/s" + max_request_status_count: "0" + name: "name_1" + name_alias: "name_alias_1" + node_exporter: "disabled" + port: "443" + referer: "referer_1" + server_header: "disabled" + ssl_protocols: + - "TLSv1" + throttle_rate: "2" + throttle_st: "disabled" + visore_access: "disabled" + +commRsClientCertCA: + overwrites: + tp: "certificate_authority" + admin_st: "admin_state" + test_values: + all: + target_dn: uni/userext/pkiext/tp-test_name + +commRsKeyRing: + overwrites: + admin_st: "admin_state" + test_values: + all: + key_ring_name: "default" + +commSsh: + documentation: + hostkeyAlgos: "The supported algorithms for the host key." + sshMacs: "Message authentication codes (MACs) supported for SSH." + kexAlgos: "The supported algorithms for key exchange." + sshCiphers: "Ciphers supported for SSH." + passwordAuth: "State of password authentication." + ignore_properties_in_test: + "hostkeyAlgos": ["rsa-sha2-256"] + "kexAlgos": ["curve25519-sha256"] + overwrites: + admin_st: "admin_state" + kex_algos: "key_exchange_algorithms" + hostkey_algos: "host_key_algorithms" + test_values: + all: + ssh_ciphers: ["aes192-ctr"] + ssh_macs: ["hmac-sha1"] + port: "22" + +commShellinabox: + overwrites: + admin_st: "admin_state" + shellinabox_service: "ssh_access_via_web" + +commTelnet: + overwrites: + admin_st: "admin_state" + test_values: + all: + port: "23" diff --git a/gen/generator.go b/gen/generator.go index 56a9e57f8..8c26f57d2 100644 --- a/gen/generator.go +++ b/gen/generator.go @@ -81,61 +81,67 @@ const pubhupDevnetBaseUrl = "https://pubhub.devnetcloud.com/media/model-doc-late // The map contains a key which is the name of the function used in the template and a value which is the function itself // The functions itself are defined in the current file var templateFuncs = template.FuncMap{ - "snakeCase": Underscore, - "validatorString": ValidatorString, - "validatorStringCustomType": ValidatorStringCustomType, - "containsString": ContainsString, - "listToString": ListToString, - "overwriteProperty": GetOverwriteAttributeName, - "overwritePropertyValue": GetOverwriteAttributeValue, - "createTestValue": func(val string) string { return fmt.Sprintf("test_%s", val) }, - "createNonExistingValue": func(val string) string { return fmt.Sprintf("non_existing_%s", val) }, - "getParentTestDependencies": GetParentTestDependencies, - "getTestTargetDn": GetTestTargetDn, - "getDefaultValues": GetDefaultValues, - "fromInterfacesToString": FromInterfacesToString, - "containsNoneAttributeValue": ContainsNoneAttributeValue, - "legacyAttributeContainsNoneValue": LegacyAttributeContainsNoneAttributeValue, - "definedInMap": DefinedInMap, - "getValueFromMap": GetValueFromMap, - "add": func(val1, val2 int) int { return val1 + val2 }, - "subtract": func(val1, val2 int) int { return val1 - val2 }, - "mod": func(val1, val2 int) int { return val1 % val2 }, - "isInterfaceSlice": IsInterfaceSlice, - "replace": Replace, - "lookupTestValue": LookupTestValue, - "lookupChildTestValue": LookupChildTestValue, - "createParentDnValue": CreateParentDnValue, - "getResourceName": GetResourceName, - "getResourceNameAsDescription": GetResourceNameAsDescription, - "capitalize": Capitalize, - "decapitalize": Decapitalize, - "getTestConfigVariableName": GetTestConfigVariableName, - "getDevnetDocForClass": GetDevnetDocForClass, - "getMigrationType": GetMigrationType, - "isLegacyAttribute": IsLegacyAttribute, - "isLegacyChild": IsLegacyChild, - "getLegacyChildAttribute": GetLegacyChildAttribute, - "getConflictingAttributeName": GetConflictingAttributeName, - "getPropertyNameForLegacyAttribute": GetPropertyNameForLegacyAttribute, - "isNewAttributeStringType": IsNewAttributeStringType, - "isNewNamedClassAttribute": IsNewNamedClassAttribute, - "isRequiredInTestValue": IsRequiredInTestValue, - "getChildAttributesFromBlocks": GetChildAttributesFromBlocks, - "getNewChildAttributes": GetNewChildAttributes, - "containsRequired": ContainsRequired, - "hasPrefix": strings.HasPrefix, - "hasCustomTypeDocs": HasCustomTypeDocs, - "containsSingleNestedChildren": ContainsSingleNestedChildren, - "isResourceClass": IsResourceClass, - "getOldType": GetOldType, - "contains": strings.Contains, - "hasKey": HasKey, - "definedInList": DefinedInList, - "keyExists": KeyExists, - "isNewNamedClassAttributeMatch": IsNewNamedClassAttributeMatch, - "getRnFormat": GetRnFormat, - "identifierIsCustomType": IdentifierIsCustomType, + "snakeCase": Underscore, + "validatorString": ValidatorString, + "validatorStringCustomType": ValidatorStringCustomType, + "containsString": ContainsString, + "listToString": ListToString, + "overwriteProperty": GetOverwriteAttributeName, + "overwritePropertyValue": GetOverwriteAttributeValue, + "createTestValue": func(val string) string { return fmt.Sprintf("test_%s", val) }, + "createNonExistingValue": func(val string) string { return fmt.Sprintf("non_existing_%s", val) }, + "getParentTestDependencies": GetParentTestDependencies, + "getTestTargetDn": GetTestTargetDn, + "getDefaultValues": GetDefaultValues, + "fromInterfacesToString": FromInterfacesToString, + "containsNoneAttributeValue": ContainsNoneAttributeValue, + "legacyAttributeContainsNoneValue": LegacyAttributeContainsNoneAttributeValue, + "definedInMap": DefinedInMap, + "getValueFromMap": GetValueFromMap, + "add": func(val1, val2 int) int { return val1 + val2 }, + "subtract": func(val1, val2 int) int { return val1 - val2 }, + "mod": func(val1, val2 int) int { return val1 % val2 }, + "isInterfaceSlice": IsInterfaceSlice, + "replace": Replace, + "lookupTestValue": LookupTestValue, + "lookupChildTestValue": LookupChildTestValue, + "createParentDnValue": CreateParentDnValue, + "getResourceName": GetResourceName, + "getResourceNameAsDescription": GetResourceNameAsDescription, + "capitalize": Capitalize, + "decapitalize": Decapitalize, + "getTestConfigVariableName": GetTestConfigVariableName, + "getDevnetDocForClass": GetDevnetDocForClass, + "getMigrationType": GetMigrationType, + "isLegacyAttribute": IsLegacyAttribute, + "isLegacyChild": IsLegacyChild, + "getLegacyChildAttribute": GetLegacyChildAttribute, + "getConflictingAttributeName": GetConflictingAttributeName, + "getPropertyNameForLegacyAttribute": GetPropertyNameForLegacyAttribute, + "isNewAttributeStringType": IsNewAttributeStringType, + "isNewNamedClassAttribute": IsNewNamedClassAttribute, + "isRequiredInTestValue": IsRequiredInTestValue, + "getChildAttributesFromBlocks": GetChildAttributesFromBlocks, + "getNewChildAttributes": GetNewChildAttributes, + "containsRequired": ContainsRequired, + "hasPrefix": strings.HasPrefix, + "hasCustomTypeDocs": HasCustomTypeDocs, + "containsSingleNestedChildren": ContainsSingleNestedChildren, + "containsDeletableSingleNestedChildren": ContainsDeletableSingleNestedChildren, + "isResourceClass": IsResourceClass, + "getOldType": GetOldType, + "contains": strings.Contains, + "hasKey": HasKey, + "definedInList": DefinedInList, + "keyExists": KeyExists, + "isNewNamedClassAttributeMatch": IsNewNamedClassAttributeMatch, + "getRnFormat": GetRnFormat, + "identifierIsCustomType": IdentifierIsCustomType, + "isListEmpty": func(stringList []string) bool { return len(stringList) == 0 }, + "addToTemplateProperties": AddToTemplateProperties, + "addToChild": AddToChildInTestTemplate, + "checkDeletableChild": CheckDeletableChild, + "emptyChild": EmptyChild, } func ContainsRequired(properties map[string]Property) bool { @@ -152,10 +158,51 @@ func ContainsSingleNestedChildren(children map[string]Model) bool { if len(child.IdentifiedBy) == 0 || child.MaxOneClassAllowed { return true } + if child.Children != nil && ContainsSingleNestedChildren(child.Children) { + return true + } + } + return false +} + +func ContainsDeletableSingleNestedChildren(children map[string]Model) bool { + for _, child := range children { + if (len(child.IdentifiedBy) == 0 || child.MaxOneClassAllowed) && child.AllowDelete { + return true + } + if child.Children != nil && ContainsDeletableSingleNestedChildren(child.Children) { + return true + } + } + return false +} + +func CheckDeletableChild(children map[interface{}]interface{}) bool { + for _, value := range children { + if val, ok := value.([]interface{}); ok { + for _, item := range val { + if child, ok := item.(map[interface{}]interface{}); ok { + if deletable, exists := child["deletable_child"]; exists && deletable == true { + return true + } + if nestedChildren, exists := child["children"]; exists { + if nestedChildrenMap, ok := nestedChildren.(map[interface{}]interface{}); ok { + if CheckDeletableChild(nestedChildrenMap) { + return true + } + } + } + } + } + } } return false } +func EmptyChild() map[interface{}]interface{} { + return make(map[interface{}]interface{}) +} + func Replace(oldValue, newValue, inputString string) string { return strings.Replace(inputString, oldValue, newValue, -1) } @@ -337,6 +384,9 @@ func Capitalize(s string) string { } func Decapitalize(s string) string { + if s == "" { + return "" + } return fmt.Sprintf("%s%s", strings.ToLower(s[:1]), s[1:]) } @@ -524,30 +574,76 @@ func LookupChildTestValue(classPkgName, childResourceName, propertyName string, overwritePropertyValue := GetOverwriteAttributeValue(classPkgName, propertyName, "", "test_values_for_parent", testValueIndex, definitions) if overwritePropertyValue != "" { - return overwritePropertyValue + return fmt.Sprintf(`"%s"`, overwritePropertyValue) } + if children, ok := testVars["children"].(map[interface{}]interface{}); ok { - if childResources, ok := children[childResourceName].([]interface{}); ok && len(childResources) > 0 { - childResource := childResources[0].(map[interface{}]interface{}) + result := searchChildResources(children, childResourceName, propertyName) + if result != nil { + return result + } else { + return fmt.Sprintf(`"%s"`, "test_value_for_child") + } + } - if val, ok := childResource[propertyName]; ok { - return val.(string) - } + return fmt.Sprintf(`"%s_%d"`, propertyName, testValueIndex) +} + +func searchChildResources(children map[interface{}]interface{}, childResourceName, propertyName string) interface{} { + childResources, ok := children[childResourceName].([]interface{}) + if ok && len(childResources) > 0 { + for _, childResourceInterface := range childResources { + if childResource, ok := childResourceInterface.(map[interface{}]interface{}); ok { + if val, ok := childResource[propertyName]; ok { + switch val := val.(type) { + case string: + return fmt.Sprintf(`"%s"`, val) + case []interface{}: + return formatSliceWithQuotes(val) + } + } - if versionMismatch, ok := childResource["version_mismatch"].(map[interface{}]interface{}); ok { - for _, versionVars := range versionMismatch { - if versionVarsMap, ok := versionVars.(map[interface{}]interface{}); ok { - if val, ok := versionVarsMap[propertyName]; ok { - return val.(string) + if versionMismatch, ok := childResource["version_mismatch"].(map[interface{}]interface{}); ok { + for _, versionVars := range versionMismatch { + if versionVarsMap, ok := versionVars.(map[interface{}]interface{}); ok { + if val, ok := versionVarsMap[propertyName]; ok { + switch val := val.(type) { + case string: + return fmt.Sprintf(`"%s"`, val) + case []interface{}: + return formatSliceWithQuotes(val) + } + } } } } } } } else { - return fmt.Sprintf("%s_%d", propertyName, testValueIndex) + for _, childResourcesInterfaces := range children { + if childResources, ok := childResourcesInterfaces.([]interface{}); ok { + for _, childResourceInterface := range childResources { + if childResource, ok := childResourceInterface.(map[interface{}]interface{}); ok { + if nestedChildren, ok := childResource["children"].(map[interface{}]interface{}); ok { + result := searchChildResources(nestedChildren, childResourceName, propertyName) + if result != nil { + return result + } + } + } + } + } + } } - return "test_value_for_child" + return nil +} + +func formatSliceWithQuotes(val []interface{}) string { + formattedSlice := make([]string, len(val)) + for i, v := range val { + formattedSlice[i] = fmt.Sprintf("\"%v\"", v) + } + return fmt.Sprintf("[%v]", strings.Join(formattedSlice, ", ")) } func LegacyAttributeContainsNoneAttributeValue(legacyAttribute LegacyAttribute, properties map[string]Property) bool { @@ -576,6 +672,67 @@ func FromInterfacesToString(identifiedBy []interface{}) string { return fmt.Sprintf("\"%s\"", strings.Join(identifiers, "\", \"")) } +func DictForTemplates(values ...interface{}) (map[string]interface{}, error) { + if len(values)%2 != 0 { + return nil, fmt.Errorf("invalid number of arguments passed to the dict") + } + dict := make(map[string]interface{}) + for i := 0; i < len(values); i += 2 { + key, ok := values[i].(string) + if !ok { + return nil, fmt.Errorf("dict keys must be strings") + } + dict[key] = values[i+1] + } + return dict, nil +} + +// AddToTemplateProperties creates a copy of the model and updates it with the new fields provided in the form of key value pairs +func AddToTemplateProperties(model Model, values ...interface{}) (*Model, error) { + // Create a copy of the model + newModel := model + updates, err := DictForTemplates(values...) + if err != nil { + return nil, err + } + + if newModel.TemplateProperties == nil { + newModel.TemplateProperties = make(map[string]interface{}) + } + + for k, v := range updates { + newModel.TemplateProperties[k] = v + } + + return &newModel, nil +} + +// AddToChildInTestTemplate is used within the test templates for applying indentation in the test config +func AddToChildInTestTemplate(child map[interface{}]interface{}, values ...interface{}) (map[interface{}]interface{}, error) { + + newChild := make(map[interface{}]interface{}) + childValue := make(map[interface{}]interface{}) + for k, v := range child { + childValue[k] = v + } + newChild["childValue"] = childValue + + updates, err := DictForTemplates(values...) + if err != nil { + return nil, err + } + + if _, ok := newChild["TemplateProperties"]; !ok { + newChild["TemplateProperties"] = make(map[string]interface{}) + } + + for k, v := range updates { + newChild["TemplateProperties"].(map[string]interface{})[k] = v + } + + return newChild, nil +} + // Renders the templates and writes a file to the output directory func renderTemplate(templateName, outputFileName, outputPath string, outputData interface{}) { templateData, err := os.ReadFile(fmt.Sprintf("%s/%s", templatePath, templateName)) @@ -642,7 +799,7 @@ func getClassModels(definitions Definitions) map[string]Model { } for _, pkgName := range pkgNames { classModel := Model{PkgName: pkgName} - classModel.setClassModel(metaPath, false, definitions, []string{}, pkgNames) + classModel.setClassModel(metaPath, false, definitions, []string{}, pkgNames, nil, nil) classModels[pkgName] = classModel rnName := make(map[string]string) @@ -928,31 +1085,10 @@ func main() { // All classmodels have been read, thus now the model, child and relational resources names can be set // When done before additional files would need to be opened and read which would slow down the generation process model.ResourceName = GetResourceName(model.PkgName, definitions) - for _, relationshipClass := range model.RelationshipClasses { model.RelationshipResourceNames = append(model.RelationshipResourceNames, GetResourceName(relationshipClass, definitions)) } - childMap := make(map[string]Model, 0) - for childName, childModel := range model.Children { - childModel.ChildResourceName = GetResourceName(childModel.PkgName, definitions) - childModel.ResourceNameDocReference = childModel.ChildResourceName - if len(childModel.IdentifiedBy) > 0 && !childModel.MaxOneClassAllowed { - // TODO add logic to determine the naming for plural child resources - childModel.ResourceName = fmt.Sprintf("%ss", childModel.ChildResourceName) - } else { - childModel.ResourceName = childModel.ChildResourceName - } - for _, relationshipClass := range childModel.RelationshipClasses { - childModel.RelationshipResourceNames = append(childModel.RelationshipResourceNames, GetResourceName(relationshipClass, definitions)) - } - - if len(childModel.VersionMismatched) > 0 { - updateVersionMismatchedWithChildren(&model, childModel.VersionMismatched) - } - - childMap[childName] = childModel - } - model.Children = childMap + model.Children = SetChildClassNames(definitions, &model, model.Children) if model.VersionMismatched != nil { sortVersionMismatched(model.VersionMismatched) @@ -1035,8 +1171,10 @@ type Model struct { ExampleResourceFull string SubCategory string RelationshipClasses []string + RelationshipClass string MultiRelationshipClass bool RelationshipResourceNames []string + RelationshipResourceName string Versions string ChildClasses []string ContainedBy []string @@ -1075,6 +1213,14 @@ type Model struct { MultiParentFormats map[string]MultiParentFormat MultiParentFormatsTestTypes map[string]string ClassVersion string + ParentName string + ParentHierarchy string + TargetResourceClassName string + TargetResourceName string + TargetDn string + TargetProperties map[string]Property + TargetNamedProperties map[string]Property + DirectParent *Model // Below booleans are used during template rendering to determine correct rendering the go code AllowDelete bool AllowChildDelete bool @@ -1094,6 +1240,7 @@ type Model struct { HasCustomTypeProperties bool Exclude bool VersionMismatched map[string][]string + TemplateProperties map[string]interface{} } type TypeChange struct { @@ -1152,7 +1299,7 @@ type Property struct { DefaultValue string Versions string NamedPropertyClass string - IgnoreInTestExampleValue string + IgnoreInTestExampleValue interface{} ValidValuesMap map[string]string RawVersion string ModelType string @@ -1177,7 +1324,7 @@ type Definitions struct { } // Reads the class details from the meta file and sets all details to the Model -func (m *Model) setClassModel(metaPath string, child bool, definitions Definitions, parents, pkgNames []string) { +func (m *Model) setClassModel(metaPath string, isChildIteration bool, definitions Definitions, parents, pkgNames, mainParentChildren, parentHierarchyList []string) { fileContent, err := os.ReadFile(fmt.Sprintf("%s/%s.json", metaPath, m.PkgName)) if err != nil { log.Fatal("Error when opening file: ", err) @@ -1194,7 +1341,7 @@ func (m *Model) setClassModel(metaPath string, child bool, definitions Definitio m.Configuration = GetClassConfiguration(m.PkgName, definitions) for _, classDetails := range classInfo { - m.SetClassLabel(classDetails, child) + m.SetClassLabel(classDetails) m.SetClassName(classDetails) m.SetRelationshipClasses(definitions) m.SetClassRnFormat(classDetails) @@ -1209,7 +1356,10 @@ func (m *Model) setClassModel(metaPath string, child bool, definitions Definitio m.SetClassComment(classDetails) m.SetClassVersions(classDetails) m.SetClassProperties(classDetails) - m.SetClassChildren(classDetails, pkgNames) + m.SetClassChildren(classDetails, pkgNames, mainParentChildren) + if len(parents) != 0 { + m.SetParentName(parents) + } m.SetResourceNotesAndWarnigns(m.PkgName, definitions) m.SetResourceNameAsDescription(m.PkgName, definitions) m.SetTestType(classDetails, definitions) @@ -1222,34 +1372,42 @@ func (m *Model) setClassModel(metaPath string, child bool, definitions Definitio - Incorrect: Parent -> Child -> Grandchild // TODO add grandchild logic */ - if !child { - if len(m.ChildClasses) > 0 { - m.HasChild = true - m.Children = make(map[string]Model) - for _, child := range m.ChildClasses { - childModel := Model{PkgName: child} - childModel.setClassModel(metaPath, true, definitions, []string{m.PkgName}, pkgNames) - m.Children[child] = childModel - if childModel.HasValidValues { - m.HasValidValues = true - } - if len(childModel.IdentifiedBy) == 0 { - m.HasChildWithoutIdentifier = true - } - if childModel.AllowDelete { - m.AllowChildDelete = true - } - if childModel.HasBitmask { - m.HasBitmask = true - } - if childModel.HasNamedProperties { - m.HasNamedProperties = true - m.HasChildNamedProperties = true - } + m.ParentHierarchy = fmt.Sprintf("%s", strings.Join(reverseList(parentHierarchyList), "")) + + if len(parentHierarchyList) == 0 { + parentHierarchyList = []string{m.ResourceClassName} + } else { + parentHierarchyList = append(parentHierarchyList, m.ResourceClassName) + } + + if len(m.ChildClasses) > 0 { + mainParentChildren := append(mainParentChildren, m.ChildClasses...) + m.HasChild = true + m.Children = make(map[string]Model) + for _, child := range m.ChildClasses { + childModel := Model{PkgName: child} + childModel.setDirectParent(m) + childModel.setClassModel(metaPath, true, definitions, []string{m.PkgName}, pkgNames, mainParentChildren, parentHierarchyList) + m.Children[child] = childModel + if childModel.HasValidValues { + m.HasValidValues = true + } + if len(childModel.IdentifiedBy) == 0 { + m.HasChildWithoutIdentifier = true + } + if childModel.AllowDelete { + m.AllowChildDelete = true + } + if childModel.HasBitmask { + m.HasBitmask = true + } + if childModel.HasNamedProperties { + m.HasNamedProperties = true + m.HasChildNamedProperties = true } - } else { - m.HasChild = false } + } else { + m.HasChild = false } version, changes := isMigrationResource(m.PkgName, definitions) @@ -1304,7 +1462,7 @@ func GetOldType(attributeName string, typeChanges []TypeChange) string { return "" } -func (m *Model) SetClassLabel(classDetails interface{}, child bool) { +func (m *Model) SetClassLabel(classDetails interface{}) { m.Label = cleanLabel(classDetails.(map[string]interface{})["label"].(string)) if slices.Contains(labels, m.Label) || m.Label == "" { if !slices.Contains(duplicateLabels, m.Label) { @@ -1419,7 +1577,7 @@ func (m *Model) setMax1Entry() { } } -func (m *Model) SetClassChildren(classDetails interface{}, pkgNames []string) { +func (m *Model) SetClassChildren(classDetails interface{}, pkgNames, mainParentChildren []string) { childClasses := []string{} excludeChildClasses := []string{} if classDetails, ok := m.Definitions.Classes[m.PkgName]; ok { @@ -1458,6 +1616,32 @@ func (m *Model) SetClassChildren(classDetails interface{}, pkgNames []string) { m.ChildClasses = uniqueStringSlice(childClasses) } +func SetChildClassNames(definitions Definitions, model *Model, children map[string]Model) map[string]Model { + childMap := make(map[string]Model, 0) + for childName, childModel := range children { + childModel.ChildResourceName = GetResourceName(childModel.PkgName, definitions) + childModel.ResourceNameDocReference = childModel.ChildResourceName + if len(childModel.IdentifiedBy) > 0 && !childModel.MaxOneClassAllowed { + // TODO add logic to determine the naming for plural child resources + childModel.ResourceName = fmt.Sprintf("%ss", childModel.ChildResourceName) + } else { + childModel.ResourceName = childModel.ChildResourceName + } + for _, relationshipClass := range childModel.RelationshipClasses { + childModel.RelationshipResourceNames = append(childModel.RelationshipResourceNames, GetResourceName(relationshipClass, definitions)) + } + + if len(childModel.VersionMismatched) > 0 { + sortVersionMismatched(childModel.VersionMismatched) + updateVersionMismatchedWithChildren(model, childModel.VersionMismatched) + } + childModel.Children = SetChildClassNames(definitions, model, childModel.Children) + + childMap[childName] = childModel + } + return childMap +} + func (m *Model) SetClassInclude() { if classDetails, ok := m.Definitions.Classes[m.PkgName]; ok { for key, value := range classDetails.(map[interface{}]interface{}) { @@ -1468,6 +1652,18 @@ func (m *Model) SetClassInclude() { } } +func (m *Model) SetClassExclude() { + if classDetails, ok := m.Definitions.Classes[m.PkgName]; ok { + for key, value := range classDetails.(map[interface{}]interface{}) { + if key.(string) == "exclude" { + m.Exclude = value.(bool) + } else { + m.Exclude = false + } + } + } +} + func (m *Model) SetClassAllowDelete(classDetails interface{}) { if classDetails.(map[string]interface{})["isCreatableDeletable"].(string) == "never" || !AllowClassDelete(m.PkgName, m.Definitions) { m.AllowDelete = false @@ -1476,6 +1672,22 @@ func (m *Model) SetClassAllowDelete(classDetails interface{}) { } } +func (m *Model) SetParentName(classPkgName []string) { + m.ParentName = classPkgName[0] +} + +func (m *Model) setDirectParent(parentModel *Model) { + m.DirectParent = parentModel +} + +func reverseList(items []string) []string { + reversedList := make([]string, len(items)) + for i, item := range items { + reversedList[len(items)-1-i] = item + } + return reversedList +} + // Determine if a class is allowed to be deleted as defined in the classes.yaml file // Flag created to ensure classes that only classes allowed to be deleted are deleted func (m *Model) SetResourceNotesAndWarnigns(classPkgName string, definitions Definitions) { @@ -1527,16 +1739,6 @@ func (m *Model) SetTestType(classDetails interface{}, definitions Definitions) { } } -func (m *Model) SetClassExclude() { - if classDetails, ok := m.Definitions.Classes[m.PkgName]; ok { - for key, value := range classDetails.(map[interface{}]interface{}) { - if key.(string) == "exclude" { - m.Exclude = value.(bool) - } - } - } -} - // Determine if a class is allowed to be deleted as defined in the classes.yaml file // Flag created to ensure classes that only classes allowed to be deleted are deleted func AllowClassDelete(classPkgName string, definitions Definitions) bool { @@ -1600,11 +1802,14 @@ func (m *Model) SetClassVersions(classDetails interface{}) { } func (m *Model) SetTestApplicableFromVersion(classDetails interface{}) { - versions, ok := classDetails.(map[string]interface{})["versions"] - if ok { - m.ClassVersion = versions.(string) - } else { - m.ClassVersion = "unknown" + m.ClassVersion = GetOverwriteClassVersion(m.PkgName, m.Definitions) + if m.ClassVersion == "" { + versions, ok := classDetails.(map[string]interface{})["versions"] + if ok { + m.ClassVersion = versions.(string) + } else { + m.ClassVersion = "unknown" + } } } @@ -1636,7 +1841,6 @@ func (m *Model) SetClassProperties(classDetails interface{}) { if ignoreProperty(propertyName, m.PkgName, m.Definitions) { continue } - ignoreInTest, ignoreInTestExampleValue := ignoreTestProperty(propertyName, m.PkgName, m.Definitions) property := Property{ @@ -1739,7 +1943,7 @@ func (m *Model) SetClassProperties(classDetails interface{}) { if reflect.TypeOf(val).String() == "string" { property.DefaultValue = val.(string) } else if reflect.TypeOf(val).String() == "float64" { - property.DefaultValue = fmt.Sprintf("%f", val.(float64)) + property.DefaultValue = fmt.Sprintf("%g", val.(float64)) } else { log.Fatal(fmt.Sprintf("Reflect type %s not defined. Define in SetClassProperties function.", reflect.TypeOf(val).String())) } @@ -1796,7 +2000,7 @@ func (m *Model) SetClassProperties(classDetails interface{}) { } } -func ignoreTestProperty(propertyName, classPkgName string, definitions Definitions) (bool, string) { +func ignoreTestProperty(propertyName, classPkgName string, definitions Definitions) (bool, interface{}) { precedenceList := []string{classPkgName, "global"} for _, precedence := range precedenceList { @@ -1805,7 +2009,12 @@ func ignoreTestProperty(propertyName, classPkgName string, definitions Definitio if key.(string) == "ignore_properties_in_test" { for k, v := range value.(map[interface{}]interface{}) { if k.(string) == propertyName { - return true, v.(string) + switch val := v.(type) { + case []interface{}: + return true, formatSliceWithQuotes(val) + default: + return true, fmt.Sprintf(`"%s"`, val) + } } } } @@ -2287,6 +2496,17 @@ func GetOverwriteTestType(classPkgName string, definitions Definitions) string { return "" } +func GetOverwriteClassVersion(classPkgName string, definitions Definitions) string { + if v, ok := definitions.Classes[classPkgName]; ok { + for key, value := range v.(map[interface{}]interface{}) { + if key.(string) == "class_version" { + return value.(string) + } + } + } + return "" +} + type MultiParentFormat struct { RnPrepend string WrapperClass string @@ -2690,15 +2910,6 @@ func isMigrationResource(classPkgName string, definitions Definitions) (bool, bo return version, changes } -func resourcesExcluded(excludeResources []interface{}, containedClassName string) bool { - for _, item := range excludeResources { - if s, ok := item.(string); ok && s == containedClassName { - return true - } - } - return false -} - // Set variables that are used during the rendering of the example and documentation templates func setDocumentationData(m *Model, definitions Definitions) { UiLocations := []string{} diff --git a/gen/meta/commHttp.json b/gen/meta/commHttp.json new file mode 100644 index 000000000..36bdcdab4 --- /dev/null +++ b/gen/meta/commHttp.json @@ -0,0 +1,1649 @@ +{ + "comm:Http": { + "contains": { + "aaa:RbacAnnotation": "", + "comm:WebConnAg15min": "", + "comm:WebConnAg1d": "", + "comm:WebConnAg1h": "", + "comm:WebConnAg1mo": "", + "comm:WebConnAg1qtr": "", + "comm:WebConnAg1w": "", + "comm:WebConnAg1year": "", + "comm:WebConnAgHist15min": "", + "comm:WebConnAgHist1d": "", + "comm:WebConnAgHist1h": "", + "comm:WebConnAgHist1mo": "", + "comm:WebConnAgHist1qtr": "", + "comm:WebConnAgHist1w": "", + "comm:WebConnAgHist1year": "", + "comm:WebConnStatesAg15min": "", + "comm:WebConnStatesAg1d": "", + "comm:WebConnStatesAg1h": "", + "comm:WebConnStatesAg1mo": "", + "comm:WebConnStatesAg1qtr": "", + "comm:WebConnStatesAg1w": "", + "comm:WebConnStatesAg1year": "", + "comm:WebConnStatesAgHist15min": "", + "comm:WebConnStatesAgHist1d": "", + "comm:WebConnStatesAgHist1h": "", + "comm:WebConnStatesAgHist1mo": "", + "comm:WebConnStatesAgHist1qtr": "", + "comm:WebConnStatesAgHist1w": "", + "comm:WebConnStatesAgHist1year": "", + "comm:WebProxy": "", + "comm:WebReqAg15min": "", + "comm:WebReqAg1d": "", + "comm:WebReqAg1h": "", + "comm:WebReqAg1mo": "", + "comm:WebReqAg1qtr": "", + "comm:WebReqAg1w": "", + "comm:WebReqAg1year": "", + "comm:WebReqAgHist15min": "", + "comm:WebReqAgHist1d": "", + "comm:WebReqAgHist1h": "", + "comm:WebReqAgHist1mo": "", + "comm:WebReqAgHist1qtr": "", + "comm:WebReqAgHist1w": "", + "comm:WebReqAgHist1year": "", + "fault:Counts": "", + "fault:Delegate": "", + "fault:Inst": "", + "health:Inst": "", + "tag:Annotation": "", + "tag:Tag": "" + }, + "rnMap": { + "CDcommWebConnAg15min": "comm:WebConnAg15min", + "CDcommWebConnAg1d": "comm:WebConnAg1d", + "CDcommWebConnAg1h": "comm:WebConnAg1h", + "CDcommWebConnAg1mo": "comm:WebConnAg1mo", + "CDcommWebConnAg1qtr": "comm:WebConnAg1qtr", + "CDcommWebConnAg1w": "comm:WebConnAg1w", + "CDcommWebConnAg1year": "comm:WebConnAg1year", + "CDcommWebConnStatesAg15min": "comm:WebConnStatesAg15min", + "CDcommWebConnStatesAg1d": "comm:WebConnStatesAg1d", + "CDcommWebConnStatesAg1h": "comm:WebConnStatesAg1h", + "CDcommWebConnStatesAg1mo": "comm:WebConnStatesAg1mo", + "CDcommWebConnStatesAg1qtr": "comm:WebConnStatesAg1qtr", + "CDcommWebConnStatesAg1w": "comm:WebConnStatesAg1w", + "CDcommWebConnStatesAg1year": "comm:WebConnStatesAg1year", + "CDcommWebReqAg15min": "comm:WebReqAg15min", + "CDcommWebReqAg1d": "comm:WebReqAg1d", + "CDcommWebReqAg1h": "comm:WebReqAg1h", + "CDcommWebReqAg1mo": "comm:WebReqAg1mo", + "CDcommWebReqAg1qtr": "comm:WebReqAg1qtr", + "CDcommWebReqAg1w": "comm:WebReqAg1w", + "CDcommWebReqAg1year": "comm:WebReqAg1year", + "HDcommWebConnAg15min-": "comm:WebConnAgHist15min", + "HDcommWebConnAg1d-": "comm:WebConnAgHist1d", + "HDcommWebConnAg1h-": "comm:WebConnAgHist1h", + "HDcommWebConnAg1mo-": "comm:WebConnAgHist1mo", + "HDcommWebConnAg1qtr-": "comm:WebConnAgHist1qtr", + "HDcommWebConnAg1w-": "comm:WebConnAgHist1w", + "HDcommWebConnAg1year-": "comm:WebConnAgHist1year", + "HDcommWebConnStatesAg15min-": "comm:WebConnStatesAgHist15min", + "HDcommWebConnStatesAg1d-": "comm:WebConnStatesAgHist1d", + "HDcommWebConnStatesAg1h-": "comm:WebConnStatesAgHist1h", + "HDcommWebConnStatesAg1mo-": "comm:WebConnStatesAgHist1mo", + "HDcommWebConnStatesAg1qtr-": "comm:WebConnStatesAgHist1qtr", + "HDcommWebConnStatesAg1w-": "comm:WebConnStatesAgHist1w", + "HDcommWebConnStatesAg1year-": "comm:WebConnStatesAgHist1year", + "HDcommWebReqAg15min-": "comm:WebReqAgHist15min", + "HDcommWebReqAg1d-": "comm:WebReqAgHist1d", + "HDcommWebReqAg1h-": "comm:WebReqAgHist1h", + "HDcommWebReqAg1mo-": "comm:WebReqAgHist1mo", + "HDcommWebReqAg1qtr-": "comm:WebReqAgHist1qtr", + "HDcommWebReqAg1w-": "comm:WebReqAgHist1w", + "HDcommWebReqAg1year-": "comm:WebReqAgHist1year", + "annotationKey-": "tag:Annotation", + "fault-": "fault:Inst", + "fd-": "fault:Delegate", + "fltCnts": "fault:Counts", + "health": "health:Inst", + "rbacDom-": "aaa:RbacAnnotation", + "tagKey-": "tag:Tag", + "wp-": "comm:WebProxy" + }, + "identifiedBy": [ + + ], + "rnFormat": "http", + "containedBy": { + "comm:Pol": "" + }, + "superClasses": [ + "comm:Web", + "comm:Comp", + "pol:Comp", + "pol:Obj", + "naming:NamedObject" + ], + "subClasses": { + + }, + "relationFrom": { + + }, + "relationTo": { + + }, + "dnFormats": [ + "uni/fabric/comm-{name}/http" + ], + "writeAccess": [ + "aaa", + "admin" + ], + "readAccess": [ + "aaa", + "admin", + "fabric-equipment" + ], + "faults": { + + }, + "events": { + "E4205023": "modification||comm:Http", + "E4211219": "creation||comm:Http", + "E4211220": "modification||comm:Http", + "E4211221": "deletion||comm:Http" + }, + "stats": { + "comm:WebConnAg15min": { + "comment": [ + "A class that represents the most current aggregated statistics for web connections in a 15 minute sampling interval. This class updates every 5 minutes." + ] + }, + "comm:WebConnAg1d": { + "comment": [ + "A class that represents the most current aggregated statistics for web connections in a 1 day sampling interval. This class updates every hour." + ] + }, + "comm:WebConnAg1h": { + "comment": [ + "A class that represents the most current aggregated statistics for web connections in a 1 hour sampling interval. This class updates every 15 minutes." + ] + }, + "comm:WebConnAg1mo": { + "comment": [ + "A class that represents the most current aggregated statistics for web connections in a 1 month sampling interval. This class updates every day." + ] + }, + "comm:WebConnAg1qtr": { + "comment": [ + "A class that represents the most current aggregated statistics for web connections in a 1 quarter sampling interval. This class updates every day." + ] + }, + "comm:WebConnAg1w": { + "comment": [ + "A class that represents the most current aggregated statistics for web connections in a 1 week sampling interval. This class updates every day." + ] + }, + "comm:WebConnAg1year": { + "comment": [ + "A class that represents the most current aggregated statistics for web connections in a 1 year sampling interval. This class updates every day." + ] + }, + "comm:WebConnAgHist15min": { + "comment": [ + "A class that represents historical aggregated statistics for web connections in a 15 minute sampling interval. This class updates every 5 minutes." + ] + }, + "comm:WebConnAgHist1d": { + "comment": [ + "A class that represents historical aggregated statistics for web connections in a 1 day sampling interval. This class updates every hour." + ] + }, + "comm:WebConnAgHist1h": { + "comment": [ + "A class that represents historical aggregated statistics for web connections in a 1 hour sampling interval. This class updates every 15 minutes." + ] + }, + "comm:WebConnAgHist1mo": { + "comment": [ + "A class that represents historical aggregated statistics for web connections in a 1 month sampling interval. This class updates every day." + ] + }, + "comm:WebConnAgHist1qtr": { + "comment": [ + "A class that represents historical aggregated statistics for web connections in a 1 quarter sampling interval. This class updates every day." + ] + }, + "comm:WebConnAgHist1w": { + "comment": [ + "A class that represents historical aggregated statistics for web connections in a 1 week sampling interval. This class updates every day." + ] + }, + "comm:WebConnAgHist1year": { + "comment": [ + "A class that represents historical aggregated statistics for web connections in a 1 year sampling interval. This class updates every day." + ] + }, + "comm:WebConnStatesAg15min": { + "comment": [ + "A class that represents the most current aggregated statistics for web connections state in a 15 minute sampling interval. This class updates every 5 minutes." + ] + }, + "comm:WebConnStatesAg1d": { + "comment": [ + "A class that represents the most current aggregated statistics for web connections state in a 1 day sampling interval. This class updates every hour." + ] + }, + "comm:WebConnStatesAg1h": { + "comment": [ + "A class that represents the most current aggregated statistics for web connections state in a 1 hour sampling interval. This class updates every 15 minutes." + ] + }, + "comm:WebConnStatesAg1mo": { + "comment": [ + "A class that represents the most current aggregated statistics for web connections state in a 1 month sampling interval. This class updates every day." + ] + }, + "comm:WebConnStatesAg1qtr": { + "comment": [ + "A class that represents the most current aggregated statistics for web connections state in a 1 quarter sampling interval. This class updates every day." + ] + }, + "comm:WebConnStatesAg1w": { + "comment": [ + "A class that represents the most current aggregated statistics for web connections state in a 1 week sampling interval. This class updates every day." + ] + }, + "comm:WebConnStatesAg1year": { + "comment": [ + "A class that represents the most current aggregated statistics for web connections state in a 1 year sampling interval. This class updates every day." + ] + }, + "comm:WebConnStatesAgHist15min": { + "comment": [ + "A class that represents historical aggregated statistics for web connections state in a 15 minute sampling interval. This class updates every 5 minutes." + ] + }, + "comm:WebConnStatesAgHist1d": { + "comment": [ + "A class that represents historical aggregated statistics for web connections state in a 1 day sampling interval. This class updates every hour." + ] + }, + "comm:WebConnStatesAgHist1h": { + "comment": [ + "A class that represents historical aggregated statistics for web connections state in a 1 hour sampling interval. This class updates every 15 minutes." + ] + }, + "comm:WebConnStatesAgHist1mo": { + "comment": [ + "A class that represents historical aggregated statistics for web connections state in a 1 month sampling interval. This class updates every day." + ] + }, + "comm:WebConnStatesAgHist1qtr": { + "comment": [ + "A class that represents historical aggregated statistics for web connections state in a 1 quarter sampling interval. This class updates every day." + ] + }, + "comm:WebConnStatesAgHist1w": { + "comment": [ + "A class that represents historical aggregated statistics for web connections state in a 1 week sampling interval. This class updates every day." + ] + }, + "comm:WebConnStatesAgHist1year": { + "comment": [ + "A class that represents historical aggregated statistics for web connections state in a 1 year sampling interval. This class updates every day." + ] + }, + "comm:WebReqAg15min": { + "comment": [ + "A class that represents the most current aggregated statistics for web requests in a 15 minute sampling interval. This class updates every 5 minutes." + ] + }, + "comm:WebReqAg1d": { + "comment": [ + "A class that represents the most current aggregated statistics for web requests in a 1 day sampling interval. This class updates every hour." + ] + }, + "comm:WebReqAg1h": { + "comment": [ + "A class that represents the most current aggregated statistics for web requests in a 1 hour sampling interval. This class updates every 15 minutes." + ] + }, + "comm:WebReqAg1mo": { + "comment": [ + "A class that represents the most current aggregated statistics for web requests in a 1 month sampling interval. This class updates every day." + ] + }, + "comm:WebReqAg1qtr": { + "comment": [ + "A class that represents the most current aggregated statistics for web requests in a 1 quarter sampling interval. This class updates every day." + ] + }, + "comm:WebReqAg1w": { + "comment": [ + "A class that represents the most current aggregated statistics for web requests in a 1 week sampling interval. This class updates every day." + ] + }, + "comm:WebReqAg1year": { + "comment": [ + "A class that represents the most current aggregated statistics for web requests in a 1 year sampling interval. This class updates every day." + ] + }, + "comm:WebReqAgHist15min": { + "comment": [ + "A class that represents historical aggregated statistics for web requests in a 15 minute sampling interval. This class updates every 5 minutes." + ] + }, + "comm:WebReqAgHist1d": { + "comment": [ + "A class that represents historical aggregated statistics for web requests in a 1 day sampling interval. This class updates every hour." + ] + }, + "comm:WebReqAgHist1h": { + "comment": [ + "A class that represents historical aggregated statistics for web requests in a 1 hour sampling interval. This class updates every 15 minutes." + ] + }, + "comm:WebReqAgHist1mo": { + "comment": [ + "A class that represents historical aggregated statistics for web requests in a 1 month sampling interval. This class updates every day." + ] + }, + "comm:WebReqAgHist1qtr": { + "comment": [ + "A class that represents historical aggregated statistics for web requests in a 1 quarter sampling interval. This class updates every day." + ] + }, + "comm:WebReqAgHist1w": { + "comment": [ + "A class that represents historical aggregated statistics for web requests in a 1 week sampling interval. This class updates every day." + ] + }, + "comm:WebReqAgHist1year": { + "comment": [ + "A class that represents historical aggregated statistics for web requests in a 1 year sampling interval. This class updates every day." + ] + } + }, + "versions": "1.0(1e)-", + "isAbstract": false, + "isConfigurable": true, + "isContextRoot": false, + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false, + "isEncrypted": false, + "isExportable": true, + "isPersistent": true, + "isSubjectToQuota": false, + "isObservable": true, + "hasStats": true, + "isStat": false, + "isFaultable": true, + "isDomainable": false, + "isHealthScorable": true, + "shouldCollectHealthStats": false, + "healthCollectionSource": "faults", + "hasEventRules": false, + "abstractionLayer": "ambiguous", + "apicNxProcessing": false, + "monitoringPolicySource": "Parent", + "isCreatableDeletable": "never", + "platformFlavors": [ + + ], + "classId": "1577", + "className": "Http", + "classPkg": "comm", + "featureTag": "", + "moCategory": "Regular", + "label": "HTTP Service", + "comment": [ + "HTTP" + ], + "properties": { + "accessControlAllowCredential": { + "versions": "2.3(1e)-", + "isConfigurable": true, + "propGlobalId": "33388", + "propLocalId": "7960", + "label": "accessControlAllowCredential", + "baseType": "scalar:Enum8", + "modelType": "comm:AllowCredentialState", + "needsPropDelimiters": false, + "uitype": "enum", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "disabled", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "2", "localName": "disabled", + "platformFlavors": [ + + ], + "label": "Disabled "}, + { "value": "1", "localName": "enabled", + "platformFlavors": [ + + ], + "label": "Enabled "} + ], + "default": "disabled", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "accessControlAllowOrigins": { + "versions": "1.1(1j)-", + "comment": [ + "" + ], + "isConfigurable": true, + "propGlobalId": "17866", + "propLocalId": "4636", + "label": "accessControlAllowOrigins", + "baseType": "string:Basic", + "modelType": "comm:UrlList", + "needsPropDelimiters": false, + "uitype": "string", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validators": [ + {"min" : 0, "max": 256, + "regexs": [ + {"regex" : "^[a-zA-Z0-9-_:/.,\\*\\s]+$", "type": "include"} + ] + } + ], + "validValues": [ + { "value": "", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "} + ], + "default": "", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "adminSt": { + "versions": "1.0(1e)-", + "comment": [ + "The state of the HTTP communication service. This can be enabled or disabled." + ], + "isConfigurable": true, + "propGlobalId": "1294", + "propLocalId": "46", + "label": "Admin State", + "baseType": "scalar:Enum8", + "modelType": "comm:AdminState", + "needsPropDelimiters": false, + "uitype": "enum", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": true, + "isLike": false, + "validValues": [ + { "value": "disabled", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "2", "localName": "disabled", + "platformFlavors": [ + + ], + "label": "Disabled "}, + { "value": "1", "localName": "enabled", + "platformFlavors": [ + + ], + "label": "Enabled "} + ], + "default": "disabled", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "annotation": { + "versions": "3.2(1l)-", + "comment": [ + "User annotation. Suggested format orchestrator:value" + ], + "isConfigurable": true, + "propGlobalId": "37531", + "propLocalId": "8719", + "label": "Annotation", + "baseType": "string:Basic", + "modelType": "mo:Annotation", + "needsPropDelimiters": false, + "uitype": "string", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validators": [ + {"min" : 0, "max": 128, + "regexs": [ + {"regex" : "^[a-zA-Z0-9_.:-]+$", "type": "include"} + ] + } + ], + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "childAction": { + "versions": "1.0(1e)-", + "comment": [ + "Delete or ignore. For internal use only." + ], + "isConfigurable": false, + "propGlobalId": "4", + "propLocalId": "5", + "label": "childAction", + "baseType": "scalar:Bitmask32", + "modelType": "mo:ModificationChildAction", + "needsPropDelimiters": false, + "uitype": "bitmask", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "16384", "localName": "deleteAll", + "platformFlavors": [ + + ], + "label": "Delete All "}, + { "value": "8192", "localName": "deleteNonPresent", + "platformFlavors": [ + + ], + "label": "Delete Non Present "}, + { "value": "4096", "localName": "ignore", + "platformFlavors": [ + + ], + "label": "Ignore "} + ], + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "cliOnlyMode": { + "versions": "4.1(1i)-", + "isConfigurable": true, + "propGlobalId": "47671", + "propLocalId": "10837", + "label": "CLI only mode", + "baseType": "scalar:Enum8", + "modelType": "comm:CliOnlyMode", + "needsPropDelimiters": false, + "uitype": "enum", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "disabled", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "2", "localName": "disabled", + "platformFlavors": [ + + ], + "label": "Disabled "}, + { "value": "1", "localName": "enabled", + "platformFlavors": [ + + ], + "label": "Enabled "} + ], + "default": "disabled", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "descr": { + "versions": "1.0(1e)-", + "comment": [ + "Specifies the description of a policy component." + ], + "isConfigurable": true, + "propGlobalId": "5582", + "propLocalId": "28", + "label": "Description", + "baseType": "string:Basic", + "modelType": "naming:Descr", + "needsPropDelimiters": false, + "uitype": "string", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": false, + "isLike": true, + "likeProp": "naming:Described:descr", + "validators": [ + {"min" : 0, "max": 128, + "regexs": [ + {"regex" : "^[a-zA-Z0-9\\\\!#$%()*,-./:;@ _{|}~?&+]+$", "type": "include"} + ] + } + ], + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "dn": { + "versions": "1.0(1e)-", + "comment": [ + "A tag or metadata is a non-hierarchical keyword or term assigned to the fabric module." + ], + "isConfigurable": false, + "propGlobalId": "1", + "propLocalId": "2", + "label": "dn", + "baseType": "reference:BinRef", + "modelType": "reference:BinRef", + "needsPropDelimiters": true, + "uitype": "auto", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "extMngdBy": { + "versions": "3.2(1l)-", + "comment": [ + "Indicates which orchestrator is managing this MO" + ], + "isConfigurable": false, + "propGlobalId": "39670", + "propLocalId": "8023", + "label": "Managed By", + "baseType": "scalar:Bitmask32", + "modelType": "mo:ExtMngdByType", + "needsPropDelimiters": false, + "uitype": "bitmask", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "undefined", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "1", "localName": "msc", + "platformFlavors": [ + + ], + "label": "MSC "}, + { "value": "0", "localName": "undefined", + "platformFlavors": [ + + ], + "label": "Undefined "} + ], + "default": "undefined", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "globalThrottleRate": { + "versions": "4.2(1i)-", + "isConfigurable": true, + "propGlobalId": "52997", + "propLocalId": "12189", + "label": "The maximum MO api calls allowed per unit time", + "baseType": "scalar:Uint32", + "modelType": "scalar:Uint32", + "needsPropDelimiters": false, + "uitype": "number", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validators": [ + {"min" : 1, "max": 10000 } + ], + "validValues": [ + { "value": "10000", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "} + ], + "default": 10000, + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "globalThrottleSt": { + "versions": "4.2(1i)-", + "isConfigurable": true, + "propGlobalId": "52996", + "propLocalId": "12188", + "label": "Throttle state for all clients without tag0 in header", + "baseType": "scalar:Enum8", + "modelType": "comm:AdminState", + "needsPropDelimiters": false, + "uitype": "enum", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "disabled", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "2", "localName": "disabled", + "platformFlavors": [ + + ], + "label": "Disabled "}, + { "value": "1", "localName": "enabled", + "platformFlavors": [ + + ], + "label": "Enabled "} + ], + "default": "disabled", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "globalThrottleUnit": { + "versions": "4.2(1i)-", + "isConfigurable": true, + "propGlobalId": "52998", + "propLocalId": "12190", + "label": "Unit of rate limit", + "baseType": "string:Basic", + "modelType": "comm:RateUnitType", + "needsPropDelimiters": false, + "uitype": "string", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validators": [ + {"regex" : "^[r]/[ms]$", "type": "include"} + ], + "validValues": [ + { "value": "r/s", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "} + ], + "default": "r/s", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "lcOwn": { + "versions": "1.0(1e)-", + "comment": [ + "A value that indicates how this object was created. For internal use only." + ], + "isConfigurable": false, + "propGlobalId": "9", + "propLocalId": "9", + "label": "lcOwn", + "baseType": "scalar:Enum8", + "modelType": "mo:Owner", + "needsPropDelimiters": false, + "uitype": "enum", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "local", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "4", "localName": "implicit", + "platformFlavors": [ + + ], + "label": "Implicit "}, + { "value": "0", "localName": "local", + "platformFlavors": [ + + ], + "label": "Local "}, + { "value": "1", "localName": "policy", + "platformFlavors": [ + + ], + "label": "Policy "}, + { "value": "2", "localName": "replica", + "platformFlavors": [ + + ], + "label": "Replica "}, + { "value": "3", "localName": "resolveOnBehalf", + "platformFlavors": [ + + ], + "label": "Resolved On Behalf "} + ], + "default": "local", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "maxRequestStatusCount": { + "versions": "1.1(1j)-", + "isConfigurable": true, + "propGlobalId": "19814", + "propLocalId": "5134", + "label": "The maximum number of request status objects to keep", + "baseType": "scalar:Uint32", + "modelType": "scalar:Uint32", + "needsPropDelimiters": false, + "uitype": "number", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validators": [ + {"min" : 0, "max": 1024 } + ], + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "modTs": { + "versions": "1.0(1e)-", + "comment": [ + "The time when this object was last modified." + ], + "isConfigurable": false, + "propGlobalId": "7", + "propLocalId": "7", + "label": "modTs", + "baseType": "scalar:Date", + "modelType": "mo:TStamp", + "needsPropDelimiters": false, + "uitype": "auto", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "never", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "0", "localName": "never", + "platformFlavors": [ + + ], + "label": "Never "} + ], + "default": "never", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "monPolDn": { + "versions": "1.1(1j)-", + "comment": [ + "The monitoring policy attached to this observable object." + ], + "isConfigurable": false, + "propGlobalId": "19755", + "propLocalId": "228", + "label": "Monitoring Policy", + "baseType": "reference:BinRef", + "modelType": "reference:BinRef", + "needsPropDelimiters": true, + "uitype": "auto", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "name": { + "versions": "1.0(1e)-", + "comment": [ + "null" + ], + "isConfigurable": true, + "propGlobalId": "1292", + "propLocalId": "13", + "label": "Name", + "baseType": "string:Basic", + "modelType": "naming:Name", + "needsPropDelimiters": false, + "uitype": "string", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": true, + "isLike": false, + "validators": [ + {"min" : 0, "max": 64, + "regexs": [ + {"regex" : "^[a-zA-Z0-9_.:-]+$", "type": "include"} + ] + } + ], + "validValues": [ + { "value": "http", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "} + ], + "default": "http", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "nameAlias": { + "versions": "2.2(1k)-", + "isConfigurable": true, + "propGlobalId": "28417", + "propLocalId": "6719", + "label": "Display Name", + "baseType": "string:Basic", + "modelType": "naming:NameAlias", + "needsPropDelimiters": false, + "uitype": "string", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validators": [ + {"min" : 0, "max": 63, + "regexs": [ + {"regex" : "^[a-zA-Z0-9_.-]+$", "type": "include"} + ] + } + ], + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "nodeExporter": { + "versions": "5.2(3e)-", + "isConfigurable": true, + "propGlobalId": "65280", + "propLocalId": "14483", + "label": "Node Exporter service", + "baseType": "scalar:Enum8", + "modelType": "comm:NodeExporter", + "needsPropDelimiters": false, + "uitype": "enum", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "disabled", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "2", "localName": "disabled", + "platformFlavors": [ + + ], + "label": "Disabled "}, + { "value": "1", "localName": "enabled", + "platformFlavors": [ + + ], + "label": "Enabled "} + ], + "default": "disabled", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "port": { + "versions": "1.0(1e)-", + "comment": [ + "The port used for HTTP communication service." + ], + "isConfigurable": true, + "propGlobalId": "1293", + "propLocalId": "127", + "label": "Port", + "baseType": "scalar:Uint32", + "modelType": "comm:Port", + "needsPropDelimiters": false, + "uitype": "number", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": true, + "isLike": false, + "validators": [ + {"min" : 1, "max": 65535 } + ], + "validValues": [ + { "value": "80", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "} + ], + "default": 80, + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "proto": { + "versions": "1.0(1e)-", + "comment": [ + "The list of protocols to match." + ], + "isConfigurable": false, + "propGlobalId": "1289", + "propLocalId": "144", + "label": "proto", + "baseType": "scalar:Enum8", + "modelType": "comm:Protocol", + "needsPropDelimiters": false, + "uitype": "enum", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": true, + "isLike": false, + "validValues": [ + { "value": "3", "localName": "all", + "platformFlavors": [ + + ], + "label": "All "}, + { "value": "tcp", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "0", "localName": "none", + "platformFlavors": [ + + ], + "label": "None "}, + { "value": "1", "localName": "tcp", + "platformFlavors": [ + + ], + "label": "tcp "}, + { "value": "2", "localName": "udp", + "platformFlavors": [ + + ], + "label": "udp "} + ], + "default": "tcp", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "redirectSt": { + "versions": "1.0(1e)-", + "comment": [ + "The state of HTTPS communication service. This can be enabled or disabled." + ], + "isConfigurable": true, + "propGlobalId": "1295", + "propLocalId": "681", + "label": "Redirect State", + "baseType": "scalar:Enum8", + "modelType": "comm:Redirect", + "needsPropDelimiters": false, + "uitype": "enum", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "disabled", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "2", "localName": "disabled", + "platformFlavors": [ + + ], + "label": "Disabled "}, + { "value": "1", "localName": "enabled", + "platformFlavors": [ + + ], + "label": "Enabled "}, + { "value": "3", "localName": "tested", + "platformFlavors": [ + + ], + "label": "Tested "} + ], + "default": "disabled", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "rn": { + "versions": "1.0(1e)-", + "comment": [ + "Identifies an object from its siblings within the context of its parent object. The distinguished name contains a sequence of relative names." + ], + "isConfigurable": false, + "propGlobalId": "2", + "propLocalId": "3", + "label": "rn", + "baseType": "reference:BinRN", + "modelType": "reference:BinRN", + "needsPropDelimiters": true, + "uitype": "auto", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "serverHeader": { + "versions": "5.2(1g)-", + "isConfigurable": true, + "propGlobalId": "63693", + "propLocalId": "13996", + "label": "Server Header Response", + "baseType": "scalar:Enum8", + "modelType": "comm:ServerHeader", + "needsPropDelimiters": false, + "uitype": "enum", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "enabled", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "2", "localName": "disabled", + "platformFlavors": [ + + ], + "label": "Disabled "}, + { "value": "1", "localName": "enabled", + "platformFlavors": [ + + ], + "label": "Enabled "} + ], + "default": "enabled", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "status": { + "versions": "1.0(1e)-", + "comment": [ + "The upgrade status. This property is for internal use only." + ], + "isConfigurable": false, + "propGlobalId": "3", + "propLocalId": "4", + "label": "status", + "baseType": "scalar:Bitmask32", + "modelType": "mo:ModificationStatus", + "needsPropDelimiters": false, + "uitype": "bitmask", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "2", "localName": "created", + "platformFlavors": [ + + ], + "comment": [ + "In a setter method: specifies that an object should be created. An error is returned if the object already exists. \nIn the return value of a setter method: indicates that an object has been created. \n" + ], + "label": "Created "}, + { "value": "8", "localName": "deleted", + "platformFlavors": [ + + ], + "comment": [ + "In a setter method: specifies that an object should be deleted. \nIn the return value of a setter method: indicates that an object has been deleted.\n" + ], + "label": "Deleted "}, + { "value": "4", "localName": "modified", + "platformFlavors": [ + + ], + "comment": [ + "In a setter method: specifies that an object should be modified \nIn the return value of a setter method: indicates that an object has been modified.\n" + ], + "label": "Modified "} + ], + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "throttleRate": { + "versions": "3.1(1i)-", + "isConfigurable": true, + "propGlobalId": "36782", + "propLocalId": "8597", + "label": "The maximum login/refresh allowed per second", + "baseType": "scalar:Uint32", + "modelType": "scalar:Uint32", + "needsPropDelimiters": false, + "uitype": "number", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validators": [ + {"min" : 1, "max": 100 } + ], + "validValues": [ + { "value": "2", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "} + ], + "default": 2, + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "throttleSt": { + "versions": "3.1(1i)-", + "isConfigurable": true, + "propGlobalId": "36781", + "propLocalId": "8596", + "label": "Login/refresh throttle state", + "baseType": "scalar:Enum8", + "modelType": "comm:AdminState", + "needsPropDelimiters": false, + "uitype": "enum", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "enabled", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "2", "localName": "disabled", + "platformFlavors": [ + + ], + "label": "Disabled "}, + { "value": "1", "localName": "enabled", + "platformFlavors": [ + + ], + "label": "Enabled "} + ], + "default": "enabled", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "uid": { + "versions": "1.0(1e)-", + "comment": [ + "A unique identifier for this object." + ], + "isConfigurable": false, + "propGlobalId": "8", + "propLocalId": "8", + "label": "uid", + "baseType": "scalar:Uint16", + "modelType": "scalar:Uint16", + "needsPropDelimiters": false, + "uitype": "auto", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "userdom": { + "versions": "5.0(1k)-", + "isConfigurable": true, + "propGlobalId": "60657", + "propLocalId": "13244", + "label": "userdom", + "baseType": "string:Basic", + "modelType": "mo:UserDomType", + "needsPropDelimiters": false, + "uitype": "string", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validators": [ + {"min" : 0, "max": 1024, + "regexs": [ + {"regex" : "^[a-zA-Z0-9_.:-]+$", "type": "include"} + ] + } + ], + "validValues": [ + { "value": "all", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "} + ], + "default": "all", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "visoreAccess": { + "versions": "3.1(1i)-", + "isConfigurable": true, + "propGlobalId": "35416", + "propLocalId": "8263", + "label": "Visore Access", + "baseType": "scalar:Enum8", + "modelType": "comm:VisoreAccess", + "needsPropDelimiters": false, + "uitype": "enum", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "enabled", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "2", "localName": "disabled", + "platformFlavors": [ + + ], + "label": "Disabled "}, + { "value": "1", "localName": "enabled", + "platformFlavors": [ + + ], + "label": "Enabled "} + ], + "default": "enabled", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + } + } + } +} diff --git a/gen/meta/commHttps.json b/gen/meta/commHttps.json new file mode 100644 index 000000000..a44c83aa6 --- /dev/null +++ b/gen/meta/commHttps.json @@ -0,0 +1,1798 @@ +{ + "comm:Https": { + "contains": { + "aaa:RbacAnnotation": "", + "comm:Cipher": "", + "comm:RsClientCertCA": "", + "comm:RsKeyRing": "", + "comm:RtCpmCommHttps": "", + "comm:WebConnAg15min": "", + "comm:WebConnAg1d": "", + "comm:WebConnAg1h": "", + "comm:WebConnAg1mo": "", + "comm:WebConnAg1qtr": "", + "comm:WebConnAg1w": "", + "comm:WebConnAg1year": "", + "comm:WebConnAgHist15min": "", + "comm:WebConnAgHist1d": "", + "comm:WebConnAgHist1h": "", + "comm:WebConnAgHist1mo": "", + "comm:WebConnAgHist1qtr": "", + "comm:WebConnAgHist1w": "", + "comm:WebConnAgHist1year": "", + "comm:WebConnStatesAg15min": "", + "comm:WebConnStatesAg1d": "", + "comm:WebConnStatesAg1h": "", + "comm:WebConnStatesAg1mo": "", + "comm:WebConnStatesAg1qtr": "", + "comm:WebConnStatesAg1w": "", + "comm:WebConnStatesAg1year": "", + "comm:WebConnStatesAgHist15min": "", + "comm:WebConnStatesAgHist1d": "", + "comm:WebConnStatesAgHist1h": "", + "comm:WebConnStatesAgHist1mo": "", + "comm:WebConnStatesAgHist1qtr": "", + "comm:WebConnStatesAgHist1w": "", + "comm:WebConnStatesAgHist1year": "", + "comm:WebProxy": "", + "comm:WebReqAg15min": "", + "comm:WebReqAg1d": "", + "comm:WebReqAg1h": "", + "comm:WebReqAg1mo": "", + "comm:WebReqAg1qtr": "", + "comm:WebReqAg1w": "", + "comm:WebReqAg1year": "", + "comm:WebReqAgHist15min": "", + "comm:WebReqAgHist1d": "", + "comm:WebReqAgHist1h": "", + "comm:WebReqAgHist1mo": "", + "comm:WebReqAgHist1qtr": "", + "comm:WebReqAgHist1w": "", + "comm:WebReqAgHist1year": "", + "fault:Counts": "", + "fault:Delegate": "", + "fault:Inst": "", + "health:Inst": "", + "tag:Annotation": "", + "tag:Tag": "" + }, + "rnMap": { + "CDcommWebConnAg15min": "comm:WebConnAg15min", + "CDcommWebConnAg1d": "comm:WebConnAg1d", + "CDcommWebConnAg1h": "comm:WebConnAg1h", + "CDcommWebConnAg1mo": "comm:WebConnAg1mo", + "CDcommWebConnAg1qtr": "comm:WebConnAg1qtr", + "CDcommWebConnAg1w": "comm:WebConnAg1w", + "CDcommWebConnAg1year": "comm:WebConnAg1year", + "CDcommWebConnStatesAg15min": "comm:WebConnStatesAg15min", + "CDcommWebConnStatesAg1d": "comm:WebConnStatesAg1d", + "CDcommWebConnStatesAg1h": "comm:WebConnStatesAg1h", + "CDcommWebConnStatesAg1mo": "comm:WebConnStatesAg1mo", + "CDcommWebConnStatesAg1qtr": "comm:WebConnStatesAg1qtr", + "CDcommWebConnStatesAg1w": "comm:WebConnStatesAg1w", + "CDcommWebConnStatesAg1year": "comm:WebConnStatesAg1year", + "CDcommWebReqAg15min": "comm:WebReqAg15min", + "CDcommWebReqAg1d": "comm:WebReqAg1d", + "CDcommWebReqAg1h": "comm:WebReqAg1h", + "CDcommWebReqAg1mo": "comm:WebReqAg1mo", + "CDcommWebReqAg1qtr": "comm:WebReqAg1qtr", + "CDcommWebReqAg1w": "comm:WebReqAg1w", + "CDcommWebReqAg1year": "comm:WebReqAg1year", + "HDcommWebConnAg15min-": "comm:WebConnAgHist15min", + "HDcommWebConnAg1d-": "comm:WebConnAgHist1d", + "HDcommWebConnAg1h-": "comm:WebConnAgHist1h", + "HDcommWebConnAg1mo-": "comm:WebConnAgHist1mo", + "HDcommWebConnAg1qtr-": "comm:WebConnAgHist1qtr", + "HDcommWebConnAg1w-": "comm:WebConnAgHist1w", + "HDcommWebConnAg1year-": "comm:WebConnAgHist1year", + "HDcommWebConnStatesAg15min-": "comm:WebConnStatesAgHist15min", + "HDcommWebConnStatesAg1d-": "comm:WebConnStatesAgHist1d", + "HDcommWebConnStatesAg1h-": "comm:WebConnStatesAgHist1h", + "HDcommWebConnStatesAg1mo-": "comm:WebConnStatesAgHist1mo", + "HDcommWebConnStatesAg1qtr-": "comm:WebConnStatesAgHist1qtr", + "HDcommWebConnStatesAg1w-": "comm:WebConnStatesAgHist1w", + "HDcommWebConnStatesAg1year-": "comm:WebConnStatesAgHist1year", + "HDcommWebReqAg15min-": "comm:WebReqAgHist15min", + "HDcommWebReqAg1d-": "comm:WebReqAgHist1d", + "HDcommWebReqAg1h-": "comm:WebReqAgHist1h", + "HDcommWebReqAg1mo-": "comm:WebReqAgHist1mo", + "HDcommWebReqAg1qtr-": "comm:WebReqAgHist1qtr", + "HDcommWebReqAg1w-": "comm:WebReqAgHist1w", + "HDcommWebReqAg1year-": "comm:WebReqAgHist1year", + "annotationKey-": "tag:Annotation", + "cph-": "comm:Cipher", + "fault-": "fault:Inst", + "fd-": "fault:Delegate", + "fltCnts": "fault:Counts", + "health": "health:Inst", + "rbacDom-": "aaa:RbacAnnotation", + "rsKeyRing": "comm:RsKeyRing", + "rsclientCertCA": "comm:RsClientCertCA", + "rtpolCpmCommHttps-": "comm:RtCpmCommHttps", + "tagKey-": "tag:Tag", + "wp-": "comm:WebProxy" + }, + "identifiedBy": [ + + ], + "rnFormat": "https", + "containedBy": { + "comm:Pol": "" + }, + "superClasses": [ + "comm:Web", + "comm:Comp", + "pol:Comp", + "pol:Obj", + "naming:NamedObject" + ], + "subClasses": { + + }, + "relationFrom": { + "comm:RtCpmCommHttps": "pol:DefRelnHolder" + }, + "relationTo": { + "comm:RsClientCertCA": "pki:TP", + "comm:RsKeyRing": "pki:KeyRing" + }, + "dnFormats": [ + "uni/fabric/comm-{name}/https" + ], + "writeAccess": [ + "aaa", + "admin" + ], + "readAccess": [ + "aaa", + "admin", + "fabric-equipment" + ], + "faults": { + + }, + "events": { + "E4205022": "modification||comm:Https", + "E4211222": "creation||comm:Https", + "E4211223": "modification||comm:Https", + "E4211224": "deletion||comm:Https" + }, + "stats": { + "comm:WebConnAg15min": { + "comment": [ + "A class that represents the most current aggregated statistics for web connections in a 15 minute sampling interval. This class updates every 5 minutes." + ] + }, + "comm:WebConnAg1d": { + "comment": [ + "A class that represents the most current aggregated statistics for web connections in a 1 day sampling interval. This class updates every hour." + ] + }, + "comm:WebConnAg1h": { + "comment": [ + "A class that represents the most current aggregated statistics for web connections in a 1 hour sampling interval. This class updates every 15 minutes." + ] + }, + "comm:WebConnAg1mo": { + "comment": [ + "A class that represents the most current aggregated statistics for web connections in a 1 month sampling interval. This class updates every day." + ] + }, + "comm:WebConnAg1qtr": { + "comment": [ + "A class that represents the most current aggregated statistics for web connections in a 1 quarter sampling interval. This class updates every day." + ] + }, + "comm:WebConnAg1w": { + "comment": [ + "A class that represents the most current aggregated statistics for web connections in a 1 week sampling interval. This class updates every day." + ] + }, + "comm:WebConnAg1year": { + "comment": [ + "A class that represents the most current aggregated statistics for web connections in a 1 year sampling interval. This class updates every day." + ] + }, + "comm:WebConnAgHist15min": { + "comment": [ + "A class that represents historical aggregated statistics for web connections in a 15 minute sampling interval. This class updates every 5 minutes." + ] + }, + "comm:WebConnAgHist1d": { + "comment": [ + "A class that represents historical aggregated statistics for web connections in a 1 day sampling interval. This class updates every hour." + ] + }, + "comm:WebConnAgHist1h": { + "comment": [ + "A class that represents historical aggregated statistics for web connections in a 1 hour sampling interval. This class updates every 15 minutes." + ] + }, + "comm:WebConnAgHist1mo": { + "comment": [ + "A class that represents historical aggregated statistics for web connections in a 1 month sampling interval. This class updates every day." + ] + }, + "comm:WebConnAgHist1qtr": { + "comment": [ + "A class that represents historical aggregated statistics for web connections in a 1 quarter sampling interval. This class updates every day." + ] + }, + "comm:WebConnAgHist1w": { + "comment": [ + "A class that represents historical aggregated statistics for web connections in a 1 week sampling interval. This class updates every day." + ] + }, + "comm:WebConnAgHist1year": { + "comment": [ + "A class that represents historical aggregated statistics for web connections in a 1 year sampling interval. This class updates every day." + ] + }, + "comm:WebConnStatesAg15min": { + "comment": [ + "A class that represents the most current aggregated statistics for web connections state in a 15 minute sampling interval. This class updates every 5 minutes." + ] + }, + "comm:WebConnStatesAg1d": { + "comment": [ + "A class that represents the most current aggregated statistics for web connections state in a 1 day sampling interval. This class updates every hour." + ] + }, + "comm:WebConnStatesAg1h": { + "comment": [ + "A class that represents the most current aggregated statistics for web connections state in a 1 hour sampling interval. This class updates every 15 minutes." + ] + }, + "comm:WebConnStatesAg1mo": { + "comment": [ + "A class that represents the most current aggregated statistics for web connections state in a 1 month sampling interval. This class updates every day." + ] + }, + "comm:WebConnStatesAg1qtr": { + "comment": [ + "A class that represents the most current aggregated statistics for web connections state in a 1 quarter sampling interval. This class updates every day." + ] + }, + "comm:WebConnStatesAg1w": { + "comment": [ + "A class that represents the most current aggregated statistics for web connections state in a 1 week sampling interval. This class updates every day." + ] + }, + "comm:WebConnStatesAg1year": { + "comment": [ + "A class that represents the most current aggregated statistics for web connections state in a 1 year sampling interval. This class updates every day." + ] + }, + "comm:WebConnStatesAgHist15min": { + "comment": [ + "A class that represents historical aggregated statistics for web connections state in a 15 minute sampling interval. This class updates every 5 minutes." + ] + }, + "comm:WebConnStatesAgHist1d": { + "comment": [ + "A class that represents historical aggregated statistics for web connections state in a 1 day sampling interval. This class updates every hour." + ] + }, + "comm:WebConnStatesAgHist1h": { + "comment": [ + "A class that represents historical aggregated statistics for web connections state in a 1 hour sampling interval. This class updates every 15 minutes." + ] + }, + "comm:WebConnStatesAgHist1mo": { + "comment": [ + "A class that represents historical aggregated statistics for web connections state in a 1 month sampling interval. This class updates every day." + ] + }, + "comm:WebConnStatesAgHist1qtr": { + "comment": [ + "A class that represents historical aggregated statistics for web connections state in a 1 quarter sampling interval. This class updates every day." + ] + }, + "comm:WebConnStatesAgHist1w": { + "comment": [ + "A class that represents historical aggregated statistics for web connections state in a 1 week sampling interval. This class updates every day." + ] + }, + "comm:WebConnStatesAgHist1year": { + "comment": [ + "A class that represents historical aggregated statistics for web connections state in a 1 year sampling interval. This class updates every day." + ] + }, + "comm:WebReqAg15min": { + "comment": [ + "A class that represents the most current aggregated statistics for web requests in a 15 minute sampling interval. This class updates every 5 minutes." + ] + }, + "comm:WebReqAg1d": { + "comment": [ + "A class that represents the most current aggregated statistics for web requests in a 1 day sampling interval. This class updates every hour." + ] + }, + "comm:WebReqAg1h": { + "comment": [ + "A class that represents the most current aggregated statistics for web requests in a 1 hour sampling interval. This class updates every 15 minutes." + ] + }, + "comm:WebReqAg1mo": { + "comment": [ + "A class that represents the most current aggregated statistics for web requests in a 1 month sampling interval. This class updates every day." + ] + }, + "comm:WebReqAg1qtr": { + "comment": [ + "A class that represents the most current aggregated statistics for web requests in a 1 quarter sampling interval. This class updates every day." + ] + }, + "comm:WebReqAg1w": { + "comment": [ + "A class that represents the most current aggregated statistics for web requests in a 1 week sampling interval. This class updates every day." + ] + }, + "comm:WebReqAg1year": { + "comment": [ + "A class that represents the most current aggregated statistics for web requests in a 1 year sampling interval. This class updates every day." + ] + }, + "comm:WebReqAgHist15min": { + "comment": [ + "A class that represents historical aggregated statistics for web requests in a 15 minute sampling interval. This class updates every 5 minutes." + ] + }, + "comm:WebReqAgHist1d": { + "comment": [ + "A class that represents historical aggregated statistics for web requests in a 1 day sampling interval. This class updates every hour." + ] + }, + "comm:WebReqAgHist1h": { + "comment": [ + "A class that represents historical aggregated statistics for web requests in a 1 hour sampling interval. This class updates every 15 minutes." + ] + }, + "comm:WebReqAgHist1mo": { + "comment": [ + "A class that represents historical aggregated statistics for web requests in a 1 month sampling interval. This class updates every day." + ] + }, + "comm:WebReqAgHist1qtr": { + "comment": [ + "A class that represents historical aggregated statistics for web requests in a 1 quarter sampling interval. This class updates every day." + ] + }, + "comm:WebReqAgHist1w": { + "comment": [ + "A class that represents historical aggregated statistics for web requests in a 1 week sampling interval. This class updates every day." + ] + }, + "comm:WebReqAgHist1year": { + "comment": [ + "A class that represents historical aggregated statistics for web requests in a 1 year sampling interval. This class updates every day." + ] + } + }, + "versions": "1.0(1e)-", + "isAbstract": false, + "isConfigurable": true, + "isContextRoot": false, + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false, + "isEncrypted": false, + "isExportable": true, + "isPersistent": true, + "isSubjectToQuota": false, + "isObservable": true, + "hasStats": true, + "isStat": false, + "isFaultable": true, + "isDomainable": false, + "isHealthScorable": true, + "shouldCollectHealthStats": false, + "healthCollectionSource": "faults", + "hasEventRules": false, + "abstractionLayer": "ambiguous", + "apicNxProcessing": false, + "monitoringPolicySource": "Parent", + "isCreatableDeletable": "never", + "platformFlavors": [ + + ], + "classId": "1578", + "className": "Https", + "classPkg": "comm", + "featureTag": "", + "moCategory": "Regular", + "label": "HTTP SSL Configuration", + "comment": [ + "HTTPS" + ], + "properties": { + "accessControlAllowCredential": { + "versions": "2.3(1e)-", + "isConfigurable": true, + "propGlobalId": "33388", + "propLocalId": "7960", + "label": "accessControlAllowCredential", + "baseType": "scalar:Enum8", + "modelType": "comm:AllowCredentialState", + "needsPropDelimiters": false, + "uitype": "enum", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "disabled", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "2", "localName": "disabled", + "platformFlavors": [ + + ], + "label": "Disabled "}, + { "value": "1", "localName": "enabled", + "platformFlavors": [ + + ], + "label": "Enabled "} + ], + "default": "disabled", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "accessControlAllowOrigins": { + "versions": "1.1(1j)-", + "comment": [ + "" + ], + "isConfigurable": true, + "propGlobalId": "17866", + "propLocalId": "4636", + "label": "accessControlAllowOrigins", + "baseType": "string:Basic", + "modelType": "comm:UrlList", + "needsPropDelimiters": false, + "uitype": "string", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validators": [ + {"min" : 0, "max": 256, + "regexs": [ + {"regex" : "^[a-zA-Z0-9-_:/.,\\*\\s]+$", "type": "include"} + ] + } + ], + "validValues": [ + { "value": "", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "} + ], + "default": "", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "adminSt": { + "versions": "1.0(1e)-", + "comment": [ + "The state of HTTPS communication service. This can be enabled or disabled." + ], + "isConfigurable": true, + "propGlobalId": "1298", + "propLocalId": "46", + "label": "Admin State", + "baseType": "scalar:Enum8", + "modelType": "comm:AdminState", + "needsPropDelimiters": false, + "uitype": "enum", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": true, + "isLike": false, + "validValues": [ + { "value": "enabled", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "2", "localName": "disabled", + "platformFlavors": [ + + ], + "label": "Disabled "}, + { "value": "1", "localName": "enabled", + "platformFlavors": [ + + ], + "label": "Enabled "} + ], + "default": "enabled", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "annotation": { + "versions": "3.2(1l)-", + "comment": [ + "User annotation. Suggested format orchestrator:value" + ], + "isConfigurable": true, + "propGlobalId": "37532", + "propLocalId": "8719", + "label": "Annotation", + "baseType": "string:Basic", + "modelType": "mo:Annotation", + "needsPropDelimiters": false, + "uitype": "string", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validators": [ + {"min" : 0, "max": 128, + "regexs": [ + {"regex" : "^[a-zA-Z0-9_.:-]+$", "type": "include"} + ] + } + ], + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "childAction": { + "versions": "1.0(1e)-", + "comment": [ + "Delete or ignore. For internal use only." + ], + "isConfigurable": false, + "propGlobalId": "4", + "propLocalId": "5", + "label": "childAction", + "baseType": "scalar:Bitmask32", + "modelType": "mo:ModificationChildAction", + "needsPropDelimiters": false, + "uitype": "bitmask", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "16384", "localName": "deleteAll", + "platformFlavors": [ + + ], + "label": "Delete All "}, + { "value": "8192", "localName": "deleteNonPresent", + "platformFlavors": [ + + ], + "label": "Delete Non Present "}, + { "value": "4096", "localName": "ignore", + "platformFlavors": [ + + ], + "label": "Ignore "} + ], + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "cliOnlyMode": { + "versions": "4.1(1i)-", + "isConfigurable": true, + "propGlobalId": "47672", + "propLocalId": "10837", + "label": "CLI only mode", + "baseType": "scalar:Enum8", + "modelType": "comm:CliOnlyMode", + "needsPropDelimiters": false, + "uitype": "enum", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "disabled", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "2", "localName": "disabled", + "platformFlavors": [ + + ], + "label": "Disabled "}, + { "value": "1", "localName": "enabled", + "platformFlavors": [ + + ], + "label": "Enabled "} + ], + "default": "disabled", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "clientCertAuthState": { + "versions": "4.0(1h)-", + "isConfigurable": true, + "propGlobalId": "42733", + "propLocalId": "9258", + "label": "Client Cert Auth State", + "baseType": "scalar:Enum8", + "modelType": "comm:AdminState", + "needsPropDelimiters": false, + "uitype": "enum", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "disabled", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "2", "localName": "disabled", + "platformFlavors": [ + + ], + "label": "Disabled "}, + { "value": "1", "localName": "enabled", + "platformFlavors": [ + + ], + "label": "Enabled "} + ], + "default": "disabled", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "descr": { + "versions": "1.0(1e)-", + "comment": [ + "Specifies the description of a policy component." + ], + "isConfigurable": true, + "propGlobalId": "5582", + "propLocalId": "28", + "label": "Description", + "baseType": "string:Basic", + "modelType": "naming:Descr", + "needsPropDelimiters": false, + "uitype": "string", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": false, + "isLike": true, + "likeProp": "naming:Described:descr", + "validators": [ + {"min" : 0, "max": 128, + "regexs": [ + {"regex" : "^[a-zA-Z0-9\\\\!#$%()*,-./:;@ _{|}~?&+]+$", "type": "include"} + ] + } + ], + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "dhParam": { + "versions": "1.2(2g)-", + "isConfigurable": true, + "propGlobalId": "24294", + "propLocalId": "5842", + "label": "DH Parameter", + "baseType": "scalar:Enum8", + "modelType": "comm:DHParam", + "needsPropDelimiters": false, + "uitype": "enum", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "1", "localName": "1024", + "platformFlavors": [ + + ], + "label": "1024 "}, + { "value": "2", "localName": "2048", + "platformFlavors": [ + + ], + "label": "2048 "}, + { "value": "3", "localName": "4096", + "platformFlavors": [ + + ], + "label": "4096 "}, + { "value": "none", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "0", "localName": "none", + "platformFlavors": [ + + ], + "label": "None "} + ], + "default": "none", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": true, + "isHidden": false + }, + "dn": { + "versions": "1.0(1e)-", + "comment": [ + "A tag or metadata is a non-hierarchical keyword or term assigned to the fabric module." + ], + "isConfigurable": false, + "propGlobalId": "1", + "propLocalId": "2", + "label": "dn", + "baseType": "reference:BinRef", + "modelType": "reference:BinRef", + "needsPropDelimiters": true, + "uitype": "auto", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "extMngdBy": { + "versions": "3.2(1l)-", + "comment": [ + "Indicates which orchestrator is managing this MO" + ], + "isConfigurable": false, + "propGlobalId": "39671", + "propLocalId": "8023", + "label": "Managed By", + "baseType": "scalar:Bitmask32", + "modelType": "mo:ExtMngdByType", + "needsPropDelimiters": false, + "uitype": "bitmask", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "undefined", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "1", "localName": "msc", + "platformFlavors": [ + + ], + "label": "MSC "}, + { "value": "0", "localName": "undefined", + "platformFlavors": [ + + ], + "label": "Undefined "} + ], + "default": "undefined", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "globalThrottleRate": { + "versions": "4.2(1i)-", + "isConfigurable": true, + "propGlobalId": "52997", + "propLocalId": "12189", + "label": "The maximum MO api calls allowed per unit time", + "baseType": "scalar:Uint32", + "modelType": "scalar:Uint32", + "needsPropDelimiters": false, + "uitype": "number", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validators": [ + {"min" : 1, "max": 10000 } + ], + "validValues": [ + { "value": "10000", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "} + ], + "default": 10000, + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "globalThrottleSt": { + "versions": "4.2(1i)-", + "isConfigurable": true, + "propGlobalId": "52996", + "propLocalId": "12188", + "label": "Throttle state for all clients without tag0 in header", + "baseType": "scalar:Enum8", + "modelType": "comm:AdminState", + "needsPropDelimiters": false, + "uitype": "enum", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "disabled", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "2", "localName": "disabled", + "platformFlavors": [ + + ], + "label": "Disabled "}, + { "value": "1", "localName": "enabled", + "platformFlavors": [ + + ], + "label": "Enabled "} + ], + "default": "disabled", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "globalThrottleUnit": { + "versions": "4.2(1i)-", + "isConfigurable": true, + "propGlobalId": "52998", + "propLocalId": "12190", + "label": "Unit of rate limit", + "baseType": "string:Basic", + "modelType": "comm:RateUnitType", + "needsPropDelimiters": false, + "uitype": "string", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validators": [ + {"regex" : "^[r]/[ms]$", "type": "include"} + ], + "validValues": [ + { "value": "r/s", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "} + ], + "default": "r/s", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "lcOwn": { + "versions": "1.0(1e)-", + "comment": [ + "A value that indicates how this object was created. For internal use only." + ], + "isConfigurable": false, + "propGlobalId": "9", + "propLocalId": "9", + "label": "lcOwn", + "baseType": "scalar:Enum8", + "modelType": "mo:Owner", + "needsPropDelimiters": false, + "uitype": "enum", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "local", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "4", "localName": "implicit", + "platformFlavors": [ + + ], + "label": "Implicit "}, + { "value": "0", "localName": "local", + "platformFlavors": [ + + ], + "label": "Local "}, + { "value": "1", "localName": "policy", + "platformFlavors": [ + + ], + "label": "Policy "}, + { "value": "2", "localName": "replica", + "platformFlavors": [ + + ], + "label": "Replica "}, + { "value": "3", "localName": "resolveOnBehalf", + "platformFlavors": [ + + ], + "label": "Resolved On Behalf "} + ], + "default": "local", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "maxRequestStatusCount": { + "versions": "1.1(1j)-", + "isConfigurable": true, + "propGlobalId": "19814", + "propLocalId": "5134", + "label": "The maximum number of request status objects to keep", + "baseType": "scalar:Uint32", + "modelType": "scalar:Uint32", + "needsPropDelimiters": false, + "uitype": "number", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validators": [ + {"min" : 0, "max": 1024 } + ], + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "modTs": { + "versions": "1.0(1e)-", + "comment": [ + "The time when this object was last modified." + ], + "isConfigurable": false, + "propGlobalId": "7", + "propLocalId": "7", + "label": "modTs", + "baseType": "scalar:Date", + "modelType": "mo:TStamp", + "needsPropDelimiters": false, + "uitype": "auto", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "never", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "0", "localName": "never", + "platformFlavors": [ + + ], + "label": "Never "} + ], + "default": "never", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "monPolDn": { + "versions": "1.0(1e)-", + "comment": [ + "The monitoring policy attached to this observable object." + ], + "isConfigurable": false, + "propGlobalId": "14145", + "propLocalId": "228", + "label": "Monitoring Policy", + "baseType": "reference:BinRef", + "modelType": "reference:BinRef", + "needsPropDelimiters": true, + "uitype": "auto", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "name": { + "versions": "1.0(1e)-", + "comment": [ + "null" + ], + "isConfigurable": true, + "propGlobalId": "1296", + "propLocalId": "13", + "label": "Name", + "baseType": "string:Basic", + "modelType": "naming:Name", + "needsPropDelimiters": false, + "uitype": "string", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": true, + "isLike": false, + "validators": [ + {"min" : 0, "max": 64, + "regexs": [ + {"regex" : "^[a-zA-Z0-9_.:-]+$", "type": "include"} + ] + } + ], + "validValues": [ + { "value": "https", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "} + ], + "default": "https", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "nameAlias": { + "versions": "2.2(1k)-", + "isConfigurable": true, + "propGlobalId": "28417", + "propLocalId": "6719", + "label": "Display Name", + "baseType": "string:Basic", + "modelType": "naming:NameAlias", + "needsPropDelimiters": false, + "uitype": "string", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validators": [ + {"min" : 0, "max": 63, + "regexs": [ + {"regex" : "^[a-zA-Z0-9_.-]+$", "type": "include"} + ] + } + ], + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "nodeExporter": { + "versions": "5.2(3e)-", + "isConfigurable": true, + "propGlobalId": "65281", + "propLocalId": "14483", + "label": "Node Exporter service", + "baseType": "scalar:Enum8", + "modelType": "comm:NodeExporter", + "needsPropDelimiters": false, + "uitype": "enum", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "disabled", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "2", "localName": "disabled", + "platformFlavors": [ + + ], + "label": "Disabled "}, + { "value": "1", "localName": "enabled", + "platformFlavors": [ + + ], + "label": "Enabled "} + ], + "default": "disabled", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "port": { + "versions": "1.0(1e)-", + "comment": [ + "The port used for HTTPS communication service." + ], + "isConfigurable": true, + "propGlobalId": "1297", + "propLocalId": "127", + "label": "Port", + "baseType": "scalar:Uint32", + "modelType": "comm:Port", + "needsPropDelimiters": false, + "uitype": "number", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": true, + "isLike": false, + "validators": [ + {"min" : 1, "max": 65535 } + ], + "validValues": [ + { "value": "443", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "} + ], + "default": 443, + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "proto": { + "versions": "1.0(1e)-", + "comment": [ + "The list of protocols to match." + ], + "isConfigurable": false, + "propGlobalId": "1289", + "propLocalId": "144", + "label": "proto", + "baseType": "scalar:Enum8", + "modelType": "comm:Protocol", + "needsPropDelimiters": false, + "uitype": "enum", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": true, + "isLike": false, + "validValues": [ + { "value": "3", "localName": "all", + "platformFlavors": [ + + ], + "label": "All "}, + { "value": "tcp", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "0", "localName": "none", + "platformFlavors": [ + + ], + "label": "None "}, + { "value": "1", "localName": "tcp", + "platformFlavors": [ + + ], + "label": "tcp "}, + { "value": "2", "localName": "udp", + "platformFlavors": [ + + ], + "label": "udp "} + ], + "default": "tcp", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "referer": { + "versions": "6.0(2h)-", + "isConfigurable": true, + "propGlobalId": "69126", + "propLocalId": "15056", + "label": "Allowed HTTP referer space separated list", + "baseType": "string:Basic", + "modelType": "string:Basic", + "needsPropDelimiters": false, + "uitype": "string", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validators": [ + {"min" : 0, "max": 512 } + ], + "validValues": [ + { "value": "", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "} + ], + "default": "", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "rn": { + "versions": "1.0(1e)-", + "comment": [ + "Identifies an object from its siblings within the context of its parent object. The distinguished name contains a sequence of relative names." + ], + "isConfigurable": false, + "propGlobalId": "2", + "propLocalId": "3", + "label": "rn", + "baseType": "reference:BinRN", + "modelType": "reference:BinRN", + "needsPropDelimiters": true, + "uitype": "auto", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "serverHeader": { + "versions": "5.2(1g)-", + "isConfigurable": true, + "propGlobalId": "63694", + "propLocalId": "13996", + "label": "Server Header", + "baseType": "scalar:Enum8", + "modelType": "comm:ServerHeader", + "needsPropDelimiters": false, + "uitype": "enum", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "enabled", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "2", "localName": "disabled", + "platformFlavors": [ + + ], + "label": "Disabled "}, + { "value": "1", "localName": "enabled", + "platformFlavors": [ + + ], + "label": "Enabled "} + ], + "default": "enabled", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "sslProtocols": { + "versions": "1.1(1j)-", + "comment": [ + "The Secure Socket Layer (SSL) protocol." + ], + "isConfigurable": true, + "propGlobalId": "18247", + "propLocalId": "4711", + "label": "SSL Protocols", + "baseType": "scalar:Bitmask64", + "modelType": "comm:SslProtocolTypes", + "needsPropDelimiters": false, + "uitype": "bitmask", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "1", "localName": "TLSv1", + "platformFlavors": [ + + ], + "label": "TLSv1 "}, + { "value": "2", "localName": "TLSv1.1", + "platformFlavors": [ + + ], + "label": "TLSv1.1 "}, + { "value": "4", "localName": "TLSv1.2", + "platformFlavors": [ + + ], + "label": "TLSv1.2 "}, + { "value": "8", "localName": "TLSv1.3", + "platformFlavors": [ + + ], + "label": "TLSv1.3 "}, + { "value": "TLSv1.1,TLSv1.2", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "} + ], + "default": "TLSv1.1,TLSv1.2", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "status": { + "versions": "1.0(1e)-", + "comment": [ + "The upgrade status. This property is for internal use only." + ], + "isConfigurable": false, + "propGlobalId": "3", + "propLocalId": "4", + "label": "status", + "baseType": "scalar:Bitmask32", + "modelType": "mo:ModificationStatus", + "needsPropDelimiters": false, + "uitype": "bitmask", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "2", "localName": "created", + "platformFlavors": [ + + ], + "comment": [ + "In a setter method: specifies that an object should be created. An error is returned if the object already exists. \nIn the return value of a setter method: indicates that an object has been created. \n" + ], + "label": "Created "}, + { "value": "8", "localName": "deleted", + "platformFlavors": [ + + ], + "comment": [ + "In a setter method: specifies that an object should be deleted. \nIn the return value of a setter method: indicates that an object has been deleted.\n" + ], + "label": "Deleted "}, + { "value": "4", "localName": "modified", + "platformFlavors": [ + + ], + "comment": [ + "In a setter method: specifies that an object should be modified \nIn the return value of a setter method: indicates that an object has been modified.\n" + ], + "label": "Modified "} + ], + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "throttleRate": { + "versions": "3.1(1i)-", + "isConfigurable": true, + "propGlobalId": "36782", + "propLocalId": "8597", + "label": "The maximum login/refresh allowed per second", + "baseType": "scalar:Uint32", + "modelType": "scalar:Uint32", + "needsPropDelimiters": false, + "uitype": "number", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validators": [ + {"min" : 1, "max": 100 } + ], + "validValues": [ + { "value": "2", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "} + ], + "default": 2, + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "throttleSt": { + "versions": "3.1(1i)-", + "isConfigurable": true, + "propGlobalId": "36781", + "propLocalId": "8596", + "label": "Login/refresh throttle state", + "baseType": "scalar:Enum8", + "modelType": "comm:AdminState", + "needsPropDelimiters": false, + "uitype": "enum", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "enabled", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "2", "localName": "disabled", + "platformFlavors": [ + + ], + "label": "Disabled "}, + { "value": "1", "localName": "enabled", + "platformFlavors": [ + + ], + "label": "Enabled "} + ], + "default": "enabled", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "uid": { + "versions": "1.0(1e)-", + "comment": [ + "A unique identifier for this object." + ], + "isConfigurable": false, + "propGlobalId": "8", + "propLocalId": "8", + "label": "uid", + "baseType": "scalar:Uint16", + "modelType": "scalar:Uint16", + "needsPropDelimiters": false, + "uitype": "auto", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "userdom": { + "versions": "5.0(1k)-", + "isConfigurable": true, + "propGlobalId": "60657", + "propLocalId": "13244", + "label": "userdom", + "baseType": "string:Basic", + "modelType": "mo:UserDomType", + "needsPropDelimiters": false, + "uitype": "string", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validators": [ + {"min" : 0, "max": 1024, + "regexs": [ + {"regex" : "^[a-zA-Z0-9_.:-]+$", "type": "include"} + ] + } + ], + "validValues": [ + { "value": "all", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "} + ], + "default": "all", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "visoreAccess": { + "versions": "3.1(1i)-", + "isConfigurable": true, + "propGlobalId": "35417", + "propLocalId": "8263", + "label": "Visore Access", + "baseType": "scalar:Enum8", + "modelType": "comm:VisoreAccess", + "needsPropDelimiters": false, + "uitype": "enum", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "enabled", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "2", "localName": "disabled", + "platformFlavors": [ + + ], + "label": "Disabled "}, + { "value": "1", "localName": "enabled", + "platformFlavors": [ + + ], + "label": "Enabled "} + ], + "default": "enabled", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + } + } + } +} diff --git a/gen/meta/commPol.json b/gen/meta/commPol.json new file mode 100644 index 000000000..9a0f3325d --- /dev/null +++ b/gen/meta/commPol.json @@ -0,0 +1,800 @@ +{ + "comm:Pol": { + "contains": { + "aaa:RbacAnnotation": "", + "comm:ApiRespTime": "", + "comm:Http": "", + "comm:Https": "", + "comm:Reconfig": "", + "comm:RtCommPol": "", + "comm:RtPol": "", + "comm:RtResPol": "", + "comm:RtWebCommDefault": "", + "comm:RtWebCommPolRel": "", + "comm:Setup": "", + "comm:Shellinabox": "", + "comm:Ssh": "", + "comm:Telnet": "", + "fault:Counts": "", + "fault:Delegate": "", + "health:Inst": "", + "tag:Annotation": "", + "tag:Tag": "" + }, + "rnMap": { + "annotationKey-": "tag:Annotation", + "apiResp": "comm:ApiRespTime", + "fd-": "fault:Delegate", + "fltCnts": "fault:Counts", + "health": "health:Inst", + "http": "comm:Http", + "https": "comm:Https", + "rbacDom-": "aaa:RbacAnnotation", + "reconfig": "comm:Reconfig", + "rtaaaPol-": "comm:RtPol", + "rtfabricCommPol-": "comm:RtCommPol", + "rtfabricResPol-": "comm:RtResPol", + "rtwebCommDefault-": "comm:RtWebCommDefault", + "rtwebCommPolRel": "comm:RtWebCommPolRel", + "setup": "comm:Setup", + "shellinabox": "comm:Shellinabox", + "ssh": "comm:Ssh", + "tagKey-": "tag:Tag", + "telnet": "comm:Telnet" + }, + "identifiedBy": [ + "name" + ], + "rnFormat": "comm-{name}", + "containedBy": { + "fabric:Inst": "" + }, + "superClasses": [ + "pol:Def", + "pol:Obj", + "naming:NamedObject" + ], + "subClasses": { + + }, + "relationFrom": { + "comm:RtCommPol": "fabric:PodPGrp", + "comm:RtPol": "aaa:SecRelnHolder", + "comm:RtResPol": "fabric:SecRelnHolder", + "comm:RtWebCommDefault": "comm:WebPolCont", + "comm:RtWebCommPolRel": "comm:WebPolCont" + }, + "relationTo": { + + }, + "dnFormats": [ + "uni/fabric/comm-{name}" + ], + "writeAccess": [ + "aaa", + "admin" + ], + "readAccess": [ + "aaa", + "admin", + "fabric-connectivity", + "fabric-equipment", + "fabric-protocol" + ], + "faults": { + + }, + "events": { + "E4211225": "creation||comm:Pol", + "E4211226": "modification||comm:Pol", + "E4211227": "deletion||comm:Pol" + }, + "stats": { + + }, + "versions": "1.0(1e)-", + "isAbstract": false, + "isConfigurable": true, + "isContextRoot": false, + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false, + "isEncrypted": false, + "isExportable": true, + "isPersistent": true, + "isSubjectToQuota": false, + "isObservable": true, + "hasStats": false, + "isStat": false, + "isFaultable": false, + "isDomainable": false, + "isHealthScorable": true, + "shouldCollectHealthStats": false, + "healthCollectionSource": "faults", + "hasEventRules": false, + "abstractionLayer": "ambiguous", + "apicNxProcessing": false, + "monitoringPolicySource": "Parent", + "isCreatableDeletable": "always", + "platformFlavors": [ + + ], + "classId": "1572", + "className": "Pol", + "classPkg": "comm", + "featureTag": "", + "moCategory": "Regular", + "label": "Communication Policy", + "comment": [ + "The communication policy contains the service configuration for various services." + ], + "properties": { + "annotation": { + "versions": "3.2(1l)-", + "comment": [ + "User annotation. Suggested format orchestrator:value" + ], + "isConfigurable": true, + "propGlobalId": "37529", + "propLocalId": "8719", + "label": "Annotation", + "baseType": "string:Basic", + "modelType": "mo:Annotation", + "needsPropDelimiters": false, + "uitype": "string", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validators": [ + {"min" : 0, "max": 128, + "regexs": [ + {"regex" : "^[a-zA-Z0-9_.:-]+$", "type": "include"} + ] + } + ], + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "childAction": { + "versions": "1.0(1e)-", + "comment": [ + "Delete or ignore. For internal use only." + ], + "isConfigurable": false, + "propGlobalId": "4", + "propLocalId": "5", + "label": "childAction", + "baseType": "scalar:Bitmask32", + "modelType": "mo:ModificationChildAction", + "needsPropDelimiters": false, + "uitype": "bitmask", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "16384", "localName": "deleteAll", + "platformFlavors": [ + + ], + "label": "Delete All "}, + { "value": "8192", "localName": "deleteNonPresent", + "platformFlavors": [ + + ], + "label": "Delete Non Present "}, + { "value": "4096", "localName": "ignore", + "platformFlavors": [ + + ], + "label": "Ignore "} + ], + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "descr": { + "versions": "1.0(1e)-", + "comment": [ + "Specifies a description of the policy definition." + ], + "isConfigurable": true, + "propGlobalId": "5579", + "propLocalId": "28", + "label": "Description", + "baseType": "string:Basic", + "modelType": "naming:Descr", + "needsPropDelimiters": false, + "uitype": "string", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": false, + "isLike": true, + "likeProp": "naming:Described:descr", + "validators": [ + {"min" : 0, "max": 128, + "regexs": [ + {"regex" : "^[a-zA-Z0-9\\\\!#$%()*,-./:;@ _{|}~?&+]+$", "type": "include"} + ] + } + ], + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "dn": { + "versions": "1.0(1e)-", + "comment": [ + "A tag or metadata is a non-hierarchical keyword or term assigned to the fabric module." + ], + "isConfigurable": false, + "propGlobalId": "1", + "propLocalId": "2", + "label": "dn", + "baseType": "reference:BinRef", + "modelType": "reference:BinRef", + "needsPropDelimiters": true, + "uitype": "auto", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "extMngdBy": { + "versions": "3.2(1l)-", + "comment": [ + "Indicates which orchestrator is managing this MO" + ], + "isConfigurable": false, + "propGlobalId": "39668", + "propLocalId": "8023", + "label": "Managed By", + "baseType": "scalar:Bitmask32", + "modelType": "mo:ExtMngdByType", + "needsPropDelimiters": false, + "uitype": "bitmask", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "undefined", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "1", "localName": "msc", + "platformFlavors": [ + + ], + "label": "MSC "}, + { "value": "0", "localName": "undefined", + "platformFlavors": [ + + ], + "label": "Undefined "} + ], + "default": "undefined", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "lcOwn": { + "versions": "1.0(1e)-", + "comment": [ + "A value that indicates how this object was created. For internal use only." + ], + "isConfigurable": false, + "propGlobalId": "9", + "propLocalId": "9", + "label": "lcOwn", + "baseType": "scalar:Enum8", + "modelType": "mo:Owner", + "needsPropDelimiters": false, + "uitype": "enum", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "local", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "4", "localName": "implicit", + "platformFlavors": [ + + ], + "label": "Implicit "}, + { "value": "0", "localName": "local", + "platformFlavors": [ + + ], + "label": "Local "}, + { "value": "1", "localName": "policy", + "platformFlavors": [ + + ], + "label": "Policy "}, + { "value": "2", "localName": "replica", + "platformFlavors": [ + + ], + "label": "Replica "}, + { "value": "3", "localName": "resolveOnBehalf", + "platformFlavors": [ + + ], + "label": "Resolved On Behalf "} + ], + "default": "local", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "modTs": { + "versions": "1.0(1e)-", + "comment": [ + "The time when this object was last modified." + ], + "isConfigurable": false, + "propGlobalId": "7", + "propLocalId": "7", + "label": "modTs", + "baseType": "scalar:Date", + "modelType": "mo:TStamp", + "needsPropDelimiters": false, + "uitype": "auto", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "never", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "0", "localName": "never", + "platformFlavors": [ + + ], + "label": "Never "} + ], + "default": "never", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "monPolDn": { + "versions": "1.0(1e)-", + "comment": [ + "The monitoring policy attached to this observable object." + ], + "isConfigurable": false, + "propGlobalId": "14144", + "propLocalId": "228", + "label": "Monitoring Policy", + "baseType": "reference:BinRef", + "modelType": "reference:BinRef", + "needsPropDelimiters": true, + "uitype": "auto", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "name": { + "versions": "1.0(1e)-", + "comment": [ + "The name of the policy. This name can be up to 64 alphanumeric characters. Note that you cannot change this name after the object has been saved." + ], + "isConfigurable": true, + "propGlobalId": "5905", + "propLocalId": "13", + "label": "Name", + "baseType": "string:Basic", + "modelType": "naming:Name", + "needsPropDelimiters": false, + "uitype": "string", + "createOnly": false, + "readWrite": false, + "readOnly": false, + "isNaming": true, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": true, + "isLike": false, + "validators": [ + {"min" : 1, "max": 64, + "regexs": [ + {"regex" : "^[a-zA-Z0-9_.:-]+$", "type": "include"} + ] + } + ], + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "nameAlias": { + "versions": "2.2(1k)-", + "isConfigurable": true, + "propGlobalId": "28417", + "propLocalId": "6719", + "label": "Display Name", + "baseType": "string:Basic", + "modelType": "naming:NameAlias", + "needsPropDelimiters": false, + "uitype": "string", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validators": [ + {"min" : 0, "max": 63, + "regexs": [ + {"regex" : "^[a-zA-Z0-9_.-]+$", "type": "include"} + ] + } + ], + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "ownerKey": { + "versions": "1.0(1e)-", + "comment": [ + "The key for enabling clients to own their data for entity correlation." + ], + "isConfigurable": true, + "propGlobalId": "15230", + "propLocalId": "4100", + "label": "ownerKey", + "baseType": "string:Basic", + "modelType": "naming:Descr", + "needsPropDelimiters": false, + "uitype": "string", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validators": [ + {"min" : 0, "max": 128, + "regexs": [ + {"regex" : "^[a-zA-Z0-9\\\\!#$%()*,-./:;@ _{|}~?&+]+$", "type": "include"} + ] + } + ], + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "ownerTag": { + "versions": "1.0(1e)-", + "comment": [ + "A tag for enabling clients to add their own data. For example, to indicate who created this object." + ], + "isConfigurable": true, + "propGlobalId": "15231", + "propLocalId": "4101", + "label": "ownerTag", + "baseType": "string:Basic", + "modelType": "naming:Descr", + "needsPropDelimiters": false, + "uitype": "string", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validators": [ + {"min" : 0, "max": 64, + "regexs": [ + {"regex" : "^[a-zA-Z0-9\\\\!#$%()*,-./:;@ _{|}~?&+]+$", "type": "include"} + ] + } + ], + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "rn": { + "versions": "1.0(1e)-", + "comment": [ + "Identifies an object from its siblings within the context of its parent object. The distinguished name contains a sequence of relative names." + ], + "isConfigurable": false, + "propGlobalId": "2", + "propLocalId": "3", + "label": "rn", + "baseType": "reference:BinRN", + "modelType": "reference:BinRN", + "needsPropDelimiters": true, + "uitype": "auto", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "status": { + "versions": "1.0(1e)-", + "comment": [ + "The upgrade status. This property is for internal use only." + ], + "isConfigurable": false, + "propGlobalId": "3", + "propLocalId": "4", + "label": "status", + "baseType": "scalar:Bitmask32", + "modelType": "mo:ModificationStatus", + "needsPropDelimiters": false, + "uitype": "bitmask", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "2", "localName": "created", + "platformFlavors": [ + + ], + "comment": [ + "In a setter method: specifies that an object should be created. An error is returned if the object already exists. \nIn the return value of a setter method: indicates that an object has been created. \n" + ], + "label": "Created "}, + { "value": "8", "localName": "deleted", + "platformFlavors": [ + + ], + "comment": [ + "In a setter method: specifies that an object should be deleted. \nIn the return value of a setter method: indicates that an object has been deleted.\n" + ], + "label": "Deleted "}, + { "value": "4", "localName": "modified", + "platformFlavors": [ + + ], + "comment": [ + "In a setter method: specifies that an object should be modified \nIn the return value of a setter method: indicates that an object has been modified.\n" + ], + "label": "Modified "} + ], + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "strictSecurityOnApicOOBSubnet": { + "isConfigurable": true, + "propGlobalId": "70760", + "propLocalId": "15519", + "label": "remove implicit access on apic oob from any apic OOB subnet IP", + "baseType": "scalar:Bool", + "modelType": "scalar:Bool", + "needsPropDelimiters": false, + "uitype": "boolean", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "false", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "false", "localName": "no", + "platformFlavors": [ + + ], + "label": "No "}, + { "value": "true", "localName": "yes", + "platformFlavors": [ + + ], + "label": "Yes "} + ], + "default": "false", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "uid": { + "versions": "1.0(1e)-", + "comment": [ + "A unique identifier for this object." + ], + "isConfigurable": false, + "propGlobalId": "8", + "propLocalId": "8", + "label": "uid", + "baseType": "scalar:Uint16", + "modelType": "scalar:Uint16", + "needsPropDelimiters": false, + "uitype": "auto", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "userdom": { + "versions": "5.0(1k)-", + "isConfigurable": true, + "propGlobalId": "60657", + "propLocalId": "13244", + "label": "userdom", + "baseType": "string:Basic", + "modelType": "mo:UserDomType", + "needsPropDelimiters": false, + "uitype": "string", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validators": [ + {"min" : 0, "max": 1024, + "regexs": [ + {"regex" : "^[a-zA-Z0-9_.:-]+$", "type": "include"} + ] + } + ], + "validValues": [ + { "value": "all", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "} + ], + "default": "all", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + } + } + } +} diff --git a/gen/meta/commRsClientCertCA.json b/gen/meta/commRsClientCertCA.json new file mode 100644 index 000000000..11dfd0982 --- /dev/null +++ b/gen/meta/commRsClientCertCA.json @@ -0,0 +1,912 @@ +{ + "comm:RsClientCertCA": { + "contains": { + "aaa:RbacAnnotation": "", + "fault:Counts": "", + "fault:Inst": "", + "health:Inst": "", + "tag:Annotation": "", + "tag:Tag": "" + }, + "rnMap": { + "annotationKey-": "tag:Annotation", + "fault-": "fault:Inst", + "fltCnts": "fault:Counts", + "health": "health:Inst", + "rbacDom-": "aaa:RbacAnnotation", + "tagKey-": "tag:Tag" + }, + "identifiedBy": [ + + ], + "rnFormat": "rsclientCertCA", + "containedBy": { + "comm:Https": "" + }, + "superClasses": [ + "reln:To", + "reln:Inst" + ], + "subClasses": { + + }, + "relationInfo": { + "type": "explicit", + "cardinality": "n-to-1", + "fromMo": "comm:Https", + "fromRelMo": "comm:RsClientCertCA", + "toMo": "pki:TP", + "toRelMo": "pki:RtClientCertCA", + "enforceable": true, + "resolvable": true + }, + "dnFormats": [ + "uni/fabric/comm-{name}/https/rsclientCertCA" + ], + "writeAccess": [ + "aaa", + "admin" + ], + "readAccess": [ + "aaa", + "admin", + "fabric-equipment" + ], + "faults": { + "F3138": "fltCommRsClientCertCAResolveFail" + }, + "events": { + "E4215646": "creation||comm:RsClientCertCA", + "E4215647": "modification||comm:RsClientCertCA", + "E4215648": "deletion||comm:RsClientCertCA" + }, + "stats": { + + }, + "versions": "4.0(1h)-", + "isAbstract": false, + "isConfigurable": true, + "isContextRoot": false, + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false, + "isEncrypted": false, + "isExportable": true, + "isPersistent": true, + "isSubjectToQuota": false, + "isObservable": true, + "hasStats": false, + "isStat": false, + "isFaultable": true, + "isDomainable": false, + "isHealthScorable": true, + "shouldCollectHealthStats": false, + "healthCollectionSource": "faults", + "hasEventRules": false, + "abstractionLayer": "regular", + "apicNxProcessing": false, + "monitoringPolicySource": "Parent", + "isCreatableDeletable": "always", + "platformFlavors": [ + + ], + "classId": "12375", + "className": "RsClientCertCA", + "classPkg": "comm", + "featureTag": "", + "moCategory": "RelationshipToLocal", + "label": "TP", + "properties": { + "annotation": { + "versions": "4.0(1h)-", + "comment": [ + "User annotation. Suggested format orchestrator:value" + ], + "isConfigurable": true, + "propGlobalId": "42750", + "propLocalId": "8719", + "label": "Annotation", + "baseType": "string:Basic", + "modelType": "mo:Annotation", + "needsPropDelimiters": false, + "uitype": "string", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validators": [ + {"min" : 0, "max": 128, + "regexs": [ + {"regex" : "^[a-zA-Z0-9_.:-]+$", "type": "include"} + ] + } + ], + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "childAction": { + "versions": "1.0(1e)-", + "comment": [ + "Delete or ignore. For internal use only." + ], + "isConfigurable": false, + "propGlobalId": "4", + "propLocalId": "5", + "label": "childAction", + "baseType": "scalar:Bitmask32", + "modelType": "mo:ModificationChildAction", + "needsPropDelimiters": false, + "uitype": "bitmask", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "16384", "localName": "deleteAll", + "platformFlavors": [ + + ], + "label": "Delete All "}, + { "value": "8192", "localName": "deleteNonPresent", + "platformFlavors": [ + + ], + "label": "Delete Non Present "}, + { "value": "4096", "localName": "ignore", + "platformFlavors": [ + + ], + "label": "Ignore "} + ], + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "dn": { + "versions": "1.0(1e)-", + "comment": [ + "A tag or metadata is a non-hierarchical keyword or term assigned to the fabric module." + ], + "isConfigurable": false, + "propGlobalId": "1", + "propLocalId": "2", + "label": "dn", + "baseType": "reference:BinRef", + "modelType": "reference:BinRef", + "needsPropDelimiters": true, + "uitype": "auto", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "extMngdBy": { + "versions": "4.0(1h)-", + "comment": [ + "Indicates which orchestrator is managing this MO" + ], + "isConfigurable": false, + "propGlobalId": "42751", + "propLocalId": "8023", + "label": "Managed By", + "baseType": "scalar:Bitmask32", + "modelType": "mo:ExtMngdByType", + "needsPropDelimiters": false, + "uitype": "bitmask", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "undefined", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "1", "localName": "msc", + "platformFlavors": [ + + ], + "label": "MSC "}, + { "value": "0", "localName": "undefined", + "platformFlavors": [ + + ], + "label": "Undefined "} + ], + "default": "undefined", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "forceResolve": { + "versions": "1.0(1e)-", + "comment": [ + "Whether the relation should force pull the target." + ], + "isConfigurable": false, + "propGlobalId": "107", + "propLocalId": "83", + "label": "Force Resolve", + "baseType": "scalar:Bool", + "modelType": "scalar:Bool", + "needsPropDelimiters": false, + "uitype": "auto", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "true", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "false", "localName": "no", + "platformFlavors": [ + + ], + "label": "No "}, + { "value": "true", "localName": "yes", + "platformFlavors": [ + + ], + "label": "Yes "} + ], + "default": "yes", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "lcOwn": { + "versions": "1.0(1e)-", + "comment": [ + "A value that indicates how this object was created. For internal use only." + ], + "isConfigurable": false, + "propGlobalId": "9", + "propLocalId": "9", + "label": "lcOwn", + "baseType": "scalar:Enum8", + "modelType": "mo:Owner", + "needsPropDelimiters": false, + "uitype": "enum", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "local", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "4", "localName": "implicit", + "platformFlavors": [ + + ], + "label": "Implicit "}, + { "value": "0", "localName": "local", + "platformFlavors": [ + + ], + "label": "Local "}, + { "value": "1", "localName": "policy", + "platformFlavors": [ + + ], + "label": "Policy "}, + { "value": "2", "localName": "replica", + "platformFlavors": [ + + ], + "label": "Replica "}, + { "value": "3", "localName": "resolveOnBehalf", + "platformFlavors": [ + + ], + "label": "Resolved On Behalf "} + ], + "default": "local", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "modTs": { + "versions": "1.0(1e)-", + "comment": [ + "The time when this object was last modified." + ], + "isConfigurable": false, + "propGlobalId": "7", + "propLocalId": "7", + "label": "modTs", + "baseType": "scalar:Date", + "modelType": "mo:TStamp", + "needsPropDelimiters": false, + "uitype": "auto", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "never", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "0", "localName": "never", + "platformFlavors": [ + + ], + "label": "Never "} + ], + "default": "never", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "monPolDn": { + "versions": "4.0(1h)-", + "comment": [ + "The monitoring policy attached to this observable object." + ], + "isConfigurable": false, + "propGlobalId": "42745", + "propLocalId": "228", + "label": "Monitoring Policy", + "baseType": "reference:BinRef", + "modelType": "reference:BinRef", + "needsPropDelimiters": true, + "uitype": "auto", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "rType": { + "versions": "1.0(1e)-", + "comment": [ + "Represents the type of resolver." + ], + "isConfigurable": false, + "propGlobalId": "106", + "propLocalId": "82", + "label": "Resolver Type", + "baseType": "scalar:Enum8", + "modelType": "reln:ResolverType", + "needsPropDelimiters": false, + "uitype": "enum", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "mo", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "3", "localName": "local", + "platformFlavors": [ + + ], + "label": "Local "}, + { "value": "1", "localName": "mo", + "platformFlavors": [ + + ], + "label": "MO "}, + { "value": "2", "localName": "service", + "platformFlavors": [ + + ], + "label": "Service "} + ], + "default": "mo", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "rn": { + "versions": "1.0(1e)-", + "comment": [ + "Identifies an object from its siblings within the context of its parent object. The distinguished name contains a sequence of relative names." + ], + "isConfigurable": false, + "propGlobalId": "2", + "propLocalId": "3", + "label": "rn", + "baseType": "reference:BinRN", + "modelType": "reference:BinRN", + "needsPropDelimiters": true, + "uitype": "auto", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "state": { + "versions": "1.0(1e)-", + "comment": [ + "Represents the state of the relationship." + ], + "isConfigurable": false, + "propGlobalId": "103", + "propLocalId": "26", + "label": "State", + "baseType": "scalar:Enum8", + "modelType": "reln:State", + "needsPropDelimiters": false, + "uitype": "enum", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "5", "localName": "cardinality-violation", + "platformFlavors": [ + + ], + "comment": [ + "cardinality violation - When relations are created such that\n they violate the cardinality, state of the relation would be\n set to this." + ], + "label": "Cardinality Violation "}, + { "value": "unformed", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "1", "localName": "formed", + "platformFlavors": [ + + ], + "comment": [ + "the relationship is formed with the target object" + ], + "label": "Formed "}, + { "value": "4", "localName": "invalid-target", + "platformFlavors": [ + + ], + "comment": [ + "invalid target DN" + ], + "label": "Invalid Target "}, + { "value": "2", "localName": "missing-target", + "platformFlavors": [ + + ], + "comment": [ + "target does not exist" + ], + "label": "Missing Target "}, + { "value": "0", "localName": "unformed", + "platformFlavors": [ + + ], + "comment": [ + "the relationship is not formed" + ], + "label": "Unformed "} + ], + "default": "unformed", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "stateQual": { + "versions": "1.0(1e)-", + "comment": [ + "Represents the state qualifier of the relationship." + ], + "isConfigurable": false, + "propGlobalId": "104", + "propLocalId": "80", + "label": "State Qualifier", + "baseType": "scalar:Enum8", + "modelType": "reln:StateQual", + "needsPropDelimiters": false, + "uitype": "enum", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "2", "localName": "default-target", + "platformFlavors": [ + + ], + "comment": [ + "target not specified, using default" + ], + "label": "Target Not Specified "}, + { "value": "none", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "1", "localName": "mismatch-target", + "platformFlavors": [ + + ], + "comment": [ + "target not found, using default" + ], + "label": "Target Not Found "}, + { "value": "0", "localName": "none", + "platformFlavors": [ + + ], + "comment": [ + "no issue" + ], + "label": "None "} + ], + "default": "none", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "status": { + "versions": "1.0(1e)-", + "comment": [ + "The upgrade status. This property is for internal use only." + ], + "isConfigurable": false, + "propGlobalId": "3", + "propLocalId": "4", + "label": "status", + "baseType": "scalar:Bitmask32", + "modelType": "mo:ModificationStatus", + "needsPropDelimiters": false, + "uitype": "bitmask", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "2", "localName": "created", + "platformFlavors": [ + + ], + "comment": [ + "In a setter method: specifies that an object should be created. An error is returned if the object already exists. \nIn the return value of a setter method: indicates that an object has been created. \n" + ], + "label": "Created "}, + { "value": "8", "localName": "deleted", + "platformFlavors": [ + + ], + "comment": [ + "In a setter method: specifies that an object should be deleted. \nIn the return value of a setter method: indicates that an object has been deleted.\n" + ], + "label": "Deleted "}, + { "value": "4", "localName": "modified", + "platformFlavors": [ + + ], + "comment": [ + "In a setter method: specifies that an object should be modified \nIn the return value of a setter method: indicates that an object has been modified.\n" + ], + "label": "Modified "} + ], + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "tCl": { + "versions": "4.0(1h)-", + "comment": [ + "The class ID of the target object. This property is managed internally and should not be modified by the user." + ], + "isConfigurable": false, + "propGlobalId": "42742", + "propLocalId": "78", + "label": "Target Class", + "baseType": "scalar:Enum16", + "modelType": "reln:ClassId", + "needsPropDelimiters": false, + "uitype": "enum", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": true, + "isLike": false, + "validValues": [ + { "value": "1483", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "1483", "localName": "pkiTP", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "0", "localName": "unspecified", + "platformFlavors": [ + + ], + "label": "unspecified "} + ], + "default": "pkiTP", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "tDn": { + "versions": "4.0(1h)-", + "comment": [ + "The distinguished name of the target." + ], + "isConfigurable": true, + "propGlobalId": "50066", + "propLocalId": "77", + "label": "Target-dn", + "baseType": "reference:BinRef", + "modelType": "reln:Dn", + "needsPropDelimiters": true, + "uitype": "string", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": true, + "isLike": false, + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "tType": { + "versions": "1.0(1e)-", + "comment": [ + "The type of target." + ], + "isConfigurable": false, + "propGlobalId": "105", + "propLocalId": "81", + "label": "Target Type", + "baseType": "scalar:Enum8", + "modelType": "reln:TargetType", + "needsPropDelimiters": false, + "uitype": "enum", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "2", "localName": "all", + "platformFlavors": [ + + ], + "label": "All "}, + { "value": "mo", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "1", "localName": "mo", + "platformFlavors": [ + + ], + "label": "MO "}, + { "value": "0", "localName": "name", + "platformFlavors": [ + + ], + "label": "Name "} + ], + "default": "mo", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "uid": { + "versions": "1.0(1e)-", + "comment": [ + "A unique identifier for this object." + ], + "isConfigurable": false, + "propGlobalId": "8", + "propLocalId": "8", + "label": "uid", + "baseType": "scalar:Uint16", + "modelType": "scalar:Uint16", + "needsPropDelimiters": false, + "uitype": "auto", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "userdom": { + "versions": "5.0(1k)-", + "isConfigurable": true, + "propGlobalId": "60657", + "propLocalId": "13244", + "label": "userdom", + "baseType": "string:Basic", + "modelType": "mo:UserDomType", + "needsPropDelimiters": false, + "uitype": "string", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validators": [ + {"min" : 0, "max": 1024, + "regexs": [ + {"regex" : "^[a-zA-Z0-9_.:-]+$", "type": "include"} + ] + } + ], + "validValues": [ + { "value": "all", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "} + ], + "default": "all", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + } + } + } +} diff --git a/gen/meta/commRsKeyRing.json b/gen/meta/commRsKeyRing.json new file mode 100644 index 000000000..8dd9b1e6b --- /dev/null +++ b/gen/meta/commRsKeyRing.json @@ -0,0 +1,1010 @@ +{ + "comm:RsKeyRing": { + "contains": { + "aaa:RbacAnnotation": "", + "fault:Counts": "", + "fault:Inst": "", + "health:Inst": "", + "tag:Annotation": "", + "tag:Tag": "" + }, + "rnMap": { + "annotationKey-": "tag:Annotation", + "fault-": "fault:Inst", + "fltCnts": "fault:Counts", + "health": "health:Inst", + "rbacDom-": "aaa:RbacAnnotation", + "tagKey-": "tag:Tag" + }, + "identifiedBy": [ + + ], + "rnFormat": "rsKeyRing", + "containedBy": { + "comm:Https": "" + }, + "superClasses": [ + "pol:NToRef", + "reln:To", + "reln:Inst" + ], + "subClasses": { + + }, + "relationInfo": { + "type": "named", + "cardinality": "n-to-1", + "fromMo": "comm:Https", + "fromRelMo": "comm:RsKeyRing", + "toMo": "pki:KeyRing", + "toRelMo": "pki:RtKeyRing", + "enforceable": true, + "resolvable": true + }, + "dnFormats": [ + "uni/fabric/comm-{name}/https/rsKeyRing" + ], + "writeAccess": [ + "aaa", + "admin" + ], + "readAccess": [ + "aaa", + "admin", + "fabric-equipment" + ], + "faults": { + "F1399": "fltCommRsKeyRingResolveFail" + }, + "events": { + "E4211228": "creation||comm:RsKeyRing", + "E4211229": "modification||comm:RsKeyRing", + "E4211230": "deletion||comm:RsKeyRing" + }, + "stats": { + + }, + "versions": "1.0(1e)-", + "isAbstract": false, + "isConfigurable": true, + "isContextRoot": false, + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false, + "isEncrypted": false, + "isExportable": true, + "isPersistent": true, + "isSubjectToQuota": false, + "isObservable": true, + "hasStats": false, + "isStat": false, + "isFaultable": true, + "isDomainable": false, + "isHealthScorable": true, + "shouldCollectHealthStats": false, + "healthCollectionSource": "faults", + "hasEventRules": false, + "abstractionLayer": "regular", + "apicNxProcessing": false, + "monitoringPolicySource": "Parent", + "isCreatableDeletable": "never", + "platformFlavors": [ + + ], + "classId": "5530", + "className": "RsKeyRing", + "classPkg": "comm", + "featureTag": "", + "moCategory": "RelationshipToLocal", + "label": "Key Ring", + "comment": [ + "A source relation to a key ring." + ], + "properties": { + "annotation": { + "versions": "3.2(1l)-", + "comment": [ + "User annotation. Suggested format orchestrator:value" + ], + "isConfigurable": true, + "propGlobalId": "38117", + "propLocalId": "8719", + "label": "Annotation", + "baseType": "string:Basic", + "modelType": "mo:Annotation", + "needsPropDelimiters": false, + "uitype": "string", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validators": [ + {"min" : 0, "max": 128, + "regexs": [ + {"regex" : "^[a-zA-Z0-9_.:-]+$", "type": "include"} + ] + } + ], + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "childAction": { + "versions": "1.0(1e)-", + "comment": [ + "Delete or ignore. For internal use only." + ], + "isConfigurable": false, + "propGlobalId": "4", + "propLocalId": "5", + "label": "childAction", + "baseType": "scalar:Bitmask32", + "modelType": "mo:ModificationChildAction", + "needsPropDelimiters": false, + "uitype": "bitmask", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "16384", "localName": "deleteAll", + "platformFlavors": [ + + ], + "label": "Delete All "}, + { "value": "8192", "localName": "deleteNonPresent", + "platformFlavors": [ + + ], + "label": "Delete Non Present "}, + { "value": "4096", "localName": "ignore", + "platformFlavors": [ + + ], + "label": "Ignore "} + ], + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "dn": { + "versions": "1.0(1e)-", + "comment": [ + "A tag or metadata is a non-hierarchical keyword or term assigned to the fabric module." + ], + "isConfigurable": false, + "propGlobalId": "1", + "propLocalId": "2", + "label": "dn", + "baseType": "reference:BinRef", + "modelType": "reference:BinRef", + "needsPropDelimiters": true, + "uitype": "auto", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "extMngdBy": { + "versions": "3.2(1l)-", + "comment": [ + "Indicates which orchestrator is managing this MO" + ], + "isConfigurable": false, + "propGlobalId": "40256", + "propLocalId": "8023", + "label": "Managed By", + "baseType": "scalar:Bitmask32", + "modelType": "mo:ExtMngdByType", + "needsPropDelimiters": false, + "uitype": "bitmask", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "undefined", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "1", "localName": "msc", + "platformFlavors": [ + + ], + "label": "MSC "}, + { "value": "0", "localName": "undefined", + "platformFlavors": [ + + ], + "label": "Undefined "} + ], + "default": "undefined", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "forceResolve": { + "versions": "1.0(1e)-", + "comment": [ + "Whether the relation should force pull the target." + ], + "isConfigurable": false, + "propGlobalId": "107", + "propLocalId": "83", + "label": "Force Resolve", + "baseType": "scalar:Bool", + "modelType": "scalar:Bool", + "needsPropDelimiters": false, + "uitype": "auto", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "true", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "false", "localName": "no", + "platformFlavors": [ + + ], + "label": "No "}, + { "value": "true", "localName": "yes", + "platformFlavors": [ + + ], + "label": "Yes "} + ], + "default": "yes", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "lcOwn": { + "versions": "1.0(1e)-", + "comment": [ + "A value that indicates how this object was created. For internal use only." + ], + "isConfigurable": false, + "propGlobalId": "9", + "propLocalId": "9", + "label": "lcOwn", + "baseType": "scalar:Enum8", + "modelType": "mo:Owner", + "needsPropDelimiters": false, + "uitype": "enum", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "local", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "4", "localName": "implicit", + "platformFlavors": [ + + ], + "label": "Implicit "}, + { "value": "0", "localName": "local", + "platformFlavors": [ + + ], + "label": "Local "}, + { "value": "1", "localName": "policy", + "platformFlavors": [ + + ], + "label": "Policy "}, + { "value": "2", "localName": "replica", + "platformFlavors": [ + + ], + "label": "Replica "}, + { "value": "3", "localName": "resolveOnBehalf", + "platformFlavors": [ + + ], + "label": "Resolved On Behalf "} + ], + "default": "local", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "modTs": { + "versions": "1.0(1e)-", + "comment": [ + "The time when this object was last modified." + ], + "isConfigurable": false, + "propGlobalId": "7", + "propLocalId": "7", + "label": "modTs", + "baseType": "scalar:Date", + "modelType": "mo:TStamp", + "needsPropDelimiters": false, + "uitype": "auto", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "never", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "0", "localName": "never", + "platformFlavors": [ + + ], + "label": "Never "} + ], + "default": "never", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "monPolDn": { + "versions": "1.0(1e)-", + "comment": [ + "The monitoring policy attached to this observable object." + ], + "isConfigurable": false, + "propGlobalId": "16229", + "propLocalId": "228", + "label": "Monitoring Policy", + "baseType": "reference:BinRef", + "modelType": "reference:BinRef", + "needsPropDelimiters": true, + "uitype": "auto", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "rType": { + "versions": "1.0(1e)-", + "comment": [ + "Represents the type of resolver." + ], + "isConfigurable": false, + "propGlobalId": "106", + "propLocalId": "82", + "label": "Resolver Type", + "baseType": "scalar:Enum8", + "modelType": "reln:ResolverType", + "needsPropDelimiters": false, + "uitype": "enum", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "mo", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "3", "localName": "local", + "platformFlavors": [ + + ], + "label": "Local "}, + { "value": "1", "localName": "mo", + "platformFlavors": [ + + ], + "label": "MO "}, + { "value": "2", "localName": "service", + "platformFlavors": [ + + ], + "label": "Service "} + ], + "default": "mo", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "rn": { + "versions": "1.0(1e)-", + "comment": [ + "Identifies an object from its siblings within the context of its parent object. The distinguished name contains a sequence of relative names." + ], + "isConfigurable": false, + "propGlobalId": "2", + "propLocalId": "3", + "label": "rn", + "baseType": "reference:BinRN", + "modelType": "reference:BinRN", + "needsPropDelimiters": true, + "uitype": "auto", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "state": { + "versions": "1.0(1e)-", + "comment": [ + "Represents the state of the relationship." + ], + "isConfigurable": false, + "propGlobalId": "103", + "propLocalId": "26", + "label": "State", + "baseType": "scalar:Enum8", + "modelType": "reln:State", + "needsPropDelimiters": false, + "uitype": "enum", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "5", "localName": "cardinality-violation", + "platformFlavors": [ + + ], + "comment": [ + "cardinality violation - When relations are created such that\n they violate the cardinality, state of the relation would be\n set to this." + ], + "label": "Cardinality Violation "}, + { "value": "unformed", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "1", "localName": "formed", + "platformFlavors": [ + + ], + "comment": [ + "the relationship is formed with the target object" + ], + "label": "Formed "}, + { "value": "4", "localName": "invalid-target", + "platformFlavors": [ + + ], + "comment": [ + "invalid target DN" + ], + "label": "Invalid Target "}, + { "value": "2", "localName": "missing-target", + "platformFlavors": [ + + ], + "comment": [ + "target does not exist" + ], + "label": "Missing Target "}, + { "value": "0", "localName": "unformed", + "platformFlavors": [ + + ], + "comment": [ + "the relationship is not formed" + ], + "label": "Unformed "} + ], + "default": "unformed", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "stateQual": { + "versions": "1.0(1e)-", + "comment": [ + "Represents the state qualifier of the relationship." + ], + "isConfigurable": false, + "propGlobalId": "104", + "propLocalId": "80", + "label": "State Qualifier", + "baseType": "scalar:Enum8", + "modelType": "reln:StateQual", + "needsPropDelimiters": false, + "uitype": "enum", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "2", "localName": "default-target", + "platformFlavors": [ + + ], + "comment": [ + "target not specified, using default" + ], + "label": "Target Not Specified "}, + { "value": "none", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "1", "localName": "mismatch-target", + "platformFlavors": [ + + ], + "comment": [ + "target not found, using default" + ], + "label": "Target Not Found "}, + { "value": "0", "localName": "none", + "platformFlavors": [ + + ], + "comment": [ + "no issue" + ], + "label": "None "} + ], + "default": "none", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "status": { + "versions": "1.0(1e)-", + "comment": [ + "The upgrade status. This property is for internal use only." + ], + "isConfigurable": false, + "propGlobalId": "3", + "propLocalId": "4", + "label": "status", + "baseType": "scalar:Bitmask32", + "modelType": "mo:ModificationStatus", + "needsPropDelimiters": false, + "uitype": "bitmask", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "2", "localName": "created", + "platformFlavors": [ + + ], + "comment": [ + "In a setter method: specifies that an object should be created. An error is returned if the object already exists. \nIn the return value of a setter method: indicates that an object has been created. \n" + ], + "label": "Created "}, + { "value": "8", "localName": "deleted", + "platformFlavors": [ + + ], + "comment": [ + "In a setter method: specifies that an object should be deleted. \nIn the return value of a setter method: indicates that an object has been deleted.\n" + ], + "label": "Deleted "}, + { "value": "4", "localName": "modified", + "platformFlavors": [ + + ], + "comment": [ + "In a setter method: specifies that an object should be modified \nIn the return value of a setter method: indicates that an object has been modified.\n" + ], + "label": "Modified "} + ], + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "tCl": { + "versions": "1.0(1e)-", + "comment": [ + "The class ID of the target object. This property is managed internally and should not be modified by the user." + ], + "isConfigurable": false, + "propGlobalId": "16226", + "propLocalId": "78", + "label": "Target Class", + "baseType": "scalar:Enum16", + "modelType": "reln:ClassId", + "needsPropDelimiters": false, + "uitype": "enum", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": true, + "isLike": false, + "validValues": [ + { "value": "1482", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "1482", "localName": "pkiKeyRing", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "0", "localName": "unspecified", + "platformFlavors": [ + + ], + "label": "unspecified "} + ], + "default": "pkiKeyRing", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "tContextDn": { + "versions": "1.0(1e)-", + "comment": [ + "Specifies the target context distinguished name." + ], + "isConfigurable": false, + "propGlobalId": "4990", + "propLocalId": "2530", + "label": "Target-context", + "baseType": "reference:BinRef", + "modelType": "reln:Dn", + "needsPropDelimiters": true, + "uitype": "auto", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "tDn": { + "versions": "1.0(1e)-", + "comment": [ + "The distinguished name of the target." + ], + "isConfigurable": false, + "propGlobalId": "100", + "propLocalId": "77", + "label": "Target-dn", + "baseType": "reference:BinRef", + "modelType": "reln:Dn", + "needsPropDelimiters": true, + "uitype": "auto", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "tRn": { + "versions": "1.0(1e)-", + "comment": [ + "Specifies the target's related name." + ], + "isConfigurable": false, + "propGlobalId": "4989", + "propLocalId": "2529", + "label": "Target-rn", + "baseType": "string:Basic", + "modelType": "string:Basic", + "needsPropDelimiters": false, + "uitype": "auto", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "tType": { + "versions": "1.0(1e)-", + "comment": [ + "Represents the type of target. The target type for this object is named." + ], + "isConfigurable": false, + "propGlobalId": "4988", + "propLocalId": "81", + "label": "Target Type", + "baseType": "scalar:Enum8", + "modelType": "reln:TargetType", + "needsPropDelimiters": false, + "uitype": "enum", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": true, + "isLike": false, + "validValues": [ + { "value": "2", "localName": "all", + "platformFlavors": [ + + ], + "label": "All "}, + { "value": "name", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "1", "localName": "mo", + "platformFlavors": [ + + ], + "label": "MO "}, + { "value": "0", "localName": "name", + "platformFlavors": [ + + ], + "label": "Name "} + ], + "default": "name", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "tnPkiKeyRingName": { + "versions": "1.0(1e)-", + "comment": [ + "The HTTP connection key ring. Each PKI device holds a pair of asymmetric Rivest-Shamir-Adleman (RSA) or Elliptic Curve Cryptography (ECC) encryption keys, one kept private and one made public, stored in an internal key ring." + ], + "isConfigurable": true, + "propGlobalId": "16225", + "propLocalId": "3986", + "label": "Name", + "baseType": "string:Basic", + "modelType": "naming:Name", + "needsPropDelimiters": false, + "uitype": "string", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validators": [ + {"min" : 0, "max": 64, + "regexs": [ + {"regex" : "^[a-zA-Z0-9_.:-]+$", "type": "include"} + ] + } + ], + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "uid": { + "versions": "1.0(1e)-", + "comment": [ + "A unique identifier for this object." + ], + "isConfigurable": false, + "propGlobalId": "8", + "propLocalId": "8", + "label": "uid", + "baseType": "scalar:Uint16", + "modelType": "scalar:Uint16", + "needsPropDelimiters": false, + "uitype": "auto", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "userdom": { + "versions": "5.0(1k)-", + "isConfigurable": true, + "propGlobalId": "60657", + "propLocalId": "13244", + "label": "userdom", + "baseType": "string:Basic", + "modelType": "mo:UserDomType", + "needsPropDelimiters": false, + "uitype": "string", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validators": [ + {"min" : 0, "max": 1024, + "regexs": [ + {"regex" : "^[a-zA-Z0-9_.:-]+$", "type": "include"} + ] + } + ], + "validValues": [ + { "value": "all", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "} + ], + "default": "all", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + } + } + } +} diff --git a/gen/meta/commShellinabox.json b/gen/meta/commShellinabox.json new file mode 100644 index 000000000..e4df245e5 --- /dev/null +++ b/gen/meta/commShellinabox.json @@ -0,0 +1,775 @@ +{ + "comm:Shellinabox": { + "contains": { + "aaa:RbacAnnotation": "", + "fault:Delegate": "", + "tag:Annotation": "", + "tag:Tag": "" + }, + "rnMap": { + "annotationKey-": "tag:Annotation", + "fd-": "fault:Delegate", + "rbacDom-": "aaa:RbacAnnotation", + "tagKey-": "tag:Tag" + }, + "identifiedBy": [ + + ], + "rnFormat": "shellinabox", + "containedBy": { + "comm:Pol": "" + }, + "superClasses": [ + "comm:Shell", + "comm:Comp", + "pol:Comp", + "pol:Obj", + "naming:NamedObject" + ], + "subClasses": { + + }, + "relationFrom": { + + }, + "relationTo": { + + }, + "dnFormats": [ + "uni/fabric/comm-{name}/shellinabox" + ], + "writeAccess": [ + "aaa", + "admin" + ], + "readAccess": [ + "aaa", + "admin", + "fabric-equipment" + ], + "faults": { + + }, + "events": { + "E4211231": "creation||comm:Shellinabox", + "E4211232": "modification||comm:Shellinabox", + "E4211233": "deletion||comm:Shellinabox" + }, + "stats": { + + }, + "versions": "1.2(1i)-", + "isAbstract": false, + "isConfigurable": true, + "isContextRoot": false, + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false, + "isEncrypted": false, + "isExportable": true, + "isPersistent": true, + "isSubjectToQuota": false, + "isObservable": false, + "hasStats": false, + "isStat": false, + "isFaultable": false, + "isDomainable": false, + "isHealthScorable": false, + "shouldCollectHealthStats": false, + "healthCollectionSource": "faults", + "hasEventRules": false, + "abstractionLayer": "ambiguous", + "apicNxProcessing": false, + "monitoringPolicySource": "Parent", + "isCreatableDeletable": "never", + "platformFlavors": [ + + ], + "classId": "7669", + "className": "Shellinabox", + "classPkg": "comm", + "featureTag": "", + "moCategory": "Regular", + "label": "Shellinabox Service", + "properties": { + "adminSt": { + "versions": "1.2(1i)-", + "comment": [ + "The administrative state of the object or policy." + ], + "isConfigurable": true, + "propGlobalId": "22698", + "propLocalId": "46", + "label": "Admin State", + "baseType": "scalar:Enum8", + "modelType": "comm:AdminState", + "needsPropDelimiters": false, + "uitype": "enum", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": true, + "isLike": false, + "validValues": [ + { "value": "disabled", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "2", "localName": "disabled", + "platformFlavors": [ + + ], + "label": "Disabled "}, + { "value": "1", "localName": "enabled", + "platformFlavors": [ + + ], + "label": "Enabled "} + ], + "default": "disabled", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "annotation": { + "versions": "3.2(1l)-", + "comment": [ + "User annotation. Suggested format orchestrator:value" + ], + "isConfigurable": true, + "propGlobalId": "38358", + "propLocalId": "8719", + "label": "Annotation", + "baseType": "string:Basic", + "modelType": "mo:Annotation", + "needsPropDelimiters": false, + "uitype": "string", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validators": [ + {"min" : 0, "max": 128, + "regexs": [ + {"regex" : "^[a-zA-Z0-9_.:-]+$", "type": "include"} + ] + } + ], + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "childAction": { + "versions": "1.0(1e)-", + "comment": [ + "Delete or ignore. For internal use only." + ], + "isConfigurable": false, + "propGlobalId": "4", + "propLocalId": "5", + "label": "childAction", + "baseType": "scalar:Bitmask32", + "modelType": "mo:ModificationChildAction", + "needsPropDelimiters": false, + "uitype": "bitmask", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "16384", "localName": "deleteAll", + "platformFlavors": [ + + ], + "label": "Delete All "}, + { "value": "8192", "localName": "deleteNonPresent", + "platformFlavors": [ + + ], + "label": "Delete Non Present "}, + { "value": "4096", "localName": "ignore", + "platformFlavors": [ + + ], + "label": "Ignore "} + ], + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "descr": { + "versions": "1.2(1i)-", + "comment": [ + "The description of this configuration item." + ], + "isConfigurable": true, + "propGlobalId": "23073", + "propLocalId": "28", + "label": "Description", + "baseType": "string:Basic", + "modelType": "naming:Descr", + "needsPropDelimiters": false, + "uitype": "string", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": true, + "isLike": false, + "validators": [ + {"min" : 0, "max": 128, + "regexs": [ + {"regex" : "^[a-zA-Z0-9\\\\!#$%()*,-./:;@ _{|}~?&+]+$", "type": "include"} + ] + } + ], + "validValues": [ + { "value": "Shellinabox server", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "} + ], + "default": "Shellinabox server", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "dn": { + "versions": "1.0(1e)-", + "comment": [ + "A tag or metadata is a non-hierarchical keyword or term assigned to the fabric module." + ], + "isConfigurable": false, + "propGlobalId": "1", + "propLocalId": "2", + "label": "dn", + "baseType": "reference:BinRef", + "modelType": "reference:BinRef", + "needsPropDelimiters": true, + "uitype": "auto", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "extMngdBy": { + "versions": "3.2(1l)-", + "comment": [ + "Indicates which orchestrator is managing this MO" + ], + "isConfigurable": false, + "propGlobalId": "40497", + "propLocalId": "8023", + "label": "Managed By", + "baseType": "scalar:Bitmask32", + "modelType": "mo:ExtMngdByType", + "needsPropDelimiters": false, + "uitype": "bitmask", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "undefined", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "1", "localName": "msc", + "platformFlavors": [ + + ], + "label": "MSC "}, + { "value": "0", "localName": "undefined", + "platformFlavors": [ + + ], + "label": "Undefined "} + ], + "default": "undefined", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "lcOwn": { + "versions": "1.0(1e)-", + "comment": [ + "A value that indicates how this object was created. For internal use only." + ], + "isConfigurable": false, + "propGlobalId": "9", + "propLocalId": "9", + "label": "lcOwn", + "baseType": "scalar:Enum8", + "modelType": "mo:Owner", + "needsPropDelimiters": false, + "uitype": "enum", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "local", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "4", "localName": "implicit", + "platformFlavors": [ + + ], + "label": "Implicit "}, + { "value": "0", "localName": "local", + "platformFlavors": [ + + ], + "label": "Local "}, + { "value": "1", "localName": "policy", + "platformFlavors": [ + + ], + "label": "Policy "}, + { "value": "2", "localName": "replica", + "platformFlavors": [ + + ], + "label": "Replica "}, + { "value": "3", "localName": "resolveOnBehalf", + "platformFlavors": [ + + ], + "label": "Resolved On Behalf "} + ], + "default": "local", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "modTs": { + "versions": "1.0(1e)-", + "comment": [ + "The time when this object was last modified." + ], + "isConfigurable": false, + "propGlobalId": "7", + "propLocalId": "7", + "label": "modTs", + "baseType": "scalar:Date", + "modelType": "mo:TStamp", + "needsPropDelimiters": false, + "uitype": "auto", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "never", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "0", "localName": "never", + "platformFlavors": [ + + ], + "label": "Never "} + ], + "default": "never", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "name": { + "versions": "1.2(1i)-", + "comment": [ + "The name of the object." + ], + "isConfigurable": true, + "propGlobalId": "22696", + "propLocalId": "13", + "label": "Name", + "baseType": "string:Basic", + "modelType": "naming:Name", + "needsPropDelimiters": false, + "uitype": "string", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": true, + "isLike": false, + "validators": [ + {"min" : 0, "max": 64, + "regexs": [ + {"regex" : "^[a-zA-Z0-9_.:-]+$", "type": "include"} + ] + } + ], + "validValues": [ + { "value": "shellinabox", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "} + ], + "default": "shellinabox", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "nameAlias": { + "versions": "2.2(1k)-", + "isConfigurable": true, + "propGlobalId": "28417", + "propLocalId": "6719", + "label": "Display Name", + "baseType": "string:Basic", + "modelType": "naming:NameAlias", + "needsPropDelimiters": false, + "uitype": "string", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validators": [ + {"min" : 0, "max": 63, + "regexs": [ + {"regex" : "^[a-zA-Z0-9_.-]+$", "type": "include"} + ] + } + ], + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "port": { + "versions": "1.2(1i)-", + "comment": [ + "The service port number for the LDAP service." + ], + "isConfigurable": false, + "propGlobalId": "22697", + "propLocalId": "127", + "label": "Port", + "baseType": "scalar:Uint32", + "modelType": "comm:Port", + "needsPropDelimiters": false, + "uitype": "auto", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": true, + "isLike": false, + "validValues": [ + { "value": "4200", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "} + ], + "default": "4200", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "proto": { + "versions": "1.0(1e)-", + "comment": [ + "The list of protocols to match." + ], + "isConfigurable": false, + "propGlobalId": "1300", + "propLocalId": "144", + "label": "proto", + "baseType": "scalar:Enum8", + "modelType": "comm:Protocol", + "needsPropDelimiters": false, + "uitype": "enum", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": true, + "isLike": false, + "validValues": [ + { "value": "3", "localName": "all", + "platformFlavors": [ + + ], + "label": "All "}, + { "value": "tcp", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "0", "localName": "none", + "platformFlavors": [ + + ], + "label": "None "}, + { "value": "1", "localName": "tcp", + "platformFlavors": [ + + ], + "label": "tcp "}, + { "value": "2", "localName": "udp", + "platformFlavors": [ + + ], + "label": "udp "} + ], + "default": "tcp", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "rn": { + "versions": "1.0(1e)-", + "comment": [ + "Identifies an object from its siblings within the context of its parent object. The distinguished name contains a sequence of relative names." + ], + "isConfigurable": false, + "propGlobalId": "2", + "propLocalId": "3", + "label": "rn", + "baseType": "reference:BinRN", + "modelType": "reference:BinRN", + "needsPropDelimiters": true, + "uitype": "auto", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "status": { + "versions": "1.0(1e)-", + "comment": [ + "The upgrade status. This property is for internal use only." + ], + "isConfigurable": false, + "propGlobalId": "3", + "propLocalId": "4", + "label": "status", + "baseType": "scalar:Bitmask32", + "modelType": "mo:ModificationStatus", + "needsPropDelimiters": false, + "uitype": "bitmask", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "2", "localName": "created", + "platformFlavors": [ + + ], + "comment": [ + "In a setter method: specifies that an object should be created. An error is returned if the object already exists. \nIn the return value of a setter method: indicates that an object has been created. \n" + ], + "label": "Created "}, + { "value": "8", "localName": "deleted", + "platformFlavors": [ + + ], + "comment": [ + "In a setter method: specifies that an object should be deleted. \nIn the return value of a setter method: indicates that an object has been deleted.\n" + ], + "label": "Deleted "}, + { "value": "4", "localName": "modified", + "platformFlavors": [ + + ], + "comment": [ + "In a setter method: specifies that an object should be modified \nIn the return value of a setter method: indicates that an object has been modified.\n" + ], + "label": "Modified "} + ], + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "uid": { + "versions": "1.0(1e)-", + "comment": [ + "A unique identifier for this object." + ], + "isConfigurable": false, + "propGlobalId": "8", + "propLocalId": "8", + "label": "uid", + "baseType": "scalar:Uint16", + "modelType": "scalar:Uint16", + "needsPropDelimiters": false, + "uitype": "auto", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "userdom": { + "versions": "5.0(1k)-", + "isConfigurable": true, + "propGlobalId": "60657", + "propLocalId": "13244", + "label": "userdom", + "baseType": "string:Basic", + "modelType": "mo:UserDomType", + "needsPropDelimiters": false, + "uitype": "string", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validators": [ + {"min" : 0, "max": 1024, + "regexs": [ + {"regex" : "^[a-zA-Z0-9_.:-]+$", "type": "include"} + ] + } + ], + "validValues": [ + { "value": "all", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "} + ], + "default": "all", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + } + } + } +} diff --git a/gen/meta/commSsh.json b/gen/meta/commSsh.json new file mode 100644 index 000000000..8119f45f8 --- /dev/null +++ b/gen/meta/commSsh.json @@ -0,0 +1,1068 @@ +{ + "comm:Ssh": { + "contains": { + "aaa:RbacAnnotation": "", + "fault:Delegate": "", + "tag:Annotation": "", + "tag:Tag": "" + }, + "rnMap": { + "annotationKey-": "tag:Annotation", + "fd-": "fault:Delegate", + "rbacDom-": "aaa:RbacAnnotation", + "tagKey-": "tag:Tag" + }, + "identifiedBy": [ + + ], + "rnFormat": "ssh", + "containedBy": { + "comm:Pol": "" + }, + "superClasses": [ + "comm:Shell", + "comm:Comp", + "pol:Comp", + "pol:Obj", + "naming:NamedObject" + ], + "subClasses": { + + }, + "relationFrom": { + + }, + "relationTo": { + + }, + "dnFormats": [ + "uni/fabric/comm-{name}/ssh" + ], + "writeAccess": [ + "aaa", + "admin" + ], + "readAccess": [ + "aaa", + "admin", + "fabric-equipment" + ], + "faults": { + + }, + "events": { + "E4211234": "creation||comm:Ssh", + "E4211235": "modification||comm:Ssh", + "E4211236": "deletion||comm:Ssh" + }, + "stats": { + + }, + "versions": "1.0(1e)-", + "isAbstract": false, + "isConfigurable": true, + "isContextRoot": false, + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false, + "isEncrypted": false, + "isExportable": true, + "isPersistent": true, + "isSubjectToQuota": false, + "isObservable": false, + "hasStats": false, + "isStat": false, + "isFaultable": false, + "isDomainable": false, + "isHealthScorable": false, + "shouldCollectHealthStats": false, + "healthCollectionSource": "faults", + "hasEventRules": false, + "abstractionLayer": "ambiguous", + "apicNxProcessing": false, + "monitoringPolicySource": "Parent", + "isCreatableDeletable": "never", + "platformFlavors": [ + + ], + "classId": "1583", + "className": "Ssh", + "classPkg": "comm", + "featureTag": "", + "moCategory": "Regular", + "label": "Ssh Service", + "comment": [ + "Object that encompasses properties related to Secure Shell access to the APIC, namely admin-state (default=enabled) and port(default=22)." + ], + "properties": { + "adminSt": { + "versions": "1.0(1e)-", + "comment": [ + "The state of SSH communication service. This can be enabled or disabled." + ], + "isConfigurable": true, + "propGlobalId": "1306", + "propLocalId": "46", + "label": "Admin State", + "baseType": "scalar:Enum8", + "modelType": "comm:AdminState", + "needsPropDelimiters": false, + "uitype": "enum", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": true, + "isLike": false, + "validValues": [ + { "value": "enabled", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "2", "localName": "disabled", + "platformFlavors": [ + + ], + "label": "Disabled "}, + { "value": "1", "localName": "enabled", + "platformFlavors": [ + + ], + "label": "Enabled "} + ], + "default": "enabled", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "annotation": { + "versions": "3.2(1l)-", + "comment": [ + "User annotation. Suggested format orchestrator:value" + ], + "isConfigurable": true, + "propGlobalId": "37534", + "propLocalId": "8719", + "label": "Annotation", + "baseType": "string:Basic", + "modelType": "mo:Annotation", + "needsPropDelimiters": false, + "uitype": "string", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validators": [ + {"min" : 0, "max": 128, + "regexs": [ + {"regex" : "^[a-zA-Z0-9_.:-]+$", "type": "include"} + ] + } + ], + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "childAction": { + "versions": "1.0(1e)-", + "comment": [ + "Delete or ignore. For internal use only." + ], + "isConfigurable": false, + "propGlobalId": "4", + "propLocalId": "5", + "label": "childAction", + "baseType": "scalar:Bitmask32", + "modelType": "mo:ModificationChildAction", + "needsPropDelimiters": false, + "uitype": "bitmask", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "16384", "localName": "deleteAll", + "platformFlavors": [ + + ], + "label": "Delete All "}, + { "value": "8192", "localName": "deleteNonPresent", + "platformFlavors": [ + + ], + "label": "Delete Non Present "}, + { "value": "4096", "localName": "ignore", + "platformFlavors": [ + + ], + "label": "Ignore "} + ], + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "descr": { + "versions": "1.0(1e)-", + "comment": [ + "Specifies the description of a policy component." + ], + "isConfigurable": true, + "propGlobalId": "5582", + "propLocalId": "28", + "label": "Description", + "baseType": "string:Basic", + "modelType": "naming:Descr", + "needsPropDelimiters": false, + "uitype": "string", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": false, + "isLike": true, + "likeProp": "naming:Described:descr", + "validators": [ + {"min" : 0, "max": 128, + "regexs": [ + {"regex" : "^[a-zA-Z0-9\\\\!#$%()*,-./:;@ _{|}~?&+]+$", "type": "include"} + ] + } + ], + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "dn": { + "versions": "1.0(1e)-", + "comment": [ + "A tag or metadata is a non-hierarchical keyword or term assigned to the fabric module." + ], + "isConfigurable": false, + "propGlobalId": "1", + "propLocalId": "2", + "label": "dn", + "baseType": "reference:BinRef", + "modelType": "reference:BinRef", + "needsPropDelimiters": true, + "uitype": "auto", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "extMngdBy": { + "versions": "3.2(1l)-", + "comment": [ + "Indicates which orchestrator is managing this MO" + ], + "isConfigurable": false, + "propGlobalId": "39673", + "propLocalId": "8023", + "label": "Managed By", + "baseType": "scalar:Bitmask32", + "modelType": "mo:ExtMngdByType", + "needsPropDelimiters": false, + "uitype": "bitmask", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "undefined", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "1", "localName": "msc", + "platformFlavors": [ + + ], + "label": "MSC "}, + { "value": "0", "localName": "undefined", + "platformFlavors": [ + + ], + "label": "Undefined "} + ], + "default": "undefined", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "hostkeyAlgos": { + "isConfigurable": true, + "propGlobalId": "70519", + "propLocalId": "15480", + "label": "Hostkey Algorithms", + "baseType": "scalar:Bitmask64", + "modelType": "comm:HostkeyAlgorithmTypes", + "needsPropDelimiters": false, + "uitype": "bitmask", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "rsa-sha2-256,rsa-sha2-512,ssh-ed25519", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "1", "localName": "rsa-sha2-256", + "platformFlavors": [ + + ], + "label": "rsa-sha2-256 "}, + { "value": "2", "localName": "rsa-sha2-512", + "platformFlavors": [ + + ], + "label": "rsa-sha2-512 "}, + { "value": "4", "localName": "ssh-ed25519", + "platformFlavors": [ + + ], + "label": "ssh-ed25519 "} + ], + "default": "rsa-sha2-256,rsa-sha2-512,ssh-ed25519", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "kexAlgos": { + "versions": "4.2(7f)-4.2(7w),5.2(1g)-", + "isConfigurable": true, + "propGlobalId": "63222", + "propLocalId": "13822", + "label": "Kex Algorithms", + "baseType": "scalar:Bitmask64", + "modelType": "comm:KexAlgorithmTypes", + "needsPropDelimiters": false, + "uitype": "bitmask", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "128", "localName": "curve25519-sha256", + "platformFlavors": [ + + ], + "label": "curve25519-sha256 "}, + { "value": "8", "localName": "curve25519-sha256@libssh.org", + "platformFlavors": [ + + ], + "label": "curve25519-sha256@libssh.org "}, + { "value": "diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,curve25519-sha256@libssh.org,ecdh-sha2-nistp521,ecdh-sha2-nistp384,ecdh-sha2-nistp256,curve25519-sha256", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "1", "localName": "diffie-hellman-group1-sha1", + "platformFlavors": [ + + ], + "label": "diffie-hellman-group1-sha1 "}, + { "value": "2", "localName": "diffie-hellman-group14-sha1", + "platformFlavors": [ + + ], + "label": "diffie-hellman-group14-sha1 "}, + { "value": "4", "localName": "diffie-hellman-group14-sha256", + "platformFlavors": [ + + ], + "label": "diffie-hellman-group14-sha256 "}, + { "value": "256", "localName": "diffie-hellman-group16-sha512", + "platformFlavors": [ + + ], + "label": "diffie-hellman-group16-sha512 "}, + { "value": "64", "localName": "ecdh-sha2-nistp256", + "platformFlavors": [ + + ], + "label": "ecdh-sha2-nistp256 "}, + { "value": "16", "localName": "ecdh-sha2-nistp384", + "platformFlavors": [ + + ], + "label": "ecdh-sha2-nistp384 "}, + { "value": "32", "localName": "ecdh-sha2-nistp521", + "platformFlavors": [ + + ], + "label": "ecdh-sha2-nistp521 "} + ], + "default": "diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,curve25519-sha256@libssh.org,ecdh-sha2-nistp521,ecdh-sha2-nistp384,ecdh-sha2-nistp256,curve25519-sha256", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "lcOwn": { + "versions": "1.0(1e)-", + "comment": [ + "A value that indicates how this object was created. For internal use only." + ], + "isConfigurable": false, + "propGlobalId": "9", + "propLocalId": "9", + "label": "lcOwn", + "baseType": "scalar:Enum8", + "modelType": "mo:Owner", + "needsPropDelimiters": false, + "uitype": "enum", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "local", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "4", "localName": "implicit", + "platformFlavors": [ + + ], + "label": "Implicit "}, + { "value": "0", "localName": "local", + "platformFlavors": [ + + ], + "label": "Local "}, + { "value": "1", "localName": "policy", + "platformFlavors": [ + + ], + "label": "Policy "}, + { "value": "2", "localName": "replica", + "platformFlavors": [ + + ], + "label": "Replica "}, + { "value": "3", "localName": "resolveOnBehalf", + "platformFlavors": [ + + ], + "label": "Resolved On Behalf "} + ], + "default": "local", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "modTs": { + "versions": "1.0(1e)-", + "comment": [ + "The time when this object was last modified." + ], + "isConfigurable": false, + "propGlobalId": "7", + "propLocalId": "7", + "label": "modTs", + "baseType": "scalar:Date", + "modelType": "mo:TStamp", + "needsPropDelimiters": false, + "uitype": "auto", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "never", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "0", "localName": "never", + "platformFlavors": [ + + ], + "label": "Never "} + ], + "default": "never", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "name": { + "versions": "1.0(1e)-", + "comment": [ + "null" + ], + "isConfigurable": true, + "propGlobalId": "1304", + "propLocalId": "13", + "label": "Name", + "baseType": "string:Basic", + "modelType": "naming:Name", + "needsPropDelimiters": false, + "uitype": "string", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": true, + "isLike": false, + "validators": [ + {"min" : 0, "max": 64, + "regexs": [ + {"regex" : "^[a-zA-Z0-9_.:-]+$", "type": "include"} + ] + } + ], + "validValues": [ + { "value": "ssh", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "} + ], + "default": "ssh", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "nameAlias": { + "versions": "2.2(1k)-", + "isConfigurable": true, + "propGlobalId": "28417", + "propLocalId": "6719", + "label": "Display Name", + "baseType": "string:Basic", + "modelType": "naming:NameAlias", + "needsPropDelimiters": false, + "uitype": "string", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validators": [ + {"min" : 0, "max": 63, + "regexs": [ + {"regex" : "^[a-zA-Z0-9_.-]+$", "type": "include"} + ] + } + ], + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "passwordAuth": { + "versions": "4.1(1i)-", + "isConfigurable": true, + "propGlobalId": "53378", + "propLocalId": "12289", + "label": "Password Auth State", + "baseType": "scalar:Enum8", + "modelType": "comm:AdminState", + "needsPropDelimiters": false, + "uitype": "enum", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "enabled", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "2", "localName": "disabled", + "platformFlavors": [ + + ], + "label": "Disabled "}, + { "value": "1", "localName": "enabled", + "platformFlavors": [ + + ], + "label": "Enabled "} + ], + "default": "enabled", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "port": { + "versions": "1.0(1e)-", + "comment": [ + "The SSH port." + ], + "isConfigurable": true, + "propGlobalId": "1305", + "propLocalId": "127", + "label": "Port", + "baseType": "scalar:Uint32", + "modelType": "comm:Port", + "needsPropDelimiters": false, + "uitype": "number", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": true, + "isLike": false, + "validators": [ + {"min" : 0, "max": 65535 } + ], + "validValues": [ + { "value": "22", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "} + ], + "default": 22, + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "proto": { + "versions": "1.0(1e)-", + "comment": [ + "The list of protocols to match." + ], + "isConfigurable": false, + "propGlobalId": "1300", + "propLocalId": "144", + "label": "proto", + "baseType": "scalar:Enum8", + "modelType": "comm:Protocol", + "needsPropDelimiters": false, + "uitype": "enum", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": true, + "isLike": false, + "validValues": [ + { "value": "3", "localName": "all", + "platformFlavors": [ + + ], + "label": "All "}, + { "value": "tcp", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "0", "localName": "none", + "platformFlavors": [ + + ], + "label": "None "}, + { "value": "1", "localName": "tcp", + "platformFlavors": [ + + ], + "label": "tcp "}, + { "value": "2", "localName": "udp", + "platformFlavors": [ + + ], + "label": "udp "} + ], + "default": "tcp", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "rn": { + "versions": "1.0(1e)-", + "comment": [ + "Identifies an object from its siblings within the context of its parent object. The distinguished name contains a sequence of relative names." + ], + "isConfigurable": false, + "propGlobalId": "2", + "propLocalId": "3", + "label": "rn", + "baseType": "reference:BinRN", + "modelType": "reference:BinRN", + "needsPropDelimiters": true, + "uitype": "auto", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "sshCiphers": { + "versions": "3.1(1i)-", + "isConfigurable": true, + "propGlobalId": "36807", + "propLocalId": "8601", + "label": "SSH Ciphers", + "baseType": "scalar:Bitmask64", + "modelType": "comm:SshCipherTypes", + "needsPropDelimiters": false, + "uitype": "bitmask", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "1", "localName": "aes128-ctr", + "platformFlavors": [ + + ], + "label": "aes128-ctr "}, + { "value": "8", "localName": "aes128-gcm@openssh.com", + "platformFlavors": [ + + ], + "label": "aes128-gcm@openssh.com "}, + { "value": "2", "localName": "aes192-ctr", + "platformFlavors": [ + + ], + "label": "aes192-ctr "}, + { "value": "4", "localName": "aes256-ctr", + "platformFlavors": [ + + ], + "label": "aes256-ctr "}, + { "value": "32", "localName": "aes256-gcm@openssh.com", + "platformFlavors": [ + + ], + "label": "aes256-gcm@openssh.com "}, + { "value": "16", "localName": "chacha20-poly1305@openssh.com", + "platformFlavors": [ + + ], + "label": "chacha20-poly1305@openssh.com "}, + { "value": "aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,chacha20-poly1305@openssh.com", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "} + ], + "default": "aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,chacha20-poly1305@openssh.com", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "sshMacs": { + "versions": "3.1(1i)-", + "isConfigurable": true, + "propGlobalId": "36808", + "propLocalId": "8602", + "label": "SSH MACs", + "baseType": "scalar:Bitmask64", + "modelType": "comm:SshMacTypes", + "needsPropDelimiters": false, + "uitype": "bitmask", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "hmac-sha2-256,hmac-sha2-512,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "1", "localName": "hmac-sha1", + "platformFlavors": [ + + ], + "label": "hmac-sha1 "}, + { "value": "2", "localName": "hmac-sha2-256", + "platformFlavors": [ + + ], + "label": "hmac-sha2-256 "}, + { "value": "8", "localName": "hmac-sha2-256-etm@openssh.com", + "platformFlavors": [ + + ], + "label": "hmac-sha2-256-etm@openssh.com "}, + { "value": "4", "localName": "hmac-sha2-512", + "platformFlavors": [ + + ], + "label": "hmac-sha2-512 "}, + { "value": "16", "localName": "hmac-sha2-512-etm@openssh.com", + "platformFlavors": [ + + ], + "label": "hmac-sha2-512-etm@openssh.com "} + ], + "default": "hmac-sha2-256,hmac-sha2-512,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "status": { + "versions": "1.0(1e)-", + "comment": [ + "The upgrade status. This property is for internal use only." + ], + "isConfigurable": false, + "propGlobalId": "3", + "propLocalId": "4", + "label": "status", + "baseType": "scalar:Bitmask32", + "modelType": "mo:ModificationStatus", + "needsPropDelimiters": false, + "uitype": "bitmask", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "2", "localName": "created", + "platformFlavors": [ + + ], + "comment": [ + "In a setter method: specifies that an object should be created. An error is returned if the object already exists. \nIn the return value of a setter method: indicates that an object has been created. \n" + ], + "label": "Created "}, + { "value": "8", "localName": "deleted", + "platformFlavors": [ + + ], + "comment": [ + "In a setter method: specifies that an object should be deleted. \nIn the return value of a setter method: indicates that an object has been deleted.\n" + ], + "label": "Deleted "}, + { "value": "4", "localName": "modified", + "platformFlavors": [ + + ], + "comment": [ + "In a setter method: specifies that an object should be modified \nIn the return value of a setter method: indicates that an object has been modified.\n" + ], + "label": "Modified "} + ], + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "uid": { + "versions": "1.0(1e)-", + "comment": [ + "A unique identifier for this object." + ], + "isConfigurable": false, + "propGlobalId": "8", + "propLocalId": "8", + "label": "uid", + "baseType": "scalar:Uint16", + "modelType": "scalar:Uint16", + "needsPropDelimiters": false, + "uitype": "auto", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "userdom": { + "versions": "5.0(1k)-", + "isConfigurable": true, + "propGlobalId": "60657", + "propLocalId": "13244", + "label": "userdom", + "baseType": "string:Basic", + "modelType": "mo:UserDomType", + "needsPropDelimiters": false, + "uitype": "string", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validators": [ + {"min" : 0, "max": 1024, + "regexs": [ + {"regex" : "^[a-zA-Z0-9_.:-]+$", "type": "include"} + ] + } + ], + "validValues": [ + { "value": "all", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "} + ], + "default": "all", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + } + } + } +} diff --git a/gen/meta/commTelnet.json b/gen/meta/commTelnet.json new file mode 100644 index 000000000..2056dd78e --- /dev/null +++ b/gen/meta/commTelnet.json @@ -0,0 +1,775 @@ +{ + "comm:Telnet": { + "contains": { + "aaa:RbacAnnotation": "", + "fault:Delegate": "", + "tag:Annotation": "", + "tag:Tag": "" + }, + "rnMap": { + "annotationKey-": "tag:Annotation", + "fd-": "fault:Delegate", + "rbacDom-": "aaa:RbacAnnotation", + "tagKey-": "tag:Tag" + }, + "identifiedBy": [ + + ], + "rnFormat": "telnet", + "containedBy": { + "comm:Pol": "" + }, + "superClasses": [ + "comm:Shell", + "comm:Comp", + "pol:Comp", + "pol:Obj", + "naming:NamedObject" + ], + "subClasses": { + + }, + "relationFrom": { + + }, + "relationTo": { + + }, + "dnFormats": [ + "uni/fabric/comm-{name}/telnet" + ], + "writeAccess": [ + "aaa", + "admin" + ], + "readAccess": [ + "aaa", + "admin", + "fabric-equipment" + ], + "faults": { + + }, + "events": { + "E4205024": "modification||comm:Telnet", + "E4211237": "creation||comm:Telnet", + "E4211238": "modification||comm:Telnet", + "E4211239": "deletion||comm:Telnet" + }, + "stats": { + + }, + "versions": "1.0(1e)-", + "isAbstract": false, + "isConfigurable": true, + "isContextRoot": false, + "isNxosConverged": false, + "isDeprecated": true, + "isHidden": false, + "isEncrypted": false, + "isExportable": true, + "isPersistent": true, + "isSubjectToQuota": false, + "isObservable": false, + "hasStats": false, + "isStat": false, + "isFaultable": false, + "isDomainable": false, + "isHealthScorable": false, + "shouldCollectHealthStats": false, + "healthCollectionSource": "faults", + "hasEventRules": false, + "abstractionLayer": "ambiguous", + "apicNxProcessing": false, + "monitoringPolicySource": "Parent", + "isCreatableDeletable": "never", + "platformFlavors": [ + + ], + "classId": "1582", + "className": "Telnet", + "classPkg": "comm", + "featureTag": "", + "moCategory": "Regular", + "label": "Telnet Service", + "comment": [ + "Telnet" + ], + "properties": { + "adminSt": { + "versions": "1.0(1e)-", + "comment": [ + "The state of Telnet communication service. This can be enabled or disabled." + ], + "isConfigurable": true, + "propGlobalId": "1303", + "propLocalId": "46", + "label": "Admin State", + "baseType": "scalar:Enum8", + "modelType": "comm:AdminState", + "needsPropDelimiters": false, + "uitype": "enum", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": true, + "isLike": false, + "validValues": [ + { "value": "disabled", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "2", "localName": "disabled", + "platformFlavors": [ + + ], + "label": "Disabled "}, + { "value": "1", "localName": "enabled", + "platformFlavors": [ + + ], + "label": "Enabled "} + ], + "default": "disabled", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "annotation": { + "versions": "3.2(1l)-", + "comment": [ + "User annotation. Suggested format orchestrator:value" + ], + "isConfigurable": true, + "propGlobalId": "37533", + "propLocalId": "8719", + "label": "Annotation", + "baseType": "string:Basic", + "modelType": "mo:Annotation", + "needsPropDelimiters": false, + "uitype": "string", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validators": [ + {"min" : 0, "max": 128, + "regexs": [ + {"regex" : "^[a-zA-Z0-9_.:-]+$", "type": "include"} + ] + } + ], + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "childAction": { + "versions": "1.0(1e)-", + "comment": [ + "Delete or ignore. For internal use only." + ], + "isConfigurable": false, + "propGlobalId": "4", + "propLocalId": "5", + "label": "childAction", + "baseType": "scalar:Bitmask32", + "modelType": "mo:ModificationChildAction", + "needsPropDelimiters": false, + "uitype": "bitmask", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "16384", "localName": "deleteAll", + "platformFlavors": [ + + ], + "label": "Delete All "}, + { "value": "8192", "localName": "deleteNonPresent", + "platformFlavors": [ + + ], + "label": "Delete Non Present "}, + { "value": "4096", "localName": "ignore", + "platformFlavors": [ + + ], + "label": "Ignore "} + ], + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "descr": { + "versions": "1.0(1e)-", + "comment": [ + "Specifies the description of a policy component." + ], + "isConfigurable": true, + "propGlobalId": "5582", + "propLocalId": "28", + "label": "Description", + "baseType": "string:Basic", + "modelType": "naming:Descr", + "needsPropDelimiters": false, + "uitype": "string", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": false, + "isLike": true, + "likeProp": "naming:Described:descr", + "validators": [ + {"min" : 0, "max": 128, + "regexs": [ + {"regex" : "^[a-zA-Z0-9\\\\!#$%()*,-./:;@ _{|}~?&+]+$", "type": "include"} + ] + } + ], + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "dn": { + "versions": "1.0(1e)-", + "comment": [ + "A tag or metadata is a non-hierarchical keyword or term assigned to the fabric module." + ], + "isConfigurable": false, + "propGlobalId": "1", + "propLocalId": "2", + "label": "dn", + "baseType": "reference:BinRef", + "modelType": "reference:BinRef", + "needsPropDelimiters": true, + "uitype": "auto", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "extMngdBy": { + "versions": "3.2(1l)-", + "comment": [ + "Indicates which orchestrator is managing this MO" + ], + "isConfigurable": false, + "propGlobalId": "39672", + "propLocalId": "8023", + "label": "Managed By", + "baseType": "scalar:Bitmask32", + "modelType": "mo:ExtMngdByType", + "needsPropDelimiters": false, + "uitype": "bitmask", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "undefined", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "1", "localName": "msc", + "platformFlavors": [ + + ], + "label": "MSC "}, + { "value": "0", "localName": "undefined", + "platformFlavors": [ + + ], + "label": "Undefined "} + ], + "default": "undefined", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "lcOwn": { + "versions": "1.0(1e)-", + "comment": [ + "A value that indicates how this object was created. For internal use only." + ], + "isConfigurable": false, + "propGlobalId": "9", + "propLocalId": "9", + "label": "lcOwn", + "baseType": "scalar:Enum8", + "modelType": "mo:Owner", + "needsPropDelimiters": false, + "uitype": "enum", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "local", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "4", "localName": "implicit", + "platformFlavors": [ + + ], + "label": "Implicit "}, + { "value": "0", "localName": "local", + "platformFlavors": [ + + ], + "label": "Local "}, + { "value": "1", "localName": "policy", + "platformFlavors": [ + + ], + "label": "Policy "}, + { "value": "2", "localName": "replica", + "platformFlavors": [ + + ], + "label": "Replica "}, + { "value": "3", "localName": "resolveOnBehalf", + "platformFlavors": [ + + ], + "label": "Resolved On Behalf "} + ], + "default": "local", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "modTs": { + "versions": "1.0(1e)-", + "comment": [ + "The time when this object was last modified." + ], + "isConfigurable": false, + "propGlobalId": "7", + "propLocalId": "7", + "label": "modTs", + "baseType": "scalar:Date", + "modelType": "mo:TStamp", + "needsPropDelimiters": false, + "uitype": "auto", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "never", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "0", "localName": "never", + "platformFlavors": [ + + ], + "label": "Never "} + ], + "default": "never", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "name": { + "versions": "1.0(1e)-", + "comment": [ + "null" + ], + "isConfigurable": true, + "propGlobalId": "1301", + "propLocalId": "13", + "label": "Name", + "baseType": "string:Basic", + "modelType": "naming:Name", + "needsPropDelimiters": false, + "uitype": "string", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": true, + "isLike": false, + "validators": [ + {"min" : 0, "max": 64, + "regexs": [ + {"regex" : "^[a-zA-Z0-9_.:-]+$", "type": "include"} + ] + } + ], + "validValues": [ + { "value": "telnet", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "} + ], + "default": "telnet", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "nameAlias": { + "versions": "2.2(1k)-", + "isConfigurable": true, + "propGlobalId": "28417", + "propLocalId": "6719", + "label": "Display Name", + "baseType": "string:Basic", + "modelType": "naming:NameAlias", + "needsPropDelimiters": false, + "uitype": "string", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validators": [ + {"min" : 0, "max": 63, + "regexs": [ + {"regex" : "^[a-zA-Z0-9_.-]+$", "type": "include"} + ] + } + ], + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "port": { + "versions": "1.0(1e)-", + "comment": [ + "The port used for Telnet communication service." + ], + "isConfigurable": true, + "propGlobalId": "1302", + "propLocalId": "127", + "label": "Port", + "baseType": "scalar:Uint32", + "modelType": "comm:Port", + "needsPropDelimiters": false, + "uitype": "number", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": true, + "isLike": false, + "validators": [ + {"min" : 0, "max": 65535 } + ], + "validValues": [ + { "value": "23", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "} + ], + "default": 23, + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "proto": { + "versions": "1.0(1e)-", + "comment": [ + "The list of protocols to match." + ], + "isConfigurable": false, + "propGlobalId": "1300", + "propLocalId": "144", + "label": "proto", + "baseType": "scalar:Enum8", + "modelType": "comm:Protocol", + "needsPropDelimiters": false, + "uitype": "enum", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": true, + "isLike": false, + "validValues": [ + { "value": "3", "localName": "all", + "platformFlavors": [ + + ], + "label": "All "}, + { "value": "tcp", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "0", "localName": "none", + "platformFlavors": [ + + ], + "label": "None "}, + { "value": "1", "localName": "tcp", + "platformFlavors": [ + + ], + "label": "tcp "}, + { "value": "2", "localName": "udp", + "platformFlavors": [ + + ], + "label": "udp "} + ], + "default": "tcp", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "rn": { + "versions": "1.0(1e)-", + "comment": [ + "Identifies an object from its siblings within the context of its parent object. The distinguished name contains a sequence of relative names." + ], + "isConfigurable": false, + "propGlobalId": "2", + "propLocalId": "3", + "label": "rn", + "baseType": "reference:BinRN", + "modelType": "reference:BinRN", + "needsPropDelimiters": true, + "uitype": "auto", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "status": { + "versions": "1.0(1e)-", + "comment": [ + "The upgrade status. This property is for internal use only." + ], + "isConfigurable": false, + "propGlobalId": "3", + "propLocalId": "4", + "label": "status", + "baseType": "scalar:Bitmask32", + "modelType": "mo:ModificationStatus", + "needsPropDelimiters": false, + "uitype": "bitmask", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "2", "localName": "created", + "platformFlavors": [ + + ], + "comment": [ + "In a setter method: specifies that an object should be created. An error is returned if the object already exists. \nIn the return value of a setter method: indicates that an object has been created. \n" + ], + "label": "Created "}, + { "value": "8", "localName": "deleted", + "platformFlavors": [ + + ], + "comment": [ + "In a setter method: specifies that an object should be deleted. \nIn the return value of a setter method: indicates that an object has been deleted.\n" + ], + "label": "Deleted "}, + { "value": "4", "localName": "modified", + "platformFlavors": [ + + ], + "comment": [ + "In a setter method: specifies that an object should be modified \nIn the return value of a setter method: indicates that an object has been modified.\n" + ], + "label": "Modified "} + ], + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "uid": { + "versions": "1.0(1e)-", + "comment": [ + "A unique identifier for this object." + ], + "isConfigurable": false, + "propGlobalId": "8", + "propLocalId": "8", + "label": "uid", + "baseType": "scalar:Uint16", + "modelType": "scalar:Uint16", + "needsPropDelimiters": false, + "uitype": "auto", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "userdom": { + "versions": "5.0(1k)-", + "isConfigurable": true, + "propGlobalId": "60657", + "propLocalId": "13244", + "label": "userdom", + "baseType": "string:Basic", + "modelType": "mo:UserDomType", + "needsPropDelimiters": false, + "uitype": "string", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validators": [ + {"min" : 0, "max": 1024, + "regexs": [ + {"regex" : "^[a-zA-Z0-9_.:-]+$", "type": "include"} + ] + } + ], + "validValues": [ + { "value": "all", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "} + ], + "default": "all", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + } + } + } +} diff --git a/gen/templates/datasource.go.tmpl b/gen/templates/datasource.go.tmpl index 838dbe434..e18c3b32f 100644 --- a/gen/templates/datasource.go.tmpl +++ b/gen/templates/datasource.go.tmpl @@ -135,50 +135,7 @@ func (d *{{.ResourceClassName}}DataSource) Schema(ctx context.Context, req datas },{{- end}} {{- end}} {{- range .Children}} - {{- if or (not .IdentifiedBy) .MaxOneClassAllowed}} - "{{overwriteProperty .PkgName .ResourceName $.Definitions}}": schema.SingleNestedAttribute{ - MarkdownDescription: `{{.Comment}}`, - Computed: true, - Attributes: map[string]schema.Attribute{ - {{- range .Properties}} - {{- if eq .ValueType "bitmask"}} - "{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}": schema.SetAttribute{ - Computed: true, - MarkdownDescription: `{{.Comment}}`, - ElementType: types.StringType, - },{{else}} - "{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}": schema.StringAttribute{ - Computed: true, - MarkdownDescription: `{{.Comment}}`, - },{{- end}} - {{- end}} - }, - }, - {{- else}} - "{{overwriteProperty .PkgName .ResourceName $.Definitions}}": schema.SetNestedAttribute{ - MarkdownDescription: `{{.Comment}}`, - Computed: true, - NestedObject: schema.NestedAttributeObject{ - Attributes: map[string]schema.Attribute{ - {{- range .Properties}} - {{- if eq .ValueType "bitmask"}} - "{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}": schema.SetAttribute{ - Computed: true, - MarkdownDescription: `{{.Comment}}`, - ElementType: types.StringType, - },{{else}} - "{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}": schema.StringAttribute{ - {{- if .HasCustomType}} - CustomType: customTypes.{{.ResourceClassName}}{{.Name}}StringType{}, - {{- end}} - Computed: true, - MarkdownDescription: `{{.Comment}}`, - },{{- end}} - {{- end}} - }, - }, - }, - {{- end}} + {{- template "childAttributes" . }} {{- end}} }, {{- if .LegacyAttributes}} @@ -277,3 +234,57 @@ func (d *{{.ResourceClassName}}DataSource) Read(ctx context.Context, req datasou resp.Diagnostics.Append(resp.State.Set(ctx, &data)...) tflog.Debug(ctx, fmt.Sprintf("End read of datasource aci_{{.ResourceName}} with id '%s'", data.Id.ValueString())) } + +{{/* A sub template for the child attributes used in the Attributes block. */}} +{{- define "childAttributes" }} + {{- if or (not .IdentifiedBy) .MaxOneClassAllowed}} + "{{overwriteProperty .PkgName .ResourceName $.Definitions}}": schema.SingleNestedAttribute{ + MarkdownDescription: `{{.Comment}}`, + Computed: true, + Attributes: map[string]schema.Attribute{ + {{- range .Properties}} + {{- if eq .ValueType "bitmask"}} + "{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}": schema.SetAttribute{ + Computed: true, + MarkdownDescription: `{{.Comment}}`, + ElementType: types.StringType, + },{{else}} + "{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `{{.Comment}}`, + },{{- end}} + {{- end}} + {{- range .Children }} + {{- template "childAttributes" . }} + {{- end }} + }, + }, + {{- else}} + "{{overwriteProperty .PkgName .ResourceName $.Definitions}}": schema.SetNestedAttribute{ + MarkdownDescription: `{{.Comment}}`, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + {{- range .Properties}} + {{- if eq .ValueType "bitmask"}} + "{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}": schema.SetAttribute{ + Computed: true, + MarkdownDescription: `{{.Comment}}`, + ElementType: types.StringType, + },{{else}} + "{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}": schema.StringAttribute{ + {{- if .HasCustomType}} + CustomType: customTypes.{{.ResourceClassName}}{{.Name}}StringType{}, + {{- end}} + Computed: true, + MarkdownDescription: `{{.Comment}}`, + },{{- end}} + {{- end}} + {{- range .Children }} + {{- template "childAttributes" . }} + {{- end }} + }, + }, + }, + {{- end}} +{{- end }} diff --git a/gen/templates/datasource.md.tmpl b/gen/templates/datasource.md.tmpl index ee01e5ef4..949eff986 100644 --- a/gen/templates/datasource.md.tmpl +++ b/gen/templates/datasource.md.tmpl @@ -87,36 +87,48 @@ Data source for ACI {{.ResourceNameAsDescription}} {{- end}} {{- end}} {{- end}} -{{ range .Children }}{{$childVersion := .Versions}}{{$RelationshipClasses := .RelationshipClasses}}{{$length := len .RelationshipClasses}} +{{- range .Children }} + {{- $newCtx := addToTemplateProperties . "Indent" "" "Versions" $.Versions }} + {{- template "childResourcesAndProperties" $newCtx }} +{{- end}} +{{/* A sub template for including nested children in the docs. */}} +{{- define "childResourcesAndProperties" -}} +{{- $indent := .TemplateProperties.Indent }} +{{- $parentVersion := .TemplateProperties.Versions }} +{{- $childVersion := .Versions}}{{$RelationshipClasses := .RelationshipClasses}}{{$length := len .RelationshipClasses}} {{- if ge $length 1}} {{- if .MultiRelationshipClass}} - {{$RelationshipResourceNames := .RelationshipResourceNames}} -* `{{- overwriteProperty .PkgName .ResourceName $.Definitions}}` - (list) A list of {{getResourceNameAsDescription .ResourceName $.Definitions}} (ACI object {{getDevnetDocForClass .PkgName}}). This relation{{if and (ne $.Versions .Versions) (ne .Versions "")}} This attribute is supported in ACI versions: {{ .Versions}} and{{- end}} can point to multiple ACI objects: + {{ $RelationshipResourceNames := .RelationshipResourceNames}} +{{ $indent }}* `{{- overwriteProperty .PkgName .ResourceName $.Definitions}}` - (list) A list of {{getResourceNameAsDescription .ResourceName $.Definitions}} (ACI object {{getDevnetDocForClass .PkgName}}). This relation{{if and (ne $.Versions .Versions) (ne .Versions "")}} This attribute is supported in ACI versions: {{ .Versions}} and{{- end}} can point to multiple ACI objects: {{- range $index, $value := .RelationshipClasses}} {{- if le $index (len $RelationshipResourceNames)}} - - {{getDevnetDocForClass $value}}. + {{ $indent }}- {{getDevnetDocForClass $value}}. {{- end}} {{- end}} {{- else}} {{- if or (not .IdentifiedBy) .MaxOneClassAllowed}} -* `{{- overwriteProperty .PkgName .ResourceName $.Definitions}}` - (map) A map of {{getResourceNameAsDescription .ResourceName $.Definitions}} (ACI object {{getDevnetDocForClass .PkgName}}) pointing to {{range $index, $value := .RelationshipResourceNames}}{{- if or (eq $length 1) (eq $.PkgName (index $RelationshipClasses $index))}}{{getResourceNameAsDescription $value $.Definitions}} (ACI Object {{getDevnetDocForClass (index $RelationshipClasses $index)}}){{end}}{{end}}.{{if and (ne $.Versions .Versions) (ne .Versions "")}} This attribute is supported in ACI versions: {{ .Versions}}{{- end}} +{{ $indent }}* `{{- overwriteProperty .PkgName .ResourceName $.Definitions}}` - (map) A map of {{getResourceNameAsDescription .ResourceName $.Definitions}} (ACI object {{getDevnetDocForClass .PkgName}}) pointing to {{range $index, $value := .RelationshipResourceNames}}{{- if or (eq $length 1) (eq $.PkgName (index $RelationshipClasses $index))}}{{getResourceNameAsDescription $value $.Definitions}} (ACI Object {{getDevnetDocForClass (index $RelationshipClasses $index)}}){{end}}{{end}}.{{if and (ne $parentVersion .Versions) (ne .Versions "")}} This attribute is supported in ACI versions: {{ .Versions}}{{- end}} {{- else}} -* `{{- overwriteProperty .PkgName .ResourceName $.Definitions}}` - (list) A list of {{getResourceNameAsDescription .ResourceName $.Definitions}} (ACI object {{getDevnetDocForClass .PkgName}}) pointing to {{range $index, $value := .RelationshipResourceNames}}{{- if or (eq $length 1) (eq $.PkgName (index $RelationshipClasses $index))}}{{getResourceNameAsDescription $value $.Definitions}} (ACI Object {{getDevnetDocForClass (index $RelationshipClasses $index)}}){{end}}{{end}}.{{if and (ne $.Versions .Versions) (ne .Versions "")}} This attribute is supported in ACI versions: {{ .Versions}}{{- end}} +{{ $indent }}* `{{- overwriteProperty .PkgName .ResourceName $.Definitions}}` - (list) A list of {{getResourceNameAsDescription .ResourceName $.Definitions}} (ACI object {{getDevnetDocForClass .PkgName}}) pointing to {{range $index, $value := .RelationshipResourceNames}}{{- if or (eq $length 1) (eq $.PkgName (index $RelationshipClasses $index))}}{{getResourceNameAsDescription $value $.Definitions}} (ACI Object {{getDevnetDocForClass (index $RelationshipClasses $index)}}){{end}}{{end}}.{{if and (ne $parentVersion .Versions) (ne .Versions "")}} This attribute is supported in ACI versions: {{ .Versions}}{{- end}} {{- end}} {{- end}} {{- else}} {{- if or (not .IdentifiedBy) .MaxOneClassAllowed}} -* `{{- overwriteProperty .PkgName .ResourceName $.Definitions}}` - (map) A map of {{getResourceNameAsDescription .ResourceName $.Definitions}} (ACI object {{getDevnetDocForClass .PkgName}}).{{if and (ne $.Versions .Versions) (ne .Versions "")}} This attribute is supported in ACI versions: {{ .Versions}}{{- end}} +{{ $indent }}* `{{- overwriteProperty .PkgName .ResourceName $.Definitions}}` - (map) A map of {{getResourceNameAsDescription .ResourceName $.Definitions}} (ACI object {{getDevnetDocForClass .PkgName}}).{{if and (ne $parentVersion .Versions) (ne .Versions "")}} This attribute is supported in ACI versions: {{ .Versions}}{{- end}} {{- else}} -* `{{- overwriteProperty .PkgName .ResourceName $.Definitions}}` - (list) A list of {{getResourceNameAsDescription .ResourceName $.Definitions}} (ACI object {{getDevnetDocForClass .PkgName}}).{{if and (ne $.Versions .Versions) (ne .Versions "")}} This attribute is supported in ACI versions: {{ .Versions}}{{- end}} +{{ $indent }}* `{{- overwriteProperty .PkgName .ResourceName $.Definitions}}` - (list) A list of {{getResourceNameAsDescription .ResourceName $.Definitions}} (ACI object {{getDevnetDocForClass .PkgName}}).{{if and (ne $parentVersion .Versions) (ne .Versions "")}} This attribute is supported in ACI versions: {{ .Versions}}{{- end}} {{- end}} {{- end}} {{- range .Properties}} {{- if eq .ValueType "bitmask"}} - * `{{- overwriteProperty .PkgName .SnakeCaseName $.Definitions}}` ({{- .PropertyName}}) - (list) {{.Comment}}{{if ne $childVersion .Versions}} This attribute is supported in ACI versions: {{ .Versions}}{{- end}} + {{ $indent }}* `{{- overwriteProperty .PkgName .SnakeCaseName $.Definitions}}` ({{- .PropertyName}}) - (list) {{.Comment}}{{if ne $childVersion .Versions}} This attribute is supported in ACI versions: {{ .Versions}}{{- end}} {{- else}} - * `{{- overwriteProperty .PkgName .SnakeCaseName $.Definitions}}` ({{- .PropertyName}}) - (string) {{.Comment}}{{if ne $childVersion .Versions}} This attribute is supported in ACI versions: {{ .Versions}}{{- end}} + {{ $indent }}* `{{- overwriteProperty .PkgName .SnakeCaseName $.Definitions}}` ({{- .PropertyName}}) - (string) {{.Comment}}{{if ne $childVersion .Versions}} This attribute is supported in ACI versions: {{ .Versions}}{{- end}} {{- end}} {{- end}} -{{ end}} \ No newline at end of file +{{- range .Children }} + {{- $newCtx := addToTemplateProperties . "Indent" (print $indent " ") "Versions" $parentVersion }} + {{- template "childResourcesAndProperties" $newCtx }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/gen/templates/datasource_test.go.tmpl b/gen/templates/datasource_test.go.tmpl index 16321a765..1bbcb93c8 100644 --- a/gen/templates/datasource_test.go.tmpl +++ b/gen/templates/datasource_test.go.tmpl @@ -37,7 +37,7 @@ func TestAccDataSource{{$.resourceClassName}}{{if .class_name}}With{{capitalize {{- if not (definedInMap $key $.datasource_required)}} {{- if eq $key "version_mismatch" }} {{- range $version, $attributes := $value }} - composeAggregateTestCheckFuncWithVersion(t, "{{$version}}", ">",{{- range $attributeName, $attributeValue := $attributes}} + composeAggregateTestCheckFuncWithVersion(t, "{{$version}}", ">=",{{- range $attributeName, $attributeValue := $attributes}} {{- if not (definedInList $.exclude_attributes $attributeName) }} {{- if (isInterfaceSlice $attributeValue)}} resource.TestCheckResourceAttr("data.aci_{{$.resourceName}}.test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}", "{{$attributeName}}.#", "{{len $attributeValue}}"), @@ -95,7 +95,7 @@ func TestAccDataSource{{.resourceClassName}}(t *testing.T) { {{- range $key, $value := .all}} {{- if eq $key "version_mismatch" }} {{- range $version, $attributes := $value }} - composeAggregateTestCheckFuncWithVersion(t, "{{$version}}", ">",{{- range $attributeName, $attributeValue := $attributes}} + composeAggregateTestCheckFuncWithVersion(t, "{{$version}}", ">=",{{- range $attributeName, $attributeValue := $attributes}} {{- if not (definedInList $.exclude_attributes $attributeName) }} {{- if (isInterfaceSlice $attributeValue)}} resource.TestCheckResourceAttr("data.aci_{{$.resourceName}}.test", "{{$attributeName}}.#", "{{len $attributeValue}}"), diff --git a/gen/templates/resource.go.tmpl b/gen/templates/resource.go.tmpl index 68b078e4a..a2f94c2fc 100644 --- a/gen/templates/resource.go.tmpl +++ b/gen/templates/resource.go.tmpl @@ -2,6 +2,7 @@ // In order to regenerate this file execute `go generate` from the repository root. // More details can be found in the [README](https://github.com/CiscoDevNet/terraform-provider-aci/blob/master/README.md). + package provider import ( @@ -106,22 +107,36 @@ func getEmpty{{.ResourceClassName}}ResourceModel() *{{.ResourceClassName}}Resour {{ .ResourceClassName }}: types.ObjectNull(map[string]attr.Type{ {{- range .Properties}} {{- if eq .ValueType "bitmask"}} - "{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}": types.SetType(types.StringType), + "{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}": types.SetType{ElemType: types.StringType}, {{- else}} "{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}": types.StringType, {{- end}} {{- end}} + {{- range .Children}} + {{- if or (not .IdentifiedBy) .MaxOneClassAllowed}} + "{{overwriteProperty .PkgName .ResourceName $.Definitions}}": types.ObjectType{AttrTypes: {{.ResourceClassName}}{{.ParentHierarchy}}Type}, + {{- else}} + "{{overwriteProperty .PkgName .ResourceName $.Definitions}}": types.SetType{ElemType: {{.ResourceClassName}}{{.ParentHierarchy}}Type}, + {{- end}} + {{- end}} }), {{- else}} {{ .ResourceClassName }}: types.SetNull(types.ObjectType{ AttrTypes: map[string]attr.Type{ {{- range .Properties}} {{- if eq .ValueType "bitmask"}} - "{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}": types.SetType(types.StringType), + "{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}": types.SetType{ElemType: types.StringType}, {{- else}} "{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}": types.StringType, {{- end}} {{- end}} + {{- range .Children}} + {{- if or (not .IdentifiedBy) .MaxOneClassAllowed}} + "{{overwriteProperty .PkgName .ResourceName $.Definitions}}": types.ObjectType{AttrTypes: {{.ResourceClassName}}{{.ParentHierarchy}}Type}, + {{- else}} + "{{overwriteProperty .PkgName .ResourceName $.Definitions}}": types.SetType{ElemType: {{.ResourceClassName}}{{.ParentHierarchy}}Type}, + {{- end}} + {{- end}} }, }), {{- end}} @@ -150,47 +165,7 @@ func getEmpty{{.ResourceClassName}}ResourceModel() *{{.ResourceClassName}}Resour } {{- range .Children}} -// {{.ResourceClassName}}{{$.ResourceClassName}}ResourceModel describes the resource data model for the children without relation ships. -type {{.ResourceClassName}}{{$.ResourceClassName}}ResourceModel struct { - {{- range .Properties}} - {{- if eq .ValueType "bitmask"}} - {{ .Name }} types.Set `tfsdk:"{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}"` - {{- else if eq .Name "Id"}} - {{.ResourceClassName}}{{ .Name }} types.String `tfsdk:"{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}"` - {{- else if .HasCustomType}} - {{ .Name }} customTypes.{{.ResourceClassName}}{{.Name}}StringValue `tfsdk:"{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}"` - {{- else}} - {{ .Name }} types.String `tfsdk:"{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}"` - {{- end}} - {{- end}} -} - -func getEmpty{{.ResourceClassName}}{{$.ResourceClassName}}ResourceModel() {{.ResourceClassName}}{{$.ResourceClassName}}ResourceModel { - return {{.ResourceClassName}}{{$.ResourceClassName}}ResourceModel{ - {{- range .Properties}} - {{- if eq .ValueType "bitmask"}} - {{ .Name }}: types.SetNull(types.StringType), - {{- else if eq .Name "Id"}} - {{.ResourceClassName}}{{ .Name }}: basetypes.NewStringNull(), - {{- else if .HasCustomType}} - {{ .Name }}: customTypes.New{{.ResourceClassName}}{{.Name}}StringNull(), - {{- else}} - {{ .Name }}: basetypes.NewStringNull(), - {{- end}} - {{- end}} - } -} - {{- if or (not .IdentifiedBy) .MaxOneClassAllowed}} -var {{.ResourceClassName}}{{$.ResourceClassName}}Type = map[string]attr.Type{ - {{- range .Properties}} - {{- if eq .ValueType "bitmask"}} - "{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}": types.SetType(types.StringType), - {{- else}} - "{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}": types.StringType, - {{- end}} - {{- end}} -} - {{- end}} + {{- template "childStructsAndAttributeTypes" . }} {{- end}} {{if .IdentifiedBy}} @@ -361,8 +336,47 @@ func (r *{{.ResourceClassName}}Resource) UpgradeState(ctx context.Context) map[i {{- end}} {{- end}} {{- end}} + {{- range .Children}} + {{- if or (not .IdentifiedBy) .MaxOneClassAllowed}} + {{ .ResourceClassName }}: basetypes.ObjectNull(map[string]attr.Type{ + {{- range .Properties}} + {{- if eq .ValueType "bitmask"}} + "{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}": types.SetType{ElemType: types.StringType}, + {{- else}} + "{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}": types.StringType, + {{- end}} + {{- end}} + {{- range .Children}} + {{- if or (not .IdentifiedBy) .MaxOneClassAllowed}} + "{{overwriteProperty .PkgName .ResourceName $.Definitions}}": types.ObjectType{AttrTypes: {{.ResourceClassName}}{{.ParentHierarchy}}Type}, + {{- else}} + "{{overwriteProperty .PkgName .ResourceName $.Definitions}}": types.SetType{ElemType: {{.ResourceClassName}}{{.ParentHierarchy}}Type}, + {{- end}} + {{- end}} + }), + {{- else}} + {{ .ResourceClassName }}: basetypes.NewSetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + {{- range .Properties}} + {{- if eq .ValueType "bitmask"}} + "{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}": types.SetType{ElemType: types.StringType}, + {{- else}} + "{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}": types.StringType, + {{- end}} + {{- end}} + {{- range .Children}} + {{- if or (not .IdentifiedBy) .MaxOneClassAllowed}} + "{{overwriteProperty .PkgName .ResourceName $.Definitions}}": types.ObjectType{AttrTypes: {{.ResourceClassName}}{{.ParentHierarchy}}Type}, + {{- else}} + "{{overwriteProperty .PkgName .ResourceName $.Definitions}}": types.SetType{ElemType: {{.ResourceClassName}}{{.ParentHierarchy}}Type}, + {{- end}} + {{- end}} + }, + }), + {{- end}} + {{- end}} } - {{ .PkgName }}Object, _ := types.ObjectValueFrom(ctx, {{ .ResourceClassName }}{{$.ResourceClassName}}Type, {{.ResourceClassName}}Object) + {{ .PkgName }}Object, _ := types.ObjectValueFrom(ctx, {{ .ResourceClassName }}{{.ParentHierarchy}}Type, {{.ResourceClassName}}Object) upgradedStateData.{{ .ResourceClassName }} = {{ .PkgName }}Object {{- end }} {{- else}} @@ -382,17 +396,48 @@ func (r *{{.ResourceClassName}}Resource) UpgradeState(ctx context.Context) map[i {{- end}} {{- end}} {{- end}} + {{- range .Children}} + {{- if or (not .IdentifiedBy) .MaxOneClassAllowed}} + {{ .ResourceClassName }}: basetypes.ObjectNull(map[string]attr.Type{ + {{- range .Properties}} + {{- if eq .ValueType "bitmask"}} + "{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}": types.SetType{ElemType: types.StringType}, + {{- else}} + "{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}": types.StringType, + {{- end}} + {{- end}} + {{- range .Children}} + {{- if or (not .IdentifiedBy) .MaxOneClassAllowed}} + "{{overwriteProperty .PkgName .ResourceName $.Definitions}}": types.ObjectType{AttrTypes: {{.ResourceClassName}}{{.ParentHierarchy}}Type}, + {{- else}} + "{{overwriteProperty .PkgName .ResourceName $.Definitions}}": types.SetType{ElemType: {{.ResourceClassName}}{{.ParentHierarchy}}Type}, + {{- end}} + {{- end}} + }), + {{- else}} + {{ .ResourceClassName }}: basetypes.NewSetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + {{- range .Properties}} + {{- if eq .ValueType "bitmask"}} + "{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}": types.SetType{ElemType: types.StringType}, + {{- else}} + "{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}": types.StringType, + {{- end}} + {{- end}} + {{- range .Children}} + {{- if or (not .IdentifiedBy) .MaxOneClassAllowed}} + "{{overwriteProperty .PkgName .ResourceName $.Definitions}}": types.ObjectType{AttrTypes: {{.ResourceClassName}}{{.ParentHierarchy}}Type}, + {{- else}} + "{{overwriteProperty .PkgName .ResourceName $.Definitions}}": types.SetType{ElemType: {{.ResourceClassName}}{{.ParentHierarchy}}Type}, + {{- end}} + {{- end}} + }, + }), + {{- end}} + {{- end}} } {{.ResourceClassName}}List = append({{.ResourceClassName}}List, {{.ResourceClassName}}) - {{.ResourceClassName}}Type := types.ObjectType{ - AttrTypes: map[string]attr.Type{ - {{- range .Properties}} - {{- $Overwrite := overwriteProperty .PkgName .SnakeCaseName $.Definitions}} - "{{$Overwrite}}": basetypes.StringType{}, - {{- end}} - }, - } - {{.ResourceClassName}}Set, _ := types.SetValueFrom(ctx, {{.ResourceClassName}}Type, {{.ResourceClassName}}List) + {{.ResourceClassName}}Set, _ := types.SetValueFrom(ctx, {{.ResourceClassName}}{{.ParentHierarchy}}Type, {{.ResourceClassName}}List) upgradedStateData.{{.ResourceClassName}} = {{.ResourceClassName}}Set {{- else if eq $childClassType "block,set" }} var priorStateData{{.ResourceClassName}}List []{{ .ResourceClassName }}{{$.ResourceClassName}}ResourceModelV{{$.LegacySchemaVersion}} @@ -410,18 +455,49 @@ func (r *{{.ResourceClassName}}Resource) UpgradeState(ctx context.Context) map[i {{ .Name }}: priorStateData{{.ResourceClassName}}.{{ $AttributeName }}, {{- end}} {{- end}} + {{- range .Children}} + {{- if or (not .IdentifiedBy) .MaxOneClassAllowed}} + {{ .ResourceClassName }}: basetypes.ObjectNull(map[string]attr.Type{ + {{- range .Properties}} + {{- if eq .ValueType "bitmask"}} + "{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}": types.SetType{ElemType: types.StringType}, + {{- else}} + "{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}": types.StringType, + {{- end}} + {{- end}} + {{- range .Children}} + {{- if or (not .IdentifiedBy) .MaxOneClassAllowed}} + "{{overwriteProperty .PkgName .ResourceName $.Definitions}}": types.ObjectType{AttrTypes: {{.ResourceClassName}}{{.ParentHierarchy}}Type}, + {{- else}} + "{{overwriteProperty .PkgName .ResourceName $.Definitions}}": types.SetType{ElemType: {{.ResourceClassName}}{{.ParentHierarchy}}Type}, + {{- end}} + {{- end}} + }), + {{- else}} + {{ .ResourceClassName }}: basetypes.NewSetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + {{- range .Properties}} + {{- if eq .ValueType "bitmask"}} + "{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}": types.SetType{ElemType: types.StringType}, + {{- else}} + "{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}": types.StringType, + {{- end}} + {{- end}} + {{- range .Children}} + {{- if or (not .IdentifiedBy) .MaxOneClassAllowed}} + "{{overwriteProperty .PkgName .ResourceName $.Definitions}}": types.ObjectType{AttrTypes: {{.ResourceClassName}}{{.ParentHierarchy}}Type}, + {{- else}} + "{{overwriteProperty .PkgName .ResourceName $.Definitions}}": types.SetType{ElemType: {{.ResourceClassName}}{{.ParentHierarchy}}Type}, + {{- end}} + {{- end}} + }, + }), + {{- end}} + {{- end}} } {{.ResourceClassName}}List = append({{.ResourceClassName}}List, {{ .ResourceClassName }}) } - {{.ResourceClassName}}Type := types.ObjectType{ - AttrTypes: map[string]attr.Type{ - {{- range .Properties}} - {{- $Overwrite := overwriteProperty .PkgName .SnakeCaseName $.Definitions}} - "{{$Overwrite}}": basetypes.StringType{}, - {{- end}} - }, - } - {{.ResourceClassName}}Set, _ := types.SetValueFrom(ctx, {{.ResourceClassName}}Type, {{.ResourceClassName}}List) + {{.ResourceClassName}}Set, _ := types.SetValueFrom(ctx, {{.ResourceClassName}}{{.ParentHierarchy}}Type, {{.ResourceClassName}}List) upgradedStateData.{{.ResourceClassName}} = {{.ResourceClassName}}Set {{- else if eq $childClassType "set,string" }} var priorStateData{{.ResourceClassName}}List []string @@ -441,18 +517,49 @@ func (r *{{.ResourceClassName}}Resource) UpgradeState(ctx context.Context) map[i {{- end}} {{- end}} {{- end}} + {{- range .Children}} + {{- if or (not .IdentifiedBy) .MaxOneClassAllowed}} + {{ .ResourceClassName }}: basetypes.ObjectNull(map[string]attr.Type{ + {{- range .Properties}} + {{- if eq .ValueType "bitmask"}} + "{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}": types.SetType{ElemType: types.StringType}, + {{- else}} + "{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}": types.StringType, + {{- end}} + {{- end}} + {{- range .Children}} + {{- if or (not .IdentifiedBy) .MaxOneClassAllowed}} + "{{overwriteProperty .PkgName .ResourceName $.Definitions}}": types.ObjectType{AttrTypes: {{.ResourceClassName}}{{.ParentHierarchy}}Type}, + {{- else}} + "{{overwriteProperty .PkgName .ResourceName $.Definitions}}": types.SetType{ElemType: {{.ResourceClassName}}{{.ParentHierarchy}}Type}, + {{- end}} + {{- end}} + }), + {{- else}} + {{ .ResourceClassName }}: basetypes.NewSetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + {{- range .Properties}} + {{- if eq .ValueType "bitmask"}} + "{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}": types.SetType{ElemType: types.StringType}, + {{- else}} + "{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}": types.StringType, + {{- end}} + {{- end}} + {{- range .Children}} + {{- if or (not .IdentifiedBy) .MaxOneClassAllowed}} + "{{overwriteProperty .PkgName .ResourceName $.Definitions}}": types.ObjectType{AttrTypes: {{.ResourceClassName}}{{.ParentHierarchy}}Type}, + {{- else}} + "{{overwriteProperty .PkgName .ResourceName $.Definitions}}": types.SetType{ElemType: {{.ResourceClassName}}{{.ParentHierarchy}}Type}, + {{- end}} + {{- end}} + }, + }), + {{- end}} + {{- end}} } {{.ResourceClassName}}List = append({{.ResourceClassName}}List, {{ .ResourceClassName }}) } - {{.ResourceClassName}}Type := types.ObjectType{ - AttrTypes: map[string]attr.Type{ - {{- range .Properties}} - {{- $Overwrite := overwriteProperty .PkgName .SnakeCaseName $.Definitions}} - "{{$Overwrite}}": basetypes.StringType{}, - {{- end}} - }, - } - {{.ResourceClassName}}Set, _ := types.SetValueFrom(ctx, {{.ResourceClassName}}Type, {{.ResourceClassName}}List) + {{.ResourceClassName}}Set, _ := types.SetValueFrom(ctx, {{.ResourceClassName}}{{.ParentHierarchy}}Type, {{.ResourceClassName}}List) upgradedStateData.{{.ResourceClassName}} = {{.ResourceClassName}}Set {{- end}} {{- end}} @@ -468,6 +575,13 @@ func (r *{{.ResourceClassName}}Resource) UpgradeState(ctx context.Context) map[i "{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}": basetypes.StringType{}, {{- end}} {{- end}} + {{- range .Children}} + {{- if or (not .IdentifiedBy) .MaxOneClassAllowed}} + "{{overwriteProperty .PkgName .ResourceName $.Definitions}}": basetypes.ObjectType{AttrTypes: {{.ResourceClassName}}{{.ParentHierarchy}}Type}, + {{- else}} + "{{overwriteProperty .PkgName .ResourceName $.Definitions}}": basetypes.SetType{ElemType: {{.ResourceClassName}}{{.ParentHierarchy}}Type}, + {{- end}} + {{- end}} }, }, ) @@ -629,19 +743,44 @@ func (r *{{.ResourceClassName}}Resource) ModifyPlan(ctx context.Context, req res return } } - - {{- if containsSingleNestedChildren .Children}} - {{- range $.Children}} - {{- if or (not .IdentifiedBy) .MaxOneClassAllowed}} - if !configData.{{ .ResourceClassName }}.IsNull() && stateData != nil { - if IsEmptySingleNestedAttribute(configData.{{ .ResourceClassName }}.Attributes()) { - {{.ResourceClassName}}Object, _ := types.ObjectValueFrom(ctx, {{.ResourceClassName}}{{$.ResourceClassName}}Type, getEmpty{{.ResourceClassName}}{{$.ResourceClassName}}ResourceModel()) - planData.{{.ResourceClassName}} = {{.ResourceClassName}}Object + {{- range .Children}} + {{- if containsSingleNestedChildren .Children}} + {{- template "declareChildListsInGetandSetAttributesFunctionWithGetEmpty" . }} + {{- if or (not .IdentifiedBy) .MaxOneClassAllowed}} + var {{ .ResourceClassName }}ConfigData {{.ResourceClassName}}{{.ParentHierarchy}}ResourceModel + configData.{{ .ResourceClassName }}.As(ctx, &{{ .ResourceClassName }}ConfigData, basetypes.ObjectAsOptions{}) + {{- else}} + var {{ .ResourceClassName }}ConfigData []{{.ResourceClassName}}{{.ParentHierarchy}}ResourceModel + configData.{{ .ResourceClassName }}.ElementsAs(ctx, &{{ .ResourceClassName }}ConfigData, false) + {{- end}} + {{- $resource := . }} + {{- range .Children}} + {{- $newCtx := addToTemplateProperties . "configData" $resource -}} + {{- template "modifyPlanForSingleNestedChildren" $newCtx }} + {{- end}} + {{- end}} + {{- end}} + {{- range .Children}} + {{- if or (not .IdentifiedBy) .MaxOneClassAllowed}} + if !configData.{{ .ResourceClassName }}.IsNull() && stateData != nil { + if IsEmptySingleNestedAttribute(configData.{{ .ResourceClassName }}.Attributes()) { + {{.ResourceClassName}}Object, _ := types.ObjectValueFrom(ctx, {{.ResourceClassName}}{{$.ResourceClassName}}Type, getEmpty{{.ResourceClassName}}{{$.ResourceClassName}}ResourceModel()) + planData.{{.ResourceClassName}} = {{.ResourceClassName}}Object + } {{- if containsSingleNestedChildren .Children}} else { + {{- range .Properties}} + {{.ResourceClassName}}{{$.ResourceClassName}}.{{.Name}} = {{.ResourceClassName}}ConfigData.{{.Name}} + {{- end}} + {{.ResourceClassName}}{{.ParentHierarchy}}List = append({{.ResourceClassName}}{{.ParentHierarchy}}List, {{.ResourceClassName}}{{.ParentHierarchy}}) + {{.ResourceClassName}}Object, _ := types.ObjectValueFrom(ctx, {{.ResourceClassName}}{{$.ResourceClassName}}Type, {{ .ResourceClassName }}{{.ParentHierarchy}}List[0]) + planData.{{.ResourceClassName}} = {{.ResourceClassName}}Object + } {{- end}} } - } - - {{- end}} + {{- else}} + {{- if containsSingleNestedChildren .Children}} + {{.ResourceClassName}}Set, _ := types.SetValueFrom(ctx, {{ .ResourceClassName }}Type, {{ .ResourceClassName }}{{.ParentHierarchy}}List[0]) + planData.{{.ResourceClassName}} = {{.ResourceClassName}}Set {{- end}} + {{- end}} {{- end}} {{ if .LegacyAttributes}}{{ $ResourceClassName := .ResourceClassName}} {{ range .LegacyAttributes}}{{$SetName := .Name}} @@ -698,18 +837,54 @@ func (r *{{.ResourceClassName}}Resource) ModifyPlan(ctx context.Context, req res {{- end}} } } else if !configData.Deprecated{{ $SetName }}.IsNull() { + var newAttributeValues {{ $SetName }}{{.ParentHierarchy}}ResourceModel + {{- range .Children}} + {{- if or (not .IdentifiedBy) .MaxOneClassAllowed}} + {{ .ResourceClassName | decapitalize }}{{.ParentHierarchy}}Value, _ := types.ObjectValueFrom(ctx, {{ .ResourceClassName }}{{.ParentHierarchy}}Type, getEmpty{{ .ResourceClassName }}{{.ParentHierarchy}}ResourceModel()) + {{- else}} + {{ .ResourceClassName | decapitalize }}{{.ParentHierarchy}}Value, _ := types.SetValueFrom(ctx, {{ .ResourceClassName }}{{.ParentHierarchy}}Type, make([]{{ .ResourceClassName }}{{.ParentHierarchy}}ResourceModel, 0)) + {{- end}} + {{- end}} + {{- range .Properties}} + {{- if eq .Name "Annotation"}} + {{ .Name | decapitalize }}Value := planData.Annotation + {{- end}} + {{- end}} + if stateData != nil { + stateData.{{ $SetName }}.As(ctx, &newAttributeValues, basetypes.ObjectAsOptions{}) + {{- range .Properties}} + {{- if eq .Name "Annotation"}} + {{ .Name | decapitalize }}Value = newAttributeValues.Annotation + {{- end}} + {{- end}} + {{- range .Children}} + {{ .ResourceClassName | decapitalize }}{{.ParentHierarchy}}Value = newAttributeValues.{{.ResourceClassName}} + {{- end}} + } + {{- range .Properties}} + {{- $Overwrite := overwriteProperty .PkgName .SnakeCaseName $.Definitions}} + {{- $AttributeName := getLegacyChildAttribute .PkgName $Overwrite . $.LegacyAttributes $.LegacyBlocks}} + {{- if isNewNamedClassAttribute $Overwrite }} + {{- if isNewNamedClassAttributeMatch $Overwrite $ResourceName}} + {{ .Name | decapitalize }}Value := basetypes.NewStringUnknown() + if !configData.Deprecated{{ $SetName }}.IsUnknown() { + {{ .Name | decapitalize }}Value = basetypes.NewStringValue(GetMOName(configData.Deprecated{{ $AttributeName }}.ValueString())) + } + {{- end}} + {{- end}} + {{- end}} {{$SetName}} := {{$SetName}}{{$.ResourceClassName}}ResourceModel{ {{- range .Properties}} {{- $Overwrite := overwriteProperty .PkgName .SnakeCaseName $.Definitions}} {{- $AttributeName := getLegacyChildAttribute .PkgName $Overwrite . $.LegacyAttributes $.LegacyBlocks}} {{- if eq .Name "Annotation"}} - {{ .Name }}: planData.Annotation, + {{ .Name }}: {{ .Name | decapitalize }}Value, {{- else if eq $AttributeName ""}} {{ .Name }}: basetypes.NewStringNull(), {{- else}} {{- if isNewNamedClassAttribute $Overwrite }} {{- if isNewNamedClassAttributeMatch $Overwrite $ResourceName}} - {{ .Name }}: basetypes.NewStringValue(GetMOName(configData.Deprecated{{ $AttributeName }}.ValueString())), + {{ .Name }}: {{ .Name | decapitalize }}Value, {{- else}} {{ .Name }}: basetypes.NewStringValue(""), {{- end }} @@ -718,6 +893,9 @@ func (r *{{.ResourceClassName}}Resource) ModifyPlan(ctx context.Context, req res {{- end}} {{- end}} {{- end}} + {{- range .Children}} + {{ .ResourceClassName }}: {{ .ResourceClassName | decapitalize }}{{.ParentHierarchy}}Value, + {{- end}} } {{$SetName}}Object, _ := types.ObjectValueFrom(ctx, {{$SetName}}{{$.ResourceClassName}}Type, {{$SetName}}) planData.{{$SetName}} = {{$SetName}}Object @@ -757,15 +935,7 @@ func (r *{{.ResourceClassName}}Resource) ModifyPlan(ctx context.Context, req res {{- end}} } {{.ResourceClassName}}List = append({{.ResourceClassName}}List, {{.ResourceClassName}}) - {{.ResourceClassName}}Type := types.ObjectType{ - AttrTypes: map[string]attr.Type{ - {{- range .Properties}} - {{- $Overwrite := overwriteProperty .PkgName .SnakeCaseName $.Definitions}} - "{{$Overwrite}}": basetypes.StringType{}, - {{- end}} - }, - } - {{.ResourceClassName}}Set, _ := types.SetValueFrom(ctx, {{.ResourceClassName}}Type, {{.ResourceClassName}}List) + {{.ResourceClassName}}Set, _ := types.SetValueFrom(ctx, {{.ResourceClassName}}{{.ParentHierarchy}}Type, {{.ResourceClassName}}List) planData.{{.ResourceClassName}} = {{.ResourceClassName}}Set } else if stateData != nil { // used to replace use state for unknown planData.Deprecated{{.ResourceClassName}} = stateData.Deprecated{{.ResourceClassName}} @@ -808,7 +978,7 @@ func (r *{{.ResourceClassName}}Resource) ModifyPlan(ctx context.Context, req res } } else if !configData.Deprecated{{ $SetName }}.IsNull() { {{.ResourceClassName}}List := make([]{{.ResourceClassName}}{{$.ResourceClassName}}ResourceModel, 0) - var attributeValues []string + var attributeValues []basetypes.StringValue var newAttributeValues []{{.ResourceClassName}}{{$.ResourceClassName}}ResourceModel configData.Deprecated{{.ResourceClassName}}.ElementsAs(ctx, &attributeValues, false) if stateData != nil { @@ -822,7 +992,7 @@ func (r *{{.ResourceClassName}}Resource) ModifyPlan(ctx context.Context, req res {{- $Overwrite := overwriteProperty .PkgName .SnakeCaseName $.Definitions}} {{- $AttributeName := getLegacyChildAttribute .PkgName $Overwrite . $.LegacyAttributes $.LegacyBlocks}} {{- if or (eq .Name "TDn") (isNewNamedClassAttribute $Overwrite)}} - if newAttributeValue.{{ .Name }}.ValueString() == {{- if isNewNamedClassAttribute $Overwrite }}GetMOName(attributeValue){{- else}}attributeValue{{- end}} { + if newAttributeValue.{{ .Name }}.ValueString() == {{- if isNewNamedClassAttribute $Overwrite }}GetMOName(attributeValue.ValueString()){{- else}}attributeValue.ValueString(){{- end}} { {{.ResourceClassName}}Value = newAttributeValue foundAttributeValue = true break @@ -830,12 +1000,22 @@ func (r *{{.ResourceClassName}}Resource) ModifyPlan(ctx context.Context, req res {{- end}} {{- end}} } + {{- range .Properties}} + {{- $Overwrite := overwriteProperty .PkgName .SnakeCaseName $.Definitions}} + {{- $AttributeName := getLegacyChildAttribute .PkgName $Overwrite . $.LegacyAttributes $.LegacyBlocks}} + {{- if or (eq .Name "TDn") (isNewNamedClassAttribute $Overwrite)}} + {{ .Name | decapitalize}}Value := basetypes.NewStringUnknown() + if !attributeValue.IsUnknown(){ + {{ .Name | decapitalize }}Value = {{- if isNewNamedClassAttribute $Overwrite }}basetypes.NewStringValue(GetMOName(attributeValue.ValueString())){{- else}}basetypes.NewStringValue(attributeValue.ValueString()){{- end}} + } + {{- end}} + {{- end}} {{ .ResourceClassName }} := {{ .ResourceClassName }}{{$.ResourceClassName}}ResourceModel { {{- range .Properties}} {{- $Overwrite := overwriteProperty .PkgName .SnakeCaseName $.Definitions}} {{- $AttributeName := getLegacyChildAttribute .PkgName $Overwrite . $.LegacyAttributes $.LegacyBlocks}} {{- if or (eq .Name "TDn") (isNewNamedClassAttribute $Overwrite)}} - {{ .Name }}: {{- if isNewNamedClassAttribute $Overwrite }}basetypes.NewStringValue(GetMOName(attributeValue)){{- else}}basetypes.NewStringValue(attributeValue){{- end}}, + {{ .Name }}: {{ .Name | decapitalize }}Value, {{- end}} {{- end}} } @@ -863,17 +1043,18 @@ func (r *{{.ResourceClassName}}Resource) ModifyPlan(ctx context.Context, req res {{- end}} {{- end}} } + {{- $resourceClassName:= .ResourceClassName}} + {{- range .Children}} + {{- if or (not .IdentifiedBy) .MaxOneClassAllowed}} + {{ .ResourceClassName | decapitalize }}{{.ParentHierarchy}}Value, _ := types.ObjectValueFrom(ctx, {{ .ResourceClassName }}{{.ParentHierarchy}}Type, getEmpty{{ .ResourceClassName }}{{.ParentHierarchy}}ResourceModel()) + {{- else}} + {{ .ResourceClassName | decapitalize }}{{.ParentHierarchy}}Value, _ := types.SetValueFrom(ctx, {{ .ResourceClassName }}{{.ParentHierarchy}}Type, make([]{{ .ResourceClassName }}{{.ParentHierarchy}}ResourceModel, 0)) + {{- end}} + {{ $resourceClassName }}.{{.ResourceClassName}} = {{ .ResourceClassName | decapitalize }}{{.ParentHierarchy}}Value + {{- end}} {{.ResourceClassName}}List = append({{.ResourceClassName}}List, {{ .ResourceClassName }}) } - {{.ResourceClassName}}Type := types.ObjectType{ - AttrTypes: map[string]attr.Type{ - {{- range .Properties}} - {{- $Overwrite := overwriteProperty .PkgName .SnakeCaseName $.Definitions}} - "{{$Overwrite}}": basetypes.StringType{}, - {{- end}} - }, - } - {{.ResourceClassName}}Set, _ := types.SetValueFrom(ctx, {{.ResourceClassName}}Type, {{.ResourceClassName}}List) + {{.ResourceClassName}}Set, _ := types.SetValueFrom(ctx, {{.ResourceClassName}}{{.ParentHierarchy}}Type, {{.ResourceClassName}}List) planData.{{.ResourceClassName}} = {{.ResourceClassName}}Set } else if stateData != nil { // used to replace use state for unknown planData.Deprecated{{.ResourceClassName}} = stateData.Deprecated{{.ResourceClassName}} @@ -886,7 +1067,7 @@ func (r *{{.ResourceClassName}}Resource) ModifyPlan(ctx context.Context, req res {{ range .LegacyBlocks}}{{$ClassName := .ClassName}}{{$Attributes := .Attributes}} planData.Deprecated{{ capitalize .ClassName }} = types.SetNull(deprecated{{ capitalize .ClassName }}Type) - if !configData.Deprecated{{ capitalize .ClassName }}.IsNull() && stateData != nil { + if !configData.Deprecated{{ capitalize .ClassName }}.IsNull() { {{- range $.Children}} {{- if isLegacyChild .PkgName $.LegacyChildren}} {{- if eq $ClassName .PkgName}} @@ -894,26 +1075,41 @@ func (r *{{.ResourceClassName}}Resource) ModifyPlan(ctx context.Context, req res var attributeValues []{{ .ResourceClassName }}{{$.ResourceClassName}}ResourceModelV1 var newAttributeValues []{{ .ResourceClassName }}{{$.ResourceClassName}}ResourceModel configData.Deprecated{{.ResourceClassName}}.ElementsAs(ctx, &attributeValues, false) - stateData.{{.ResourceClassName}}.ElementsAs(ctx, &newAttributeValues, false) + if stateData != nil { + stateData.{{.ResourceClassName}}.ElementsAs(ctx, &newAttributeValues, false) + } for _, attributeValue := range attributeValues { {{- $NewProperties := getNewChildAttributes (getChildAttributesFromBlocks $ClassName $.LegacyBlocks) .Properties}} - {{- if ne (len $NewProperties) 0}} - {{- range .Properties}} - {{- $Overwrite := overwriteProperty .PkgName .SnakeCaseName $.Definitions}} - {{- $AttributeName := getLegacyChildAttribute .PkgName $Overwrite . $.LegacyAttributes $.LegacyBlocks}} - {{- if and (ne $AttributeName "") .IsRequired }} + {{- if ne (len $NewProperties) 0 }} planned{{ .ResourceClassName }} := {{ .ResourceClassName }}{{$.ResourceClassName}}ResourceModel{} - foundAttributeValue := false + foundAttributeValue := false for _, newAttributeValue := range newAttributeValues { + {{- range .Properties}} + {{- $Overwrite := overwriteProperty .PkgName .SnakeCaseName $.Definitions}} + {{- $AttributeName := getLegacyChildAttribute .PkgName $Overwrite . $.LegacyAttributes $.LegacyBlocks}} + {{- if and (ne $AttributeName "") (.IsRequired) (or (eq .Name "TDn") (isNewNamedClassAttribute $Overwrite)) }} if newAttributeValue.{{ .Name }}.ValueString() == {{- if isNewNamedClassAttribute $Overwrite }}GetMOName(attributeValue.{{ $AttributeName }}.ValueString()){{- else}}attributeValue.TDn.ValueString(){{- end}} { planned{{ .ResourceClassName }} = newAttributeValue + {{- if ne (len $NewProperties) 0 }} foundAttributeValue = true + {{- end}} break } } {{- end}} {{- end}} {{- end}} + + {{- range .Properties}} + {{- $Overwrite := overwriteProperty .PkgName .SnakeCaseName $.Definitions}} + {{- $AttributeName := getLegacyChildAttribute .PkgName $Overwrite . $.LegacyAttributes $.LegacyBlocks}} + {{- if or (eq .Name "TDn") (isNewNamedClassAttribute $Overwrite)}} + {{ .Name | decapitalize }}Value := basetypes.NewStringUnknown() + if !attributeValue.{{ $AttributeName }}.IsUnknown() { + {{ .Name | decapitalize }}Value = {{- if isNewNamedClassAttribute $Overwrite }}basetypes.NewStringValue(GetMOName(attributeValue.{{ $AttributeName }}.ValueString())){{- else}}basetypes.NewStringValue(attributeValue.TDn.ValueString()){{- end}} + } + {{- end}} + {{- end}} {{ .ResourceClassName }} := {{ .ResourceClassName }}{{$.ResourceClassName}}ResourceModel { {{- range .Properties}} @@ -921,6 +1117,8 @@ func (r *{{.ResourceClassName}}Resource) ModifyPlan(ctx context.Context, req res {{- $AttributeName := getLegacyChildAttribute .PkgName $Overwrite . $.LegacyAttributes $.LegacyBlocks}} {{- if eq .Name "Annotation"}} {{ .Name }}: planData.Annotation, + {{- else if or (eq .Name "TDn") (isNewNamedClassAttribute $Overwrite)}} + {{ .Name }}: {{ .Name | decapitalize }}Value, {{- else if and (ne $AttributeName "") (not (isNewNamedClassAttribute $Overwrite)) }} {{- if .HasCustomType}} {{ .Name }}: customTypes.{{.ResourceClassName}}{{.Name}}StringValue{StringValue: attributeValue.{{ .Name }}}, @@ -944,7 +1142,7 @@ func (r *{{.ResourceClassName}}Resource) ModifyPlan(ctx context.Context, req res {{- $Overwrite := overwriteProperty .PkgName .SnakeCaseName $.Definitions}} {{- $AttributeName := getLegacyChildAttribute .PkgName $Overwrite . $.LegacyAttributes $.LegacyBlocks}} {{- if isNewNamedClassAttribute $Overwrite }} - {{ .ResourceClassName }}.{{ .Name }} = basetypes.NewStringValue(GetMOName(attributeValue.{{ $AttributeName }}.ValueString())) + {{ .ResourceClassName }}.{{ .Name }} = {{ .Name | decapitalize }}Value {{- else if ne .DefaultValue ""}} {{ .ResourceClassName }}.{{ .Name }} = basetypes.NewStringValue("{{.DefaultValue}}") // Default to default value from meta when not found {{- else}} @@ -954,18 +1152,19 @@ func (r *{{.ResourceClassName}}Resource) ModifyPlan(ctx context.Context, req res } {{- end}} + {{- $resourceClassName:= .ResourceClassName}} + {{- range .Children}} + {{- if or (not .IdentifiedBy) .MaxOneClassAllowed}} + {{ .ResourceClassName | decapitalize }}{{.ParentHierarchy}}Value, _ := types.ObjectValueFrom(ctx, {{ .ResourceClassName }}{{.ParentHierarchy}}Type, getEmpty{{ .ResourceClassName }}{{.ParentHierarchy}}ResourceModel()) + {{- else}} + {{ .ResourceClassName | decapitalize }}{{.ParentHierarchy}}Value, _ := types.SetValueFrom(ctx, {{ .ResourceClassName }}{{.ParentHierarchy}}Type, make([]{{ .ResourceClassName }}{{.ParentHierarchy}}ResourceModel, 0)) + {{- end}} + {{ $resourceClassName }}.{{.ResourceClassName}} = {{ .ResourceClassName | decapitalize }}{{.ParentHierarchy}}Value + {{- end}} {{.ResourceClassName}}List = append({{.ResourceClassName}}List, {{ .ResourceClassName }}) } - {{.ResourceClassName}}Type := types.ObjectType{ - AttrTypes: map[string]attr.Type{ - {{- range .Properties}} - {{- $Overwrite := overwriteProperty .PkgName .SnakeCaseName $.Definitions}} - "{{$Overwrite}}": basetypes.StringType{}, - {{- end}} - }, - } - {{.ResourceClassName}}Set, _ := types.SetValueFrom(ctx, {{.ResourceClassName}}Type, {{.ResourceClassName}}List) + {{.ResourceClassName}}Set, _ := types.SetValueFrom(ctx, {{.ResourceClassName}}{{.ParentHierarchy}}Type, {{.ResourceClassName}}List) planData.{{.ResourceClassName}} = {{.ResourceClassName}}Set {{- end }} @@ -1289,13 +1488,11 @@ func (r *{{.ResourceClassName}}Resource) Schema(ctx context.Context, req resourc {{- else}} Sensitive: true, {{- end}} - {{- if not .ReadOnly }} PlanModifiers: []planmodifier.Set{ setplanmodifier.UseStateForUnknown(), SetToSetNullWhenStateIsNullPlanIsUnknownDuringUpdate(), }, - {{- end}} {{- if .ValidValues}} Validators: []validator.Set{ setvalidator.SizeAtMost({{ len .ValidValues }}), @@ -1330,7 +1527,6 @@ func (r *{{.ResourceClassName}}Resource) Schema(ctx context.Context, req resourc Sensitive: true, {{- end}} {{- end}} - {{- if not .ReadOnly }} PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), SetToStringNullWhenStateIsNullPlanIsUnknownDuringUpdate(), @@ -1338,7 +1534,6 @@ func (r *{{.ResourceClassName}}Resource) Schema(ctx context.Context, req resourc stringplanmodifier.RequiresReplace(), {{- end}} }, - {{- end}} {{- if eq .Name "Annotation"}} Default: stringdefault.StaticString(globalAnnotation), {{- end}} @@ -1366,169 +1561,27 @@ func (r *{{.ResourceClassName}}Resource) Schema(ctx context.Context, req resourc {{- end}} {{- end}} {{- range .Children}} - {{- if or (not .IdentifiedBy) .MaxOneClassAllowed}} - "{{overwriteProperty .PkgName .ResourceName $.Definitions}}": schema.SingleNestedAttribute{ - MarkdownDescription: `{{.Comment}}`, - Optional: true, - Computed: true, - PlanModifiers: []planmodifier.Object{ - objectplanmodifier.UseStateForUnknown(), - }, - {{- if .RequiredPropertiesNames }} - Validators: []validator.Object{ - MakeSingleNestedAttributeRequiredAttributesNotProvidedValidator("{{.ResourceName}}", []string{"{{listToString .RequiredPropertiesNames}}"}), - }, - {{- end }} - Attributes: map[string]schema.Attribute{ - {{- range .Properties}} - {{- if eq .ValueType "bitmask"}} - "{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}": schema.SetAttribute{ - MarkdownDescription: `{{.Comment}}`, - {{- if not .ReadOnly }} - Optional: true, - {{- end }} - Computed: true, - {{- if not .ReadOnly }} - PlanModifiers: []planmodifier.Set{ - setplanmodifier.UseStateForUnknown(), - }, - {{- end }} - {{- if .ValidValues}} - Validators: []validator.Set{ - setvalidator.SizeAtMost({{ len .ValidValues }}), - setvalidator.ValueStringsAre( - stringvalidator.OneOf({{- validatorString .ValidValues}}), - ), - }, - {{- end}} - ElementType: types.StringType, - }, - {{- else}} - "{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}": schema.StringAttribute{ - Optional: true, - Computed: true, - {{- if not .ReadOnly }} - PlanModifiers: []planmodifier.String{ - stringplanmodifier.UseStateForUnknown(), - }, - {{- end}} - {{- if or .ValidValues $.HasReadOnlyProperties}} - Validators: []validator.String{ - {{- if .ValidValues}} - stringvalidator.OneOf({{- validatorString .ValidValues}}), - {{- end}} - {{- if or .IsNaming .IsRequired}} - MakeStringRequired(), - {{- end}} - }, - {{- end}} - MarkdownDescription: `{{.Comment}}`, - }, - {{- end}} - {{- end}} - }, - }, - {{- else }} - "{{overwriteProperty .PkgName .ResourceName $.Definitions}}": schema.SetNestedAttribute{ - MarkdownDescription: `{{.Comment}}`, - Optional: true, - Computed: true, - PlanModifiers: []planmodifier.Set{ - setplanmodifier.UseStateForUnknown(), - }, - NestedObject: schema.NestedAttributeObject{ - Attributes: map[string]schema.Attribute{ - {{- range .Properties}} - {{- if eq .ValueType "bitmask"}} - "{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}": schema.SetAttribute{ - MarkdownDescription: `{{.Comment}}`, - {{- if not .ReadOnly }} - Optional: true, - {{- end }} - {{- if ne .ValueType "password"}} - Computed: true, - {{- else}} - Sensitive: true, - {{- end}} - {{- if not .ReadOnly }} - PlanModifiers: []planmodifier.Set{ - setplanmodifier.UseStateForUnknown(), - }, - {{- end }} - {{- if .ValidValues}} - Validators: []validator.Set{ - setvalidator.SizeAtMost({{ len .ValidValues }}), - setvalidator.ValueStringsAre( - stringvalidator.OneOf({{- validatorString .ValidValues}}), - ), - }, - {{- end}} - ElementType: types.StringType, - }, - {{- else}} - "{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}": schema.StringAttribute{ - {{- if .HasCustomType}} - CustomType: customTypes.{{.ResourceClassName}}{{.Name}}StringType{}, - {{- end}} - {{- if and (or .IsNaming .IsRequired) (not $.HasReadOnlyProperties)}} - Required: true, - {{- else }} - Optional: true, - {{- if ne .ValueType "password"}} - Computed: true, - {{- else}} - Sensitive: true, - {{- end}} - {{- end}} - {{- if not .ReadOnly }} - PlanModifiers: []planmodifier.String{ - stringplanmodifier.UseStateForUnknown(), - }, - {{- end}} - {{- if .HasCustomType}} - Validators: []validator.String{ - stringvalidator.Any( - stringvalidator.OneOf({{- validatorStringCustomType .ValidValues .ValidValuesMap}}), - validators.InBetweenFromString({{- index .Validators 0 "min"}}, {{- index .Validators 0 "max"}}), - ), - }, - {{- else if or .ValidValues $.HasReadOnlyProperties}} - Validators: []validator.String{ - {{- if .ValidValues}} - stringvalidator.OneOf({{- validatorString .ValidValues}}), - {{- end}} - {{- if or .IsNaming .IsRequired}} - MakeStringRequired(), - {{- end}} - }, - {{- end}} - MarkdownDescription: `{{.Comment}}`, - }, - {{- end}} - {{- end}} - }, - }, - }, - {{- end}} - {{- end}} - }, - {{- if .LegacyAttributes}} - Blocks: map[string]schema.Block{ - {{- range .LegacyBlocks}} - "{{ .Name }}": schema.SetNestedBlock{ - NestedObject: schema.NestedBlockObject{ - Attributes: map[string]schema.Attribute{ - {{- range .Attributes}} - {{- if eq (getMigrationType .ValueType) "String"}} - "{{.AttributeName}}": schema.StringAttribute{ - Optional: true, - Computed: true, - DeprecationMessage: "Attribute '{{.AttributeName}}' will be deprecated soon, please use '{{.ReplacedBy.AttributeName}}' instead", - Validators: []validator.String{ - stringvalidator.ConflictsWith(path.Expressions{ - path.MatchRoot("{{getConflictingAttributeName .ReplacedBy.AttributeName}}"), - }...), - }, + {{- $newCtx := addToTemplateProperties . "HasReadOnlyProperties" $.HasReadOnlyProperties -}} + {{- template "childAttributes" $newCtx }} + {{- end}} + }, + {{- if .LegacyAttributes}} + Blocks: map[string]schema.Block{ + {{- range .LegacyBlocks}} + "{{ .Name }}": schema.SetNestedBlock{ + NestedObject: schema.NestedBlockObject{ + Attributes: map[string]schema.Attribute{ + {{- range .Attributes}} + {{- if eq (getMigrationType .ValueType) "String"}} + "{{.AttributeName}}": schema.StringAttribute{ + Optional: true, + Computed: true, + DeprecationMessage: "Attribute '{{.AttributeName}}' will be deprecated soon, please use '{{.ReplacedBy.AttributeName}}' instead", + Validators: []validator.String{ + stringvalidator.ConflictsWith(path.Expressions{ + path.MatchRoot("{{getConflictingAttributeName .ReplacedBy.AttributeName}}"), + }...), + }, }, {{- end}} {{- if eq (getMigrationType .ValueType) "Set"}} @@ -1627,11 +1680,11 @@ func (r *{{.ResourceClassName}}Resource) Create(ctx context.Context, req resourc {{ if .HasChild}} {{- range .Children}} {{- if or (not .IdentifiedBy) .MaxOneClassAllowed}} - var {{.PkgName}}Plan, {{.PkgName}}State {{.ResourceClassName}}{{$.ResourceClassName}}ResourceModel + var {{.PkgName}}Plan, {{.PkgName}}State {{.ResourceClassName}}{{.ParentHierarchy}}ResourceModel data.{{ .ResourceClassName }}.As(ctx, &{{.PkgName}}Plan, basetypes.ObjectAsOptions{}) stateData.{{ .ResourceClassName }}.As(ctx, &{{.PkgName}}State, basetypes.ObjectAsOptions{}) {{- else}} - var {{.PkgName}}Plan, {{.PkgName}}State []{{.ResourceClassName}}{{$.ResourceClassName}}ResourceModel + var {{.PkgName}}Plan, {{.PkgName}}State []{{.ResourceClassName}}{{.ParentHierarchy}}ResourceModel data.{{ .ResourceClassName }}.ElementsAs(ctx, &{{.PkgName}}Plan, false) stateData.{{ .ResourceClassName }}.ElementsAs(ctx, &{{.PkgName}}State, false) {{- end}} @@ -1732,6 +1785,24 @@ func (r *{{.ResourceClassName}}Resource) Update(ctx context.Context, req resourc ) } {{- end}} + {{- if containsDeletableSingleNestedChildren .Children}} + {{- if or (not .IdentifiedBy) .MaxOneClassAllowed}} + var {{ .ResourceClassName }}Data {{.ResourceClassName}}{{.ParentHierarchy}}ResourceModel + var {{ .ResourceClassName }}StateData {{.ResourceClassName}}{{.ParentHierarchy}}ResourceModel + data.{{ .ResourceClassName }}.As(ctx, &{{ .ResourceClassName }}Data, basetypes.ObjectAsOptions{}) + stateData.{{ .ResourceClassName }}.As(ctx, &{{ .ResourceClassName }}StateData, basetypes.ObjectAsOptions{}) + {{- else}} + var {{ .ResourceClassName }}Data []{{.ResourceClassName}}{{.ParentHierarchy}}ResourceModel + var {{ .ResourceClassName }}StateData []{{.ResourceClassName}}{{.ParentHierarchy}}ResourceModel + data.{{ .ResourceClassName }}.ElementsAs(ctx, &{{ .ResourceClassName }}Data, false) + stateData.{{ .ResourceClassName }}.ElementsAs(ctx, &{{ .ResourceClassName }}StateData, false) + {{- end}} + {{- $resource := . }} + {{- range .Children}} + {{- $newCtx := addToTemplateProperties . "data" $resource -}} + {{- template "isDeleteAllowedForSingleNestedChildren" $newCtx }} + {{- end}} + {{- end}} {{- end}} {{- end}} @@ -1857,7 +1928,7 @@ func (r *{{.ResourceClassName}}Resource) ImportState(ctx context.Context, req re func getAndSet{{.ResourceClassName}}Attributes(ctx context.Context, diags *diag.Diagnostics, client *client.Client, data *{{.ResourceClassName}}ResourceModel) { {{- if .HasChild}} - requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=children&rsp-subtree-class=%s", data.Id.ValueString(), "{{- .PkgName}},{{- listToString .ChildClasses}}"), "GET", nil) + requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=full&rsp-subtree-class=%s", data.Id.ValueString(), "{{- .PkgName}},{{ template "rspSubtreeClassFilter" . }}"), "GET", nil) {{- else}} requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json", data.Id.ValueString()), "GET", nil) {{- end}} @@ -1913,7 +1984,7 @@ func getAndSet{{.ResourceClassName}}Attributes(ctx context.Context, diags *diag. {{- if .HasChild}} {{- range .Children}} - {{ .ResourceClassName }}{{$.ResourceClassName}}List := make([]{{.ResourceClassName}}{{$.ResourceClassName}}ResourceModel, 0) + {{- template "declareChildListsInGetandSetAttributesFunction" . }} {{- end}} _, ok := classReadInfo[0].(map[string]interface{})["children"] if ok { @@ -1923,7 +1994,7 @@ func getAndSet{{.ResourceClassName}}Attributes(ctx context.Context, diags *diag. childAttributes := childClassDetails.(map[string]interface{})["attributes"].(map[string]interface{}) {{- range .Children}} if childClassName == "{{ .PkgName }}" { - {{.ResourceClassName}}{{$.ResourceClassName}} := getEmpty{{.ResourceClassName}}{{$.ResourceClassName}}ResourceModel() + {{.ResourceClassName}}{{.ParentHierarchy}} := getEmpty{{.ResourceClassName}}{{.ParentHierarchy}}ResourceModel() for childAttributeName, childAttributeValue := range childAttributes { {{- range .Properties}} {{- if eq .ValueType "bitmask"}} @@ -1933,14 +2004,19 @@ func getAndSet{{.ResourceClassName}}Attributes(ctx context.Context, diags *diag. {{.ResourceClassName}}{{$.ResourceClassName}}.{{.Name}} = {{.PropertyName}}Set } else if childAttributeName == "{{.PropertyName}}" { {{.PropertyName}}List := strings.Split(childAttributeValue.(string), ",") - {{.PropertyName}}Set, _ := types.SetValueFrom(ctx, {{.ResourceClassName}}{{$.ResourceClassName}}.{{.Name}}.ElementType(ctx), {{.PropertyName}}List) + var data{{.ResourceClassName}}{{$.ResourceClassName}} []{{.ResourceClassName}}{{$.ResourceClassName}}ResourceModel + data.{{.ResourceClassName}}.ElementsAs(ctx,&data{{.ResourceClassName}}{{$.ResourceClassName}},false) + for _, {{.ResourceClassName | decapitalize}} := range data{{.ResourceClassName}}{{$.ResourceClassName}} { + {{.PropertyName}}Set, _ := types.SetValueFrom(ctx, {{.ResourceClassName | decapitalize}}.{{.Name}}.ElementType(ctx),{{.PropertyName}}List) {{.ResourceClassName}}{{$.ResourceClassName}}.{{.Name}} = {{.PropertyName}}Set + } } {{- else}} if childAttributeName == "{{.PropertyName}}" { {{.PropertyName}}List := strings.Split(childAttributeValue.(string), ",") - {{.PropertyName}}Set, _ := types.SetValueFrom(ctx, {{.ResourceClassName}}{{$.ResourceClassName}}.{{.Name}}.ElementType(ctx), {{.PropertyName}}List) + {{.PropertyName}}Set, _ := types.SetValueFrom(ctx, basetypes.StringType{},{{.PropertyName}}List) {{.ResourceClassName}}{{$.ResourceClassName}}.{{.Name}} = {{.PropertyName}}Set + } {{- end}} {{- else}} @@ -1961,11 +2037,48 @@ func getAndSet{{.ResourceClassName}}Attributes(ctx context.Context, diags *diag. {{- end}} {{- end}} {{- end}} - } + {{/* $enteredGrandChildGetAndSetAttributesZone is used here because the presence of grand children is unknown while rendering the template unlike .HasChild used for the immediate children. It is also used because there can be more than one grandchild in the same level. */}} + {{- $enteredGrandChildGetAndSetAttributesZone := false }} + {{- $children := .Children }} + {{- range .Children}} + {{- if not $enteredGrandChildGetAndSetAttributesZone }} + {{- $enteredGrandChildGetAndSetAttributesZone = true }} + } + {{- range $children}} + {{ .ResourceClassName }}{{.ParentHierarchy}}List := make([]{{.ResourceClassName}}{{.ParentHierarchy}}ResourceModel, 0) + {{- end}} + childrenOf{{.ParentHierarchy}}, childrenOf{{.ParentHierarchy}}Exist:= childClassDetails.(map[string]interface{})["children"] + if childrenOf{{.ParentHierarchy}}Exist { + for _, child{{.ParentHierarchy}} := range childrenOf{{.ParentHierarchy}}.([]interface{}) { + for childClassName{{.ParentHierarchy}}, childClassDetails{{.ParentHierarchy}} := range child{{.ParentHierarchy}}.(map[string]interface{}) { + {{- end}} + {{- template "getAndSetGrandChildren" . }} + {{- end }} + {{- if $enteredGrandChildGetAndSetAttributesZone }} + } + } + } + {{- range .Children}} + {{- if or (not .IdentifiedBy) .MaxOneClassAllowed}} + if len({{.ResourceClassName}}{{.ParentHierarchy}}List) == 1 { + {{.ResourceClassName}}{{.ParentHierarchy}}Object, _ := types.ObjectValueFrom(ctx, {{ .ResourceClassName }}{{.ParentHierarchy}}Type, {{ .ResourceClassName }}{{.ParentHierarchy}}List[0]) + {{.ParentHierarchy}}.{{ .ResourceClassName }} = {{.ResourceClassName}}{{.ParentHierarchy}}Object + } else { + {{.ResourceClassName}}{{.ParentHierarchy}}Object, _ := types.ObjectValueFrom(ctx, {{ .ResourceClassName }}{{.ParentHierarchy}}Type, getEmpty{{ .ResourceClassName }}{{.ParentHierarchy}}ResourceModel()) + {{.ParentHierarchy}}.{{ .ResourceClassName }} = {{.ResourceClassName}}{{.ParentHierarchy}}Object + } + {{- else}} + {{.ResourceClassName}}{{.ParentHierarchy}}Set,_ := types.SetValueFrom(ctx,{{.ResourceClassName}}{{.ParentHierarchy}}Type,{{.ResourceClassName}}{{.ParentHierarchy}}List) + {{.ParentHierarchy}}.{{.ResourceClassName}} = {{.ResourceClassName}}{{.ParentHierarchy}}Set + {{- end}} + {{- end}} + {{- else}} + } + {{- end}} {{.ResourceClassName}}{{$.ResourceClassName}}List = append({{.ResourceClassName}}{{$.ResourceClassName}}List, {{.ResourceClassName}}{{$.ResourceClassName}}) - } + } {{- end}} - } + } } } {{- range .Children}} @@ -2070,68 +2183,102 @@ func set{{.ResourceClassName}}Id(ctx context.Context, data *{{.ResourceClassName {{- end}} } + {{ range .Children}} -func get{{$.ResourceClassName}}{{ .ResourceClassName }}ChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *{{$.ResourceClassName}}ResourceModel, {{.PkgName}}Plan, {{.PkgName}}State {{if not ( or (not .IdentifiedBy) .MaxOneClassAllowed)}}[]{{end}}{{.ResourceClassName}}{{$.ResourceClassName}}ResourceModel) []map[string]interface{} { - +{{- $child:= .}} +func get{{$.ResourceClassName}}{{ .ResourceClassName }}ChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *{{$.ResourceClassName}}ResourceModel, {{.PkgName}}{{.ParentHierarchy}}Plan, {{.PkgName}}{{.ParentHierarchy}}State {{if not ( or (not .IdentifiedBy) .MaxOneClassAllowed)}}[]{{end}}{{.ResourceClassName}}{{$.ResourceClassName}}ResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.{{ .ResourceClassName }}.IsUnknown() { - {{- if and (and .IdentifiedBy (not (and .MaxOneClassAllowed (hasPrefix .RnFormat "rs")))) (not (or (not .IdentifiedBy) .MaxOneClassAllowed))}} - {{ .PkgName }}Identifiers := []{{ .ResourceClassName }}Identifier{} - {{- end}} - {{- if or (not .IdentifiedBy) .MaxOneClassAllowed}} - childMap := map[string]map[string]interface{}{"attributes": {}} + {{- $enteredGrandChildDeclarationZone := false }} + {{- range .Children}} + {{- $enteredGrandChildDeclarationZone = true }} + {{- template "grandChildDeclarationInChildPayloadFunction" . }} + {{- end}} + if !data.{{.ResourceClassName}}.IsNull() && !data.{{.ResourceClassName}}.IsUnknown() { + {{- if and (and .IdentifiedBy (not (and .MaxOneClassAllowed (hasPrefix .RnFormat "rs")))) (not (or (not .IdentifiedBy) .MaxOneClassAllowed))}} + {{ .PkgName }}Identifiers := []{{.ResourceClassName}}Identifier{} + {{- end}} + {{- if or (not .IdentifiedBy) .MaxOneClassAllowed}} + {{.ResourceClassName}}{{.ParentHierarchy}}Children := make([]map[string]interface{}, 0) + childMap := NewAciObject() if !IsEmptySingleNestedAttribute(data.{{ .ResourceClassName }}.Attributes()) { {{- range .Properties}} - if !{{ .PkgName }}Plan.{{- if eq .Name "Id"}}{{.ResourceClassName}}{{ .Name }}{{- else}}{{.Name}}{{- end}}.IsUnknown() && !{{ .PkgName }}Plan.{{- if eq .Name "Id"}}{{.ResourceClassName}}{{ .Name }}{{- else}}{{.Name}}{{- end}}.IsNull(){ + if !{{ .PkgName }}{{$child.ParentHierarchy}}Plan.{{- if eq .Name "Id"}}{{.ResourceClassName}}{{ .Name }}{{- else}}{{.Name}}{{- end}}.IsUnknown() && !{{ .PkgName }}{{$child.ParentHierarchy}}Plan.{{- if eq .Name "Id"}}{{.ResourceClassName}}{{ .Name }}{{- else}}{{.Name}}{{- end}}.IsNull(){ {{- if eq .ValueType "bitmask"}} var tmp{{ .Name }} []string - {{ .PkgName }}.{{ .Name }}.ElementsAs(ctx, &tmp{{ .Name }}, false) - childMap["attributes"]["{{ .PropertyName }}"] = strings.Join(tmp{{ .Name }}, ",") + {{ .PkgName }}{{$child.ParentHierarchy}}Plan.{{ .Name }}.ElementsAs(ctx, &tmp{{ .Name }}, false) + childMap.Attributes["{{ .PropertyName }}"] = strings.Join(tmp{{ .Name }}, ",") {{- else if eq .Name "Id"}} - childMap["attributes"]["{{ .PropertyName }}"] = {{ .PkgName }}Plan.{{.ResourceClassName}}{{ .Name }}.ValueString() + childMap.Attributes["{{ .PropertyName }}"] = {{ .PkgName }}{{$child.ParentHierarchy}}Plan.{{.ResourceClassName}}{{ .Name }}.ValueString() {{- else}} - childMap["attributes"]["{{ .PropertyName }}"] = {{ .PkgName }}Plan.{{ .Name }}.ValueString() + childMap.Attributes["{{ .PropertyName }}"] = {{ .PkgName }}{{$child.ParentHierarchy}}Plan.{{ .Name }}.ValueString() {{- end}} } {{- if eq .Name "Annotation" }} else { - childMap["attributes"]["annotation"] = globalAnnotation + childMap.Attributes["annotation"] = globalAnnotation } {{- end}} {{- end}} }{{- if .AllowDelete}} else { {{- range .Properties}} {{- if .IsNaming }} - childMap["attributes"]["{{.PropertyName}}"] = {{.PkgName}}State.{{- if eq .Name "Id"}}{{.ResourceClassName}}{{ .Name }}{{- else}}{{.Name}}{{- end}}.ValueString() + childMap.Attributes["{{.PropertyName}}"] = {{.PkgName}}{{$child.ParentHierarchy}}State.{{- if eq .Name "Id"}}{{.ResourceClassName}}{{ .Name }}{{- else}}{{.Name}}{{- end}}.ValueString() {{- end}} {{- end}} - childMap["attributes"]["status"] = "deleted" + childMap.Attributes["status"] = "deleted" }{{- end}} + {{- $enteredGrandChildPayloadZone := false }} + {{- range .Children}} + {{- $enteredGrandChildPayloadZone = true }} + {{- template "grandChildPayload" . }} + {{- end}} + {{- range .Children}} + {{- if $enteredGrandChildPayloadZone }} + {{- $enteredGrandChildPayloadZone = false }} + childMap.Children = {{.ParentHierarchy}}Children + {{- end}} + {{- end}} childPayloads = append(childPayloads, map[string]interface{}{"{{ .PkgName }}": childMap}) {{- else}} - for _, {{ .PkgName }} := range {{ .PkgName }}Plan { - childMap := map[string]map[string]interface{}{"attributes": {}} - {{- range .Properties}} - if !{{ .PkgName }}.{{- if eq .Name "Id"}}{{.ResourceClassName}}{{ .Name }}{{- else}}{{.Name}}{{- end}}.IsUnknown() && !{{ .PkgName }}.{{- if eq .Name "Id"}}{{.ResourceClassName}}{{ .Name }}{{- else}}{{.Name}}{{- end}}.IsNull(){ - {{- if eq .ValueType "bitmask"}} - var tmp{{ .Name }} []string - {{ .PkgName }}.{{ .Name }}.ElementsAs(ctx, &tmp{{ .Name }}, false) - childMap["attributes"]["{{ .PropertyName }}"] = strings.Join(tmp{{ .Name }}, ",") - {{- else if eq .Name "Id"}} - childMap["attributes"]["{{ .PropertyName }}"] = {{ .PkgName }}.{{.ResourceClassName}}{{ .Name }}.ValueString() - {{- else}} - childMap["attributes"]["{{ .PropertyName }}"] = {{ .PkgName }}.{{ .Name }}.ValueString() - {{- end}} - } {{- if eq .Name "Annotation" }} else { - childMap["attributes"]["annotation"] = globalAnnotation - } {{- end}} + for _, {{ .PkgName }}{{.ParentHierarchy}} := range {{ .PkgName }}{{.ParentHierarchy}}Plan { + {{- if $enteredGrandChildDeclarationZone }} + {{- $enteredGrandChildDeclarationZone = false }} + {{.ResourceClassName}}{{.ParentHierarchy}}Children := make([]map[string]interface{}, 0) {{- end}} - childPayloads = append(childPayloads, map[string]interface{}{"{{ .PkgName }}": childMap}) - {{- if and .IdentifiedBy (not (and .MaxOneClassAllowed (hasPrefix .RnFormat "rs")))}} + childMap := NewAciObject() + {{- range .Properties}} + if !{{ .PkgName }}{{$child.ParentHierarchy}}.{{- if eq .Name "Id"}}{{.ResourceClassName}}{{ .Name }}{{- else}}{{.Name}}{{- end}}.IsNull() && !{{ .PkgName }}{{$child.ParentHierarchy}}.{{- if eq .Name "Id"}}{{.ResourceClassName}}{{ .Name }}{{- else}}{{.Name}}{{- end}}.IsUnknown(){ + {{- if eq .ValueType "bitmask"}} + var tmp{{ .Name }} []string + {{ .PkgName }}{{$child.ParentHierarchy}}.{{ .Name }}.ElementsAs(ctx, &tmp{{ .Name }}, false) + childMap.Attributes["{{ .PropertyName }}"] = strings.Join(tmp{{ .Name }}, ",") + {{- else if eq .Name "Id"}} + childMap.Attributes["{{ .PropertyName }}"] = {{ .PkgName }}{{$child.ParentHierarchy}}.{{.ResourceClassName}}{{ .Name }}.ValueString() + {{- else}} + childMap.Attributes["{{ .PropertyName }}"] = {{ .PkgName }}{{$child.ParentHierarchy}}.{{ .Name }}.ValueString() + {{- end}} + } {{- if eq .Name "Annotation" }} else { + childMap.Attributes["annotation"] = globalAnnotation + } {{- end}} + {{- end}} + {{- $enteredGrandChildPayloadZone := false }} + {{- range .Children}} + {{- $enteredGrandChildPayloadZone = true }} + {{- $newCtx := addToTemplateProperties . "AlreadyInPlan" true -}} + {{- template "grandChildPayload" $newCtx }} + {{- end}} + {{- range .Children}} + {{- if $enteredGrandChildPayloadZone }} + {{- $enteredGrandChildPayloadZone = false }} + childMap.Children = {{.ParentHierarchy}}Children + {{- end}} + {{- end}} + childPayloads = append(childPayloads, map[string]interface{}{"{{ .PkgName }}": childMap}) + {{- if and .IdentifiedBy (not (and .MaxOneClassAllowed (hasPrefix .RnFormat "rs")))}} {{ .PkgName }}Identifier := {{ .ResourceClassName }}Identifier{} {{- range .Properties}} {{- if .IsNaming}} {{- if .HasCustomType}} - {{ .PkgName }}Identifier.{{.Name}} = basetypes.NewStringValue({{ .PkgName }}.{{- if eq .Name "Id"}}{{.ResourceClassName}}.ValueString(){{ .Name }}{{- else}}{{.Name}}.ValueString(){{- end}}) + {{ .PkgName }}Identifier.{{.Name}} = basetypes.NewStringValue({{ .PkgName }}{{$child.ParentHierarchy}}.{{- if eq .Name "Id"}}{{.ResourceClassName}}.ValueString(){{ .Name }}{{- else}}{{.Name}}.ValueString(){{- end}}) {{- else}} - {{ .PkgName }}Identifier.{{.Name}} = {{ .PkgName }}.{{- if eq .Name "Id"}}{{.ResourceClassName}}{{ .Name }}{{- else}}{{.Name}}{{- end}} + {{ .PkgName }}Identifier.{{.Name}} = {{ .PkgName }}{{$child.ParentHierarchy}}.{{- if eq .Name "Id"}}{{.ResourceClassName}}{{ .Name }}{{- else}}{{.Name}}{{- end}} {{- end}} {{- end}} {{- end}} @@ -2139,7 +2286,7 @@ func get{{$.ResourceClassName}}{{ .ResourceClassName }}ChildPayloads(ctx context {{- end}} } {{- if and .IdentifiedBy (not (and .MaxOneClassAllowed (hasPrefix .RnFormat "rs")))}} - for _, {{ .PkgName }} := range {{ .PkgName }}State { + for _, {{ .PkgName }} := range {{ .PkgName }}{{.ParentHierarchy}}State { delete := true for _, {{ .PkgName }}Identifier := range {{ .PkgName }}Identifiers { {{$i := 1}}{{$length := len .IdentifiedBy}} if @@ -2157,31 +2304,31 @@ func get{{$.ResourceClassName}}{{ .ResourceClassName }}ChildPayloads(ctx context } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - {{- range .Properties}} - {{- if .IsNaming }} - childMap["attributes"]["{{.PropertyName}}"] = {{ .PkgName }}.{{- if eq .Name "Id"}}{{.ResourceClassName}}{{ .Name }}{{- else}}{{.Name}}{{- end}}.ValueString() - {{- end}} + {{.PkgName}}{{$.ParentHierarchy}}ChildMapForDelete := NewAciObject() + {{.PkgName}}{{$.ParentHierarchy}}ChildMapForDelete.Attributes["status"] = "deleted" + {{- range .Properties}} + {{- if .IsNaming }} + {{.PkgName}}{{$.ParentHierarchy}}ChildMapForDelete.Attributes["{{.PropertyName}}"] = {{ .PkgName }}.{{- if eq .Name "Id"}}{{.ResourceClassName}}{{ .Name }}{{- else}}{{.Name}}{{- end}}.ValueString() {{- end}} - childPayloads = append(childPayloads, map[string]interface{}{"{{ .PkgName }}": childMap}) + {{- end}} + childPayloads = append(childPayloads, map[string]interface{}{"{{ .PkgName }}": {{.PkgName}}{{$.ParentHierarchy}}ChildMapForDelete}) } } - {{- else}} - {{- if not (or (not .IdentifiedBy) .MaxOneClassAllowed)}} - if len({{ .PkgName }}Plan) == 0 && len({{ .PkgName }}State) == 1 { - {{- if .AllowDelete}} - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" + {{- else}} + {{- if not (or (not .IdentifiedBy) .MaxOneClassAllowed)}} + if len({{ .PkgName }}{{.ParentHierarchy}}Plan) == 0 && len({{ .PkgName }}{{.ParentHierarchy}}State) == 1 { + {{- if .AllowDelete}} + {{.PkgName}}{{.ParentHierarchy}}ChildMapForDelete := NewAciObject() + {{.PkgName}}{{.ParentHierarchy}}ChildMapForDelete.Attributes["status"] = "deleted" {{- if .IdentifiedBy}} {{- range .Properties}} {{- if .IsNaming }} - childMap["attributes"]["{{.PropertyName}}"] = {{ .PkgName }}State[0].{{- if eq .Name "Id"}}{{.ResourceClassName}}{{ .Name }}{{- else}}{{.Name}}{{- end}}.ValueString() + {{.PkgName}}{{$.ParentHierarchy}}ChildMapForDelete.Attributes["{{.PropertyName}}"] = {{ .PkgName }}State[0].{{- if eq .Name "Id"}}{{.ResourceClassName}}{{ .Name }}{{- else}}{{.Name}}{{- end}}.ValueString() {{- end}} {{- end}} {{- end}} - childPayloads = append(childPayloads, map[string]interface{}{"{{ .PkgName }}": childMap}) - {{- else}} + childPayloads = append(childPayloads, map[string]interface{}{"{{ .PkgName }}": {{.PkgName}}{{.ParentHierarchy}}ChildMapForDelete}) + {{- else}} diags.AddError( "{{ .ResourceClassName }} object cannot be deleted", "deletion of child is only possible upon deletion of the parent", @@ -2203,7 +2350,7 @@ func get{{$.ResourceClassName}}{{ .ResourceClassName }}ChildPayloads(ctx context return childPayloads } -{{- end}} +{{ end}} func get{{.ResourceClassName}}CreateJsonPayload(ctx context.Context, diags *diag.Diagnostics, createType bool, data *{{.ResourceClassName}}ResourceModel{{- range .Children}}, {{.PkgName}}Plan, {{.PkgName}}State {{if not ( or (not .IdentifiedBy) .MaxOneClassAllowed)}}[]{{end}}{{.ResourceClassName}}{{$.ResourceClassName}}ResourceModel{{- end}}) *container.Container { payloadMap := map[string]interface{}{} @@ -2285,3 +2432,670 @@ func get{{.ResourceClassName}}CreateJsonPayload(ctx context.Context, diags *diag } return jsonPayload } + + +{{/* Sub Templates */}} + +{{/* A sub template for the child structs used in the structs definiton section. */}} +{{- define "childStructsAndAttributeTypes" }} +// {{.ResourceClassName}}{{.ParentHierarchy}}ResourceModel describes the resource data model for the children without relation ships. +type {{.ResourceClassName}}{{.ParentHierarchy}}ResourceModel struct { + {{- range .Properties}} + {{- if eq .ValueType "bitmask"}} + {{ .Name }} types.Set `tfsdk:"{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}"` + {{- else if eq .Name "Id"}} + {{.ResourceClassName}}{{ .Name }} types.String `tfsdk:"{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}"` + {{- else if .HasCustomType}} + {{ .Name }} customTypes.{{.ResourceClassName}}{{.Name}}StringValue `tfsdk:"{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}"` + {{- else}} + {{ .Name }} types.String `tfsdk:"{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}"` + {{- end}} + {{- end}} + {{- range .Children}} + {{- if or (not .IdentifiedBy) .MaxOneClassAllowed}} + {{ .ResourceClassName }} types.Object `tfsdk:"{{overwriteProperty .PkgName .ResourceName $.Definitions}}"` + {{- else}} + {{ .ResourceClassName }} types.Set `tfsdk:"{{overwriteProperty .PkgName .ResourceName $.Definitions}}"` + {{- end}} + {{- end}} +} + +func getEmpty{{.ResourceClassName}}{{.ParentHierarchy}}ResourceModel() {{.ResourceClassName}}{{.ParentHierarchy}}ResourceModel { + return {{.ResourceClassName}}{{.ParentHierarchy}}ResourceModel{ + {{- range .Properties}} + {{- if eq .ValueType "bitmask"}} + {{ .Name }}: types.SetNull(types.StringType), + {{- else if eq .Name "Id"}} + {{.ResourceClassName}}{{ .Name }}: basetypes.NewStringNull(), + {{- else if .HasCustomType}} + {{ .Name }}: customTypes.New{{.ResourceClassName}}{{.Name}}StringNull(), + {{- else}} + {{ .Name }}: basetypes.NewStringNull(), + {{- end}} + {{- end}} + {{- range .Children}} + {{- if or (not .IdentifiedBy) .MaxOneClassAllowed}} + {{ .ResourceClassName }}: types.ObjectNull(map[string]attr.Type{ + {{- range .Properties}} + {{- if eq .ValueType "bitmask"}} + "{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}": types.SetType{ElemType: types.StringType}, + {{- else}} + "{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}": types.StringType, + {{- end}} + {{- end}} + {{- range .Children}} + {{- if or (not .IdentifiedBy) .MaxOneClassAllowed}} + "{{overwriteProperty .PkgName .ResourceName $.Definitions}}": types.ObjectType{AttrTypes: {{.ResourceClassName}}{{.ParentHierarchy}}Type}, + {{- else}} + "{{overwriteProperty .PkgName .ResourceName $.Definitions}}": types.SetType{ElemType: {{.ResourceClassName}}{{.ParentHierarchy}}Type}, + {{- end}} + {{- end}} + }), + {{- else}} + {{ .ResourceClassName }}: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + {{- range .Properties}} + {{- if eq .ValueType "bitmask"}} + "{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}": types.SetType{ElemType: types.StringType}, + {{- else}} + "{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}": types.StringType, + {{- end}} + {{- end}} + {{- range .Children}} + {{- if or (not .IdentifiedBy) .MaxOneClassAllowed}} + "{{overwriteProperty .PkgName .ResourceName $.Definitions}}": types.ObjectType{AttrTypes: {{.ResourceClassName}}{{.ParentHierarchy}}Type}, + {{- else}} + "{{overwriteProperty .PkgName .ResourceName $.Definitions}}": types.SetType{ElemType: {{.ResourceClassName}}{{.ParentHierarchy}}Type}, + {{- end}} + {{- end}} + }, + }), + {{- end}} + {{- end}} + } +} +{{- if or (not .IdentifiedBy) .MaxOneClassAllowed}} +var {{.ResourceClassName}}{{.ParentHierarchy}}Type = map[string]attr.Type{ + {{- range .Properties}} + {{- if eq .ValueType "bitmask"}} + "{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}": types.SetType{ElemType: types.StringType}, + {{- else}} + "{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}": types.StringType, + {{- end}} + {{- end}} + {{- range .Children}} + {{- if or (not .IdentifiedBy) .MaxOneClassAllowed}} + "{{overwriteProperty .PkgName .ResourceName $.Definitions}}": types.ObjectType{AttrTypes: {{.ResourceClassName}}{{.ParentHierarchy}}Type}, + {{- else}} + "{{overwriteProperty .PkgName .ResourceName $.Definitions}}": types.SetType{ElemType: {{.ResourceClassName}}{{.ParentHierarchy}}Type}, + {{- end}} + {{- end}} +} +{{- else}} +var {{.ResourceClassName}}{{.ParentHierarchy}}Type = types.ObjectType{ + AttrTypes:map[string]attr.Type{ + {{- range .Properties}} + {{- if eq .ValueType "bitmask"}} + "{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}": types.SetType{ElemType: types.StringType}, + {{- else if eq .Name "Id"}} + "{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}": types.StringType, + {{- else}} + "{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}": types.StringType, + {{- end}} + {{- end}} + {{- range .Children}} + {{- if or (not .IdentifiedBy) .MaxOneClassAllowed}} + "{{overwriteProperty .PkgName .ResourceName $.Definitions}}": types.ObjectType{AttrTypes: {{.ResourceClassName}}{{.ParentHierarchy}}Type}, + {{- else}} + "{{overwriteProperty .PkgName .ResourceName $.Definitions}}": types.SetType{ElemType: {{.ResourceClassName}}{{.ParentHierarchy}}Type}, + {{- end}} + {{- end}} + }, +} +{{- end}} +{{- range .Children}} + {{- template "childStructsAndAttributeTypes" . }} +{{- end}} +{{- end}} + + +{{/* A sub template for the child attributes used in the Attributes block. */}} +{{- define "childAttributes" }} + {{- if or (not .IdentifiedBy) .MaxOneClassAllowed}} + "{{overwriteProperty .PkgName .ResourceName $.Definitions}}": schema.SingleNestedAttribute{ + MarkdownDescription: `{{.Comment}}`, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Object{ + objectplanmodifier.UseStateForUnknown(), + }, + {{- if .RequiredPropertiesNames }} + Validators: []validator.Object{ + MakeSingleNestedAttributeRequiredAttributesNotProvidedValidator("{{.ResourceName}}", []string{"{{listToString .RequiredPropertiesNames}}"}), + }, + {{- end }} + Attributes: map[string]schema.Attribute{ + {{- range .Properties}} + {{- if eq .ValueType "bitmask"}} + "{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}": schema.SetAttribute{ + MarkdownDescription: `{{.Comment}}`, + {{- if not .ReadOnly }} + Optional: true, + {{- end }} + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + {{- if .ValidValues}} + Validators: []validator.Set{ + setvalidator.SizeAtMost({{ len .ValidValues }}), + setvalidator.ValueStringsAre( + stringvalidator.OneOf({{- validatorString .ValidValues}}), + ), + }, + {{- end}} + ElementType: types.StringType, + }, + {{- else}} + "{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + {{- if or .ValidValues $.TemplateProperties.HasReadOnlyProperties}} + Validators: []validator.String{ + {{- if .ValidValues}} + stringvalidator.OneOf({{- validatorString .ValidValues}}), + {{- end}} + {{- if or .IsNaming .IsRequired}} + MakeStringRequired(), + {{- end}} + }, + {{- end}} + MarkdownDescription: `{{.Comment}}`, + }, + {{- end}} + {{- end}} + {{- range .Children }} + {{- $newCtx := addToTemplateProperties . "HasReadOnlyProperties" $.TemplateProperties.HasReadOnlyProperties -}} + {{- template "childAttributes" $newCtx }} + {{- end }} + }, + }, + {{- else }} + "{{overwriteProperty .PkgName .ResourceName $.Definitions}}": schema.SetNestedAttribute{ + MarkdownDescription: `{{.Comment}}`, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + {{- range .Properties}} + {{- if eq .ValueType "bitmask"}} + "{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}": schema.SetAttribute{ + MarkdownDescription: `{{.Comment}}`, + {{- if not .ReadOnly }} + Optional: true, + {{- end }} + {{- if ne .ValueType "password"}} + Computed: true, + {{- else}} + Sensitive: true, + {{- end}} + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + {{- if .ValidValues}} + Validators: []validator.Set{ + setvalidator.SizeAtMost({{ len .ValidValues }}), + setvalidator.ValueStringsAre( + stringvalidator.OneOf({{- validatorString .ValidValues}}), + ), + }, + {{- end}} + ElementType: types.StringType, + }, + {{- else}} + "{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}": schema.StringAttribute{ + {{- if .HasCustomType}} + CustomType: customTypes.{{.ResourceClassName}}{{.Name}}StringType{}, + {{- end}} + {{- if and (or .IsNaming .IsRequired) (not $.TemplateProperties.HasReadOnlyProperties)}} + Required: true, + {{- else }} + Optional: true, + {{- if ne .ValueType "password"}} + Computed: true, + {{- else}} + Sensitive: true, + {{- end}} + {{- end}} + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + {{- if .HasCustomType}} + Validators: []validator.String{ + stringvalidator.Any( + stringvalidator.OneOf({{- validatorStringCustomType .ValidValues .ValidValuesMap}}), + validators.InBetweenFromString({{- index .Validators 0 "min"}}, {{- index .Validators 0 "max"}}), + ), + }, + {{- else if or .ValidValues $.TemplateProperties.HasReadOnlyProperties}} + Validators: []validator.String{ + {{- if .ValidValues}} + stringvalidator.OneOf({{- validatorString .ValidValues}}), + {{- end}} + {{- if or .IsNaming .IsRequired}} + MakeStringRequired(), + {{- end}} + }, + {{- end}} + MarkdownDescription: `{{.Comment}}`, + }, + {{- end}} + {{- end}} + {{- range .Children }} + {{- $newCtx := addToTemplateProperties . "HasReadOnlyProperties" $.TemplateProperties.HasReadOnlyProperties -}} + {{- template "childAttributes" $newCtx }} + {{- end }} + }, + }, + }, +{{- end }} +{{- end }} + +{{/* A sub template for the grand child attributes used in the Payload function. */}} +{{- define "grandChildPayload" }} +{{$grandChild:= .}} +{{- if or (not .IdentifiedBy) .MaxOneClassAllowed}} +var {{.PkgName}}{{.ParentHierarchy}}Plan, {{.PkgName}}{{.ParentHierarchy}}State {{.ResourceClassName}}{{.ParentHierarchy}}ResourceModel +{{- else}} +var {{.PkgName}}{{.ParentHierarchy}}Plan, {{.PkgName}}{{.ParentHierarchy}}State []{{.ResourceClassName}}{{.ParentHierarchy}}ResourceModel +{{- end}} +{{- if .TemplateProperties.AlreadyInPlan }} +{{- if or (not .IdentifiedBy) .MaxOneClassAllowed}} +{{.ParentHierarchy | decapitalize}}.{{.ResourceClassName}}.As(ctx, &{{.PkgName}}{{.ParentHierarchy}}Plan, basetypes.ObjectAsOptions{}) +if !{{.ParentHierarchy | decapitalize}}State.{{.ResourceClassName}}.IsNull(){ + {{.ParentHierarchy | decapitalize}}State.{{.ResourceClassName}}.As(ctx, &{{.PkgName}}{{.ParentHierarchy}}State, basetypes.ObjectAsOptions{}) +} +{{- else}} +{{.ParentHierarchy | decapitalize}}.{{.ResourceClassName}}.ElementsAs(ctx, &{{.PkgName}}{{.ParentHierarchy}}Plan, false) +for _, {{ .PkgName }}{{.ParentHierarchy}}state := range {{.ParentHierarchy | decapitalize}}State { + {{ .PkgName }}{{.ParentHierarchy}}state.{{.ResourceClassName}}.ElementsAs(ctx, &{{.PkgName}}{{.ParentHierarchy}}State, false) +} +{{- end}} +if !{{ .ParentHierarchy | decapitalize}}.{{.ResourceClassName}}.IsNull() && !{{ .ParentHierarchy | decapitalize}}.{{.ResourceClassName}}.IsUnknown(){ +{{- else}} +{{- if or (not .IdentifiedBy) .MaxOneClassAllowed}} +{{.ParentHierarchy | decapitalize}}Plan.{{.ResourceClassName}}.As(ctx, &{{.PkgName}}{{.ParentHierarchy}}Plan, basetypes.ObjectAsOptions{}) +if !{{.ParentHierarchy | decapitalize}}State.{{.ResourceClassName}}.IsNull(){ + {{.ParentHierarchy | decapitalize}}State.{{.ResourceClassName}}.As(ctx, &{{.PkgName}}{{.ParentHierarchy}}State, basetypes.ObjectAsOptions{}) +} +{{- else}} +{{.ParentHierarchy | decapitalize}}Plan.{{.ResourceClassName}}.ElementsAs(ctx, &{{.PkgName}}{{.ParentHierarchy}}Plan, false) +if !{{.ParentHierarchy | decapitalize}}State.{{.ResourceClassName}}.IsNull(){ + {{.ParentHierarchy | decapitalize}}State.{{.ResourceClassName}}.ElementsAs(ctx, &{{.PkgName}}{{.ParentHierarchy}}State, false) +} +{{- end}} +if !{{ .ParentHierarchy | decapitalize}}Plan.{{.ResourceClassName}}.IsNull() && !{{ .ParentHierarchy | decapitalize}}Plan.{{.ResourceClassName}}.IsUnknown(){ +{{- end}} + {{- if and (and .IdentifiedBy (not (and .MaxOneClassAllowed (hasPrefix .RnFormat "rs")))) (not (or (not .IdentifiedBy) .MaxOneClassAllowed))}} + {{ .PkgName }}Identifiers := []{{.ResourceClassName}}Identifier{} + {{- end}} +{{- if or (not .IdentifiedBy) .MaxOneClassAllowed}} + {{.PkgName}}{{.ParentHierarchy}}ChildMap := NewAciObject() + if !IsEmptySingleNestedAttribute({{ .ParentHierarchy | decapitalize}}Plan.{{.ResourceClassName}}.Attributes()) { + {{- range .Properties}} + if !{{ .PkgName }}{{$.ParentHierarchy}}Plan.{{- if eq .Name "Id"}}{{.ResourceClassName}}{{ .Name }}{{- else}}{{.Name}}{{- end}}.IsUnknown() && !{{ .PkgName }}{{$.ParentHierarchy}}Plan.{{- if eq .Name "Id"}}{{.ResourceClassName}}{{ .Name }}{{- else}}{{.Name}}{{- end}}.IsNull(){ + {{- if eq .ValueType "bitmask"}} + var tmp{{ .Name }} []string + {{ .PkgName }}{{$.ParentHierarchy}}Plan.{{ .Name }}.ElementsAs(ctx, &tmp{{ .Name }}, false) + {{.PkgName}}{{$.ParentHierarchy}}ChildMap.Attributes["{{ .PropertyName }}"] = strings.Join(tmp{{ .Name }}, ",") + {{- else if eq .Name "Id"}} + {{.PkgName}}{{$.ParentHierarchy}}ChildMap.Attributes["{{ .PropertyName }}"] = {{ .PkgName }}{{$.ParentHierarchy}}Plan.{{.ResourceClassName}}{{ .Name }}.ValueString() + {{- else}} + {{.PkgName}}{{$.ParentHierarchy}}ChildMap.Attributes["{{ .PropertyName }}"] = {{ .PkgName }}{{$.ParentHierarchy}}Plan.{{ .Name }}.ValueString() + {{- end}} + } {{- if eq .Name "Annotation" }} else { + {{.PkgName}}{{$.ParentHierarchy}}ChildMap.Attributes["annotation"] = globalAnnotation + } {{- end}} + {{- end}} + }{{- if .AllowDelete}} else { + {{- range .Properties}} + {{- if .IsNaming }} + {{.PkgName}}{{$.ParentHierarchy}}childMap.Attributes["{{.PropertyName}}"] = {{.PkgName}}State.{{- if eq .Name "Id"}}{{.ResourceClassName}}{{ .Name }}{{- else}}{{.Name}}{{- end}}.ValueString() + {{- end}} + {{- end}} + {{.PkgName}}{{$.ParentHierarchy}}ChildMap.Attributes["status"] = "deleted" + }{{- end}} + {{- $enteredGreatGrandChildPayloadZoneOne := false }} + {{- range .Children}} + {{- $enteredGreatGrandChildPayloadZoneOne = true }} + {{- template "grandChildPayload" . }} + {{- end}} + {{- range .Children}} + {{- if $enteredGreatGrandChildPayloadZoneOne }} + {{- $enteredGreatGrandChildPayloadZoneOne = false }} + {{$.PkgName}}{{$.ParentHierarchy}}ChildMap.Children = {{.ParentHierarchy}}Children + {{- end}} + {{- end}} + {{ .ParentHierarchy }}Children = append({{ .ParentHierarchy }}Children, map[string]interface{}{"{{.PkgName}}": {{.PkgName}}{{$.ParentHierarchy}}ChildMap}) + {{- else}} +for _, {{ .PkgName }}{{.ParentHierarchy}} := range {{.PkgName}}{{.ParentHierarchy}}Plan { + {{.PkgName}}{{.ParentHierarchy}}ChildMap := NewAciObject() + {{- range .Properties}} + if !{{ .PkgName }}{{$.ParentHierarchy}}.{{- if eq .Name "Id"}}{{.ResourceClassName}}{{ .Name }}{{- else}}{{.Name}}{{- end}}.IsNull() && !{{ .PkgName }}{{$.ParentHierarchy}}.{{- if eq .Name "Id"}}{{.ResourceClassName}}{{ .Name }}{{- else}}{{.Name}}{{- end}}.IsUnknown(){ + {{- if eq .ValueType "bitmask"}} + var tmp{{ .Name }} []string + {{ .PkgName }}{{$.ParentHierarchy}}.{{ .Name }}.ElementsAs(ctx, &tmp{{ .Name }}, false) + {{.PkgName}}{{$.ParentHierarchy}}ChildMap.Attributes["{{ .PropertyName }}"] = strings.Join(tmp{{ .Name }}, ",") + {{- else if eq .Name "Id"}} + {{.PkgName}}{{$.ParentHierarchy}}ChildMap.Attributes["{{ .PropertyName }}"] = {{ .PkgName }}{{$.ParentHierarchy}}.{{.ResourceClassName}}{{ .Name }}.ValueString() + {{- else}} + {{.PkgName}}{{$.ParentHierarchy}}ChildMap.Attributes["{{ .PropertyName }}"] = {{ .PkgName }}{{$.ParentHierarchy}}.{{ .Name }}.ValueString() + {{- end}} + } {{- if eq .Name "Annotation" }} else { + {{.PkgName}}{{$.ParentHierarchy}}ChildMap.Attributes["annotation"] = globalAnnotation + } {{- end}} + {{- end}} + {{- $enteredGreatGrandChildPayloadZone := false }} + {{- range .Children}} + {{- $enteredGreatGrandChildPayloadZone = true }} + {{- $newCtx := addToTemplateProperties . "AlreadyInPlan" true -}} + {{- template "grandChildPayload" $newCtx }} + {{- end}} + {{- range .Children}} + {{- if $enteredGreatGrandChildPayloadZone }} + {{- $enteredGreatGrandChildPayloadZone = false }} + {{$.PkgName}}{{$.ParentHierarchy}}ChildMap.Children = {{.ParentHierarchy}}Children + {{- end}} + {{- end}} + {{ .ParentHierarchy }}Children = append({{ .ParentHierarchy }}Children, map[string]interface{}{"{{.PkgName}}": {{.PkgName}}{{$.ParentHierarchy}}ChildMap}) + {{- if .IdentifiedBy}} + {{ .PkgName }}Identifier := {{ .ResourceClassName }}Identifier{} + {{- range .Properties}} + {{- if .IsNaming}} + {{ .PkgName }}Identifier.{{.Name}} = {{ .PkgName }}{{$grandChild.ParentHierarchy}}.{{- if eq .Name "Id"}}{{.ResourceClassName}}{{ .Name }}{{- else}}{{.Name}}{{- end}} + {{- end}} + {{- end}} + {{ .PkgName }}Identifiers = append({{ .PkgName }}Identifiers, {{ .PkgName }}Identifier) + {{- end}} + } + {{- end}} + {{- if .IdentifiedBy}} + for _, {{ .PkgName }}{{.ParentHierarchy}} := range {{ .PkgName }}{{.ParentHierarchy}}State { + delete := true + for _, {{ .PkgName }}Identifier := range {{ .PkgName }}Identifiers { {{$i := 1}}{{$length := len .IdentifiedBy}} + if + {{- range .Properties}} + {{- if .IsNaming }} + {{ .PkgName }}Identifier.{{.Name}} == {{ .PkgName }}{{$grandChild.ParentHierarchy}}.{{- if eq .Name "Id"}}{{.ResourceClassName}}{{ .Name }}{{- else}}{{.Name}}{{- end}}{{- if ne $length $i}} {{$i = add $i 1}} && {{- end}} + {{- end}} + {{- end}} { + delete = false + break + } + } + if delete { + {{.PkgName}}{{$.ParentHierarchy}}ChildMapForDelete := NewAciObject() + {{.PkgName}}{{$.ParentHierarchy}}ChildMapForDelete.Attributes["status"] = "deleted" + {{- range .Properties}} + {{- if .IsNaming }} + {{.PkgName}}{{$.ParentHierarchy}}ChildMapForDelete.Attributes["{{.PropertyName}}"] = {{ .PkgName }}{{$grandChild.ParentHierarchy}}.{{- if eq .Name "Id"}}{{.ResourceClassName}}{{ .Name }}{{- else}}{{.Name}}{{- end}}.ValueString() + {{- end}} + {{- end}} + {{ .ParentHierarchy }}Children = append({{ .ParentHierarchy }}Children, map[string]interface{}{"{{ .PkgName }}": {{.PkgName}}{{$.ParentHierarchy}}ChildMapForDelete}) + } + } + } + {{- else}} + {{- if not (or (not .IdentifiedBy) .MaxOneClassAllowed)}} + if len({{ .PkgName }}{{.ParentHierarchy}}Plan) == 0 && len({{.PkgName}}{{.ParentHierarchy}}State) == 1 { + {{- if .AllowDelete}} + {{.PkgName}}{{.ParentHierarchy}}ChildMapForDelete := NewAciObject() + {{.PkgName}}{{.ParentHierarchy}}ChildMapForDelete.Attributes["status"] = "deleted" + {{- if .IdentifiedBy}} + {{- range .Properties}} + {{- if .IsNaming }} + {{.PkgName}}{{$.ParentHierarchy}}ChildMapForDelete.Attributes["{{.PropertyName}}"] = {{ .PkgName }}State[0].{{- if eq .Name "Id"}}{{.ResourceClassName}}{{ .Name }}{{- else}}{{.Name}}{{- end}}.ValueString() + {{- end}} + {{- end}} + {{- end}} + {{ .ParentHierarchy }}Children = append({{ .ParentHierarchy }}Children, map[string]interface{}{"{{.PkgName}}": {{.PkgName}}{{.ParentHierarchy}}ChildMapForDelete}) + {{- else}} + diags.AddError( + "{{ .ResourceClassName }} object cannot be deleted", + "deletion of child is only possible upon deletion of the parent", + ) + return nil + {{- end }} + } + {{- end }} + } + {{- end}} +{{- end }} + + +{{/* A sub template to declare child lists in the get and set attributes function. */}} +{{- define "declareChildListsInGetandSetAttributesFunction" }} +{{ .ResourceClassName }}{{.ParentHierarchy}}List := make([]{{.ResourceClassName}}{{.ParentHierarchy}}ResourceModel, 0) +{{- end}} + +{{- define "declareChildListsInGetandSetAttributesFunctionWithGetEmpty" }} +{{.ResourceClassName}}{{.ParentHierarchy}} := getEmpty{{ .ResourceClassName}}{{.ParentHierarchy}}ResourceModel() +{{ .ResourceClassName }}{{.ParentHierarchy}}List := make([]{{.ResourceClassName}}{{.ParentHierarchy}}ResourceModel, 0) +{{- range .Children}} + {{- template "declareChildListsInGetandSetAttributesFunctionWithGetEmpty" . }} +{{- end}} +{{- end}} + +{{/* A sub template for the grand child attributes used in the get and set attributes function. */}} +{{- define "getAndSetGrandChildren" }} +if childClassName{{.ParentHierarchy}} == "{{.PkgName}}"{ +{{.ResourceClassName}}{{.ParentHierarchy}} := getEmpty{{ .ResourceClassName}}{{.ParentHierarchy}}ResourceModel() +{{.PkgName}}childAttributeValue:= childClassDetails{{.ParentHierarchy}}.(map[string]interface{})["attributes"].(map[string]interface{}) +for childAttributeName, childAttributeValue := range {{.PkgName}}childAttributeValue { + {{- range .Properties}} + {{- if eq .ValueType "bitmask"}} + {{- if containsNoneAttributeValue .ValidValues}} + if childAttributeName == "{{.PropertyName}}" && childAttributeValue.(string) == "" { + {{.PropertyName}}Set, _ := types.SetValueFrom(ctx, {{.ResourceClassName}}{{$.ParentHierarchy}}.{{.Name}}.ElementType(ctx), []string{"none"}) + {{.ResourceClassName}}{{$.ParentHierarchy}}.{{.Name}} = {{.PropertyName}}Set + } else if childAttributeName == "{{.PropertyName}}" { + {{.PropertyName}}List := strings.Split(childAttributeValue.(string), ",") + var data{{.ParentHierarchy}} []{{.ParentHierarchy}}ResourceModel + data.{{.ParentHierarchy}}.ElementsAs(ctx,&data{{.ParentHierarchy}},false) + for _, {{.ParentHierarchy | decapitalize}} := range data{{.ResourceClassName}}{{.ParentHierarchy}} { + {{.PropertyName}}Set, _ := types.SetValueFrom(ctx, {{.ParentHierarchy | decapitalize}}.{{.ResourceClassName}}.ElementType(ctx),{{.PropertyName}}List) + {{.ResourceClassName}}{{$.ParentHierarchy}}.{{.Name}} = {{.PropertyName}}Set + } + } + {{- else}} + if childAttributeName == "{{.PropertyName}}" { + {{.PropertyName}}List := strings.Split(childAttributeValue.(string), ",") + var data{{.ParentHierarchy}} []{{.ParentHierarchy}}ResourceModel + data.{{.ParentHierarchy}}.ElementsAs(ctx,&data{{.ParentHierarchy}},false) + for _, {{.ParentHierarchy | decapitalize}} := range data{{.ResourceClassName}}{{.ParentHierarchy}} { + {{.PropertyName}}Set, _ := types.SetValueFrom(ctx, {{.ParentHierarchy | decapitalize}}.{{.ResourceClassName}}.ElementType(ctx),{{.PropertyName}}List) + {{.ResourceClassName}}{{$.ParentHierarchy}}.{{.Name}} = {{.PropertyName}}Set + } + } + {{- end}} + {{- else}} + {{- if containsNoneAttributeValue .ValidValues}} + if childAttributeName == "{{.PropertyName}}" && childAttributeValue.(string) == "" { + {{.ResourceClassName}}{{.ParentHierarchy}}.{{.Name}} = basetypes.NewStringValue("none") + } else if childAttributeName == "{{.PropertyName}}" { + {{.ResourceClassName}}{{$.ParentHierarchy}}.{{.Name}} = basetypes.NewStringValue(childAttributeValue.(string)) + } + {{- else}} + if childAttributeName == "{{.PropertyName}}" { + {{.ResourceClassName}}{{$.ParentHierarchy}}.{{- if eq .Name "Id"}}{{.ResourceClassName}}{{ .Name }}{{- else}}{{.Name}}{{- end}} = basetypes.NewStringValue(childAttributeValue.(string)) + } + {{- end}} + {{- end}} + {{- end}} + {{- $enteredGrandChildGetAndSetAttributesZone := false }} + {{- $children := .Children }} + {{- range .Children}} + {{- if not $enteredGrandChildGetAndSetAttributesZone }} + {{- $enteredGrandChildGetAndSetAttributesZone = true }} + } + {{- range $children}} + {{ .ResourceClassName }}{{.ParentHierarchy}}List := make([]{{.ResourceClassName}}{{.ParentHierarchy}}ResourceModel, 0) + {{- end}} + childrenOf{{.ParentHierarchy}}, childrenOf{{.ParentHierarchy}}Exist:= childClassDetails{{$.ParentHierarchy}}.(map[string]interface{})["children"] + if childrenOf{{.ParentHierarchy}}Exist { + for _, child{{.ParentHierarchy}} := range childrenOf{{.ParentHierarchy}}.([]interface{}) { + for childClassName{{.ParentHierarchy}}, childClassDetails{{.ParentHierarchy}} := range child{{.ParentHierarchy}}.(map[string]interface{}) { + {{- end}} + {{- template "getAndSetGrandChildren" . }} + {{- end }} + {{- if $enteredGrandChildGetAndSetAttributesZone }} + } + } + } + {{- range .Children}} + {{- if or (not .IdentifiedBy) .MaxOneClassAllowed}} + if len({{.ResourceClassName}}{{.ParentHierarchy}}List) == 1 { + {{.ResourceClassName}}{{.ParentHierarchy}}Object, _ := types.ObjectValueFrom(ctx, {{ .ResourceClassName }}{{.ParentHierarchy}}Type, {{ .ResourceClassName }}{{.ParentHierarchy}}List[0]) + {{.ParentHierarchy}}.{{ .ResourceClassName }} = {{.ResourceClassName}}{{.ParentHierarchy}}Object + } else { + {{.ResourceClassName}}{{.ParentHierarchy}}Object, _ := types.ObjectValueFrom(ctx, {{ .ResourceClassName }}{{.ParentHierarchy}}Type, getEmpty{{ .ResourceClassName }}{{.ParentHierarchy}}ResourceModel()) + {{.ParentHierarchy}}.{{ .ResourceClassName }} = {{.ResourceClassName}}{{.ParentHierarchy}}Object + } + {{- else}} + {{.ResourceClassName}}{{.ParentHierarchy}}Set,_ := types.SetValueFrom(ctx,{{.ResourceClassName}}{{.ParentHierarchy}}Type,{{.ResourceClassName}}{{.ParentHierarchy}}List) + {{.ParentHierarchy}}.{{.ResourceClassName}} = {{.ResourceClassName}}{{.ParentHierarchy}}Set + {{- end}} + {{- end}} + {{- else}} + } + {{- end}} + {{.ResourceClassName}}{{$.ParentHierarchy}}List = append({{.ResourceClassName}}{{$.ParentHierarchy}}List, {{.ResourceClassName}}{{$.ParentHierarchy}}) +} +{{- end }} + + +{{/* A sub template for grand child declaration in the child payload function. */}} +{{- define "grandChildDeclarationInChildPayloadFunction" }} +{{- $enteredGrandChildDeclarationZone := false }} +{{- range .Children}} + {{- $enteredGrandChildDeclarationZone = true }} + {{- template "grandChildDeclarationInChildPayloadFunction" . }} +{{- end }} +{{- range .Children}} + {{- if $enteredGrandChildDeclarationZone }} + {{- $enteredGrandChildDeclarationZone = false }} +{{.ParentHierarchy}}Children := make([]map[string]interface{}, 0) + {{- end}} +{{- end}} +{{- end}} + + +{{/* A sub template for joining all the class names as a single string. */}} +{{- define "rspSubtreeClassFilter" -}} + {{- $currentClasses := listToString .ChildClasses -}} + {{- $currentClasses -}} + {{- range .Children -}} + {{- if not (isListEmpty .ChildClasses) -}} + ,{{- template "rspSubtreeClassFilter" . -}} + {{- end -}} + {{- end -}} +{{- end -}} + + +{{- define "modifyPlanForSingleNestedChildren" }} +{{- if or (not .IdentifiedBy) .MaxOneClassAllowed}} + var {{.PkgName}}{{.ParentHierarchy}}ConfigData {{.ResourceClassName}}{{.ParentHierarchy}}ResourceModel + {{- if .TemplateProperties.configData}} + if !{{.TemplateProperties.configData.ResourceClassName}}ConfigData.{{.ResourceClassName}}.IsNull() && stateData != nil { + {{.TemplateProperties.configData.ResourceClassName}}ConfigData.{{.ResourceClassName}}.As(ctx, &{{.PkgName}}{{.ParentHierarchy}}ConfigData, basetypes.ObjectAsOptions{}) + if IsEmptySingleNestedAttribute({{.TemplateProperties.configData.ResourceClassName}}ConfigData.{{.ResourceClassName}}.Attributes()) { + {{.ResourceClassName}}{{.ParentHierarchy}}Object, _ := types.ObjectValueFrom(ctx, {{ .ResourceClassName }}{{.ParentHierarchy}}Type, getEmpty{{ .ResourceClassName }}{{.ParentHierarchy}}ResourceModel()) + {{.ParentHierarchy}}.{{ .ResourceClassName }} = {{.ResourceClassName}}{{.ParentHierarchy}}Object + } else { + {{.ResourceClassName}}{{.ParentHierarchy}}Object, _ := types.ObjectValueFrom(ctx, {{ .ResourceClassName }}{{.ParentHierarchy}}Type, {{.PkgName}}{{.ParentHierarchy}}ConfigData) + {{.ParentHierarchy}}.{{ .ResourceClassName }} = {{.ResourceClassName}}{{.ParentHierarchy}}Object + } + } + {{- else}} + if !{{.ParentHierarchy | decapitalize}}ConfigData.{{.ResourceClassName}}.IsNull() && stateData != nil { + {{.ParentHierarchy | decapitalize}}ConfigData.{{.ResourceClassName}}.As(ctx, &{{.PkgName}}{{.ParentHierarchy}}ConfigData, basetypes.ObjectAsOptions{}) + if IsEmptySingleNestedAttribute({{.ParentHierarchy}}ConfigData.{{.ResourceClassName}}.Attributes()) { + {{.ResourceClassName}}{{.ParentHierarchy}}Object, _ := types.ObjectValueFrom(ctx, {{ .ResourceClassName }}{{.ParentHierarchy}}Type, getEmpty{{ .ResourceClassName }}{{.ParentHierarchy}}ResourceModel()) + {{.ParentHierarchy}}.{{ .ResourceClassName }} = {{.ResourceClassName}}{{.ParentHierarchy}}Object + } else { + {{.ResourceClassName}}{{.ParentHierarchy}}Object, _ := types.ObjectValueFrom(ctx, {{ .ResourceClassName }}{{.ParentHierarchy}}Type, {{.PkgName}}{{.ParentHierarchy}}ConfigData) + {{.ParentHierarchy}}.{{ .ResourceClassName }} = {{.ResourceClassName}}{{.ParentHierarchy}}Object + } + } + {{- end}} +{{- else}} + var {{.PkgName}}{{.ParentHierarchy}}ConfigData []{{.ResourceClassName}}{{.ParentHierarchy}}ResourceModel + {{- if .TemplateProperties.configData}} + if !{{.TemplateProperties.configData.ResourceClassName}}ConfigData.{{.ResourceClassName}}.IsNull() && stateData != nil { + {{.TemplateProperties.configData.ResourceClassName}}ConfigData.{{.ResourceClassName}}.ElementsAs(ctx, &{{.PkgName}}{{.ParentHierarchy}}ConfigData, false) + {{- else}} + if !{{.ParentHierarchy | decapitalize}}ConfigData.{{.ResourceClassName}}.IsNull() && stateData != nil { + {{.ParentHierarchy | decapitalize}}ConfigData.{{.ResourceClassName}}.ElementsAs(ctx, &{{.PkgName}}{{.ParentHierarchy}}ConfigData, false) + {{- end}} + {{.ResourceClassName}}{{.ParentHierarchy}}Set, _ := types.SetValueFrom(ctx, {{ .ResourceClassName }}{{.ParentHierarchy}}Type, {{.PkgName}}{{.ParentHierarchy}}ConfigData) + {{.ParentHierarchy}}.{{ .ResourceClassName }} = {{.ResourceClassName}}{{.ParentHierarchy}}Set + } +{{- end}} +{{- range .Children}} + {{- $newCtx := addToTemplateProperties . "configData" "" -}} + {{- template "modifyPlanForSingleNestedChildren" $newCtx }} +{{- end}} +{{.ResourceClassName}}{{$.ParentHierarchy}}List = append({{.ResourceClassName}}{{$.ParentHierarchy}}List, {{.ResourceClassName}}{{$.ParentHierarchy}}) +{{- end}} + +{{- define "isDeleteAllowedForSingleNestedChildren" }} + {{- if or (and (or (not .IdentifiedBy) .MaxOneClassAllowed) (not .AllowDelete)) (containsDeletableSingleNestedChildren .Children)}} + var {{.PkgName}}{{.ParentHierarchy}}Data {{.ResourceClassName}}{{.ParentHierarchy}}ResourceModel + var {{.PkgName}}{{.ParentHierarchy}}StateData {{.ResourceClassName}}{{.ParentHierarchy}}ResourceModel + {{- if .TemplateProperties.data}} + {{.TemplateProperties.data.ResourceClassName}}Data.{{.ResourceClassName}}.As(ctx, &{{.PkgName}}{{.ParentHierarchy}}Data, basetypes.ObjectAsOptions{}) + {{.TemplateProperties.data.ResourceClassName}}StateData.{{.ResourceClassName}}.As(ctx, &{{.PkgName}}{{.ParentHierarchy}}StateData, basetypes.ObjectAsOptions{}) + {{- if (not .AllowDelete)}} + if IsEmptySingleNestedAttribute({{.TemplateProperties.data.ResourceClassName}}Data.{{.ResourceClassName}}.Attributes()) && !IsEmptySingleNestedAttribute({{.TemplateProperties.data.ResourceClassName}}StateData.{{.ResourceClassName}}.Attributes()) { + resp.Diagnostics.AddError( + "{{ .ResourceClassName }} object cannot be deleted", + "deletion of child is only possible upon deletion of the parent", + ) + } + {{- end}} + {{- else}} + {{.ParentHierarchy | decapitalize}}Data.{{.ResourceClassName}}.As(ctx, &{{.PkgName}}{{.ParentHierarchy}}Data, basetypes.ObjectAsOptions{}) + {{.ParentHierarchy | decapitalize}}StateData.{{.ResourceClassName}}.As(ctx, &{{.PkgName}}{{.ParentHierarchy}}StateData, basetypes.ObjectAsOptions{}) + {{- if (not .AllowDelete)}} + if IsEmptySingleNestedAttribute({{.ParentHierarchy}}Data.{{.ResourceClassName}}.Attributes()) && !IsEmptySingleNestedAttribute({{.ParentHierarchy}}StateData.{{.ResourceClassName}}.Attributes()) { + resp.Diagnostics.AddError( + "{{ .ResourceClassName }} object cannot be deleted", + "deletion of child is only possible upon deletion of the parent", + ) + } + {{- end}} + {{- end}} + {{- else}} + {{- if containsDeletableSingleNestedChildren .Children}} + var {{.PkgName}}{{.ParentHierarchy}}Data []{{.ResourceClassName}}{{.ParentHierarchy}}ResourceModel + var {{.PkgName}}{{.ParentHierarchy}}StateData []{{.ResourceClassName}}{{.ParentHierarchy}}ResourceModel + {{- if .TemplateProperties.data}} + {{.TemplateProperties.data.ResourceClassName}}Data.{{.ResourceClassName}}.ElementsAs(ctx, &{{.PkgName}}{{.ParentHierarchy}}Data, false) + {{.TemplateProperties.data.ResourceClassName}}StateData.{{.ResourceClassName}}.ElementsAs(ctx, &{{.PkgName}}{{.ParentHierarchy}}StateData, false) + {{- else}} + {{.ParentHierarchy | decapitalize}}Data.{{.ResourceClassName}}.ElementsAs(ctx, &{{.PkgName}}{{.ParentHierarchy}}Data, false) + {{.ParentHierarchy | decapitalize}}StateData.{{.ResourceClassName}}.ElementsAs(ctx, &{{.PkgName}}{{.ParentHierarchy}}StateData, false) + {{- end}} + {{- end}} + {{- end}} +{{- range .Children}} + {{- $newCtx := addToTemplateProperties . "data" "" -}} + {{- template "isDeleteAllowedForSingleNestedChildren" $newCtx }} +{{- end}} +{{- end}} \ No newline at end of file diff --git a/gen/templates/resource.md.tmpl b/gen/templates/resource.md.tmpl index 6164e0d51..ceb7bf7a3 100644 --- a/gen/templates/resource.md.tmpl +++ b/gen/templates/resource.md.tmpl @@ -126,81 +126,94 @@ All examples for the {{.ResourceNameAsDescription}} resource can be found in the {{- end}} {{- end}} {{- end}} -{{ range .Children }}{{$childVersion := .Versions}}{{$RelationshipClasses := .RelationshipClasses}}{{$length := len .RelationshipClasses}} +{{- range .Children }} + {{- $newCtx := addToTemplateProperties . "Indent" "" "Versions" $.Versions }} + {{- template "childResourcesAndProperties" $newCtx }} +{{- end}} + +## Importing + +An existing {{.ResourceNameAsDescription}} can be [imported](https://www.terraform.io/docs/import/index.html) into this resource with its distinguished name (DN), via the following command: + +``` +terraform import aci_{{- .ResourceName}}.example{{- if .DocumentationExamples}}_{{- $key := index .DocumentationExamples 0 }}{{getResourceName $key $.Definitions}}{{- end}} {{ index .DnFormats 0 }} +``` + +Starting in Terraform version 1.5, an existing {{.ResourceNameAsDescription}} can be imported +using [import blocks](https://developer.hashicorp.com/terraform/language/import) via the following configuration: + +``` +import { + id = "{{ index .DnFormats 0 }}" + to = aci_{{ .ResourceName}}.example{{- if .DocumentationExamples}}_{{- $key := index .DocumentationExamples 0 }}{{getResourceName $key $.Definitions}}{{- end}} +} +``` +{{ if .DocumentationChildren}} +## Child Resources + {{range .DocumentationChildren}} + - {{ . }} + {{- end}} +{{- end}} + +{{- /* A sub template for including nested children in the docs. */}} +{{- define "childResourcesAndProperties" -}} +{{- $indent := .TemplateProperties.Indent }} +{{- $parentVersion := .TemplateProperties.Versions }} +{{- $childVersion := .Versions }}{{$RelationshipClasses := .RelationshipClasses}}{{$length := len .RelationshipClasses}} {{- if ge $length 1}} {{- if .MultiRelationshipClass}} {{$RelationshipResourceNames := .RelationshipResourceNames}} -* `{{- overwriteProperty .PkgName .ResourceName $.Definitions}}` - (list) A list of {{getResourceNameAsDescription .ResourceName $.Definitions}} (ACI object {{getDevnetDocForClass .PkgName}}). This relation{{if and (ne $.Versions .Versions) (ne .Versions "")}} This attribute is supported in ACI versions: {{ .Versions}} and{{- end}} can point to multiple ACI objects: +{{ $indent }}* `{{- overwriteProperty .PkgName .ResourceName $.Definitions}}` - (list) A list of {{getResourceNameAsDescription .ResourceName $.Definitions}} (ACI object {{getDevnetDocForClass .PkgName}}). This relation{{if and (ne $parentVersion .Versions) (ne .Versions "")}} This attribute is supported in ACI versions: {{ .Versions}} and{{- end}} can point to multiple ACI objects: {{- range $index, $value := .RelationshipClasses}} {{- if le $index (len $RelationshipResourceNames)}} - - {{getDevnetDocForClass $value}}{{- if ne (index $RelationshipResourceNames $index) ""}} which can be configured using the [aci_{{(index $RelationshipResourceNames $index)}}](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/{{(index $RelationshipResourceNames $index)}}) resource.{{- else}}. Currently there is no resource available to configure this ACI object.{{- end}} + {{ $indent }}- {{getDevnetDocForClass $value}}{{- if ne (index $RelationshipResourceNames $index) ""}} which can be configured using the [aci_{{(index $RelationshipResourceNames $index)}}](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/{{(index $RelationshipResourceNames $index)}}) resource.{{- else}}. Currently there is no resource available to configure this ACI object.{{- end}} {{- end}} {{- end}} {{- else}} {{- if or (not .IdentifiedBy) .MaxOneClassAllowed}} -* `{{- overwriteProperty .PkgName .ResourceName $.Definitions}}` - (map) A map of {{getResourceNameAsDescription .ResourceName $.Definitions}} (ACI object {{getDevnetDocForClass .PkgName}}) pointing to {{range $index, $value := .RelationshipResourceNames}}{{- if or (eq $length 1) (eq $.PkgName (index $RelationshipClasses $index))}}{{getResourceNameAsDescription $value $.Definitions}} (ACI Object {{getDevnetDocForClass (index $RelationshipClasses $index)}}){{- if and (ne $value "") (isResourceClass (index $RelationshipClasses $index)) }} which can be configured using the [aci_{{($value)}}](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/{{($value)}}) resource{{end}}{{end}}{{end}}.{{if and (ne $.Versions .Versions) (ne .Versions "")}} This attribute is supported in ACI versions: {{ .Versions}}{{- end}} +{{ $indent }}* `{{- overwriteProperty .PkgName .ResourceName $.Definitions}}` - (map) A map of {{getResourceNameAsDescription .ResourceName $.Definitions}} (ACI object {{getDevnetDocForClass .PkgName}}) pointing to {{range $index, $value := .RelationshipResourceNames}}{{- if or (eq $length 1) (eq $.PkgName (index $RelationshipClasses $index))}}{{getResourceNameAsDescription $value $.Definitions}} (ACI Object {{getDevnetDocForClass (index $RelationshipClasses $index)}}){{- if and (ne $value "") (isResourceClass (index $RelationshipClasses $index)) }} which can be configured using the [aci_{{($value)}}](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/{{($value)}}) resource{{end}}{{end}}{{end}}.{{if and (ne $parentVersion .Versions) (ne .Versions "")}} This attribute is supported in ACI versions: {{ .Versions}}{{- end}} {{- else}} -* `{{- overwriteProperty .PkgName .ResourceName $.Definitions}}` - (list) A list of {{getResourceNameAsDescription .ResourceName $.Definitions}} (ACI object {{getDevnetDocForClass .PkgName}}) pointing to {{range $index, $value := .RelationshipResourceNames}}{{- if or (eq $length 1) (eq $.PkgName (index $RelationshipClasses $index))}}{{getResourceNameAsDescription $value $.Definitions}} (ACI Object {{getDevnetDocForClass (index $RelationshipClasses $index)}}){{- if and (ne $value "") (isResourceClass (index $RelationshipClasses $index)) }} which can be configured using the [aci_{{($value)}}](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/{{($value)}}) resource{{end}}{{end}}{{end}}.{{if and (ne $.Versions .Versions) (ne .Versions "")}} This attribute is supported in ACI versions: {{ .Versions}}{{- end}} +{{ $indent }}* `{{- overwriteProperty .PkgName .ResourceName $.Definitions}}` - (list) A list of {{getResourceNameAsDescription .ResourceName $.Definitions}} (ACI object {{getDevnetDocForClass .PkgName}}) pointing to {{range $index, $value := .RelationshipResourceNames}}{{- if or (eq $length 1) (eq $.PkgName (index $RelationshipClasses $index))}}{{getResourceNameAsDescription $value $.Definitions}} (ACI Object {{getDevnetDocForClass (index $RelationshipClasses $index)}}){{- if and (ne $value "") (isResourceClass (index $RelationshipClasses $index)) }} which can be configured using the [aci_{{($value)}}](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/{{($value)}}) resource{{end}}{{end}}{{end}}.{{if and (ne $parentVersion .Versions) (ne .Versions "")}} This attribute is supported in ACI versions: {{ .Versions}}{{- end}} {{- end}} {{- end}} {{- else}} {{- if or (not .IdentifiedBy) .MaxOneClassAllowed}} -* `{{- overwriteProperty .PkgName .ResourceName $.Definitions}}` - (map) A map of {{getResourceNameAsDescription .ResourceName $.Definitions}} (ACI object {{getDevnetDocForClass .PkgName}}).{{if .Include}} {{getResourceNameAsDescription .ResourceName $.Definitions}} can also be configured using a separate [aci_{{.ResourceNameDocReference}}](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/{{.ResourceNameDocReference}}) resource.{{end}}{{if and (ne $.Versions .Versions) (ne .Versions "")}} This attribute is supported in ACI versions: {{ .Versions}}{{- end}} +{{ $indent }}* `{{- overwriteProperty .PkgName .ResourceName $.Definitions}}` - (map) A map of {{getResourceNameAsDescription .ResourceName $.Definitions}} (ACI object {{getDevnetDocForClass .PkgName}}).{{if .Include}} {{getResourceNameAsDescription .ResourceName $.Definitions}} can also be configured using a separate [aci_{{.ResourceNameDocReference}}](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/{{.ResourceNameDocReference}}) resource.{{end}}{{if and (ne $parentVersion .Versions) (ne .Versions "")}} This attribute is supported in ACI versions: {{ .Versions}}{{- end}} {{- else}} -* `{{- overwriteProperty .PkgName .ResourceName $.Definitions}}` - (list) A list of {{getResourceNameAsDescription .ResourceName $.Definitions}} (ACI object {{getDevnetDocForClass .PkgName}}). {{getResourceNameAsDescription .ResourceName $.Definitions}} can also be configured using a separate [aci_{{.ResourceNameDocReference}}](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/{{.ResourceNameDocReference}}) resource.{{if and (ne $.Versions .Versions) (ne .Versions "")}} This attribute is supported in ACI versions: {{ .Versions}}{{- end}} +{{ $indent }}* `{{- overwriteProperty .PkgName .ResourceName $.Definitions}}` - (list) A list of {{getResourceNameAsDescription .ResourceName $.Definitions}} (ACI object {{getDevnetDocForClass .PkgName}}). {{getResourceNameAsDescription .ResourceName $.Definitions}} can also be configured using a separate [aci_{{.ResourceNameDocReference}}](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/{{.ResourceNameDocReference}}) resource.{{if and (ne $parentVersion .Versions) (ne .Versions "")}} This attribute is supported in ACI versions: {{ .Versions}}{{- end}} {{- end}} {{- end}} - {{ if containsRequired .Properties}} - #### Required #### + {{- if containsRequired .Properties}} + {{ $indent }}#### Required #### {{ range .Properties}} {{- if or .IsNaming .IsRequired}} {{- if eq .ValueType "bitmask"}} - * `{{- overwriteProperty .PkgName .SnakeCaseName $.Definitions}}` ({{- .PropertyName}}) - (list) {{.Comment}}{{if ne $childVersion .Versions}} This attribute is supported in ACI versions: {{ .Versions}}{{- end}} + {{ $indent }}* `{{- overwriteProperty .PkgName .SnakeCaseName $.Definitions}}` ({{- .PropertyName}}) - (list) {{.Comment}}{{if ne $childVersion .Versions}} This attribute is supported in ACI versions: {{ .Versions}}{{- end}} {{- else}} - * `{{- overwriteProperty .PkgName .SnakeCaseName $.Definitions}}` ({{- .PropertyName}}) - (string) {{.Comment}}{{if ne .NamedPropertyClass ""}}{{$RName := getResourceName .NamedPropertyClass $.Definitions}} This attribute can be referenced from a [resource](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/{{$RName}}) with `aci_{{$RName}}.example.name` or from a [datasource](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/data-sources/{{$RName}}) with `data.aci_{{$RName}}.example.name`.{{end}}{{if ne $childVersion .Versions}} This attribute is supported in ACI versions: {{ .Versions}}{{- end}} + {{ $indent }}* `{{- overwriteProperty .PkgName .SnakeCaseName $.Definitions}}` ({{- .PropertyName}}) - (string) {{.Comment}}{{if ne .NamedPropertyClass ""}}{{$RName := getResourceName .NamedPropertyClass $.Definitions}} This attribute can be referenced from a [resource](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/{{$RName}}) with `aci_{{$RName}}.example.name` or from a [datasource](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/data-sources/{{$RName}}) with `data.aci_{{$RName}}.example.name`.{{end}}{{if ne $childVersion .Versions}} This attribute is supported in ACI versions: {{ .Versions}}{{- end}} {{- end}} {{- end}} {{- end}}{{- end}} {{- if .HasOptionalProperties}} - - #### Optional #### + {{ $indent }}#### Optional #### {{ range .Properties}} {{- if and (not .IsNaming) (not .IsRequired)}} {{- if eq .ValueType "bitmask"}} - * `{{- overwriteProperty .PkgName .SnakeCaseName $.Definitions}}` ({{- .PropertyName}}) - (list) {{.Comment}}{{if ne $childVersion .Versions}} This attribute is supported in ACI versions: {{ .Versions}}{{- end}} + {{ $indent }}* `{{- overwriteProperty .PkgName .SnakeCaseName $.Definitions}}` ({{- .PropertyName}}) - (list) {{.Comment}}{{if ne $childVersion .Versions}} This attribute is supported in ACI versions: {{ .Versions}}{{- end}} {{- else}} - * `{{- overwriteProperty .PkgName .SnakeCaseName $.Definitions}}` ({{- .PropertyName}}) - (string) {{.Comment}}{{if ne $childVersion .Versions}} This attribute is supported in ACI versions: {{ .Versions}}{{- end}} + {{ $indent }}* `{{- overwriteProperty .PkgName .SnakeCaseName $.Definitions}}` ({{- .PropertyName}}) - (string) {{.Comment}}{{if ne $childVersion .Versions}} This attribute is supported in ACI versions: {{ .Versions}}{{- end}} {{- end}} {{- if .DefaultValue }} - - Default: `{{ .DefaultValue }}` + {{ $indent }}- Default: `{{ .DefaultValue }}` {{- end}} {{- if .ValidValues }}{{$i := 1}}{{$length := len .ValidValues}} - - Valid Values:{{ range .ValidValues}} `{{ . }}`{{ if ne $length $i}}{{$i = add $i 1}}, {{- else}}.{{- end}}{{- end}} + {{ $indent }}- Valid Values:{{ range .ValidValues}} `{{ . }}`{{ if ne $length $i}}{{$i = add $i 1}}, {{- else}}.{{- end}}{{- end}} {{- end}} {{- end}} {{- end}} {{- end}} -{{ end}} -## Importing - -An existing {{.ResourceNameAsDescription}} can be [imported](https://www.terraform.io/docs/import/index.html) into this resource with its distinguished name (DN), via the following command: - -``` -terraform import aci_{{- .ResourceName}}.example{{- if .DocumentationExamples}}_{{- $key := index .DocumentationExamples 0 }}{{getResourceName $key $.Definitions}}{{- end}} {{ index .DnFormats 0 }} -``` - -Starting in Terraform version 1.5, an existing {{.ResourceNameAsDescription}} can be imported -using [import blocks](https://developer.hashicorp.com/terraform/language/import) via the following configuration: - -``` -import { - id = "{{ index .DnFormats 0 }}" - to = aci_{{ .ResourceName}}.example{{- if .DocumentationExamples}}_{{- $key := index .DocumentationExamples 0 }}{{getResourceName $key $.Definitions}}{{- end}} -} -``` -{{ if .DocumentationChildren}} -## Child Resources - {{range .DocumentationChildren}} - - {{ . }} - {{- end}} -{{- end}} \ No newline at end of file +{{- range .Children }} + {{- $newCtx := addToTemplateProperties . "Indent" (print $indent " ") "Versions" $parentVersion }} + {{- template "childResourcesAndProperties" $newCtx }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/gen/templates/resource_example_all_attributes.tf.tmpl b/gen/templates/resource_example_all_attributes.tf.tmpl index 9535bd7d9..7b9dcd60b 100644 --- a/gen/templates/resource_example_all_attributes.tf.tmpl +++ b/gen/templates/resource_example_all_attributes.tf.tmpl @@ -12,49 +12,21 @@ resource "aci_{{$.ResourceName}}" "full_example_{{getResourceName $key $.Definit {{overwriteProperty .PkgName .SnakeCaseName $.Definitions}} = aci_{{getResourceName .NamedPropertyClass $.Definitions}}.example.name {{- else if eq .SnakeCaseName "t_dn" }}{{$attributeKey := overwriteProperty .PkgName .SnakeCaseName $.Definitions}} {{- range $index, $testParent := $.TestVars.parents }} - {{- if eq $index $parentIndex }}{{$attributeVale := getTestTargetDn $.TestVars.targets $.TestVars.resourceName "" true $testParent.target_classes $index true | replace "test" "example" | replace "_0" "" | replace "_1" "_2" }} - {{$attributeKey}} = {{if containsString $attributeVale "."}}{{$attributeVale}}{{else}}"{{$attributeVale}}"{{end}} + {{- if eq $index $parentIndex }}{{$attributeValue := getTestTargetDn $.TestVars.targets $.TestVars.resourceName "" true $testParent.target_classes $index true | replace "test" "example" | replace "_0" "" | replace "_1" "_2" }} + {{$attributeKey}} = {{if containsString $attributeValue "."}}{{$attributeValue}}{{else}}"{{$attributeValue}}"{{end}} {{- $parentIndex = add $parentIndex 1 }}{{- break}} {{- end}} {{- end}} {{- else if .IgnoreInTest}} - {{overwriteProperty .PkgName .SnakeCaseName $.Definitions}} = "{{.IgnoreInTestExampleValue}}" + {{overwriteProperty .PkgName .SnakeCaseName $.Definitions}} = {{.IgnoreInTestExampleValue}} {{- else if eq .ValueType "bitmask"}}{{ $bitmaskTestValue := lookupTestValue .PkgName .SnakeCaseName $.TestVars $.Definitions $.Properties}} {{overwriteProperty .PkgName .SnakeCaseName $.Definitions}} = [{{range $index, $value := $bitmaskTestValue}}{{if lt $index (subtract (len $bitmaskTestValue) 1)}}"{{$value}}",{{else}}"{{$value}}"{{end}}{{end}}] {{- else}} {{overwriteProperty .PkgName .SnakeCaseName $.Definitions}} = {{lookupTestValue .PkgName .SnakeCaseName $.TestVars $.Definitions $.Properties}} {{- end}}{{- end}}{{- end}} - {{- range $key, $value := $.Children}}{{$ChildResourceName := overwriteProperty .PkgName .ResourceName $.Definitions}} - {{- if or (not .IdentifiedBy) .MaxOneClassAllowed}} - {{$ChildResourceName}} = { - {{- range .Properties}}{{- if not .ReadOnly }}{{- if ne .NamedPropertyClass ""}} - {{overwriteProperty .PkgName .SnakeCaseName $.Definitions}} = aci_{{getResourceName .NamedPropertyClass $.Definitions}}.example.name - {{- else if eq .SnakeCaseName "t_dn" }} - {{- range $index, $testParent := $.TestVars.parents }}{{$attributeVale := getTestTargetDn $.TestVars.child_targets $ChildResourceName "target_dn_0" true nil 0 true | replace "test_0" "example_2" }} - target_dn = {{if containsString $attributeVale "."}}{{$attributeVale}}{{else}}"{{$attributeVale}}"{{end}} - {{- break}} - {{- end}} - {{- else if .IgnoreInTest}} - {{overwriteProperty .PkgName .SnakeCaseName $.Definitions}} = "{{.IgnoreInTestExampleValue}}" - {{- else}} - {{overwriteProperty .PkgName .SnakeCaseName $.Definitions}} = "{{lookupChildTestValue .PkgName $ChildResourceName .SnakeCaseName $.TestVars 0 $.Definitions}}"{{- end}}{{ end}}{{- end}} - } - {{- else}} - {{$ChildResourceName}} = [ - { {{- range .Properties}}{{- if not .ReadOnly }}{{- if ne .NamedPropertyClass ""}} - {{overwriteProperty .PkgName .SnakeCaseName $.Definitions}} = aci_{{getResourceName .NamedPropertyClass $.Definitions}}.example.name - {{- else if eq .SnakeCaseName "t_dn" }} - {{- range $index, $testParent := $.TestVars.parents }}{{$attributeVale := getTestTargetDn $.TestVars.child_targets $ChildResourceName "target_dn_0" true nil 0 true | replace "test_0" "example_2" }} - target_dn = {{if containsString $attributeVale "."}}{{$attributeVale}}{{else}}"{{$attributeVale}}"{{end}} - {{- break}} - {{- end}} - {{- else if .IgnoreInTest}} - {{overwriteProperty .PkgName .SnakeCaseName $.Definitions}} = "{{.IgnoreInTestExampleValue}}" - {{- else}} - {{overwriteProperty .PkgName .SnakeCaseName $.Definitions}} = "{{lookupChildTestValue .PkgName $ChildResourceName .SnakeCaseName $.TestVars 0 $.Definitions}}"{{- end}}{{ end}}{{- end}} - } - ] - {{- end}} + {{- range $key, $value := $.Children}} + {{- $newCtx := addToTemplateProperties . "TestVars" $.TestVars "Indent" "" -}} + {{- template "childResourcesAndPropertiesDocExamples" $newCtx }} {{- end}} } {{ end}} @@ -69,35 +41,13 @@ resource "aci_{{$.ResourceName}}" "full_example" { {{- else if eq .SnakeCaseName "t_dn" }} {{overwriteProperty .PkgName .SnakeCaseName $.Definitions}} = {{lookupTestValue .PkgName .SnakeCaseName $.TestVars $.Definitions $.Properties | replace ".test_0.id" ".example.id"}} {{- else if .IgnoreInTest}} - {{overwriteProperty .PkgName .SnakeCaseName $.Definitions}} = "{{.IgnoreInTestExampleValue}}" + {{overwriteProperty .PkgName .SnakeCaseName $.Definitions}} = {{.IgnoreInTestExampleValue}} {{- else}} {{overwriteProperty .PkgName .SnakeCaseName $.Definitions}} = {{lookupTestValue .PkgName .SnakeCaseName $.TestVars $.Definitions $.Properties}} {{- end}}{{- end}}{{- end}} - {{- range $key, $value := $.Children}}{{$ChildResourceName := overwriteProperty .PkgName .ResourceName $.Definitions}} - {{- if or (not .IdentifiedBy) .MaxOneClassAllowed}} - {{$ChildResourceName}} = { - {{- range .Properties}}{{- if not .ReadOnly }}{{- if ne .NamedPropertyClass ""}} - {{overwriteProperty .PkgName .SnakeCaseName $.Definitions}} = aci_{{getResourceName .NamedPropertyClass $.Definitions}}.example.name - {{- else if eq .SnakeCaseName "t_dn" }}{{$attributeVale := getTestTargetDn $.TestVars.child_targets $ChildResourceName "target_dn_0" true nil 0 true | replace "test_0" "example_2" }} - target_dn = {{if containsString $attributeVale "."}}{{$attributeVale}}{{else}}"{{$attributeVale}}"{{end}} - {{- else if .IgnoreInTest}} - {{overwriteProperty .PkgName .SnakeCaseName $.Definitions}} = "{{.IgnoreInTestExampleValue}}" - {{- else}} - {{overwriteProperty .PkgName .SnakeCaseName $.Definitions}} = "{{lookupChildTestValue .PkgName $ChildResourceName .SnakeCaseName $.TestVars 0 $.Definitions}}"{{- end}}{{ end}}{{- end}} - } - {{- else}} - {{$ChildResourceName}} = [ - { {{- range .Properties}}{{- if not .ReadOnly }}{{- if ne .NamedPropertyClass ""}} - {{overwriteProperty .PkgName .SnakeCaseName $.Definitions}} = aci_{{getResourceName .NamedPropertyClass $.Definitions}}.example.name - {{- else if eq .SnakeCaseName "t_dn" }}{{$attributeVale := getTestTargetDn $.TestVars.child_targets $ChildResourceName "target_dn_0" true nil 0 true | replace "test_0" "example_2" }} - target_dn = {{if containsString $attributeVale "."}}{{$attributeVale}}{{else}}"{{$attributeVale}}"{{end}} - {{- else if .IgnoreInTest}} - {{overwriteProperty .PkgName .SnakeCaseName $.Definitions}} = "{{.IgnoreInTestExampleValue}}" - {{- else}} - {{overwriteProperty .PkgName .SnakeCaseName $.Definitions}} = "{{lookupChildTestValue .PkgName $ChildResourceName .SnakeCaseName $.TestVars 0 $.Definitions}}"{{- end}}{{ end}}{{- end}} - } - ] - {{- end}} + {{- range $key, $value := $.Children}} + {{- $newCtx := addToTemplateProperties . "TestVars" $.TestVars "Indent" "" -}} + {{- template "childResourcesAndProperties" $newCtx }} {{- end}} } {{ end}} @@ -124,11 +74,99 @@ resource "aci_{{$topContext.ResourceName}}" {{- if ne $formatValue.ContainedBy " { {{- range .Properties}}{{- if ne .NamedPropertyClass ""}} {{overwriteProperty .PkgName .SnakeCaseName $.Definitions}} = aci_{{getResourceName .NamedPropertyClass $.Definitions}}.example.name {{- else}} - {{overwriteProperty .PkgName .SnakeCaseName $.Definitions}} = "{{lookupChildTestValue .PkgName $ChildResourceName .SnakeCaseName $.TestVars 0 $.Definitions}}"{{- end}}{{ end}} + {{overwriteProperty .PkgName .SnakeCaseName $.Definitions}} = {{lookupChildTestValue .PkgName $ChildResourceName .SnakeCaseName $.TestVars 0 $.Definitions}}{{- end}}{{ end}} + {{- range $key, $value := $.Children}} + {{- $newCtx := addToTemplateProperties . "TestVars" $.TestVars "Indent" "" -}} + {{- template "childResourcesAndProperties" $newCtx }} + {{- end}} } ] {{- end}} } {{- println }} {{- end -}} -{{- end}} \ No newline at end of file +{{- end}} + +{{- /* A sub template for including nested children in the examples from Documentation Examples. */}} +{{- define "childResourcesAndPropertiesDocExamples" -}} +{{- $testvars := .TemplateProperties.TestVars -}} +{{- $indent := .TemplateProperties.Indent -}} +{{$ChildResourceName := overwriteProperty .PkgName .ResourceName $.Definitions}} + {{- if or (not .IdentifiedBy) .MaxOneClassAllowed}} + {{ $indent }}{{$ChildResourceName}} = { + {{- range .Properties}}{{- if not .ReadOnly }}{{- if ne .NamedPropertyClass ""}} + {{ $indent }}{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}} = aci_{{getResourceName .NamedPropertyClass $.Definitions}}.example.name + {{- else if eq .SnakeCaseName "t_dn" }} + {{- range $index, $testParent := $testvars.parents }}{{$attributeValue := getTestTargetDn $testvars.child_targets $ChildResourceName "target_dn_0" true nil 0 true | replace "test_0" "example_2" }} + {{ $indent }}target_dn = {{if containsString $attributeValue "."}}{{$attributeValue}}{{else}}"{{$attributeValue}}"{{end}} + {{- break}} + {{- end}} + {{- else if .IgnoreInTest}} + {{ $indent }}{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}} = {{.IgnoreInTestExampleValue}} + {{- else}} + {{ $indent }}{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}} = {{lookupChildTestValue .PkgName $ChildResourceName .SnakeCaseName $testvars 0 $.Definitions}}{{- end}}{{ end}}{{- end}} + {{- range $key, $value := $.Children}} + {{- $newCtx := addToTemplateProperties . "TestVars" $testvars "Indent" (print $indent " ") -}} + {{- template "childResourcesAndPropertiesDocExamples" $newCtx }} + {{- end}} + {{ $indent }}} + {{- else}} + {{ $indent }}{{$ChildResourceName}} = [ + {{ $indent }}{ {{- range .Properties}}{{- if not .ReadOnly }}{{- if ne .NamedPropertyClass ""}} + {{ $indent }}{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}} = aci_{{getResourceName .NamedPropertyClass $.Definitions}}.example.name + {{- else if eq .SnakeCaseName "t_dn" }} + {{- range $index, $testParent := $testvars.parents }}{{$attributeValue := getTestTargetDn $testvars.child_targets $ChildResourceName "target_dn_0" true nil 0 true | replace "test_0" "example_2" }} + {{ $indent }}target_dn = {{if containsString $attributeValue "."}}{{$attributeValue}}{{else}}"{{$attributeValue}}"{{end}} + {{- break}} + {{- end}} + {{- else if .IgnoreInTest}} + {{ $indent }}{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}} = {{.IgnoreInTestExampleValue}} + {{- else}} + {{ $indent }}{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}} = {{lookupChildTestValue .PkgName $ChildResourceName .SnakeCaseName $testvars 0 $.Definitions}}{{- end}}{{ end}}{{- end}} + {{- range $key, $value := $.Children}} + {{- $newCtx := addToTemplateProperties . "TestVars" $testvars "Indent" (print $indent " ") -}} + {{- template "childResourcesAndPropertiesDocExamples" $newCtx }} + {{- end}} + {{ $indent }}} + {{ $indent }}] +{{- end}} +{{- end}} + +{{- /* A sub template for including nested children in the examples. */}} +{{- define "childResourcesAndProperties" -}} +{{- $testvars := .TemplateProperties.TestVars -}} +{{- $indent := .TemplateProperties.Indent -}} +{{$ChildResourceName := overwriteProperty .PkgName .ResourceName $.Definitions}} + {{- if or (not .IdentifiedBy) .MaxOneClassAllowed}} + {{ $indent }}{{$ChildResourceName}} = { + {{- range .Properties}}{{- if not .ReadOnly }}{{- if ne .NamedPropertyClass ""}} + {{ $indent }}{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}} = aci_{{getResourceName .NamedPropertyClass $.Definitions}}.example.name + {{- else if eq .SnakeCaseName "t_dn" }}{{$attributeValue := getTestTargetDn $testvars.child_targets $ChildResourceName "target_dn_0" true nil 0 true | replace "test_0" "example_2" }} + {{ $indent }}target_dn = {{if containsString $attributeValue "."}}{{$attributeValue}}{{else if eq $attributeValue ""}}{{lookupChildTestValue .PkgName $ChildResourceName .SnakeCaseName $testvars 0 $.Definitions}}{{else}}"{{$attributeValue}}"{{end}} + {{- else if .IgnoreInTest}} + {{ $indent }}{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}} = {{.IgnoreInTestExampleValue}} + {{- else}} + {{ $indent }}{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}} = {{lookupChildTestValue .PkgName $ChildResourceName .SnakeCaseName $testvars 0 $.Definitions}}{{- end}}{{ end}}{{- end}} + {{- range $key, $value := $.Children}} + {{- $newCtx := addToTemplateProperties . "TestVars" $testvars "Indent" (print $indent " ") -}} + {{- template "childResourcesAndProperties" $newCtx }} + {{- end}} + {{ $indent }}} + {{- else}} + {{ $indent }}{{$ChildResourceName}} = [ + {{ $indent }}{ {{- range .Properties}}{{- if not .ReadOnly }}{{- if ne .NamedPropertyClass ""}} + {{ $indent }}{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}} = aci_{{getResourceName .NamedPropertyClass $.Definitions}}.example.name + {{- else if eq .SnakeCaseName "t_dn" }}{{$attributeValue := getTestTargetDn $testvars.child_targets $ChildResourceName "target_dn_0" true nil 0 true | replace "test_0" "example_2" }} + {{ $indent }}target_dn = {{if containsString $attributeValue "."}}{{$attributeValue}}{{else if eq $attributeValue ""}}{{lookupChildTestValue .PkgName $ChildResourceName .SnakeCaseName $testvars 0 $.Definitions}}{{else}}"{{$attributeValue}}"{{end}} + {{- else if .IgnoreInTest}} + {{ $indent }}{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}} = {{.IgnoreInTestExampleValue}} + {{- else}} + {{ $indent }}{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}} = {{lookupChildTestValue .PkgName $ChildResourceName .SnakeCaseName $testvars 0 $.Definitions}}{{- end}}{{ end}}{{- end}} + {{- range $key, $value := $.Children}} + {{- $newCtx := addToTemplateProperties . "TestVars" $testvars "Indent" (print $indent " ") -}} + {{- template "childResourcesAndProperties" $newCtx }} + {{- end}} + {{ $indent }}} + {{ $indent }}] + {{- end}} + {{- end}} \ No newline at end of file diff --git a/gen/templates/resource_test.go.tmpl b/gen/templates/resource_test.go.tmpl index a47215289..20f3f9fff 100644 --- a/gen/templates/resource_test.go.tmpl +++ b/gen/templates/resource_test.go.tmpl @@ -11,14 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-testing/helper/resource" ) -{{$single_nested_children := false}} -{{- range $key, $value := $.children}} - {{- if eq (len $value) 1}}{{- $child := index $value 0 }} - {{- if $child.deletable_child}} - {{- $single_nested_children = true}} - {{- end}} - {{- end}} -{{- end}} +{{$single_nested_children := checkDeletableChild $.children}} {{- if .parents}} {{- range .parents}}{{$target_classes := .target_classes}} {{- $parentClassName := capitalize .class_name }} @@ -49,7 +42,7 @@ PreCheck: func() { testAccPreCheck(t, "{{.test_type}}", "{{$.class_version}}") } {{- range $key, $value := $.default}} {{- if eq $key "version_mismatch" }} {{- range $version, $attributes := $value }} - composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">",{{- range $attributeName, $attributeValue := $attributes}} + composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">=",{{- range $attributeName, $attributeValue := $attributes}} {{- if not (definedInList $.exclude_attributes $attributeName) }} {{- if (isInterfaceSlice $attributeValue)}} resource.TestCheckResourceAttr("aci_{{$.resourceName}}.allow_test", "{{$attributeName}}.#", "{{len $attributeValue}}"), @@ -128,7 +121,7 @@ PreCheck: func() { testAccPreCheck(t, "{{.test_type}}", "{{$.class_version}}") } {{- range $key, $value := $.default}} {{- if eq $key "version_mismatch" }} {{- range $version, $attributes := $value }} - composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">",{{- range $attributeName, $attributeValue := $attributes}} + composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">=",{{- range $attributeName, $attributeValue := $attributes}} {{- if not (definedInList $.exclude_attributes $attributeName) }} {{- if (isInterfaceSlice $attributeValue)}} resource.TestCheckResourceAttr("aci_{{$.resourceName}}.allow_test", "{{$attributeName}}.#", "{{len $attributeValue}}"), @@ -192,7 +185,7 @@ PreCheck: func() { testAccPreCheck(t, "{{.test_type}}", "{{$.class_version}}") } {{- range $key, $value := $.default}} {{- if eq $key "version_mismatch" }} {{- range $version, $attributes := $value }} - composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">",{{- range $attributeName, $attributeValue := $attributes}} + composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">=",{{- range $attributeName, $attributeValue := $attributes}} {{- if not (definedInList $.exclude_attributes $attributeName) }} {{- if (isInterfaceSlice $attributeValue)}} resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}", "{{$attributeName}}.#", "{{len $attributeValue}}"), @@ -242,7 +235,7 @@ PreCheck: func() { testAccPreCheck(t, "{{.test_type}}", "{{$.class_version}}") } {{- range $key, $value := $.all}} {{- if eq $key "version_mismatch" }} {{- range $version, $attributes := $value }} - composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">",{{- range $attributeName, $attributeValue := $attributes}} + composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">=",{{- range $attributeName, $attributeValue := $attributes}} {{- if not (definedInList $.exclude_attributes $attributeName) }} {{- if (isInterfaceSlice $attributeValue)}} resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}", "{{$attributeName}}.#", "{{len $attributeValue}}"), @@ -323,7 +316,7 @@ PreCheck: func() { testAccPreCheck(t, "{{.test_type}}", "{{$.class_version}}") } {{- range $key, $value := $.default}} {{- if eq $key "version_mismatch" }} {{- range $version, $attributes := $value }} - composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">",{{- range $attributeName, $attributeValue := $attributes}} + composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">=",{{- range $attributeName, $attributeValue := $attributes}} {{- $contains := definedInMap $attributeName $.resource_required}} {{- if not $contains}} {{- if not (definedInList $.exclude_attributes $attributeName) }} @@ -390,7 +383,7 @@ PreCheck: func() { testAccPreCheck(t, "{{.test_type}}", "{{$.class_version}}") } {{- range $key, $value := $.default}} {{- if eq $key "version_mismatch" }} {{- range $version, $attributes := $value }} - composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">",{{- range $attributeName, $attributeValue := $attributes}} + composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">=",{{- range $attributeName, $attributeValue := $attributes}} {{- $contains := definedInMap $attributeName $.resource_required}} {{- if not $contains}} {{- if not (definedInList $.exclude_attributes $attributeName) }} @@ -429,15 +422,29 @@ PreCheck: func() { testAccPreCheck(t, "{{.test_type}}", "{{$.class_version}}") } {{- if eq (len $value) 1}} {{- range $child_index, $child := $value}} {{- range $child_key, $child_value := $child}} - {{- if eq $child_key "version_mismatch" }} + {{- if eq $child_key "children"}} + {{- $newCtx := addToChild $child_value "ResourceName" (print "aci_" $.resourceName ".test") "InheritedKey" (print $key) -}} + {{- template "testNestedChildren" $newCtx }} + {{- else if eq $child_key "version_mismatch" }} {{- range $version, $attributes := $child_value }} - composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">",{{- range $attributeName, $attributeValue := $attributes}} + composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">=",{{- range $attributeName, $attributeValue := $attributes}} + {{- if (isInterfaceSlice $attributeValue)}} + resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}", "{{$attributeName}}.#", "{{len $attributeValue}}"), + {{- range $index, $subvalue := $attributeValue}} + resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}", "{{$attributeName}}.{{$index}}", "{{$subvalue}}"), + {{- end}} + {{- else}} resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}.{{$attributeName}}", "{{$attributeValue}}"), - {{- end }}), + {{- end }}{{- end }}), {{- end }} {{- else }} {{- if eq $child_key "target_dn"}} - resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}.{{$child_key}}", "{{getTestTargetDn $.child_targets $key $child_value false nil $child_index false }}"), + resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}.{{$child_key}}", "{{getTestTargetDn $.child_targets $key $child_value false nil $child_index false }}"), + {{- else if (isInterfaceSlice $child_value)}} + resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}.{{$child_key}}.#", "{{len $child_value}}"), + {{- range $index, $subvalue := $child_value}} + resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}.{{$child_key}}.{{$index}}", "{{$subvalue}}"), + {{- end}} {{- else if ne $child_key "deletable_child"}} resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}.{{$child_key}}", "{{$child_value}}"), {{- end}} @@ -447,9 +454,12 @@ PreCheck: func() { testAccPreCheck(t, "{{.test_type}}", "{{$.class_version}}") } {{- else}} {{- range $child_index, $child := $value}} {{- range $child_key, $child_value := $child}} - {{- if eq $child_key "version_mismatch" }} + {{- if eq $child_key "children"}} + {{- $newCtx := addToChild $child_value "ResourceName" (print "aci_" $.resourceName ".test") "InheritedKey" (print $key "." $child_index) "ResourceClassName" $.resourceClassName "ParentClassName" $parentClassName -}} + {{- template "testNestedChildren" $newCtx }} + {{- else if eq $child_key "version_mismatch" }} {{- range $version, $attributes := $child_value }} - composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">",{{- range $attributeName, $attributeValue := $attributes}} + composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">=",{{- range $attributeName, $attributeValue := $attributes}} resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}", "{{$key}}.{{$child_index}}.{{$attributeName}}", "{{$attributeValue}}"), {{- end }}), {{- end }} @@ -494,7 +504,7 @@ PreCheck: func() { testAccPreCheck(t, "{{.test_type}}", "{{$.class_version}}") } {{- range $key, $value := .default}} {{- if eq $key "version_mismatch" }} {{- range $version, $attributes := $value }} - composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">",{{- range $attributeName, $attributeValue := $attributes}} + composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">=",{{- range $attributeName, $attributeValue := $attributes}} {{- $contains := definedInMap $attributeName $.resource_required}} {{- if not $contains}} {{- if (isInterfaceSlice $attributeValue)}} @@ -530,15 +540,29 @@ PreCheck: func() { testAccPreCheck(t, "{{.test_type}}", "{{$.class_version}}") } {{- if eq (len $value) 1}} {{- range $child_index, $child := $value}} {{- range $child_key, $child_value := $child}} - {{- if eq $child_key "version_mismatch" }} + {{- if eq $child_key "children"}} + {{- $newCtx := addToChild $child_value "ResourceName" (print "aci_" $.resourceName ".test") "InheritedKey" (print $key) "ResourceClassName" $.resourceClassName "ParentClassName" $parentClassName -}} + {{- template "testNestedChildrenRemovedFromConfig" $newCtx }} + {{- else if eq $child_key "version_mismatch" }} {{- range $version, $attributes := $child_value }} - composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">",{{- range $attributeName, $attributeValue := $attributes}} + composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">=",{{- range $attributeName, $attributeValue := $attributes}} + {{- if (isInterfaceSlice $attributeValue)}} + resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}", "{{$attributeName}}.#", "{{len $attributeValue}}"), + {{- range $index, $subvalue := $attributeValue}} + resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}", "{{$attributeName}}.{{$index}}", "{{$subvalue}}"), + {{- end}} + {{- else}} resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}", "{{$key}}.{{$attributeName}}", "{{$attributeValue}}"), - {{- end }}), + {{- end }}{{- end }}), {{- end }} {{- else }} {{- if eq $child_key "target_dn"}} - resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}", "{{$key}}.{{$child_key}}", "{{getTestTargetDn $.child_targets $key $child_value false nil $child_index false}}"), + resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}", "{{$key}}.{{$child_key}}", "{{getTestTargetDn $.child_targets $key $child_value false nil $child_index false}}"), + {{- else if (isInterfaceSlice $child_value)}} + resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}", "{{$key}}.{{$child_key}}.#", "{{len $child_value}}"), + {{- range $index, $subvalue := $child_value}} + resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}", "{{$key}}.{{$child_key}}.{{$index}}", "{{$subvalue}}"), + {{- end}} {{- else if ne $child_key "deletable_child"}} resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}", "{{$key}}.{{$child_key}}", "{{$child_value}}"), {{- end}} @@ -548,9 +572,12 @@ PreCheck: func() { testAccPreCheck(t, "{{.test_type}}", "{{$.class_version}}") } {{- else}} {{- range $child_index, $child := $value}} {{- range $child_key, $child_value := $child}} - {{- if eq $child_key "version_mismatch" }} + {{- if eq $child_key "children"}} + {{- $newCtx := addToChild $child_value "ResourceName" (print "aci_" $.resourceName ".test") "InheritedKey" (print $key "." $child_index) "ResourceClassName" $.resourceClassName "ParentClassName" $parentClassName -}} + {{- template "testNestedChildrenRemovedFromConfig" $newCtx }} + {{- else if eq $child_key "version_mismatch" }} {{- range $version, $attributes := $child_value }} - composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">",{{- range $attributeName, $attributeValue := $attributes}} + composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">=",{{- range $attributeName, $attributeValue := $attributes}} resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}", "{{$key}}.{{$child_index}}.{{$attributeName}}", "{{$attributeValue}}"), {{- end }}), {{- end }} @@ -579,7 +606,7 @@ PreCheck: func() { testAccPreCheck(t, "{{.test_type}}", "{{$.class_version}}") } {{- range $key, $value := .default}} {{- if eq $key "version_mismatch" }} {{- range $version, $attributes := $value }} - composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">",{{- range $attributeName, $attributeValue := $attributes}} + composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">=",{{- range $attributeName, $attributeValue := $attributes}} {{- $contains := definedInMap $attributeName $.resource_required}} {{- if not $contains}} resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}", "{{$attributeName}}", "{{$attributeValue}}"), @@ -600,15 +627,29 @@ PreCheck: func() { testAccPreCheck(t, "{{.test_type}}", "{{$.class_version}}") } {{- if eq (len $value) 1}}{{- $child := index $value 0 }} {{- if not $child.deletable_child}} {{- range $child_key, $child_value := $child}} - {{- if eq $child_key "version_mismatch" }} + {{- if eq $child_key "children"}} + {{- $newCtx := addToChild $child_value "ResourceName" (print "aci_" $.resourceName ".test") "InheritedKey" (print $key) "ResourceClassName" $.resourceClassName "ParentClassName" $parentClassName -}} + {{- template "testNestedChildrenWithFirstChilRemoved" $newCtx }} + {{- else if eq $child_key "version_mismatch" }} {{- range $version, $attributes := $child_value }} - composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">",{{- range $attributeName, $attributeValue := $attributes}} + composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">=",{{- range $attributeName, $attributeValue := $attributes}} + {{- if (isInterfaceSlice $attributeValue)}} + resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}", "{{$attributeName}}.#", "{{len $attributeValue}}"), + {{- range $index, $subvalue := $attributeValue}} + resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}", "{{$attributeName}}.{{$index}}", "{{$subvalue}}"), + {{- end}} + {{- else}} resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}", "{{$key}}.{{$attributeName}}", "{{$attributeValue}}"), - {{- end }}), + {{- end }}{{- end }}), {{- end }} {{- else }} {{- if eq $child_key "target_dn"}} - resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}", "{{$key}}.{{$child_key}}", "{{getTestTargetDn $.child_targets $key $child_value false nil 0 false}}"), + resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}", "{{$key}}.{{$child_key}}", "{{getTestTargetDn $.child_targets $key $child_value false nil 0 false}}"), + {{- else if (isInterfaceSlice $child_value)}} + resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}", "{{$key}}.{{$child_key}}.#", "{{len $child_value}}"), + {{- range $index, $subvalue := $child_value}} + resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}", "{{$key}}.{{$child_key}}.{{$index}}", "{{$subvalue}}"), + {{- end}} {{- else if ne $child_key "deletable_child"}} resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}", "{{$key}}.{{$child_key}}", "{{$child_value}}"), {{- end}} @@ -618,9 +659,12 @@ PreCheck: func() { testAccPreCheck(t, "{{.test_type}}", "{{$.class_version}}") } {{- else}} {{- $child := index $value 1 }} {{- range $child_key, $child_value := $child}} - {{- if eq $child_key "version_mismatch" }} + {{- if eq $child_key "children"}} + {{- $newCtx := addToChild $child_value "ResourceName" (print "aci_" $.resourceName ".test") "InheritedKey" (print $key "." 0) "ResourceClassName" $.resourceClassName "ParentClassName" $parentClassName -}} + {{- template "testNestedChildrenWithFirstChilRemoved" $newCtx }} + {{- else if eq $child_key "version_mismatch" }} {{- range $version, $attributes := $child_value }} - composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">",{{- range $attributeName, $attributeValue := $attributes}} + composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">=",{{- range $attributeName, $attributeValue := $attributes}} resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}", "{{$key}}.0.{{$attributeName}}", "{{$attributeValue}}"), {{- end }}), {{- end }} @@ -639,6 +683,7 @@ PreCheck: func() { testAccPreCheck(t, "{{.test_type}}", "{{$.class_version}}") } {{- if $single_nested_children}} ConfigStateChecks: []statecheck.StateCheck{ {{- range $key, $value := $.children}} + {{- $newCtx := emptyChild -}} {{- if eq (len $value) 1}}{{- $child := index $value 0 }} {{- if $child.deletable_child}} statecheck.ExpectKnownValue("aci_{{$.resourceName}}.test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}", @@ -646,7 +691,7 @@ PreCheck: func() { testAccPreCheck(t, "{{.test_type}}", "{{$.class_version}}") } knownvalue.MapExact( map[string]knownvalue.Check{ {{- range $child_key, $child_value := $child}} - {{- if and (ne $child_key "deletable_child") (ne $child_key "version_mismatch")}} + {{- if and (ne $child_key "deletable_child") (ne $child_key "version_mismatch") (ne $child_key "children") }} "{{$child_key}}": knownvalue.Null(), {{- else if eq $child_key "version_mismatch"}} {{- range $version, $attributes := $child_value }} @@ -654,13 +699,27 @@ PreCheck: func() { testAccPreCheck(t, "{{.test_type}}", "{{$.class_version}}") } "{{$attributeName}}" : knownvalue.Null(), {{- end}} {{- end}} + {{- else if eq $child_key "children"}} + {{- range $key, $value := $child_value}} + {{- if gt (len $value) 1}} + "{{$key}}": knownvalue.Null(), + {{- end}} + {{- end}} {{- end}} {{- end}} }, ), ), {{- end}} + {{- range $child_key, $child_value := $child}} + {{- if eq $child_key "children"}} + {{- if checkDeletableChild $child_value }} + {{- $newCtx = addToChild $child_value "ResourceName" (print "aci_" $.resourceName ".test") "InheritedKey" (print "tfjsonpath.New(\"" $key "\")") "ResourceClassName" $.resourceClassName "ParentClassName" $parentClassName -}} + {{- end}} + {{- end}} + {{- end}} {{- end}} + {{- template "singleNestedChildrenDeletionCheck" $newCtx }} {{- end}} }, @@ -677,7 +736,7 @@ PreCheck: func() { testAccPreCheck(t, "{{.test_type}}", "{{$.class_version}}") } {{- range $key, $value := .default}} {{- if eq $key "version_mismatch" }} {{- range $version, $attributes := $value }} - composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">",{{- range $attributeName, $attributeValue := $attributes}} + composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">=",{{- range $attributeName, $attributeValue := $attributes}} {{- $contains := definedInMap $attributeName $.resource_required}} {{- if not $contains}} resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$attributeName}}", "{{$attributeValue}}"), @@ -698,14 +757,28 @@ PreCheck: func() { testAccPreCheck(t, "{{.test_type}}", "{{$.class_version}}") } {{- if eq (len $value) 1}}{{- $child := index $value 0 }} {{- if not $child.deletable_child}} {{- range $child_key, $child_value := $child}} - {{- if eq $child_key "version_mismatch" }} + {{- if eq $child_key "children"}} + {{- $newCtx := addToChild $child_value "ResourceName" (print "aci_" $.resourceName ".test") "InheritedKey" (print $key) "ResourceClassName" $.resourceClassName "ParentClassName" $parentClassName -}} + {{- template "testNestedChildrenAllChildrenRemoved" $newCtx }} + {{- else if eq $child_key "version_mismatch" }} {{- range $version, $attributes := $child_value }} - composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">",{{- range $attributeName, $attributeValue := $attributes}} + composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">=",{{- range $attributeName, $attributeValue := $attributes}} + {{- if (isInterfaceSlice $attributeValue)}} + resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}", "{{$attributeName}}.#", "{{len $attributeValue}}"), + {{- range $index, $subvalue := $attributeValue}} + resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}", "{{$attributeName}}.{{$index}}", "{{$subvalue}}"), + {{- end}} + {{- else}} resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}", "{{$key}}.{{$attributeName}}", "{{$attributeValue}}"), - {{- end }}), + {{- end }}{{- end }}), {{- end }} {{- else }} - {{- if ne $child_key "deletable_child"}} + {{- if (isInterfaceSlice $child_value)}} + resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}", "{{$key}}.{{$child_key}}.#", "{{len $child_value}}"), + {{- range $index, $subvalue := $child_value}} + resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}", "{{$key}}.{{$child_key}}.{{$index}}", "{{$subvalue}}"), + {{- end}} + {{- else if ne $child_key "deletable_child"}} resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}", "{{$key}}.{{$child_key}}", "{{$child_value}}"), {{- end}} {{- end}} @@ -719,6 +792,7 @@ PreCheck: func() { testAccPreCheck(t, "{{.test_type}}", "{{$.class_version}}") } {{- if $single_nested_children}} ConfigStateChecks: []statecheck.StateCheck{ {{- range $key, $value := $.children}} + {{- $newCtx := emptyChild -}} {{- if eq (len $value) 1}}{{- $child := index $value 0 }} {{- if $child.deletable_child}} statecheck.ExpectKnownValue("aci_{{$.resourceName}}.test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}", @@ -726,7 +800,7 @@ PreCheck: func() { testAccPreCheck(t, "{{.test_type}}", "{{$.class_version}}") } knownvalue.MapExact( map[string]knownvalue.Check{ {{- range $child_key, $child_value := $child}} - {{- if and (ne $child_key "deletable_child") (ne $child_key "version_mismatch")}} + {{- if and (ne $child_key "deletable_child") (ne $child_key "version_mismatch") (ne $child_key "children")}} "{{$child_key}}": knownvalue.Null(), {{- else if eq $child_key "version_mismatch"}} {{- range $version, $attributes := $child_value }} @@ -734,13 +808,27 @@ PreCheck: func() { testAccPreCheck(t, "{{.test_type}}", "{{$.class_version}}") } "{{$attributeName}}" : knownvalue.Null(), {{- end}} {{- end}} + {{- else if eq $child_key "children"}} + {{- range $key, $value := $child_value}} + {{- if gt (len $value) 1}} + "{{$key}}": knownvalue.Null(), + {{- end}} + {{- end}} {{- end}} {{- end}} }, ), ), {{- end}} - {{- end}} + {{- range $child_key, $child_value := $child}} + {{- if eq $child_key "children"}} + {{- if checkDeletableChild $child_value }} + {{- $newCtx = addToChild $child_value "ResourceName" (print "aci_" $.resourceName ".test") "InheritedKey" (print "tfjsonpath.New(\"" $key "\")") "ResourceClassName" $.resourceClassName "ParentClassName" $parentClassName -}} + {{- end}} + {{- end}} + {{- end}} + {{- end}} + {{- template "singleNestedChildrenDeletionCheck" $newCtx }} {{- end}} }, @@ -792,7 +880,7 @@ func TestAccResource{{.resourceClassName}}(t *testing.T) { {{- range $key, $value := $.default}} {{- if eq $key "version_mismatch" }} {{- range $version, $attributes := $value }} - composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">",{{- range $attributeName, $attributeValue := $attributes}} + composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">=",{{- range $attributeName, $attributeValue := $attributes}} resource.TestCheckResourceAttr("aci_{{$.resourceName}}.allow_test", "{{$attributeName}}", "{{$attributeValue}}"), resource.TestCheckResourceAttr("aci_{{$.resourceName}}.allow_test_2", "{{$attributeName}}", "{{$attributeValue}}"), {{- end}}), @@ -846,7 +934,7 @@ func TestAccResource{{.resourceClassName}}(t *testing.T) { {{- range $key, $value := $.default}} {{- if eq $key "version_mismatch" }} {{- range $version, $attributes := $value }} - composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">",{{- range $attributeName, $attributeValue := $attributes}} + composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">=",{{- range $attributeName, $attributeValue := $attributes}} resource.TestCheckResourceAttr("aci_{{$.resourceName}}.allow_test", "{{$attributeName}}", "{{$attributeValue}}"), resource.TestCheckResourceAttr("aci_{{$.resourceName}}.allow_test_2", "{{$attributeName}}", "{{$attributeValue}}"), {{- end}}), @@ -884,7 +972,7 @@ func TestAccResource{{.resourceClassName}}(t *testing.T) { {{- range $key, $value := .default}} {{- if eq $key "version_mismatch" }} {{- range $version, $attributes := $value }} - composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">",{{- range $attributeName, $attributeValue := $attributes}} + composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">=",{{- range $attributeName, $attributeValue := $attributes}} {{- if (isInterfaceSlice $attributeValue)}} resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$attributeName}}.#", "{{len $attributeValue}}"), {{- range $index, $subvalue := $attributeValue}} @@ -927,7 +1015,7 @@ func TestAccResource{{.resourceClassName}}(t *testing.T) { {{- range $key, $value := .all}} {{- if eq $key "version_mismatch" }} {{- range $version, $attributes := $value }} - composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">",{{- range $attributeName, $attributeValue := $attributes}} + composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">=",{{- range $attributeName, $attributeValue := $attributes}} {{- if not (definedInList $.exclude_attributes $attributeName) }} {{- if (isInterfaceSlice $attributeValue)}} resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$attributeName}}.#", "{{len $attributeValue}}"), @@ -973,7 +1061,7 @@ func TestAccResource{{.resourceClassName}}(t *testing.T) { {{- if ne $key "annotation"}} {{- if eq $key "version_mismatch" }} {{- range $version, $attributes := $value }} - composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">",{{- range $attributeName, $attributeValue := $attributes}} + composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">=",{{- range $attributeName, $attributeValue := $attributes}} {{- if not (definedInList $.exclude_attributes $attributeName) }} {{- if (isInterfaceSlice $attributeValue)}} resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$attributeName}}.#", "{{len $attributeValue}}"), @@ -1023,7 +1111,7 @@ func TestAccResource{{.resourceClassName}}(t *testing.T) { {{- range $key, $value := $.default}} {{- if eq $key "version_mismatch" }} {{- range $version, $attributes := $value }} - composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">",{{- range $attributeName, $attributeValue := $attributes}} + composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">=",{{- range $attributeName, $attributeValue := $attributes}} {{- $contains := definedInMap $attributeName $.resource_required}} {{- if not $contains}} {{- if (isInterfaceSlice $attributeValue)}} @@ -1077,7 +1165,7 @@ func TestAccResource{{.resourceClassName}}(t *testing.T) { {{- range $key, $value := .default}} {{- if eq $key "version_mismatch" }} {{- range $version, $attributes := $value }} - composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">",{{- range $attributeName, $attributeValue := $attributes}} + composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">=",{{- range $attributeName, $attributeValue := $attributes}} {{- $contains := definedInMap $attributeName $.resource_required}} {{- if not $contains}} {{- if (isInterfaceSlice $attributeValue)}} @@ -1112,15 +1200,29 @@ func TestAccResource{{.resourceClassName}}(t *testing.T) { {{- if eq (len $value) 1}} {{- range $child_index, $child := $value}} {{- range $child_key, $child_value := $child}} - {{- if eq $child_key "version_mismatch" }} + {{- if eq $child_key "children"}} + {{- $newCtx := addToChild $child_value "ResourceName" (print "aci_" $.resourceName ".test") "InheritedKey" (print $key) -}} + {{- template "testNestedChildrenWithNoParent" $newCtx }} + {{- else if eq $child_key "version_mismatch" }} {{- range $version, $attributes := $child_value }} - composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">",{{- range $attributeName, $attributeValue := $attributes}} + composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">=",{{- range $attributeName, $attributeValue := $attributes}} + {{- if (isInterfaceSlice $attributeValue)}} + resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$attributeName}}.#", "{{len $attributeValue}}"), + {{- range $index, $subvalue := $attributeValue}} + resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$attributeName}}.{{$index}}", "{{$subvalue}}"), + {{- end}} + {{- else}} resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}.{{$attributeName}}", "{{$attributeValue}}"), - {{- end }}), + {{- end }}{{- end }}), {{- end }} {{- else }} {{- if eq $child_key "target_dn"}} resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}.{{$child_key}}", "{{getTestTargetDn $.child_targets $key $child_value false nil $child_index false}}"), + {{- else if (isInterfaceSlice $child_value)}} + resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}.{{$child_key}}.#", "{{len $child_value}}"), + {{- range $index, $subvalue := $child_value}} + resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}.{{$child_key}}.{{$index}}", "{{$subvalue}}"), + {{- end}} {{- else if ne $child_key "deletable_child"}} resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}.{{$child_key}}", "{{$child_value}}"), {{- end}} @@ -1130,11 +1232,20 @@ func TestAccResource{{.resourceClassName}}(t *testing.T) { {{- else}} {{- range $child_index, $child := $value}} {{- range $child_key, $child_value := $child}} - {{- if eq $child_key "version_mismatch" }} + {{- if eq $child_key "children"}} + {{- $newCtx := addToChild $child_value "ResourceName" (print "aci_" $.resourceName ".test") "InheritedKey" (print $key "." $child_index) -}} + {{- template "testNestedChildrenWithNoParent" $newCtx }} + {{- else if eq $child_key "version_mismatch" }} {{- range $version, $attributes := $child_value }} - composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">",{{- range $attributeName, $attributeValue := $attributes}} + composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">=",{{- range $attributeName, $attributeValue := $attributes}} + {{- if (isInterfaceSlice $attributeValue)}} + resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$attributeName}}.#", "{{len $attributeValue}}"), + {{- range $index, $subvalue := $attributeValue}} + resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$attributeName}}.{{$index}}", "{{$subvalue}}"), + {{- end}} + {{- else}} resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}.{{$child_index}}.{{$attributeName}}", "{{$attributeValue}}"), - {{- end }}), + {{- end}}{{- end }}), {{- end }} {{- else }} {{- if eq $child_key "target_dn"}} @@ -1164,7 +1275,7 @@ func TestAccResource{{.resourceClassName}}(t *testing.T) { {{- range $key, $value := .default}} {{- if eq $key "version_mismatch" }} {{- range $version, $attributes := $value }} - composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">",{{- range $attributeName, $attributeValue := $attributes}} + composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">=",{{- range $attributeName, $attributeValue := $attributes}} {{- $contains := definedInMap $attributeName $.resource_required}} {{- if not $contains}} {{- if (isInterfaceSlice $attributeValue)}} @@ -1199,15 +1310,29 @@ func TestAccResource{{.resourceClassName}}(t *testing.T) { {{- if eq (len $value) 1}} {{- range $child_index, $child := $value}} {{- range $child_key, $child_value := $child}} - {{- if eq $child_key "version_mismatch" }} + {{- if eq $child_key "children"}} + {{- $newCtx := addToChild $child_value "ResourceName" (print "aci_" $.resourceName ".test") "InheritedKey" (print $key) -}} + {{- template "testNestedChildrenWithNoParentAndChildrenRemovedFromConfig" $newCtx }} + {{- else if eq $child_key "version_mismatch" }} {{- range $version, $attributes := $child_value }} - composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">",{{- range $attributeName, $attributeValue := $attributes}} + composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">=",{{- range $attributeName, $attributeValue := $attributes}} + {{- if (isInterfaceSlice $attributeValue)}} + resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$attributeName}}.#", "{{len $attributeValue}}"), + {{- range $index, $subvalue := $attributeValue}} + resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$attributeName}}.{{$index}}", "{{$subvalue}}"), + {{- end}} + {{- else}} resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}.{{$attributeName}}", "{{$attributeValue}}"), - {{- end }}), + {{- end }}{{- end }}), {{- end }} {{- else }} {{- if eq $child_key "target_dn"}} resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}.{{$child_key}}", "{{getTestTargetDn $.child_targets $key $child_value false nil $child_index false}}"), + {{- else if (isInterfaceSlice $child_value)}} + resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}.{{$child_key}}.#", "{{len $child_value}}"), + {{- range $index, $subvalue := $child_value}} + resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}.{{$child_key}}.{{$index}}", "{{$subvalue}}"), + {{- end}} {{- else if ne $child_key "deletable_child"}} resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}.{{$child_key}}", "{{$child_value}}"), {{- end}} @@ -1217,9 +1342,12 @@ func TestAccResource{{.resourceClassName}}(t *testing.T) { {{- else}} {{- range $child_index, $child := $value}} {{- range $child_key, $child_value := $child}} - {{- if eq $child_key "version_mismatch" }} + {{- if eq $child_key "children"}} + {{- $newCtx := addToChild $child_value "ResourceName" (print "aci_" $.resourceName ".test") "InheritedKey" (print $key "." $child_index) -}} + {{- template "testNestedChildrenWithNoParentAndChildrenRemovedFromConfig" $newCtx }} + {{- else if eq $child_key "version_mismatch" }} {{- range $version, $attributes := $child_value }} - composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">",{{- range $attributeName, $attributeValue := $attributes}} + composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">=",{{- range $attributeName, $attributeValue := $attributes}} resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}.{{$child_index}}.{{$attributeName}}", "{{$attributeValue}}"), {{- end }}), {{- end }} @@ -1251,7 +1379,7 @@ func TestAccResource{{.resourceClassName}}(t *testing.T) { {{- range $key, $value := .default}} {{- if eq $key "version_mismatch" }} {{- range $version, $attributes := $value }} - composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">",{{- range $attributeName, $attributeValue := $attributes}} + composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">=",{{- range $attributeName, $attributeValue := $attributes}} {{- $contains := definedInMap $attributeName $.resource_required}} {{- if not $contains}} {{- if (isInterfaceSlice $attributeValue)}} @@ -1286,15 +1414,29 @@ func TestAccResource{{.resourceClassName}}(t *testing.T) { {{- if eq (len $value) 1}}{{- $child := index $value 0 }} {{- if not $child.deletable_child}} {{- range $child_key, $child_value := $child}} - {{- if eq $child_key "version_mismatch" }} + {{- if eq $child_key "children"}} + {{- $newCtx := addToChild $child_value "ResourceName" (print "aci_" $.resourceName ".test") "InheritedKey" (print $key) -}} + {{- template "testNestedChildrenWithNoParentAndFirstChildRemoved" $newCtx }} + {{- else if eq $child_key "version_mismatch" }} {{- range $version, $attributes := $child_value }} - composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">",{{- range $attributeName, $attributeValue := $attributes}} + composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">=",{{- range $attributeName, $attributeValue := $attributes}} + {{- if (isInterfaceSlice $attributeValue)}} + resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$attributeName}}.#", "{{len $attributeValue}}"), + {{- range $index, $subvalue := $attributeValue}} + resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$attributeName}}.{{$index}}", "{{$subvalue}}"), + {{- end}} + {{- else}} resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}.{{$attributeName}}", "{{$attributeValue}}"), - {{- end }}), + {{- end }}{{- end }}), {{- end }} {{- else }} {{- if eq $child_key "target_dn"}} resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}.{{$child_key}}", "{{getTestTargetDn $.child_targets $key $child_value false nil 1 false}}"), + {{- else if (isInterfaceSlice $child_value)}} + resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}.{{$child_key}}.#", "{{len $child_value}}"), + {{- range $index, $subvalue := $child_value}} + resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}.{{$child_key}}.{{$index}}", "{{$subvalue}}"), + {{- end}} {{- else if ne $child_key "deletable_child"}} resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}.{{$child_key}}", "{{$child_value}}"), {{- end}} @@ -1304,10 +1446,21 @@ func TestAccResource{{.resourceClassName}}(t *testing.T) { {{- else}} {{- $child := index $value 1 }} {{- range $child_key, $child_value := $child}} + {{- if eq $child_key "children"}} + {{- $newCtx := addToChild $child_value "ResourceName" (print "aci_" $.resourceName ".test") "InheritedKey" (print $key "." 0) -}} + {{- template "testNestedChildrenWithNoParentAndFirstChildRemoved" $newCtx }} + {{- else if eq $child_key "version_mismatch" }} + {{- range $version, $attributes := $child_value }} + composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">=",{{- range $attributeName, $attributeValue := $attributes}} + resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}.0.{{$attributeName}}", "{{$attributeValue}}"), + {{- end }}), + {{- end }} + {{- else }} {{- if eq $child_key "target_dn"}} resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}.0.{{$child_key}}", "{{getTestTargetDn $.child_targets $key $child_value false nil 1 false}}"), {{- else}} resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}.0.{{$child_key}}", "{{$child_value}}"), + {{- end}} {{- end}} {{- end}} resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}.#", "1"), @@ -1317,6 +1470,7 @@ func TestAccResource{{.resourceClassName}}(t *testing.T) { {{- if $single_nested_children}} ConfigStateChecks: []statecheck.StateCheck{ {{- range $key, $value := $.children}} + {{- $newCtx := emptyChild -}} {{- if eq (len $value) 1}}{{- $child := index $value 0 }} {{- if $child.deletable_child}} statecheck.ExpectKnownValue("aci_{{$.resourceName}}.test", @@ -1324,7 +1478,7 @@ func TestAccResource{{.resourceClassName}}(t *testing.T) { knownvalue.MapExact( map[string]knownvalue.Check{ {{- range $child_key, $child_value := $child}} - {{- if and (ne $child_key "deletable_child") (ne $child_key "version_mismatch")}} + {{- if and (ne $child_key "deletable_child") (ne $child_key "version_mismatch") (ne $child_key "children") }} "{{$child_key}}": knownvalue.Null(), {{- else if eq $child_key "version_mismatch"}} {{- range $version, $attributes := $child_value }} @@ -1332,13 +1486,29 @@ func TestAccResource{{.resourceClassName}}(t *testing.T) { "{{$attributeName}}" : knownvalue.Null(), {{- end}} {{- end}} + {{- else if eq $child_key "children"}} + {{- range $key, $value := $child_value}} + {{- if gt (len $value) 1}} + "{{$key}}": knownvalue.Null(), + {{- end}} + {{- end}} {{- end}} {{- end}} }, ), ), {{- end}} + {{- range $child_key, $child_value := $child}} + {{- if eq $child_key "children"}} + {{- if eq $child_key "children"}} + {{- if checkDeletableChild $child_value }} + {{- $newCtx = addToChild $child_value "ResourceName" (print "aci_" $.resourceName ".test") "InheritedKey" (print "tfjsonpath.New(\"" $key "\")") -}} + {{- end}} + {{- end}} + {{- end}} {{- end}} + {{- end}} + {{- template "singleNestedChildrenDeletionCheck2" $newCtx }} {{- end}} }, @@ -1358,7 +1528,7 @@ func TestAccResource{{.resourceClassName}}(t *testing.T) { {{- range $key, $value := .default}} {{- if eq $key "version_mismatch" }} {{- range $version, $attributes := $value }} - composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">",{{- range $attributeName, $attributeValue := $attributes}} + composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">=",{{- range $attributeName, $attributeValue := $attributes}} {{- $contains := definedInMap $attributeName $.resource_required}} {{- if not $contains}} {{- if (isInterfaceSlice $attributeValue)}} @@ -1393,14 +1563,28 @@ func TestAccResource{{.resourceClassName}}(t *testing.T) { {{- if eq (len $value) 1}}{{- $child := index $value 0 }} {{- if not $child.deletable_child}} {{- range $child_key, $child_value := $child}} - {{- if eq $child_key "version_mismatch" }} + {{- if eq $child_key "children"}} + {{- $newCtx := addToChild $child_value "ResourceName" (print "aci_" $.resourceName ".test") "InheritedKey" (print $key) -}} + {{- template "testNestedChildrenWithNoParentAndAllChildrenRemoved" $newCtx }} + {{- else if eq $child_key "version_mismatch" }} {{- range $version, $attributes := $child_value }} - composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">",{{- range $attributeName, $attributeValue := $attributes}} + composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">=",{{- range $attributeName, $attributeValue := $attributes}} + {{- if (isInterfaceSlice $attributeValue)}} + resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$attributeName}}.#", "{{len $attributeValue}}"), + {{- range $index, $subvalue := $attributeValue}} + resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$attributeName}}.{{$index}}", "{{$subvalue}}"), + {{- end}} + {{- else}} resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}.{{$attributeName}}", "{{$attributeValue}}"), - {{- end }}), + {{- end}}{{- end }}), {{- end }} {{- else }} - {{- if ne $child_key "deletable_child"}} + {{- if (isInterfaceSlice $child_value)}} + resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}.{{$child_key}}.#", "{{len $child_value}}"), + {{- range $index, $subvalue := $child_value}} + resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}.{{$child_key}}.{{$index}}", "{{$subvalue}}"), + {{- end}} + {{- else if ne $child_key "deletable_child"}} resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}.{{$child_key}}", "{{$child_value}}"), {{- end}} {{- end}} @@ -1414,6 +1598,7 @@ func TestAccResource{{.resourceClassName}}(t *testing.T) { {{- if $single_nested_children}} ConfigStateChecks: []statecheck.StateCheck{ {{- range $key, $value := $.children}} + {{- $newCtx := emptyChild -}} {{- if eq (len $value) 1}}{{- $child := index $value 0 }} {{- if $child.deletable_child}} statecheck.ExpectKnownValue("aci_{{$.resourceName}}.test", @@ -1421,7 +1606,7 @@ func TestAccResource{{.resourceClassName}}(t *testing.T) { knownvalue.MapExact( map[string]knownvalue.Check{ {{- range $child_key, $child_value := $child}} - {{- if and (ne $child_key "deletable_child") (ne $child_key "version_mismatch")}} + {{- if and (ne $child_key "deletable_child") (ne $child_key "version_mismatch") (ne $child_key "children") }} "{{$child_key}}": knownvalue.Null(), {{- else if eq $child_key "version_mismatch"}} {{- range $version, $attributes := $child_value }} @@ -1429,13 +1614,27 @@ func TestAccResource{{.resourceClassName}}(t *testing.T) { "{{$attributeName}}" : knownvalue.Null(), {{- end}} {{- end}} + {{- else if eq $child_key "children"}} + {{- range $key, $value := $child_value}} + {{- if gt (len $value) 1}} + "{{$key}}": knownvalue.Null(), + {{- end}} + {{- end}} {{- end}} {{- end}} }, ), ), {{- end}} + {{- range $child_key, $child_value := $child}} + {{- if eq $child_key "children"}} + {{- if checkDeletableChild $child_value }} + {{- $newCtx = addToChild $child_value "ResourceName" (print "aci_" $.resourceName ".test") "InheritedKey" (print "tfjsonpath.New(\"" $key "\")") -}} + {{- end}} + {{- end}} {{- end}} + {{- end}} + {{- template "singleNestedChildrenDeletionCheck2" $newCtx }} {{- end}} }, @@ -1488,15 +1687,15 @@ resource "aci_{{$target.target_resource_name}}" "test_{{$target.target_resource_ {{ $childDependencies = true }} const testChildDependencyConfig{{$.resourceClassName}} = ` {{- range $index, $target := .child_targets}}{{if not $target.static}} - {{- if ne .parent_dependency "" }} resource "aci_{{$target.target_resource_name}}" "test_{{$target.target_resource_name}}_{{mod $testIndex 2}}"{ + {{- if ne $target.parent_dependency_dn_ref ""}} {{$target.parent_dn_key}} = {{$target.parent_dependency_dn_ref}} + {{- end}} {{- range $key, $value := $target.properties}} {{$key}} = "{{$value}}" {{- end}} }{{$testIndex = add $testIndex 1}} - {{- end }} {{- end }}{{- end }} ` {{- end }} @@ -1653,7 +1852,10 @@ resource "aci_{{$.resourceName}}" "test{{- if eq $.resourceClassName $parentClas {{- $child := index $value 0}} {{$key}} = { {{- range $child_key, $child_value := $child}} - {{- if eq $child_key "version_mismatch" }} + {{- if eq $child_key "children"}} + {{- $newCtx := addToChild $child_value "Indent" " " -}} + {{- template "nestedChildren" $newCtx }} + {{- else if eq $child_key "version_mismatch" }} {{- range $version, $attributes := $child_value }} {{- range $attributeName, $attributeValue := $attributes}} {{$attributeName}} = provider::aci::compare_versions(data.aci_system.version.version,">=","{{ $version }}") ? "{{$attributeValue}}" : null @@ -1661,7 +1863,13 @@ resource "aci_{{$.resourceName}}" "test{{- if eq $.resourceClassName $parentClas {{- end }} {{- else }} {{- if eq $child_key "target_dn"}}{{$attributeValue := getTestTargetDn $.child_targets $key $child_value true nil $index false}} - {{$child_key}} = {{if containsString $attributeValue "."}}{{$attributeValue}}{{else}}"{{$attributeValue}}"{{end}} + {{$child_key}} = {{if containsString $attributeValue "."}}{{$attributeValue}}{{else}}"{{$attributeValue}}"{{end}} + {{- else if (isInterfaceSlice $child_value)}} + {{- if lt 0 (len $child_value)}} + {{$child_key}} = [{{range $index, $subvalue := $child_value}}{{if lt $index (subtract (len $child_value) 1)}}"{{$subvalue}}", {{else}}"{{$subvalue}}"{{end}}{{end}}] + {{- else}} + {{$child_key}} = [] + {{- end}} {{- else if ne $child_key "deletable_child"}} {{$child_key}} = "{{$child_value}}" {{- end}} @@ -1671,23 +1879,26 @@ resource "aci_{{$.resourceName}}" "test{{- if eq $.resourceClassName $parentClas {{- else}} {{$key}} = [ {{- range $child := $value}} - { + { {{- range $child_key, $child_value := $child}} - {{- if eq $child_key "version_mismatch" }} - {{- range $version, $attributes := $child_value }} - {{- range $attributeName, $attributeValue := $attributes}} - {{$attributeName}} = provider::aci::compare_versions(data.aci_system.version.version,">=","{{ $version }}") ? "{{$attributeValue}}" : null - {{- end }} - {{- end }} - {{- else }} - {{- if eq $child_key "target_dn"}}{{$attributeValue := getTestTargetDn $.child_targets $key $child_value true nil $index false}} - {{$child_key}} = {{if containsString $attributeValue "."}}{{$attributeValue}}{{else}}"{{$attributeValue}}"{{end}} - {{- else if ne $child_key "deletable_child"}} - {{$child_key}} = "{{$child_value}}" + {{- if eq $child_key "children"}} + {{- $newCtx := addToChild $child_value "Indent" " " -}} + {{- template "nestedChildren" $newCtx }} + {{- else if eq $child_key "version_mismatch" }} + {{- range $version, $attributes := $child_value }} + {{- range $attributeName, $attributeValue := $attributes}} + {{$attributeName}} = provider::aci::compare_versions(data.aci_system.version.version,">=","{{ $version }}") ? "{{$attributeValue}}" : null + {{- end }} + {{- end }} + {{- else }} + {{- if eq $child_key "target_dn"}}{{$attributeValue := getTestTargetDn $.child_targets $key $child_value true nil $index false}} + {{$child_key}} = {{if containsString $attributeValue "."}}{{$attributeValue}}{{else}}"{{$attributeValue}}"{{end}} + {{- else if ne $child_key "deletable_child"}} + {{$child_key}} = "{{$child_value}}" {{- end}} {{- end}} {{- end}}{{ $index = add $index 1 }} - }, + }, {{- end}} ] {{- end}} @@ -1722,17 +1933,47 @@ resource "aci_{{$.resourceName}}" "test{{- if eq $.resourceClassName $parentClas {{$key}} = "{{$value}}" {{- end }} {{- end}} - {{- range $key, $value := $.children}} + {{- range $key, $value := $.children}}{{$index := 0}} {{- if eq (len $value) 1}} {{- $child := index $value 0}} {{- if $child.deletable_child}} {{$key}} = {} + {{- else}} + {{$key}} = { + {{- range $child_key, $child_value := $child}} + {{- if eq $child_key "children"}} + {{- $newCtx := addToChild $child_value "Indent" " " -}} + {{- template "nestedChildrenRemoveOne" $newCtx }} + {{- else if eq $child_key "version_mismatch" }} + {{- range $version, $attributes := $child_value }} + {{- range $attributeName, $attributeValue := $attributes}} + {{$attributeName}} = provider::aci::compare_versions(data.aci_system.version.version,">=","{{ $version }}") ? "{{$attributeValue}}" : null + {{- end }} + {{- end }} + {{- else }} + {{- if eq $child_key "target_dn"}}{{$attributeValue := getTestTargetDn $.child_targets $key $child_value true nil $index false}} + {{$child_key}} = {{if containsString $attributeValue "."}}{{$attributeValue}}{{else}}"{{$attributeValue}}"{{end}} + {{- else if (isInterfaceSlice $child_value)}} + {{- if lt 0 (len $child_value)}} + {{$child_key}} = [{{range $index, $subvalue := $child_value}}{{if lt $index (subtract (len $child_value) 1)}}"{{$subvalue}}", {{else}}"{{$subvalue}}"{{end}}{{end}}] + {{- else}} + {{$child_key}} = [] + {{- end}} + {{- else if ne $child_key "deletable_child"}} + {{$child_key}} = "{{$child_value}}" + {{- end}} + {{- end}} + {{- end}}{{ $index = add $index 1 }} + } {{- end}} {{- else}} {{$key}} = [ {{$child := index $value 1 }} { {{- range $child_key, $child_value := $child}} - {{- if eq $child_key "version_mismatch" }} + {{- if eq $child_key "children"}} + {{- $newCtx := addToChild $child_value "Indent" " " -}} + {{- template "nestedChildrenRemoveOne" $newCtx }} + {{- else if eq $child_key "version_mismatch" }} {{- range $version, $attributes := $child_value }} {{- range $attributeName, $attributeValue := $attributes}} {{$attributeName}} = provider::aci::compare_versions(data.aci_system.version.version,">=","{{ $version }}") ? "{{$attributeValue}}" : null @@ -1748,8 +1989,8 @@ resource "aci_{{$.resourceName}}" "test{{- if eq $.resourceClassName $parentClas {{- end}} }, ] - {{- end}} - {{- end}} + {{- end}} +{{- end}} } ` @@ -1765,16 +2006,43 @@ resource "aci_{{$.resourceName}}" "test{{- if eq $.resourceClassName $parentClas {{$key}} = "{{$value}}" {{- end }} {{- end}} - {{- range $key, $value := $.children}} + {{- range $key, $value := $.children}}{{$index := 0}} {{- if eq (len $value) 1}} {{- $child := index $value 0}} {{- if $child.deletable_child}} {{$key}} = {} + {{- else }} + {{$key}} = { + {{- range $child_key, $child_value := $child}} + {{- if eq $child_key "children"}} + {{- $newCtx := addToChild $child_value "Indent" " " -}} + {{- template "nestedChildrenRemoveAll" $newCtx }} + {{- else if eq $child_key "version_mismatch" }} + {{- range $version, $attributes := $child_value }} + {{- range $attributeName, $attributeValue := $attributes}} + {{$attributeName}} = provider::aci::compare_versions(data.aci_system.version.version,">=","{{ $version }}") ? "{{$attributeValue}}" : null + {{- end }} + {{- end }} + {{- else }} + {{- if eq $child_key "target_dn"}}{{$attributeValue := getTestTargetDn $.child_targets $key $child_value true nil $index false}} + {{$child_key}} = {{if containsString $attributeValue "."}}{{$attributeValue}}{{else}}"{{$attributeValue}}"{{end}} + {{- else if (isInterfaceSlice $child_value)}} + {{- if lt 0 (len $child_value)}} + {{$child_key}} = [{{range $index, $subvalue := $child_value}}{{if lt $index (subtract (len $child_value) 1)}}"{{$subvalue}}", {{else}}"{{$subvalue}}"{{end}}{{end}}] + {{- else}} + {{$child_key}} = [] + {{- end}} + {{- else if ne $child_key "deletable_child"}} + {{$child_key}} = "{{$child_value}}" + {{- end}} + {{- end}} + {{- end}}{{ $index = add $index 1 }} + } {{- end}} {{- else}} {{$key}} = [] {{- end}} - {{- end}} + {{- end}} } ` {{- end}} @@ -1907,15 +2175,32 @@ resource "aci_{{$.resourceName}}" "test" { {{- $child := index $value 0}} {{$key}} = { {{- range $child_key, $child_value := $child}} - {{- if eq $child_key "version_mismatch" }} + {{- if eq $child_key "children"}} + {{- $newCtx := addToChild $child_value "Indent" " " -}} + {{- template "nestedChildren" $newCtx }} + {{- else if eq $child_key "version_mismatch" }} {{- range $version, $attributes := $child_value }} {{- range $attributeName, $attributeValue := $attributes}} - {{$attributeName}} = provider::aci::compare_versions(data.aci_system.version.version,">=","{{ $version }}") ? "{{$attributeValue}}" : null + {{- if (isInterfaceSlice $attributeValue) }} + {{- if lt 0 (len $attributeValue) }} + {{$attributeName}} = provider::aci::compare_versions(data.aci_system.version.version,">=","{{ $version }}") ? [{{range $index, $subvalue := $attributeValue}}{{if lt $index (subtract (len $attributeValue) 1)}}"{{$subvalue}}", {{else}}"{{$subvalue}}"{{end}}{{end}}] : null + {{- else}} + {{$attributeName}} = provider::aci::compare_versions(data.aci_system.version.version,">=","{{ $version }}") ? [] : null + {{- end}} + {{- else}} + {{$attributeName}} = provider::aci::compare_versions(data.aci_system.version.version,">=","{{ $version }}") ? "{{$attributeValue}}" : null {{- end }} {{- end }} + {{- end }} {{- else }} {{- if eq $child_key "target_dn"}}{{$attributeValue := getTestTargetDn $.child_targets $key $child_value true nil $index false}} - {{$child_key}} = {{if containsString $attributeValue "."}}{{$attributeValue}}{{else}}"{{$attributeValue}}"{{end}} + {{$child_key}} = {{if containsString $attributeValue "."}}{{$attributeValue}}{{else}}"{{$attributeValue}}"{{end}} + {{- else if (isInterfaceSlice $child_value)}} + {{- if lt 0 (len $child_value)}} + {{$child_key}} = [{{range $index, $subvalue := $child_value}}{{if lt $index (subtract (len $child_value) 1)}}"{{$subvalue}}", {{else}}"{{$subvalue}}"{{end}}{{end}}] + {{- else}} + {{$child_key}} = [] + {{- end}} {{- else if ne $child_key "deletable_child"}} {{$child_key}} = "{{$child_value}}" {{- end}} @@ -1927,7 +2212,10 @@ resource "aci_{{$.resourceName}}" "test" { {{- range $child := $value}} { {{- range $child_key, $child_value := $child}} - {{- if eq $child_key "version_mismatch" }} + {{- if eq $child_key "children"}} + {{- $newCtx := addToChild $child_value "Indent" " " -}} + {{- template "nestedChildren" $newCtx }} + {{- else if eq $child_key "version_mismatch" }} {{- range $version, $attributes := $child_value }} {{- range $attributeName, $attributeValue := $attributes}} {{$attributeName}} = provider::aci::compare_versions(data.aci_system.version.version,">=","{{ $version }}") ? "{{$attributeValue}}" : null @@ -1946,6 +2234,13 @@ resource "aci_{{$.resourceName}}" "test" { ] {{- end}} {{- end}} + {{- if $childDependencies }} + {{ $testIndex := 0 }} + {{- range $index, $target := .child_targets}}{{if not $target.static}} + depends_on = [aci_{{$target.target_resource_name}}.test_{{$target.target_resource_name}}_{{mod $testIndex 2}}] + {{- end}} + {{- end}} + {{- end}} } ` @@ -1970,17 +2265,55 @@ resource "aci_{{$.resourceName}}" "test" { {{$key}} = "{{$value}}" {{- end }} {{- end}} - {{- range $key, $value := $.children}} + {{- range $key, $value := $.children}}{{$index := 0}} {{- if eq (len $value) 1}} {{- $child := index $value 0}} {{- if $child.deletable_child}} {{$key}} = {} + {{- else }} + {{$key}} = { + {{- range $child_key, $child_value := $child}} + {{- if eq $child_key "children"}} + {{- $newCtx := addToChild $child_value "Indent" " " -}} + {{- template "nestedChildrenRemoveOne" $newCtx }} + {{- else if eq $child_key "version_mismatch" }} + {{- range $version, $attributes := $child_value }} + {{- range $attributeName, $attributeValue := $attributes}} + {{- if (isInterfaceSlice $attributeValue) }} + {{- if lt 0 (len $attributeValue) }} + {{$attributeName}} = provider::aci::compare_versions(data.aci_system.version.version,">=","{{ $version }}") ? [{{range $index, $subvalue := $attributeValue}}{{if lt $index (subtract (len $attributeValue) 1)}}"{{$subvalue}}", {{else}}"{{$subvalue}}"{{end}}{{end}}] : null + {{- else}} + {{$attributeName}} = provider::aci::compare_versions(data.aci_system.version.version,">=","{{ $version }}") ? [] : null + {{- end}} + {{- else}} + {{$attributeName}} = provider::aci::compare_versions(data.aci_system.version.version,">=","{{ $version }}") ? "{{$attributeValue}}" : null + {{- end }} + {{- end }} + {{- end }} + {{- else }} + {{- if eq $child_key "target_dn"}}{{$attributeValue := getTestTargetDn $.child_targets $key $child_value true nil $index false}} + {{$child_key}} = {{if containsString $attributeValue "."}}{{$attributeValue}}{{else}}"{{$attributeValue}}"{{end}} + {{- else if (isInterfaceSlice $child_value)}} + {{- if lt 0 (len $child_value)}} + {{$child_key}} = [{{range $index, $subvalue := $child_value}}{{if lt $index (subtract (len $child_value) 1)}}"{{$subvalue}}", {{else}}"{{$subvalue}}"{{end}}{{end}}] + {{- else}} + {{$child_key}} = [] + {{- end}} + {{- else if ne $child_key "deletable_child"}} + {{$child_key}} = "{{$child_value}}" + {{- end}} + {{- end}} + {{- end}}{{ $index = add $index 1 }} + } {{- end}} {{- else}} {{$key}} = [ {{$child := index $value 1 }} { {{- range $child_key, $child_value := $child}} - {{- if eq $child_key "version_mismatch" }} + {{- if eq $child_key "children"}} + {{- $newCtx := addToChild $child_value "Indent" " " -}} + {{- template "nestedChildrenRemoveOne" $newCtx }} + {{- else if eq $child_key "version_mismatch" }} {{- range $version, $attributes := $child_value }} {{- range $attributeName, $attributeValue := $attributes}} {{$attributeName}} = provider::aci::compare_versions(data.aci_system.version.version,">=","{{ $version }}") ? "{{$attributeValue}}" : null @@ -2010,11 +2343,46 @@ resource "aci_{{$.resourceName}}" "test" { {{$key}} = "{{$value}}" {{- end }} {{- end}} - {{- range $key, $value := $.children}} + {{- range $key, $value := $.children}}{{$index := 0}} {{- if eq (len $value) 1}} {{- $child := index $value 0}} {{- if $child.deletable_child}} {{$key}} = {} + {{- else }} + {{$key}} = { + {{- range $child_key, $child_value := $child}} + {{- if eq $child_key "children"}} + {{- $newCtx := addToChild $child_value "Indent" " " -}} + {{- template "nestedChildrenRemoveAll" $newCtx }} + {{- else if eq $child_key "version_mismatch" }} + {{- range $version, $attributes := $child_value }} + {{- range $attributeName, $attributeValue := $attributes}} + {{- if (isInterfaceSlice $attributeValue) }} + {{- if lt 0 (len $attributeValue) }} + {{$attributeName}} = provider::aci::compare_versions(data.aci_system.version.version,">=","{{ $version }}") ? [{{range $index, $subvalue := $attributeValue}}{{if lt $index (subtract (len $attributeValue) 1)}}"{{$subvalue}}", {{else}}"{{$subvalue}}"{{end}}{{end}}] : null + {{- else}} + {{$attributeName}} = provider::aci::compare_versions(data.aci_system.version.version,">=","{{ $version }}") ? [] : null + {{- end}} + {{- else}} + {{$attributeName}} = provider::aci::compare_versions(data.aci_system.version.version,">=","{{ $version }}") ? "{{$attributeValue}}" : null + {{- end }} + {{- end }} + {{- end }} + {{- else }} + {{- if eq $child_key "target_dn"}}{{$attributeValue := getTestTargetDn $.child_targets $key $child_value true nil $index false}} + {{$child_key}} = {{if containsString $attributeValue "."}}{{$attributeValue}}{{else}}"{{$attributeValue}}"{{end}} + {{- else if (isInterfaceSlice $child_value)}} + {{- if lt 0 (len $child_value)}} + {{$child_key}} = [{{range $index, $subvalue := $child_value}}{{if lt $index (subtract (len $child_value) 1)}}"{{$subvalue}}", {{else}}"{{$subvalue}}"{{end}}{{end}}] + {{- else}} + {{$child_key}} = [] + {{- end}} + {{- else if ne $child_key "deletable_child"}} + {{$child_key}} = "{{$child_value}}" + {{- end}} + {{- end}} + {{- end}}{{ $index = add $index 1 }} + } {{- end}} {{- else}} {{$key}} = [] @@ -2033,4 +2401,745 @@ resource "aci_{{$.resourceName}}" "test" { } ` {{- end}} +{{- end}} + +{{/* Sub Templates */}} + +{{/* A sub template for including nested children in the test config. */}} +{{- define "nestedChildren" -}} + {{- $indent := .TemplateProperties.Indent -}} + {{- range $key, $value := .childValue}}{{$index := 0}} + {{- if eq (len $value) 1}} + {{- $child := index $value 0}} + {{$indent}}{{$key}} = { + {{- range $child_key, $child_value := $child}} + {{- if eq $child_key "children"}} + {{- $newCtx := addToChild $child_value "Indent" (print $indent " ") -}} + {{- template "nestedChildren" $newCtx }} + {{- else if eq $child_key "version_mismatch" }} + {{- range $version, $attributes := $child_value }} + {{- range $attributeName, $attributeValue := $attributes}} + {{- if (isInterfaceSlice $attributeValue) }} + {{- if lt 0 (len $attributeValue) }} + {{$indent}}{{$attributeName}} = provider::aci::compare_versions(data.aci_system.version.version,">=","{{ $version }}") ? [{{range $index, $subvalue := $attributeValue}}{{if lt $index (subtract (len $attributeValue) 1)}}"{{$subvalue}}", {{else}}"{{$subvalue}}"{{end}}{{end}}] : null + {{- else}} + {{$indent}}{{$attributeName}} = provider::aci::compare_versions(data.aci_system.version.version,">=","{{ $version }}") ? [] : null + {{- end}} + {{- else}} + {{$indent}}{{$attributeName}} = provider::aci::compare_versions(data.aci_system.version.version,">=","{{ $version }}") ? "{{$attributeValue}}" : null + {{- end }} + {{- end }} + {{- end }} + {{- else }} + {{- if eq $child_key "target_dn"}}{{$attributeValue := getTestTargetDn $.child_targets $key $child_value true nil $index false}} + {{$indent}}{{$child_key}} = {{if containsString $attributeValue "."}}{{$attributeValue}}{{else}}"{{$attributeValue}}"{{end}} + {{- else if (isInterfaceSlice $child_value)}} + {{- if lt 0 (len $child_value)}} + {{$indent}}{{$child_key}} = [{{range $index, $subvalue := $child_value}}{{if lt $index (subtract (len $child_value) 1)}}"{{$subvalue}}", {{else}}"{{$subvalue}}"{{end}}{{end}}] + {{- else}} + {{$indent}}{{$child_key}} = [] + {{- end}} + {{- else if ne $child_key "deletable_child"}} + {{$indent}}{{$child_key}} = "{{$child_value}}" + {{- end}} + {{- end}} + {{- end}}{{ $index = add $index 1 }} + {{$indent}}} + {{- else}} + {{$indent}}{{$key}} = [ + {{- range $child := $value}} + {{$indent}}{ + {{- range $child_key, $child_value := $child}} + {{- if eq $child_key "children"}} + {{- $newCtx := addToChild $child_value "Indent" (print $indent " ") -}} + {{- template "nestedChildren" $newCtx }} + {{- else if eq $child_key "version_mismatch" }} + {{- range $version, $attributes := $child_value }} + {{- range $attributeName, $attributeValue := $attributes}} + {{$indent}}{{$attributeName}} = provider::aci::compare_versions(data.aci_system.version.version,">=","{{ $version }}") ? "{{$attributeValue}}" : null + {{- end }} + {{- end }} + {{- else }} + {{- if eq $child_key "target_dn"}}{{$attributeValue := getTestTargetDn $.child_targets $key $child_value true nil $index false}} + {{$indent}}{{$child_key}} = {{if containsString $attributeValue "."}}{{$attributeValue}}{{else}}"{{$attributeValue}}"{{end}} + {{- else if ne $child_key "deletable_child"}} + {{$indent}}{{$child_key}} = "{{$child_value}}" + {{- end}} + {{- end}} + {{- end}}{{ $index = add $index 1 }} + {{$indent}}}, + {{- end}} + {{$indent}}] + {{- end}} + +{{- end}} +{{- end}} + +{{/* A sub template for including nested children by removing only one child that is deletable in the test config. */}} +{{- define "nestedChildrenRemoveOne" -}} + {{- $indent := .TemplateProperties.Indent -}} + {{- range $key, $value := .childValue}}{{$index := 0}} + {{- if eq (len $value) 1}} + {{- $child := index $value 0}} + {{- if $child.deletable_child}} + {{$indent}}{{$key}} = {} + {{- else }} + {{$indent}}{{$key}} = { + {{- range $child_key, $child_value := $child}} + {{- if eq $child_key "children"}} + {{- $newCtx := addToChild $child_value "Indent" (print $indent " ") -}} + {{- template "nestedChildrenRemoveOne" $newCtx }} + {{- else if eq $child_key "version_mismatch" }} + {{- range $version, $attributes := $child_value }} + {{- range $attributeName, $attributeValue := $attributes}} + {{- if (isInterfaceSlice $attributeValue) }} + {{- if lt 0 (len $attributeValue) }} + {{$indent}}{{$attributeName}} = provider::aci::compare_versions(data.aci_system.version.version,">=","{{ $version }}") ? [{{range $index, $subvalue := $attributeValue}}{{if lt $index (subtract (len $attributeValue) 1)}}"{{$subvalue}}", {{else}}"{{$subvalue}}"{{end}}{{end}}] : null + {{- else}} + {{$indent}}{{$attributeName}} = provider::aci::compare_versions(data.aci_system.version.version,">=","{{ $version }}") ? [] : null + {{- end}} + {{- else}} + {{$indent}}{{$attributeName}} = provider::aci::compare_versions(data.aci_system.version.version,">=","{{ $version }}") ? "{{$attributeValue}}" : null + {{- end }} + {{- end }} + {{- end }} + {{- else }} + {{- if eq $child_key "target_dn"}}{{$attributeValue := getTestTargetDn $.child_targets $key $child_value true nil $index false}} + {{$indent}}{{$child_key}} = {{if containsString $attributeValue "."}}{{$attributeValue}}{{else}}"{{$attributeValue}}"{{end}} + {{- else if (isInterfaceSlice $child_value)}} + {{- if lt 0 (len $child_value)}} + {{$indent}}{{$child_key}} = [{{range $index, $subvalue := $child_value}}{{if lt $index (subtract (len $child_value) 1)}}"{{$subvalue}}", {{else}}"{{$subvalue}}"{{end}}{{end}}] + {{- else}} + {{$indent}}{{$child_key}} = [] + {{- end}} + {{- else if ne $child_key "deletable_child"}} + {{$indent}}{{$child_key}} = "{{$child_value}}" + {{- end}} + {{- end}} + {{- end}}{{ $index = add $index 1 }} + {{$indent}}} + {{- end}} + {{- else}} + {{$indent}}{{$key}} = [ {{$child := index $value 1 }} + {{$indent}}{ + {{- range $child_key, $child_value := $child}} + {{- if eq $child_key "children"}} + {{- $newCtx := addToChild $child_value "Indent" (print $indent " ") -}} + {{- template "nestedChildrenRemoveOne" $newCtx }} + {{- else if eq $child_key "version_mismatch" }} + {{- range $version, $attributes := $child_value }} + {{- range $attributeName, $attributeValue := $attributes}} + {{$indent}}{{$attributeName}} = provider::aci::compare_versions(data.aci_system.version.version,">=","{{ $version }}") ? "{{$attributeValue}}" : null + {{- end }} + {{- end }} + {{- else }} + {{- if eq $child_key "target_dn"}}{{$attributeValue := getTestTargetDn $.child_targets $key $child_value true nil 1 false}} + {{$indent}}{{$child_key}} = {{if containsString $attributeValue "."}}{{$attributeValue}}{{else}}"{{$attributeValue}}"{{end}} + {{- else }} + {{$indent}}{{$child_key}} = "{{$child_value}}" + {{- end}} + {{- end}} + {{- end}} + {{$indent}}}, + {{$indent}}] + {{- end}} +{{- end}} +{{- end}} + +{{/* A sub template for including nested children by removing all deletable children in the test config. */}} +{{- define "nestedChildrenRemoveAll" -}} + {{- $indent := .TemplateProperties.Indent -}} + {{- range $key, $value := .childValue}}{{$index := 0}} + {{- if eq (len $value) 1}} + {{- $child := index $value 0}} + {{- if $child.deletable_child}} + {{$indent}}{{$key}} = {} + {{- else }} + {{$indent}}{{$key}} = { + {{- range $child_key, $child_value := $child}} + {{- if eq $child_key "children"}} + {{- $newCtx := addToChild $child_value "Indent" (print $indent " ") -}} + {{- template "nestedChildrenRemoveAll" $newCtx }} + {{- else if eq $child_key "version_mismatch" }} + {{- range $version, $attributes := $child_value }} + {{- range $attributeName, $attributeValue := $attributes}} + {{- if (isInterfaceSlice $attributeValue) }} + {{- if lt 0 (len $attributeValue) }} + {{$indent}}{{$attributeName}} = provider::aci::compare_versions(data.aci_system.version.version,">=","{{ $version }}") ? [{{range $index, $subvalue := $attributeValue}}{{if lt $index (subtract (len $attributeValue) 1)}}"{{$subvalue}}", {{else}}"{{$subvalue}}"{{end}}{{end}}] : null + {{- else}} + {{$indent}}{{$attributeName}} = provider::aci::compare_versions(data.aci_system.version.version,">=","{{ $version }}") ? [] : null + {{- end}} + {{- else}} + {{$indent}}{{$attributeName}} = provider::aci::compare_versions(data.aci_system.version.version,">=","{{ $version }}") ? "{{$attributeValue}}" : null + {{- end }} + {{- end }} + {{- end }} + {{- else }} + {{- if eq $child_key "target_dn"}}{{$attributeValue := getTestTargetDn $.child_targets $key $child_value true nil $index false}} + {{$indent}}{{$child_key}} = {{if containsString $attributeValue "."}}{{$attributeValue}}{{else}}"{{$attributeValue}}"{{end}} + {{- else if (isInterfaceSlice $child_value)}} + {{- if lt 0 (len $child_value)}} + {{$indent}}{{$child_key}} = [{{range $index, $subvalue := $child_value}}{{if lt $index (subtract (len $child_value) 1)}}"{{$subvalue}}", {{else}}"{{$subvalue}}"{{end}}{{end}}] + {{- else}} + {{$indent}}{{$child_key}} = [] + {{- end}} + {{- else if ne $child_key "deletable_child"}} + {{$indent}}{{$child_key}} = "{{$child_value}}" + {{- end}} + {{- end}} + {{- end}}{{ $index = add $index 1 }} + {{$indent}}} + {{- end}} + {{- else}} + {{$indent}}{{$key}} = [] + {{- end}} +{{- end}} +{{- end}} + +{{/* A sub template for testing nested children resource attributes */}} +{{- define "testNestedChildren" -}} + {{- $inheritedKey := .TemplateProperties.InheritedKey -}} + {{- $resourceName := .TemplateProperties.ResourceName -}} + {{- $resourceClassName := .TemplateProperties.ResourceClassName -}} + {{- $parentClassName := .TemplateProperties.ParentClassName -}} + {{- range $key, $value := .childValue}} + {{- if eq (len $value) 1}} + {{- range $child_index, $child := $value}} + {{- range $child_key, $child_value := $child}} + {{- if eq $child_key "children"}} + {{- $newCtx := addToChild $child_value "ResourceName" $resourceName "InheritedKey" (print $inheritedKey "." $key) -}} + {{- template "testNestedChildren" $newCtx }} + {{- else if eq $child_key "version_mismatch" }} + {{- range $version, $attributes := $child_value }} + composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">=",{{- range $attributeName, $attributeValue := $attributes}} + {{- if (isInterfaceSlice $attributeValue)}} + resource.TestCheckResourceAttr("{{$resourceName}}", "{{$inheritedKey}}.{{$key}}.{{$attributeName}}.#", "{{len $attributeValue}}"), + {{- range $index, $subvalue := $attributeValue}} + resource.TestCheckResourceAttr("{{$resourceName}}", "{{$inheritedKey}}.{{$key}}.{{$attributeName}}.{{$index}}", "{{$subvalue}}"), + {{- end}} + {{- else}} + resource.TestCheckResourceAttr("{{$resourceName}}", "{{$inheritedKey}}.{{$key}}.{{$attributeName}}", "{{$attributeValue}}"), + {{- end }}{{- end }}), + {{- end }} + {{- else }} + {{- if eq $child_key "target_dn"}} + resource.TestCheckResourceAttr("{{$resourceName}}", "{{$inheritedKey}}.{{$key}}.{{$child_key}}", "{{getTestTargetDn $.child_targets $key $child_value false nil $child_index false}}"), + {{- else if (isInterfaceSlice $child_value)}} + resource.TestCheckResourceAttr("{{$resourceName}}", "{{$inheritedKey}}.{{$key}}.{{$child_key}}.#", "{{len $child_value}}"), + {{- range $index, $subvalue := $child_value}} + resource.TestCheckResourceAttr("{{$resourceName}}", "{{$inheritedKey}}.{{$key}}.{{$child_key}}.{{$index}}", "{{$subvalue}}"), + {{- end}} + {{- else if ne $child_key "deletable_child"}} + resource.TestCheckResourceAttr("{{$resourceName}}", "{{$inheritedKey}}.{{$key}}.{{$child_key}}", "{{$child_value}}"), + {{- end}} + {{- end}} + {{- end}} + {{- end }} + {{- end }} + {{- else }} + {{- range $child_index, $child := $value}} + {{- range $child_key, $child_value := $child}} + {{- if eq $child_key "children"}} + {{- $newCtx := addToChild $child_value "ResourceName" $resourceName "InheritedKey" (print $inheritedKey "." $key "." $child_index) "ResourceClassName" $resourceClassName "ParentClassName" $parentClassName -}} + {{- template "testNestedChildren" $newCtx }} + {{- else if eq $child_key "version_mismatch" }} + {{- range $version, $attributes := $child_value }} + composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">=",{{- range $attributeName, $attributeValue := $attributes}} + resource.TestCheckResourceAttr("{{$resourceName}}{{- if eq $resourceClassName $parentClassName }}_1{{- end }}", "{{$inheritedKey}}.{{$key}}.{{$child_index}}.{{$attributeName}}", "{{$attributeValue}}"), + {{- end }}), + {{- end }} + {{- else }} + {{- if eq $child_key "target_dn"}} + resource.TestCheckResourceAttr("{{$resourceName}}{{- if eq $resourceClassName $parentClassName }}_1{{- end }}", "{{$inheritedKey}}.{{$key}}.{{$child_index}}.{{$child_key}}", "{{getTestTargetDn $.child_targets $key $child_value false nil $child_index false}}"), + {{- else if ne $child_key "deletable_child"}} + resource.TestCheckResourceAttr("{{$resourceName}}{{- if eq $resourceClassName $parentClassName }}_1{{- end }}", "{{$inheritedKey}}.{{$key}}.{{$child_index}}.{{$child_key}}", "{{$child_value}}"), + {{- end}} + {{- end}} + {{- end}} + {{- end}} + {{- end}} +{{- end}} + +{{- define "testNestedChildrenRemovedFromConfig" -}} + {{- $inheritedKey := .TemplateProperties.InheritedKey -}} + {{- $resourceName := .TemplateProperties.ResourceName -}} + {{- $resourceClassName := .TemplateProperties.ResourceClassName -}} + {{- $parentClassName := .TemplateProperties.ParentClassName -}} + {{- range $key, $value := .childValue}} + {{- if eq (len $value) 1}} + {{- range $child_index, $child := $value}} + {{- range $child_key, $child_value := $child}} + {{- if eq $child_key "children"}} + {{- $newCtx := addToChild $child_value "ResourceName" (print "aci_" $.resourceName ".test") "InheritedKey" (print $inheritedKey "." $key) "ResourceClassName" $resourceClassName "ParentClassName" $parentClassName -}} + {{- template "testNestedChildrenRemovedFromConfig" $newCtx }} + {{- else if eq $child_key "version_mismatch" }} + {{- range $version, $attributes := $child_value }} + composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">=",{{- range $attributeName, $attributeValue := $attributes}} + {{- if (isInterfaceSlice $attributeValue)}} + resource.TestCheckResourceAttr("{{$resourceName}}{{- if eq $resourceClassName $parentClassName }}_1{{- end }}", "{{$inheritedKey}}.{{$key}}.{{$attributeName}}.#", "{{len $attributeValue}}"), + {{- range $index, $subvalue := $attributeValue}} + resource.TestCheckResourceAttr("{{$resourceName}}{{- if eq $resourceClassName $parentClassName }}_1{{- end }}", "{{$inheritedKey}}.{{$key}}.{{$attributeName}}.{{$index}}", "{{$subvalue}}"), + {{- end}} + {{- else}} + resource.TestCheckResourceAttr("{{$resourceName}}{{- if eq $resourceClassName $parentClassName }}_1{{- end }}", "{{$inheritedKey}}.{{$key}}.{{$attributeName}}", "{{$attributeValue}}"), + {{- end }}{{- end }}), + {{- end }} + {{- else }} + {{- if eq $child_key "target_dn"}} + resource.TestCheckResourceAttr("{{$resourceName}}{{- if eq $resourceClassName $parentClassName }}_1{{- end }}", "{{$inheritedKey}}.{{$key}}.{{$child_key}}", "{{getTestTargetDn $.child_targets $key $child_value false nil $child_index false}}"), + {{- else if (isInterfaceSlice $child_value)}} + resource.TestCheckResourceAttr("{{$resourceName}}{{- if eq $resourceClassName $parentClassName }}_1{{- end }}", "{{$inheritedKey}}.{{$key}}.{{$child_key}}.#", "{{len $child_value}}"), + {{- range $index, $subvalue := $child_value}} + resource.TestCheckResourceAttr("{{$resourceName}}{{- if eq $resourceClassName $parentClassName }}_1{{- end }}", "{{$inheritedKey}}.{{$key}}.{{$child_key}}.{{$index}}", "{{$subvalue}}"), + {{- end}} + {{- else if ne $child_key "deletable_child"}} + resource.TestCheckResourceAttr("{{$resourceName}}{{- if eq $resourceClassName $parentClassName }}_1{{- end }}", "{{$inheritedKey}}.{{$key}}.{{$child_key}}", "{{$child_value}}"), + {{- end}} + {{- end}} + {{- end}} + {{- end }} + {{- else}} + {{- range $child_index, $child := $value}} + {{- range $child_key, $child_value := $child}} + {{- if eq $child_key "children"}} + {{- $newCtx := addToChild $child_value "ResourceName" (print "aci_" $.resourceName ".test") "InheritedKey" (print $inheritedKey "." $key "." $child_index) "ResourceClassName" $resourceClassName "ParentClassName" $parentClassName -}} + {{- template "testNestedChildrenRemovedFromConfig" $newCtx }} + {{- else if eq $child_key "version_mismatch" }} + {{- range $version, $attributes := $child_value }} + composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">=",{{- range $attributeName, $attributeValue := $attributes}} + resource.TestCheckResourceAttr("{{$resourceName}}{{- if eq $resourceClassName $parentClassName }}_1{{- end }}", "{{$inheritedKey}}.{{$key}}.{{$child_index}}.{{$attributeName}}", "{{$attributeValue}}"), + {{- end }}), + {{- end }} + {{- else }} + {{- if eq $child_key "target_dn"}} + resource.TestCheckResourceAttr("{{$resourceName}}{{- if eq $resourceClassName $parentClassName }}_1{{- end }}", "{{$inheritedKey}}.{{$key}}.{{$child_index}}.{{$child_key}}", "{{getTestTargetDn $.child_targets $key $child_value false nil $child_index false}}"), + {{- else if ne $child_key "deletable_child"}} + resource.TestCheckResourceAttr("{{$resourceName}}{{- if eq $resourceClassName $parentClassName }}_1{{- end }}", "{{$inheritedKey}}.{{$key}}.{{$child_index}}.{{$child_key}}", "{{$child_value}}"), + {{- end}} + {{- end}} + {{- end}} + {{- end}} + resource.TestCheckResourceAttr("{{$resourceName}}", "{{$key}}.#", "{{len $value}}"), + {{- end}} + {{- end}} + {{- end}} + +{{- define "testNestedChildrenWithFirstChilRemoved" -}} + {{- $inheritedKey := .TemplateProperties.InheritedKey -}} + {{- $resourceName := .TemplateProperties.ResourceName -}} + {{- $resourceClassName := .TemplateProperties.ResourceClassName -}} + {{- $parentClassName := .TemplateProperties.ParentClassName -}} + {{- range $key, $value := .childValue}} + {{- if eq (len $value) 1}}{{- $child := index $value 0 }} + {{- if not $child.deletable_child}} + {{- range $child_key, $child_value := $child}} + {{- if eq $child_key "children"}} + {{- $newCtx := addToChild $child_value "ResourceName" $resourceName "InheritedKey" (print $inheritedKey "." $key) "ResourceClassName" $resourceClassName "ParentClassName" $parentClassName -}} + {{- template "testNestedChildrenWithFirstChilRemoved" $newCtx }} + {{- else if eq $child_key "version_mismatch" }} + {{- range $version, $attributes := $child_value }} + composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">=",{{- range $attributeName, $attributeValue := $attributes}} + {{- if (isInterfaceSlice $attributeValue)}} + resource.TestCheckResourceAttr("{{$resourceName}}{{- if eq $resourceClassName $parentClassName }}_1{{- end }}", "{{$inheritedKey}}.{{$key}}.{{$attributeName}}.#", "{{len $attributeValue}}"), + {{- range $index, $subvalue := $attributeValue}} + resource.TestCheckResourceAttr("{{$resourceName}}{{- if eq $resourceClassName $parentClassName }}_1{{- end }}", "{{$inheritedKey}}.{{$key}}.{{$attributeName}}.{{$index}}", "{{$subvalue}}"), + {{- end}} + {{- else}} + resource.TestCheckResourceAttr("{{$resourceName}}{{- if eq $resourceClassName $parentClassName }}_1{{- end }}", "{{$inheritedKey}}.{{$key}}.{{$attributeName}}", "{{$attributeValue}}"), + {{- end }}{{- end }}), + {{- end }} + {{- else }} + {{- if eq $child_key "target_dn"}} + resource.TestCheckResourceAttr("{{$resourceName}}{{- if eq $resourceClassName $parentClassName }}_1{{- end }}", "{{$inheritedKey}}.{{$key}}.{{$child_key}}", "{{getTestTargetDn $.child_targets $key $child_value false nil 0 false}}"), + {{- else if (isInterfaceSlice $child_value)}} + resource.TestCheckResourceAttr("{{$resourceName}}{{- if eq $resourceClassName $parentClassName }}_1{{- end }}", "{{$inheritedKey}}.{{$key}}.{{$child_key}}.#", "{{len $child_value}}"), + {{- range $index, $subvalue := $child_value}} + resource.TestCheckResourceAttr("{{$resourceName}}{{- if eq $resourceClassName $parentClassName }}_1{{- end }}", "{{$inheritedKey}}.{{$key}}.{{$child_key}}.{{$index}}", "{{$subvalue}}"), + {{- end}} + {{- else if ne $child_key "deletable_child"}} + resource.TestCheckResourceAttr("{{$resourceName}}{{- if eq $resourceClassName $parentClassName }}_1{{- end }}", "{{$inheritedKey}}.{{$key}}.{{$child_key}}", "{{$child_value}}"), + {{- end}} + {{- end}} + {{- end}} + {{- end}} + {{- else}} + {{- $child := index $value 1 }} + {{- range $child_key, $child_value := $child}} + {{- if eq $child_key "children"}} + {{- $newCtx := addToChild $child_value "ResourceName" $resourceName "InheritedKey" (print $inheritedKey "." $key "." 0) "ResourceClassName" $resourceClassName "ParentClassName" $parentClassName -}} + {{- template "testNestedChildrenWithFirstChilRemoved" $newCtx }} + {{- else if eq $child_key "version_mismatch" }} + {{- range $version, $attributes := $child_value }} + composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">=",{{- range $attributeName, $attributeValue := $attributes}} + resource.TestCheckResourceAttr("{{$resourceName}}{{- if eq $resourceClassName $parentClassName }}_1{{- end }}", "{{$inheritedKey}}.{{$key}}.0.{{$attributeName}}", "{{$attributeValue}}"), + {{- end }}), + {{- end }} + {{- else }} + {{- if eq $child_key "target_dn"}} + resource.TestCheckResourceAttr("{{$resourceName}}{{- if eq $resourceClassName $parentClassName }}_1{{- end }}", "{{$inheritedKey}}.{{$key}}.0.{{$child_key}}", "{{getTestTargetDn $.child_targets $key $child_value false nil 1 false}}"), + {{- else}} + resource.TestCheckResourceAttr("{{$resourceName}}{{- if eq $resourceClassName $parentClassName }}_1{{- end }}", "{{$inheritedKey}}.{{$key}}.0.{{$child_key}}", "{{$child_value}}"), + {{- end}} + {{- end}} + {{- end}} + resource.TestCheckResourceAttr("{{$resourceName}}{{- if eq $resourceClassName $parentClassName }}_1{{- end }}", "{{$inheritedKey}}.{{$key}}.#", "1"), + {{- end}} + {{- end}} + {{- end}} + +{{- define "testNestedChildrenAllChildrenRemoved" -}} + {{- $inheritedKey := .TemplateProperties.InheritedKey -}} + {{- $resourceName := .TemplateProperties.ResourceName -}} + {{- $resourceClassName := .TemplateProperties.ResourceClassName -}} + {{- $parentClassName := .TemplateProperties.ParentClassName -}} + {{- range $key, $value := .childValue}} + {{- if eq (len $value) 1}}{{- $child := index $value 0 }} + {{- if not $child.deletable_child}} + {{- range $child_key, $child_value := $child}} + {{- if eq $child_key "children"}} + {{- $newCtx := addToChild $child_value "ResourceName" $resourceName "InheritedKey" (print $inheritedKey "." $key) "ResourceClassName" $resourceClassName "ParentClassName" $parentClassName -}} + {{- template "testNestedChildrenAllChildrenRemoved" $newCtx }} + {{- else if eq $child_key "version_mismatch" }} + {{- range $version, $attributes := $child_value }} + composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">=",{{- range $attributeName, $attributeValue := $attributes}} + {{- if (isInterfaceSlice $attributeValue)}} + resource.TestCheckResourceAttr("{{$resourceName}}{{- if eq $resourceClassName $parentClassName }}_1{{- end }}", "{{$inheritedKey}}.{{$key}}.{{$attributeName}}.#", "{{len $attributeValue}}"), + {{- range $index, $subvalue := $attributeValue}} + resource.TestCheckResourceAttr("{{$resourceName}}{{- if eq $resourceClassName $parentClassName }}_1{{- end }}", "{{$inheritedKey}}.{{$key}}.{{$attributeName}}.{{$index}}", "{{$subvalue}}"), + {{- end}} + {{- else}} + resource.TestCheckResourceAttr("{{$resourceName}}{{- if eq $resourceClassName $parentClassName }}_1{{- end }}", "{{$inheritedKey}}.{{$key}}.{{$attributeName}}", "{{$attributeValue}}"), + {{- end }}{{- end }}), + {{- end }} + {{- else }} + {{- if (isInterfaceSlice $child_value)}} + resource.TestCheckResourceAttr("{{$resourceName}}{{- if eq $resourceClassName $parentClassName }}_1{{- end }}", "{{$inheritedKey}}.{{$key}}.{{$child_key}}.#", "{{len $child_value}}"), + {{- range $index, $subvalue := $child_value}} + resource.TestCheckResourceAttr("{{$resourceName}}{{- if eq $resourceClassName $parentClassName }}_1{{- end }}", "{{$inheritedKey}}.{{$key}}.{{$child_key}}.{{$index}}", "{{$subvalue}}"), + {{- end}} + {{- else if ne $child_key "deletable_child"}} + resource.TestCheckResourceAttr("{{$resourceName}}{{- if eq $resourceClassName $parentClassName }}_1{{- end }}", "{{$inheritedKey}}.{{$key}}.{{$child_key}}", "{{$child_value}}"), + {{- end}} + {{- end}} + {{- end}} + {{- end}} + {{- else}} + resource.TestCheckResourceAttr("{{$resourceName}}{{- if eq $resourceClassName $parentClassName }}_1{{- end }}", "{{$inheritedKey}}.{{$key}}.#", "0"), + {{- end}} + {{- end}} +{{- end}} + +{{- define "testNestedChildrenWithNoParent" -}} + {{- $inheritedKey := .TemplateProperties.InheritedKey -}} + {{- $resourceName := .TemplateProperties.ResourceName -}} + {{- range $key, $value := .childValue}} + {{- if eq (len $value) 1}} + {{- range $child_index, $child := $value}} + {{- range $child_key, $child_value := $child}} + {{- if eq $child_key "children"}} + {{- $newCtx := addToChild $child_value "ResourceName" $resourceName "InheritedKey" (print $inheritedKey "." $key) -}} + {{- template "testNestedChildrenWithNoParent" $newCtx }} + {{- else if eq $child_key "version_mismatch" }} + {{- range $version, $attributes := $child_value }} + composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">=",{{- range $attributeName, $attributeValue := $attributes}} + {{- if (isInterfaceSlice $attributeValue)}} + resource.TestCheckResourceAttr("{{$resourceName}}", "{{$inheritedKey}}.{{$key}}.{{$attributeName}}.#", "{{len $attributeValue}}"), + {{- range $index, $subvalue := $attributeValue}} + resource.TestCheckResourceAttr("{{$resourceName}}", "{{$inheritedKey}}.{{$key}}.{{$attributeName}}.{{$index}}", "{{$subvalue}}"), + {{- end}} + {{- else}} + resource.TestCheckResourceAttr("{{$resourceName}}", "{{$inheritedKey}}.{{$key}}.{{$attributeName}}", "{{$attributeValue}}"), + {{- end }}{{- end }}), + {{- end }} + {{- else }} + {{- if eq $child_key "target_dn"}} + resource.TestCheckResourceAttr("{{$resourceName}}", "{{$inheritedKey}}.{{$key}}.{{$child_key}}", "{{getTestTargetDn $.child_targets $key $child_value false nil $child_index false}}"), + {{- else if (isInterfaceSlice $child_value)}} + resource.TestCheckResourceAttr("{{$resourceName}}", "{{$inheritedKey}}.{{$key}}.{{$child_key}}.#", "{{len $child_value}}"), + {{- range $index, $subvalue := $child_value}} + resource.TestCheckResourceAttr("{{$resourceName}}", "{{$inheritedKey}}.{{$key}}.{{$child_key}}.{{$index}}", "{{$subvalue}}"), + {{- end}} + {{- else if ne $child_key "deletable_child"}} + resource.TestCheckResourceAttr("{{$resourceName}}", "{{$inheritedKey}}.{{$key}}.{{$child_key}}", "{{$child_value}}"), + {{- end}} + {{- end}} + {{- end}} + {{- end }} + {{- else}} + {{- range $child_index, $child := $value}} + {{- range $child_key, $child_value := $child}} + {{- if eq $child_key "children"}} + {{- $newCtx := addToChild $child_value "ResourceName" $resourceName "InheritedKey" (print $inheritedKey "." $key "." $child_index) -}} + {{- template "testNestedChildrenWithNoParent" $newCtx }} + {{- else if eq $child_key "version_mismatch" }} + {{- range $version, $attributes := $child_value }} + composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">=",{{- range $attributeName, $attributeValue := $attributes}} + resource.TestCheckResourceAttr("{{$resourceName}}", "{{$inheritedKey}}.{{$key}}.{{$child_index}}.{{$attributeName}}", "{{$attributeValue}}"), + {{- end }}), + {{- end }} + {{- else }} + {{- if eq $child_key "target_dn"}} + resource.TestCheckResourceAttr("{{$resourceName}}", "{{$inheritedKey}}.{{$key}}.{{$child_index}}.{{$child_key}}", "{{getTestTargetDn $.child_targets $key $child_value false nil $child_index false}}"), + {{- else if ne $child_key "deletable_child"}} + resource.TestCheckResourceAttr("{{$resourceName}}", "{{$inheritedKey}}.{{$key}}.{{$child_index}}.{{$child_key}}", "{{$child_value}}"), + {{- end}} + {{- end}} + {{- end}} + {{- end}} + resource.TestCheckResourceAttr("{{$resourceName}}", "{{$inheritedKey}}.{{$key}}.#", "{{len $value}}"), + {{- end}} + {{- end}} + {{- end}} + +{{- define "testNestedChildrenWithNoParentAndChildrenRemovedFromConfig" -}} +{{- $inheritedKey := .TemplateProperties.InheritedKey -}} + {{- $resourceName := .TemplateProperties.ResourceName -}} + {{- range $key, $value := .childValue}} + {{- if eq (len $value) 1}} + {{- range $child_index, $child := $value}} + {{- range $child_key, $child_value := $child}} + {{- if eq $child_key "children"}} + {{- $newCtx := addToChild $child_value "ResourceName" $resourceName "InheritedKey" (print $inheritedKey "." $key) -}} + {{- template "testNestedChildrenWithNoParentAndChildrenRemovedFromConfig" $newCtx }} + {{- else if eq $child_key "version_mismatch" }} + {{- range $version, $attributes := $child_value }} + composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">=",{{- range $attributeName, $attributeValue := $attributes}} + {{- if (isInterfaceSlice $attributeValue)}} + resource.TestCheckResourceAttr("{{$resourceName}}", "{{$inheritedKey}}.{{$key}}.{{$attributeName}}.#", "{{len $attributeValue}}"), + {{- range $index, $subvalue := $attributeValue}} + resource.TestCheckResourceAttr("{{$resourceName}}", "{{$inheritedKey}}.{{$key}}.{{$attributeName}}.{{$index}}", "{{$subvalue}}"), + {{- end}} + {{- else}} + resource.TestCheckResourceAttr("{{$resourceName}}", "{{$inheritedKey}}.{{$key}}.{{$attributeName}}", "{{$attributeValue}}"), + {{- end }}{{- end }}), + {{- end }} + {{- else }} + {{- if eq $child_key "target_dn"}} + resource.TestCheckResourceAttr("{{$resourceName}}", "{{$inheritedKey}}.{{$key}}.{{$child_key}}", "{{getTestTargetDn $.child_targets $key $child_value false nil $child_index false}}"), + {{- else if (isInterfaceSlice $child_value)}} + resource.TestCheckResourceAttr("{{$resourceName}}", "{{$inheritedKey}}.{{$key}}.{{$child_key}}.#", "{{len $child_value}}"), + {{- range $index, $subvalue := $child_value}} + resource.TestCheckResourceAttr("{{$resourceName}}", "{{$inheritedKey}}.{{$key}}.{{$child_key}}.{{$index}}", "{{$subvalue}}"), + {{- end}} + {{- else if ne $child_key "deletable_child"}} + resource.TestCheckResourceAttr("{{$resourceName}}", "{{$inheritedKey}}.{{$key}}.{{$child_key}}", "{{$child_value}}"), + {{- end}} + {{- end}} + {{- end}} + {{- end}} + {{- else}} + {{- range $child_index, $child := $value}} + {{- range $child_key, $child_value := $child}} + {{- if eq $child_key "children"}} + {{- $newCtx := addToChild $child_value "ResourceName" $resourceName "InheritedKey" (print $inheritedKey "." $key "." $child_index) -}} + {{- template "testNestedChildrenWithNoParentAndChildrenRemovedFromConfig" $newCtx }} + {{- else if eq $child_key "version_mismatch" }} + {{- range $version, $attributes := $child_value }} + composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">=",{{- range $attributeName, $attributeValue := $attributes}} + resource.TestCheckResourceAttr("{{$resourceName}}", "{{$inheritedKey}}.{{$key}}.{{$child_index}}.{{$attributeName}}", "{{$attributeValue}}"), + {{- end }}), + {{- end }} + {{- else }} + {{- if eq $child_key "target_dn"}} + resource.TestCheckResourceAttr("{{$resourceName}}", "{{$inheritedKey}}.{{$key}}.{{$child_index}}.{{$child_key}}", "{{getTestTargetDn $.child_targets $key $child_value false nil $child_index false}}"), + {{- else if ne $child_key "deletable_child"}} + resource.TestCheckResourceAttr("{{$resourceName}}", "{{$inheritedKey}}.{{$key}}.{{$child_index}}.{{$child_key}}", "{{$child_value}}"), + {{- end}} + {{- end}} + {{- end}} + {{- end}} + resource.TestCheckResourceAttr("{{$resourceName}}", "{{$inheritedKey}}.{{$key}}.#", "{{len $value}}"), + {{- end}} + {{- end}} + {{- end}} + +{{- define "testNestedChildrenWithNoParentAndFirstChildRemoved" -}} +{{- $inheritedKey := .TemplateProperties.InheritedKey -}} +{{- $resourceName := .TemplateProperties.ResourceName -}} + {{- range $key, $value := .childValue}} + {{- if eq (len $value) 1}}{{- $child := index $value 0 }} + {{- if not $child.deletable_child}} + {{- range $child_key, $child_value := $child}} + {{- if eq $child_key "children"}} + {{- $newCtx := addToChild $child_value "ResourceName" $resourceName "InheritedKey" (print $inheritedKey "." $key) -}} + {{- template "testNestedChildrenWithNoParentAndFirstChildRemoved" $newCtx }} + {{- else if eq $child_key "version_mismatch" }} + {{- range $version, $attributes := $child_value }} + composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">=",{{- range $attributeName, $attributeValue := $attributes}} + {{- if (isInterfaceSlice $attributeValue)}} + resource.TestCheckResourceAttr("{{$resourceName}}", "{{$inheritedKey}}.{{$key}}.{{$attributeName}}.#", "{{len $attributeValue}}"), + {{- range $index, $subvalue := $attributeValue}} + resource.TestCheckResourceAttr("{{$resourceName}}", "{{$inheritedKey}}.{{$key}}.{{$attributeName}}.{{$index}}", "{{$subvalue}}"), + {{- end}} + {{- else}} + resource.TestCheckResourceAttr("{{$resourceName}}", "{{$inheritedKey}}.{{$key}}.{{$attributeName}}", "{{$attributeValue}}"), + {{- end }}{{- end }}), + {{- end }} + {{- else }} + {{- if eq $child_key "target_dn"}} + resource.TestCheckResourceAttr("{{$resourceName}}", "{{$inheritedKey}}.{{$key}}.{{$child_key}}", "{{getTestTargetDn $.child_targets $key $child_value false nil 1 false}}"), + {{- else if (isInterfaceSlice $child_value)}} + resource.TestCheckResourceAttr("{{$resourceName}}", "{{$inheritedKey}}.{{$key}}.{{$child_key}}.#", "{{len $child_value}}"), + {{- range $index, $subvalue := $child_value}} + resource.TestCheckResourceAttr("{{$resourceName}}", "{{$inheritedKey}}.{{$key}}.{{$child_key}}.{{$index}}", "{{$subvalue}}"), + {{- end}} + {{- else if ne $child_key "deletable_child"}} + resource.TestCheckResourceAttr("{{$resourceName}}", "{{$inheritedKey}}.{{$key}}.{{$child_key}}", "{{$child_value}}"), + {{- end}} + {{- end}} + {{- end}} + {{- end}} + {{- else}} + {{- $child := index $value 1 }} + {{- range $child_key, $child_value := $child}} + {{- if eq $child_key "children"}} + {{- $newCtx := addToChild $child_value "ResourceName" $resourceName "InheritedKey" (print $inheritedKey "." $key "." 0) -}} + {{- template "testNestedChildrenWithNoParentAndFirstChildRemoved" $newCtx }} + {{- else if eq $child_key "version_mismatch" }} + {{- range $version, $attributes := $child_value }} + composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">=",{{- range $attributeName, $attributeValue := $attributes}} + resource.TestCheckResourceAttr("{{$resourceName}}", "{{$inheritedKey}}.{{$key}}.0.{{$attributeName}}", "{{$attributeValue}}"), + {{- end }}), + {{- end }} + {{- else }} + {{- if eq $child_key "target_dn"}} + resource.TestCheckResourceAttr("{{$resourceName}}", "{{$inheritedKey}}.{{$key}}.0.{{$child_key}}", "{{getTestTargetDn $.child_targets $key $child_value false nil 1 false}}"), + {{- else}} + resource.TestCheckResourceAttr("{{$resourceName}}", "{{$inheritedKey}}.{{$key}}.0.{{$child_key}}", "{{$child_value}}"), + {{- end}} + {{- end}} + {{- end}} + resource.TestCheckResourceAttr("{{$resourceName}}", "{{$inheritedKey}}.{{$key}}.#", "1"), + {{- end}} + {{- end}} + {{- end}} + +{{- define "testNestedChildrenWithNoParentAndAllChildrenRemoved" -}} + {{- $inheritedKey := .TemplateProperties.InheritedKey -}} + {{- $resourceName := .TemplateProperties.ResourceName -}} + {{- range $key, $value := .childValue}} + {{- if eq (len $value) 1}}{{- $child := index $value 0 }} + {{- if not $child.deletable_child}} + {{- range $child_key, $child_value := $child}} + {{- if eq $child_key "children"}} + {{- $newCtx := addToChild $child_value "ResourceName" $resourceName "InheritedKey" (print $inheritedKey "." $key) -}} + {{- template "testNestedChildrenWithNoParentAndAllChildrenRemoved" $newCtx }} + {{- else if eq $child_key "version_mismatch" }} + {{- range $version, $attributes := $child_value }} + composeAggregateTestCheckFuncWithVersion(t,"{{$version}}", ">=",{{- range $attributeName, $attributeValue := $attributes}} + {{- if (isInterfaceSlice $attributeValue)}} + resource.TestCheckResourceAttr("{{$resourceName}}", "{{$inheritedKey}}.{{$key}}.{{$attributeName}}.#", "{{len $attributeValue}}"), + {{- range $index, $subvalue := $attributeValue}} + resource.TestCheckResourceAttr("{{$resourceName}}", "{{$inheritedKey}}.{{$key}}.{{$attributeName}}.{{$index}}", "{{$subvalue}}"), + {{- end}} + {{- else}} + resource.TestCheckResourceAttr("{{$resourceName}}", "{{$inheritedKey}}.{{$key}}.{{$attributeName}}", "{{$attributeValue}}"), + {{- end }}{{- end }}), + {{- end }} + {{- else }} + {{- if ne $child_key "deletable_child"}} + resource.TestCheckResourceAttr("{{$resourceName}}", "{{$inheritedKey}}.{{$key}}.{{$child_key}}", "{{$child_value}}"), + {{- else if (isInterfaceSlice $child_value)}} + resource.TestCheckResourceAttr("{{$resourceName}}", "{{$inheritedKey}}.{{$key}}.{{$child_key}}.#", "{{len $child_value}}"), + {{- range $index, $subvalue := $child_value}} + resource.TestCheckResourceAttr("{{$resourceName}}", "{{$inheritedKey}}.{{$key}}.{{$child_key}}.{{$index}}", "{{$subvalue}}"), + {{- end}} + {{- end}} + {{- end}} + {{- end}} + {{- end}} + {{- else}} + resource.TestCheckResourceAttr("{{$resourceName}}", "{{$inheritedKey}}.{{$key}}.#", "0"), + {{- end}} + {{- end}} +{{- end}} + +{{- define "singleNestedChildrenDeletionCheck" -}} +{{- $inheritedKey := .TemplateProperties.InheritedKey -}} +{{- $resourceName := .TemplateProperties.ResourceName -}} +{{- $resourceClassName := .TemplateProperties.ResourceClassName -}} +{{- $parentClassName := .TemplateProperties.ParentClassName -}} +{{- range $key, $value := .childValue}} + {{- $newCtx := emptyChild -}} + {{- if eq (len $value) 1}}{{- $child := index $value 0 }} + {{- if $child.deletable_child}} + statecheck.ExpectKnownValue("{{$resourceName}}", + {{$inheritedKey}}.AtMapKey("{{$key}}"), + knownvalue.MapExact( + map[string]knownvalue.Check{ + {{- range $child_key, $child_value := $child}} + {{- if and (ne $child_key "deletable_child") (ne $child_key "version_mismatch") (ne $child_key "children") }} + "{{$child_key}}": knownvalue.Null(), + {{- else if eq $child_key "version_mismatch"}} + {{- range $version, $attributes := $child_value }} + {{- range $attributeName, $attributeValue := $attributes}} + "{{$attributeName}}" : knownvalue.Null(), + {{- end}} + {{- end}} + {{- else if eq $child_key "children"}} + {{- range $key, $value := $child_value}} + {{- if gt (len $value) 1}} + "{{$key}}": knownvalue.Null(), + {{- end}} + {{- end}} + {{- end}} + {{- end}} + }, + ), + ), + {{- end}} + {{- range $child_key, $child_value := $child}} + {{- if eq $child_key "children"}} + {{- if checkDeletableChild $child_value }} + {{- $newCtx = addToChild $child_value "ResourceName" (print "aci_" $.resourceName ".test") "InheritedKey" (print $inheritedKey ".AtMapKey(" $key ")") "ResourceClassName" $.resourceClassName "ParentClassName" $parentClassName -}} + {{- end}} + {{- end}} + {{- end}} + {{- end}} + {{- template "singleNestedChildrenDeletionCheck" $newCtx }} + {{- end}} +{{- end}} + +{{- define "singleNestedChildrenDeletionCheck2" -}} +{{- $inheritedKey := .TemplateProperties.InheritedKey -}} +{{- $resourceName := .TemplateProperties.ResourceName -}} +{{- range $key, $value := .childValue}} + {{- $newCtx := emptyChild -}} + {{- if eq (len $value) 1}}{{- $child := index $value 0 }} + {{- if $child.deletable_child}} + statecheck.ExpectKnownValue("{{$resourceName}}", + {{$inheritedKey}}.AtMapKey("{{$key}}"), + knownvalue.MapExact( + map[string]knownvalue.Check{ + {{- range $child_key, $child_value := $child}} + {{- if and (ne $child_key "deletable_child") (ne $child_key "version_mismatch") (ne $child_key "children") }} + "{{$child_key}}": knownvalue.Null(), + {{- else if eq $child_key "version_mismatch"}} + {{- range $version, $attributes := $child_value }} + {{- range $attributeName, $attributeValue := $attributes}} + "{{$attributeName}}" : knownvalue.Null(), + {{- end}} + {{- end}} + {{- else if eq $child_key "children"}} + {{- range $key, $value := $child_value}} + {{- if gt (len $value) 1}} + "{{$key}}": knownvalue.Null(), + {{- end}} + {{- end}} + {{- end}} + {{- end}} + }, + ), + ), + {{- end}} + {{- range $child_key, $child_value := $child}} + {{- if eq $child_key "children"}} + {{- if checkDeletableChild $child_value }} + {{- $newCtx = addToChild $child_value "ResourceName" (print "aci_" $.resourceName ".test") "InheritedKey" (print $inheritedKey ".AtMapKey(" $key ")") -}} + {{- end}} + {{- end}} + {{- end}} + {{- end}} + {{- template "singleNestedChildrenDeletionCheck2" $newCtx }} + {{- end}} {{- end}} \ No newline at end of file diff --git a/gen/templates/testvars.yaml.tmpl b/gen/templates/testvars.yaml.tmpl index b6093fea4..26df919ad 100644 --- a/gen/templates/testvars.yaml.tmpl +++ b/gen/templates/testvars.yaml.tmpl @@ -197,88 +197,10 @@ all: {{- end}} {{ if .Children}} children: - {{- range $key, $value := .Children}}{{$name := .ResourceName}}{{$child_deletable := .AllowDelete}}{{$childVersionMismatched := .VersionMismatched}} - {{overwriteProperty .PkgName .ResourceName $.Definitions}}: - {{- if or (not .IdentifiedBy) .MaxOneClassAllowed}} - {{- $versionMismatchExists = false}} - - {{ range .Properties}}{{- if keyExists $childVersionMismatched .RawVersion}}{{$versionMismatchExists = true}}{{- end}}{{$overwritePropertyName := overwriteProperty .PkgName .SnakeCaseName $.Definitions}}{{- if and (not (keyExists $childVersionMismatched .RawVersion)) (not .IgnoreInTest) (not .ReadOnly)}}{{$overwritePropertyName}}: {{$length := len .ValidValues}}{{if ne $length 0}}"{{ index .ValidValues 0 }}"{{else if not .IsNaming}}"{{overwritePropertyValue .PkgName $overwritePropertyName $overwritePropertyName "all" 0 $.Definitions }}"{{- else}}"{{lookupChildTestValue .PkgName $.ResourceName .SnakeCaseName $.TestVars 0 $.Definitions}}"{{- end}} - {{ end}}{{ end}} - {{- if $child_deletable -}} - deletable_child: true - {{- else -}} - deletable_child: false - {{ end}} - {{- if $versionMismatchExists}} - {{- $properties := .Properties }} - version_mismatch: - {{- range $versionMismatchNumber, $propertyNames := $versionMismatch }} - {{- $printedVersionMismatchNumberChildOne := false }} - {{- range $propertyNames }} - {{- $propertyInMismatch := .}} - {{- range $properties}} - {{- if eq .PropertyName $propertyInMismatch}} - {{- if not $printedVersionMismatchNumberChildOne }} - {{- $printedVersionMismatchNumberChildOne = true }} - {{ $versionMismatchNumber }}: - {{- end }} - {{- $overwritePropertyName := overwriteProperty .PkgName .SnakeCaseName $.Definitions}} - {{$overwritePropertyName}}: {{$length := len .ValidValues}}{{if ne $length 0}}"{{ index .ValidValues 0 }}"{{else if not .IsNaming}}"{{overwritePropertyValue .PkgName $overwritePropertyName $overwritePropertyName "all" 0 $.Definitions }}"{{- else}}"{{lookupChildTestValue .PkgName $.ResourceName .SnakeCaseName $.TestVars 0 $.Definitions}}" - {{- end}} - {{- end}} - {{- end}} - {{- end}} - {{- end}} - {{- end}} - {{- else}} - {{- $versionMismatchExists = false}} - - {{ range .Properties}}{{- if keyExists $versionMismatch .RawVersion}}{{$versionMismatchExists = true}}{{- end}}{{$overwritePropertyName := overwriteProperty .PkgName .SnakeCaseName $.Definitions}}{{- if and (not (keyExists $versionMismatch .RawVersion)) (not .IgnoreInTest) (not .ReadOnly)}}{{$overwritePropertyName}}: {{$length := len .ValidValues}}{{if ne $length 0}}"{{ index .ValidValues 0 }}"{{else if not .IsNaming}}"{{overwritePropertyValue .PkgName $overwritePropertyName $overwritePropertyName "all" 0 $.Definitions }}"{{- else}}"{{lookupChildTestValue .PkgName $.ResourceName .SnakeCaseName $.TestVars 0 $.Definitions}}"{{- end}} - {{ end}}{{ end}} - {{- if $versionMismatchExists}} - {{- $properties := .Properties }} - version_mismatch: - {{- range $versionMismatchNumber, $propertyNames := $versionMismatch }} - {{- $printedVersionMismatchNumberChildTwo := false }} - {{- range $propertyNames }} - {{- $propertyInMismatch := .}} - {{- range $properties}} - {{- if eq .PropertyName $propertyInMismatch}} - {{- if not $printedVersionMismatchNumberChildTwo }} - {{- $printedVersionMismatchNumberChildTwo = true }} - {{ $versionMismatchNumber }}: - {{- end }} - {{- $overwritePropertyName := overwriteProperty .PkgName .SnakeCaseName $.Definitions}} - {{$overwritePropertyName}}: {{$length := len .ValidValues}}{{if ne $length 0}}"{{ index .ValidValues 0 }}"{{else if not .IsNaming}}"{{overwritePropertyValue .PkgName $overwritePropertyName $overwritePropertyName "all" 0 $.Definitions }}"{{- else}}"{{lookupChildTestValue .PkgName $.ResourceName .SnakeCaseName $.TestVars 0 $.Definitions}}" - {{- end}} - {{- end}} - {{- end}} - {{- end}} - {{- end}} - {{- end}} - {{- $versionMismatchExists = false}} - - {{ range .Properties}}{{- if keyExists $versionMismatch .RawVersion}}{{$versionMismatchExists = true}}{{- end}}{{$overwritePropertyName := overwriteProperty .PkgName .SnakeCaseName $.Definitions}}{{- if and (not (keyExists $versionMismatch .RawVersion)) (not .IgnoreInTest) (not .ReadOnly)}}{{$overwritePropertyName}}: {{$length := len .ValidValues}}{{if ge $length 2}}"{{ index .ValidValues 1 }}"{{else if not .IsNaming}}"{{overwritePropertyValue .PkgName $overwritePropertyName $overwritePropertyName "default" 0 $.Definitions }}"{{- else}}"{{lookupChildTestValue .PkgName $.ResourceName .SnakeCaseName $.TestVars 1 $.Definitions}}"{{- end}} - {{ end}}{{- end}} - {{- if $versionMismatchExists}} - {{- $properties := .Properties }} - version_mismatch: - {{- range $versionMismatchNumber, $propertyNames := $versionMismatch }} - {{- $printedVersionMismatchNumberChildThree := false }} - {{- range $propertyNames }} - {{- $propertyInMismatch := .}} - {{- range $properties}} - {{- if eq .PropertyName $propertyInMismatch}} - {{- if not $printedVersionMismatchNumberChildThree }} - {{- $printedVersionMismatchNumberChildThree = true }} - {{ $versionMismatchNumber }}: - {{- end }} - {{- $overwritePropertyName := overwriteProperty .PkgName .SnakeCaseName $.Definitions}} - {{$overwritePropertyName}}: {{$length := len .ValidValues}}{{if ge $length 2}}"{{ index .ValidValues 1 }}"{{else if not .IsNaming}}"{{overwritePropertyValue .PkgName $overwritePropertyName $overwritePropertyName "default" 0 $.Definitions }}"{{- else}}"{{lookupChildTestValue .PkgName $.ResourceName .SnakeCaseName $.TestVars 1 $.Definitions}}" - {{- end}} - {{- end}} - {{- end}} - {{- end}} - {{- end}} - {{- end}} - {{- end}}{{- end}}{{ end}} + {{- range $key, $value := .Children}} + {{- $newCtx := addToTemplateProperties . "Indent" "" -}} + {{- template "nestedChildren" $newCtx }} + {{- end}}{{- end}} {{- if and .ContainedBy (not .MultiParentFormats)}} parents: {{- $index := 0}}{{- range $key := .DocumentationExamples}}{{$parentDependency := getParentTestDependencies $.PkgName $index $.Definitions}}{{$index = add $index 1}} @@ -383,10 +305,34 @@ targets: {{- end }} {{- if or (and (not .ContainedBy) (not .MultiParentFormats)) (and (.ContainedBy) (not .DocumentationExamples) (not .MultiParentFormats)) }} +{{- if .ChildTestDependencies}} +child_targets: + {{- range .ChildTestDependencies }} + - class_name: "{{ .ClassName }}" + target_dn: "{{ .TargetDn }}" + {{- if .TargetDnOverwriteDocs}} + target_dn_overwrite_docs: "{{ .TargetDnOverwriteDocs }}" + {{- end}} + relation_resource_name: "{{ .RelationResourceName }}" + static: {{ .Static }} + {{- if not .Static}} + target_dn_ref: "{{ .TargetDnRef }}" + parent_dependency: "{{ .ParentDependency}}" + parent_dependency_dn_ref: "{{.ParentDependencyDnRef}}" + target_resource_name: "{{ .TargetResourceName }}" + parent_dn_key: "{{ .ParentDnKey }}" + properties: + {{- range $key, $value := .Properties}} + {{ $key }}: "{{ $value }}" + {{- end }} + {{- end }} + {{- end }} + {{- end}} + test_type: {{ .TestType }} {{- end }} class_version: {{.ClassVersion}} -{{ $exists_exclude := false -}} +{{- $exists_exclude := false -}} {{- range .Properties }} {{- if eq .ValueType "password" }} {{- $exists_exclude = true -}} @@ -402,4 +348,128 @@ exclude_attributes: {{- end }} {{- if gt (len $versionMismatch) 0 }} version_mismatch: true -{{- end }} \ No newline at end of file +{{- end }} + +{{- /* A sub template for including vars in nested children. */}} +{{- define "nestedChildren" -}} +{{ $versionMismatch := .VersionMismatched}} +{{- $indent := .TemplateProperties.Indent -}} +{{$name := .ResourceName}}{{$child_deletable := .AllowDelete}} + {{ $indent }}{{overwriteProperty $.PkgName .ResourceName $.Definitions}}: + {{- if or (not .IdentifiedBy) .MaxOneClassAllowed}} + {{- $versionMismatchExists := false}} + {{- $enteredPropertiesZone := false }} + {{ $indent }}- {{ range .Properties}}{{- if $enteredPropertiesZone }}{{ $indent }}{{- else}}{{- $enteredPropertiesZone = true }}{{- end}}{{- if keyExists $versionMismatch .RawVersion}}{{$versionMismatchExists = true}}{{- end}}{{- if and (not (keyExists $versionMismatch .RawVersion)) (not .IgnoreInTest) (not .ReadOnly)}}{{$overwritePropertyName := overwriteProperty $.PkgName .SnakeCaseName $.Definitions}}{{$overwritePropertyName}}: {{$length := len .ValidValues}}{{- if eq .ValueType "bitmask"}}{{- if lt 0 (len (overwritePropertyValue $.PkgName $overwritePropertyName $overwritePropertyName "all" 0 $.Definitions))}}[{{range $index, $value := (overwritePropertyValue $.PkgName $overwritePropertyName $overwritePropertyName "all" 0 $.Definitions)}}"{{ $value}}"{{- if ne (add $index 1) (len (overwritePropertyValue $.PkgName $overwritePropertyName $overwritePropertyName "all" 0 $.Definitions))}},{{- end}}{{- end}}]{{- else}}[]{{- end}}{{else if ne $length 0}}"{{ index .ValidValues 0 }}"{{else if not .IsNaming}}"{{overwritePropertyValue $.PkgName $overwritePropertyName $overwritePropertyName "all" 0 $.Definitions }}"{{- else}}{{lookupChildTestValue $.PkgName $.ResourceName .SnakeCaseName $.TestVars 0 $.Definitions}}{{- end}} + {{ end}}{{ end}} + {{- if $child_deletable -}} + {{ $indent }}deletable_child: true + {{- else -}} + {{ $indent }}deletable_child: false + {{ end}} + {{- if $versionMismatchExists}} + {{- $properties := .Properties }} + {{ $indent }}version_mismatch: + {{- range $versionMismatchNumber, $propertyNames := $versionMismatch }} + {{- $printedVersionMismatchNumberChildOne := false }} + {{- range $propertyNames }} + {{- $propertyInMismatch := .}} + {{- range $properties}} + {{- if eq .PropertyName $propertyInMismatch}} + {{- if not $printedVersionMismatchNumberChildOne }} + {{- $printedVersionMismatchNumberChildOne = true }} + {{ $indent }}{{ $versionMismatchNumber }}: + {{- end }} + {{- $overwritePropertyName := overwriteProperty $.PkgName .SnakeCaseName $.Definitions}} + {{ $indent }}{{$overwritePropertyName}}: {{$length := len .ValidValues}}{{- if eq .ValueType "bitmask"}}{{- if lt 0 (len (overwritePropertyValue $.PkgName $overwritePropertyName $overwritePropertyName "all" 0 $.Definitions))}}[{{range $index, $value := (overwritePropertyValue $.PkgName $overwritePropertyName $overwritePropertyName "all" 0 $.Definitions)}}"{{ $value}}"{{- if ne (add $index 1) (len (overwritePropertyValue $.PkgName $overwritePropertyName $overwritePropertyName "all" 0 $.Definitions))}},{{- end}}{{- end}}]{{- else}}[]{{- end}}{{else if ne $length 0}}"{{ index .ValidValues 0 }}"{{else if not .IsNaming}}"{{overwritePropertyValue $.PkgName $overwritePropertyName $overwritePropertyName "all" 0 $.Definitions }}"{{- else}}{{lookupChildTestValue $.PkgName $.ResourceName .SnakeCaseName $.TestVars 0 $.Definitions}} + {{- end}} + {{- end}} + {{- end}} + {{- end}} + {{- end}} + {{- end}} + {{- $enteredGrandChildZone := false }} + {{- range .Children}} + {{- if not $enteredGrandChildZone }} + {{- $enteredGrandChildZone = true }} + {{ $indent }}children: + {{- end }} + {{- end }} + {{- range $key, $value := .Children}} + {{- $newCtx := addToTemplateProperties . "Indent" (print $indent " ") -}} + {{- template "nestedChildren" $newCtx }} + {{- end}} + {{- else}} + {{- $enteredPropertiesZone1 := false }} + {{- $versionMismatchExists := false}} + {{ $indent }}- {{ range .Properties}}{{- if $enteredPropertiesZone1 }}{{ $indent }}{{- else}}{{- $enteredPropertiesZone1 = true }}{{- end}}{{- if keyExists $versionMismatch .RawVersion}}{{$versionMismatchExists = true}}{{- end}}{{- if and (not (keyExists $versionMismatch .RawVersion)) (not .IgnoreInTest) (not .ReadOnly)}}{{$overwritePropertyName := overwriteProperty $.PkgName .SnakeCaseName $.Definitions}}{{$overwritePropertyName}}: {{$length := len .ValidValues}}{{- if eq .ValueType "bitmask"}}{{- if lt 0 (len (overwritePropertyValue $.PkgName $overwritePropertyName $overwritePropertyName "all" 0 $.Definitions))}}[{{range $index, $value := (overwritePropertyValue $.PkgName $overwritePropertyName $overwritePropertyName "all" 0 $.Definitions)}}"{{ $value}}"{{- if ne (add $index 1) (len (overwritePropertyValue $.PkgName $overwritePropertyName $overwritePropertyName "all" 0 $.Definitions))}},{{- end}}{{- end}}]{{- else}}[]{{- end}}{{else if ne $length 0}}"{{ index .ValidValues 0 }}"{{else if not .IsNaming}}"{{overwritePropertyValue $.PkgName $overwritePropertyName $overwritePropertyName "all" 0 $.Definitions }}"{{- else}}{{lookupChildTestValue $.PkgName $.ResourceName .SnakeCaseName $.TestVars 0 $.Definitions}}{{- end}} + {{ end}}{{ end}} + {{- if $versionMismatchExists}} + {{- $properties := .Properties }} + {{ $indent }}version_mismatch: + {{- range $versionMismatchNumber, $propertyNames := $versionMismatch }} + {{- $printedVersionMismatchNumberChildTwo := false }} + {{- range $propertyNames }} + {{- $propertyInMismatch := .}} + {{- range $properties}} + {{- if eq .PropertyName $propertyInMismatch}} + {{- if not $printedVersionMismatchNumberChildTwo }} + {{- $printedVersionMismatchNumberChildTwo = true }} + {{ $indent }}{{ $versionMismatchNumber }}: + {{- end }} + {{- $overwritePropertyName := overwriteProperty $.PkgName .SnakeCaseName $.Definitions}} + {{ $indent }}{{$overwritePropertyName}}: {{$length := len .ValidValues}}{{- if eq .ValueType "bitmask"}}{{- if lt 0 (len (overwritePropertyValue $.PkgName $overwritePropertyName $overwritePropertyName "all" 0 $.Definitions))}}[{{range $index, $value := (overwritePropertyValue $.PkgName $overwritePropertyName $overwritePropertyName "all" 0 $.Definitions)}}"{{ $value}}"{{- if ne (add $index 1) (len (overwritePropertyValue $.PkgName $overwritePropertyName $overwritePropertyName "all" 0 $.Definitions))}},{{- end}}{{- end}}]{{- else}}[]{{- end}}{{else if ne $length 0}}"{{ index .ValidValues 0 }}"{{else if not .IsNaming}}"{{overwritePropertyValue $.PkgName $overwritePropertyName $overwritePropertyName "all" 0 $.Definitions }}"{{- else}}{{lookupChildTestValue $.PkgName $.ResourceName .SnakeCaseName $.TestVars 0 $.Definitions}} + {{- end}} + {{- end}} + {{- end}} + {{- end}} + {{- end}} + {{- end}} + {{- $enteredGrandChildZone := false }} + {{- range .Children}} + {{- if not $enteredGrandChildZone }} + {{- $enteredGrandChildZone = true }} + {{ $indent }}children: + {{- end }} + {{- end }} + {{- range $key, $value := .Children}} + {{- $newCtx := addToTemplateProperties . "Indent" (print $indent " ") -}} + {{- template "nestedChildren" $newCtx }} + {{- end}} + {{- $enteredPropertiesZone2 := false }} + {{- $versionMismatchExists := false}} + {{ $indent }}- {{ range .Properties}}{{- if $enteredPropertiesZone2 }}{{ $indent }}{{- else}}{{- $enteredPropertiesZone2 = true }}{{- end}}{{- if keyExists $versionMismatch .RawVersion}}{{$versionMismatchExists = true}}{{- end}}{{- if and (not (keyExists $versionMismatch .RawVersion)) (not .IgnoreInTest) (not .ReadOnly)}}{{$overwritePropertyName := overwriteProperty $.PkgName .SnakeCaseName $.Definitions}}{{$overwritePropertyName}}: {{$length := len .ValidValues}}{{- if eq .ValueType "bitmask"}}{{- if lt 0 (len (overwritePropertyValue $.PkgName $overwritePropertyName $overwritePropertyName "default" 0 $.Definitions))}}[{{range $index, $value := (overwritePropertyValue $.PkgName $overwritePropertyName $overwritePropertyName "default" 0 $.Definitions)}}"{{ $value}}"{{- if ne (add $index 1) (len (overwritePropertyValue $.PkgName $overwritePropertyName $overwritePropertyName "default" 0 $.Definitions))}},{{- end}}{{- end}}]{{- else}}[]{{- end}}{{else if ge $length 2}}"{{ index .ValidValues 1 }}"{{else if not .IsNaming}}"{{overwritePropertyValue $.PkgName $overwritePropertyName $overwritePropertyName "default" 0 $.Definitions }}"{{- else}}{{lookupChildTestValue $.PkgName $.ResourceName .SnakeCaseName $.TestVars 1 $.Definitions}}{{- end}} + {{ end}}{{- end}} + {{- if $versionMismatchExists}} + {{- $properties := .Properties }} + {{ $indent }}version_mismatch: + {{- range $versionMismatchNumber, $propertyNames := $versionMismatch }} + {{- $printedVersionMismatchNumberChildThree := false }} + {{- range $propertyNames }} + {{- $propertyInMismatch := .}} + {{- range $properties}} + {{- if eq .PropertyName $propertyInMismatch}} + {{- if not $printedVersionMismatchNumberChildThree }} + {{- $printedVersionMismatchNumberChildThree = true }} + {{ $indent }}{{ $versionMismatchNumber }}: + {{- end }} + {{- $overwritePropertyName := overwriteProperty $.PkgName .SnakeCaseName $.Definitions}} + {{ $indent }}{{$overwritePropertyName}}: {{$length := len .ValidValues}}{{- if eq .ValueType "bitmask"}}{{- if lt 0 (len (overwritePropertyValue $.PkgName $overwritePropertyName $overwritePropertyName "default" 0 $.Definitions))}}[{{range $index, $value := (overwritePropertyValue $.PkgName $overwritePropertyName $overwritePropertyName "default" 0 $.Definitions)}}"{{ $value}}"{{- if ne (add $index 1) (len (overwritePropertyValue $.PkgName $overwritePropertyName $overwritePropertyName "default" 0 $.Definitions))}},{{- end}}{{- end}}]{{- else}}[]{{- end}}{{else if ge $length 2}}"{{ index .ValidValues 1 }}"{{else if not .IsNaming}}"{{overwritePropertyValue $.PkgName $overwritePropertyName $overwritePropertyName "default" 0 $.Definitions }}"{{- else}}{{lookupChildTestValue $.PkgName $.ResourceName .SnakeCaseName $.TestVars 1 $.Definitions}} + {{- end}} + {{- end}} + {{- end}} + {{- end}} + {{- end}} + {{- end}} + {{- $enteredGrandChildZone := false }} + {{- range .Children}} + {{- if not $enteredGrandChildZone }} + {{- $enteredGrandChildZone = true }} + {{ $indent }}children: + {{- end }} + {{- end }} + {{- range $key, $value := .Children}} + {{- $newCtx := addToTemplateProperties . "Indent" (print $indent " ") -}} + {{- template "nestedChildren" $newCtx }} + {{- end}} + {{- end}} + {{- end}} diff --git a/gen/testvars/commPol.yaml b/gen/testvars/commPol.yaml new file mode 100644 index 000000000..cb81be9e4 --- /dev/null +++ b/gen/testvars/commPol.yaml @@ -0,0 +1,264 @@ +# Code generated by "gen/generator.go"; DO NOT EDIT. +# In order to regenerate this file execute `go generate` from the repository root. +# More details can be found in the [README](https://github.com/CiscoDevNet/terraform-provider-aci/blob/master/README.md). + + +default: + annotation: "orchestrator:terraform" + description: "" + name_alias: "" + owner_key: "" + owner_tag: "" + +datasource_non_existing: + name: "non_existing_name" + +datasource_required: + name: "test_name" + +resource_required: + name: "test_name" + +all: + annotation: "annotation" + description: "description_1" + name_alias: "name_alias_1" + owner_key: "owner_key_1" + owner_tag: "owner_tag_1" + +children: + http_service: + - access_control_allow_credential: "disabled" + access_control_allow_origins: "access_control_allow_origins_1" + admin_state: "disabled" + annotation: "annotation_1" + description: "description_1" + max_request_status_count: "0" + name: "name_1" + name_alias: "name_alias_1" + port: "80" + redirect_state: "disabled" + throttle_rate: "2" + throttle_state: "disabled" + visore_access: "disabled" + deletable_child: false + + version_mismatch: + 4.1(1i): + cli_only_mode: "disabled" + 4.2(1i): + global_throttle_rate: "10000" + global_throttle_state: "disabled" + global_throttle_unit: "r/s" + 5.2(1g): + server_header: "disabled" + 5.2(3e): + node_exporter: "disabled" + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + http_ssl_configuration: + - access_control_allow_credential: "disabled" + access_control_allow_origins: "access_control_allow_origins_1" + admin_state: "enabled" + annotation: "annotation_1" + description: "description_1" + dh_param: "1024" + max_request_status_count: "0" + name: "name_1" + name_alias: "name_alias_1" + port: "443" + ssl_protocols: ["TLSv1"] + throttle_rate: "2" + throttle_state: "disabled" + visore_access: "disabled" + deletable_child: false + + version_mismatch: + 4.0(1h): + client_cert_auth_state: "disabled" + 4.1(1i): + cli_only_mode: "disabled" + 4.2(1i): + global_throttle_rate: "10000" + global_throttle_state: "disabled" + global_throttle_unit: "r/s" + 5.2(1g): + server_header: "disabled" + 5.2(3e): + node_exporter: "disabled" + 6.0(2h): + referer: "referer_1" + children: + certificate_authority: + - annotation: "annotation_1" + target_dn: "uni/userext/pkiext/tp-test_name" + deletable_child: true + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + key_ring: + - annotation: "annotation_1" + key_ring_name: "default" + deletable_child: false + + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + ssh_access_via_web: + - admin_state: "disabled" + annotation: "annotation_1" + description: "description_1" + name: "name_1" + name_alias: "name_alias_1" + deletable_child: false + + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + ssh_service: + - admin_state: "disabled" + annotation: "annotation_1" + description: "description_1" + name: "name_1" + name_alias: "name_alias_1" + port: "22" + ssh_ciphers: ["aes192-ctr"] + ssh_macs: ["hmac-sha1"] + deletable_child: false + + version_mismatch: + 4.1(1i): + password_auth: "disabled" + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + telnet_service: + - admin_state: "disabled" + annotation: "annotation_1" + description: "description_1" + name: "name_1" + name_alias: "name_alias_1" + port: "23" + deletable_child: false + + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + +child_targets: + - class_name: "pkiTP" + target_dn: "" + relation_resource_name: "certificate_authority" + static: false + target_dn_ref: "" + parent_dependency: "" + parent_dependency_dn_ref: "" + target_resource_name: "certificate_authority" + parent_dn_key: "parent_dn" + properties: + certificate_chain: "-----BEGIN CERTIFICATE-----\\nMIICODCCAaGgAwIBAgIJAIt8XMntue0VMA0GCSqGSIb3DQEBCwUAMDQxDjAMBgNV\\nBAMMBUFkbWluMRUwEwYDVQQKDAxZb3VyIENvbXBhbnkxCzAJBgNVBAYTAlVTMCAX\\nDTE4MDEwOTAwNTk0NFoYDzIxMTcxMjE2MDA1OTQ0WjA0MQ4wDAYDVQQDDAVBZG1p\\nbjEVMBMGA1UECgwMWW91ciBDb21wYW55MQswCQYDVQQGEwJVUzCBnzANBgkqhkiG\\n9w0BAQEFAAOBjQAwgYkCgYEAohG/7axtt7CbSaMP7r+2mhTKbNgh0Ww36C7Ta14i\\nv+VmLyKkQHnXinKGhp6uy3Nug+15a+eIu7CrgpBVMQeCiWfsnwRocKcQJWIYDrWl\\nXHxGQn31yYKR6mylE7Dcj3rMFybnyhezr5D8GcP85YRPmwG9H2hO/0Y1FUnWu9Iw\\nAQkCAwEAAaNQME4wHQYDVR0OBBYEFD0jLXfpkrU/ChzRvfruRs/fy1VXMB8GA1Ud\\nIwQYMBaAFD0jLXfpkrU/ChzRvfruRs/fy1VXMAwGA1UdEwQFMAMBAf8wDQYJKoZI\\nhvcNAQELBQADgYEAOmvre+5tgZ0+F3DgsfxNQqLTrGiBgGCIymPkP/cBXXkNuJyl\\n3ac7tArHQc7WEA4U2R2rZbEq8FC3UJJm4nUVtCPvEh3G9OhN2xwYev79yt6pIn/l\\nKU0Td2OpVyo0eLqjoX5u2G90IBWzhyjFbo+CcKMrSVKj1YOdG0E3OuiJf00=\\n-----END CERTIFICATE-----" + name: "test_name" + +test_type: both +class_version: 6.0(2h) +version_mismatch: true diff --git a/gen/testvars/fhsBDPol.yaml b/gen/testvars/fhsBDPol.yaml index e9882f672..cf4e675bf 100644 --- a/gen/testvars/fhsBDPol.yaml +++ b/gen/testvars/fhsBDPol.yaml @@ -48,6 +48,21 @@ children: owner_key: "owner_key_1" owner_tag: "owner_tag_1" deletable_child: true + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + annotations: - key: "key_0" value: "value_1" diff --git a/gen/testvars/fvAEPg.yaml b/gen/testvars/fvAEPg.yaml index 66cb1e47d..072832892 100644 --- a/gen/testvars/fvAEPg.yaml +++ b/gen/testvars/fvAEPg.yaml @@ -67,38 +67,158 @@ children: 4.1(1i): precedence: "1" scope: "scope-bd" + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + relation_to_application_epg_monitoring_policy: - annotation: "annotation_1" monitoring_policy_name: "monitoring_policy_name_1" deletable_child: true + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + relation_to_bridge_domain: - annotation: "annotation_1" bridge_domain_name: "bridge_domain_name_1" deletable_child: false + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + relation_to_consumed_contracts: - annotation: "annotation_1" priority: "level1" contract_name: "contract_name_0" + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + - annotation: "annotation_2" priority: "level2" contract_name: "contract_name_1" + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + relation_to_imported_contracts: - annotation: "annotation_1" priority: "level1" imported_contract_name: "imported_contract_name_0" + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + - annotation: "annotation_2" priority: "level2" imported_contract_name: "imported_contract_name_1" + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + relation_to_custom_qos_policy: - annotation: "annotation_1" custom_qos_policy_name: "custom_qos_policy_name_1" deletable_child: false + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + relation_to_domains: - annotation: "annotation_1" class_preference: "encap" @@ -126,6 +246,21 @@ children: port_allocation: "elastic" 4.2(3j): custom_epg_name: "custom_epg_name_1" + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + - annotation: "annotation_2" class_preference: "useg" delimiter: "" @@ -152,10 +287,40 @@ children: port_allocation: "fixed" 4.2(3j): custom_epg_name: "custom_epg_name_2" + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + relation_to_data_plane_policing_policy: - annotation: "annotation_1" data_plane_policing_policy_name: "data_plane_policing_policy_name_1" deletable_child: true + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + relation_to_fibre_channel_paths: - annotation: "annotation_1" description: "description_1" @@ -163,19 +328,79 @@ children: vsan: "vsan-10" vsan_mode: "native" + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + - annotation: "annotation_2" description: "description_2" target_dn: "target_dn_1" vsan: "unknown" vsan_mode: "regular" + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + relation_to_intra_epg_contracts: - annotation: "annotation_1" contract_name: "contract_name_0" + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + - annotation: "annotation_2" contract_name: "contract_name_1" + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + relation_to_static_leafs: - annotation: "annotation_1" description: "description_1" @@ -184,6 +409,21 @@ children: mode: "native" target_dn: "target_dn_0" + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + - annotation: "annotation_2" description: "description_2" encapsulation: "vlan-101" @@ -191,6 +431,21 @@ children: mode: "regular" target_dn: "target_dn_1" + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + relation_to_static_paths: - annotation: "annotation_1" description: "description_1" @@ -200,6 +455,21 @@ children: primary_encapsulation: "vlan-203" target_dn: "target_dn_0" + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + - annotation: "annotation_2" description: "description_2" encapsulation: "vlan-201" @@ -208,35 +478,155 @@ children: primary_encapsulation: "unknown" target_dn: "target_dn_1" + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + relation_to_taboo_contracts: - annotation: "annotation_1" taboo_contract_name: "taboo_contract_name_0" + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + - annotation: "annotation_2" taboo_contract_name: "taboo_contract_name_1" + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + relation_to_provided_contracts: - annotation: "annotation_1" match_criteria: "All" priority: "level1" contract_name: "contract_name_0" + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + - annotation: "annotation_2" match_criteria: "AtleastOne" priority: "level2" contract_name: "contract_name_1" + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + relation_to_contract_masters: - annotation: "annotation_1" target_dn: "target_dn_0" + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + - annotation: "annotation_2" target_dn: "target_dn_1" + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + relation_to_trust_control_policy: - annotation: "annotation_1" trust_control_policy_name: "trust_control_policy_name_1" deletable_child: true + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + annotations: - key: "key_0" value: "value_1" @@ -313,5 +703,4 @@ child_targets: properties: name: "epg_3" class_version: 1.0(1e)- - -version_mismatch: true \ No newline at end of file +version_mismatch: true diff --git a/gen/testvars/fvBD.yaml b/gen/testvars/fvBD.yaml index 4a4f438a6..2f5a503e7 100644 --- a/gen/testvars/fvBD.yaml +++ b/gen/testvars/fvBD.yaml @@ -88,6 +88,21 @@ children: owner_key: "owner_key_1" owner_tag: "owner_tag_1" deletable_child: true + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + rogue_coop_exceptions: - annotation: "annotation_1" description: "description_1" @@ -95,71 +110,296 @@ children: name: "name_1" name_alias: "name_alias_1" + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + - annotation: "annotation_2" description: "description_2" mac: "00:00:00:00:00:01" name: "name_2" name_alias: "name_alias_2" + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + relation_to_monitor_policy: - annotation: "annotation_1" monitoring_policy_name: "monitoring_policy_name_1" deletable_child: true + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + relation_to_first_hop_security_policy: - annotation: "annotation_1" first_hop_security_policy_name: "first_hop_security_policy_name_1" deletable_child: true + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + relation_to_neighbor_discovery_interface_policy: - annotation: "annotation_1" neighbor_discovery_interface_policy_name: "neighbor_discovery_interface_policy_name_1" deletable_child: false + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + relation_to_netflow_monitor_policies: - annotation: "annotation_1" filter_type: "ce" netflow_monitor_policy_name: "netflow_monitor_policy_name_0" + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + - annotation: "annotation_2" filter_type: "ipv4" netflow_monitor_policy_name: "netflow_monitor_policy_name_1" + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + relation_to_l3_outsides: - annotation: "annotation_1" l3_outside_name: "l3_outside_name_0" + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + - annotation: "annotation_2" l3_outside_name: "l3_outside_name_1" + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + relation_to_route_control_profile: - annotation: "annotation_1" l3_outside_name: "l3_outside_name_1" route_control_profile_name: "route_control_profile_name_1" deletable_child: true + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + relation_to_dhcp_relay_policy: - annotation: "annotation_1" dhcp_relay_policy_name: "dhcp_relay_policy_name_1" deletable_child: true + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + relation_to_end_point_retention_policy: - annotation: "annotation_1" resolve_action: "inherit" end_point_retention_policy_name: "end_point_retention_policy_name_1" deletable_child: false + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + relation_to_vrf: - annotation: "annotation_1" vrf_name: "vrf_name_1" deletable_child: false + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + relation_to_igmp_snooping_policy: - annotation: "annotation_1" igmp_snooping_policy_name: "igmp_snooping_policy_name_1" deletable_child: false + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + relation_to_mld_snooping_policy: - annotation: "annotation_1" mld_snooping_policy_name: "mld_snooping_policy_name_1" deletable_child: false + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + annotations: - key: "key_0" value: "value_1" @@ -181,5 +421,4 @@ parents: class_in_parent: false test_type: apic class_version: 1.0(1e)- - -version_mismatch: true \ No newline at end of file +version_mismatch: true diff --git a/gen/testvars/fvCrtrn.yaml b/gen/testvars/fvCrtrn.yaml index 113066237..072e1e7bd 100644 --- a/gen/testvars/fvCrtrn.yaml +++ b/gen/testvars/fvCrtrn.yaml @@ -52,5 +52,4 @@ parents: class_in_parent: false test_type: apic class_version: 1.1(1j)- - -version_mismatch: true \ No newline at end of file +version_mismatch: true diff --git a/gen/testvars/fvESg.yaml b/gen/testvars/fvESg.yaml index a51b127a1..d17f2e7a8 100644 --- a/gen/testvars/fvESg.yaml +++ b/gen/testvars/fvESg.yaml @@ -45,49 +45,214 @@ children: priority: "level1" contract_name: "contract_name_0" + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + - annotation: "annotation_2" priority: "level2" contract_name: "contract_name_1" + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + relation_to_imported_contracts: - annotation: "annotation_1" priority: "level1" imported_contract_name: "imported_contract_name_0" + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + - annotation: "annotation_2" priority: "level2" imported_contract_name: "imported_contract_name_1" + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + relation_to_intra_epg_contracts: - annotation: "annotation_1" contract_name: "contract_name_0" + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + - annotation: "annotation_2" contract_name: "contract_name_1" + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + relation_to_provided_contracts: - annotation: "annotation_1" match_criteria: "All" priority: "level1" contract_name: "contract_name_0" + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + - annotation: "annotation_2" match_criteria: "AtleastOne" priority: "level2" contract_name: "contract_name_1" + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + relation_to_vrf: - annotation: "annotation_1" vrf_name: "vrf_name_1" deletable_child: false + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + relation_to_contract_masters: - annotation: "annotation_1" target_dn: "target_dn_0" + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + - annotation: "annotation_2" target_dn: "target_dn_1" + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + annotations: - key: "key_0" value: "value_1" @@ -132,5 +297,4 @@ child_targets: properties: name: "esg_1" class_version: 5.0(1k)- - -version_mismatch: true \ No newline at end of file +version_mismatch: true diff --git a/gen/testvars/fvFBRGroup.yaml b/gen/testvars/fvFBRGroup.yaml index ae7ee0160..8707396c3 100644 --- a/gen/testvars/fvFBRGroup.yaml +++ b/gen/testvars/fvFBRGroup.yaml @@ -30,12 +30,42 @@ children: name_alias: "name_alias_1" fallback_member: "2.2.2.2" + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + - annotation: "annotation_2" description: "description_2" name: "name_2" name_alias: "name_alias_2" fallback_member: "2.2.2.3" + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + vrf_fallback_route: - annotation: "annotation_1" description: "description_1" @@ -43,6 +73,21 @@ children: name: "name_1" name_alias: "name_alias_1" deletable_child: true + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + annotations: - key: "key_0" value: "value_1" diff --git a/gen/testvars/fvRsDomAtt.yaml b/gen/testvars/fvRsDomAtt.yaml index d55d78d1e..51c3a0b84 100644 --- a/gen/testvars/fvRsDomAtt.yaml +++ b/gen/testvars/fvRsDomAtt.yaml @@ -109,5 +109,4 @@ targets: static: true properties: class_version: 1.0(1e)- - -version_mismatch: true \ No newline at end of file +version_mismatch: true diff --git a/gen/testvars/igmpSnoopPol.yaml b/gen/testvars/igmpSnoopPol.yaml index 2d7a2a1ee..6e1931cb6 100644 --- a/gen/testvars/igmpSnoopPol.yaml +++ b/gen/testvars/igmpSnoopPol.yaml @@ -70,5 +70,4 @@ parents: class_in_parent: false test_type: both class_version: 1.0(1e)- - -version_mismatch: true \ No newline at end of file +version_mismatch: true diff --git a/gen/testvars/infraHPathS.yaml b/gen/testvars/infraHPathS.yaml index 27a3f1f72..a4c2cb002 100644 --- a/gen/testvars/infraHPathS.yaml +++ b/gen/testvars/infraHPathS.yaml @@ -31,10 +31,40 @@ children: - annotation: "annotation_1" target_dn: "target_dn_0" deletable_child: true + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + relation_to_access_interface_policy_group: - annotation: "annotation_1" target_dn: "target_dn_1" deletable_child: true + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + annotations: - key: "key_0" value: "value_1" @@ -59,5 +89,15 @@ child_targets: target_dn: "uni/infra/funcprof/accportgrp-access_interface_policy_group" relation_resource_name: "access_interface_policy_group" static: true +child_targets: + - class_name: "fabricPathEp" + target_dn: "topology/pod-1/paths-101/pathep-[eth1/1]" + relation_resource_name: "host_path" + static: true + - class_name: "infraAccPortGrp" + target_dn: "uni/infra/funcprof/accportgrp-access_interface_policy_group" + relation_resource_name: "access_interface_policy_group" + static: true + test_type: apic class_version: 1.1(1j)- diff --git a/gen/testvars/l3extConsLbl.yaml b/gen/testvars/l3extConsLbl.yaml index 05c7d9cfa..8f452fdfc 100644 --- a/gen/testvars/l3extConsLbl.yaml +++ b/gen/testvars/l3extConsLbl.yaml @@ -35,18 +35,78 @@ children: - annotation: "annotation_1" target_dn: "uni/tn-test_tenant/out-test_l3_outside/instP-inst_profile_1" + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + - annotation: "annotation_2" target_dn: "uni/tn-test_tenant/out-test_l3_outside/instP-inst_profile_2" + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + relation_to_route_control_profiles: - annotation: "annotation_1" direction: "export" target_dn: "uni/tn-test_tenant/prof-rt_ctrl_profile_1" + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + - annotation: "annotation_2" direction: "import" target_dn: "uni/tn-test_tenant/prof-rt_ctrl_profile_2" + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + annotations: - key: "key_0" value: "value_1" diff --git a/gen/testvars/mgmtInstP.yaml b/gen/testvars/mgmtInstP.yaml index 84ad12a38..82ac7f461 100644 --- a/gen/testvars/mgmtInstP.yaml +++ b/gen/testvars/mgmtInstP.yaml @@ -34,10 +34,40 @@ children: priority: "level1" out_of_band_contract_name: "out_of_band_contract_name_0" + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + - annotation: "annotation_2" priority: "level2" out_of_band_contract_name: "out_of_band_contract_name_1" + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + annotations: - key: "key_0" value: "value_1" @@ -52,5 +82,6 @@ children: - key: "key_1" value: "test_value" + test_type: both class_version: 1.0(1e)- diff --git a/gen/testvars/mldSnoopPol.yaml b/gen/testvars/mldSnoopPol.yaml index b88ceef8e..0701290b6 100644 --- a/gen/testvars/mldSnoopPol.yaml +++ b/gen/testvars/mldSnoopPol.yaml @@ -70,5 +70,4 @@ parents: class_in_parent: false test_type: both class_version: 4.1(1i)- - -version_mismatch: true \ No newline at end of file +version_mismatch: true diff --git a/gen/testvars/ndIfPol.yaml b/gen/testvars/ndIfPol.yaml index f66db592e..3c35f2330 100644 --- a/gen/testvars/ndIfPol.yaml +++ b/gen/testvars/ndIfPol.yaml @@ -77,5 +77,4 @@ parents: class_in_parent: false test_type: both class_version: 1.1(1j)- - -version_mismatch: true \ No newline at end of file +version_mismatch: true diff --git a/gen/testvars/netflowExporterPol.yaml b/gen/testvars/netflowExporterPol.yaml index 65b6de52f..2ac220956 100644 --- a/gen/testvars/netflowExporterPol.yaml +++ b/gen/testvars/netflowExporterPol.yaml @@ -53,10 +53,40 @@ children: - annotation: "annotation_1" target_dn: "target_dn_1" deletable_child: true + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + relation_to_epg: - annotation: "annotation_1" target_dn: "target_dn_1" deletable_child: true + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + annotations: - key: "key_0" value: "value_1" diff --git a/gen/testvars/netflowMonitorPol.yaml b/gen/testvars/netflowMonitorPol.yaml index 2f41c2a63..ce134ae5d 100644 --- a/gen/testvars/netflowMonitorPol.yaml +++ b/gen/testvars/netflowMonitorPol.yaml @@ -31,14 +31,59 @@ children: - annotation: "annotation_1" netflow_exporter_policy_name: "netflow_exporter_policy_name_0" + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + - annotation: "annotation_2" netflow_exporter_policy_name: "netflow_exporter_policy_name_1" + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + relation_to_netflow_record: - annotation: "annotation_1" netflow_record_policy_name: "netflow_record_policy_name_1" deletable_child: false + children: + annotations: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + + tags: + - key: "key_0" + value: "value_1" + + - key: "key_1" + value: "test_value" + annotations: - key: "key_0" value: "value_1" diff --git a/gen/testvars/pkiKeyRing.yaml b/gen/testvars/pkiKeyRing.yaml index dd1af97e4..27f4585c7 100644 --- a/gen/testvars/pkiKeyRing.yaml +++ b/gen/testvars/pkiKeyRing.yaml @@ -89,7 +89,6 @@ targets: certificate_chain: "-----BEGIN CERTIFICATE-----\\nMIICODCCAaGgAwIBAgIJAIt8XMntue0VMA0GCSqGSIb3DQEBCwUAMDQxDjAMBgNV\\nBAMMBUFkbWluMRUwEwYDVQQKDAxZb3VyIENvbXBhbnkxCzAJBgNVBAYTAlVTMCAX\\nDTE4MDEwOTAwNTk0NFoYDzIxMTcxMjE2MDA1OTQ0WjA0MQ4wDAYDVQQDDAVBZG1p\\nbjEVMBMGA1UECgwMWW91ciBDb21wYW55MQswCQYDVQQGEwJVUzCBnzANBgkqhkiG\\n9w0BAQEFAAOBjQAwgYkCgYEAohG/7axtt7CbSaMP7r+2mhTKbNgh0Ww36C7Ta14i\\nv+VmLyKkQHnXinKGhp6uy3Nug+15a+eIu7CrgpBVMQeCiWfsnwRocKcQJWIYDrWl\\nXHxGQn31yYKR6mylE7Dcj3rMFybnyhezr5D8GcP85YRPmwG9H2hO/0Y1FUnWu9Iw\\nAQkCAwEAAaNQME4wHQYDVR0OBBYEFD0jLXfpkrU/ChzRvfruRs/fy1VXMB8GA1Ud\\nIwQYMBaAFD0jLXfpkrU/ChzRvfruRs/fy1VXMAwGA1UdEwQFMAMBAf8wDQYJKoZI\\nhvcNAQELBQADgYEAOmvre+5tgZ0+F3DgsfxNQqLTrGiBgGCIymPkP/cBXXkNuJyl\\n3ac7tArHQc7WEA4U2R2rZbEq8FC3UJJm4nUVtCPvEh3G9OhN2xwYev79yt6pIn/l\\nKU0Td2OpVyo0eLqjoX5u2G90IBWzhyjFbo+CcKMrSVKj1YOdG0E3OuiJf00=\\n-----END CERTIFICATE-----" name: "test_name" class_version: 1.0(1e)- - exclude_attributes: - "key" -version_mismatch: true \ No newline at end of file +version_mismatch: true diff --git a/gen/testvars/rtctrlProfile.yaml b/gen/testvars/rtctrlProfile.yaml index c23b41cfe..b2cb7730e 100644 --- a/gen/testvars/rtctrlProfile.yaml +++ b/gen/testvars/rtctrlProfile.yaml @@ -61,5 +61,4 @@ parents: class_in_parent: false test_type: both class_version: 1.0(1e)- - -version_mismatch: true \ No newline at end of file +version_mismatch: true diff --git a/gen/testvars/vzOOBBrCP.yaml b/gen/testvars/vzOOBBrCP.yaml index 811303381..d0cf7fcbf 100644 --- a/gen/testvars/vzOOBBrCP.yaml +++ b/gen/testvars/vzOOBBrCP.yaml @@ -58,7 +58,7 @@ children: - key: "key_1" value: "test_value" + test_type: both class_version: 1.0(1e)- - -version_mismatch: true \ No newline at end of file +version_mismatch: true diff --git a/internal/provider/data_source_aci_access_interface_override.go b/internal/provider/data_source_aci_access_interface_override.go index 474f3cfca..4b2b92c53 100644 --- a/internal/provider/data_source_aci_access_interface_override.go +++ b/internal/provider/data_source_aci_access_interface_override.go @@ -85,6 +85,38 @@ func (d *InfraHPathSDataSource) Schema(ctx context.Context, req datasource.Schem Computed: true, MarkdownDescription: `The distinguished name of the target.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, "relation_to_access_interface_policy_group": schema.SingleNestedAttribute{ @@ -99,6 +131,38 @@ func (d *InfraHPathSDataSource) Schema(ctx context.Context, req datasource.Schem Computed: true, MarkdownDescription: `The distinguished name of the target.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, "annotations": schema.SetNestedAttribute{ diff --git a/internal/provider/data_source_aci_application_epg.go b/internal/provider/data_source_aci_application_epg.go index c3c8cb022..33b51356d 100644 --- a/internal/provider/data_source_aci_application_epg.go +++ b/internal/provider/data_source_aci_application_epg.go @@ -262,6 +262,38 @@ func (d *FvAEPgDataSource) Schema(ctx context.Context, req datasource.SchemaRequ Computed: true, MarkdownDescription: `The scope of the EPG uSeg Block Statement object.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, "relation_to_application_epg_monitoring_policy": schema.SingleNestedAttribute{ @@ -276,6 +308,38 @@ func (d *FvAEPgDataSource) Schema(ctx context.Context, req datasource.SchemaRequ Computed: true, MarkdownDescription: `The name of the monitoring policy.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, "relation_to_bridge_domain": schema.SingleNestedAttribute{ @@ -290,6 +354,38 @@ func (d *FvAEPgDataSource) Schema(ctx context.Context, req datasource.SchemaRequ Computed: true, MarkdownDescription: `The name of the bridge domain associated with this EPG.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, "relation_to_consumed_contracts": schema.SetNestedAttribute{ @@ -310,6 +406,38 @@ func (d *FvAEPgDataSource) Schema(ctx context.Context, req datasource.SchemaRequ Computed: true, MarkdownDescription: `The consumer contract name.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, }, @@ -331,6 +459,38 @@ func (d *FvAEPgDataSource) Schema(ctx context.Context, req datasource.SchemaRequ Computed: true, MarkdownDescription: `The contract interface name.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, }, @@ -346,6 +506,38 @@ func (d *FvAEPgDataSource) Schema(ctx context.Context, req datasource.SchemaRequ Computed: true, MarkdownDescription: `The Custom QoS traffic policy name.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, "relation_to_domains": schema.SetNestedAttribute{ @@ -453,6 +645,38 @@ func (d *FvAEPgDataSource) Schema(ctx context.Context, req datasource.SchemaRequ Computed: true, MarkdownDescription: `The untagged status of the Relation To Domain object.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, }, @@ -468,6 +692,38 @@ func (d *FvAEPgDataSource) Schema(ctx context.Context, req datasource.SchemaRequ Computed: true, MarkdownDescription: `Name.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, "relation_to_fibre_channel_paths": schema.SetNestedAttribute{ @@ -498,6 +754,38 @@ func (d *FvAEPgDataSource) Schema(ctx context.Context, req datasource.SchemaRequ Computed: true, MarkdownDescription: `The virtual storage area network (VSAN) mode of the Relation To Fibre Channel Path object.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, }, @@ -518,6 +806,38 @@ func (d *FvAEPgDataSource) Schema(ctx context.Context, req datasource.SchemaRequ Computed: true, MarkdownDescription: `The contract name.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, }, @@ -550,6 +870,38 @@ func (d *FvAEPgDataSource) Schema(ctx context.Context, req datasource.SchemaRequ Computed: true, MarkdownDescription: `The distinguished name of the target of this static binding.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, }, @@ -586,6 +938,38 @@ func (d *FvAEPgDataSource) Schema(ctx context.Context, req datasource.SchemaRequ Computed: true, MarkdownDescription: `null.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, }, @@ -602,6 +986,38 @@ func (d *FvAEPgDataSource) Schema(ctx context.Context, req datasource.SchemaRequ Computed: true, MarkdownDescription: `A contract for denying specific classes of traffic. Taboo rules are applied in the hardware before applying the rules of regular contracts. Without a contract, the default forwarding policy is to not allow any communication between EPGs.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, }, @@ -627,6 +1043,38 @@ func (d *FvAEPgDataSource) Schema(ctx context.Context, req datasource.SchemaRequ Computed: true, MarkdownDescription: `The provider contract name.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, }, @@ -643,6 +1091,38 @@ func (d *FvAEPgDataSource) Schema(ctx context.Context, req datasource.SchemaRequ Computed: true, MarkdownDescription: `The distinguished name of the target.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, }, @@ -658,6 +1138,38 @@ func (d *FvAEPgDataSource) Schema(ctx context.Context, req datasource.SchemaRequ Computed: true, MarkdownDescription: `Name.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, "annotations": schema.SetNestedAttribute{ diff --git a/internal/provider/data_source_aci_application_epg_test.go b/internal/provider/data_source_aci_application_epg_test.go index 89460beda..e8d592126 100644 --- a/internal/provider/data_source_aci_application_epg_test.go +++ b/internal/provider/data_source_aci_application_epg_test.go @@ -33,7 +33,7 @@ func TestAccDataSourceFvAEPgWithFvAp(t *testing.T) { resource.TestCheckResourceAttr("data.aci_application_epg.test", "preferred_group_member", "exclude"), resource.TestCheckResourceAttr("data.aci_application_epg.test", "priority", "unspecified"), resource.TestCheckResourceAttr("data.aci_application_epg.test", "useg_epg", "no"), - composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)", ">=", resource.TestCheckResourceAttr("data.aci_application_epg.test", "admin_state", "no"), resource.TestCheckResourceAttr("data.aci_application_epg.test", "has_multicast_source", "no")), resource.TestCheckResourceAttrSet("data.aci_application_epg.test", "pc_tag"), diff --git a/internal/provider/data_source_aci_bridge_domain.go b/internal/provider/data_source_aci_bridge_domain.go index ddb8d0c76..e27b64387 100644 --- a/internal/provider/data_source_aci_bridge_domain.go +++ b/internal/provider/data_source_aci_bridge_domain.go @@ -305,6 +305,38 @@ func (d *FvBDDataSource) Schema(ctx context.Context, req datasource.SchemaReques Computed: true, MarkdownDescription: `A tag for enabling clients to add their own data. For example, to indicate who created this object.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, "rogue_coop_exceptions": schema.SetNestedAttribute{ @@ -332,6 +364,38 @@ func (d *FvBDDataSource) Schema(ctx context.Context, req datasource.SchemaReques Computed: true, MarkdownDescription: `The name alias of the Rogue Coop Exception object.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, }, @@ -347,6 +411,38 @@ func (d *FvBDDataSource) Schema(ctx context.Context, req datasource.SchemaReques Computed: true, MarkdownDescription: `The name of the Monitoring Policy object.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, "relation_to_first_hop_security_policy": schema.SingleNestedAttribute{ @@ -361,6 +457,38 @@ func (d *FvBDDataSource) Schema(ctx context.Context, req datasource.SchemaReques Computed: true, MarkdownDescription: `The name of the First Hop Security Policy object.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, "relation_to_neighbor_discovery_interface_policy": schema.SingleNestedAttribute{ @@ -375,6 +503,38 @@ func (d *FvBDDataSource) Schema(ctx context.Context, req datasource.SchemaReques Computed: true, MarkdownDescription: `The name of the Neighbor Discovery Interface Policy object.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, "relation_to_netflow_monitor_policies": schema.SetNestedAttribute{ @@ -394,6 +554,38 @@ func (d *FvBDDataSource) Schema(ctx context.Context, req datasource.SchemaReques Computed: true, MarkdownDescription: `The name of the NetFlow Monitor Policy object.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, }, @@ -410,6 +602,38 @@ func (d *FvBDDataSource) Schema(ctx context.Context, req datasource.SchemaReques Computed: true, MarkdownDescription: `The name of the L3 Outside object.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, }, @@ -429,6 +653,38 @@ func (d *FvBDDataSource) Schema(ctx context.Context, req datasource.SchemaReques Computed: true, MarkdownDescription: `The name of the Route Control Profile object.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, "relation_to_dhcp_relay_policy": schema.SingleNestedAttribute{ @@ -443,6 +699,38 @@ func (d *FvBDDataSource) Schema(ctx context.Context, req datasource.SchemaReques Computed: true, MarkdownDescription: `The name of the DHCP Relay Policy object.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, "relation_to_end_point_retention_policy": schema.SingleNestedAttribute{ @@ -461,6 +749,38 @@ func (d *FvBDDataSource) Schema(ctx context.Context, req datasource.SchemaReques Computed: true, MarkdownDescription: `The name of the Endpoint Retention Policy object.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, "relation_to_vrf": schema.SingleNestedAttribute{ @@ -475,6 +795,38 @@ func (d *FvBDDataSource) Schema(ctx context.Context, req datasource.SchemaReques Computed: true, MarkdownDescription: `The name of the VRF object.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, "relation_to_igmp_snooping_policy": schema.SingleNestedAttribute{ @@ -489,6 +841,38 @@ func (d *FvBDDataSource) Schema(ctx context.Context, req datasource.SchemaReques Computed: true, MarkdownDescription: `The name of the IGMP Snooping Policy object.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, "relation_to_mld_snooping_policy": schema.SingleNestedAttribute{ @@ -503,6 +887,38 @@ func (d *FvBDDataSource) Schema(ctx context.Context, req datasource.SchemaReques Computed: true, MarkdownDescription: `The name of the MLD Snooping Policy object.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, "annotations": schema.SetNestedAttribute{ diff --git a/internal/provider/data_source_aci_bridge_domain_test.go b/internal/provider/data_source_aci_bridge_domain_test.go index a98353e36..d4d6d3953 100644 --- a/internal/provider/data_source_aci_bridge_domain_test.go +++ b/internal/provider/data_source_aci_bridge_domain_test.go @@ -43,13 +43,13 @@ func TestAccDataSourceFvBDWithFvTenant(t *testing.T) { resource.TestCheckResourceAttr("data.aci_bridge_domain.test", "owner_tag", ""), resource.TestCheckResourceAttr("data.aci_bridge_domain.test", "pim", "no"), resource.TestCheckResourceAttr("data.aci_bridge_domain.test", "unicast_routing", "yes"), - composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)", ">=", resource.TestCheckResourceAttr("data.aci_bridge_domain.test", "advertise_host_routes", "no")), - composeAggregateTestCheckFuncWithVersion(t, "4.1(1i)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.1(1i)", ">=", resource.TestCheckResourceAttr("data.aci_bridge_domain.test", "ipv6_l3_unknown_multicast_flooding", "flood")), - composeAggregateTestCheckFuncWithVersion(t, "4.2(1i)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.2(1i)", ">=", resource.TestCheckResourceAttr("data.aci_bridge_domain.test", "pim_ipv6", "no")), - composeAggregateTestCheckFuncWithVersion(t, "5.2(5c)", ">", + composeAggregateTestCheckFuncWithVersion(t, "5.2(5c)", ">=", resource.TestCheckResourceAttr("data.aci_bridge_domain.test", "drop_arp_with_multicast_smac", "yes")), resource.TestCheckResourceAttr("data.aci_bridge_domain.test", "virtual_mac_address", "not-applicable"), ), diff --git a/internal/provider/data_source_aci_endpoint_security_group.go b/internal/provider/data_source_aci_endpoint_security_group.go index 59fcfcdd1..7bb530f56 100644 --- a/internal/provider/data_source_aci_endpoint_security_group.go +++ b/internal/provider/data_source_aci_endpoint_security_group.go @@ -149,6 +149,38 @@ func (d *FvESgDataSource) Schema(ctx context.Context, req datasource.SchemaReque Computed: true, MarkdownDescription: `The consumer contract name.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, }, @@ -170,6 +202,38 @@ func (d *FvESgDataSource) Schema(ctx context.Context, req datasource.SchemaReque Computed: true, MarkdownDescription: `The contract interface name.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, }, @@ -190,6 +254,38 @@ func (d *FvESgDataSource) Schema(ctx context.Context, req datasource.SchemaReque Computed: true, MarkdownDescription: `The contract name.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, }, @@ -215,6 +311,38 @@ func (d *FvESgDataSource) Schema(ctx context.Context, req datasource.SchemaReque Computed: true, MarkdownDescription: `The provider contract name.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, }, @@ -230,6 +358,38 @@ func (d *FvESgDataSource) Schema(ctx context.Context, req datasource.SchemaReque Computed: true, MarkdownDescription: `The name of the VRF object.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, "relation_to_contract_masters": schema.SetNestedAttribute{ @@ -245,6 +405,38 @@ func (d *FvESgDataSource) Schema(ctx context.Context, req datasource.SchemaReque Computed: true, MarkdownDescription: `The distinguished name of the target.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, }, diff --git a/internal/provider/data_source_aci_endpoint_security_group_test.go b/internal/provider/data_source_aci_endpoint_security_group_test.go index 343ec16e5..406d35735 100644 --- a/internal/provider/data_source_aci_endpoint_security_group_test.go +++ b/internal/provider/data_source_aci_endpoint_security_group_test.go @@ -29,7 +29,7 @@ func TestAccDataSourceFvESgWithFvAp(t *testing.T) { resource.TestCheckResourceAttr("data.aci_endpoint_security_group.test", "match_criteria", "AtleastOne"), resource.TestCheckResourceAttr("data.aci_endpoint_security_group.test", "name_alias", ""), resource.TestCheckResourceAttr("data.aci_endpoint_security_group.test", "preferred_group_member", "exclude"), - composeAggregateTestCheckFuncWithVersion(t, "5.2(1g)", ">", + composeAggregateTestCheckFuncWithVersion(t, "5.2(1g)", ">=", resource.TestCheckResourceAttr("data.aci_endpoint_security_group.test", "admin_state", "no")), resource.TestCheckResourceAttrSet("data.aci_endpoint_security_group.test", "pc_tag"), ), diff --git a/internal/provider/data_source_aci_epg_useg_block_statement_test.go b/internal/provider/data_source_aci_epg_useg_block_statement_test.go index 047315507..e79f920d6 100644 --- a/internal/provider/data_source_aci_epg_useg_block_statement_test.go +++ b/internal/provider/data_source_aci_epg_useg_block_statement_test.go @@ -28,7 +28,7 @@ func TestAccDataSourceFvCrtrnWithFvAEPg(t *testing.T) { resource.TestCheckResourceAttr("data.aci_epg_useg_block_statement.test", "name_alias", ""), resource.TestCheckResourceAttr("data.aci_epg_useg_block_statement.test", "owner_key", ""), resource.TestCheckResourceAttr("data.aci_epg_useg_block_statement.test", "owner_tag", ""), - composeAggregateTestCheckFuncWithVersion(t, "4.1(1i)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.1(1i)", ">=", resource.TestCheckResourceAttr("data.aci_epg_useg_block_statement.test", "precedence", "0"), resource.TestCheckResourceAttr("data.aci_epg_useg_block_statement.test", "scope", "scope-bd")), ), diff --git a/internal/provider/data_source_aci_external_management_network_instance_profile.go b/internal/provider/data_source_aci_external_management_network_instance_profile.go index 1f2104e58..fe262b0ad 100644 --- a/internal/provider/data_source_aci_external_management_network_instance_profile.go +++ b/internal/provider/data_source_aci_external_management_network_instance_profile.go @@ -84,6 +84,38 @@ func (d *MgmtInstPDataSource) Schema(ctx context.Context, req datasource.SchemaR Computed: true, MarkdownDescription: `The name of the Out Of Band Contract object.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, }, diff --git a/internal/provider/data_source_aci_first_hop_security_policy.go b/internal/provider/data_source_aci_first_hop_security_policy.go index 41b454d35..d8fc1ea79 100644 --- a/internal/provider/data_source_aci_first_hop_security_policy.go +++ b/internal/provider/data_source_aci_first_hop_security_policy.go @@ -140,6 +140,38 @@ func (d *FhsBDPolDataSource) Schema(ctx context.Context, req datasource.SchemaRe Computed: true, MarkdownDescription: `A tag for enabling clients to add their own data. For example, to indicate who created this object.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, "annotations": schema.SetNestedAttribute{ diff --git a/internal/provider/data_source_aci_igmp_snooping_policy_test.go b/internal/provider/data_source_aci_igmp_snooping_policy_test.go index 45fe3229c..74380631a 100644 --- a/internal/provider/data_source_aci_igmp_snooping_policy_test.go +++ b/internal/provider/data_source_aci_igmp_snooping_policy_test.go @@ -34,7 +34,7 @@ func TestAccDataSourceIgmpSnoopPolWithFvTenant(t *testing.T) { resource.TestCheckResourceAttr("data.aci_igmp_snooping_policy.test", "response_interval", "10"), resource.TestCheckResourceAttr("data.aci_igmp_snooping_policy.test", "start_query_count", "2"), resource.TestCheckResourceAttr("data.aci_igmp_snooping_policy.test", "start_query_interval", "31"), - composeAggregateTestCheckFuncWithVersion(t, "5.1(1h)", ">", + composeAggregateTestCheckFuncWithVersion(t, "5.1(1h)", ">=", resource.TestCheckResourceAttr("data.aci_igmp_snooping_policy.test", "querier_version", "v3")), ), }, diff --git a/internal/provider/data_source_aci_key_ring_test.go b/internal/provider/data_source_aci_key_ring_test.go index cf2fb0cc6..fa98a29b1 100644 --- a/internal/provider/data_source_aci_key_ring_test.go +++ b/internal/provider/data_source_aci_key_ring_test.go @@ -32,7 +32,7 @@ func TestAccDataSourcePkiKeyRing(t *testing.T) { resource.TestCheckResourceAttr("data.aci_key_ring.test", "owner_key", ""), resource.TestCheckResourceAttr("data.aci_key_ring.test", "owner_tag", ""), resource.TestCheckResourceAttr("data.aci_key_ring.test", "regenerate", "no"), - composeAggregateTestCheckFuncWithVersion(t, "6.0(2h)", ">", + composeAggregateTestCheckFuncWithVersion(t, "6.0(2h)", ">=", resource.TestCheckResourceAttr("data.aci_key_ring.test", "elliptic_curve", "none"), resource.TestCheckResourceAttr("data.aci_key_ring.test", "key_type", "RSA")), ), @@ -65,7 +65,7 @@ func TestAccDataSourcePkiKeyRingWithFvTenant(t *testing.T) { resource.TestCheckResourceAttr("data.aci_key_ring.test", "owner_key", ""), resource.TestCheckResourceAttr("data.aci_key_ring.test", "owner_tag", ""), resource.TestCheckResourceAttr("data.aci_key_ring.test", "regenerate", "no"), - composeAggregateTestCheckFuncWithVersion(t, "6.0(2h)", ">", + composeAggregateTestCheckFuncWithVersion(t, "6.0(2h)", ">=", resource.TestCheckResourceAttr("data.aci_key_ring.test", "elliptic_curve", "none"), resource.TestCheckResourceAttr("data.aci_key_ring.test", "key_type", "RSA")), ), diff --git a/internal/provider/data_source_aci_l3out_consumer_label.go b/internal/provider/data_source_aci_l3out_consumer_label.go index 257d73a6c..a349183dd 100644 --- a/internal/provider/data_source_aci_l3out_consumer_label.go +++ b/internal/provider/data_source_aci_l3out_consumer_label.go @@ -93,6 +93,38 @@ func (d *L3extConsLblDataSource) Schema(ctx context.Context, req datasource.Sche Computed: true, MarkdownDescription: `The distinguished name (DN) of the External EPG object.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, }, @@ -113,6 +145,38 @@ func (d *L3extConsLblDataSource) Schema(ctx context.Context, req datasource.Sche Computed: true, MarkdownDescription: `The distinguished name (DN) of the Route Control Profile object.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, }, diff --git a/internal/provider/data_source_aci_management_access_policy.go b/internal/provider/data_source_aci_management_access_policy.go new file mode 100644 index 000000000..c9b61de4c --- /dev/null +++ b/internal/provider/data_source_aci_management_access_policy.go @@ -0,0 +1,705 @@ +// Code generated by "gen/generator.go"; DO NOT EDIT. +// In order to regenerate this file execute `go generate` from the repository root. +// More details can be found in the [README](https://github.com/CiscoDevNet/terraform-provider-aci/blob/master/README.md). + +package provider + +import ( + "context" + "fmt" + + "github.com/ciscoecosystem/aci-go-client/v2/client" + + "github.com/hashicorp/terraform-plugin-framework/datasource" + "github.com/hashicorp/terraform-plugin-framework/datasource/schema" + "github.com/hashicorp/terraform-plugin-framework/types" + "github.com/hashicorp/terraform-plugin-log/tflog" +) + +// Ensure provider defined types fully satisfy framework interfaces. +var _ datasource.DataSource = &CommPolDataSource{} + +func NewCommPolDataSource() datasource.DataSource { + return &CommPolDataSource{} +} + +// CommPolDataSource defines the data source implementation. +type CommPolDataSource struct { + client *client.Client +} + +func (d *CommPolDataSource) Metadata(ctx context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) { + tflog.Debug(ctx, "Start metadata of datasource: aci_management_access_policy") + resp.TypeName = req.ProviderTypeName + "_management_access_policy" + tflog.Debug(ctx, "End metadata of datasource: aci_management_access_policy") +} + +func (d *CommPolDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) { + tflog.Debug(ctx, "Start schema of datasource: aci_management_access_policy") + resp.Schema = schema.Schema{ + // This description is used by the documentation generator and the language server. + MarkdownDescription: "The management_access_policy datasource for the 'commPol' class", + + Attributes: map[string]schema.Attribute{ + "id": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "The distinguished name (DN) of the Management Access Policy object.", + }, + "annotation": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The annotation of the Management Access Policy object.`, + }, + "description": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The description of the Management Access Policy object.`, + }, + "name": schema.StringAttribute{ + Required: true, + MarkdownDescription: `The name of the Management Access Policy object.`, + }, + "name_alias": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The name alias of the Management Access Policy object.`, + }, + "owner_key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key for enabling clients to own their data for entity correlation.`, + }, + "owner_tag": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `A tag for enabling clients to add their own data. For example, to indicate who created this object.`, + }, + "strict_security_on_apic_oob_subnet": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `Removes implicit access permissions from any APIC out-of-band (OOB) subnet IP address.`, + }, + "http_service": schema.SingleNestedAttribute{ + MarkdownDescription: `HTTP`, + Computed: true, + Attributes: map[string]schema.Attribute{ + "access_control_allow_credential": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `Determines if credentials are allowed in HTTP (Hypertext Transfer Protocol) responses.`, + }, + "access_control_allow_origins": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `Determines which origins can access the resource. For example, inputting http://127.0.0.1:8000 would allow access from a source device with that IP address and port.`, + }, + "admin_state": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The administrative state of the HTTP (Hypertext Transfer Protocol) Service.`, + }, + "annotation": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The annotation of the HTTP (Hypertext Transfer Protocol) Service object.`, + }, + "cli_only_mode": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `Determines if CLI-only mode is enabled.`, + }, + "description": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The description of the HTTP (Hypertext Transfer Protocol) Service object.`, + }, + "global_throttle_rate": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `Maximum API calls allowed per unit time.`, + }, + "global_throttle_state": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The throttle state for all clients without specific identifier in their headers.`, + }, + "global_throttle_unit": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The unit of measurement for rate limiting.`, + }, + "max_request_status_count": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The maximum number of request status objects to keep.`, + }, + "name": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The name of the HTTP (Hypertext Transfer Protocol) Service object.`, + }, + "name_alias": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The name alias of the HTTP (Hypertext Transfer Protocol) Service object.`, + }, + "node_exporter": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `Node Exporter service status.`, + }, + "port": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The port used for HTTP communication service.`, + }, + "redirect_state": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The state of HTTP (Hypertext Transfer Protocol) communication service.`, + }, + "server_header": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `Determines if the server header is included in responses.`, + }, + "throttle_rate": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The maximum login/refresh allowed per second.`, + }, + "throttle_state": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The state of login and refresh throttling.`, + }, + "visore_access": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `Grants permissions for accessing the Visore tool in Cisco ACI.`, + }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + }, + }, + "http_ssl_configuration": schema.SingleNestedAttribute{ + MarkdownDescription: `HTTPS`, + Computed: true, + Attributes: map[string]schema.Attribute{ + "access_control_allow_credential": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `Determines if credentials are allowed in HTTP (Hypertext Transfer Protocol) SSL (Secure Sockets Layer) responses.`, + }, + "access_control_allow_origins": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `Determines which origins can access the resource. For example, inputting http://127.0.0.1:8000 would allow access from a source device with that IP address and port.`, + }, + "admin_state": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The administrative state of the HTTP (Hypertext Transfer Protocol) SSL (Secure Sockets Layer) Service.`, + }, + "annotation": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The annotation of the HTTP (Hypertext Transfer Protocol) SSL (Secure Sockets Layer) Configuration object.`, + }, + "cli_only_mode": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `Determines if CLI-only mode is enabled.`, + }, + "client_cert_auth_state": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `State of client certificate authentication.`, + }, + "description": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The description of the HTTP (Hypertext Transfer Protocol) SSL (Secure Sockets Layer) Configuration object.`, + }, + "dh_param": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `Determines the settings for DH (Diffie-Hellman) parameters.`, + }, + "global_throttle_rate": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `Maximum API calls allowed per unit time.`, + }, + "global_throttle_state": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The throttle state for all clients without specific identifier in their headers.`, + }, + "global_throttle_unit": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The unit of measurement for rate limiting.`, + }, + "max_request_status_count": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The maximum number of request status objects to keep.`, + }, + "name": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The name of the HTTP (Hypertext Transfer Protocol) SSL (Secure Sockets Layer) Configuration object.`, + }, + "name_alias": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The name alias of the HTTP (Hypertext Transfer Protocol) SSL (Secure Sockets Layer) Configuration object.`, + }, + "node_exporter": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `Node Exporter service status.`, + }, + "port": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The port used for HTTPS communication service.`, + }, + "referer": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `Allowed HTTP referers.`, + }, + "server_header": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `Determines if the server header is included in responses.`, + }, + "ssl_protocols": schema.SetAttribute{ + Computed: true, + MarkdownDescription: `The Secure Socket Layer (SSL) protocol.`, + ElementType: types.StringType, + }, + "throttle_rate": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The maximum login/refresh allowed per second.`, + }, + "throttle_state": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The state of login and refresh throttling.`, + }, + "visore_access": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `Grants permissions for accessing the Visore tool in Cisco ACI.`, + }, + "certificate_authority": schema.SingleNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + Attributes: map[string]schema.Attribute{ + "annotation": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The annotation of the Certificate Authority object.`, + }, + "target_dn": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The distinguished name of the target.`, + }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + }, + }, + "key_ring": schema.SingleNestedAttribute{ + MarkdownDescription: `A source relation to a key ring.`, + Computed: true, + Attributes: map[string]schema.Attribute{ + "annotation": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The annotation of the Key Ring object.`, + }, + "key_ring_name": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The HTTP connection key ring. Each PKI device holds a pair of asymmetric Rivest-Shamir-Adleman (RSA) or Elliptic Curve Cryptography (ECC) encryption keys, one kept private and one made public, stored in an internal key ring.`, + }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + }, + }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + }, + }, + "ssh_access_via_web": schema.SingleNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + Attributes: map[string]schema.Attribute{ + "admin_state": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The administrative state of the SSH (Secure Shell) access via WEB object.`, + }, + "annotation": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The annotation of the SSH (Secure Shell) access via WEB object.`, + }, + "description": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The description of the SSH (Secure Shell) access via WEB object.`, + }, + "name": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The name of the SSH (Secure Shell) access via WEB object.`, + }, + "name_alias": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The name alias of the SSH (Secure Shell) access via WEB object.`, + }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + }, + }, + "ssh_service": schema.SingleNestedAttribute{ + MarkdownDescription: `Object that encompasses properties related to Secure Shell access to the APIC, namely admin-state (default=enabled) and port(default=22).`, + Computed: true, + Attributes: map[string]schema.Attribute{ + "admin_state": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The administrative state of the SSH (Secure Shell) Service object.`, + }, + "annotation": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The annotation of the SSH (Secure Shell) Service object.`, + }, + "description": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The description of the SSH (Secure Shell) Service object.`, + }, + "host_key_algorithms": schema.SetAttribute{ + Computed: true, + MarkdownDescription: `The supported algorithms for the host key.`, + ElementType: types.StringType, + }, + "key_exchange_algorithms": schema.SetAttribute{ + Computed: true, + MarkdownDescription: `The supported algorithms for key exchange.`, + ElementType: types.StringType, + }, + "name": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The name of the SSH (Secure Shell) Service object.`, + }, + "name_alias": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The name alias of the SSH (Secure Shell) Service object.`, + }, + "password_auth": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `State of password authentication.`, + }, + "port": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The SSH port.`, + }, + "ssh_ciphers": schema.SetAttribute{ + Computed: true, + MarkdownDescription: `Ciphers supported for SSH.`, + ElementType: types.StringType, + }, + "ssh_macs": schema.SetAttribute{ + Computed: true, + MarkdownDescription: `Message authentication codes (MACs) supported for SSH.`, + ElementType: types.StringType, + }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + }, + }, + "telnet_service": schema.SingleNestedAttribute{ + MarkdownDescription: `Telnet`, + Computed: true, + Attributes: map[string]schema.Attribute{ + "admin_state": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The administrative state of the Telnet Service object.`, + }, + "annotation": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The annotation of the Telnet Service object.`, + }, + "description": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The description of the Telnet Service object.`, + }, + "name": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The name of the Telnet Service object.`, + }, + "name_alias": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The name alias of the Telnet Service object.`, + }, + "port": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The port used for Telnet communication service.`, + }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + }, + }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + }, + } + tflog.Debug(ctx, "End schema of datasource: aci_management_access_policy") +} + +func (d *CommPolDataSource) Configure(ctx context.Context, req datasource.ConfigureRequest, resp *datasource.ConfigureResponse) { + tflog.Debug(ctx, "Start configure of datasource: aci_management_access_policy") + // Prevent panic if the provider has not been configured. + if req.ProviderData == nil { + return + } + + client, ok := req.ProviderData.(*client.Client) + + if !ok { + resp.Diagnostics.AddError( + "Unexpected Data Source Configure Type", + fmt.Sprintf("Expected *client.Client, got: %T. Please report this issue to the provider developers.", req.ProviderData), + ) + + return + } + + d.client = client + tflog.Debug(ctx, "End configure of datasource: aci_management_access_policy") +} + +func (d *CommPolDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) { + tflog.Debug(ctx, "Start read of datasource: aci_management_access_policy") + var data *CommPolResourceModel + + // Read Terraform configuration data into the model + resp.Diagnostics.Append(req.Config.Get(ctx, &data)...) + + if resp.Diagnostics.HasError() { + return + } + + setCommPolId(ctx, data) + + // Create a copy of the Id for when not found during getAndSetCommPolAttributes + cachedId := data.Id.ValueString() + + tflog.Debug(ctx, fmt.Sprintf("Read of datasource aci_management_access_policy with id '%s'", data.Id.ValueString())) + + getAndSetCommPolAttributes(ctx, &resp.Diagnostics, d.client, data) + + if data.Id.IsNull() { + resp.Diagnostics.AddError( + "Failed to read aci_management_access_policy data source", + fmt.Sprintf("The aci_management_access_policy data source with id '%s' has not been found", cachedId), + ) + return + } + + // Save data into Terraform state + resp.Diagnostics.Append(resp.State.Set(ctx, &data)...) + tflog.Debug(ctx, fmt.Sprintf("End read of datasource aci_management_access_policy with id '%s'", data.Id.ValueString())) +} diff --git a/internal/provider/data_source_aci_management_access_policy_test.go b/internal/provider/data_source_aci_management_access_policy_test.go new file mode 100644 index 000000000..3ba11540b --- /dev/null +++ b/internal/provider/data_source_aci_management_access_policy_test.go @@ -0,0 +1,49 @@ +// Code generated by "gen/generator.go"; DO NOT EDIT. +// In order to regenerate this file execute `go generate` from the repository root. +// More details can be found in the [README](https://github.com/CiscoDevNet/terraform-provider-aci/blob/master/README.md). + +package provider + +import ( + "regexp" + "testing" + + "github.com/hashicorp/terraform-plugin-testing/helper/resource" +) + +func TestAccDataSourceCommPol(t *testing.T) { + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t, "both", "6.0(2h)") }, + ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, + Steps: []resource.TestStep{ + { + Config: testConfigCommPolDataSource + testConfigDataSourceSystem, + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr("data.aci_management_access_policy.test", "annotation", "annotation"), + resource.TestCheckResourceAttr("data.aci_management_access_policy.test", "description", "description_1"), + resource.TestCheckResourceAttr("data.aci_management_access_policy.test", "name_alias", "name_alias_1"), + resource.TestCheckResourceAttr("data.aci_management_access_policy.test", "owner_key", "owner_key_1"), + resource.TestCheckResourceAttr("data.aci_management_access_policy.test", "owner_tag", "owner_tag_1"), + ), + }, + { + Config: testConfigCommPolNotExisting + testConfigDataSourceSystem, + ExpectError: regexp.MustCompile("Failed to read aci_management_access_policy data source"), + }, + }, + }) +} + +const testConfigCommPolDataSource = testConfigCommPolAll + ` +data "aci_management_access_policy" "test" { + name = "test_name" + depends_on = [aci_management_access_policy.test] +} +` + +const testConfigCommPolNotExisting = testConfigCommPolAll + ` +data "aci_management_access_policy" "test_non_existing" { + name = "non_existing_name" +} +` diff --git a/internal/provider/data_source_aci_mld_snooping_policy_test.go b/internal/provider/data_source_aci_mld_snooping_policy_test.go index e01a46e24..88129f8ee 100644 --- a/internal/provider/data_source_aci_mld_snooping_policy_test.go +++ b/internal/provider/data_source_aci_mld_snooping_policy_test.go @@ -34,7 +34,7 @@ func TestAccDataSourceMldSnoopPolWithFvTenant(t *testing.T) { resource.TestCheckResourceAttr("data.aci_mld_snooping_policy.test", "response_interval", "10"), resource.TestCheckResourceAttr("data.aci_mld_snooping_policy.test", "start_query_count", "2"), resource.TestCheckResourceAttr("data.aci_mld_snooping_policy.test", "start_query_interval", "31"), - composeAggregateTestCheckFuncWithVersion(t, "5.1(1h)", ">", + composeAggregateTestCheckFuncWithVersion(t, "5.1(1h)", ">=", resource.TestCheckResourceAttr("data.aci_mld_snooping_policy.test", "version", "v2")), ), }, diff --git a/internal/provider/data_source_aci_neighbor_discovery_interface_policy_test.go b/internal/provider/data_source_aci_neighbor_discovery_interface_policy_test.go index be5b80fdd..0003ed3f9 100644 --- a/internal/provider/data_source_aci_neighbor_discovery_interface_policy_test.go +++ b/internal/provider/data_source_aci_neighbor_discovery_interface_policy_test.go @@ -36,7 +36,7 @@ func TestAccDataSourceNdIfPolWithFvTenant(t *testing.T) { resource.TestCheckResourceAttr("data.aci_neighbor_discovery_interface_policy.test", "retransmit_timer", "0"), resource.TestCheckResourceAttr("data.aci_neighbor_discovery_interface_policy.test", "router_advertisement_interval", "600"), resource.TestCheckResourceAttr("data.aci_neighbor_discovery_interface_policy.test", "router_advertisement_lifetime", "1800"), - composeAggregateTestCheckFuncWithVersion(t, "5.1(1h)", ">", + composeAggregateTestCheckFuncWithVersion(t, "5.1(1h)", ">=", resource.TestCheckResourceAttr("data.aci_neighbor_discovery_interface_policy.test", "nud_retry_base", "1"), resource.TestCheckResourceAttr("data.aci_neighbor_discovery_interface_policy.test", "nud_retry_interval", "1000"), resource.TestCheckResourceAttr("data.aci_neighbor_discovery_interface_policy.test", "nud_retry_max_attempts", "3")), diff --git a/internal/provider/data_source_aci_netflow_exporter_policy.go b/internal/provider/data_source_aci_netflow_exporter_policy.go index 13064088e..dcb298bb3 100644 --- a/internal/provider/data_source_aci_netflow_exporter_policy.go +++ b/internal/provider/data_source_aci_netflow_exporter_policy.go @@ -112,6 +112,38 @@ func (d *NetflowExporterPolDataSource) Schema(ctx context.Context, req datasourc Computed: true, MarkdownDescription: `The distinguished name of the target.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, "relation_to_epg": schema.SingleNestedAttribute{ @@ -126,6 +158,38 @@ func (d *NetflowExporterPolDataSource) Schema(ctx context.Context, req datasourc Computed: true, MarkdownDescription: `The distinguished name of the target.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, "annotations": schema.SetNestedAttribute{ diff --git a/internal/provider/data_source_aci_netflow_monitor_policy.go b/internal/provider/data_source_aci_netflow_monitor_policy.go index f12063190..9ab7115cc 100644 --- a/internal/provider/data_source_aci_netflow_monitor_policy.go +++ b/internal/provider/data_source_aci_netflow_monitor_policy.go @@ -86,6 +86,38 @@ func (d *NetflowMonitorPolDataSource) Schema(ctx context.Context, req datasource Computed: true, MarkdownDescription: `Name.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, }, @@ -101,6 +133,38 @@ func (d *NetflowMonitorPolDataSource) Schema(ctx context.Context, req datasource Computed: true, MarkdownDescription: `Name.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, "annotations": schema.SetNestedAttribute{ diff --git a/internal/provider/data_source_aci_out_of_band_contract_test.go b/internal/provider/data_source_aci_out_of_band_contract_test.go index 3e89f47db..57e195def 100644 --- a/internal/provider/data_source_aci_out_of_band_contract_test.go +++ b/internal/provider/data_source_aci_out_of_band_contract_test.go @@ -28,7 +28,7 @@ func TestAccDataSourceVzOOBBrCP(t *testing.T) { resource.TestCheckResourceAttr("data.aci_out_of_band_contract.test", "priority", "level1"), resource.TestCheckResourceAttr("data.aci_out_of_band_contract.test", "scope", "application-profile"), resource.TestCheckResourceAttr("data.aci_out_of_band_contract.test", "target_dscp", "AF11"), - composeAggregateTestCheckFuncWithVersion(t, "4.2(1i)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.2(1i)", ">=", resource.TestCheckResourceAttr("data.aci_out_of_band_contract.test", "intent", "estimate_add")), ), }, diff --git a/internal/provider/data_source_aci_relation_to_domain_test.go b/internal/provider/data_source_aci_relation_to_domain_test.go index fcf9bd5d6..ac0677b9c 100644 --- a/internal/provider/data_source_aci_relation_to_domain_test.go +++ b/internal/provider/data_source_aci_relation_to_domain_test.go @@ -39,11 +39,11 @@ func TestAccDataSourceFvRsDomAttWithFvAEPg(t *testing.T) { resource.TestCheckResourceAttr("data.aci_relation_to_domain.test", "secondary_encapsulation_inner", "unknown"), resource.TestCheckResourceAttr("data.aci_relation_to_domain.test", "switching_mode", "native"), resource.TestCheckResourceAttr("data.aci_relation_to_domain.test", "untagged", "no"), - composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)", ">=", resource.TestCheckResourceAttr("data.aci_relation_to_domain.test", "binding_type", "none"), resource.TestCheckResourceAttr("data.aci_relation_to_domain.test", "number_of_ports", "0"), resource.TestCheckResourceAttr("data.aci_relation_to_domain.test", "port_allocation", "none")), - composeAggregateTestCheckFuncWithVersion(t, "4.2(3j)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.2(3j)", ">=", resource.TestCheckResourceAttr("data.aci_relation_to_domain.test", "custom_epg_name", "")), ), }, diff --git a/internal/provider/data_source_aci_route_control_profile_test.go b/internal/provider/data_source_aci_route_control_profile_test.go index f0607013e..f443b6f67 100644 --- a/internal/provider/data_source_aci_route_control_profile_test.go +++ b/internal/provider/data_source_aci_route_control_profile_test.go @@ -28,7 +28,7 @@ func TestAccDataSourceRtctrlProfileWithFvTenant(t *testing.T) { resource.TestCheckResourceAttr("data.aci_route_control_profile.test", "owner_key", ""), resource.TestCheckResourceAttr("data.aci_route_control_profile.test", "owner_tag", ""), resource.TestCheckResourceAttr("data.aci_route_control_profile.test", "route_control_profile_type", "combinable"), - composeAggregateTestCheckFuncWithVersion(t, "4.2(6d)-4.2(7w),5.1(3e)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.2(6d)-4.2(7w),5.1(3e)", ">=", resource.TestCheckResourceAttr("data.aci_route_control_profile.test", "route_map_continue", "no")), ), }, @@ -56,7 +56,7 @@ func TestAccDataSourceRtctrlProfileWithL3extOut(t *testing.T) { resource.TestCheckResourceAttr("data.aci_route_control_profile.test", "owner_key", ""), resource.TestCheckResourceAttr("data.aci_route_control_profile.test", "owner_tag", ""), resource.TestCheckResourceAttr("data.aci_route_control_profile.test", "route_control_profile_type", "combinable"), - composeAggregateTestCheckFuncWithVersion(t, "4.2(6d)-4.2(7w),5.1(3e)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.2(6d)-4.2(7w),5.1(3e)", ">=", resource.TestCheckResourceAttr("data.aci_route_control_profile.test", "route_map_continue", "no")), ), }, diff --git a/internal/provider/data_source_aci_vrf_fallback_route_group.go b/internal/provider/data_source_aci_vrf_fallback_route_group.go index 0086672bf..e89de56d1 100644 --- a/internal/provider/data_source_aci_vrf_fallback_route_group.go +++ b/internal/provider/data_source_aci_vrf_fallback_route_group.go @@ -89,6 +89,38 @@ func (d *FvFBRGroupDataSource) Schema(ctx context.Context, req datasource.Schema Computed: true, MarkdownDescription: `The address of the VRF Fallback Route Group Member object.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, }, @@ -116,6 +148,38 @@ func (d *FvFBRGroupDataSource) Schema(ctx context.Context, req datasource.Schema Computed: true, MarkdownDescription: `The name alias of the VRF Fallback Route object.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, "annotations": schema.SetNestedAttribute{ diff --git a/internal/provider/provider.go b/internal/provider/provider.go index 5f8ca9d11..e19ebd466 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -206,6 +206,7 @@ func (p *AciProvider) Configure(ctx context.Context, req provider.ConfigureReque func (p *AciProvider) Resources(ctx context.Context) []func() resource.Resource { return []func() resource.Resource{ + NewCommPolResource, NewFhsBDPolResource, NewFhsTrustCtrlPolResource, NewFvAEPgResource, @@ -270,6 +271,7 @@ func (p *AciProvider) Resources(ctx context.Context) []func() resource.Resource func (p *AciProvider) DataSources(ctx context.Context) []func() datasource.DataSource { return []func() datasource.DataSource{ + NewCommPolDataSource, NewFhsBDPolDataSource, NewFhsTrustCtrlPolDataSource, NewFvAEPgDataSource, diff --git a/internal/provider/resource_aci_access_interface_override.go b/internal/provider/resource_aci_access_interface_override.go index bead074ff..66dd2cea3 100644 --- a/internal/provider/resource_aci_access_interface_override.go +++ b/internal/provider/resource_aci_access_interface_override.go @@ -67,12 +67,16 @@ func getEmptyInfraHPathSResourceModel() *InfraHPathSResourceModel { OwnerKey: basetypes.NewStringNull(), OwnerTag: basetypes.NewStringNull(), InfraRsHPathAtt: types.ObjectNull(map[string]attr.Type{ - "annotation": types.StringType, - "target_dn": types.StringType, + "annotation": types.StringType, + "target_dn": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationInfraRsHPathAttInfraHPathSType}, + "tags": types.SetType{ElemType: TagTagInfraRsHPathAttInfraHPathSType}, }), InfraRsPathToAccBaseGrp: types.ObjectNull(map[string]attr.Type{ - "annotation": types.StringType, - "target_dn": types.StringType, + "annotation": types.StringType, + "target_dn": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationInfraRsPathToAccBaseGrpInfraHPathSType}, + "tags": types.SetType{ElemType: TagTagInfraRsPathToAccBaseGrpInfraHPathSType}, }), TagAnnotation: types.SetNull(types.ObjectType{ AttrTypes: map[string]attr.Type{ @@ -91,38 +95,150 @@ func getEmptyInfraHPathSResourceModel() *InfraHPathSResourceModel { // InfraRsHPathAttInfraHPathSResourceModel describes the resource data model for the children without relation ships. type InfraRsHPathAttInfraHPathSResourceModel struct { - Annotation types.String `tfsdk:"annotation"` - TDn types.String `tfsdk:"target_dn"` + Annotation types.String `tfsdk:"annotation"` + TDn types.String `tfsdk:"target_dn"` + TagAnnotation types.Set `tfsdk:"annotations"` + TagTag types.Set `tfsdk:"tags"` } func getEmptyInfraRsHPathAttInfraHPathSResourceModel() InfraRsHPathAttInfraHPathSResourceModel { return InfraRsHPathAttInfraHPathSResourceModel{ Annotation: basetypes.NewStringNull(), TDn: basetypes.NewStringNull(), + TagAnnotation: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), } } var InfraRsHPathAttInfraHPathSType = map[string]attr.Type{ - "annotation": types.StringType, - "target_dn": types.StringType, + "annotation": types.StringType, + "target_dn": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationInfraRsHPathAttInfraHPathSType}, + "tags": types.SetType{ElemType: TagTagInfraRsHPathAttInfraHPathSType}, +} + +// TagAnnotationInfraRsHPathAttInfraHPathSResourceModel describes the resource data model for the children without relation ships. +type TagAnnotationInfraRsHPathAttInfraHPathSResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagAnnotationInfraRsHPathAttInfraHPathSResourceModel() TagAnnotationInfraRsHPathAttInfraHPathSResourceModel { + return TagAnnotationInfraRsHPathAttInfraHPathSResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagAnnotationInfraRsHPathAttInfraHPathSType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + +// TagTagInfraRsHPathAttInfraHPathSResourceModel describes the resource data model for the children without relation ships. +type TagTagInfraRsHPathAttInfraHPathSResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagTagInfraRsHPathAttInfraHPathSResourceModel() TagTagInfraRsHPathAttInfraHPathSResourceModel { + return TagTagInfraRsHPathAttInfraHPathSResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagTagInfraRsHPathAttInfraHPathSType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, } // InfraRsPathToAccBaseGrpInfraHPathSResourceModel describes the resource data model for the children without relation ships. type InfraRsPathToAccBaseGrpInfraHPathSResourceModel struct { - Annotation types.String `tfsdk:"annotation"` - TDn types.String `tfsdk:"target_dn"` + Annotation types.String `tfsdk:"annotation"` + TDn types.String `tfsdk:"target_dn"` + TagAnnotation types.Set `tfsdk:"annotations"` + TagTag types.Set `tfsdk:"tags"` } func getEmptyInfraRsPathToAccBaseGrpInfraHPathSResourceModel() InfraRsPathToAccBaseGrpInfraHPathSResourceModel { return InfraRsPathToAccBaseGrpInfraHPathSResourceModel{ Annotation: basetypes.NewStringNull(), TDn: basetypes.NewStringNull(), + TagAnnotation: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), } } var InfraRsPathToAccBaseGrpInfraHPathSType = map[string]attr.Type{ - "annotation": types.StringType, - "target_dn": types.StringType, + "annotation": types.StringType, + "target_dn": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationInfraRsPathToAccBaseGrpInfraHPathSType}, + "tags": types.SetType{ElemType: TagTagInfraRsPathToAccBaseGrpInfraHPathSType}, +} + +// TagAnnotationInfraRsPathToAccBaseGrpInfraHPathSResourceModel describes the resource data model for the children without relation ships. +type TagAnnotationInfraRsPathToAccBaseGrpInfraHPathSResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagAnnotationInfraRsPathToAccBaseGrpInfraHPathSResourceModel() TagAnnotationInfraRsPathToAccBaseGrpInfraHPathSResourceModel { + return TagAnnotationInfraRsPathToAccBaseGrpInfraHPathSResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagAnnotationInfraRsPathToAccBaseGrpInfraHPathSType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + +// TagTagInfraRsPathToAccBaseGrpInfraHPathSResourceModel describes the resource data model for the children without relation ships. +type TagTagInfraRsPathToAccBaseGrpInfraHPathSResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagTagInfraRsPathToAccBaseGrpInfraHPathSResourceModel() TagTagInfraRsPathToAccBaseGrpInfraHPathSResourceModel { + return TagTagInfraRsPathToAccBaseGrpInfraHPathSResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagTagInfraRsPathToAccBaseGrpInfraHPathSType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, } // TagAnnotationInfraHPathSResourceModel describes the resource data model for the children without relation ships. @@ -138,6 +254,13 @@ func getEmptyTagAnnotationInfraHPathSResourceModel() TagAnnotationInfraHPathSRes } } +var TagAnnotationInfraHPathSType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // TagTagInfraHPathSResourceModel describes the resource data model for the children without relation ships. type TagTagInfraHPathSResourceModel struct { Key types.String `tfsdk:"key"` @@ -151,6 +274,13 @@ func getEmptyTagTagInfraHPathSResourceModel() TagTagInfraHPathSResourceModel { } } +var TagTagInfraHPathSType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + type InfraHPathSIdentifier struct { Name types.String } @@ -305,6 +435,58 @@ func (r *InfraHPathSResource) Schema(ctx context.Context, req resource.SchemaReq }, MarkdownDescription: `The distinguished name of the target.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, "relation_to_access_interface_policy_group": schema.SingleNestedAttribute{ @@ -331,6 +513,58 @@ func (r *InfraHPathSResource) Schema(ctx context.Context, req resource.SchemaReq }, MarkdownDescription: `The distinguished name of the target.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, "annotations": schema.SetNestedAttribute{ @@ -582,7 +816,7 @@ func (r *InfraHPathSResource) ImportState(ctx context.Context, req resource.Impo } func getAndSetInfraHPathSAttributes(ctx context.Context, diags *diag.Diagnostics, client *client.Client, data *InfraHPathSResourceModel) { - requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=children&rsp-subtree-class=%s", data.Id.ValueString(), "infraHPathS,infraRsHPathAtt,infraRsPathToAccBaseGrp,tagAnnotation,tagTag"), "GET", nil) + requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=full&rsp-subtree-class=%s", data.Id.ValueString(), "infraHPathS,infraRsHPathAtt,infraRsPathToAccBaseGrp,tagAnnotation,tagTag,tagAnnotation,tagTag,tagAnnotation,tagTag"), "GET", nil) readData := getEmptyInfraHPathSResourceModel() @@ -636,7 +870,47 @@ func getAndSetInfraHPathSAttributes(ctx context.Context, diags *diag.Diagnostics if childAttributeName == "tDn" { InfraRsHPathAttInfraHPathS.TDn = basetypes.NewStringValue(childAttributeValue.(string)) } + + } + TagAnnotationInfraRsHPathAttInfraHPathSList := make([]TagAnnotationInfraRsHPathAttInfraHPathSResourceModel, 0) + TagTagInfraRsHPathAttInfraHPathSList := make([]TagTagInfraRsHPathAttInfraHPathSResourceModel, 0) + childrenOfInfraRsHPathAttInfraHPathS, childrenOfInfraRsHPathAttInfraHPathSExist := childClassDetails.(map[string]interface{})["children"] + if childrenOfInfraRsHPathAttInfraHPathSExist { + for _, childInfraRsHPathAttInfraHPathS := range childrenOfInfraRsHPathAttInfraHPathS.([]interface{}) { + for childClassNameInfraRsHPathAttInfraHPathS, childClassDetailsInfraRsHPathAttInfraHPathS := range childInfraRsHPathAttInfraHPathS.(map[string]interface{}) { + if childClassNameInfraRsHPathAttInfraHPathS == "tagAnnotation" { + TagAnnotationInfraRsHPathAttInfraHPathS := getEmptyTagAnnotationInfraRsHPathAttInfraHPathSResourceModel() + tagAnnotationchildAttributeValue := childClassDetailsInfraRsHPathAttInfraHPathS.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagAnnotationchildAttributeValue { + if childAttributeName == "key" { + TagAnnotationInfraRsHPathAttInfraHPathS.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagAnnotationInfraRsHPathAttInfraHPathS.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagAnnotationInfraRsHPathAttInfraHPathSList = append(TagAnnotationInfraRsHPathAttInfraHPathSList, TagAnnotationInfraRsHPathAttInfraHPathS) + } + if childClassNameInfraRsHPathAttInfraHPathS == "tagTag" { + TagTagInfraRsHPathAttInfraHPathS := getEmptyTagTagInfraRsHPathAttInfraHPathSResourceModel() + tagTagchildAttributeValue := childClassDetailsInfraRsHPathAttInfraHPathS.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagTagchildAttributeValue { + if childAttributeName == "key" { + TagTagInfraRsHPathAttInfraHPathS.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagTagInfraRsHPathAttInfraHPathS.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagTagInfraRsHPathAttInfraHPathSList = append(TagTagInfraRsHPathAttInfraHPathSList, TagTagInfraRsHPathAttInfraHPathS) + } + } + } } + TagAnnotationInfraRsHPathAttInfraHPathSSet, _ := types.SetValueFrom(ctx, TagAnnotationInfraRsHPathAttInfraHPathSType, TagAnnotationInfraRsHPathAttInfraHPathSList) + InfraRsHPathAttInfraHPathS.TagAnnotation = TagAnnotationInfraRsHPathAttInfraHPathSSet + TagTagInfraRsHPathAttInfraHPathSSet, _ := types.SetValueFrom(ctx, TagTagInfraRsHPathAttInfraHPathSType, TagTagInfraRsHPathAttInfraHPathSList) + InfraRsHPathAttInfraHPathS.TagTag = TagTagInfraRsHPathAttInfraHPathSSet InfraRsHPathAttInfraHPathSList = append(InfraRsHPathAttInfraHPathSList, InfraRsHPathAttInfraHPathS) } if childClassName == "infraRsPathToAccBaseGrp" { @@ -648,7 +922,47 @@ func getAndSetInfraHPathSAttributes(ctx context.Context, diags *diag.Diagnostics if childAttributeName == "tDn" { InfraRsPathToAccBaseGrpInfraHPathS.TDn = basetypes.NewStringValue(childAttributeValue.(string)) } + + } + TagAnnotationInfraRsPathToAccBaseGrpInfraHPathSList := make([]TagAnnotationInfraRsPathToAccBaseGrpInfraHPathSResourceModel, 0) + TagTagInfraRsPathToAccBaseGrpInfraHPathSList := make([]TagTagInfraRsPathToAccBaseGrpInfraHPathSResourceModel, 0) + childrenOfInfraRsPathToAccBaseGrpInfraHPathS, childrenOfInfraRsPathToAccBaseGrpInfraHPathSExist := childClassDetails.(map[string]interface{})["children"] + if childrenOfInfraRsPathToAccBaseGrpInfraHPathSExist { + for _, childInfraRsPathToAccBaseGrpInfraHPathS := range childrenOfInfraRsPathToAccBaseGrpInfraHPathS.([]interface{}) { + for childClassNameInfraRsPathToAccBaseGrpInfraHPathS, childClassDetailsInfraRsPathToAccBaseGrpInfraHPathS := range childInfraRsPathToAccBaseGrpInfraHPathS.(map[string]interface{}) { + if childClassNameInfraRsPathToAccBaseGrpInfraHPathS == "tagAnnotation" { + TagAnnotationInfraRsPathToAccBaseGrpInfraHPathS := getEmptyTagAnnotationInfraRsPathToAccBaseGrpInfraHPathSResourceModel() + tagAnnotationchildAttributeValue := childClassDetailsInfraRsPathToAccBaseGrpInfraHPathS.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagAnnotationchildAttributeValue { + if childAttributeName == "key" { + TagAnnotationInfraRsPathToAccBaseGrpInfraHPathS.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagAnnotationInfraRsPathToAccBaseGrpInfraHPathS.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagAnnotationInfraRsPathToAccBaseGrpInfraHPathSList = append(TagAnnotationInfraRsPathToAccBaseGrpInfraHPathSList, TagAnnotationInfraRsPathToAccBaseGrpInfraHPathS) + } + if childClassNameInfraRsPathToAccBaseGrpInfraHPathS == "tagTag" { + TagTagInfraRsPathToAccBaseGrpInfraHPathS := getEmptyTagTagInfraRsPathToAccBaseGrpInfraHPathSResourceModel() + tagTagchildAttributeValue := childClassDetailsInfraRsPathToAccBaseGrpInfraHPathS.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagTagchildAttributeValue { + if childAttributeName == "key" { + TagTagInfraRsPathToAccBaseGrpInfraHPathS.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagTagInfraRsPathToAccBaseGrpInfraHPathS.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagTagInfraRsPathToAccBaseGrpInfraHPathSList = append(TagTagInfraRsPathToAccBaseGrpInfraHPathSList, TagTagInfraRsPathToAccBaseGrpInfraHPathS) + } + } + } } + TagAnnotationInfraRsPathToAccBaseGrpInfraHPathSSet, _ := types.SetValueFrom(ctx, TagAnnotationInfraRsPathToAccBaseGrpInfraHPathSType, TagAnnotationInfraRsPathToAccBaseGrpInfraHPathSList) + InfraRsPathToAccBaseGrpInfraHPathS.TagAnnotation = TagAnnotationInfraRsPathToAccBaseGrpInfraHPathSSet + TagTagInfraRsPathToAccBaseGrpInfraHPathSSet, _ := types.SetValueFrom(ctx, TagTagInfraRsPathToAccBaseGrpInfraHPathSType, TagTagInfraRsPathToAccBaseGrpInfraHPathSList) + InfraRsPathToAccBaseGrpInfraHPathS.TagTag = TagTagInfraRsPathToAccBaseGrpInfraHPathSSet InfraRsPathToAccBaseGrpInfraHPathSList = append(InfraRsPathToAccBaseGrpInfraHPathSList, InfraRsPathToAccBaseGrpInfraHPathS) } if childClassName == "tagAnnotation" { @@ -660,6 +974,7 @@ func getAndSetInfraHPathSAttributes(ctx context.Context, diags *diag.Diagnostics if childAttributeName == "value" { TagAnnotationInfraHPathS.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagAnnotationInfraHPathSList = append(TagAnnotationInfraHPathSList, TagAnnotationInfraHPathS) } @@ -672,6 +987,7 @@ func getAndSetInfraHPathSAttributes(ctx context.Context, diags *diag.Diagnostics if childAttributeName == "value" { TagTagInfraHPathS.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagTagInfraHPathSList = append(TagTagInfraHPathSList, TagTagInfraHPathS) } @@ -733,24 +1049,99 @@ func setInfraHPathSId(ctx context.Context, data *InfraHPathSResourceModel) { data.Id = types.StringValue(fmt.Sprintf("%s/%s", data.ParentDn.ValueString(), rn)) } -func getInfraHPathSInfraRsHPathAttChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *InfraHPathSResourceModel, infraRsHPathAttPlan, infraRsHPathAttState InfraRsHPathAttInfraHPathSResourceModel) []map[string]interface{} { - +func getInfraHPathSInfraRsHPathAttChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *InfraHPathSResourceModel, infraRsHPathAttInfraHPathSPlan, infraRsHPathAttInfraHPathSState InfraRsHPathAttInfraHPathSResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.InfraRsHPathAtt.IsUnknown() { - childMap := map[string]map[string]interface{}{"attributes": {}} + if !data.InfraRsHPathAtt.IsNull() && !data.InfraRsHPathAtt.IsUnknown() { + InfraRsHPathAttInfraHPathSChildren := make([]map[string]interface{}, 0) + childMap := NewAciObject() if !IsEmptySingleNestedAttribute(data.InfraRsHPathAtt.Attributes()) { - if !infraRsHPathAttPlan.Annotation.IsUnknown() && !infraRsHPathAttPlan.Annotation.IsNull() { - childMap["attributes"]["annotation"] = infraRsHPathAttPlan.Annotation.ValueString() + if !infraRsHPathAttInfraHPathSPlan.Annotation.IsUnknown() && !infraRsHPathAttInfraHPathSPlan.Annotation.IsNull() { + childMap.Attributes["annotation"] = infraRsHPathAttInfraHPathSPlan.Annotation.ValueString() } else { - childMap["attributes"]["annotation"] = globalAnnotation + childMap.Attributes["annotation"] = globalAnnotation } - if !infraRsHPathAttPlan.TDn.IsUnknown() && !infraRsHPathAttPlan.TDn.IsNull() { - childMap["attributes"]["tDn"] = infraRsHPathAttPlan.TDn.ValueString() + if !infraRsHPathAttInfraHPathSPlan.TDn.IsUnknown() && !infraRsHPathAttInfraHPathSPlan.TDn.IsNull() { + childMap.Attributes["tDn"] = infraRsHPathAttInfraHPathSPlan.TDn.ValueString() } } else { - childMap["attributes"]["tDn"] = infraRsHPathAttState.TDn.ValueString() - childMap["attributes"]["status"] = "deleted" + childMap.Attributes["tDn"] = infraRsHPathAttInfraHPathSState.TDn.ValueString() + childMap.Attributes["status"] = "deleted" + } + + var tagAnnotationInfraRsHPathAttInfraHPathSPlan, tagAnnotationInfraRsHPathAttInfraHPathSState []TagAnnotationInfraRsHPathAttInfraHPathSResourceModel + infraRsHPathAttInfraHPathSPlan.TagAnnotation.ElementsAs(ctx, &tagAnnotationInfraRsHPathAttInfraHPathSPlan, false) + if !infraRsHPathAttInfraHPathSState.TagAnnotation.IsNull() { + infraRsHPathAttInfraHPathSState.TagAnnotation.ElementsAs(ctx, &tagAnnotationInfraRsHPathAttInfraHPathSState, false) + } + if !infraRsHPathAttInfraHPathSPlan.TagAnnotation.IsNull() && !infraRsHPathAttInfraHPathSPlan.TagAnnotation.IsUnknown() { + tagAnnotationIdentifiers := []TagAnnotationIdentifier{} + for _, tagAnnotationInfraRsHPathAttInfraHPathS := range tagAnnotationInfraRsHPathAttInfraHPathSPlan { + tagAnnotationInfraRsHPathAttInfraHPathSChildMap := NewAciObject() + if !tagAnnotationInfraRsHPathAttInfraHPathS.Key.IsNull() && !tagAnnotationInfraRsHPathAttInfraHPathS.Key.IsUnknown() { + tagAnnotationInfraRsHPathAttInfraHPathSChildMap.Attributes["key"] = tagAnnotationInfraRsHPathAttInfraHPathS.Key.ValueString() + } + if !tagAnnotationInfraRsHPathAttInfraHPathS.Value.IsNull() && !tagAnnotationInfraRsHPathAttInfraHPathS.Value.IsUnknown() { + tagAnnotationInfraRsHPathAttInfraHPathSChildMap.Attributes["value"] = tagAnnotationInfraRsHPathAttInfraHPathS.Value.ValueString() + } + InfraRsHPathAttInfraHPathSChildren = append(InfraRsHPathAttInfraHPathSChildren, map[string]interface{}{"tagAnnotation": tagAnnotationInfraRsHPathAttInfraHPathSChildMap}) + tagAnnotationIdentifier := TagAnnotationIdentifier{} + tagAnnotationIdentifier.Key = tagAnnotationInfraRsHPathAttInfraHPathS.Key + tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) + } + for _, tagAnnotationInfraRsHPathAttInfraHPathS := range tagAnnotationInfraRsHPathAttInfraHPathSState { + delete := true + for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { + if tagAnnotationIdentifier.Key == tagAnnotationInfraRsHPathAttInfraHPathS.Key { + delete = false + break + } + } + if delete { + tagAnnotationInfraRsHPathAttInfraHPathSChildMapForDelete := NewAciObject() + tagAnnotationInfraRsHPathAttInfraHPathSChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationInfraRsHPathAttInfraHPathSChildMapForDelete.Attributes["key"] = tagAnnotationInfraRsHPathAttInfraHPathS.Key.ValueString() + InfraRsHPathAttInfraHPathSChildren = append(InfraRsHPathAttInfraHPathSChildren, map[string]interface{}{"tagAnnotation": tagAnnotationInfraRsHPathAttInfraHPathSChildMapForDelete}) + } + } } + + var tagTagInfraRsHPathAttInfraHPathSPlan, tagTagInfraRsHPathAttInfraHPathSState []TagTagInfraRsHPathAttInfraHPathSResourceModel + infraRsHPathAttInfraHPathSPlan.TagTag.ElementsAs(ctx, &tagTagInfraRsHPathAttInfraHPathSPlan, false) + if !infraRsHPathAttInfraHPathSState.TagTag.IsNull() { + infraRsHPathAttInfraHPathSState.TagTag.ElementsAs(ctx, &tagTagInfraRsHPathAttInfraHPathSState, false) + } + if !infraRsHPathAttInfraHPathSPlan.TagTag.IsNull() && !infraRsHPathAttInfraHPathSPlan.TagTag.IsUnknown() { + tagTagIdentifiers := []TagTagIdentifier{} + for _, tagTagInfraRsHPathAttInfraHPathS := range tagTagInfraRsHPathAttInfraHPathSPlan { + tagTagInfraRsHPathAttInfraHPathSChildMap := NewAciObject() + if !tagTagInfraRsHPathAttInfraHPathS.Key.IsNull() && !tagTagInfraRsHPathAttInfraHPathS.Key.IsUnknown() { + tagTagInfraRsHPathAttInfraHPathSChildMap.Attributes["key"] = tagTagInfraRsHPathAttInfraHPathS.Key.ValueString() + } + if !tagTagInfraRsHPathAttInfraHPathS.Value.IsNull() && !tagTagInfraRsHPathAttInfraHPathS.Value.IsUnknown() { + tagTagInfraRsHPathAttInfraHPathSChildMap.Attributes["value"] = tagTagInfraRsHPathAttInfraHPathS.Value.ValueString() + } + InfraRsHPathAttInfraHPathSChildren = append(InfraRsHPathAttInfraHPathSChildren, map[string]interface{}{"tagTag": tagTagInfraRsHPathAttInfraHPathSChildMap}) + tagTagIdentifier := TagTagIdentifier{} + tagTagIdentifier.Key = tagTagInfraRsHPathAttInfraHPathS.Key + tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) + } + for _, tagTagInfraRsHPathAttInfraHPathS := range tagTagInfraRsHPathAttInfraHPathSState { + delete := true + for _, tagTagIdentifier := range tagTagIdentifiers { + if tagTagIdentifier.Key == tagTagInfraRsHPathAttInfraHPathS.Key { + delete = false + break + } + } + if delete { + tagTagInfraRsHPathAttInfraHPathSChildMapForDelete := NewAciObject() + tagTagInfraRsHPathAttInfraHPathSChildMapForDelete.Attributes["status"] = "deleted" + tagTagInfraRsHPathAttInfraHPathSChildMapForDelete.Attributes["key"] = tagTagInfraRsHPathAttInfraHPathS.Key.ValueString() + InfraRsHPathAttInfraHPathSChildren = append(InfraRsHPathAttInfraHPathSChildren, map[string]interface{}{"tagTag": tagTagInfraRsHPathAttInfraHPathSChildMapForDelete}) + } + } + } + childMap.Children = InfraRsHPathAttInfraHPathSChildren childPayloads = append(childPayloads, map[string]interface{}{"infraRsHPathAtt": childMap}) } else { InfraRsHPathAttObject, _ := types.ObjectValueFrom(ctx, InfraRsHPathAttInfraHPathSType, getEmptyInfraRsHPathAttInfraHPathSResourceModel()) @@ -759,23 +1150,99 @@ func getInfraHPathSInfraRsHPathAttChildPayloads(ctx context.Context, diags *diag return childPayloads } -func getInfraHPathSInfraRsPathToAccBaseGrpChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *InfraHPathSResourceModel, infraRsPathToAccBaseGrpPlan, infraRsPathToAccBaseGrpState InfraRsPathToAccBaseGrpInfraHPathSResourceModel) []map[string]interface{} { +func getInfraHPathSInfraRsPathToAccBaseGrpChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *InfraHPathSResourceModel, infraRsPathToAccBaseGrpInfraHPathSPlan, infraRsPathToAccBaseGrpInfraHPathSState InfraRsPathToAccBaseGrpInfraHPathSResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.InfraRsPathToAccBaseGrp.IsUnknown() { - childMap := map[string]map[string]interface{}{"attributes": {}} + if !data.InfraRsPathToAccBaseGrp.IsNull() && !data.InfraRsPathToAccBaseGrp.IsUnknown() { + InfraRsPathToAccBaseGrpInfraHPathSChildren := make([]map[string]interface{}, 0) + childMap := NewAciObject() if !IsEmptySingleNestedAttribute(data.InfraRsPathToAccBaseGrp.Attributes()) { - if !infraRsPathToAccBaseGrpPlan.Annotation.IsUnknown() && !infraRsPathToAccBaseGrpPlan.Annotation.IsNull() { - childMap["attributes"]["annotation"] = infraRsPathToAccBaseGrpPlan.Annotation.ValueString() + if !infraRsPathToAccBaseGrpInfraHPathSPlan.Annotation.IsUnknown() && !infraRsPathToAccBaseGrpInfraHPathSPlan.Annotation.IsNull() { + childMap.Attributes["annotation"] = infraRsPathToAccBaseGrpInfraHPathSPlan.Annotation.ValueString() } else { - childMap["attributes"]["annotation"] = globalAnnotation + childMap.Attributes["annotation"] = globalAnnotation } - if !infraRsPathToAccBaseGrpPlan.TDn.IsUnknown() && !infraRsPathToAccBaseGrpPlan.TDn.IsNull() { - childMap["attributes"]["tDn"] = infraRsPathToAccBaseGrpPlan.TDn.ValueString() + if !infraRsPathToAccBaseGrpInfraHPathSPlan.TDn.IsUnknown() && !infraRsPathToAccBaseGrpInfraHPathSPlan.TDn.IsNull() { + childMap.Attributes["tDn"] = infraRsPathToAccBaseGrpInfraHPathSPlan.TDn.ValueString() } } else { - childMap["attributes"]["status"] = "deleted" + childMap.Attributes["status"] = "deleted" + } + + var tagAnnotationInfraRsPathToAccBaseGrpInfraHPathSPlan, tagAnnotationInfraRsPathToAccBaseGrpInfraHPathSState []TagAnnotationInfraRsPathToAccBaseGrpInfraHPathSResourceModel + infraRsPathToAccBaseGrpInfraHPathSPlan.TagAnnotation.ElementsAs(ctx, &tagAnnotationInfraRsPathToAccBaseGrpInfraHPathSPlan, false) + if !infraRsPathToAccBaseGrpInfraHPathSState.TagAnnotation.IsNull() { + infraRsPathToAccBaseGrpInfraHPathSState.TagAnnotation.ElementsAs(ctx, &tagAnnotationInfraRsPathToAccBaseGrpInfraHPathSState, false) + } + if !infraRsPathToAccBaseGrpInfraHPathSPlan.TagAnnotation.IsNull() && !infraRsPathToAccBaseGrpInfraHPathSPlan.TagAnnotation.IsUnknown() { + tagAnnotationIdentifiers := []TagAnnotationIdentifier{} + for _, tagAnnotationInfraRsPathToAccBaseGrpInfraHPathS := range tagAnnotationInfraRsPathToAccBaseGrpInfraHPathSPlan { + tagAnnotationInfraRsPathToAccBaseGrpInfraHPathSChildMap := NewAciObject() + if !tagAnnotationInfraRsPathToAccBaseGrpInfraHPathS.Key.IsNull() && !tagAnnotationInfraRsPathToAccBaseGrpInfraHPathS.Key.IsUnknown() { + tagAnnotationInfraRsPathToAccBaseGrpInfraHPathSChildMap.Attributes["key"] = tagAnnotationInfraRsPathToAccBaseGrpInfraHPathS.Key.ValueString() + } + if !tagAnnotationInfraRsPathToAccBaseGrpInfraHPathS.Value.IsNull() && !tagAnnotationInfraRsPathToAccBaseGrpInfraHPathS.Value.IsUnknown() { + tagAnnotationInfraRsPathToAccBaseGrpInfraHPathSChildMap.Attributes["value"] = tagAnnotationInfraRsPathToAccBaseGrpInfraHPathS.Value.ValueString() + } + InfraRsPathToAccBaseGrpInfraHPathSChildren = append(InfraRsPathToAccBaseGrpInfraHPathSChildren, map[string]interface{}{"tagAnnotation": tagAnnotationInfraRsPathToAccBaseGrpInfraHPathSChildMap}) + tagAnnotationIdentifier := TagAnnotationIdentifier{} + tagAnnotationIdentifier.Key = tagAnnotationInfraRsPathToAccBaseGrpInfraHPathS.Key + tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) + } + for _, tagAnnotationInfraRsPathToAccBaseGrpInfraHPathS := range tagAnnotationInfraRsPathToAccBaseGrpInfraHPathSState { + delete := true + for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { + if tagAnnotationIdentifier.Key == tagAnnotationInfraRsPathToAccBaseGrpInfraHPathS.Key { + delete = false + break + } + } + if delete { + tagAnnotationInfraRsPathToAccBaseGrpInfraHPathSChildMapForDelete := NewAciObject() + tagAnnotationInfraRsPathToAccBaseGrpInfraHPathSChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationInfraRsPathToAccBaseGrpInfraHPathSChildMapForDelete.Attributes["key"] = tagAnnotationInfraRsPathToAccBaseGrpInfraHPathS.Key.ValueString() + InfraRsPathToAccBaseGrpInfraHPathSChildren = append(InfraRsPathToAccBaseGrpInfraHPathSChildren, map[string]interface{}{"tagAnnotation": tagAnnotationInfraRsPathToAccBaseGrpInfraHPathSChildMapForDelete}) + } + } + } + + var tagTagInfraRsPathToAccBaseGrpInfraHPathSPlan, tagTagInfraRsPathToAccBaseGrpInfraHPathSState []TagTagInfraRsPathToAccBaseGrpInfraHPathSResourceModel + infraRsPathToAccBaseGrpInfraHPathSPlan.TagTag.ElementsAs(ctx, &tagTagInfraRsPathToAccBaseGrpInfraHPathSPlan, false) + if !infraRsPathToAccBaseGrpInfraHPathSState.TagTag.IsNull() { + infraRsPathToAccBaseGrpInfraHPathSState.TagTag.ElementsAs(ctx, &tagTagInfraRsPathToAccBaseGrpInfraHPathSState, false) + } + if !infraRsPathToAccBaseGrpInfraHPathSPlan.TagTag.IsNull() && !infraRsPathToAccBaseGrpInfraHPathSPlan.TagTag.IsUnknown() { + tagTagIdentifiers := []TagTagIdentifier{} + for _, tagTagInfraRsPathToAccBaseGrpInfraHPathS := range tagTagInfraRsPathToAccBaseGrpInfraHPathSPlan { + tagTagInfraRsPathToAccBaseGrpInfraHPathSChildMap := NewAciObject() + if !tagTagInfraRsPathToAccBaseGrpInfraHPathS.Key.IsNull() && !tagTagInfraRsPathToAccBaseGrpInfraHPathS.Key.IsUnknown() { + tagTagInfraRsPathToAccBaseGrpInfraHPathSChildMap.Attributes["key"] = tagTagInfraRsPathToAccBaseGrpInfraHPathS.Key.ValueString() + } + if !tagTagInfraRsPathToAccBaseGrpInfraHPathS.Value.IsNull() && !tagTagInfraRsPathToAccBaseGrpInfraHPathS.Value.IsUnknown() { + tagTagInfraRsPathToAccBaseGrpInfraHPathSChildMap.Attributes["value"] = tagTagInfraRsPathToAccBaseGrpInfraHPathS.Value.ValueString() + } + InfraRsPathToAccBaseGrpInfraHPathSChildren = append(InfraRsPathToAccBaseGrpInfraHPathSChildren, map[string]interface{}{"tagTag": tagTagInfraRsPathToAccBaseGrpInfraHPathSChildMap}) + tagTagIdentifier := TagTagIdentifier{} + tagTagIdentifier.Key = tagTagInfraRsPathToAccBaseGrpInfraHPathS.Key + tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) + } + for _, tagTagInfraRsPathToAccBaseGrpInfraHPathS := range tagTagInfraRsPathToAccBaseGrpInfraHPathSState { + delete := true + for _, tagTagIdentifier := range tagTagIdentifiers { + if tagTagIdentifier.Key == tagTagInfraRsPathToAccBaseGrpInfraHPathS.Key { + delete = false + break + } + } + if delete { + tagTagInfraRsPathToAccBaseGrpInfraHPathSChildMapForDelete := NewAciObject() + tagTagInfraRsPathToAccBaseGrpInfraHPathSChildMapForDelete.Attributes["status"] = "deleted" + tagTagInfraRsPathToAccBaseGrpInfraHPathSChildMapForDelete.Attributes["key"] = tagTagInfraRsPathToAccBaseGrpInfraHPathS.Key.ValueString() + InfraRsPathToAccBaseGrpInfraHPathSChildren = append(InfraRsPathToAccBaseGrpInfraHPathSChildren, map[string]interface{}{"tagTag": tagTagInfraRsPathToAccBaseGrpInfraHPathSChildMapForDelete}) + } + } } + childMap.Children = InfraRsPathToAccBaseGrpInfraHPathSChildren childPayloads = append(childPayloads, map[string]interface{}{"infraRsPathToAccBaseGrp": childMap}) } else { InfraRsPathToAccBaseGrpObject, _ := types.ObjectValueFrom(ctx, InfraRsPathToAccBaseGrpInfraHPathSType, getEmptyInfraRsPathToAccBaseGrpInfraHPathSResourceModel()) @@ -784,25 +1251,25 @@ func getInfraHPathSInfraRsPathToAccBaseGrpChildPayloads(ctx context.Context, dia return childPayloads } -func getInfraHPathSTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *InfraHPathSResourceModel, tagAnnotationPlan, tagAnnotationState []TagAnnotationInfraHPathSResourceModel) []map[string]interface{} { +func getInfraHPathSTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *InfraHPathSResourceModel, tagAnnotationInfraHPathSPlan, tagAnnotationInfraHPathSState []TagAnnotationInfraHPathSResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagAnnotation.IsUnknown() { + if !data.TagAnnotation.IsNull() && !data.TagAnnotation.IsUnknown() { tagAnnotationIdentifiers := []TagAnnotationIdentifier{} - for _, tagAnnotation := range tagAnnotationPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagAnnotation.Key.IsUnknown() && !tagAnnotation.Key.IsNull() { - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() + for _, tagAnnotationInfraHPathS := range tagAnnotationInfraHPathSPlan { + childMap := NewAciObject() + if !tagAnnotationInfraHPathS.Key.IsNull() && !tagAnnotationInfraHPathS.Key.IsUnknown() { + childMap.Attributes["key"] = tagAnnotationInfraHPathS.Key.ValueString() } - if !tagAnnotation.Value.IsUnknown() && !tagAnnotation.Value.IsNull() { - childMap["attributes"]["value"] = tagAnnotation.Value.ValueString() + if !tagAnnotationInfraHPathS.Value.IsNull() && !tagAnnotationInfraHPathS.Value.IsUnknown() { + childMap.Attributes["value"] = tagAnnotationInfraHPathS.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) tagAnnotationIdentifier := TagAnnotationIdentifier{} - tagAnnotationIdentifier.Key = tagAnnotation.Key + tagAnnotationIdentifier.Key = tagAnnotationInfraHPathS.Key tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) } - for _, tagAnnotation := range tagAnnotationState { + for _, tagAnnotation := range tagAnnotationInfraHPathSState { delete := true for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { if tagAnnotationIdentifier.Key == tagAnnotation.Key { @@ -811,10 +1278,10 @@ func getInfraHPathSTagAnnotationChildPayloads(ctx context.Context, diags *diag.D } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) + tagAnnotationChildMapForDelete := NewAciObject() + tagAnnotationChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationChildMapForDelete.Attributes["key"] = tagAnnotation.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": tagAnnotationChildMapForDelete}) } } } else { @@ -823,25 +1290,25 @@ func getInfraHPathSTagAnnotationChildPayloads(ctx context.Context, diags *diag.D return childPayloads } -func getInfraHPathSTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *InfraHPathSResourceModel, tagTagPlan, tagTagState []TagTagInfraHPathSResourceModel) []map[string]interface{} { +func getInfraHPathSTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *InfraHPathSResourceModel, tagTagInfraHPathSPlan, tagTagInfraHPathSState []TagTagInfraHPathSResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagTag.IsUnknown() { + if !data.TagTag.IsNull() && !data.TagTag.IsUnknown() { tagTagIdentifiers := []TagTagIdentifier{} - for _, tagTag := range tagTagPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagTag.Key.IsUnknown() && !tagTag.Key.IsNull() { - childMap["attributes"]["key"] = tagTag.Key.ValueString() + for _, tagTagInfraHPathS := range tagTagInfraHPathSPlan { + childMap := NewAciObject() + if !tagTagInfraHPathS.Key.IsNull() && !tagTagInfraHPathS.Key.IsUnknown() { + childMap.Attributes["key"] = tagTagInfraHPathS.Key.ValueString() } - if !tagTag.Value.IsUnknown() && !tagTag.Value.IsNull() { - childMap["attributes"]["value"] = tagTag.Value.ValueString() + if !tagTagInfraHPathS.Value.IsNull() && !tagTagInfraHPathS.Value.IsUnknown() { + childMap.Attributes["value"] = tagTagInfraHPathS.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) tagTagIdentifier := TagTagIdentifier{} - tagTagIdentifier.Key = tagTag.Key + tagTagIdentifier.Key = tagTagInfraHPathS.Key tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) } - for _, tagTag := range tagTagState { + for _, tagTag := range tagTagInfraHPathSState { delete := true for _, tagTagIdentifier := range tagTagIdentifiers { if tagTagIdentifier.Key == tagTag.Key { @@ -850,10 +1317,10 @@ func getInfraHPathSTagTagChildPayloads(ctx context.Context, diags *diag.Diagnost } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagTag.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) + tagTagChildMapForDelete := NewAciObject() + tagTagChildMapForDelete.Attributes["status"] = "deleted" + tagTagChildMapForDelete.Attributes["key"] = tagTag.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagTag": tagTagChildMapForDelete}) } } } else { diff --git a/internal/provider/resource_aci_access_interface_override_test.go b/internal/provider/resource_aci_access_interface_override_test.go index e6b1ac3b0..b27eaea8d 100644 --- a/internal/provider/resource_aci_access_interface_override_test.go +++ b/internal/provider/resource_aci_access_interface_override_test.go @@ -153,8 +153,28 @@ func TestAccResourceInfraHPathS(t *testing.T) { resource.TestCheckResourceAttr("aci_access_interface_override.test", "annotations.1.value", "test_value"), resource.TestCheckResourceAttr("aci_access_interface_override.test", "annotations.#", "2"), resource.TestCheckResourceAttr("aci_access_interface_override.test", "relation_to_access_interface_policy_group.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_access_interface_override.test", "relation_to_access_interface_policy_group.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_access_interface_override.test", "relation_to_access_interface_policy_group.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_access_interface_override.test", "relation_to_access_interface_policy_group.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_access_interface_override.test", "relation_to_access_interface_policy_group.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_access_interface_override.test", "relation_to_access_interface_policy_group.annotations.#", "2"), + resource.TestCheckResourceAttr("aci_access_interface_override.test", "relation_to_access_interface_policy_group.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_access_interface_override.test", "relation_to_access_interface_policy_group.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_access_interface_override.test", "relation_to_access_interface_policy_group.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_access_interface_override.test", "relation_to_access_interface_policy_group.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_access_interface_override.test", "relation_to_access_interface_policy_group.tags.#", "2"), resource.TestCheckResourceAttr("aci_access_interface_override.test", "relation_to_access_interface_policy_group.target_dn", "uni/infra/funcprof/accportgrp-access_interface_policy_group"), resource.TestCheckResourceAttr("aci_access_interface_override.test", "relation_to_host_path.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_access_interface_override.test", "relation_to_host_path.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_access_interface_override.test", "relation_to_host_path.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_access_interface_override.test", "relation_to_host_path.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_access_interface_override.test", "relation_to_host_path.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_access_interface_override.test", "relation_to_host_path.annotations.#", "2"), + resource.TestCheckResourceAttr("aci_access_interface_override.test", "relation_to_host_path.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_access_interface_override.test", "relation_to_host_path.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_access_interface_override.test", "relation_to_host_path.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_access_interface_override.test", "relation_to_host_path.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_access_interface_override.test", "relation_to_host_path.tags.#", "2"), resource.TestCheckResourceAttr("aci_access_interface_override.test", "relation_to_host_path.target_dn", "topology/pod-1/paths-101/pathep-[eth1/1]"), resource.TestCheckResourceAttr("aci_access_interface_override.test", "tags.0.key", "key_0"), resource.TestCheckResourceAttr("aci_access_interface_override.test", "tags.0.value", "value_1"), @@ -178,8 +198,28 @@ func TestAccResourceInfraHPathS(t *testing.T) { resource.TestCheckResourceAttr("aci_access_interface_override.test", "annotations.1.value", "test_value"), resource.TestCheckResourceAttr("aci_access_interface_override.test", "annotations.#", "2"), resource.TestCheckResourceAttr("aci_access_interface_override.test", "relation_to_access_interface_policy_group.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_access_interface_override.test", "relation_to_access_interface_policy_group.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_access_interface_override.test", "relation_to_access_interface_policy_group.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_access_interface_override.test", "relation_to_access_interface_policy_group.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_access_interface_override.test", "relation_to_access_interface_policy_group.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_access_interface_override.test", "relation_to_access_interface_policy_group.annotations.#", "2"), + resource.TestCheckResourceAttr("aci_access_interface_override.test", "relation_to_access_interface_policy_group.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_access_interface_override.test", "relation_to_access_interface_policy_group.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_access_interface_override.test", "relation_to_access_interface_policy_group.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_access_interface_override.test", "relation_to_access_interface_policy_group.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_access_interface_override.test", "relation_to_access_interface_policy_group.tags.#", "2"), resource.TestCheckResourceAttr("aci_access_interface_override.test", "relation_to_access_interface_policy_group.target_dn", "uni/infra/funcprof/accportgrp-access_interface_policy_group"), resource.TestCheckResourceAttr("aci_access_interface_override.test", "relation_to_host_path.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_access_interface_override.test", "relation_to_host_path.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_access_interface_override.test", "relation_to_host_path.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_access_interface_override.test", "relation_to_host_path.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_access_interface_override.test", "relation_to_host_path.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_access_interface_override.test", "relation_to_host_path.annotations.#", "2"), + resource.TestCheckResourceAttr("aci_access_interface_override.test", "relation_to_host_path.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_access_interface_override.test", "relation_to_host_path.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_access_interface_override.test", "relation_to_host_path.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_access_interface_override.test", "relation_to_host_path.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_access_interface_override.test", "relation_to_host_path.tags.#", "2"), resource.TestCheckResourceAttr("aci_access_interface_override.test", "relation_to_host_path.target_dn", "topology/pod-1/paths-101/pathep-[eth1/1]"), resource.TestCheckResourceAttr("aci_access_interface_override.test", "tags.0.key", "key_0"), resource.TestCheckResourceAttr("aci_access_interface_override.test", "tags.0.value", "value_1"), @@ -209,8 +249,10 @@ func TestAccResourceInfraHPathS(t *testing.T) { tfjsonpath.New("relation_to_access_interface_policy_group"), knownvalue.MapExact( map[string]knownvalue.Check{ - "annotation": knownvalue.Null(), - "target_dn": knownvalue.Null(), + "annotation": knownvalue.Null(), + "annotations": knownvalue.Null(), + "tags": knownvalue.Null(), + "target_dn": knownvalue.Null(), }, ), ), @@ -218,8 +260,10 @@ func TestAccResourceInfraHPathS(t *testing.T) { tfjsonpath.New("relation_to_host_path"), knownvalue.MapExact( map[string]knownvalue.Check{ - "annotation": knownvalue.Null(), - "target_dn": knownvalue.Null(), + "annotation": knownvalue.Null(), + "annotations": knownvalue.Null(), + "tags": knownvalue.Null(), + "target_dn": knownvalue.Null(), }, ), ), @@ -242,8 +286,10 @@ func TestAccResourceInfraHPathS(t *testing.T) { tfjsonpath.New("relation_to_access_interface_policy_group"), knownvalue.MapExact( map[string]knownvalue.Check{ - "annotation": knownvalue.Null(), - "target_dn": knownvalue.Null(), + "annotation": knownvalue.Null(), + "annotations": knownvalue.Null(), + "tags": knownvalue.Null(), + "target_dn": knownvalue.Null(), }, ), ), @@ -251,8 +297,10 @@ func TestAccResourceInfraHPathS(t *testing.T) { tfjsonpath.New("relation_to_host_path"), knownvalue.MapExact( map[string]knownvalue.Check{ - "annotation": knownvalue.Null(), - "target_dn": knownvalue.Null(), + "annotation": knownvalue.Null(), + "annotations": knownvalue.Null(), + "tags": knownvalue.Null(), + "target_dn": knownvalue.Null(), }, ), ), @@ -318,10 +366,50 @@ resource "aci_access_interface_override" "test" { ] relation_to_access_interface_policy_group = { annotation = "annotation_1" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] target_dn = "uni/infra/funcprof/accportgrp-access_interface_policy_group" } relation_to_host_path = { annotation = "annotation_1" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] target_dn = "topology/pod-1/paths-101/pathep-[eth1/1]" } tags = [ @@ -334,6 +422,7 @@ resource "aci_access_interface_override" "test" { value = "test_value" }, ] + } ` diff --git a/internal/provider/resource_aci_application_epg.go b/internal/provider/resource_aci_application_epg.go index a258f622d..cf2142b48 100644 --- a/internal/provider/resource_aci_application_epg.go +++ b/internal/provider/resource_aci_application_epg.go @@ -138,20 +138,28 @@ func getEmptyFvAEPgResourceModel() *FvAEPgResourceModel { "owner_tag": types.StringType, "precedence": types.StringType, "scope": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvCrtrnFvAEPgType}, + "tags": types.SetType{ElemType: TagTagFvCrtrnFvAEPgType}, }), FvRsAEPgMonPol: types.ObjectNull(map[string]attr.Type{ "annotation": types.StringType, "monitoring_policy_name": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvRsAEPgMonPolFvAEPgType}, + "tags": types.SetType{ElemType: TagTagFvRsAEPgMonPolFvAEPgType}, }), FvRsBd: types.ObjectNull(map[string]attr.Type{ "annotation": types.StringType, "bridge_domain_name": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvRsBdFvAEPgType}, + "tags": types.SetType{ElemType: TagTagFvRsBdFvAEPgType}, }), FvRsCons: types.SetNull(types.ObjectType{ AttrTypes: map[string]attr.Type{ "annotation": types.StringType, "priority": types.StringType, "contract_name": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvRsConsFvAEPgType}, + "tags": types.SetType{ElemType: TagTagFvRsConsFvAEPgType}, }, }), FvRsConsIf: types.SetNull(types.ObjectType{ @@ -159,11 +167,15 @@ func getEmptyFvAEPgResourceModel() *FvAEPgResourceModel { "annotation": types.StringType, "priority": types.StringType, "imported_contract_name": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvRsConsIfFvAEPgType}, + "tags": types.SetType{ElemType: TagTagFvRsConsIfFvAEPgType}, }, }), FvRsCustQosPol: types.ObjectNull(map[string]attr.Type{ "annotation": types.StringType, "custom_qos_policy_name": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvRsCustQosPolFvAEPgType}, + "tags": types.SetType{ElemType: TagTagFvRsCustQosPolFvAEPgType}, }), FvRsDomAtt: types.SetNull(types.ObjectType{ AttrTypes: map[string]attr.Type{ @@ -192,11 +204,15 @@ func getEmptyFvAEPgResourceModel() *FvAEPgResourceModel { "switching_mode": types.StringType, "target_dn": types.StringType, "untagged": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvRsDomAttFvAEPgType}, + "tags": types.SetType{ElemType: TagTagFvRsDomAttFvAEPgType}, }, }), FvRsDppPol: types.ObjectNull(map[string]attr.Type{ "annotation": types.StringType, "data_plane_policing_policy_name": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvRsDppPolFvAEPgType}, + "tags": types.SetType{ElemType: TagTagFvRsDppPolFvAEPgType}, }), FvRsFcPathAtt: types.SetNull(types.ObjectType{ AttrTypes: map[string]attr.Type{ @@ -205,12 +221,16 @@ func getEmptyFvAEPgResourceModel() *FvAEPgResourceModel { "target_dn": types.StringType, "vsan": types.StringType, "vsan_mode": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvRsFcPathAttFvAEPgType}, + "tags": types.SetType{ElemType: TagTagFvRsFcPathAttFvAEPgType}, }, }), FvRsIntraEpg: types.SetNull(types.ObjectType{ AttrTypes: map[string]attr.Type{ "annotation": types.StringType, "contract_name": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvRsIntraEpgFvAEPgType}, + "tags": types.SetType{ElemType: TagTagFvRsIntraEpgFvAEPgType}, }, }), FvRsNodeAtt: types.SetNull(types.ObjectType{ @@ -221,6 +241,8 @@ func getEmptyFvAEPgResourceModel() *FvAEPgResourceModel { "deployment_immediacy": types.StringType, "mode": types.StringType, "target_dn": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvRsNodeAttFvAEPgType}, + "tags": types.SetType{ElemType: TagTagFvRsNodeAttFvAEPgType}, }, }), FvRsPathAtt: types.SetNull(types.ObjectType{ @@ -232,12 +254,16 @@ func getEmptyFvAEPgResourceModel() *FvAEPgResourceModel { "mode": types.StringType, "primary_encapsulation": types.StringType, "target_dn": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvRsPathAttFvAEPgType}, + "tags": types.SetType{ElemType: TagTagFvRsPathAttFvAEPgType}, }, }), FvRsProtBy: types.SetNull(types.ObjectType{ AttrTypes: map[string]attr.Type{ "annotation": types.StringType, "taboo_contract_name": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvRsProtByFvAEPgType}, + "tags": types.SetType{ElemType: TagTagFvRsProtByFvAEPgType}, }, }), FvRsProv: types.SetNull(types.ObjectType{ @@ -246,17 +272,23 @@ func getEmptyFvAEPgResourceModel() *FvAEPgResourceModel { "match_criteria": types.StringType, "priority": types.StringType, "contract_name": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvRsProvFvAEPgType}, + "tags": types.SetType{ElemType: TagTagFvRsProvFvAEPgType}, }, }), FvRsSecInherited: types.SetNull(types.ObjectType{ AttrTypes: map[string]attr.Type{ - "annotation": types.StringType, - "target_dn": types.StringType, + "annotation": types.StringType, + "target_dn": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvRsSecInheritedFvAEPgType}, + "tags": types.SetType{ElemType: TagTagFvRsSecInheritedFvAEPgType}, }, }), FvRsTrustCtrl: types.ObjectNull(map[string]attr.Type{ "annotation": types.StringType, "trust_control_policy_name": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvRsTrustCtrlFvAEPgType}, + "tags": types.SetType{ElemType: TagTagFvRsTrustCtrlFvAEPgType}, }), TagAnnotation: types.SetNull(types.ObjectType{ AttrTypes: map[string]attr.Type{ @@ -301,15 +333,17 @@ func getEmptyFvAEPgResourceModel() *FvAEPgResourceModel { // FvCrtrnFvAEPgResourceModel describes the resource data model for the children without relation ships. type FvCrtrnFvAEPgResourceModel struct { - Annotation types.String `tfsdk:"annotation"` - Descr types.String `tfsdk:"description"` - Match types.String `tfsdk:"match"` - Name types.String `tfsdk:"name"` - NameAlias types.String `tfsdk:"name_alias"` - OwnerKey types.String `tfsdk:"owner_key"` - OwnerTag types.String `tfsdk:"owner_tag"` - Prec types.String `tfsdk:"precedence"` - Scope types.String `tfsdk:"scope"` + Annotation types.String `tfsdk:"annotation"` + Descr types.String `tfsdk:"description"` + Match types.String `tfsdk:"match"` + Name types.String `tfsdk:"name"` + NameAlias types.String `tfsdk:"name_alias"` + OwnerKey types.String `tfsdk:"owner_key"` + OwnerTag types.String `tfsdk:"owner_tag"` + Prec types.String `tfsdk:"precedence"` + Scope types.String `tfsdk:"scope"` + TagAnnotation types.Set `tfsdk:"annotations"` + TagTag types.Set `tfsdk:"tags"` } func getEmptyFvCrtrnFvAEPgResourceModel() FvCrtrnFvAEPgResourceModel { @@ -323,6 +357,18 @@ func getEmptyFvCrtrnFvAEPgResourceModel() FvCrtrnFvAEPgResourceModel { OwnerTag: basetypes.NewStringNull(), Prec: basetypes.NewStringNull(), Scope: basetypes.NewStringNull(), + TagAnnotation: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), } } @@ -336,49 +382,205 @@ var FvCrtrnFvAEPgType = map[string]attr.Type{ "owner_tag": types.StringType, "precedence": types.StringType, "scope": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvCrtrnFvAEPgType}, + "tags": types.SetType{ElemType: TagTagFvCrtrnFvAEPgType}, +} + +// TagAnnotationFvCrtrnFvAEPgResourceModel describes the resource data model for the children without relation ships. +type TagAnnotationFvCrtrnFvAEPgResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagAnnotationFvCrtrnFvAEPgResourceModel() TagAnnotationFvCrtrnFvAEPgResourceModel { + return TagAnnotationFvCrtrnFvAEPgResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagAnnotationFvCrtrnFvAEPgType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + +// TagTagFvCrtrnFvAEPgResourceModel describes the resource data model for the children without relation ships. +type TagTagFvCrtrnFvAEPgResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagTagFvCrtrnFvAEPgResourceModel() TagTagFvCrtrnFvAEPgResourceModel { + return TagTagFvCrtrnFvAEPgResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagTagFvCrtrnFvAEPgType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, } // FvRsAEPgMonPolFvAEPgResourceModel describes the resource data model for the children without relation ships. type FvRsAEPgMonPolFvAEPgResourceModel struct { Annotation types.String `tfsdk:"annotation"` TnMonEPGPolName types.String `tfsdk:"monitoring_policy_name"` + TagAnnotation types.Set `tfsdk:"annotations"` + TagTag types.Set `tfsdk:"tags"` } func getEmptyFvRsAEPgMonPolFvAEPgResourceModel() FvRsAEPgMonPolFvAEPgResourceModel { return FvRsAEPgMonPolFvAEPgResourceModel{ Annotation: basetypes.NewStringNull(), TnMonEPGPolName: basetypes.NewStringNull(), + TagAnnotation: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), } } var FvRsAEPgMonPolFvAEPgType = map[string]attr.Type{ "annotation": types.StringType, "monitoring_policy_name": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvRsAEPgMonPolFvAEPgType}, + "tags": types.SetType{ElemType: TagTagFvRsAEPgMonPolFvAEPgType}, +} + +// TagAnnotationFvRsAEPgMonPolFvAEPgResourceModel describes the resource data model for the children without relation ships. +type TagAnnotationFvRsAEPgMonPolFvAEPgResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagAnnotationFvRsAEPgMonPolFvAEPgResourceModel() TagAnnotationFvRsAEPgMonPolFvAEPgResourceModel { + return TagAnnotationFvRsAEPgMonPolFvAEPgResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagAnnotationFvRsAEPgMonPolFvAEPgType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + +// TagTagFvRsAEPgMonPolFvAEPgResourceModel describes the resource data model for the children without relation ships. +type TagTagFvRsAEPgMonPolFvAEPgResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagTagFvRsAEPgMonPolFvAEPgResourceModel() TagTagFvRsAEPgMonPolFvAEPgResourceModel { + return TagTagFvRsAEPgMonPolFvAEPgResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagTagFvRsAEPgMonPolFvAEPgType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, } // FvRsBdFvAEPgResourceModel describes the resource data model for the children without relation ships. type FvRsBdFvAEPgResourceModel struct { - Annotation types.String `tfsdk:"annotation"` - TnFvBDName types.String `tfsdk:"bridge_domain_name"` + Annotation types.String `tfsdk:"annotation"` + TnFvBDName types.String `tfsdk:"bridge_domain_name"` + TagAnnotation types.Set `tfsdk:"annotations"` + TagTag types.Set `tfsdk:"tags"` } func getEmptyFvRsBdFvAEPgResourceModel() FvRsBdFvAEPgResourceModel { return FvRsBdFvAEPgResourceModel{ Annotation: basetypes.NewStringNull(), TnFvBDName: basetypes.NewStringNull(), + TagAnnotation: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), } } var FvRsBdFvAEPgType = map[string]attr.Type{ "annotation": types.StringType, "bridge_domain_name": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvRsBdFvAEPgType}, + "tags": types.SetType{ElemType: TagTagFvRsBdFvAEPgType}, +} + +// TagAnnotationFvRsBdFvAEPgResourceModel describes the resource data model for the children without relation ships. +type TagAnnotationFvRsBdFvAEPgResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagAnnotationFvRsBdFvAEPgResourceModel() TagAnnotationFvRsBdFvAEPgResourceModel { + return TagAnnotationFvRsBdFvAEPgResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagAnnotationFvRsBdFvAEPgType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + +// TagTagFvRsBdFvAEPgResourceModel describes the resource data model for the children without relation ships. +type TagTagFvRsBdFvAEPgResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagTagFvRsBdFvAEPgResourceModel() TagTagFvRsBdFvAEPgResourceModel { + return TagTagFvRsBdFvAEPgResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagTagFvRsBdFvAEPgType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, } // FvRsConsFvAEPgResourceModel describes the resource data model for the children without relation ships. type FvRsConsFvAEPgResourceModel struct { - Annotation types.String `tfsdk:"annotation"` - Prio customTypes.FvRsConsPrioStringValue `tfsdk:"priority"` - TnVzBrCPName types.String `tfsdk:"contract_name"` + Annotation types.String `tfsdk:"annotation"` + Prio customTypes.FvRsConsPrioStringValue `tfsdk:"priority"` + TnVzBrCPName types.String `tfsdk:"contract_name"` + TagAnnotation types.Set `tfsdk:"annotations"` + TagTag types.Set `tfsdk:"tags"` } func getEmptyFvRsConsFvAEPgResourceModel() FvRsConsFvAEPgResourceModel { @@ -386,14 +588,78 @@ func getEmptyFvRsConsFvAEPgResourceModel() FvRsConsFvAEPgResourceModel { Annotation: basetypes.NewStringNull(), Prio: customTypes.NewFvRsConsPrioStringNull(), TnVzBrCPName: basetypes.NewStringNull(), + TagAnnotation: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + } +} + +var FvRsConsFvAEPgType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "annotation": types.StringType, + "priority": types.StringType, + "contract_name": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvRsConsFvAEPgType}, + "tags": types.SetType{ElemType: TagTagFvRsConsFvAEPgType}, + }, +} + +// TagAnnotationFvRsConsFvAEPgResourceModel describes the resource data model for the children without relation ships. +type TagAnnotationFvRsConsFvAEPgResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagAnnotationFvRsConsFvAEPgResourceModel() TagAnnotationFvRsConsFvAEPgResourceModel { + return TagAnnotationFvRsConsFvAEPgResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagAnnotationFvRsConsFvAEPgType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + +// TagTagFvRsConsFvAEPgResourceModel describes the resource data model for the children without relation ships. +type TagTagFvRsConsFvAEPgResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagTagFvRsConsFvAEPgResourceModel() TagTagFvRsConsFvAEPgResourceModel { + return TagTagFvRsConsFvAEPgResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), } } +var TagTagFvRsConsFvAEPgType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // FvRsConsIfFvAEPgResourceModel describes the resource data model for the children without relation ships. type FvRsConsIfFvAEPgResourceModel struct { - Annotation types.String `tfsdk:"annotation"` - Prio customTypes.FvRsConsIfPrioStringValue `tfsdk:"priority"` - TnVzCPIfName types.String `tfsdk:"imported_contract_name"` + Annotation types.String `tfsdk:"annotation"` + Prio customTypes.FvRsConsIfPrioStringValue `tfsdk:"priority"` + TnVzCPIfName types.String `tfsdk:"imported_contract_name"` + TagAnnotation types.Set `tfsdk:"annotations"` + TagTag types.Set `tfsdk:"tags"` } func getEmptyFvRsConsIfFvAEPgResourceModel() FvRsConsIfFvAEPgResourceModel { @@ -401,25 +667,143 @@ func getEmptyFvRsConsIfFvAEPgResourceModel() FvRsConsIfFvAEPgResourceModel { Annotation: basetypes.NewStringNull(), Prio: customTypes.NewFvRsConsIfPrioStringNull(), TnVzCPIfName: basetypes.NewStringNull(), + TagAnnotation: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + } +} + +var FvRsConsIfFvAEPgType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "annotation": types.StringType, + "priority": types.StringType, + "imported_contract_name": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvRsConsIfFvAEPgType}, + "tags": types.SetType{ElemType: TagTagFvRsConsIfFvAEPgType}, + }, +} + +// TagAnnotationFvRsConsIfFvAEPgResourceModel describes the resource data model for the children without relation ships. +type TagAnnotationFvRsConsIfFvAEPgResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagAnnotationFvRsConsIfFvAEPgResourceModel() TagAnnotationFvRsConsIfFvAEPgResourceModel { + return TagAnnotationFvRsConsIfFvAEPgResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagAnnotationFvRsConsIfFvAEPgType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + +// TagTagFvRsConsIfFvAEPgResourceModel describes the resource data model for the children without relation ships. +type TagTagFvRsConsIfFvAEPgResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagTagFvRsConsIfFvAEPgResourceModel() TagTagFvRsConsIfFvAEPgResourceModel { + return TagTagFvRsConsIfFvAEPgResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), } } +var TagTagFvRsConsIfFvAEPgType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // FvRsCustQosPolFvAEPgResourceModel describes the resource data model for the children without relation ships. type FvRsCustQosPolFvAEPgResourceModel struct { Annotation types.String `tfsdk:"annotation"` TnQosCustomPolName types.String `tfsdk:"custom_qos_policy_name"` + TagAnnotation types.Set `tfsdk:"annotations"` + TagTag types.Set `tfsdk:"tags"` } func getEmptyFvRsCustQosPolFvAEPgResourceModel() FvRsCustQosPolFvAEPgResourceModel { return FvRsCustQosPolFvAEPgResourceModel{ Annotation: basetypes.NewStringNull(), TnQosCustomPolName: basetypes.NewStringNull(), + TagAnnotation: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), } } var FvRsCustQosPolFvAEPgType = map[string]attr.Type{ "annotation": types.StringType, "custom_qos_policy_name": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvRsCustQosPolFvAEPgType}, + "tags": types.SetType{ElemType: TagTagFvRsCustQosPolFvAEPgType}, +} + +// TagAnnotationFvRsCustQosPolFvAEPgResourceModel describes the resource data model for the children without relation ships. +type TagAnnotationFvRsCustQosPolFvAEPgResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagAnnotationFvRsCustQosPolFvAEPgResourceModel() TagAnnotationFvRsCustQosPolFvAEPgResourceModel { + return TagAnnotationFvRsCustQosPolFvAEPgResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagAnnotationFvRsCustQosPolFvAEPgType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + +// TagTagFvRsCustQosPolFvAEPgResourceModel describes the resource data model for the children without relation ships. +type TagTagFvRsCustQosPolFvAEPgResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagTagFvRsCustQosPolFvAEPgResourceModel() TagTagFvRsCustQosPolFvAEPgResourceModel { + return TagTagFvRsCustQosPolFvAEPgResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagTagFvRsCustQosPolFvAEPgType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, } // FvRsDomAttFvAEPgResourceModel describes the resource data model for the children without relation ships. @@ -449,6 +833,8 @@ type FvRsDomAttFvAEPgResourceModel struct { SwitchingMode types.String `tfsdk:"switching_mode"` TDn types.String `tfsdk:"target_dn"` Untagged types.String `tfsdk:"untagged"` + TagAnnotation types.Set `tfsdk:"annotations"` + TagTag types.Set `tfsdk:"tags"` } func getEmptyFvRsDomAttFvAEPgResourceModel() FvRsDomAttFvAEPgResourceModel { @@ -478,34 +864,176 @@ func getEmptyFvRsDomAttFvAEPgResourceModel() FvRsDomAttFvAEPgResourceModel { SwitchingMode: basetypes.NewStringNull(), TDn: basetypes.NewStringNull(), Untagged: basetypes.NewStringNull(), + TagAnnotation: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), } } -// FvRsDppPolFvAEPgResourceModel describes the resource data model for the children without relation ships. -type FvRsDppPolFvAEPgResourceModel struct { - Annotation types.String `tfsdk:"annotation"` - TnQosDppPolName types.String `tfsdk:"data_plane_policing_policy_name"` +var FvRsDomAttFvAEPgType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "annotation": types.StringType, + "binding_type": types.StringType, + "class_preference": types.StringType, + "custom_epg_name": types.StringType, + "delimiter": types.StringType, + "encapsulation": types.StringType, + "encapsulation_mode": types.StringType, + "epg_cos": types.StringType, + "epg_cos_pref": types.StringType, + "deployment_immediacy": types.StringType, + "ipam_dhcp_override": types.StringType, + "ipam_enabled": types.StringType, + "ipam_gateway": types.StringType, + "lag_policy_name": types.StringType, + "netflow_direction": types.StringType, + "enable_netflow": types.StringType, + "number_of_ports": types.StringType, + "port_allocation": types.StringType, + "primary_encapsulation": types.StringType, + "primary_encapsulation_inner": types.StringType, + "resolution_immediacy": types.StringType, + "secondary_encapsulation_inner": types.StringType, + "switching_mode": types.StringType, + "target_dn": types.StringType, + "untagged": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvRsDomAttFvAEPgType}, + "tags": types.SetType{ElemType: TagTagFvRsDomAttFvAEPgType}, + }, +} + +// TagAnnotationFvRsDomAttFvAEPgResourceModel describes the resource data model for the children without relation ships. +type TagAnnotationFvRsDomAttFvAEPgResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagAnnotationFvRsDomAttFvAEPgResourceModel() TagAnnotationFvRsDomAttFvAEPgResourceModel { + return TagAnnotationFvRsDomAttFvAEPgResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagAnnotationFvRsDomAttFvAEPgType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + +// TagTagFvRsDomAttFvAEPgResourceModel describes the resource data model for the children without relation ships. +type TagTagFvRsDomAttFvAEPgResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagTagFvRsDomAttFvAEPgResourceModel() TagTagFvRsDomAttFvAEPgResourceModel { + return TagTagFvRsDomAttFvAEPgResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagTagFvRsDomAttFvAEPgType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + +// FvRsDppPolFvAEPgResourceModel describes the resource data model for the children without relation ships. +type FvRsDppPolFvAEPgResourceModel struct { + Annotation types.String `tfsdk:"annotation"` + TnQosDppPolName types.String `tfsdk:"data_plane_policing_policy_name"` + TagAnnotation types.Set `tfsdk:"annotations"` + TagTag types.Set `tfsdk:"tags"` } func getEmptyFvRsDppPolFvAEPgResourceModel() FvRsDppPolFvAEPgResourceModel { return FvRsDppPolFvAEPgResourceModel{ Annotation: basetypes.NewStringNull(), TnQosDppPolName: basetypes.NewStringNull(), + TagAnnotation: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), } } var FvRsDppPolFvAEPgType = map[string]attr.Type{ "annotation": types.StringType, "data_plane_policing_policy_name": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvRsDppPolFvAEPgType}, + "tags": types.SetType{ElemType: TagTagFvRsDppPolFvAEPgType}, +} + +// TagAnnotationFvRsDppPolFvAEPgResourceModel describes the resource data model for the children without relation ships. +type TagAnnotationFvRsDppPolFvAEPgResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagAnnotationFvRsDppPolFvAEPgResourceModel() TagAnnotationFvRsDppPolFvAEPgResourceModel { + return TagAnnotationFvRsDppPolFvAEPgResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagAnnotationFvRsDppPolFvAEPgType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + +// TagTagFvRsDppPolFvAEPgResourceModel describes the resource data model for the children without relation ships. +type TagTagFvRsDppPolFvAEPgResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagTagFvRsDppPolFvAEPgResourceModel() TagTagFvRsDppPolFvAEPgResourceModel { + return TagTagFvRsDppPolFvAEPgResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagTagFvRsDppPolFvAEPgType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, } // FvRsFcPathAttFvAEPgResourceModel describes the resource data model for the children without relation ships. type FvRsFcPathAttFvAEPgResourceModel struct { - Annotation types.String `tfsdk:"annotation"` - Descr types.String `tfsdk:"description"` - TDn types.String `tfsdk:"target_dn"` - Vsan types.String `tfsdk:"vsan"` - VsanMode types.String `tfsdk:"vsan_mode"` + Annotation types.String `tfsdk:"annotation"` + Descr types.String `tfsdk:"description"` + TDn types.String `tfsdk:"target_dn"` + Vsan types.String `tfsdk:"vsan"` + VsanMode types.String `tfsdk:"vsan_mode"` + TagAnnotation types.Set `tfsdk:"annotations"` + TagTag types.Set `tfsdk:"tags"` } func getEmptyFvRsFcPathAttFvAEPgResourceModel() FvRsFcPathAttFvAEPgResourceModel { @@ -515,30 +1043,159 @@ func getEmptyFvRsFcPathAttFvAEPgResourceModel() FvRsFcPathAttFvAEPgResourceModel TDn: basetypes.NewStringNull(), Vsan: basetypes.NewStringNull(), VsanMode: basetypes.NewStringNull(), + TagAnnotation: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + } +} + +var FvRsFcPathAttFvAEPgType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "annotation": types.StringType, + "description": types.StringType, + "target_dn": types.StringType, + "vsan": types.StringType, + "vsan_mode": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvRsFcPathAttFvAEPgType}, + "tags": types.SetType{ElemType: TagTagFvRsFcPathAttFvAEPgType}, + }, +} + +// TagAnnotationFvRsFcPathAttFvAEPgResourceModel describes the resource data model for the children without relation ships. +type TagAnnotationFvRsFcPathAttFvAEPgResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagAnnotationFvRsFcPathAttFvAEPgResourceModel() TagAnnotationFvRsFcPathAttFvAEPgResourceModel { + return TagAnnotationFvRsFcPathAttFvAEPgResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagAnnotationFvRsFcPathAttFvAEPgType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + +// TagTagFvRsFcPathAttFvAEPgResourceModel describes the resource data model for the children without relation ships. +type TagTagFvRsFcPathAttFvAEPgResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagTagFvRsFcPathAttFvAEPgResourceModel() TagTagFvRsFcPathAttFvAEPgResourceModel { + return TagTagFvRsFcPathAttFvAEPgResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), } } +var TagTagFvRsFcPathAttFvAEPgType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // FvRsIntraEpgFvAEPgResourceModel describes the resource data model for the children without relation ships. type FvRsIntraEpgFvAEPgResourceModel struct { - Annotation types.String `tfsdk:"annotation"` - TnVzBrCPName types.String `tfsdk:"contract_name"` + Annotation types.String `tfsdk:"annotation"` + TnVzBrCPName types.String `tfsdk:"contract_name"` + TagAnnotation types.Set `tfsdk:"annotations"` + TagTag types.Set `tfsdk:"tags"` } func getEmptyFvRsIntraEpgFvAEPgResourceModel() FvRsIntraEpgFvAEPgResourceModel { return FvRsIntraEpgFvAEPgResourceModel{ Annotation: basetypes.NewStringNull(), TnVzBrCPName: basetypes.NewStringNull(), + TagAnnotation: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), } } +var FvRsIntraEpgFvAEPgType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "annotation": types.StringType, + "contract_name": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvRsIntraEpgFvAEPgType}, + "tags": types.SetType{ElemType: TagTagFvRsIntraEpgFvAEPgType}, + }, +} + +// TagAnnotationFvRsIntraEpgFvAEPgResourceModel describes the resource data model for the children without relation ships. +type TagAnnotationFvRsIntraEpgFvAEPgResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagAnnotationFvRsIntraEpgFvAEPgResourceModel() TagAnnotationFvRsIntraEpgFvAEPgResourceModel { + return TagAnnotationFvRsIntraEpgFvAEPgResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagAnnotationFvRsIntraEpgFvAEPgType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + +// TagTagFvRsIntraEpgFvAEPgResourceModel describes the resource data model for the children without relation ships. +type TagTagFvRsIntraEpgFvAEPgResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagTagFvRsIntraEpgFvAEPgResourceModel() TagTagFvRsIntraEpgFvAEPgResourceModel { + return TagTagFvRsIntraEpgFvAEPgResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagTagFvRsIntraEpgFvAEPgType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // FvRsNodeAttFvAEPgResourceModel describes the resource data model for the children without relation ships. type FvRsNodeAttFvAEPgResourceModel struct { - Annotation types.String `tfsdk:"annotation"` - Descr types.String `tfsdk:"description"` - Encap types.String `tfsdk:"encapsulation"` - InstrImedcy types.String `tfsdk:"deployment_immediacy"` - Mode types.String `tfsdk:"mode"` - TDn types.String `tfsdk:"target_dn"` + Annotation types.String `tfsdk:"annotation"` + Descr types.String `tfsdk:"description"` + Encap types.String `tfsdk:"encapsulation"` + InstrImedcy types.String `tfsdk:"deployment_immediacy"` + Mode types.String `tfsdk:"mode"` + TDn types.String `tfsdk:"target_dn"` + TagAnnotation types.Set `tfsdk:"annotations"` + TagTag types.Set `tfsdk:"tags"` } func getEmptyFvRsNodeAttFvAEPgResourceModel() FvRsNodeAttFvAEPgResourceModel { @@ -549,18 +1206,85 @@ func getEmptyFvRsNodeAttFvAEPgResourceModel() FvRsNodeAttFvAEPgResourceModel { InstrImedcy: basetypes.NewStringNull(), Mode: basetypes.NewStringNull(), TDn: basetypes.NewStringNull(), + TagAnnotation: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + } +} + +var FvRsNodeAttFvAEPgType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "annotation": types.StringType, + "description": types.StringType, + "encapsulation": types.StringType, + "deployment_immediacy": types.StringType, + "mode": types.StringType, + "target_dn": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvRsNodeAttFvAEPgType}, + "tags": types.SetType{ElemType: TagTagFvRsNodeAttFvAEPgType}, + }, +} + +// TagAnnotationFvRsNodeAttFvAEPgResourceModel describes the resource data model for the children without relation ships. +type TagAnnotationFvRsNodeAttFvAEPgResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagAnnotationFvRsNodeAttFvAEPgResourceModel() TagAnnotationFvRsNodeAttFvAEPgResourceModel { + return TagAnnotationFvRsNodeAttFvAEPgResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagAnnotationFvRsNodeAttFvAEPgType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + +// TagTagFvRsNodeAttFvAEPgResourceModel describes the resource data model for the children without relation ships. +type TagTagFvRsNodeAttFvAEPgResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagTagFvRsNodeAttFvAEPgResourceModel() TagTagFvRsNodeAttFvAEPgResourceModel { + return TagTagFvRsNodeAttFvAEPgResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), } } +var TagTagFvRsNodeAttFvAEPgType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // FvRsPathAttFvAEPgResourceModel describes the resource data model for the children without relation ships. type FvRsPathAttFvAEPgResourceModel struct { - Annotation types.String `tfsdk:"annotation"` - Descr types.String `tfsdk:"description"` - Encap types.String `tfsdk:"encapsulation"` - InstrImedcy types.String `tfsdk:"deployment_immediacy"` - Mode types.String `tfsdk:"mode"` - PrimaryEncap types.String `tfsdk:"primary_encapsulation"` - TDn types.String `tfsdk:"target_dn"` + Annotation types.String `tfsdk:"annotation"` + Descr types.String `tfsdk:"description"` + Encap types.String `tfsdk:"encapsulation"` + InstrImedcy types.String `tfsdk:"deployment_immediacy"` + Mode types.String `tfsdk:"mode"` + PrimaryEncap types.String `tfsdk:"primary_encapsulation"` + TDn types.String `tfsdk:"target_dn"` + TagAnnotation types.Set `tfsdk:"annotations"` + TagTag types.Set `tfsdk:"tags"` } func getEmptyFvRsPathAttFvAEPgResourceModel() FvRsPathAttFvAEPgResourceModel { @@ -572,68 +1296,381 @@ func getEmptyFvRsPathAttFvAEPgResourceModel() FvRsPathAttFvAEPgResourceModel { Mode: basetypes.NewStringNull(), PrimaryEncap: basetypes.NewStringNull(), TDn: basetypes.NewStringNull(), + TagAnnotation: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), } } +var FvRsPathAttFvAEPgType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "annotation": types.StringType, + "description": types.StringType, + "encapsulation": types.StringType, + "deployment_immediacy": types.StringType, + "mode": types.StringType, + "primary_encapsulation": types.StringType, + "target_dn": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvRsPathAttFvAEPgType}, + "tags": types.SetType{ElemType: TagTagFvRsPathAttFvAEPgType}, + }, +} + +// TagAnnotationFvRsPathAttFvAEPgResourceModel describes the resource data model for the children without relation ships. +type TagAnnotationFvRsPathAttFvAEPgResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagAnnotationFvRsPathAttFvAEPgResourceModel() TagAnnotationFvRsPathAttFvAEPgResourceModel { + return TagAnnotationFvRsPathAttFvAEPgResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagAnnotationFvRsPathAttFvAEPgType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + +// TagTagFvRsPathAttFvAEPgResourceModel describes the resource data model for the children without relation ships. +type TagTagFvRsPathAttFvAEPgResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagTagFvRsPathAttFvAEPgResourceModel() TagTagFvRsPathAttFvAEPgResourceModel { + return TagTagFvRsPathAttFvAEPgResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagTagFvRsPathAttFvAEPgType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // FvRsProtByFvAEPgResourceModel describes the resource data model for the children without relation ships. type FvRsProtByFvAEPgResourceModel struct { Annotation types.String `tfsdk:"annotation"` TnVzTabooName types.String `tfsdk:"taboo_contract_name"` + TagAnnotation types.Set `tfsdk:"annotations"` + TagTag types.Set `tfsdk:"tags"` } func getEmptyFvRsProtByFvAEPgResourceModel() FvRsProtByFvAEPgResourceModel { return FvRsProtByFvAEPgResourceModel{ Annotation: basetypes.NewStringNull(), TnVzTabooName: basetypes.NewStringNull(), + TagAnnotation: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + } +} + +var FvRsProtByFvAEPgType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "annotation": types.StringType, + "taboo_contract_name": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvRsProtByFvAEPgType}, + "tags": types.SetType{ElemType: TagTagFvRsProtByFvAEPgType}, + }, +} + +// TagAnnotationFvRsProtByFvAEPgResourceModel describes the resource data model for the children without relation ships. +type TagAnnotationFvRsProtByFvAEPgResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagAnnotationFvRsProtByFvAEPgResourceModel() TagAnnotationFvRsProtByFvAEPgResourceModel { + return TagAnnotationFvRsProtByFvAEPgResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagAnnotationFvRsProtByFvAEPgType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + +// TagTagFvRsProtByFvAEPgResourceModel describes the resource data model for the children without relation ships. +type TagTagFvRsProtByFvAEPgResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagTagFvRsProtByFvAEPgResourceModel() TagTagFvRsProtByFvAEPgResourceModel { + return TagTagFvRsProtByFvAEPgResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), } } -// FvRsProvFvAEPgResourceModel describes the resource data model for the children without relation ships. -type FvRsProvFvAEPgResourceModel struct { - Annotation types.String `tfsdk:"annotation"` - MatchT types.String `tfsdk:"match_criteria"` - Prio customTypes.FvRsProvPrioStringValue `tfsdk:"priority"` - TnVzBrCPName types.String `tfsdk:"contract_name"` +var TagTagFvRsProtByFvAEPgType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + +// FvRsProvFvAEPgResourceModel describes the resource data model for the children without relation ships. +type FvRsProvFvAEPgResourceModel struct { + Annotation types.String `tfsdk:"annotation"` + MatchT types.String `tfsdk:"match_criteria"` + Prio customTypes.FvRsProvPrioStringValue `tfsdk:"priority"` + TnVzBrCPName types.String `tfsdk:"contract_name"` + TagAnnotation types.Set `tfsdk:"annotations"` + TagTag types.Set `tfsdk:"tags"` +} + +func getEmptyFvRsProvFvAEPgResourceModel() FvRsProvFvAEPgResourceModel { + return FvRsProvFvAEPgResourceModel{ + Annotation: basetypes.NewStringNull(), + MatchT: basetypes.NewStringNull(), + Prio: customTypes.NewFvRsProvPrioStringNull(), + TnVzBrCPName: basetypes.NewStringNull(), + TagAnnotation: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + } +} + +var FvRsProvFvAEPgType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "annotation": types.StringType, + "match_criteria": types.StringType, + "priority": types.StringType, + "contract_name": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvRsProvFvAEPgType}, + "tags": types.SetType{ElemType: TagTagFvRsProvFvAEPgType}, + }, +} + +// TagAnnotationFvRsProvFvAEPgResourceModel describes the resource data model for the children without relation ships. +type TagAnnotationFvRsProvFvAEPgResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagAnnotationFvRsProvFvAEPgResourceModel() TagAnnotationFvRsProvFvAEPgResourceModel { + return TagAnnotationFvRsProvFvAEPgResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagAnnotationFvRsProvFvAEPgType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + +// TagTagFvRsProvFvAEPgResourceModel describes the resource data model for the children without relation ships. +type TagTagFvRsProvFvAEPgResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagTagFvRsProvFvAEPgResourceModel() TagTagFvRsProvFvAEPgResourceModel { + return TagTagFvRsProvFvAEPgResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagTagFvRsProvFvAEPgType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + +// FvRsSecInheritedFvAEPgResourceModel describes the resource data model for the children without relation ships. +type FvRsSecInheritedFvAEPgResourceModel struct { + Annotation types.String `tfsdk:"annotation"` + TDn types.String `tfsdk:"target_dn"` + TagAnnotation types.Set `tfsdk:"annotations"` + TagTag types.Set `tfsdk:"tags"` +} + +func getEmptyFvRsSecInheritedFvAEPgResourceModel() FvRsSecInheritedFvAEPgResourceModel { + return FvRsSecInheritedFvAEPgResourceModel{ + Annotation: basetypes.NewStringNull(), + TDn: basetypes.NewStringNull(), + TagAnnotation: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + } +} + +var FvRsSecInheritedFvAEPgType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "annotation": types.StringType, + "target_dn": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvRsSecInheritedFvAEPgType}, + "tags": types.SetType{ElemType: TagTagFvRsSecInheritedFvAEPgType}, + }, +} + +// TagAnnotationFvRsSecInheritedFvAEPgResourceModel describes the resource data model for the children without relation ships. +type TagAnnotationFvRsSecInheritedFvAEPgResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` } -func getEmptyFvRsProvFvAEPgResourceModel() FvRsProvFvAEPgResourceModel { - return FvRsProvFvAEPgResourceModel{ - Annotation: basetypes.NewStringNull(), - MatchT: basetypes.NewStringNull(), - Prio: customTypes.NewFvRsProvPrioStringNull(), - TnVzBrCPName: basetypes.NewStringNull(), +func getEmptyTagAnnotationFvRsSecInheritedFvAEPgResourceModel() TagAnnotationFvRsSecInheritedFvAEPgResourceModel { + return TagAnnotationFvRsSecInheritedFvAEPgResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), } } -// FvRsSecInheritedFvAEPgResourceModel describes the resource data model for the children without relation ships. -type FvRsSecInheritedFvAEPgResourceModel struct { - Annotation types.String `tfsdk:"annotation"` - TDn types.String `tfsdk:"target_dn"` +var TagAnnotationFvRsSecInheritedFvAEPgType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, } -func getEmptyFvRsSecInheritedFvAEPgResourceModel() FvRsSecInheritedFvAEPgResourceModel { - return FvRsSecInheritedFvAEPgResourceModel{ - Annotation: basetypes.NewStringNull(), - TDn: basetypes.NewStringNull(), +// TagTagFvRsSecInheritedFvAEPgResourceModel describes the resource data model for the children without relation ships. +type TagTagFvRsSecInheritedFvAEPgResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagTagFvRsSecInheritedFvAEPgResourceModel() TagTagFvRsSecInheritedFvAEPgResourceModel { + return TagTagFvRsSecInheritedFvAEPgResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), } } +var TagTagFvRsSecInheritedFvAEPgType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // FvRsTrustCtrlFvAEPgResourceModel describes the resource data model for the children without relation ships. type FvRsTrustCtrlFvAEPgResourceModel struct { Annotation types.String `tfsdk:"annotation"` TnFhsTrustCtrlPolName types.String `tfsdk:"trust_control_policy_name"` + TagAnnotation types.Set `tfsdk:"annotations"` + TagTag types.Set `tfsdk:"tags"` } func getEmptyFvRsTrustCtrlFvAEPgResourceModel() FvRsTrustCtrlFvAEPgResourceModel { return FvRsTrustCtrlFvAEPgResourceModel{ Annotation: basetypes.NewStringNull(), TnFhsTrustCtrlPolName: basetypes.NewStringNull(), + TagAnnotation: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), } } var FvRsTrustCtrlFvAEPgType = map[string]attr.Type{ "annotation": types.StringType, "trust_control_policy_name": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvRsTrustCtrlFvAEPgType}, + "tags": types.SetType{ElemType: TagTagFvRsTrustCtrlFvAEPgType}, +} + +// TagAnnotationFvRsTrustCtrlFvAEPgResourceModel describes the resource data model for the children without relation ships. +type TagAnnotationFvRsTrustCtrlFvAEPgResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagAnnotationFvRsTrustCtrlFvAEPgResourceModel() TagAnnotationFvRsTrustCtrlFvAEPgResourceModel { + return TagAnnotationFvRsTrustCtrlFvAEPgResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagAnnotationFvRsTrustCtrlFvAEPgType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + +// TagTagFvRsTrustCtrlFvAEPgResourceModel describes the resource data model for the children without relation ships. +type TagTagFvRsTrustCtrlFvAEPgResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagTagFvRsTrustCtrlFvAEPgResourceModel() TagTagFvRsTrustCtrlFvAEPgResourceModel { + return TagTagFvRsTrustCtrlFvAEPgResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagTagFvRsTrustCtrlFvAEPgType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, } // TagAnnotationFvAEPgResourceModel describes the resource data model for the children without relation ships. @@ -649,6 +1686,13 @@ func getEmptyTagAnnotationFvAEPgResourceModel() TagAnnotationFvAEPgResourceModel } } +var TagAnnotationFvAEPgType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // TagTagFvAEPgResourceModel describes the resource data model for the children without relation ships. type TagTagFvAEPgResourceModel struct { Key types.String `tfsdk:"key"` @@ -662,6 +1706,13 @@ func getEmptyTagTagFvAEPgResourceModel() TagTagFvAEPgResourceModel { } } +var TagTagFvAEPgType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + type FvAEPgIdentifier struct { Name types.String } @@ -968,6 +2019,18 @@ func (r *FvAEPgResource) UpgradeState(ctx context.Context) map[int64]resource.St FvRsAEPgMonPolObject := FvRsAEPgMonPolFvAEPgResourceModel{ Annotation: basetypes.NewStringNull(), TnMonEPGPolName: basetypes.NewStringValue(GetMOName(priorStateData.FvRsAEPgMonPol.ValueString())), + TagAnnotation: basetypes.NewSetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: basetypes.NewSetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), } fvRsAEPgMonPolObject, _ := types.ObjectValueFrom(ctx, FvRsAEPgMonPolFvAEPgType, FvRsAEPgMonPolObject) upgradedStateData.FvRsAEPgMonPol = fvRsAEPgMonPolObject @@ -975,6 +2038,18 @@ func (r *FvAEPgResource) UpgradeState(ctx context.Context) map[int64]resource.St FvRsBdObject := FvRsBdFvAEPgResourceModel{ Annotation: basetypes.NewStringNull(), TnFvBDName: basetypes.NewStringValue(GetMOName(priorStateData.FvRsBd.ValueString())), + TagAnnotation: basetypes.NewSetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: basetypes.NewSetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), } fvRsBdObject, _ := types.ObjectValueFrom(ctx, FvRsBdFvAEPgType, FvRsBdObject) upgradedStateData.FvRsBd = fvRsBdObject @@ -986,17 +2061,22 @@ func (r *FvAEPgResource) UpgradeState(ctx context.Context) map[int64]resource.St FvRsCons := FvRsConsFvAEPgResourceModel{ Annotation: basetypes.NewStringNull(), TnVzBrCPName: basetypes.NewStringValue(GetMOName(priorStateDataFvRsCons)), + TagAnnotation: basetypes.NewSetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: basetypes.NewSetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), } FvRsConsList = append(FvRsConsList, FvRsCons) } - FvRsConsType := types.ObjectType{ - AttrTypes: map[string]attr.Type{ - "annotation": basetypes.StringType{}, - "priority": basetypes.StringType{}, - "contract_name": basetypes.StringType{}, - }, - } - FvRsConsSet, _ := types.SetValueFrom(ctx, FvRsConsType, FvRsConsList) + FvRsConsSet, _ := types.SetValueFrom(ctx, FvRsConsFvAEPgType, FvRsConsList) upgradedStateData.FvRsCons = FvRsConsSet FvRsConsIfList := make([]FvRsConsIfFvAEPgResourceModel, 0) @@ -1006,22 +2086,39 @@ func (r *FvAEPgResource) UpgradeState(ctx context.Context) map[int64]resource.St FvRsConsIf := FvRsConsIfFvAEPgResourceModel{ Annotation: basetypes.NewStringNull(), TnVzCPIfName: basetypes.NewStringValue(GetMOName(priorStateDataFvRsConsIf)), + TagAnnotation: basetypes.NewSetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: basetypes.NewSetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), } FvRsConsIfList = append(FvRsConsIfList, FvRsConsIf) } - FvRsConsIfType := types.ObjectType{ - AttrTypes: map[string]attr.Type{ - "annotation": basetypes.StringType{}, - "priority": basetypes.StringType{}, - "imported_contract_name": basetypes.StringType{}, - }, - } - FvRsConsIfSet, _ := types.SetValueFrom(ctx, FvRsConsIfType, FvRsConsIfList) + FvRsConsIfSet, _ := types.SetValueFrom(ctx, FvRsConsIfFvAEPgType, FvRsConsIfList) upgradedStateData.FvRsConsIf = FvRsConsIfSet FvRsCustQosPolObject := FvRsCustQosPolFvAEPgResourceModel{ Annotation: basetypes.NewStringNull(), TnQosCustomPolName: basetypes.NewStringValue(GetMOName(priorStateData.FvRsCustQosPol.ValueString())), + TagAnnotation: basetypes.NewSetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: basetypes.NewSetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), } fvRsCustQosPolObject, _ := types.ObjectValueFrom(ctx, FvRsCustQosPolFvAEPgType, FvRsCustQosPolObject) upgradedStateData.FvRsCustQosPol = fvRsCustQosPolObject @@ -1054,6 +2151,8 @@ func (r *FvAEPgResource) UpgradeState(ctx context.Context) map[int64]resource.St "switching_mode": basetypes.StringType{}, "target_dn": basetypes.StringType{}, "untagged": basetypes.StringType{}, + "annotations": basetypes.SetType{ElemType: TagAnnotationFvRsDomAttFvAEPgType}, + "tags": basetypes.SetType{ElemType: TagTagFvRsDomAttFvAEPgType}, }, }, ) @@ -1061,6 +2160,18 @@ func (r *FvAEPgResource) UpgradeState(ctx context.Context) map[int64]resource.St FvRsDppPolObject := FvRsDppPolFvAEPgResourceModel{ Annotation: basetypes.NewStringNull(), TnQosDppPolName: basetypes.NewStringValue(GetMOName(priorStateData.FvRsDppPol.ValueString())), + TagAnnotation: basetypes.NewSetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: basetypes.NewSetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), } fvRsDppPolObject, _ := types.ObjectValueFrom(ctx, FvRsDppPolFvAEPgType, FvRsDppPolObject) upgradedStateData.FvRsDppPol = fvRsDppPolObject @@ -1075,19 +2186,22 @@ func (r *FvAEPgResource) UpgradeState(ctx context.Context) map[int64]resource.St TDn: basetypes.NewStringValue(priorStateDataFvRsFcPathAtt), Vsan: basetypes.NewStringNull(), VsanMode: basetypes.NewStringNull(), + TagAnnotation: basetypes.NewSetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: basetypes.NewSetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), } FvRsFcPathAttList = append(FvRsFcPathAttList, FvRsFcPathAtt) } - FvRsFcPathAttType := types.ObjectType{ - AttrTypes: map[string]attr.Type{ - "annotation": basetypes.StringType{}, - "description": basetypes.StringType{}, - "target_dn": basetypes.StringType{}, - "vsan": basetypes.StringType{}, - "vsan_mode": basetypes.StringType{}, - }, - } - FvRsFcPathAttSet, _ := types.SetValueFrom(ctx, FvRsFcPathAttType, FvRsFcPathAttList) + FvRsFcPathAttSet, _ := types.SetValueFrom(ctx, FvRsFcPathAttFvAEPgType, FvRsFcPathAttList) upgradedStateData.FvRsFcPathAtt = FvRsFcPathAttSet FvRsIntraEpgList := make([]FvRsIntraEpgFvAEPgResourceModel, 0) @@ -1097,16 +2211,22 @@ func (r *FvAEPgResource) UpgradeState(ctx context.Context) map[int64]resource.St FvRsIntraEpg := FvRsIntraEpgFvAEPgResourceModel{ Annotation: basetypes.NewStringNull(), TnVzBrCPName: basetypes.NewStringValue(GetMOName(priorStateDataFvRsIntraEpg)), + TagAnnotation: basetypes.NewSetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: basetypes.NewSetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), } FvRsIntraEpgList = append(FvRsIntraEpgList, FvRsIntraEpg) } - FvRsIntraEpgType := types.ObjectType{ - AttrTypes: map[string]attr.Type{ - "annotation": basetypes.StringType{}, - "contract_name": basetypes.StringType{}, - }, - } - FvRsIntraEpgSet, _ := types.SetValueFrom(ctx, FvRsIntraEpgType, FvRsIntraEpgList) + FvRsIntraEpgSet, _ := types.SetValueFrom(ctx, FvRsIntraEpgFvAEPgType, FvRsIntraEpgList) upgradedStateData.FvRsIntraEpg = FvRsIntraEpgSet FvRsNodeAttList := make([]FvRsNodeAttFvAEPgResourceModel, 0) @@ -1120,20 +2240,22 @@ func (r *FvAEPgResource) UpgradeState(ctx context.Context) map[int64]resource.St InstrImedcy: priorStateDataFvRsNodeAtt.InstrImedcy, Mode: priorStateDataFvRsNodeAtt.Mode, TDn: priorStateDataFvRsNodeAtt.TDn, + TagAnnotation: basetypes.NewSetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: basetypes.NewSetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), } FvRsNodeAttList = append(FvRsNodeAttList, FvRsNodeAtt) } - FvRsNodeAttType := types.ObjectType{ - AttrTypes: map[string]attr.Type{ - "annotation": basetypes.StringType{}, - "description": basetypes.StringType{}, - "encapsulation": basetypes.StringType{}, - "deployment_immediacy": basetypes.StringType{}, - "mode": basetypes.StringType{}, - "target_dn": basetypes.StringType{}, - }, - } - FvRsNodeAttSet, _ := types.SetValueFrom(ctx, FvRsNodeAttType, FvRsNodeAttList) + FvRsNodeAttSet, _ := types.SetValueFrom(ctx, FvRsNodeAttFvAEPgType, FvRsNodeAttList) upgradedStateData.FvRsNodeAtt = FvRsNodeAttSet FvRsPathAttList := make([]FvRsPathAttFvAEPgResourceModel, 0) @@ -1147,21 +2269,22 @@ func (r *FvAEPgResource) UpgradeState(ctx context.Context) map[int64]resource.St Mode: basetypes.NewStringNull(), PrimaryEncap: basetypes.NewStringNull(), TDn: basetypes.NewStringValue(priorStateDataFvRsPathAtt), + TagAnnotation: basetypes.NewSetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: basetypes.NewSetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), } FvRsPathAttList = append(FvRsPathAttList, FvRsPathAtt) } - FvRsPathAttType := types.ObjectType{ - AttrTypes: map[string]attr.Type{ - "annotation": basetypes.StringType{}, - "description": basetypes.StringType{}, - "encapsulation": basetypes.StringType{}, - "deployment_immediacy": basetypes.StringType{}, - "mode": basetypes.StringType{}, - "primary_encapsulation": basetypes.StringType{}, - "target_dn": basetypes.StringType{}, - }, - } - FvRsPathAttSet, _ := types.SetValueFrom(ctx, FvRsPathAttType, FvRsPathAttList) + FvRsPathAttSet, _ := types.SetValueFrom(ctx, FvRsPathAttFvAEPgType, FvRsPathAttList) upgradedStateData.FvRsPathAtt = FvRsPathAttSet FvRsProtByList := make([]FvRsProtByFvAEPgResourceModel, 0) @@ -1171,16 +2294,22 @@ func (r *FvAEPgResource) UpgradeState(ctx context.Context) map[int64]resource.St FvRsProtBy := FvRsProtByFvAEPgResourceModel{ Annotation: basetypes.NewStringNull(), TnVzTabooName: basetypes.NewStringValue(GetMOName(priorStateDataFvRsProtBy)), + TagAnnotation: basetypes.NewSetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: basetypes.NewSetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), } FvRsProtByList = append(FvRsProtByList, FvRsProtBy) } - FvRsProtByType := types.ObjectType{ - AttrTypes: map[string]attr.Type{ - "annotation": basetypes.StringType{}, - "taboo_contract_name": basetypes.StringType{}, - }, - } - FvRsProtBySet, _ := types.SetValueFrom(ctx, FvRsProtByType, FvRsProtByList) + FvRsProtBySet, _ := types.SetValueFrom(ctx, FvRsProtByFvAEPgType, FvRsProtByList) upgradedStateData.FvRsProtBy = FvRsProtBySet FvRsProvList := make([]FvRsProvFvAEPgResourceModel, 0) @@ -1190,18 +2319,22 @@ func (r *FvAEPgResource) UpgradeState(ctx context.Context) map[int64]resource.St FvRsProv := FvRsProvFvAEPgResourceModel{ Annotation: basetypes.NewStringNull(), TnVzBrCPName: basetypes.NewStringValue(GetMOName(priorStateDataFvRsProv)), + TagAnnotation: basetypes.NewSetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: basetypes.NewSetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), } FvRsProvList = append(FvRsProvList, FvRsProv) } - FvRsProvType := types.ObjectType{ - AttrTypes: map[string]attr.Type{ - "annotation": basetypes.StringType{}, - "match_criteria": basetypes.StringType{}, - "priority": basetypes.StringType{}, - "contract_name": basetypes.StringType{}, - }, - } - FvRsProvSet, _ := types.SetValueFrom(ctx, FvRsProvType, FvRsProvList) + FvRsProvSet, _ := types.SetValueFrom(ctx, FvRsProvFvAEPgType, FvRsProvList) upgradedStateData.FvRsProv = FvRsProvSet FvRsSecInheritedList := make([]FvRsSecInheritedFvAEPgResourceModel, 0) @@ -1211,21 +2344,39 @@ func (r *FvAEPgResource) UpgradeState(ctx context.Context) map[int64]resource.St FvRsSecInherited := FvRsSecInheritedFvAEPgResourceModel{ Annotation: basetypes.NewStringNull(), TDn: basetypes.NewStringValue(priorStateDataFvRsSecInherited), + TagAnnotation: basetypes.NewSetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: basetypes.NewSetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), } FvRsSecInheritedList = append(FvRsSecInheritedList, FvRsSecInherited) } - FvRsSecInheritedType := types.ObjectType{ - AttrTypes: map[string]attr.Type{ - "annotation": basetypes.StringType{}, - "target_dn": basetypes.StringType{}, - }, - } - FvRsSecInheritedSet, _ := types.SetValueFrom(ctx, FvRsSecInheritedType, FvRsSecInheritedList) + FvRsSecInheritedSet, _ := types.SetValueFrom(ctx, FvRsSecInheritedFvAEPgType, FvRsSecInheritedList) upgradedStateData.FvRsSecInherited = FvRsSecInheritedSet FvRsTrustCtrlObject := FvRsTrustCtrlFvAEPgResourceModel{ Annotation: basetypes.NewStringNull(), TnFhsTrustCtrlPolName: basetypes.NewStringValue(GetMOName(priorStateData.FvRsTrustCtrl.ValueString())), + TagAnnotation: basetypes.NewSetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: basetypes.NewSetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), } fvRsTrustCtrlObject, _ := types.ObjectValueFrom(ctx, FvRsTrustCtrlFvAEPgType, FvRsTrustCtrlObject) upgradedStateData.FvRsTrustCtrl = fvRsTrustCtrlObject @@ -1646,9 +2797,25 @@ func (r *FvAEPgResource) ModifyPlan(ctx context.Context, req resource.ModifyPlan } } } else if !configData.DeprecatedFvRsAEPgMonPol.IsNull() { + var newAttributeValues FvRsAEPgMonPolFvAEPgResourceModel + tagAnnotationFvRsAEPgMonPolFvAEPgValue, _ := types.SetValueFrom(ctx, TagAnnotationFvRsAEPgMonPolFvAEPgType, make([]TagAnnotationFvRsAEPgMonPolFvAEPgResourceModel, 0)) + tagTagFvRsAEPgMonPolFvAEPgValue, _ := types.SetValueFrom(ctx, TagTagFvRsAEPgMonPolFvAEPgType, make([]TagTagFvRsAEPgMonPolFvAEPgResourceModel, 0)) + annotationValue := planData.Annotation + if stateData != nil { + stateData.FvRsAEPgMonPol.As(ctx, &newAttributeValues, basetypes.ObjectAsOptions{}) + annotationValue = newAttributeValues.Annotation + tagAnnotationFvRsAEPgMonPolFvAEPgValue = newAttributeValues.TagAnnotation + tagTagFvRsAEPgMonPolFvAEPgValue = newAttributeValues.TagTag + } + tnMonEPGPolNameValue := basetypes.NewStringUnknown() + if !configData.DeprecatedFvRsAEPgMonPol.IsUnknown() { + tnMonEPGPolNameValue = basetypes.NewStringValue(GetMOName(configData.DeprecatedFvRsAEPgMonPol.ValueString())) + } FvRsAEPgMonPol := FvRsAEPgMonPolFvAEPgResourceModel{ - Annotation: planData.Annotation, - TnMonEPGPolName: basetypes.NewStringValue(GetMOName(configData.DeprecatedFvRsAEPgMonPol.ValueString())), + Annotation: annotationValue, + TnMonEPGPolName: tnMonEPGPolNameValue, + TagAnnotation: tagAnnotationFvRsAEPgMonPolFvAEPgValue, + TagTag: tagTagFvRsAEPgMonPolFvAEPgValue, } FvRsAEPgMonPolObject, _ := types.ObjectValueFrom(ctx, FvRsAEPgMonPolFvAEPgType, FvRsAEPgMonPol) planData.FvRsAEPgMonPol = FvRsAEPgMonPolObject @@ -1668,9 +2835,25 @@ func (r *FvAEPgResource) ModifyPlan(ctx context.Context, req resource.ModifyPlan } } } else if !configData.DeprecatedFvRsBd.IsNull() { + var newAttributeValues FvRsBdFvAEPgResourceModel + tagAnnotationFvRsBdFvAEPgValue, _ := types.SetValueFrom(ctx, TagAnnotationFvRsBdFvAEPgType, make([]TagAnnotationFvRsBdFvAEPgResourceModel, 0)) + tagTagFvRsBdFvAEPgValue, _ := types.SetValueFrom(ctx, TagTagFvRsBdFvAEPgType, make([]TagTagFvRsBdFvAEPgResourceModel, 0)) + annotationValue := planData.Annotation + if stateData != nil { + stateData.FvRsBd.As(ctx, &newAttributeValues, basetypes.ObjectAsOptions{}) + annotationValue = newAttributeValues.Annotation + tagAnnotationFvRsBdFvAEPgValue = newAttributeValues.TagAnnotation + tagTagFvRsBdFvAEPgValue = newAttributeValues.TagTag + } + tnFvBDNameValue := basetypes.NewStringUnknown() + if !configData.DeprecatedFvRsBd.IsUnknown() { + tnFvBDNameValue = basetypes.NewStringValue(GetMOName(configData.DeprecatedFvRsBd.ValueString())) + } FvRsBd := FvRsBdFvAEPgResourceModel{ - Annotation: planData.Annotation, - TnFvBDName: basetypes.NewStringValue(GetMOName(configData.DeprecatedFvRsBd.ValueString())), + Annotation: annotationValue, + TnFvBDName: tnFvBDNameValue, + TagAnnotation: tagAnnotationFvRsBdFvAEPgValue, + TagTag: tagTagFvRsBdFvAEPgValue, } FvRsBdObject, _ := types.ObjectValueFrom(ctx, FvRsBdFvAEPgType, FvRsBd) planData.FvRsBd = FvRsBdObject @@ -1702,7 +2885,7 @@ func (r *FvAEPgResource) ModifyPlan(ctx context.Context, req resource.ModifyPlan } } else if !configData.DeprecatedFvRsCons.IsNull() { FvRsConsList := make([]FvRsConsFvAEPgResourceModel, 0) - var attributeValues []string + var attributeValues []basetypes.StringValue var newAttributeValues []FvRsConsFvAEPgResourceModel configData.DeprecatedFvRsCons.ElementsAs(ctx, &attributeValues, false) if stateData != nil { @@ -1712,14 +2895,18 @@ func (r *FvAEPgResource) ModifyPlan(ctx context.Context, req resource.ModifyPlan FvRsConsValue := FvRsConsFvAEPgResourceModel{} foundAttributeValue := false for _, newAttributeValue := range newAttributeValues { - if newAttributeValue.TnVzBrCPName.ValueString() == GetMOName(attributeValue) { + if newAttributeValue.TnVzBrCPName.ValueString() == GetMOName(attributeValue.ValueString()) { FvRsConsValue = newAttributeValue foundAttributeValue = true break } } + tnVzBrCPNameValue := basetypes.NewStringUnknown() + if !attributeValue.IsUnknown() { + tnVzBrCPNameValue = basetypes.NewStringValue(GetMOName(attributeValue.ValueString())) + } FvRsCons := FvRsConsFvAEPgResourceModel{ - TnVzBrCPName: basetypes.NewStringValue(GetMOName(attributeValue)), + TnVzBrCPName: tnVzBrCPNameValue, } if foundAttributeValue { @@ -1729,16 +2916,13 @@ func (r *FvAEPgResource) ModifyPlan(ctx context.Context, req resource.ModifyPlan FvRsCons.Annotation = planData.Annotation FvRsCons.Prio = customTypes.NewFvRsConsPrioStringValue("unspecified") // Default to default value from meta when not found } + tagAnnotationFvRsConsFvAEPgValue, _ := types.SetValueFrom(ctx, TagAnnotationFvRsConsFvAEPgType, make([]TagAnnotationFvRsConsFvAEPgResourceModel, 0)) + FvRsCons.TagAnnotation = tagAnnotationFvRsConsFvAEPgValue + tagTagFvRsConsFvAEPgValue, _ := types.SetValueFrom(ctx, TagTagFvRsConsFvAEPgType, make([]TagTagFvRsConsFvAEPgResourceModel, 0)) + FvRsCons.TagTag = tagTagFvRsConsFvAEPgValue FvRsConsList = append(FvRsConsList, FvRsCons) } - FvRsConsType := types.ObjectType{ - AttrTypes: map[string]attr.Type{ - "annotation": basetypes.StringType{}, - "priority": basetypes.StringType{}, - "contract_name": basetypes.StringType{}, - }, - } - FvRsConsSet, _ := types.SetValueFrom(ctx, FvRsConsType, FvRsConsList) + FvRsConsSet, _ := types.SetValueFrom(ctx, FvRsConsFvAEPgType, FvRsConsList) planData.FvRsCons = FvRsConsSet } else if stateData != nil { // used to replace use state for unknown planData.DeprecatedFvRsCons = stateData.DeprecatedFvRsCons @@ -1768,7 +2952,7 @@ func (r *FvAEPgResource) ModifyPlan(ctx context.Context, req resource.ModifyPlan } } else if !configData.DeprecatedFvRsSecInherited.IsNull() { FvRsSecInheritedList := make([]FvRsSecInheritedFvAEPgResourceModel, 0) - var attributeValues []string + var attributeValues []basetypes.StringValue var newAttributeValues []FvRsSecInheritedFvAEPgResourceModel configData.DeprecatedFvRsSecInherited.ElementsAs(ctx, &attributeValues, false) if stateData != nil { @@ -1778,14 +2962,18 @@ func (r *FvAEPgResource) ModifyPlan(ctx context.Context, req resource.ModifyPlan FvRsSecInheritedValue := FvRsSecInheritedFvAEPgResourceModel{} foundAttributeValue := false for _, newAttributeValue := range newAttributeValues { - if newAttributeValue.TDn.ValueString() == attributeValue { + if newAttributeValue.TDn.ValueString() == attributeValue.ValueString() { FvRsSecInheritedValue = newAttributeValue foundAttributeValue = true break } } + tDnValue := basetypes.NewStringUnknown() + if !attributeValue.IsUnknown() { + tDnValue = basetypes.NewStringValue(attributeValue.ValueString()) + } FvRsSecInherited := FvRsSecInheritedFvAEPgResourceModel{ - TDn: basetypes.NewStringValue(attributeValue), + TDn: tDnValue, } if foundAttributeValue { @@ -1793,15 +2981,13 @@ func (r *FvAEPgResource) ModifyPlan(ctx context.Context, req resource.ModifyPlan } else { FvRsSecInherited.Annotation = planData.Annotation } + tagAnnotationFvRsSecInheritedFvAEPgValue, _ := types.SetValueFrom(ctx, TagAnnotationFvRsSecInheritedFvAEPgType, make([]TagAnnotationFvRsSecInheritedFvAEPgResourceModel, 0)) + FvRsSecInherited.TagAnnotation = tagAnnotationFvRsSecInheritedFvAEPgValue + tagTagFvRsSecInheritedFvAEPgValue, _ := types.SetValueFrom(ctx, TagTagFvRsSecInheritedFvAEPgType, make([]TagTagFvRsSecInheritedFvAEPgResourceModel, 0)) + FvRsSecInherited.TagTag = tagTagFvRsSecInheritedFvAEPgValue FvRsSecInheritedList = append(FvRsSecInheritedList, FvRsSecInherited) } - FvRsSecInheritedType := types.ObjectType{ - AttrTypes: map[string]attr.Type{ - "annotation": basetypes.StringType{}, - "target_dn": basetypes.StringType{}, - }, - } - FvRsSecInheritedSet, _ := types.SetValueFrom(ctx, FvRsSecInheritedType, FvRsSecInheritedList) + FvRsSecInheritedSet, _ := types.SetValueFrom(ctx, FvRsSecInheritedFvAEPgType, FvRsSecInheritedList) planData.FvRsSecInherited = FvRsSecInheritedSet } else if stateData != nil { // used to replace use state for unknown planData.DeprecatedFvRsSecInherited = stateData.DeprecatedFvRsSecInherited @@ -1819,9 +3005,25 @@ func (r *FvAEPgResource) ModifyPlan(ctx context.Context, req resource.ModifyPlan } } } else if !configData.DeprecatedFvRsCustQosPol.IsNull() { + var newAttributeValues FvRsCustQosPolFvAEPgResourceModel + tagAnnotationFvRsCustQosPolFvAEPgValue, _ := types.SetValueFrom(ctx, TagAnnotationFvRsCustQosPolFvAEPgType, make([]TagAnnotationFvRsCustQosPolFvAEPgResourceModel, 0)) + tagTagFvRsCustQosPolFvAEPgValue, _ := types.SetValueFrom(ctx, TagTagFvRsCustQosPolFvAEPgType, make([]TagTagFvRsCustQosPolFvAEPgResourceModel, 0)) + annotationValue := planData.Annotation + if stateData != nil { + stateData.FvRsCustQosPol.As(ctx, &newAttributeValues, basetypes.ObjectAsOptions{}) + annotationValue = newAttributeValues.Annotation + tagAnnotationFvRsCustQosPolFvAEPgValue = newAttributeValues.TagAnnotation + tagTagFvRsCustQosPolFvAEPgValue = newAttributeValues.TagTag + } + tnQosCustomPolNameValue := basetypes.NewStringUnknown() + if !configData.DeprecatedFvRsCustQosPol.IsUnknown() { + tnQosCustomPolNameValue = basetypes.NewStringValue(GetMOName(configData.DeprecatedFvRsCustQosPol.ValueString())) + } FvRsCustQosPol := FvRsCustQosPolFvAEPgResourceModel{ - Annotation: planData.Annotation, - TnQosCustomPolName: basetypes.NewStringValue(GetMOName(configData.DeprecatedFvRsCustQosPol.ValueString())), + Annotation: annotationValue, + TnQosCustomPolName: tnQosCustomPolNameValue, + TagAnnotation: tagAnnotationFvRsCustQosPolFvAEPgValue, + TagTag: tagTagFvRsCustQosPolFvAEPgValue, } FvRsCustQosPolObject, _ := types.ObjectValueFrom(ctx, FvRsCustQosPolFvAEPgType, FvRsCustQosPol) planData.FvRsCustQosPol = FvRsCustQosPolObject @@ -1841,9 +3043,25 @@ func (r *FvAEPgResource) ModifyPlan(ctx context.Context, req resource.ModifyPlan } } } else if !configData.DeprecatedFvRsDppPol.IsNull() { + var newAttributeValues FvRsDppPolFvAEPgResourceModel + tagAnnotationFvRsDppPolFvAEPgValue, _ := types.SetValueFrom(ctx, TagAnnotationFvRsDppPolFvAEPgType, make([]TagAnnotationFvRsDppPolFvAEPgResourceModel, 0)) + tagTagFvRsDppPolFvAEPgValue, _ := types.SetValueFrom(ctx, TagTagFvRsDppPolFvAEPgType, make([]TagTagFvRsDppPolFvAEPgResourceModel, 0)) + annotationValue := planData.Annotation + if stateData != nil { + stateData.FvRsDppPol.As(ctx, &newAttributeValues, basetypes.ObjectAsOptions{}) + annotationValue = newAttributeValues.Annotation + tagAnnotationFvRsDppPolFvAEPgValue = newAttributeValues.TagAnnotation + tagTagFvRsDppPolFvAEPgValue = newAttributeValues.TagTag + } + tnQosDppPolNameValue := basetypes.NewStringUnknown() + if !configData.DeprecatedFvRsDppPol.IsUnknown() { + tnQosDppPolNameValue = basetypes.NewStringValue(GetMOName(configData.DeprecatedFvRsDppPol.ValueString())) + } FvRsDppPol := FvRsDppPolFvAEPgResourceModel{ - Annotation: planData.Annotation, - TnQosDppPolName: basetypes.NewStringValue(GetMOName(configData.DeprecatedFvRsDppPol.ValueString())), + Annotation: annotationValue, + TnQosDppPolName: tnQosDppPolNameValue, + TagAnnotation: tagAnnotationFvRsDppPolFvAEPgValue, + TagTag: tagTagFvRsDppPolFvAEPgValue, } FvRsDppPolObject, _ := types.ObjectValueFrom(ctx, FvRsDppPolFvAEPgType, FvRsDppPol) planData.FvRsDppPol = FvRsDppPolObject @@ -1875,7 +3093,7 @@ func (r *FvAEPgResource) ModifyPlan(ctx context.Context, req resource.ModifyPlan } } else if !configData.DeprecatedFvRsFcPathAtt.IsNull() { FvRsFcPathAttList := make([]FvRsFcPathAttFvAEPgResourceModel, 0) - var attributeValues []string + var attributeValues []basetypes.StringValue var newAttributeValues []FvRsFcPathAttFvAEPgResourceModel configData.DeprecatedFvRsFcPathAtt.ElementsAs(ctx, &attributeValues, false) if stateData != nil { @@ -1885,14 +3103,18 @@ func (r *FvAEPgResource) ModifyPlan(ctx context.Context, req resource.ModifyPlan FvRsFcPathAttValue := FvRsFcPathAttFvAEPgResourceModel{} foundAttributeValue := false for _, newAttributeValue := range newAttributeValues { - if newAttributeValue.TDn.ValueString() == attributeValue { + if newAttributeValue.TDn.ValueString() == attributeValue.ValueString() { FvRsFcPathAttValue = newAttributeValue foundAttributeValue = true break } } + tDnValue := basetypes.NewStringUnknown() + if !attributeValue.IsUnknown() { + tDnValue = basetypes.NewStringValue(attributeValue.ValueString()) + } FvRsFcPathAtt := FvRsFcPathAttFvAEPgResourceModel{ - TDn: basetypes.NewStringValue(attributeValue), + TDn: tDnValue, } if foundAttributeValue { @@ -1905,18 +3127,13 @@ func (r *FvAEPgResource) ModifyPlan(ctx context.Context, req resource.ModifyPlan FvRsFcPathAtt.Vsan = basetypes.NewStringValue("unknown") // Default to default value from meta when not found FvRsFcPathAtt.VsanMode = basetypes.NewStringValue("regular") // Default to default value from meta when not found } + tagAnnotationFvRsFcPathAttFvAEPgValue, _ := types.SetValueFrom(ctx, TagAnnotationFvRsFcPathAttFvAEPgType, make([]TagAnnotationFvRsFcPathAttFvAEPgResourceModel, 0)) + FvRsFcPathAtt.TagAnnotation = tagAnnotationFvRsFcPathAttFvAEPgValue + tagTagFvRsFcPathAttFvAEPgValue, _ := types.SetValueFrom(ctx, TagTagFvRsFcPathAttFvAEPgType, make([]TagTagFvRsFcPathAttFvAEPgResourceModel, 0)) + FvRsFcPathAtt.TagTag = tagTagFvRsFcPathAttFvAEPgValue FvRsFcPathAttList = append(FvRsFcPathAttList, FvRsFcPathAtt) } - FvRsFcPathAttType := types.ObjectType{ - AttrTypes: map[string]attr.Type{ - "annotation": basetypes.StringType{}, - "description": basetypes.StringType{}, - "target_dn": basetypes.StringType{}, - "vsan": basetypes.StringType{}, - "vsan_mode": basetypes.StringType{}, - }, - } - FvRsFcPathAttSet, _ := types.SetValueFrom(ctx, FvRsFcPathAttType, FvRsFcPathAttList) + FvRsFcPathAttSet, _ := types.SetValueFrom(ctx, FvRsFcPathAttFvAEPgType, FvRsFcPathAttList) planData.FvRsFcPathAtt = FvRsFcPathAttSet } else if stateData != nil { // used to replace use state for unknown planData.DeprecatedFvRsFcPathAtt = stateData.DeprecatedFvRsFcPathAtt @@ -1946,7 +3163,7 @@ func (r *FvAEPgResource) ModifyPlan(ctx context.Context, req resource.ModifyPlan } } else if !configData.DeprecatedFvRsConsIf.IsNull() { FvRsConsIfList := make([]FvRsConsIfFvAEPgResourceModel, 0) - var attributeValues []string + var attributeValues []basetypes.StringValue var newAttributeValues []FvRsConsIfFvAEPgResourceModel configData.DeprecatedFvRsConsIf.ElementsAs(ctx, &attributeValues, false) if stateData != nil { @@ -1956,14 +3173,18 @@ func (r *FvAEPgResource) ModifyPlan(ctx context.Context, req resource.ModifyPlan FvRsConsIfValue := FvRsConsIfFvAEPgResourceModel{} foundAttributeValue := false for _, newAttributeValue := range newAttributeValues { - if newAttributeValue.TnVzCPIfName.ValueString() == GetMOName(attributeValue) { + if newAttributeValue.TnVzCPIfName.ValueString() == GetMOName(attributeValue.ValueString()) { FvRsConsIfValue = newAttributeValue foundAttributeValue = true break } } + tnVzCPIfNameValue := basetypes.NewStringUnknown() + if !attributeValue.IsUnknown() { + tnVzCPIfNameValue = basetypes.NewStringValue(GetMOName(attributeValue.ValueString())) + } FvRsConsIf := FvRsConsIfFvAEPgResourceModel{ - TnVzCPIfName: basetypes.NewStringValue(GetMOName(attributeValue)), + TnVzCPIfName: tnVzCPIfNameValue, } if foundAttributeValue { @@ -1973,16 +3194,13 @@ func (r *FvAEPgResource) ModifyPlan(ctx context.Context, req resource.ModifyPlan FvRsConsIf.Annotation = planData.Annotation FvRsConsIf.Prio = customTypes.NewFvRsConsIfPrioStringValue("unspecified") // Default to default value from meta when not found } + tagAnnotationFvRsConsIfFvAEPgValue, _ := types.SetValueFrom(ctx, TagAnnotationFvRsConsIfFvAEPgType, make([]TagAnnotationFvRsConsIfFvAEPgResourceModel, 0)) + FvRsConsIf.TagAnnotation = tagAnnotationFvRsConsIfFvAEPgValue + tagTagFvRsConsIfFvAEPgValue, _ := types.SetValueFrom(ctx, TagTagFvRsConsIfFvAEPgType, make([]TagTagFvRsConsIfFvAEPgResourceModel, 0)) + FvRsConsIf.TagTag = tagTagFvRsConsIfFvAEPgValue FvRsConsIfList = append(FvRsConsIfList, FvRsConsIf) } - FvRsConsIfType := types.ObjectType{ - AttrTypes: map[string]attr.Type{ - "annotation": basetypes.StringType{}, - "priority": basetypes.StringType{}, - "imported_contract_name": basetypes.StringType{}, - }, - } - FvRsConsIfSet, _ := types.SetValueFrom(ctx, FvRsConsIfType, FvRsConsIfList) + FvRsConsIfSet, _ := types.SetValueFrom(ctx, FvRsConsIfFvAEPgType, FvRsConsIfList) planData.FvRsConsIf = FvRsConsIfSet } else if stateData != nil { // used to replace use state for unknown planData.DeprecatedFvRsConsIf = stateData.DeprecatedFvRsConsIf @@ -2012,7 +3230,7 @@ func (r *FvAEPgResource) ModifyPlan(ctx context.Context, req resource.ModifyPlan } } else if !configData.DeprecatedFvRsIntraEpg.IsNull() { FvRsIntraEpgList := make([]FvRsIntraEpgFvAEPgResourceModel, 0) - var attributeValues []string + var attributeValues []basetypes.StringValue var newAttributeValues []FvRsIntraEpgFvAEPgResourceModel configData.DeprecatedFvRsIntraEpg.ElementsAs(ctx, &attributeValues, false) if stateData != nil { @@ -2022,14 +3240,18 @@ func (r *FvAEPgResource) ModifyPlan(ctx context.Context, req resource.ModifyPlan FvRsIntraEpgValue := FvRsIntraEpgFvAEPgResourceModel{} foundAttributeValue := false for _, newAttributeValue := range newAttributeValues { - if newAttributeValue.TnVzBrCPName.ValueString() == GetMOName(attributeValue) { + if newAttributeValue.TnVzBrCPName.ValueString() == GetMOName(attributeValue.ValueString()) { FvRsIntraEpgValue = newAttributeValue foundAttributeValue = true break } } + tnVzBrCPNameValue := basetypes.NewStringUnknown() + if !attributeValue.IsUnknown() { + tnVzBrCPNameValue = basetypes.NewStringValue(GetMOName(attributeValue.ValueString())) + } FvRsIntraEpg := FvRsIntraEpgFvAEPgResourceModel{ - TnVzBrCPName: basetypes.NewStringValue(GetMOName(attributeValue)), + TnVzBrCPName: tnVzBrCPNameValue, } if foundAttributeValue { @@ -2037,15 +3259,13 @@ func (r *FvAEPgResource) ModifyPlan(ctx context.Context, req resource.ModifyPlan } else { FvRsIntraEpg.Annotation = planData.Annotation } + tagAnnotationFvRsIntraEpgFvAEPgValue, _ := types.SetValueFrom(ctx, TagAnnotationFvRsIntraEpgFvAEPgType, make([]TagAnnotationFvRsIntraEpgFvAEPgResourceModel, 0)) + FvRsIntraEpg.TagAnnotation = tagAnnotationFvRsIntraEpgFvAEPgValue + tagTagFvRsIntraEpgFvAEPgValue, _ := types.SetValueFrom(ctx, TagTagFvRsIntraEpgFvAEPgType, make([]TagTagFvRsIntraEpgFvAEPgResourceModel, 0)) + FvRsIntraEpg.TagTag = tagTagFvRsIntraEpgFvAEPgValue FvRsIntraEpgList = append(FvRsIntraEpgList, FvRsIntraEpg) } - FvRsIntraEpgType := types.ObjectType{ - AttrTypes: map[string]attr.Type{ - "annotation": basetypes.StringType{}, - "contract_name": basetypes.StringType{}, - }, - } - FvRsIntraEpgSet, _ := types.SetValueFrom(ctx, FvRsIntraEpgType, FvRsIntraEpgList) + FvRsIntraEpgSet, _ := types.SetValueFrom(ctx, FvRsIntraEpgFvAEPgType, FvRsIntraEpgList) planData.FvRsIntraEpg = FvRsIntraEpgSet } else if stateData != nil { // used to replace use state for unknown planData.DeprecatedFvRsIntraEpg = stateData.DeprecatedFvRsIntraEpg @@ -2075,7 +3295,7 @@ func (r *FvAEPgResource) ModifyPlan(ctx context.Context, req resource.ModifyPlan } } else if !configData.DeprecatedFvRsProv.IsNull() { FvRsProvList := make([]FvRsProvFvAEPgResourceModel, 0) - var attributeValues []string + var attributeValues []basetypes.StringValue var newAttributeValues []FvRsProvFvAEPgResourceModel configData.DeprecatedFvRsProv.ElementsAs(ctx, &attributeValues, false) if stateData != nil { @@ -2085,14 +3305,18 @@ func (r *FvAEPgResource) ModifyPlan(ctx context.Context, req resource.ModifyPlan FvRsProvValue := FvRsProvFvAEPgResourceModel{} foundAttributeValue := false for _, newAttributeValue := range newAttributeValues { - if newAttributeValue.TnVzBrCPName.ValueString() == GetMOName(attributeValue) { + if newAttributeValue.TnVzBrCPName.ValueString() == GetMOName(attributeValue.ValueString()) { FvRsProvValue = newAttributeValue foundAttributeValue = true break } } + tnVzBrCPNameValue := basetypes.NewStringUnknown() + if !attributeValue.IsUnknown() { + tnVzBrCPNameValue = basetypes.NewStringValue(GetMOName(attributeValue.ValueString())) + } FvRsProv := FvRsProvFvAEPgResourceModel{ - TnVzBrCPName: basetypes.NewStringValue(GetMOName(attributeValue)), + TnVzBrCPName: tnVzBrCPNameValue, } if foundAttributeValue { @@ -2104,17 +3328,13 @@ func (r *FvAEPgResource) ModifyPlan(ctx context.Context, req resource.ModifyPlan FvRsProv.MatchT = basetypes.NewStringValue("AtleastOne") // Default to default value from meta when not found FvRsProv.Prio = customTypes.NewFvRsProvPrioStringValue("unspecified") // Default to default value from meta when not found } + tagAnnotationFvRsProvFvAEPgValue, _ := types.SetValueFrom(ctx, TagAnnotationFvRsProvFvAEPgType, make([]TagAnnotationFvRsProvFvAEPgResourceModel, 0)) + FvRsProv.TagAnnotation = tagAnnotationFvRsProvFvAEPgValue + tagTagFvRsProvFvAEPgValue, _ := types.SetValueFrom(ctx, TagTagFvRsProvFvAEPgType, make([]TagTagFvRsProvFvAEPgResourceModel, 0)) + FvRsProv.TagTag = tagTagFvRsProvFvAEPgValue FvRsProvList = append(FvRsProvList, FvRsProv) } - FvRsProvType := types.ObjectType{ - AttrTypes: map[string]attr.Type{ - "annotation": basetypes.StringType{}, - "match_criteria": basetypes.StringType{}, - "priority": basetypes.StringType{}, - "contract_name": basetypes.StringType{}, - }, - } - FvRsProvSet, _ := types.SetValueFrom(ctx, FvRsProvType, FvRsProvList) + FvRsProvSet, _ := types.SetValueFrom(ctx, FvRsProvFvAEPgType, FvRsProvList) planData.FvRsProv = FvRsProvSet } else if stateData != nil { // used to replace use state for unknown planData.DeprecatedFvRsProv = stateData.DeprecatedFvRsProv @@ -2144,7 +3364,7 @@ func (r *FvAEPgResource) ModifyPlan(ctx context.Context, req resource.ModifyPlan } } else if !configData.DeprecatedFvRsPathAtt.IsNull() { FvRsPathAttList := make([]FvRsPathAttFvAEPgResourceModel, 0) - var attributeValues []string + var attributeValues []basetypes.StringValue var newAttributeValues []FvRsPathAttFvAEPgResourceModel configData.DeprecatedFvRsPathAtt.ElementsAs(ctx, &attributeValues, false) if stateData != nil { @@ -2154,14 +3374,18 @@ func (r *FvAEPgResource) ModifyPlan(ctx context.Context, req resource.ModifyPlan FvRsPathAttValue := FvRsPathAttFvAEPgResourceModel{} foundAttributeValue := false for _, newAttributeValue := range newAttributeValues { - if newAttributeValue.TDn.ValueString() == attributeValue { + if newAttributeValue.TDn.ValueString() == attributeValue.ValueString() { FvRsPathAttValue = newAttributeValue foundAttributeValue = true break } } + tDnValue := basetypes.NewStringUnknown() + if !attributeValue.IsUnknown() { + tDnValue = basetypes.NewStringValue(attributeValue.ValueString()) + } FvRsPathAtt := FvRsPathAttFvAEPgResourceModel{ - TDn: basetypes.NewStringValue(attributeValue), + TDn: tDnValue, } if foundAttributeValue { @@ -2176,20 +3400,13 @@ func (r *FvAEPgResource) ModifyPlan(ctx context.Context, req resource.ModifyPlan FvRsPathAtt.InstrImedcy = basetypes.NewStringValue("lazy") // Default to default value from meta when not found FvRsPathAtt.Mode = basetypes.NewStringValue("regular") // Default to default value from meta when not found } + tagAnnotationFvRsPathAttFvAEPgValue, _ := types.SetValueFrom(ctx, TagAnnotationFvRsPathAttFvAEPgType, make([]TagAnnotationFvRsPathAttFvAEPgResourceModel, 0)) + FvRsPathAtt.TagAnnotation = tagAnnotationFvRsPathAttFvAEPgValue + tagTagFvRsPathAttFvAEPgValue, _ := types.SetValueFrom(ctx, TagTagFvRsPathAttFvAEPgType, make([]TagTagFvRsPathAttFvAEPgResourceModel, 0)) + FvRsPathAtt.TagTag = tagTagFvRsPathAttFvAEPgValue FvRsPathAttList = append(FvRsPathAttList, FvRsPathAtt) } - FvRsPathAttType := types.ObjectType{ - AttrTypes: map[string]attr.Type{ - "annotation": basetypes.StringType{}, - "description": basetypes.StringType{}, - "encapsulation": basetypes.StringType{}, - "deployment_immediacy": basetypes.StringType{}, - "mode": basetypes.StringType{}, - "primary_encapsulation": basetypes.StringType{}, - "target_dn": basetypes.StringType{}, - }, - } - FvRsPathAttSet, _ := types.SetValueFrom(ctx, FvRsPathAttType, FvRsPathAttList) + FvRsPathAttSet, _ := types.SetValueFrom(ctx, FvRsPathAttFvAEPgType, FvRsPathAttList) planData.FvRsPathAtt = FvRsPathAttSet } else if stateData != nil { // used to replace use state for unknown planData.DeprecatedFvRsPathAtt = stateData.DeprecatedFvRsPathAtt @@ -2219,7 +3436,7 @@ func (r *FvAEPgResource) ModifyPlan(ctx context.Context, req resource.ModifyPlan } } else if !configData.DeprecatedFvRsProtBy.IsNull() { FvRsProtByList := make([]FvRsProtByFvAEPgResourceModel, 0) - var attributeValues []string + var attributeValues []basetypes.StringValue var newAttributeValues []FvRsProtByFvAEPgResourceModel configData.DeprecatedFvRsProtBy.ElementsAs(ctx, &attributeValues, false) if stateData != nil { @@ -2229,14 +3446,18 @@ func (r *FvAEPgResource) ModifyPlan(ctx context.Context, req resource.ModifyPlan FvRsProtByValue := FvRsProtByFvAEPgResourceModel{} foundAttributeValue := false for _, newAttributeValue := range newAttributeValues { - if newAttributeValue.TnVzTabooName.ValueString() == GetMOName(attributeValue) { + if newAttributeValue.TnVzTabooName.ValueString() == GetMOName(attributeValue.ValueString()) { FvRsProtByValue = newAttributeValue foundAttributeValue = true break } } + tnVzTabooNameValue := basetypes.NewStringUnknown() + if !attributeValue.IsUnknown() { + tnVzTabooNameValue = basetypes.NewStringValue(GetMOName(attributeValue.ValueString())) + } FvRsProtBy := FvRsProtByFvAEPgResourceModel{ - TnVzTabooName: basetypes.NewStringValue(GetMOName(attributeValue)), + TnVzTabooName: tnVzTabooNameValue, } if foundAttributeValue { @@ -2244,15 +3465,13 @@ func (r *FvAEPgResource) ModifyPlan(ctx context.Context, req resource.ModifyPlan } else { FvRsProtBy.Annotation = planData.Annotation } + tagAnnotationFvRsProtByFvAEPgValue, _ := types.SetValueFrom(ctx, TagAnnotationFvRsProtByFvAEPgType, make([]TagAnnotationFvRsProtByFvAEPgResourceModel, 0)) + FvRsProtBy.TagAnnotation = tagAnnotationFvRsProtByFvAEPgValue + tagTagFvRsProtByFvAEPgValue, _ := types.SetValueFrom(ctx, TagTagFvRsProtByFvAEPgType, make([]TagTagFvRsProtByFvAEPgResourceModel, 0)) + FvRsProtBy.TagTag = tagTagFvRsProtByFvAEPgValue FvRsProtByList = append(FvRsProtByList, FvRsProtBy) } - FvRsProtByType := types.ObjectType{ - AttrTypes: map[string]attr.Type{ - "annotation": basetypes.StringType{}, - "taboo_contract_name": basetypes.StringType{}, - }, - } - FvRsProtBySet, _ := types.SetValueFrom(ctx, FvRsProtByType, FvRsProtByList) + FvRsProtBySet, _ := types.SetValueFrom(ctx, FvRsProtByFvAEPgType, FvRsProtByList) planData.FvRsProtBy = FvRsProtBySet } else if stateData != nil { // used to replace use state for unknown planData.DeprecatedFvRsProtBy = stateData.DeprecatedFvRsProtBy @@ -2270,9 +3489,25 @@ func (r *FvAEPgResource) ModifyPlan(ctx context.Context, req resource.ModifyPlan } } } else if !configData.DeprecatedFvRsTrustCtrl.IsNull() { + var newAttributeValues FvRsTrustCtrlFvAEPgResourceModel + tagAnnotationFvRsTrustCtrlFvAEPgValue, _ := types.SetValueFrom(ctx, TagAnnotationFvRsTrustCtrlFvAEPgType, make([]TagAnnotationFvRsTrustCtrlFvAEPgResourceModel, 0)) + tagTagFvRsTrustCtrlFvAEPgValue, _ := types.SetValueFrom(ctx, TagTagFvRsTrustCtrlFvAEPgType, make([]TagTagFvRsTrustCtrlFvAEPgResourceModel, 0)) + annotationValue := planData.Annotation + if stateData != nil { + stateData.FvRsTrustCtrl.As(ctx, &newAttributeValues, basetypes.ObjectAsOptions{}) + annotationValue = newAttributeValues.Annotation + tagAnnotationFvRsTrustCtrlFvAEPgValue = newAttributeValues.TagAnnotation + tagTagFvRsTrustCtrlFvAEPgValue = newAttributeValues.TagTag + } + tnFhsTrustCtrlPolNameValue := basetypes.NewStringUnknown() + if !configData.DeprecatedFvRsTrustCtrl.IsUnknown() { + tnFhsTrustCtrlPolNameValue = basetypes.NewStringValue(GetMOName(configData.DeprecatedFvRsTrustCtrl.ValueString())) + } FvRsTrustCtrl := FvRsTrustCtrlFvAEPgResourceModel{ - Annotation: planData.Annotation, - TnFhsTrustCtrlPolName: basetypes.NewStringValue(GetMOName(configData.DeprecatedFvRsTrustCtrl.ValueString())), + Annotation: annotationValue, + TnFhsTrustCtrlPolName: tnFhsTrustCtrlPolNameValue, + TagAnnotation: tagAnnotationFvRsTrustCtrlFvAEPgValue, + TagTag: tagTagFvRsTrustCtrlFvAEPgValue, } FvRsTrustCtrlObject, _ := types.ObjectValueFrom(ctx, FvRsTrustCtrlFvAEPgType, FvRsTrustCtrl) planData.FvRsTrustCtrl = FvRsTrustCtrlObject @@ -2281,13 +3516,19 @@ func (r *FvAEPgResource) ModifyPlan(ctx context.Context, req resource.ModifyPlan } planData.DeprecatedFvRsNodeAtt = types.SetNull(deprecatedFvRsNodeAttType) - if !configData.DeprecatedFvRsNodeAtt.IsNull() && stateData != nil { + if !configData.DeprecatedFvRsNodeAtt.IsNull() { FvRsNodeAttList := make([]FvRsNodeAttFvAEPgResourceModel, 0) var attributeValues []FvRsNodeAttFvAEPgResourceModelV1 var newAttributeValues []FvRsNodeAttFvAEPgResourceModel configData.DeprecatedFvRsNodeAtt.ElementsAs(ctx, &attributeValues, false) - stateData.FvRsNodeAtt.ElementsAs(ctx, &newAttributeValues, false) + if stateData != nil { + stateData.FvRsNodeAtt.ElementsAs(ctx, &newAttributeValues, false) + } for _, attributeValue := range attributeValues { + tDnValue := basetypes.NewStringUnknown() + if !attributeValue.TDn.IsUnknown() { + tDnValue = basetypes.NewStringValue(attributeValue.TDn.ValueString()) + } FvRsNodeAtt := FvRsNodeAttFvAEPgResourceModel{ Annotation: planData.Annotation, @@ -2295,23 +3536,16 @@ func (r *FvAEPgResource) ModifyPlan(ctx context.Context, req resource.ModifyPlan Encap: attributeValue.Encap, InstrImedcy: attributeValue.InstrImedcy, Mode: attributeValue.Mode, - TDn: attributeValue.TDn, + TDn: tDnValue, } - + tagAnnotationFvRsNodeAttFvAEPgValue, _ := types.SetValueFrom(ctx, TagAnnotationFvRsNodeAttFvAEPgType, make([]TagAnnotationFvRsNodeAttFvAEPgResourceModel, 0)) + FvRsNodeAtt.TagAnnotation = tagAnnotationFvRsNodeAttFvAEPgValue + tagTagFvRsNodeAttFvAEPgValue, _ := types.SetValueFrom(ctx, TagTagFvRsNodeAttFvAEPgType, make([]TagTagFvRsNodeAttFvAEPgResourceModel, 0)) + FvRsNodeAtt.TagTag = tagTagFvRsNodeAttFvAEPgValue FvRsNodeAttList = append(FvRsNodeAttList, FvRsNodeAtt) } - FvRsNodeAttType := types.ObjectType{ - AttrTypes: map[string]attr.Type{ - "annotation": basetypes.StringType{}, - "description": basetypes.StringType{}, - "encapsulation": basetypes.StringType{}, - "deployment_immediacy": basetypes.StringType{}, - "mode": basetypes.StringType{}, - "target_dn": basetypes.StringType{}, - }, - } - FvRsNodeAttSet, _ := types.SetValueFrom(ctx, FvRsNodeAttType, FvRsNodeAttList) + FvRsNodeAttSet, _ := types.SetValueFrom(ctx, FvRsNodeAttFvAEPgType, FvRsNodeAttList) planData.FvRsNodeAtt = FvRsNodeAttSet } @@ -2733,7 +3967,11 @@ func (r *FvAEPgResource) Schema(ctx context.Context, req resource.SchemaRequest, MarkdownDescription: `Parameter used to determine whether communication between endpoints within the EPG is blocked.`, }, "pc_tag": schema.StringAttribute{ - Computed: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + SetToStringNullWhenStateIsNullPlanIsUnknownDuringUpdate(), + }, MarkdownDescription: `The classification tag used for policy enforcement and zoning.`, }, "preferred_group_member": schema.StringAttribute{ @@ -2869,6 +4107,74 @@ func (r *FvAEPgResource) Schema(ctx context.Context, req resource.SchemaRequest, }, MarkdownDescription: `The scope of the EPG uSeg Block Statement object.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, "relation_to_application_epg_monitoring_policy": schema.SingleNestedAttribute{ @@ -2897,6 +4203,74 @@ func (r *FvAEPgResource) Schema(ctx context.Context, req resource.SchemaRequest, Validators: []validator.String{}, MarkdownDescription: `The name of the monitoring policy.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, "relation_to_bridge_domain": schema.SingleNestedAttribute{ @@ -2925,6 +4299,74 @@ func (r *FvAEPgResource) Schema(ctx context.Context, req resource.SchemaRequest, Validators: []validator.String{}, MarkdownDescription: `The name of the bridge domain associated with this EPG.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, "relation_to_consumed_contracts": schema.SetNestedAttribute{ @@ -2969,7 +4411,75 @@ func (r *FvAEPgResource) Schema(ctx context.Context, req resource.SchemaRequest, Validators: []validator.String{ MakeStringRequired(), }, - MarkdownDescription: `The consumer contract name.`, + MarkdownDescription: `The consumer contract name.`, + }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, }, }, }, @@ -3018,6 +4528,74 @@ func (r *FvAEPgResource) Schema(ctx context.Context, req resource.SchemaRequest, }, MarkdownDescription: `The contract interface name.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, }, @@ -3047,6 +4625,74 @@ func (r *FvAEPgResource) Schema(ctx context.Context, req resource.SchemaRequest, Validators: []validator.String{}, MarkdownDescription: `The Custom QoS traffic policy name.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, "relation_to_domains": schema.SetNestedAttribute{ @@ -3311,6 +4957,74 @@ func (r *FvAEPgResource) Schema(ctx context.Context, req resource.SchemaRequest, }, MarkdownDescription: `The untagged status of the Relation To Domain object.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, }, @@ -3340,6 +5054,74 @@ func (r *FvAEPgResource) Schema(ctx context.Context, req resource.SchemaRequest, Validators: []validator.String{}, MarkdownDescription: `Name.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, "relation_to_fibre_channel_paths": schema.SetNestedAttribute{ @@ -3403,6 +5185,74 @@ func (r *FvAEPgResource) Schema(ctx context.Context, req resource.SchemaRequest, }, MarkdownDescription: `The virtual storage area network (VSAN) mode of the Relation To Fibre Channel Path object.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, }, @@ -3439,6 +5289,74 @@ func (r *FvAEPgResource) Schema(ctx context.Context, req resource.SchemaRequest, }, MarkdownDescription: `The contract name.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, }, @@ -3513,6 +5431,74 @@ func (r *FvAEPgResource) Schema(ctx context.Context, req resource.SchemaRequest, }, MarkdownDescription: `The distinguished name of the target of this static binding.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, }, @@ -3596,6 +5582,74 @@ func (r *FvAEPgResource) Schema(ctx context.Context, req resource.SchemaRequest, }, MarkdownDescription: `null.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, }, @@ -3628,6 +5682,74 @@ func (r *FvAEPgResource) Schema(ctx context.Context, req resource.SchemaRequest, }, MarkdownDescription: `A contract for denying specific classes of traffic. Taboo rules are applied in the hardware before applying the rules of regular contracts. Without a contract, the default forwarding policy is to not allow any communication between EPGs.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, }, @@ -3686,6 +5808,74 @@ func (r *FvAEPgResource) Schema(ctx context.Context, req resource.SchemaRequest, }, MarkdownDescription: `The provider contract name.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, }, @@ -3718,6 +5908,74 @@ func (r *FvAEPgResource) Schema(ctx context.Context, req resource.SchemaRequest, }, MarkdownDescription: `The distinguished name of the target.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, }, @@ -3747,6 +6005,74 @@ func (r *FvAEPgResource) Schema(ctx context.Context, req resource.SchemaRequest, Validators: []validator.String{}, MarkdownDescription: `Name.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, "annotations": schema.SetNestedAttribute{ @@ -4170,7 +6496,7 @@ func (r *FvAEPgResource) ImportState(ctx context.Context, req resource.ImportSta } func getAndSetFvAEPgAttributes(ctx context.Context, diags *diag.Diagnostics, client *client.Client, data *FvAEPgResourceModel) { - requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=children&rsp-subtree-class=%s", data.Id.ValueString(), "fvAEPg,fvCrtrn,fvRsAEPgMonPol,fvRsBd,fvRsCons,fvRsConsIf,fvRsCustQosPol,fvRsDomAtt,fvRsDppPol,fvRsFcPathAtt,fvRsIntraEpg,fvRsNodeAtt,fvRsPathAtt,fvRsProtBy,fvRsProv,fvRsSecInherited,fvRsTrustCtrl,tagAnnotation,tagTag"), "GET", nil) + requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=full&rsp-subtree-class=%s", data.Id.ValueString(), "fvAEPg,fvCrtrn,fvRsAEPgMonPol,fvRsBd,fvRsCons,fvRsConsIf,fvRsCustQosPol,fvRsDomAtt,fvRsDppPol,fvRsFcPathAtt,fvRsIntraEpg,fvRsNodeAtt,fvRsPathAtt,fvRsProtBy,fvRsProv,fvRsSecInherited,fvRsTrustCtrl,tagAnnotation,tagTag,tagAnnotation,tagTag,tagAnnotation,tagTag,tagAnnotation,tagTag,tagAnnotation,tagTag,tagAnnotation,tagTag,tagAnnotation,tagTag,tagAnnotation,tagTag,tagAnnotation,tagTag,tagAnnotation,tagTag,tagAnnotation,tagTag,tagAnnotation,tagTag,tagAnnotation,tagTag,tagAnnotation,tagTag,tagAnnotation,tagTag,tagAnnotation,tagTag,tagAnnotation,tagTag"), "GET", nil) readData := getEmptyFvAEPgResourceModel() @@ -4288,7 +6614,47 @@ func getAndSetFvAEPgAttributes(ctx context.Context, diags *diag.Diagnostics, cli if childAttributeName == "scope" { FvCrtrnFvAEPg.Scope = basetypes.NewStringValue(childAttributeValue.(string)) } + + } + TagAnnotationFvCrtrnFvAEPgList := make([]TagAnnotationFvCrtrnFvAEPgResourceModel, 0) + TagTagFvCrtrnFvAEPgList := make([]TagTagFvCrtrnFvAEPgResourceModel, 0) + childrenOfFvCrtrnFvAEPg, childrenOfFvCrtrnFvAEPgExist := childClassDetails.(map[string]interface{})["children"] + if childrenOfFvCrtrnFvAEPgExist { + for _, childFvCrtrnFvAEPg := range childrenOfFvCrtrnFvAEPg.([]interface{}) { + for childClassNameFvCrtrnFvAEPg, childClassDetailsFvCrtrnFvAEPg := range childFvCrtrnFvAEPg.(map[string]interface{}) { + if childClassNameFvCrtrnFvAEPg == "tagAnnotation" { + TagAnnotationFvCrtrnFvAEPg := getEmptyTagAnnotationFvCrtrnFvAEPgResourceModel() + tagAnnotationchildAttributeValue := childClassDetailsFvCrtrnFvAEPg.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagAnnotationchildAttributeValue { + if childAttributeName == "key" { + TagAnnotationFvCrtrnFvAEPg.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagAnnotationFvCrtrnFvAEPg.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagAnnotationFvCrtrnFvAEPgList = append(TagAnnotationFvCrtrnFvAEPgList, TagAnnotationFvCrtrnFvAEPg) + } + if childClassNameFvCrtrnFvAEPg == "tagTag" { + TagTagFvCrtrnFvAEPg := getEmptyTagTagFvCrtrnFvAEPgResourceModel() + tagTagchildAttributeValue := childClassDetailsFvCrtrnFvAEPg.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagTagchildAttributeValue { + if childAttributeName == "key" { + TagTagFvCrtrnFvAEPg.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagTagFvCrtrnFvAEPg.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagTagFvCrtrnFvAEPgList = append(TagTagFvCrtrnFvAEPgList, TagTagFvCrtrnFvAEPg) + } + } + } } + TagAnnotationFvCrtrnFvAEPgSet, _ := types.SetValueFrom(ctx, TagAnnotationFvCrtrnFvAEPgType, TagAnnotationFvCrtrnFvAEPgList) + FvCrtrnFvAEPg.TagAnnotation = TagAnnotationFvCrtrnFvAEPgSet + TagTagFvCrtrnFvAEPgSet, _ := types.SetValueFrom(ctx, TagTagFvCrtrnFvAEPgType, TagTagFvCrtrnFvAEPgList) + FvCrtrnFvAEPg.TagTag = TagTagFvCrtrnFvAEPgSet FvCrtrnFvAEPgList = append(FvCrtrnFvAEPgList, FvCrtrnFvAEPg) } if childClassName == "fvRsAEPgMonPol" { @@ -4300,7 +6666,47 @@ func getAndSetFvAEPgAttributes(ctx context.Context, diags *diag.Diagnostics, cli if childAttributeName == "tnMonEPGPolName" { FvRsAEPgMonPolFvAEPg.TnMonEPGPolName = basetypes.NewStringValue(childAttributeValue.(string)) } + + } + TagAnnotationFvRsAEPgMonPolFvAEPgList := make([]TagAnnotationFvRsAEPgMonPolFvAEPgResourceModel, 0) + TagTagFvRsAEPgMonPolFvAEPgList := make([]TagTagFvRsAEPgMonPolFvAEPgResourceModel, 0) + childrenOfFvRsAEPgMonPolFvAEPg, childrenOfFvRsAEPgMonPolFvAEPgExist := childClassDetails.(map[string]interface{})["children"] + if childrenOfFvRsAEPgMonPolFvAEPgExist { + for _, childFvRsAEPgMonPolFvAEPg := range childrenOfFvRsAEPgMonPolFvAEPg.([]interface{}) { + for childClassNameFvRsAEPgMonPolFvAEPg, childClassDetailsFvRsAEPgMonPolFvAEPg := range childFvRsAEPgMonPolFvAEPg.(map[string]interface{}) { + if childClassNameFvRsAEPgMonPolFvAEPg == "tagAnnotation" { + TagAnnotationFvRsAEPgMonPolFvAEPg := getEmptyTagAnnotationFvRsAEPgMonPolFvAEPgResourceModel() + tagAnnotationchildAttributeValue := childClassDetailsFvRsAEPgMonPolFvAEPg.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagAnnotationchildAttributeValue { + if childAttributeName == "key" { + TagAnnotationFvRsAEPgMonPolFvAEPg.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagAnnotationFvRsAEPgMonPolFvAEPg.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagAnnotationFvRsAEPgMonPolFvAEPgList = append(TagAnnotationFvRsAEPgMonPolFvAEPgList, TagAnnotationFvRsAEPgMonPolFvAEPg) + } + if childClassNameFvRsAEPgMonPolFvAEPg == "tagTag" { + TagTagFvRsAEPgMonPolFvAEPg := getEmptyTagTagFvRsAEPgMonPolFvAEPgResourceModel() + tagTagchildAttributeValue := childClassDetailsFvRsAEPgMonPolFvAEPg.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagTagchildAttributeValue { + if childAttributeName == "key" { + TagTagFvRsAEPgMonPolFvAEPg.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagTagFvRsAEPgMonPolFvAEPg.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagTagFvRsAEPgMonPolFvAEPgList = append(TagTagFvRsAEPgMonPolFvAEPgList, TagTagFvRsAEPgMonPolFvAEPg) + } + } + } } + TagAnnotationFvRsAEPgMonPolFvAEPgSet, _ := types.SetValueFrom(ctx, TagAnnotationFvRsAEPgMonPolFvAEPgType, TagAnnotationFvRsAEPgMonPolFvAEPgList) + FvRsAEPgMonPolFvAEPg.TagAnnotation = TagAnnotationFvRsAEPgMonPolFvAEPgSet + TagTagFvRsAEPgMonPolFvAEPgSet, _ := types.SetValueFrom(ctx, TagTagFvRsAEPgMonPolFvAEPgType, TagTagFvRsAEPgMonPolFvAEPgList) + FvRsAEPgMonPolFvAEPg.TagTag = TagTagFvRsAEPgMonPolFvAEPgSet FvRsAEPgMonPolFvAEPgList = append(FvRsAEPgMonPolFvAEPgList, FvRsAEPgMonPolFvAEPg) } if childClassName == "fvRsBd" { @@ -4312,7 +6718,47 @@ func getAndSetFvAEPgAttributes(ctx context.Context, diags *diag.Diagnostics, cli if childAttributeName == "tnFvBDName" { FvRsBdFvAEPg.TnFvBDName = basetypes.NewStringValue(childAttributeValue.(string)) } + + } + TagAnnotationFvRsBdFvAEPgList := make([]TagAnnotationFvRsBdFvAEPgResourceModel, 0) + TagTagFvRsBdFvAEPgList := make([]TagTagFvRsBdFvAEPgResourceModel, 0) + childrenOfFvRsBdFvAEPg, childrenOfFvRsBdFvAEPgExist := childClassDetails.(map[string]interface{})["children"] + if childrenOfFvRsBdFvAEPgExist { + for _, childFvRsBdFvAEPg := range childrenOfFvRsBdFvAEPg.([]interface{}) { + for childClassNameFvRsBdFvAEPg, childClassDetailsFvRsBdFvAEPg := range childFvRsBdFvAEPg.(map[string]interface{}) { + if childClassNameFvRsBdFvAEPg == "tagAnnotation" { + TagAnnotationFvRsBdFvAEPg := getEmptyTagAnnotationFvRsBdFvAEPgResourceModel() + tagAnnotationchildAttributeValue := childClassDetailsFvRsBdFvAEPg.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagAnnotationchildAttributeValue { + if childAttributeName == "key" { + TagAnnotationFvRsBdFvAEPg.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagAnnotationFvRsBdFvAEPg.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagAnnotationFvRsBdFvAEPgList = append(TagAnnotationFvRsBdFvAEPgList, TagAnnotationFvRsBdFvAEPg) + } + if childClassNameFvRsBdFvAEPg == "tagTag" { + TagTagFvRsBdFvAEPg := getEmptyTagTagFvRsBdFvAEPgResourceModel() + tagTagchildAttributeValue := childClassDetailsFvRsBdFvAEPg.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagTagchildAttributeValue { + if childAttributeName == "key" { + TagTagFvRsBdFvAEPg.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagTagFvRsBdFvAEPg.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagTagFvRsBdFvAEPgList = append(TagTagFvRsBdFvAEPgList, TagTagFvRsBdFvAEPg) + } + } + } } + TagAnnotationFvRsBdFvAEPgSet, _ := types.SetValueFrom(ctx, TagAnnotationFvRsBdFvAEPgType, TagAnnotationFvRsBdFvAEPgList) + FvRsBdFvAEPg.TagAnnotation = TagAnnotationFvRsBdFvAEPgSet + TagTagFvRsBdFvAEPgSet, _ := types.SetValueFrom(ctx, TagTagFvRsBdFvAEPgType, TagTagFvRsBdFvAEPgList) + FvRsBdFvAEPg.TagTag = TagTagFvRsBdFvAEPgSet FvRsBdFvAEPgList = append(FvRsBdFvAEPgList, FvRsBdFvAEPg) } if childClassName == "fvRsCons" { @@ -4327,7 +6773,47 @@ func getAndSetFvAEPgAttributes(ctx context.Context, diags *diag.Diagnostics, cli if childAttributeName == "tnVzBrCPName" { FvRsConsFvAEPg.TnVzBrCPName = basetypes.NewStringValue(childAttributeValue.(string)) } + + } + TagAnnotationFvRsConsFvAEPgList := make([]TagAnnotationFvRsConsFvAEPgResourceModel, 0) + TagTagFvRsConsFvAEPgList := make([]TagTagFvRsConsFvAEPgResourceModel, 0) + childrenOfFvRsConsFvAEPg, childrenOfFvRsConsFvAEPgExist := childClassDetails.(map[string]interface{})["children"] + if childrenOfFvRsConsFvAEPgExist { + for _, childFvRsConsFvAEPg := range childrenOfFvRsConsFvAEPg.([]interface{}) { + for childClassNameFvRsConsFvAEPg, childClassDetailsFvRsConsFvAEPg := range childFvRsConsFvAEPg.(map[string]interface{}) { + if childClassNameFvRsConsFvAEPg == "tagAnnotation" { + TagAnnotationFvRsConsFvAEPg := getEmptyTagAnnotationFvRsConsFvAEPgResourceModel() + tagAnnotationchildAttributeValue := childClassDetailsFvRsConsFvAEPg.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagAnnotationchildAttributeValue { + if childAttributeName == "key" { + TagAnnotationFvRsConsFvAEPg.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagAnnotationFvRsConsFvAEPg.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagAnnotationFvRsConsFvAEPgList = append(TagAnnotationFvRsConsFvAEPgList, TagAnnotationFvRsConsFvAEPg) + } + if childClassNameFvRsConsFvAEPg == "tagTag" { + TagTagFvRsConsFvAEPg := getEmptyTagTagFvRsConsFvAEPgResourceModel() + tagTagchildAttributeValue := childClassDetailsFvRsConsFvAEPg.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagTagchildAttributeValue { + if childAttributeName == "key" { + TagTagFvRsConsFvAEPg.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagTagFvRsConsFvAEPg.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagTagFvRsConsFvAEPgList = append(TagTagFvRsConsFvAEPgList, TagTagFvRsConsFvAEPg) + } + } + } } + TagAnnotationFvRsConsFvAEPgSet, _ := types.SetValueFrom(ctx, TagAnnotationFvRsConsFvAEPgType, TagAnnotationFvRsConsFvAEPgList) + FvRsConsFvAEPg.TagAnnotation = TagAnnotationFvRsConsFvAEPgSet + TagTagFvRsConsFvAEPgSet, _ := types.SetValueFrom(ctx, TagTagFvRsConsFvAEPgType, TagTagFvRsConsFvAEPgList) + FvRsConsFvAEPg.TagTag = TagTagFvRsConsFvAEPgSet FvRsConsFvAEPgList = append(FvRsConsFvAEPgList, FvRsConsFvAEPg) } if childClassName == "fvRsConsIf" { @@ -4342,7 +6828,47 @@ func getAndSetFvAEPgAttributes(ctx context.Context, diags *diag.Diagnostics, cli if childAttributeName == "tnVzCPIfName" { FvRsConsIfFvAEPg.TnVzCPIfName = basetypes.NewStringValue(childAttributeValue.(string)) } + + } + TagAnnotationFvRsConsIfFvAEPgList := make([]TagAnnotationFvRsConsIfFvAEPgResourceModel, 0) + TagTagFvRsConsIfFvAEPgList := make([]TagTagFvRsConsIfFvAEPgResourceModel, 0) + childrenOfFvRsConsIfFvAEPg, childrenOfFvRsConsIfFvAEPgExist := childClassDetails.(map[string]interface{})["children"] + if childrenOfFvRsConsIfFvAEPgExist { + for _, childFvRsConsIfFvAEPg := range childrenOfFvRsConsIfFvAEPg.([]interface{}) { + for childClassNameFvRsConsIfFvAEPg, childClassDetailsFvRsConsIfFvAEPg := range childFvRsConsIfFvAEPg.(map[string]interface{}) { + if childClassNameFvRsConsIfFvAEPg == "tagAnnotation" { + TagAnnotationFvRsConsIfFvAEPg := getEmptyTagAnnotationFvRsConsIfFvAEPgResourceModel() + tagAnnotationchildAttributeValue := childClassDetailsFvRsConsIfFvAEPg.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagAnnotationchildAttributeValue { + if childAttributeName == "key" { + TagAnnotationFvRsConsIfFvAEPg.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagAnnotationFvRsConsIfFvAEPg.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagAnnotationFvRsConsIfFvAEPgList = append(TagAnnotationFvRsConsIfFvAEPgList, TagAnnotationFvRsConsIfFvAEPg) + } + if childClassNameFvRsConsIfFvAEPg == "tagTag" { + TagTagFvRsConsIfFvAEPg := getEmptyTagTagFvRsConsIfFvAEPgResourceModel() + tagTagchildAttributeValue := childClassDetailsFvRsConsIfFvAEPg.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagTagchildAttributeValue { + if childAttributeName == "key" { + TagTagFvRsConsIfFvAEPg.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagTagFvRsConsIfFvAEPg.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagTagFvRsConsIfFvAEPgList = append(TagTagFvRsConsIfFvAEPgList, TagTagFvRsConsIfFvAEPg) + } + } + } } + TagAnnotationFvRsConsIfFvAEPgSet, _ := types.SetValueFrom(ctx, TagAnnotationFvRsConsIfFvAEPgType, TagAnnotationFvRsConsIfFvAEPgList) + FvRsConsIfFvAEPg.TagAnnotation = TagAnnotationFvRsConsIfFvAEPgSet + TagTagFvRsConsIfFvAEPgSet, _ := types.SetValueFrom(ctx, TagTagFvRsConsIfFvAEPgType, TagTagFvRsConsIfFvAEPgList) + FvRsConsIfFvAEPg.TagTag = TagTagFvRsConsIfFvAEPgSet FvRsConsIfFvAEPgList = append(FvRsConsIfFvAEPgList, FvRsConsIfFvAEPg) } if childClassName == "fvRsCustQosPol" { @@ -4354,7 +6880,47 @@ func getAndSetFvAEPgAttributes(ctx context.Context, diags *diag.Diagnostics, cli if childAttributeName == "tnQosCustomPolName" { FvRsCustQosPolFvAEPg.TnQosCustomPolName = basetypes.NewStringValue(childAttributeValue.(string)) } + + } + TagAnnotationFvRsCustQosPolFvAEPgList := make([]TagAnnotationFvRsCustQosPolFvAEPgResourceModel, 0) + TagTagFvRsCustQosPolFvAEPgList := make([]TagTagFvRsCustQosPolFvAEPgResourceModel, 0) + childrenOfFvRsCustQosPolFvAEPg, childrenOfFvRsCustQosPolFvAEPgExist := childClassDetails.(map[string]interface{})["children"] + if childrenOfFvRsCustQosPolFvAEPgExist { + for _, childFvRsCustQosPolFvAEPg := range childrenOfFvRsCustQosPolFvAEPg.([]interface{}) { + for childClassNameFvRsCustQosPolFvAEPg, childClassDetailsFvRsCustQosPolFvAEPg := range childFvRsCustQosPolFvAEPg.(map[string]interface{}) { + if childClassNameFvRsCustQosPolFvAEPg == "tagAnnotation" { + TagAnnotationFvRsCustQosPolFvAEPg := getEmptyTagAnnotationFvRsCustQosPolFvAEPgResourceModel() + tagAnnotationchildAttributeValue := childClassDetailsFvRsCustQosPolFvAEPg.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagAnnotationchildAttributeValue { + if childAttributeName == "key" { + TagAnnotationFvRsCustQosPolFvAEPg.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagAnnotationFvRsCustQosPolFvAEPg.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagAnnotationFvRsCustQosPolFvAEPgList = append(TagAnnotationFvRsCustQosPolFvAEPgList, TagAnnotationFvRsCustQosPolFvAEPg) + } + if childClassNameFvRsCustQosPolFvAEPg == "tagTag" { + TagTagFvRsCustQosPolFvAEPg := getEmptyTagTagFvRsCustQosPolFvAEPgResourceModel() + tagTagchildAttributeValue := childClassDetailsFvRsCustQosPolFvAEPg.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagTagchildAttributeValue { + if childAttributeName == "key" { + TagTagFvRsCustQosPolFvAEPg.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagTagFvRsCustQosPolFvAEPg.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagTagFvRsCustQosPolFvAEPgList = append(TagTagFvRsCustQosPolFvAEPgList, TagTagFvRsCustQosPolFvAEPg) + } + } + } } + TagAnnotationFvRsCustQosPolFvAEPgSet, _ := types.SetValueFrom(ctx, TagAnnotationFvRsCustQosPolFvAEPgType, TagAnnotationFvRsCustQosPolFvAEPgList) + FvRsCustQosPolFvAEPg.TagAnnotation = TagAnnotationFvRsCustQosPolFvAEPgSet + TagTagFvRsCustQosPolFvAEPgSet, _ := types.SetValueFrom(ctx, TagTagFvRsCustQosPolFvAEPgType, TagTagFvRsCustQosPolFvAEPgList) + FvRsCustQosPolFvAEPg.TagTag = TagTagFvRsCustQosPolFvAEPgSet FvRsCustQosPolFvAEPgList = append(FvRsCustQosPolFvAEPgList, FvRsCustQosPolFvAEPg) } if childClassName == "fvRsDomAtt" { @@ -4439,7 +7005,47 @@ func getAndSetFvAEPgAttributes(ctx context.Context, diags *diag.Diagnostics, cli if childAttributeName == "untagged" { FvRsDomAttFvAEPg.Untagged = basetypes.NewStringValue(childAttributeValue.(string)) } + + } + TagAnnotationFvRsDomAttFvAEPgList := make([]TagAnnotationFvRsDomAttFvAEPgResourceModel, 0) + TagTagFvRsDomAttFvAEPgList := make([]TagTagFvRsDomAttFvAEPgResourceModel, 0) + childrenOfFvRsDomAttFvAEPg, childrenOfFvRsDomAttFvAEPgExist := childClassDetails.(map[string]interface{})["children"] + if childrenOfFvRsDomAttFvAEPgExist { + for _, childFvRsDomAttFvAEPg := range childrenOfFvRsDomAttFvAEPg.([]interface{}) { + for childClassNameFvRsDomAttFvAEPg, childClassDetailsFvRsDomAttFvAEPg := range childFvRsDomAttFvAEPg.(map[string]interface{}) { + if childClassNameFvRsDomAttFvAEPg == "tagAnnotation" { + TagAnnotationFvRsDomAttFvAEPg := getEmptyTagAnnotationFvRsDomAttFvAEPgResourceModel() + tagAnnotationchildAttributeValue := childClassDetailsFvRsDomAttFvAEPg.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagAnnotationchildAttributeValue { + if childAttributeName == "key" { + TagAnnotationFvRsDomAttFvAEPg.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagAnnotationFvRsDomAttFvAEPg.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagAnnotationFvRsDomAttFvAEPgList = append(TagAnnotationFvRsDomAttFvAEPgList, TagAnnotationFvRsDomAttFvAEPg) + } + if childClassNameFvRsDomAttFvAEPg == "tagTag" { + TagTagFvRsDomAttFvAEPg := getEmptyTagTagFvRsDomAttFvAEPgResourceModel() + tagTagchildAttributeValue := childClassDetailsFvRsDomAttFvAEPg.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagTagchildAttributeValue { + if childAttributeName == "key" { + TagTagFvRsDomAttFvAEPg.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagTagFvRsDomAttFvAEPg.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagTagFvRsDomAttFvAEPgList = append(TagTagFvRsDomAttFvAEPgList, TagTagFvRsDomAttFvAEPg) + } + } + } } + TagAnnotationFvRsDomAttFvAEPgSet, _ := types.SetValueFrom(ctx, TagAnnotationFvRsDomAttFvAEPgType, TagAnnotationFvRsDomAttFvAEPgList) + FvRsDomAttFvAEPg.TagAnnotation = TagAnnotationFvRsDomAttFvAEPgSet + TagTagFvRsDomAttFvAEPgSet, _ := types.SetValueFrom(ctx, TagTagFvRsDomAttFvAEPgType, TagTagFvRsDomAttFvAEPgList) + FvRsDomAttFvAEPg.TagTag = TagTagFvRsDomAttFvAEPgSet FvRsDomAttFvAEPgList = append(FvRsDomAttFvAEPgList, FvRsDomAttFvAEPg) } if childClassName == "fvRsDppPol" { @@ -4451,7 +7057,47 @@ func getAndSetFvAEPgAttributes(ctx context.Context, diags *diag.Diagnostics, cli if childAttributeName == "tnQosDppPolName" { FvRsDppPolFvAEPg.TnQosDppPolName = basetypes.NewStringValue(childAttributeValue.(string)) } + + } + TagAnnotationFvRsDppPolFvAEPgList := make([]TagAnnotationFvRsDppPolFvAEPgResourceModel, 0) + TagTagFvRsDppPolFvAEPgList := make([]TagTagFvRsDppPolFvAEPgResourceModel, 0) + childrenOfFvRsDppPolFvAEPg, childrenOfFvRsDppPolFvAEPgExist := childClassDetails.(map[string]interface{})["children"] + if childrenOfFvRsDppPolFvAEPgExist { + for _, childFvRsDppPolFvAEPg := range childrenOfFvRsDppPolFvAEPg.([]interface{}) { + for childClassNameFvRsDppPolFvAEPg, childClassDetailsFvRsDppPolFvAEPg := range childFvRsDppPolFvAEPg.(map[string]interface{}) { + if childClassNameFvRsDppPolFvAEPg == "tagAnnotation" { + TagAnnotationFvRsDppPolFvAEPg := getEmptyTagAnnotationFvRsDppPolFvAEPgResourceModel() + tagAnnotationchildAttributeValue := childClassDetailsFvRsDppPolFvAEPg.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagAnnotationchildAttributeValue { + if childAttributeName == "key" { + TagAnnotationFvRsDppPolFvAEPg.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagAnnotationFvRsDppPolFvAEPg.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagAnnotationFvRsDppPolFvAEPgList = append(TagAnnotationFvRsDppPolFvAEPgList, TagAnnotationFvRsDppPolFvAEPg) + } + if childClassNameFvRsDppPolFvAEPg == "tagTag" { + TagTagFvRsDppPolFvAEPg := getEmptyTagTagFvRsDppPolFvAEPgResourceModel() + tagTagchildAttributeValue := childClassDetailsFvRsDppPolFvAEPg.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagTagchildAttributeValue { + if childAttributeName == "key" { + TagTagFvRsDppPolFvAEPg.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagTagFvRsDppPolFvAEPg.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagTagFvRsDppPolFvAEPgList = append(TagTagFvRsDppPolFvAEPgList, TagTagFvRsDppPolFvAEPg) + } + } + } } + TagAnnotationFvRsDppPolFvAEPgSet, _ := types.SetValueFrom(ctx, TagAnnotationFvRsDppPolFvAEPgType, TagAnnotationFvRsDppPolFvAEPgList) + FvRsDppPolFvAEPg.TagAnnotation = TagAnnotationFvRsDppPolFvAEPgSet + TagTagFvRsDppPolFvAEPgSet, _ := types.SetValueFrom(ctx, TagTagFvRsDppPolFvAEPgType, TagTagFvRsDppPolFvAEPgList) + FvRsDppPolFvAEPg.TagTag = TagTagFvRsDppPolFvAEPgSet FvRsDppPolFvAEPgList = append(FvRsDppPolFvAEPgList, FvRsDppPolFvAEPg) } if childClassName == "fvRsFcPathAtt" { @@ -4472,7 +7118,47 @@ func getAndSetFvAEPgAttributes(ctx context.Context, diags *diag.Diagnostics, cli if childAttributeName == "vsanMode" { FvRsFcPathAttFvAEPg.VsanMode = basetypes.NewStringValue(childAttributeValue.(string)) } + + } + TagAnnotationFvRsFcPathAttFvAEPgList := make([]TagAnnotationFvRsFcPathAttFvAEPgResourceModel, 0) + TagTagFvRsFcPathAttFvAEPgList := make([]TagTagFvRsFcPathAttFvAEPgResourceModel, 0) + childrenOfFvRsFcPathAttFvAEPg, childrenOfFvRsFcPathAttFvAEPgExist := childClassDetails.(map[string]interface{})["children"] + if childrenOfFvRsFcPathAttFvAEPgExist { + for _, childFvRsFcPathAttFvAEPg := range childrenOfFvRsFcPathAttFvAEPg.([]interface{}) { + for childClassNameFvRsFcPathAttFvAEPg, childClassDetailsFvRsFcPathAttFvAEPg := range childFvRsFcPathAttFvAEPg.(map[string]interface{}) { + if childClassNameFvRsFcPathAttFvAEPg == "tagAnnotation" { + TagAnnotationFvRsFcPathAttFvAEPg := getEmptyTagAnnotationFvRsFcPathAttFvAEPgResourceModel() + tagAnnotationchildAttributeValue := childClassDetailsFvRsFcPathAttFvAEPg.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagAnnotationchildAttributeValue { + if childAttributeName == "key" { + TagAnnotationFvRsFcPathAttFvAEPg.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagAnnotationFvRsFcPathAttFvAEPg.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagAnnotationFvRsFcPathAttFvAEPgList = append(TagAnnotationFvRsFcPathAttFvAEPgList, TagAnnotationFvRsFcPathAttFvAEPg) + } + if childClassNameFvRsFcPathAttFvAEPg == "tagTag" { + TagTagFvRsFcPathAttFvAEPg := getEmptyTagTagFvRsFcPathAttFvAEPgResourceModel() + tagTagchildAttributeValue := childClassDetailsFvRsFcPathAttFvAEPg.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagTagchildAttributeValue { + if childAttributeName == "key" { + TagTagFvRsFcPathAttFvAEPg.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagTagFvRsFcPathAttFvAEPg.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagTagFvRsFcPathAttFvAEPgList = append(TagTagFvRsFcPathAttFvAEPgList, TagTagFvRsFcPathAttFvAEPg) + } + } + } } + TagAnnotationFvRsFcPathAttFvAEPgSet, _ := types.SetValueFrom(ctx, TagAnnotationFvRsFcPathAttFvAEPgType, TagAnnotationFvRsFcPathAttFvAEPgList) + FvRsFcPathAttFvAEPg.TagAnnotation = TagAnnotationFvRsFcPathAttFvAEPgSet + TagTagFvRsFcPathAttFvAEPgSet, _ := types.SetValueFrom(ctx, TagTagFvRsFcPathAttFvAEPgType, TagTagFvRsFcPathAttFvAEPgList) + FvRsFcPathAttFvAEPg.TagTag = TagTagFvRsFcPathAttFvAEPgSet FvRsFcPathAttFvAEPgList = append(FvRsFcPathAttFvAEPgList, FvRsFcPathAttFvAEPg) } if childClassName == "fvRsIntraEpg" { @@ -4484,7 +7170,47 @@ func getAndSetFvAEPgAttributes(ctx context.Context, diags *diag.Diagnostics, cli if childAttributeName == "tnVzBrCPName" { FvRsIntraEpgFvAEPg.TnVzBrCPName = basetypes.NewStringValue(childAttributeValue.(string)) } + + } + TagAnnotationFvRsIntraEpgFvAEPgList := make([]TagAnnotationFvRsIntraEpgFvAEPgResourceModel, 0) + TagTagFvRsIntraEpgFvAEPgList := make([]TagTagFvRsIntraEpgFvAEPgResourceModel, 0) + childrenOfFvRsIntraEpgFvAEPg, childrenOfFvRsIntraEpgFvAEPgExist := childClassDetails.(map[string]interface{})["children"] + if childrenOfFvRsIntraEpgFvAEPgExist { + for _, childFvRsIntraEpgFvAEPg := range childrenOfFvRsIntraEpgFvAEPg.([]interface{}) { + for childClassNameFvRsIntraEpgFvAEPg, childClassDetailsFvRsIntraEpgFvAEPg := range childFvRsIntraEpgFvAEPg.(map[string]interface{}) { + if childClassNameFvRsIntraEpgFvAEPg == "tagAnnotation" { + TagAnnotationFvRsIntraEpgFvAEPg := getEmptyTagAnnotationFvRsIntraEpgFvAEPgResourceModel() + tagAnnotationchildAttributeValue := childClassDetailsFvRsIntraEpgFvAEPg.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagAnnotationchildAttributeValue { + if childAttributeName == "key" { + TagAnnotationFvRsIntraEpgFvAEPg.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagAnnotationFvRsIntraEpgFvAEPg.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagAnnotationFvRsIntraEpgFvAEPgList = append(TagAnnotationFvRsIntraEpgFvAEPgList, TagAnnotationFvRsIntraEpgFvAEPg) + } + if childClassNameFvRsIntraEpgFvAEPg == "tagTag" { + TagTagFvRsIntraEpgFvAEPg := getEmptyTagTagFvRsIntraEpgFvAEPgResourceModel() + tagTagchildAttributeValue := childClassDetailsFvRsIntraEpgFvAEPg.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagTagchildAttributeValue { + if childAttributeName == "key" { + TagTagFvRsIntraEpgFvAEPg.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagTagFvRsIntraEpgFvAEPg.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagTagFvRsIntraEpgFvAEPgList = append(TagTagFvRsIntraEpgFvAEPgList, TagTagFvRsIntraEpgFvAEPg) + } + } + } } + TagAnnotationFvRsIntraEpgFvAEPgSet, _ := types.SetValueFrom(ctx, TagAnnotationFvRsIntraEpgFvAEPgType, TagAnnotationFvRsIntraEpgFvAEPgList) + FvRsIntraEpgFvAEPg.TagAnnotation = TagAnnotationFvRsIntraEpgFvAEPgSet + TagTagFvRsIntraEpgFvAEPgSet, _ := types.SetValueFrom(ctx, TagTagFvRsIntraEpgFvAEPgType, TagTagFvRsIntraEpgFvAEPgList) + FvRsIntraEpgFvAEPg.TagTag = TagTagFvRsIntraEpgFvAEPgSet FvRsIntraEpgFvAEPgList = append(FvRsIntraEpgFvAEPgList, FvRsIntraEpgFvAEPg) } if childClassName == "fvRsNodeAtt" { @@ -4508,7 +7234,47 @@ func getAndSetFvAEPgAttributes(ctx context.Context, diags *diag.Diagnostics, cli if childAttributeName == "tDn" { FvRsNodeAttFvAEPg.TDn = basetypes.NewStringValue(childAttributeValue.(string)) } + + } + TagAnnotationFvRsNodeAttFvAEPgList := make([]TagAnnotationFvRsNodeAttFvAEPgResourceModel, 0) + TagTagFvRsNodeAttFvAEPgList := make([]TagTagFvRsNodeAttFvAEPgResourceModel, 0) + childrenOfFvRsNodeAttFvAEPg, childrenOfFvRsNodeAttFvAEPgExist := childClassDetails.(map[string]interface{})["children"] + if childrenOfFvRsNodeAttFvAEPgExist { + for _, childFvRsNodeAttFvAEPg := range childrenOfFvRsNodeAttFvAEPg.([]interface{}) { + for childClassNameFvRsNodeAttFvAEPg, childClassDetailsFvRsNodeAttFvAEPg := range childFvRsNodeAttFvAEPg.(map[string]interface{}) { + if childClassNameFvRsNodeAttFvAEPg == "tagAnnotation" { + TagAnnotationFvRsNodeAttFvAEPg := getEmptyTagAnnotationFvRsNodeAttFvAEPgResourceModel() + tagAnnotationchildAttributeValue := childClassDetailsFvRsNodeAttFvAEPg.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagAnnotationchildAttributeValue { + if childAttributeName == "key" { + TagAnnotationFvRsNodeAttFvAEPg.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagAnnotationFvRsNodeAttFvAEPg.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagAnnotationFvRsNodeAttFvAEPgList = append(TagAnnotationFvRsNodeAttFvAEPgList, TagAnnotationFvRsNodeAttFvAEPg) + } + if childClassNameFvRsNodeAttFvAEPg == "tagTag" { + TagTagFvRsNodeAttFvAEPg := getEmptyTagTagFvRsNodeAttFvAEPgResourceModel() + tagTagchildAttributeValue := childClassDetailsFvRsNodeAttFvAEPg.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagTagchildAttributeValue { + if childAttributeName == "key" { + TagTagFvRsNodeAttFvAEPg.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagTagFvRsNodeAttFvAEPg.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagTagFvRsNodeAttFvAEPgList = append(TagTagFvRsNodeAttFvAEPgList, TagTagFvRsNodeAttFvAEPg) + } + } + } } + TagAnnotationFvRsNodeAttFvAEPgSet, _ := types.SetValueFrom(ctx, TagAnnotationFvRsNodeAttFvAEPgType, TagAnnotationFvRsNodeAttFvAEPgList) + FvRsNodeAttFvAEPg.TagAnnotation = TagAnnotationFvRsNodeAttFvAEPgSet + TagTagFvRsNodeAttFvAEPgSet, _ := types.SetValueFrom(ctx, TagTagFvRsNodeAttFvAEPgType, TagTagFvRsNodeAttFvAEPgList) + FvRsNodeAttFvAEPg.TagTag = TagTagFvRsNodeAttFvAEPgSet FvRsNodeAttFvAEPgList = append(FvRsNodeAttFvAEPgList, FvRsNodeAttFvAEPg) } if childClassName == "fvRsPathAtt" { @@ -4535,7 +7301,47 @@ func getAndSetFvAEPgAttributes(ctx context.Context, diags *diag.Diagnostics, cli if childAttributeName == "tDn" { FvRsPathAttFvAEPg.TDn = basetypes.NewStringValue(childAttributeValue.(string)) } + + } + TagAnnotationFvRsPathAttFvAEPgList := make([]TagAnnotationFvRsPathAttFvAEPgResourceModel, 0) + TagTagFvRsPathAttFvAEPgList := make([]TagTagFvRsPathAttFvAEPgResourceModel, 0) + childrenOfFvRsPathAttFvAEPg, childrenOfFvRsPathAttFvAEPgExist := childClassDetails.(map[string]interface{})["children"] + if childrenOfFvRsPathAttFvAEPgExist { + for _, childFvRsPathAttFvAEPg := range childrenOfFvRsPathAttFvAEPg.([]interface{}) { + for childClassNameFvRsPathAttFvAEPg, childClassDetailsFvRsPathAttFvAEPg := range childFvRsPathAttFvAEPg.(map[string]interface{}) { + if childClassNameFvRsPathAttFvAEPg == "tagAnnotation" { + TagAnnotationFvRsPathAttFvAEPg := getEmptyTagAnnotationFvRsPathAttFvAEPgResourceModel() + tagAnnotationchildAttributeValue := childClassDetailsFvRsPathAttFvAEPg.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagAnnotationchildAttributeValue { + if childAttributeName == "key" { + TagAnnotationFvRsPathAttFvAEPg.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagAnnotationFvRsPathAttFvAEPg.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagAnnotationFvRsPathAttFvAEPgList = append(TagAnnotationFvRsPathAttFvAEPgList, TagAnnotationFvRsPathAttFvAEPg) + } + if childClassNameFvRsPathAttFvAEPg == "tagTag" { + TagTagFvRsPathAttFvAEPg := getEmptyTagTagFvRsPathAttFvAEPgResourceModel() + tagTagchildAttributeValue := childClassDetailsFvRsPathAttFvAEPg.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagTagchildAttributeValue { + if childAttributeName == "key" { + TagTagFvRsPathAttFvAEPg.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagTagFvRsPathAttFvAEPg.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagTagFvRsPathAttFvAEPgList = append(TagTagFvRsPathAttFvAEPgList, TagTagFvRsPathAttFvAEPg) + } + } + } } + TagAnnotationFvRsPathAttFvAEPgSet, _ := types.SetValueFrom(ctx, TagAnnotationFvRsPathAttFvAEPgType, TagAnnotationFvRsPathAttFvAEPgList) + FvRsPathAttFvAEPg.TagAnnotation = TagAnnotationFvRsPathAttFvAEPgSet + TagTagFvRsPathAttFvAEPgSet, _ := types.SetValueFrom(ctx, TagTagFvRsPathAttFvAEPgType, TagTagFvRsPathAttFvAEPgList) + FvRsPathAttFvAEPg.TagTag = TagTagFvRsPathAttFvAEPgSet FvRsPathAttFvAEPgList = append(FvRsPathAttFvAEPgList, FvRsPathAttFvAEPg) } if childClassName == "fvRsProtBy" { @@ -4547,7 +7353,47 @@ func getAndSetFvAEPgAttributes(ctx context.Context, diags *diag.Diagnostics, cli if childAttributeName == "tnVzTabooName" { FvRsProtByFvAEPg.TnVzTabooName = basetypes.NewStringValue(childAttributeValue.(string)) } + + } + TagAnnotationFvRsProtByFvAEPgList := make([]TagAnnotationFvRsProtByFvAEPgResourceModel, 0) + TagTagFvRsProtByFvAEPgList := make([]TagTagFvRsProtByFvAEPgResourceModel, 0) + childrenOfFvRsProtByFvAEPg, childrenOfFvRsProtByFvAEPgExist := childClassDetails.(map[string]interface{})["children"] + if childrenOfFvRsProtByFvAEPgExist { + for _, childFvRsProtByFvAEPg := range childrenOfFvRsProtByFvAEPg.([]interface{}) { + for childClassNameFvRsProtByFvAEPg, childClassDetailsFvRsProtByFvAEPg := range childFvRsProtByFvAEPg.(map[string]interface{}) { + if childClassNameFvRsProtByFvAEPg == "tagAnnotation" { + TagAnnotationFvRsProtByFvAEPg := getEmptyTagAnnotationFvRsProtByFvAEPgResourceModel() + tagAnnotationchildAttributeValue := childClassDetailsFvRsProtByFvAEPg.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagAnnotationchildAttributeValue { + if childAttributeName == "key" { + TagAnnotationFvRsProtByFvAEPg.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagAnnotationFvRsProtByFvAEPg.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagAnnotationFvRsProtByFvAEPgList = append(TagAnnotationFvRsProtByFvAEPgList, TagAnnotationFvRsProtByFvAEPg) + } + if childClassNameFvRsProtByFvAEPg == "tagTag" { + TagTagFvRsProtByFvAEPg := getEmptyTagTagFvRsProtByFvAEPgResourceModel() + tagTagchildAttributeValue := childClassDetailsFvRsProtByFvAEPg.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagTagchildAttributeValue { + if childAttributeName == "key" { + TagTagFvRsProtByFvAEPg.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagTagFvRsProtByFvAEPg.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagTagFvRsProtByFvAEPgList = append(TagTagFvRsProtByFvAEPgList, TagTagFvRsProtByFvAEPg) + } + } + } } + TagAnnotationFvRsProtByFvAEPgSet, _ := types.SetValueFrom(ctx, TagAnnotationFvRsProtByFvAEPgType, TagAnnotationFvRsProtByFvAEPgList) + FvRsProtByFvAEPg.TagAnnotation = TagAnnotationFvRsProtByFvAEPgSet + TagTagFvRsProtByFvAEPgSet, _ := types.SetValueFrom(ctx, TagTagFvRsProtByFvAEPgType, TagTagFvRsProtByFvAEPgList) + FvRsProtByFvAEPg.TagTag = TagTagFvRsProtByFvAEPgSet FvRsProtByFvAEPgList = append(FvRsProtByFvAEPgList, FvRsProtByFvAEPg) } if childClassName == "fvRsProv" { @@ -4565,7 +7411,47 @@ func getAndSetFvAEPgAttributes(ctx context.Context, diags *diag.Diagnostics, cli if childAttributeName == "tnVzBrCPName" { FvRsProvFvAEPg.TnVzBrCPName = basetypes.NewStringValue(childAttributeValue.(string)) } + + } + TagAnnotationFvRsProvFvAEPgList := make([]TagAnnotationFvRsProvFvAEPgResourceModel, 0) + TagTagFvRsProvFvAEPgList := make([]TagTagFvRsProvFvAEPgResourceModel, 0) + childrenOfFvRsProvFvAEPg, childrenOfFvRsProvFvAEPgExist := childClassDetails.(map[string]interface{})["children"] + if childrenOfFvRsProvFvAEPgExist { + for _, childFvRsProvFvAEPg := range childrenOfFvRsProvFvAEPg.([]interface{}) { + for childClassNameFvRsProvFvAEPg, childClassDetailsFvRsProvFvAEPg := range childFvRsProvFvAEPg.(map[string]interface{}) { + if childClassNameFvRsProvFvAEPg == "tagAnnotation" { + TagAnnotationFvRsProvFvAEPg := getEmptyTagAnnotationFvRsProvFvAEPgResourceModel() + tagAnnotationchildAttributeValue := childClassDetailsFvRsProvFvAEPg.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagAnnotationchildAttributeValue { + if childAttributeName == "key" { + TagAnnotationFvRsProvFvAEPg.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagAnnotationFvRsProvFvAEPg.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagAnnotationFvRsProvFvAEPgList = append(TagAnnotationFvRsProvFvAEPgList, TagAnnotationFvRsProvFvAEPg) + } + if childClassNameFvRsProvFvAEPg == "tagTag" { + TagTagFvRsProvFvAEPg := getEmptyTagTagFvRsProvFvAEPgResourceModel() + tagTagchildAttributeValue := childClassDetailsFvRsProvFvAEPg.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagTagchildAttributeValue { + if childAttributeName == "key" { + TagTagFvRsProvFvAEPg.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagTagFvRsProvFvAEPg.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagTagFvRsProvFvAEPgList = append(TagTagFvRsProvFvAEPgList, TagTagFvRsProvFvAEPg) + } + } + } } + TagAnnotationFvRsProvFvAEPgSet, _ := types.SetValueFrom(ctx, TagAnnotationFvRsProvFvAEPgType, TagAnnotationFvRsProvFvAEPgList) + FvRsProvFvAEPg.TagAnnotation = TagAnnotationFvRsProvFvAEPgSet + TagTagFvRsProvFvAEPgSet, _ := types.SetValueFrom(ctx, TagTagFvRsProvFvAEPgType, TagTagFvRsProvFvAEPgList) + FvRsProvFvAEPg.TagTag = TagTagFvRsProvFvAEPgSet FvRsProvFvAEPgList = append(FvRsProvFvAEPgList, FvRsProvFvAEPg) } if childClassName == "fvRsSecInherited" { @@ -4577,7 +7463,47 @@ func getAndSetFvAEPgAttributes(ctx context.Context, diags *diag.Diagnostics, cli if childAttributeName == "tDn" { FvRsSecInheritedFvAEPg.TDn = basetypes.NewStringValue(childAttributeValue.(string)) } + + } + TagAnnotationFvRsSecInheritedFvAEPgList := make([]TagAnnotationFvRsSecInheritedFvAEPgResourceModel, 0) + TagTagFvRsSecInheritedFvAEPgList := make([]TagTagFvRsSecInheritedFvAEPgResourceModel, 0) + childrenOfFvRsSecInheritedFvAEPg, childrenOfFvRsSecInheritedFvAEPgExist := childClassDetails.(map[string]interface{})["children"] + if childrenOfFvRsSecInheritedFvAEPgExist { + for _, childFvRsSecInheritedFvAEPg := range childrenOfFvRsSecInheritedFvAEPg.([]interface{}) { + for childClassNameFvRsSecInheritedFvAEPg, childClassDetailsFvRsSecInheritedFvAEPg := range childFvRsSecInheritedFvAEPg.(map[string]interface{}) { + if childClassNameFvRsSecInheritedFvAEPg == "tagAnnotation" { + TagAnnotationFvRsSecInheritedFvAEPg := getEmptyTagAnnotationFvRsSecInheritedFvAEPgResourceModel() + tagAnnotationchildAttributeValue := childClassDetailsFvRsSecInheritedFvAEPg.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagAnnotationchildAttributeValue { + if childAttributeName == "key" { + TagAnnotationFvRsSecInheritedFvAEPg.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagAnnotationFvRsSecInheritedFvAEPg.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagAnnotationFvRsSecInheritedFvAEPgList = append(TagAnnotationFvRsSecInheritedFvAEPgList, TagAnnotationFvRsSecInheritedFvAEPg) + } + if childClassNameFvRsSecInheritedFvAEPg == "tagTag" { + TagTagFvRsSecInheritedFvAEPg := getEmptyTagTagFvRsSecInheritedFvAEPgResourceModel() + tagTagchildAttributeValue := childClassDetailsFvRsSecInheritedFvAEPg.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagTagchildAttributeValue { + if childAttributeName == "key" { + TagTagFvRsSecInheritedFvAEPg.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagTagFvRsSecInheritedFvAEPg.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagTagFvRsSecInheritedFvAEPgList = append(TagTagFvRsSecInheritedFvAEPgList, TagTagFvRsSecInheritedFvAEPg) + } + } + } } + TagAnnotationFvRsSecInheritedFvAEPgSet, _ := types.SetValueFrom(ctx, TagAnnotationFvRsSecInheritedFvAEPgType, TagAnnotationFvRsSecInheritedFvAEPgList) + FvRsSecInheritedFvAEPg.TagAnnotation = TagAnnotationFvRsSecInheritedFvAEPgSet + TagTagFvRsSecInheritedFvAEPgSet, _ := types.SetValueFrom(ctx, TagTagFvRsSecInheritedFvAEPgType, TagTagFvRsSecInheritedFvAEPgList) + FvRsSecInheritedFvAEPg.TagTag = TagTagFvRsSecInheritedFvAEPgSet FvRsSecInheritedFvAEPgList = append(FvRsSecInheritedFvAEPgList, FvRsSecInheritedFvAEPg) } if childClassName == "fvRsTrustCtrl" { @@ -4589,7 +7515,47 @@ func getAndSetFvAEPgAttributes(ctx context.Context, diags *diag.Diagnostics, cli if childAttributeName == "tnFhsTrustCtrlPolName" { FvRsTrustCtrlFvAEPg.TnFhsTrustCtrlPolName = basetypes.NewStringValue(childAttributeValue.(string)) } + + } + TagAnnotationFvRsTrustCtrlFvAEPgList := make([]TagAnnotationFvRsTrustCtrlFvAEPgResourceModel, 0) + TagTagFvRsTrustCtrlFvAEPgList := make([]TagTagFvRsTrustCtrlFvAEPgResourceModel, 0) + childrenOfFvRsTrustCtrlFvAEPg, childrenOfFvRsTrustCtrlFvAEPgExist := childClassDetails.(map[string]interface{})["children"] + if childrenOfFvRsTrustCtrlFvAEPgExist { + for _, childFvRsTrustCtrlFvAEPg := range childrenOfFvRsTrustCtrlFvAEPg.([]interface{}) { + for childClassNameFvRsTrustCtrlFvAEPg, childClassDetailsFvRsTrustCtrlFvAEPg := range childFvRsTrustCtrlFvAEPg.(map[string]interface{}) { + if childClassNameFvRsTrustCtrlFvAEPg == "tagAnnotation" { + TagAnnotationFvRsTrustCtrlFvAEPg := getEmptyTagAnnotationFvRsTrustCtrlFvAEPgResourceModel() + tagAnnotationchildAttributeValue := childClassDetailsFvRsTrustCtrlFvAEPg.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagAnnotationchildAttributeValue { + if childAttributeName == "key" { + TagAnnotationFvRsTrustCtrlFvAEPg.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagAnnotationFvRsTrustCtrlFvAEPg.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagAnnotationFvRsTrustCtrlFvAEPgList = append(TagAnnotationFvRsTrustCtrlFvAEPgList, TagAnnotationFvRsTrustCtrlFvAEPg) + } + if childClassNameFvRsTrustCtrlFvAEPg == "tagTag" { + TagTagFvRsTrustCtrlFvAEPg := getEmptyTagTagFvRsTrustCtrlFvAEPgResourceModel() + tagTagchildAttributeValue := childClassDetailsFvRsTrustCtrlFvAEPg.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagTagchildAttributeValue { + if childAttributeName == "key" { + TagTagFvRsTrustCtrlFvAEPg.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagTagFvRsTrustCtrlFvAEPg.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagTagFvRsTrustCtrlFvAEPgList = append(TagTagFvRsTrustCtrlFvAEPgList, TagTagFvRsTrustCtrlFvAEPg) + } + } + } } + TagAnnotationFvRsTrustCtrlFvAEPgSet, _ := types.SetValueFrom(ctx, TagAnnotationFvRsTrustCtrlFvAEPgType, TagAnnotationFvRsTrustCtrlFvAEPgList) + FvRsTrustCtrlFvAEPg.TagAnnotation = TagAnnotationFvRsTrustCtrlFvAEPgSet + TagTagFvRsTrustCtrlFvAEPgSet, _ := types.SetValueFrom(ctx, TagTagFvRsTrustCtrlFvAEPgType, TagTagFvRsTrustCtrlFvAEPgList) + FvRsTrustCtrlFvAEPg.TagTag = TagTagFvRsTrustCtrlFvAEPgSet FvRsTrustCtrlFvAEPgList = append(FvRsTrustCtrlFvAEPgList, FvRsTrustCtrlFvAEPg) } if childClassName == "tagAnnotation" { @@ -4601,6 +7567,7 @@ func getAndSetFvAEPgAttributes(ctx context.Context, diags *diag.Diagnostics, cli if childAttributeName == "value" { TagAnnotationFvAEPg.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagAnnotationFvAEPgList = append(TagAnnotationFvAEPgList, TagAnnotationFvAEPg) } @@ -4613,6 +7580,7 @@ func getAndSetFvAEPgAttributes(ctx context.Context, diags *diag.Diagnostics, cli if childAttributeName == "value" { TagTagFvAEPg.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagTagFvAEPgList = append(TagTagFvAEPgList, TagTagFvAEPg) } @@ -4723,44 +7691,119 @@ func setFvAEPgId(ctx context.Context, data *FvAEPgResourceModel) { data.Id = types.StringValue(fmt.Sprintf("%s/%s", data.ParentDn.ValueString(), rn)) } -func getFvAEPgFvCrtrnChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvAEPgResourceModel, fvCrtrnPlan, fvCrtrnState FvCrtrnFvAEPgResourceModel) []map[string]interface{} { - +func getFvAEPgFvCrtrnChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvAEPgResourceModel, fvCrtrnFvAEPgPlan, fvCrtrnFvAEPgState FvCrtrnFvAEPgResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.FvCrtrn.IsUnknown() { - childMap := map[string]map[string]interface{}{"attributes": {}} + if !data.FvCrtrn.IsNull() && !data.FvCrtrn.IsUnknown() { + FvCrtrnFvAEPgChildren := make([]map[string]interface{}, 0) + childMap := NewAciObject() if !IsEmptySingleNestedAttribute(data.FvCrtrn.Attributes()) { - if !fvCrtrnPlan.Annotation.IsUnknown() && !fvCrtrnPlan.Annotation.IsNull() { - childMap["attributes"]["annotation"] = fvCrtrnPlan.Annotation.ValueString() + if !fvCrtrnFvAEPgPlan.Annotation.IsUnknown() && !fvCrtrnFvAEPgPlan.Annotation.IsNull() { + childMap.Attributes["annotation"] = fvCrtrnFvAEPgPlan.Annotation.ValueString() } else { - childMap["attributes"]["annotation"] = globalAnnotation + childMap.Attributes["annotation"] = globalAnnotation } - if !fvCrtrnPlan.Descr.IsUnknown() && !fvCrtrnPlan.Descr.IsNull() { - childMap["attributes"]["descr"] = fvCrtrnPlan.Descr.ValueString() + if !fvCrtrnFvAEPgPlan.Descr.IsUnknown() && !fvCrtrnFvAEPgPlan.Descr.IsNull() { + childMap.Attributes["descr"] = fvCrtrnFvAEPgPlan.Descr.ValueString() } - if !fvCrtrnPlan.Match.IsUnknown() && !fvCrtrnPlan.Match.IsNull() { - childMap["attributes"]["match"] = fvCrtrnPlan.Match.ValueString() + if !fvCrtrnFvAEPgPlan.Match.IsUnknown() && !fvCrtrnFvAEPgPlan.Match.IsNull() { + childMap.Attributes["match"] = fvCrtrnFvAEPgPlan.Match.ValueString() } - if !fvCrtrnPlan.Name.IsUnknown() && !fvCrtrnPlan.Name.IsNull() { - childMap["attributes"]["name"] = fvCrtrnPlan.Name.ValueString() + if !fvCrtrnFvAEPgPlan.Name.IsUnknown() && !fvCrtrnFvAEPgPlan.Name.IsNull() { + childMap.Attributes["name"] = fvCrtrnFvAEPgPlan.Name.ValueString() } - if !fvCrtrnPlan.NameAlias.IsUnknown() && !fvCrtrnPlan.NameAlias.IsNull() { - childMap["attributes"]["nameAlias"] = fvCrtrnPlan.NameAlias.ValueString() + if !fvCrtrnFvAEPgPlan.NameAlias.IsUnknown() && !fvCrtrnFvAEPgPlan.NameAlias.IsNull() { + childMap.Attributes["nameAlias"] = fvCrtrnFvAEPgPlan.NameAlias.ValueString() } - if !fvCrtrnPlan.OwnerKey.IsUnknown() && !fvCrtrnPlan.OwnerKey.IsNull() { - childMap["attributes"]["ownerKey"] = fvCrtrnPlan.OwnerKey.ValueString() + if !fvCrtrnFvAEPgPlan.OwnerKey.IsUnknown() && !fvCrtrnFvAEPgPlan.OwnerKey.IsNull() { + childMap.Attributes["ownerKey"] = fvCrtrnFvAEPgPlan.OwnerKey.ValueString() } - if !fvCrtrnPlan.OwnerTag.IsUnknown() && !fvCrtrnPlan.OwnerTag.IsNull() { - childMap["attributes"]["ownerTag"] = fvCrtrnPlan.OwnerTag.ValueString() + if !fvCrtrnFvAEPgPlan.OwnerTag.IsUnknown() && !fvCrtrnFvAEPgPlan.OwnerTag.IsNull() { + childMap.Attributes["ownerTag"] = fvCrtrnFvAEPgPlan.OwnerTag.ValueString() } - if !fvCrtrnPlan.Prec.IsUnknown() && !fvCrtrnPlan.Prec.IsNull() { - childMap["attributes"]["prec"] = fvCrtrnPlan.Prec.ValueString() + if !fvCrtrnFvAEPgPlan.Prec.IsUnknown() && !fvCrtrnFvAEPgPlan.Prec.IsNull() { + childMap.Attributes["prec"] = fvCrtrnFvAEPgPlan.Prec.ValueString() } - if !fvCrtrnPlan.Scope.IsUnknown() && !fvCrtrnPlan.Scope.IsNull() { - childMap["attributes"]["scope"] = fvCrtrnPlan.Scope.ValueString() + if !fvCrtrnFvAEPgPlan.Scope.IsUnknown() && !fvCrtrnFvAEPgPlan.Scope.IsNull() { + childMap.Attributes["scope"] = fvCrtrnFvAEPgPlan.Scope.ValueString() } } else { - childMap["attributes"]["status"] = "deleted" + childMap.Attributes["status"] = "deleted" } + + var tagAnnotationFvCrtrnFvAEPgPlan, tagAnnotationFvCrtrnFvAEPgState []TagAnnotationFvCrtrnFvAEPgResourceModel + fvCrtrnFvAEPgPlan.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvCrtrnFvAEPgPlan, false) + if !fvCrtrnFvAEPgState.TagAnnotation.IsNull() { + fvCrtrnFvAEPgState.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvCrtrnFvAEPgState, false) + } + if !fvCrtrnFvAEPgPlan.TagAnnotation.IsNull() && !fvCrtrnFvAEPgPlan.TagAnnotation.IsUnknown() { + tagAnnotationIdentifiers := []TagAnnotationIdentifier{} + for _, tagAnnotationFvCrtrnFvAEPg := range tagAnnotationFvCrtrnFvAEPgPlan { + tagAnnotationFvCrtrnFvAEPgChildMap := NewAciObject() + if !tagAnnotationFvCrtrnFvAEPg.Key.IsNull() && !tagAnnotationFvCrtrnFvAEPg.Key.IsUnknown() { + tagAnnotationFvCrtrnFvAEPgChildMap.Attributes["key"] = tagAnnotationFvCrtrnFvAEPg.Key.ValueString() + } + if !tagAnnotationFvCrtrnFvAEPg.Value.IsNull() && !tagAnnotationFvCrtrnFvAEPg.Value.IsUnknown() { + tagAnnotationFvCrtrnFvAEPgChildMap.Attributes["value"] = tagAnnotationFvCrtrnFvAEPg.Value.ValueString() + } + FvCrtrnFvAEPgChildren = append(FvCrtrnFvAEPgChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvCrtrnFvAEPgChildMap}) + tagAnnotationIdentifier := TagAnnotationIdentifier{} + tagAnnotationIdentifier.Key = tagAnnotationFvCrtrnFvAEPg.Key + tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) + } + for _, tagAnnotationFvCrtrnFvAEPg := range tagAnnotationFvCrtrnFvAEPgState { + delete := true + for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { + if tagAnnotationIdentifier.Key == tagAnnotationFvCrtrnFvAEPg.Key { + delete = false + break + } + } + if delete { + tagAnnotationFvCrtrnFvAEPgChildMapForDelete := NewAciObject() + tagAnnotationFvCrtrnFvAEPgChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationFvCrtrnFvAEPgChildMapForDelete.Attributes["key"] = tagAnnotationFvCrtrnFvAEPg.Key.ValueString() + FvCrtrnFvAEPgChildren = append(FvCrtrnFvAEPgChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvCrtrnFvAEPgChildMapForDelete}) + } + } + } + + var tagTagFvCrtrnFvAEPgPlan, tagTagFvCrtrnFvAEPgState []TagTagFvCrtrnFvAEPgResourceModel + fvCrtrnFvAEPgPlan.TagTag.ElementsAs(ctx, &tagTagFvCrtrnFvAEPgPlan, false) + if !fvCrtrnFvAEPgState.TagTag.IsNull() { + fvCrtrnFvAEPgState.TagTag.ElementsAs(ctx, &tagTagFvCrtrnFvAEPgState, false) + } + if !fvCrtrnFvAEPgPlan.TagTag.IsNull() && !fvCrtrnFvAEPgPlan.TagTag.IsUnknown() { + tagTagIdentifiers := []TagTagIdentifier{} + for _, tagTagFvCrtrnFvAEPg := range tagTagFvCrtrnFvAEPgPlan { + tagTagFvCrtrnFvAEPgChildMap := NewAciObject() + if !tagTagFvCrtrnFvAEPg.Key.IsNull() && !tagTagFvCrtrnFvAEPg.Key.IsUnknown() { + tagTagFvCrtrnFvAEPgChildMap.Attributes["key"] = tagTagFvCrtrnFvAEPg.Key.ValueString() + } + if !tagTagFvCrtrnFvAEPg.Value.IsNull() && !tagTagFvCrtrnFvAEPg.Value.IsUnknown() { + tagTagFvCrtrnFvAEPgChildMap.Attributes["value"] = tagTagFvCrtrnFvAEPg.Value.ValueString() + } + FvCrtrnFvAEPgChildren = append(FvCrtrnFvAEPgChildren, map[string]interface{}{"tagTag": tagTagFvCrtrnFvAEPgChildMap}) + tagTagIdentifier := TagTagIdentifier{} + tagTagIdentifier.Key = tagTagFvCrtrnFvAEPg.Key + tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) + } + for _, tagTagFvCrtrnFvAEPg := range tagTagFvCrtrnFvAEPgState { + delete := true + for _, tagTagIdentifier := range tagTagIdentifiers { + if tagTagIdentifier.Key == tagTagFvCrtrnFvAEPg.Key { + delete = false + break + } + } + if delete { + tagTagFvCrtrnFvAEPgChildMapForDelete := NewAciObject() + tagTagFvCrtrnFvAEPgChildMapForDelete.Attributes["status"] = "deleted" + tagTagFvCrtrnFvAEPgChildMapForDelete.Attributes["key"] = tagTagFvCrtrnFvAEPg.Key.ValueString() + FvCrtrnFvAEPgChildren = append(FvCrtrnFvAEPgChildren, map[string]interface{}{"tagTag": tagTagFvCrtrnFvAEPgChildMapForDelete}) + } + } + } + childMap.Children = FvCrtrnFvAEPgChildren childPayloads = append(childPayloads, map[string]interface{}{"fvCrtrn": childMap}) } else { FvCrtrnObject, _ := types.ObjectValueFrom(ctx, FvCrtrnFvAEPgType, getEmptyFvCrtrnFvAEPgResourceModel()) @@ -4769,23 +7812,99 @@ func getFvAEPgFvCrtrnChildPayloads(ctx context.Context, diags *diag.Diagnostics, return childPayloads } -func getFvAEPgFvRsAEPgMonPolChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvAEPgResourceModel, fvRsAEPgMonPolPlan, fvRsAEPgMonPolState FvRsAEPgMonPolFvAEPgResourceModel) []map[string]interface{} { +func getFvAEPgFvRsAEPgMonPolChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvAEPgResourceModel, fvRsAEPgMonPolFvAEPgPlan, fvRsAEPgMonPolFvAEPgState FvRsAEPgMonPolFvAEPgResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.FvRsAEPgMonPol.IsUnknown() { - childMap := map[string]map[string]interface{}{"attributes": {}} + if !data.FvRsAEPgMonPol.IsNull() && !data.FvRsAEPgMonPol.IsUnknown() { + FvRsAEPgMonPolFvAEPgChildren := make([]map[string]interface{}, 0) + childMap := NewAciObject() if !IsEmptySingleNestedAttribute(data.FvRsAEPgMonPol.Attributes()) { - if !fvRsAEPgMonPolPlan.Annotation.IsUnknown() && !fvRsAEPgMonPolPlan.Annotation.IsNull() { - childMap["attributes"]["annotation"] = fvRsAEPgMonPolPlan.Annotation.ValueString() + if !fvRsAEPgMonPolFvAEPgPlan.Annotation.IsUnknown() && !fvRsAEPgMonPolFvAEPgPlan.Annotation.IsNull() { + childMap.Attributes["annotation"] = fvRsAEPgMonPolFvAEPgPlan.Annotation.ValueString() } else { - childMap["attributes"]["annotation"] = globalAnnotation + childMap.Attributes["annotation"] = globalAnnotation } - if !fvRsAEPgMonPolPlan.TnMonEPGPolName.IsUnknown() && !fvRsAEPgMonPolPlan.TnMonEPGPolName.IsNull() { - childMap["attributes"]["tnMonEPGPolName"] = fvRsAEPgMonPolPlan.TnMonEPGPolName.ValueString() + if !fvRsAEPgMonPolFvAEPgPlan.TnMonEPGPolName.IsUnknown() && !fvRsAEPgMonPolFvAEPgPlan.TnMonEPGPolName.IsNull() { + childMap.Attributes["tnMonEPGPolName"] = fvRsAEPgMonPolFvAEPgPlan.TnMonEPGPolName.ValueString() } } else { - childMap["attributes"]["status"] = "deleted" + childMap.Attributes["status"] = "deleted" + } + + var tagAnnotationFvRsAEPgMonPolFvAEPgPlan, tagAnnotationFvRsAEPgMonPolFvAEPgState []TagAnnotationFvRsAEPgMonPolFvAEPgResourceModel + fvRsAEPgMonPolFvAEPgPlan.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsAEPgMonPolFvAEPgPlan, false) + if !fvRsAEPgMonPolFvAEPgState.TagAnnotation.IsNull() { + fvRsAEPgMonPolFvAEPgState.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsAEPgMonPolFvAEPgState, false) + } + if !fvRsAEPgMonPolFvAEPgPlan.TagAnnotation.IsNull() && !fvRsAEPgMonPolFvAEPgPlan.TagAnnotation.IsUnknown() { + tagAnnotationIdentifiers := []TagAnnotationIdentifier{} + for _, tagAnnotationFvRsAEPgMonPolFvAEPg := range tagAnnotationFvRsAEPgMonPolFvAEPgPlan { + tagAnnotationFvRsAEPgMonPolFvAEPgChildMap := NewAciObject() + if !tagAnnotationFvRsAEPgMonPolFvAEPg.Key.IsNull() && !tagAnnotationFvRsAEPgMonPolFvAEPg.Key.IsUnknown() { + tagAnnotationFvRsAEPgMonPolFvAEPgChildMap.Attributes["key"] = tagAnnotationFvRsAEPgMonPolFvAEPg.Key.ValueString() + } + if !tagAnnotationFvRsAEPgMonPolFvAEPg.Value.IsNull() && !tagAnnotationFvRsAEPgMonPolFvAEPg.Value.IsUnknown() { + tagAnnotationFvRsAEPgMonPolFvAEPgChildMap.Attributes["value"] = tagAnnotationFvRsAEPgMonPolFvAEPg.Value.ValueString() + } + FvRsAEPgMonPolFvAEPgChildren = append(FvRsAEPgMonPolFvAEPgChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsAEPgMonPolFvAEPgChildMap}) + tagAnnotationIdentifier := TagAnnotationIdentifier{} + tagAnnotationIdentifier.Key = tagAnnotationFvRsAEPgMonPolFvAEPg.Key + tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) + } + for _, tagAnnotationFvRsAEPgMonPolFvAEPg := range tagAnnotationFvRsAEPgMonPolFvAEPgState { + delete := true + for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { + if tagAnnotationIdentifier.Key == tagAnnotationFvRsAEPgMonPolFvAEPg.Key { + delete = false + break + } + } + if delete { + tagAnnotationFvRsAEPgMonPolFvAEPgChildMapForDelete := NewAciObject() + tagAnnotationFvRsAEPgMonPolFvAEPgChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationFvRsAEPgMonPolFvAEPgChildMapForDelete.Attributes["key"] = tagAnnotationFvRsAEPgMonPolFvAEPg.Key.ValueString() + FvRsAEPgMonPolFvAEPgChildren = append(FvRsAEPgMonPolFvAEPgChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsAEPgMonPolFvAEPgChildMapForDelete}) + } + } + } + + var tagTagFvRsAEPgMonPolFvAEPgPlan, tagTagFvRsAEPgMonPolFvAEPgState []TagTagFvRsAEPgMonPolFvAEPgResourceModel + fvRsAEPgMonPolFvAEPgPlan.TagTag.ElementsAs(ctx, &tagTagFvRsAEPgMonPolFvAEPgPlan, false) + if !fvRsAEPgMonPolFvAEPgState.TagTag.IsNull() { + fvRsAEPgMonPolFvAEPgState.TagTag.ElementsAs(ctx, &tagTagFvRsAEPgMonPolFvAEPgState, false) } + if !fvRsAEPgMonPolFvAEPgPlan.TagTag.IsNull() && !fvRsAEPgMonPolFvAEPgPlan.TagTag.IsUnknown() { + tagTagIdentifiers := []TagTagIdentifier{} + for _, tagTagFvRsAEPgMonPolFvAEPg := range tagTagFvRsAEPgMonPolFvAEPgPlan { + tagTagFvRsAEPgMonPolFvAEPgChildMap := NewAciObject() + if !tagTagFvRsAEPgMonPolFvAEPg.Key.IsNull() && !tagTagFvRsAEPgMonPolFvAEPg.Key.IsUnknown() { + tagTagFvRsAEPgMonPolFvAEPgChildMap.Attributes["key"] = tagTagFvRsAEPgMonPolFvAEPg.Key.ValueString() + } + if !tagTagFvRsAEPgMonPolFvAEPg.Value.IsNull() && !tagTagFvRsAEPgMonPolFvAEPg.Value.IsUnknown() { + tagTagFvRsAEPgMonPolFvAEPgChildMap.Attributes["value"] = tagTagFvRsAEPgMonPolFvAEPg.Value.ValueString() + } + FvRsAEPgMonPolFvAEPgChildren = append(FvRsAEPgMonPolFvAEPgChildren, map[string]interface{}{"tagTag": tagTagFvRsAEPgMonPolFvAEPgChildMap}) + tagTagIdentifier := TagTagIdentifier{} + tagTagIdentifier.Key = tagTagFvRsAEPgMonPolFvAEPg.Key + tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) + } + for _, tagTagFvRsAEPgMonPolFvAEPg := range tagTagFvRsAEPgMonPolFvAEPgState { + delete := true + for _, tagTagIdentifier := range tagTagIdentifiers { + if tagTagIdentifier.Key == tagTagFvRsAEPgMonPolFvAEPg.Key { + delete = false + break + } + } + if delete { + tagTagFvRsAEPgMonPolFvAEPgChildMapForDelete := NewAciObject() + tagTagFvRsAEPgMonPolFvAEPgChildMapForDelete.Attributes["status"] = "deleted" + tagTagFvRsAEPgMonPolFvAEPgChildMapForDelete.Attributes["key"] = tagTagFvRsAEPgMonPolFvAEPg.Key.ValueString() + FvRsAEPgMonPolFvAEPgChildren = append(FvRsAEPgMonPolFvAEPgChildren, map[string]interface{}{"tagTag": tagTagFvRsAEPgMonPolFvAEPgChildMapForDelete}) + } + } + } + childMap.Children = FvRsAEPgMonPolFvAEPgChildren childPayloads = append(childPayloads, map[string]interface{}{"fvRsAEPgMonPol": childMap}) } else { FvRsAEPgMonPolObject, _ := types.ObjectValueFrom(ctx, FvRsAEPgMonPolFvAEPgType, getEmptyFvRsAEPgMonPolFvAEPgResourceModel()) @@ -4794,21 +7913,97 @@ func getFvAEPgFvRsAEPgMonPolChildPayloads(ctx context.Context, diags *diag.Diagn return childPayloads } -func getFvAEPgFvRsBdChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvAEPgResourceModel, fvRsBdPlan, fvRsBdState FvRsBdFvAEPgResourceModel) []map[string]interface{} { +func getFvAEPgFvRsBdChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvAEPgResourceModel, fvRsBdFvAEPgPlan, fvRsBdFvAEPgState FvRsBdFvAEPgResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.FvRsBd.IsUnknown() { - childMap := map[string]map[string]interface{}{"attributes": {}} + if !data.FvRsBd.IsNull() && !data.FvRsBd.IsUnknown() { + FvRsBdFvAEPgChildren := make([]map[string]interface{}, 0) + childMap := NewAciObject() if !IsEmptySingleNestedAttribute(data.FvRsBd.Attributes()) { - if !fvRsBdPlan.Annotation.IsUnknown() && !fvRsBdPlan.Annotation.IsNull() { - childMap["attributes"]["annotation"] = fvRsBdPlan.Annotation.ValueString() + if !fvRsBdFvAEPgPlan.Annotation.IsUnknown() && !fvRsBdFvAEPgPlan.Annotation.IsNull() { + childMap.Attributes["annotation"] = fvRsBdFvAEPgPlan.Annotation.ValueString() } else { - childMap["attributes"]["annotation"] = globalAnnotation + childMap.Attributes["annotation"] = globalAnnotation + } + if !fvRsBdFvAEPgPlan.TnFvBDName.IsUnknown() && !fvRsBdFvAEPgPlan.TnFvBDName.IsNull() { + childMap.Attributes["tnFvBDName"] = fvRsBdFvAEPgPlan.TnFvBDName.ValueString() + } + } + + var tagAnnotationFvRsBdFvAEPgPlan, tagAnnotationFvRsBdFvAEPgState []TagAnnotationFvRsBdFvAEPgResourceModel + fvRsBdFvAEPgPlan.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsBdFvAEPgPlan, false) + if !fvRsBdFvAEPgState.TagAnnotation.IsNull() { + fvRsBdFvAEPgState.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsBdFvAEPgState, false) + } + if !fvRsBdFvAEPgPlan.TagAnnotation.IsNull() && !fvRsBdFvAEPgPlan.TagAnnotation.IsUnknown() { + tagAnnotationIdentifiers := []TagAnnotationIdentifier{} + for _, tagAnnotationFvRsBdFvAEPg := range tagAnnotationFvRsBdFvAEPgPlan { + tagAnnotationFvRsBdFvAEPgChildMap := NewAciObject() + if !tagAnnotationFvRsBdFvAEPg.Key.IsNull() && !tagAnnotationFvRsBdFvAEPg.Key.IsUnknown() { + tagAnnotationFvRsBdFvAEPgChildMap.Attributes["key"] = tagAnnotationFvRsBdFvAEPg.Key.ValueString() + } + if !tagAnnotationFvRsBdFvAEPg.Value.IsNull() && !tagAnnotationFvRsBdFvAEPg.Value.IsUnknown() { + tagAnnotationFvRsBdFvAEPgChildMap.Attributes["value"] = tagAnnotationFvRsBdFvAEPg.Value.ValueString() + } + FvRsBdFvAEPgChildren = append(FvRsBdFvAEPgChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsBdFvAEPgChildMap}) + tagAnnotationIdentifier := TagAnnotationIdentifier{} + tagAnnotationIdentifier.Key = tagAnnotationFvRsBdFvAEPg.Key + tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) + } + for _, tagAnnotationFvRsBdFvAEPg := range tagAnnotationFvRsBdFvAEPgState { + delete := true + for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { + if tagAnnotationIdentifier.Key == tagAnnotationFvRsBdFvAEPg.Key { + delete = false + break + } + } + if delete { + tagAnnotationFvRsBdFvAEPgChildMapForDelete := NewAciObject() + tagAnnotationFvRsBdFvAEPgChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationFvRsBdFvAEPgChildMapForDelete.Attributes["key"] = tagAnnotationFvRsBdFvAEPg.Key.ValueString() + FvRsBdFvAEPgChildren = append(FvRsBdFvAEPgChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsBdFvAEPgChildMapForDelete}) + } } - if !fvRsBdPlan.TnFvBDName.IsUnknown() && !fvRsBdPlan.TnFvBDName.IsNull() { - childMap["attributes"]["tnFvBDName"] = fvRsBdPlan.TnFvBDName.ValueString() + } + + var tagTagFvRsBdFvAEPgPlan, tagTagFvRsBdFvAEPgState []TagTagFvRsBdFvAEPgResourceModel + fvRsBdFvAEPgPlan.TagTag.ElementsAs(ctx, &tagTagFvRsBdFvAEPgPlan, false) + if !fvRsBdFvAEPgState.TagTag.IsNull() { + fvRsBdFvAEPgState.TagTag.ElementsAs(ctx, &tagTagFvRsBdFvAEPgState, false) + } + if !fvRsBdFvAEPgPlan.TagTag.IsNull() && !fvRsBdFvAEPgPlan.TagTag.IsUnknown() { + tagTagIdentifiers := []TagTagIdentifier{} + for _, tagTagFvRsBdFvAEPg := range tagTagFvRsBdFvAEPgPlan { + tagTagFvRsBdFvAEPgChildMap := NewAciObject() + if !tagTagFvRsBdFvAEPg.Key.IsNull() && !tagTagFvRsBdFvAEPg.Key.IsUnknown() { + tagTagFvRsBdFvAEPgChildMap.Attributes["key"] = tagTagFvRsBdFvAEPg.Key.ValueString() + } + if !tagTagFvRsBdFvAEPg.Value.IsNull() && !tagTagFvRsBdFvAEPg.Value.IsUnknown() { + tagTagFvRsBdFvAEPgChildMap.Attributes["value"] = tagTagFvRsBdFvAEPg.Value.ValueString() + } + FvRsBdFvAEPgChildren = append(FvRsBdFvAEPgChildren, map[string]interface{}{"tagTag": tagTagFvRsBdFvAEPgChildMap}) + tagTagIdentifier := TagTagIdentifier{} + tagTagIdentifier.Key = tagTagFvRsBdFvAEPg.Key + tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) + } + for _, tagTagFvRsBdFvAEPg := range tagTagFvRsBdFvAEPgState { + delete := true + for _, tagTagIdentifier := range tagTagIdentifiers { + if tagTagIdentifier.Key == tagTagFvRsBdFvAEPg.Key { + delete = false + break + } + } + if delete { + tagTagFvRsBdFvAEPgChildMapForDelete := NewAciObject() + tagTagFvRsBdFvAEPgChildMapForDelete.Attributes["status"] = "deleted" + tagTagFvRsBdFvAEPgChildMapForDelete.Attributes["key"] = tagTagFvRsBdFvAEPg.Key.ValueString() + FvRsBdFvAEPgChildren = append(FvRsBdFvAEPgChildren, map[string]interface{}{"tagTag": tagTagFvRsBdFvAEPgChildMapForDelete}) + } } } + childMap.Children = FvRsBdFvAEPgChildren childPayloads = append(childPayloads, map[string]interface{}{"fvRsBd": childMap}) } else { FvRsBdObject, _ := types.ObjectValueFrom(ctx, FvRsBdFvAEPgType, getEmptyFvRsBdFvAEPgResourceModel()) @@ -4817,30 +8012,106 @@ func getFvAEPgFvRsBdChildPayloads(ctx context.Context, diags *diag.Diagnostics, return childPayloads } -func getFvAEPgFvRsConsChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvAEPgResourceModel, fvRsConsPlan, fvRsConsState []FvRsConsFvAEPgResourceModel) []map[string]interface{} { +func getFvAEPgFvRsConsChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvAEPgResourceModel, fvRsConsFvAEPgPlan, fvRsConsFvAEPgState []FvRsConsFvAEPgResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.FvRsCons.IsUnknown() { + if !data.FvRsCons.IsNull() && !data.FvRsCons.IsUnknown() { fvRsConsIdentifiers := []FvRsConsIdentifier{} - for _, fvRsCons := range fvRsConsPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !fvRsCons.Annotation.IsUnknown() && !fvRsCons.Annotation.IsNull() { - childMap["attributes"]["annotation"] = fvRsCons.Annotation.ValueString() + for _, fvRsConsFvAEPg := range fvRsConsFvAEPgPlan { + FvRsConsFvAEPgChildren := make([]map[string]interface{}, 0) + childMap := NewAciObject() + if !fvRsConsFvAEPg.Annotation.IsNull() && !fvRsConsFvAEPg.Annotation.IsUnknown() { + childMap.Attributes["annotation"] = fvRsConsFvAEPg.Annotation.ValueString() } else { - childMap["attributes"]["annotation"] = globalAnnotation + childMap.Attributes["annotation"] = globalAnnotation + } + if !fvRsConsFvAEPg.Prio.IsNull() && !fvRsConsFvAEPg.Prio.IsUnknown() { + childMap.Attributes["prio"] = fvRsConsFvAEPg.Prio.ValueString() + } + if !fvRsConsFvAEPg.TnVzBrCPName.IsNull() && !fvRsConsFvAEPg.TnVzBrCPName.IsUnknown() { + childMap.Attributes["tnVzBrCPName"] = fvRsConsFvAEPg.TnVzBrCPName.ValueString() + } + + var tagAnnotationFvRsConsFvAEPgPlan, tagAnnotationFvRsConsFvAEPgState []TagAnnotationFvRsConsFvAEPgResourceModel + fvRsConsFvAEPg.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsConsFvAEPgPlan, false) + for _, tagAnnotationFvRsConsFvAEPgstate := range fvRsConsFvAEPgState { + tagAnnotationFvRsConsFvAEPgstate.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsConsFvAEPgState, false) } - if !fvRsCons.Prio.IsUnknown() && !fvRsCons.Prio.IsNull() { - childMap["attributes"]["prio"] = fvRsCons.Prio.ValueString() + if !fvRsConsFvAEPg.TagAnnotation.IsNull() && !fvRsConsFvAEPg.TagAnnotation.IsUnknown() { + tagAnnotationIdentifiers := []TagAnnotationIdentifier{} + for _, tagAnnotationFvRsConsFvAEPg := range tagAnnotationFvRsConsFvAEPgPlan { + tagAnnotationFvRsConsFvAEPgChildMap := NewAciObject() + if !tagAnnotationFvRsConsFvAEPg.Key.IsNull() && !tagAnnotationFvRsConsFvAEPg.Key.IsUnknown() { + tagAnnotationFvRsConsFvAEPgChildMap.Attributes["key"] = tagAnnotationFvRsConsFvAEPg.Key.ValueString() + } + if !tagAnnotationFvRsConsFvAEPg.Value.IsNull() && !tagAnnotationFvRsConsFvAEPg.Value.IsUnknown() { + tagAnnotationFvRsConsFvAEPgChildMap.Attributes["value"] = tagAnnotationFvRsConsFvAEPg.Value.ValueString() + } + FvRsConsFvAEPgChildren = append(FvRsConsFvAEPgChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsConsFvAEPgChildMap}) + tagAnnotationIdentifier := TagAnnotationIdentifier{} + tagAnnotationIdentifier.Key = tagAnnotationFvRsConsFvAEPg.Key + tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) + } + for _, tagAnnotationFvRsConsFvAEPg := range tagAnnotationFvRsConsFvAEPgState { + delete := true + for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { + if tagAnnotationIdentifier.Key == tagAnnotationFvRsConsFvAEPg.Key { + delete = false + break + } + } + if delete { + tagAnnotationFvRsConsFvAEPgChildMapForDelete := NewAciObject() + tagAnnotationFvRsConsFvAEPgChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationFvRsConsFvAEPgChildMapForDelete.Attributes["key"] = tagAnnotationFvRsConsFvAEPg.Key.ValueString() + FvRsConsFvAEPgChildren = append(FvRsConsFvAEPgChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsConsFvAEPgChildMapForDelete}) + } + } + } + + var tagTagFvRsConsFvAEPgPlan, tagTagFvRsConsFvAEPgState []TagTagFvRsConsFvAEPgResourceModel + fvRsConsFvAEPg.TagTag.ElementsAs(ctx, &tagTagFvRsConsFvAEPgPlan, false) + for _, tagTagFvRsConsFvAEPgstate := range fvRsConsFvAEPgState { + tagTagFvRsConsFvAEPgstate.TagTag.ElementsAs(ctx, &tagTagFvRsConsFvAEPgState, false) } - if !fvRsCons.TnVzBrCPName.IsUnknown() && !fvRsCons.TnVzBrCPName.IsNull() { - childMap["attributes"]["tnVzBrCPName"] = fvRsCons.TnVzBrCPName.ValueString() + if !fvRsConsFvAEPg.TagTag.IsNull() && !fvRsConsFvAEPg.TagTag.IsUnknown() { + tagTagIdentifiers := []TagTagIdentifier{} + for _, tagTagFvRsConsFvAEPg := range tagTagFvRsConsFvAEPgPlan { + tagTagFvRsConsFvAEPgChildMap := NewAciObject() + if !tagTagFvRsConsFvAEPg.Key.IsNull() && !tagTagFvRsConsFvAEPg.Key.IsUnknown() { + tagTagFvRsConsFvAEPgChildMap.Attributes["key"] = tagTagFvRsConsFvAEPg.Key.ValueString() + } + if !tagTagFvRsConsFvAEPg.Value.IsNull() && !tagTagFvRsConsFvAEPg.Value.IsUnknown() { + tagTagFvRsConsFvAEPgChildMap.Attributes["value"] = tagTagFvRsConsFvAEPg.Value.ValueString() + } + FvRsConsFvAEPgChildren = append(FvRsConsFvAEPgChildren, map[string]interface{}{"tagTag": tagTagFvRsConsFvAEPgChildMap}) + tagTagIdentifier := TagTagIdentifier{} + tagTagIdentifier.Key = tagTagFvRsConsFvAEPg.Key + tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) + } + for _, tagTagFvRsConsFvAEPg := range tagTagFvRsConsFvAEPgState { + delete := true + for _, tagTagIdentifier := range tagTagIdentifiers { + if tagTagIdentifier.Key == tagTagFvRsConsFvAEPg.Key { + delete = false + break + } + } + if delete { + tagTagFvRsConsFvAEPgChildMapForDelete := NewAciObject() + tagTagFvRsConsFvAEPgChildMapForDelete.Attributes["status"] = "deleted" + tagTagFvRsConsFvAEPgChildMapForDelete.Attributes["key"] = tagTagFvRsConsFvAEPg.Key.ValueString() + FvRsConsFvAEPgChildren = append(FvRsConsFvAEPgChildren, map[string]interface{}{"tagTag": tagTagFvRsConsFvAEPgChildMapForDelete}) + } + } } + childMap.Children = FvRsConsFvAEPgChildren childPayloads = append(childPayloads, map[string]interface{}{"fvRsCons": childMap}) fvRsConsIdentifier := FvRsConsIdentifier{} - fvRsConsIdentifier.TnVzBrCPName = fvRsCons.TnVzBrCPName + fvRsConsIdentifier.TnVzBrCPName = fvRsConsFvAEPg.TnVzBrCPName fvRsConsIdentifiers = append(fvRsConsIdentifiers, fvRsConsIdentifier) } - for _, fvRsCons := range fvRsConsState { + for _, fvRsCons := range fvRsConsFvAEPgState { delete := true for _, fvRsConsIdentifier := range fvRsConsIdentifiers { if fvRsConsIdentifier.TnVzBrCPName == fvRsCons.TnVzBrCPName { @@ -4849,10 +8120,10 @@ func getFvAEPgFvRsConsChildPayloads(ctx context.Context, diags *diag.Diagnostics } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["tnVzBrCPName"] = fvRsCons.TnVzBrCPName.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"fvRsCons": childMap}) + fvRsConsChildMapForDelete := NewAciObject() + fvRsConsChildMapForDelete.Attributes["status"] = "deleted" + fvRsConsChildMapForDelete.Attributes["tnVzBrCPName"] = fvRsCons.TnVzBrCPName.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"fvRsCons": fvRsConsChildMapForDelete}) } } } else { @@ -4861,30 +8132,106 @@ func getFvAEPgFvRsConsChildPayloads(ctx context.Context, diags *diag.Diagnostics return childPayloads } -func getFvAEPgFvRsConsIfChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvAEPgResourceModel, fvRsConsIfPlan, fvRsConsIfState []FvRsConsIfFvAEPgResourceModel) []map[string]interface{} { +func getFvAEPgFvRsConsIfChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvAEPgResourceModel, fvRsConsIfFvAEPgPlan, fvRsConsIfFvAEPgState []FvRsConsIfFvAEPgResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.FvRsConsIf.IsUnknown() { + if !data.FvRsConsIf.IsNull() && !data.FvRsConsIf.IsUnknown() { fvRsConsIfIdentifiers := []FvRsConsIfIdentifier{} - for _, fvRsConsIf := range fvRsConsIfPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !fvRsConsIf.Annotation.IsUnknown() && !fvRsConsIf.Annotation.IsNull() { - childMap["attributes"]["annotation"] = fvRsConsIf.Annotation.ValueString() + for _, fvRsConsIfFvAEPg := range fvRsConsIfFvAEPgPlan { + FvRsConsIfFvAEPgChildren := make([]map[string]interface{}, 0) + childMap := NewAciObject() + if !fvRsConsIfFvAEPg.Annotation.IsNull() && !fvRsConsIfFvAEPg.Annotation.IsUnknown() { + childMap.Attributes["annotation"] = fvRsConsIfFvAEPg.Annotation.ValueString() } else { - childMap["attributes"]["annotation"] = globalAnnotation + childMap.Attributes["annotation"] = globalAnnotation } - if !fvRsConsIf.Prio.IsUnknown() && !fvRsConsIf.Prio.IsNull() { - childMap["attributes"]["prio"] = fvRsConsIf.Prio.ValueString() + if !fvRsConsIfFvAEPg.Prio.IsNull() && !fvRsConsIfFvAEPg.Prio.IsUnknown() { + childMap.Attributes["prio"] = fvRsConsIfFvAEPg.Prio.ValueString() } - if !fvRsConsIf.TnVzCPIfName.IsUnknown() && !fvRsConsIf.TnVzCPIfName.IsNull() { - childMap["attributes"]["tnVzCPIfName"] = fvRsConsIf.TnVzCPIfName.ValueString() + if !fvRsConsIfFvAEPg.TnVzCPIfName.IsNull() && !fvRsConsIfFvAEPg.TnVzCPIfName.IsUnknown() { + childMap.Attributes["tnVzCPIfName"] = fvRsConsIfFvAEPg.TnVzCPIfName.ValueString() + } + + var tagAnnotationFvRsConsIfFvAEPgPlan, tagAnnotationFvRsConsIfFvAEPgState []TagAnnotationFvRsConsIfFvAEPgResourceModel + fvRsConsIfFvAEPg.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsConsIfFvAEPgPlan, false) + for _, tagAnnotationFvRsConsIfFvAEPgstate := range fvRsConsIfFvAEPgState { + tagAnnotationFvRsConsIfFvAEPgstate.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsConsIfFvAEPgState, false) + } + if !fvRsConsIfFvAEPg.TagAnnotation.IsNull() && !fvRsConsIfFvAEPg.TagAnnotation.IsUnknown() { + tagAnnotationIdentifiers := []TagAnnotationIdentifier{} + for _, tagAnnotationFvRsConsIfFvAEPg := range tagAnnotationFvRsConsIfFvAEPgPlan { + tagAnnotationFvRsConsIfFvAEPgChildMap := NewAciObject() + if !tagAnnotationFvRsConsIfFvAEPg.Key.IsNull() && !tagAnnotationFvRsConsIfFvAEPg.Key.IsUnknown() { + tagAnnotationFvRsConsIfFvAEPgChildMap.Attributes["key"] = tagAnnotationFvRsConsIfFvAEPg.Key.ValueString() + } + if !tagAnnotationFvRsConsIfFvAEPg.Value.IsNull() && !tagAnnotationFvRsConsIfFvAEPg.Value.IsUnknown() { + tagAnnotationFvRsConsIfFvAEPgChildMap.Attributes["value"] = tagAnnotationFvRsConsIfFvAEPg.Value.ValueString() + } + FvRsConsIfFvAEPgChildren = append(FvRsConsIfFvAEPgChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsConsIfFvAEPgChildMap}) + tagAnnotationIdentifier := TagAnnotationIdentifier{} + tagAnnotationIdentifier.Key = tagAnnotationFvRsConsIfFvAEPg.Key + tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) + } + for _, tagAnnotationFvRsConsIfFvAEPg := range tagAnnotationFvRsConsIfFvAEPgState { + delete := true + for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { + if tagAnnotationIdentifier.Key == tagAnnotationFvRsConsIfFvAEPg.Key { + delete = false + break + } + } + if delete { + tagAnnotationFvRsConsIfFvAEPgChildMapForDelete := NewAciObject() + tagAnnotationFvRsConsIfFvAEPgChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationFvRsConsIfFvAEPgChildMapForDelete.Attributes["key"] = tagAnnotationFvRsConsIfFvAEPg.Key.ValueString() + FvRsConsIfFvAEPgChildren = append(FvRsConsIfFvAEPgChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsConsIfFvAEPgChildMapForDelete}) + } + } + } + + var tagTagFvRsConsIfFvAEPgPlan, tagTagFvRsConsIfFvAEPgState []TagTagFvRsConsIfFvAEPgResourceModel + fvRsConsIfFvAEPg.TagTag.ElementsAs(ctx, &tagTagFvRsConsIfFvAEPgPlan, false) + for _, tagTagFvRsConsIfFvAEPgstate := range fvRsConsIfFvAEPgState { + tagTagFvRsConsIfFvAEPgstate.TagTag.ElementsAs(ctx, &tagTagFvRsConsIfFvAEPgState, false) + } + if !fvRsConsIfFvAEPg.TagTag.IsNull() && !fvRsConsIfFvAEPg.TagTag.IsUnknown() { + tagTagIdentifiers := []TagTagIdentifier{} + for _, tagTagFvRsConsIfFvAEPg := range tagTagFvRsConsIfFvAEPgPlan { + tagTagFvRsConsIfFvAEPgChildMap := NewAciObject() + if !tagTagFvRsConsIfFvAEPg.Key.IsNull() && !tagTagFvRsConsIfFvAEPg.Key.IsUnknown() { + tagTagFvRsConsIfFvAEPgChildMap.Attributes["key"] = tagTagFvRsConsIfFvAEPg.Key.ValueString() + } + if !tagTagFvRsConsIfFvAEPg.Value.IsNull() && !tagTagFvRsConsIfFvAEPg.Value.IsUnknown() { + tagTagFvRsConsIfFvAEPgChildMap.Attributes["value"] = tagTagFvRsConsIfFvAEPg.Value.ValueString() + } + FvRsConsIfFvAEPgChildren = append(FvRsConsIfFvAEPgChildren, map[string]interface{}{"tagTag": tagTagFvRsConsIfFvAEPgChildMap}) + tagTagIdentifier := TagTagIdentifier{} + tagTagIdentifier.Key = tagTagFvRsConsIfFvAEPg.Key + tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) + } + for _, tagTagFvRsConsIfFvAEPg := range tagTagFvRsConsIfFvAEPgState { + delete := true + for _, tagTagIdentifier := range tagTagIdentifiers { + if tagTagIdentifier.Key == tagTagFvRsConsIfFvAEPg.Key { + delete = false + break + } + } + if delete { + tagTagFvRsConsIfFvAEPgChildMapForDelete := NewAciObject() + tagTagFvRsConsIfFvAEPgChildMapForDelete.Attributes["status"] = "deleted" + tagTagFvRsConsIfFvAEPgChildMapForDelete.Attributes["key"] = tagTagFvRsConsIfFvAEPg.Key.ValueString() + FvRsConsIfFvAEPgChildren = append(FvRsConsIfFvAEPgChildren, map[string]interface{}{"tagTag": tagTagFvRsConsIfFvAEPgChildMapForDelete}) + } + } } + childMap.Children = FvRsConsIfFvAEPgChildren childPayloads = append(childPayloads, map[string]interface{}{"fvRsConsIf": childMap}) fvRsConsIfIdentifier := FvRsConsIfIdentifier{} - fvRsConsIfIdentifier.TnVzCPIfName = fvRsConsIf.TnVzCPIfName + fvRsConsIfIdentifier.TnVzCPIfName = fvRsConsIfFvAEPg.TnVzCPIfName fvRsConsIfIdentifiers = append(fvRsConsIfIdentifiers, fvRsConsIfIdentifier) } - for _, fvRsConsIf := range fvRsConsIfState { + for _, fvRsConsIf := range fvRsConsIfFvAEPgState { delete := true for _, fvRsConsIfIdentifier := range fvRsConsIfIdentifiers { if fvRsConsIfIdentifier.TnVzCPIfName == fvRsConsIf.TnVzCPIfName { @@ -4893,10 +8240,10 @@ func getFvAEPgFvRsConsIfChildPayloads(ctx context.Context, diags *diag.Diagnosti } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["tnVzCPIfName"] = fvRsConsIf.TnVzCPIfName.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"fvRsConsIf": childMap}) + fvRsConsIfChildMapForDelete := NewAciObject() + fvRsConsIfChildMapForDelete.Attributes["status"] = "deleted" + fvRsConsIfChildMapForDelete.Attributes["tnVzCPIfName"] = fvRsConsIf.TnVzCPIfName.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"fvRsConsIf": fvRsConsIfChildMapForDelete}) } } } else { @@ -4905,21 +8252,97 @@ func getFvAEPgFvRsConsIfChildPayloads(ctx context.Context, diags *diag.Diagnosti return childPayloads } -func getFvAEPgFvRsCustQosPolChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvAEPgResourceModel, fvRsCustQosPolPlan, fvRsCustQosPolState FvRsCustQosPolFvAEPgResourceModel) []map[string]interface{} { +func getFvAEPgFvRsCustQosPolChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvAEPgResourceModel, fvRsCustQosPolFvAEPgPlan, fvRsCustQosPolFvAEPgState FvRsCustQosPolFvAEPgResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.FvRsCustQosPol.IsUnknown() { - childMap := map[string]map[string]interface{}{"attributes": {}} + if !data.FvRsCustQosPol.IsNull() && !data.FvRsCustQosPol.IsUnknown() { + FvRsCustQosPolFvAEPgChildren := make([]map[string]interface{}, 0) + childMap := NewAciObject() if !IsEmptySingleNestedAttribute(data.FvRsCustQosPol.Attributes()) { - if !fvRsCustQosPolPlan.Annotation.IsUnknown() && !fvRsCustQosPolPlan.Annotation.IsNull() { - childMap["attributes"]["annotation"] = fvRsCustQosPolPlan.Annotation.ValueString() + if !fvRsCustQosPolFvAEPgPlan.Annotation.IsUnknown() && !fvRsCustQosPolFvAEPgPlan.Annotation.IsNull() { + childMap.Attributes["annotation"] = fvRsCustQosPolFvAEPgPlan.Annotation.ValueString() } else { - childMap["attributes"]["annotation"] = globalAnnotation + childMap.Attributes["annotation"] = globalAnnotation + } + if !fvRsCustQosPolFvAEPgPlan.TnQosCustomPolName.IsUnknown() && !fvRsCustQosPolFvAEPgPlan.TnQosCustomPolName.IsNull() { + childMap.Attributes["tnQosCustomPolName"] = fvRsCustQosPolFvAEPgPlan.TnQosCustomPolName.ValueString() + } + } + + var tagAnnotationFvRsCustQosPolFvAEPgPlan, tagAnnotationFvRsCustQosPolFvAEPgState []TagAnnotationFvRsCustQosPolFvAEPgResourceModel + fvRsCustQosPolFvAEPgPlan.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsCustQosPolFvAEPgPlan, false) + if !fvRsCustQosPolFvAEPgState.TagAnnotation.IsNull() { + fvRsCustQosPolFvAEPgState.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsCustQosPolFvAEPgState, false) + } + if !fvRsCustQosPolFvAEPgPlan.TagAnnotation.IsNull() && !fvRsCustQosPolFvAEPgPlan.TagAnnotation.IsUnknown() { + tagAnnotationIdentifiers := []TagAnnotationIdentifier{} + for _, tagAnnotationFvRsCustQosPolFvAEPg := range tagAnnotationFvRsCustQosPolFvAEPgPlan { + tagAnnotationFvRsCustQosPolFvAEPgChildMap := NewAciObject() + if !tagAnnotationFvRsCustQosPolFvAEPg.Key.IsNull() && !tagAnnotationFvRsCustQosPolFvAEPg.Key.IsUnknown() { + tagAnnotationFvRsCustQosPolFvAEPgChildMap.Attributes["key"] = tagAnnotationFvRsCustQosPolFvAEPg.Key.ValueString() + } + if !tagAnnotationFvRsCustQosPolFvAEPg.Value.IsNull() && !tagAnnotationFvRsCustQosPolFvAEPg.Value.IsUnknown() { + tagAnnotationFvRsCustQosPolFvAEPgChildMap.Attributes["value"] = tagAnnotationFvRsCustQosPolFvAEPg.Value.ValueString() + } + FvRsCustQosPolFvAEPgChildren = append(FvRsCustQosPolFvAEPgChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsCustQosPolFvAEPgChildMap}) + tagAnnotationIdentifier := TagAnnotationIdentifier{} + tagAnnotationIdentifier.Key = tagAnnotationFvRsCustQosPolFvAEPg.Key + tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) + } + for _, tagAnnotationFvRsCustQosPolFvAEPg := range tagAnnotationFvRsCustQosPolFvAEPgState { + delete := true + for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { + if tagAnnotationIdentifier.Key == tagAnnotationFvRsCustQosPolFvAEPg.Key { + delete = false + break + } + } + if delete { + tagAnnotationFvRsCustQosPolFvAEPgChildMapForDelete := NewAciObject() + tagAnnotationFvRsCustQosPolFvAEPgChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationFvRsCustQosPolFvAEPgChildMapForDelete.Attributes["key"] = tagAnnotationFvRsCustQosPolFvAEPg.Key.ValueString() + FvRsCustQosPolFvAEPgChildren = append(FvRsCustQosPolFvAEPgChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsCustQosPolFvAEPgChildMapForDelete}) + } } - if !fvRsCustQosPolPlan.TnQosCustomPolName.IsUnknown() && !fvRsCustQosPolPlan.TnQosCustomPolName.IsNull() { - childMap["attributes"]["tnQosCustomPolName"] = fvRsCustQosPolPlan.TnQosCustomPolName.ValueString() + } + + var tagTagFvRsCustQosPolFvAEPgPlan, tagTagFvRsCustQosPolFvAEPgState []TagTagFvRsCustQosPolFvAEPgResourceModel + fvRsCustQosPolFvAEPgPlan.TagTag.ElementsAs(ctx, &tagTagFvRsCustQosPolFvAEPgPlan, false) + if !fvRsCustQosPolFvAEPgState.TagTag.IsNull() { + fvRsCustQosPolFvAEPgState.TagTag.ElementsAs(ctx, &tagTagFvRsCustQosPolFvAEPgState, false) + } + if !fvRsCustQosPolFvAEPgPlan.TagTag.IsNull() && !fvRsCustQosPolFvAEPgPlan.TagTag.IsUnknown() { + tagTagIdentifiers := []TagTagIdentifier{} + for _, tagTagFvRsCustQosPolFvAEPg := range tagTagFvRsCustQosPolFvAEPgPlan { + tagTagFvRsCustQosPolFvAEPgChildMap := NewAciObject() + if !tagTagFvRsCustQosPolFvAEPg.Key.IsNull() && !tagTagFvRsCustQosPolFvAEPg.Key.IsUnknown() { + tagTagFvRsCustQosPolFvAEPgChildMap.Attributes["key"] = tagTagFvRsCustQosPolFvAEPg.Key.ValueString() + } + if !tagTagFvRsCustQosPolFvAEPg.Value.IsNull() && !tagTagFvRsCustQosPolFvAEPg.Value.IsUnknown() { + tagTagFvRsCustQosPolFvAEPgChildMap.Attributes["value"] = tagTagFvRsCustQosPolFvAEPg.Value.ValueString() + } + FvRsCustQosPolFvAEPgChildren = append(FvRsCustQosPolFvAEPgChildren, map[string]interface{}{"tagTag": tagTagFvRsCustQosPolFvAEPgChildMap}) + tagTagIdentifier := TagTagIdentifier{} + tagTagIdentifier.Key = tagTagFvRsCustQosPolFvAEPg.Key + tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) + } + for _, tagTagFvRsCustQosPolFvAEPg := range tagTagFvRsCustQosPolFvAEPgState { + delete := true + for _, tagTagIdentifier := range tagTagIdentifiers { + if tagTagIdentifier.Key == tagTagFvRsCustQosPolFvAEPg.Key { + delete = false + break + } + } + if delete { + tagTagFvRsCustQosPolFvAEPgChildMapForDelete := NewAciObject() + tagTagFvRsCustQosPolFvAEPgChildMapForDelete.Attributes["status"] = "deleted" + tagTagFvRsCustQosPolFvAEPgChildMapForDelete.Attributes["key"] = tagTagFvRsCustQosPolFvAEPg.Key.ValueString() + FvRsCustQosPolFvAEPgChildren = append(FvRsCustQosPolFvAEPgChildren, map[string]interface{}{"tagTag": tagTagFvRsCustQosPolFvAEPgChildMapForDelete}) + } } } + childMap.Children = FvRsCustQosPolFvAEPgChildren childPayloads = append(childPayloads, map[string]interface{}{"fvRsCustQosPol": childMap}) } else { FvRsCustQosPolObject, _ := types.ObjectValueFrom(ctx, FvRsCustQosPolFvAEPgType, getEmptyFvRsCustQosPolFvAEPgResourceModel()) @@ -4928,96 +8351,172 @@ func getFvAEPgFvRsCustQosPolChildPayloads(ctx context.Context, diags *diag.Diagn return childPayloads } -func getFvAEPgFvRsDomAttChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvAEPgResourceModel, fvRsDomAttPlan, fvRsDomAttState []FvRsDomAttFvAEPgResourceModel) []map[string]interface{} { +func getFvAEPgFvRsDomAttChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvAEPgResourceModel, fvRsDomAttFvAEPgPlan, fvRsDomAttFvAEPgState []FvRsDomAttFvAEPgResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.FvRsDomAtt.IsUnknown() { + if !data.FvRsDomAtt.IsNull() && !data.FvRsDomAtt.IsUnknown() { fvRsDomAttIdentifiers := []FvRsDomAttIdentifier{} - for _, fvRsDomAtt := range fvRsDomAttPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !fvRsDomAtt.Annotation.IsUnknown() && !fvRsDomAtt.Annotation.IsNull() { - childMap["attributes"]["annotation"] = fvRsDomAtt.Annotation.ValueString() + for _, fvRsDomAttFvAEPg := range fvRsDomAttFvAEPgPlan { + FvRsDomAttFvAEPgChildren := make([]map[string]interface{}, 0) + childMap := NewAciObject() + if !fvRsDomAttFvAEPg.Annotation.IsNull() && !fvRsDomAttFvAEPg.Annotation.IsUnknown() { + childMap.Attributes["annotation"] = fvRsDomAttFvAEPg.Annotation.ValueString() } else { - childMap["attributes"]["annotation"] = globalAnnotation + childMap.Attributes["annotation"] = globalAnnotation } - if !fvRsDomAtt.BindingType.IsUnknown() && !fvRsDomAtt.BindingType.IsNull() { - childMap["attributes"]["bindingType"] = fvRsDomAtt.BindingType.ValueString() + if !fvRsDomAttFvAEPg.BindingType.IsNull() && !fvRsDomAttFvAEPg.BindingType.IsUnknown() { + childMap.Attributes["bindingType"] = fvRsDomAttFvAEPg.BindingType.ValueString() } - if !fvRsDomAtt.ClassPref.IsUnknown() && !fvRsDomAtt.ClassPref.IsNull() { - childMap["attributes"]["classPref"] = fvRsDomAtt.ClassPref.ValueString() + if !fvRsDomAttFvAEPg.ClassPref.IsNull() && !fvRsDomAttFvAEPg.ClassPref.IsUnknown() { + childMap.Attributes["classPref"] = fvRsDomAttFvAEPg.ClassPref.ValueString() } - if !fvRsDomAtt.CustomEpgName.IsUnknown() && !fvRsDomAtt.CustomEpgName.IsNull() { - childMap["attributes"]["customEpgName"] = fvRsDomAtt.CustomEpgName.ValueString() + if !fvRsDomAttFvAEPg.CustomEpgName.IsNull() && !fvRsDomAttFvAEPg.CustomEpgName.IsUnknown() { + childMap.Attributes["customEpgName"] = fvRsDomAttFvAEPg.CustomEpgName.ValueString() } - if !fvRsDomAtt.Delimiter.IsUnknown() && !fvRsDomAtt.Delimiter.IsNull() { - childMap["attributes"]["delimiter"] = fvRsDomAtt.Delimiter.ValueString() + if !fvRsDomAttFvAEPg.Delimiter.IsNull() && !fvRsDomAttFvAEPg.Delimiter.IsUnknown() { + childMap.Attributes["delimiter"] = fvRsDomAttFvAEPg.Delimiter.ValueString() } - if !fvRsDomAtt.Encap.IsUnknown() && !fvRsDomAtt.Encap.IsNull() { - childMap["attributes"]["encap"] = fvRsDomAtt.Encap.ValueString() + if !fvRsDomAttFvAEPg.Encap.IsNull() && !fvRsDomAttFvAEPg.Encap.IsUnknown() { + childMap.Attributes["encap"] = fvRsDomAttFvAEPg.Encap.ValueString() } - if !fvRsDomAtt.EncapMode.IsUnknown() && !fvRsDomAtt.EncapMode.IsNull() { - childMap["attributes"]["encapMode"] = fvRsDomAtt.EncapMode.ValueString() + if !fvRsDomAttFvAEPg.EncapMode.IsNull() && !fvRsDomAttFvAEPg.EncapMode.IsUnknown() { + childMap.Attributes["encapMode"] = fvRsDomAttFvAEPg.EncapMode.ValueString() } - if !fvRsDomAtt.EpgCos.IsUnknown() && !fvRsDomAtt.EpgCos.IsNull() { - childMap["attributes"]["epgCos"] = fvRsDomAtt.EpgCos.ValueString() + if !fvRsDomAttFvAEPg.EpgCos.IsNull() && !fvRsDomAttFvAEPg.EpgCos.IsUnknown() { + childMap.Attributes["epgCos"] = fvRsDomAttFvAEPg.EpgCos.ValueString() } - if !fvRsDomAtt.EpgCosPref.IsUnknown() && !fvRsDomAtt.EpgCosPref.IsNull() { - childMap["attributes"]["epgCosPref"] = fvRsDomAtt.EpgCosPref.ValueString() + if !fvRsDomAttFvAEPg.EpgCosPref.IsNull() && !fvRsDomAttFvAEPg.EpgCosPref.IsUnknown() { + childMap.Attributes["epgCosPref"] = fvRsDomAttFvAEPg.EpgCosPref.ValueString() } - if !fvRsDomAtt.InstrImedcy.IsUnknown() && !fvRsDomAtt.InstrImedcy.IsNull() { - childMap["attributes"]["instrImedcy"] = fvRsDomAtt.InstrImedcy.ValueString() + if !fvRsDomAttFvAEPg.InstrImedcy.IsNull() && !fvRsDomAttFvAEPg.InstrImedcy.IsUnknown() { + childMap.Attributes["instrImedcy"] = fvRsDomAttFvAEPg.InstrImedcy.ValueString() } - if !fvRsDomAtt.IpamDhcpOverride.IsUnknown() && !fvRsDomAtt.IpamDhcpOverride.IsNull() { - childMap["attributes"]["ipamDhcpOverride"] = fvRsDomAtt.IpamDhcpOverride.ValueString() + if !fvRsDomAttFvAEPg.IpamDhcpOverride.IsNull() && !fvRsDomAttFvAEPg.IpamDhcpOverride.IsUnknown() { + childMap.Attributes["ipamDhcpOverride"] = fvRsDomAttFvAEPg.IpamDhcpOverride.ValueString() } - if !fvRsDomAtt.IpamEnabled.IsUnknown() && !fvRsDomAtt.IpamEnabled.IsNull() { - childMap["attributes"]["ipamEnabled"] = fvRsDomAtt.IpamEnabled.ValueString() + if !fvRsDomAttFvAEPg.IpamEnabled.IsNull() && !fvRsDomAttFvAEPg.IpamEnabled.IsUnknown() { + childMap.Attributes["ipamEnabled"] = fvRsDomAttFvAEPg.IpamEnabled.ValueString() } - if !fvRsDomAtt.IpamGateway.IsUnknown() && !fvRsDomAtt.IpamGateway.IsNull() { - childMap["attributes"]["ipamGateway"] = fvRsDomAtt.IpamGateway.ValueString() + if !fvRsDomAttFvAEPg.IpamGateway.IsNull() && !fvRsDomAttFvAEPg.IpamGateway.IsUnknown() { + childMap.Attributes["ipamGateway"] = fvRsDomAttFvAEPg.IpamGateway.ValueString() } - if !fvRsDomAtt.LagPolicyName.IsUnknown() && !fvRsDomAtt.LagPolicyName.IsNull() { - childMap["attributes"]["lagPolicyName"] = fvRsDomAtt.LagPolicyName.ValueString() + if !fvRsDomAttFvAEPg.LagPolicyName.IsNull() && !fvRsDomAttFvAEPg.LagPolicyName.IsUnknown() { + childMap.Attributes["lagPolicyName"] = fvRsDomAttFvAEPg.LagPolicyName.ValueString() } - if !fvRsDomAtt.NetflowDir.IsUnknown() && !fvRsDomAtt.NetflowDir.IsNull() { - childMap["attributes"]["netflowDir"] = fvRsDomAtt.NetflowDir.ValueString() + if !fvRsDomAttFvAEPg.NetflowDir.IsNull() && !fvRsDomAttFvAEPg.NetflowDir.IsUnknown() { + childMap.Attributes["netflowDir"] = fvRsDomAttFvAEPg.NetflowDir.ValueString() } - if !fvRsDomAtt.NetflowPref.IsUnknown() && !fvRsDomAtt.NetflowPref.IsNull() { - childMap["attributes"]["netflowPref"] = fvRsDomAtt.NetflowPref.ValueString() + if !fvRsDomAttFvAEPg.NetflowPref.IsNull() && !fvRsDomAttFvAEPg.NetflowPref.IsUnknown() { + childMap.Attributes["netflowPref"] = fvRsDomAttFvAEPg.NetflowPref.ValueString() } - if !fvRsDomAtt.NumPorts.IsUnknown() && !fvRsDomAtt.NumPorts.IsNull() { - childMap["attributes"]["numPorts"] = fvRsDomAtt.NumPorts.ValueString() + if !fvRsDomAttFvAEPg.NumPorts.IsNull() && !fvRsDomAttFvAEPg.NumPorts.IsUnknown() { + childMap.Attributes["numPorts"] = fvRsDomAttFvAEPg.NumPorts.ValueString() } - if !fvRsDomAtt.PortAllocation.IsUnknown() && !fvRsDomAtt.PortAllocation.IsNull() { - childMap["attributes"]["portAllocation"] = fvRsDomAtt.PortAllocation.ValueString() + if !fvRsDomAttFvAEPg.PortAllocation.IsNull() && !fvRsDomAttFvAEPg.PortAllocation.IsUnknown() { + childMap.Attributes["portAllocation"] = fvRsDomAttFvAEPg.PortAllocation.ValueString() } - if !fvRsDomAtt.PrimaryEncap.IsUnknown() && !fvRsDomAtt.PrimaryEncap.IsNull() { - childMap["attributes"]["primaryEncap"] = fvRsDomAtt.PrimaryEncap.ValueString() + if !fvRsDomAttFvAEPg.PrimaryEncap.IsNull() && !fvRsDomAttFvAEPg.PrimaryEncap.IsUnknown() { + childMap.Attributes["primaryEncap"] = fvRsDomAttFvAEPg.PrimaryEncap.ValueString() } - if !fvRsDomAtt.PrimaryEncapInner.IsUnknown() && !fvRsDomAtt.PrimaryEncapInner.IsNull() { - childMap["attributes"]["primaryEncapInner"] = fvRsDomAtt.PrimaryEncapInner.ValueString() + if !fvRsDomAttFvAEPg.PrimaryEncapInner.IsNull() && !fvRsDomAttFvAEPg.PrimaryEncapInner.IsUnknown() { + childMap.Attributes["primaryEncapInner"] = fvRsDomAttFvAEPg.PrimaryEncapInner.ValueString() } - if !fvRsDomAtt.ResImedcy.IsUnknown() && !fvRsDomAtt.ResImedcy.IsNull() { - childMap["attributes"]["resImedcy"] = fvRsDomAtt.ResImedcy.ValueString() + if !fvRsDomAttFvAEPg.ResImedcy.IsNull() && !fvRsDomAttFvAEPg.ResImedcy.IsUnknown() { + childMap.Attributes["resImedcy"] = fvRsDomAttFvAEPg.ResImedcy.ValueString() } - if !fvRsDomAtt.SecondaryEncapInner.IsUnknown() && !fvRsDomAtt.SecondaryEncapInner.IsNull() { - childMap["attributes"]["secondaryEncapInner"] = fvRsDomAtt.SecondaryEncapInner.ValueString() + if !fvRsDomAttFvAEPg.SecondaryEncapInner.IsNull() && !fvRsDomAttFvAEPg.SecondaryEncapInner.IsUnknown() { + childMap.Attributes["secondaryEncapInner"] = fvRsDomAttFvAEPg.SecondaryEncapInner.ValueString() } - if !fvRsDomAtt.SwitchingMode.IsUnknown() && !fvRsDomAtt.SwitchingMode.IsNull() { - childMap["attributes"]["switchingMode"] = fvRsDomAtt.SwitchingMode.ValueString() + if !fvRsDomAttFvAEPg.SwitchingMode.IsNull() && !fvRsDomAttFvAEPg.SwitchingMode.IsUnknown() { + childMap.Attributes["switchingMode"] = fvRsDomAttFvAEPg.SwitchingMode.ValueString() + } + if !fvRsDomAttFvAEPg.TDn.IsNull() && !fvRsDomAttFvAEPg.TDn.IsUnknown() { + childMap.Attributes["tDn"] = fvRsDomAttFvAEPg.TDn.ValueString() + } + if !fvRsDomAttFvAEPg.Untagged.IsNull() && !fvRsDomAttFvAEPg.Untagged.IsUnknown() { + childMap.Attributes["untagged"] = fvRsDomAttFvAEPg.Untagged.ValueString() + } + + var tagAnnotationFvRsDomAttFvAEPgPlan, tagAnnotationFvRsDomAttFvAEPgState []TagAnnotationFvRsDomAttFvAEPgResourceModel + fvRsDomAttFvAEPg.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsDomAttFvAEPgPlan, false) + for _, tagAnnotationFvRsDomAttFvAEPgstate := range fvRsDomAttFvAEPgState { + tagAnnotationFvRsDomAttFvAEPgstate.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsDomAttFvAEPgState, false) + } + if !fvRsDomAttFvAEPg.TagAnnotation.IsNull() && !fvRsDomAttFvAEPg.TagAnnotation.IsUnknown() { + tagAnnotationIdentifiers := []TagAnnotationIdentifier{} + for _, tagAnnotationFvRsDomAttFvAEPg := range tagAnnotationFvRsDomAttFvAEPgPlan { + tagAnnotationFvRsDomAttFvAEPgChildMap := NewAciObject() + if !tagAnnotationFvRsDomAttFvAEPg.Key.IsNull() && !tagAnnotationFvRsDomAttFvAEPg.Key.IsUnknown() { + tagAnnotationFvRsDomAttFvAEPgChildMap.Attributes["key"] = tagAnnotationFvRsDomAttFvAEPg.Key.ValueString() + } + if !tagAnnotationFvRsDomAttFvAEPg.Value.IsNull() && !tagAnnotationFvRsDomAttFvAEPg.Value.IsUnknown() { + tagAnnotationFvRsDomAttFvAEPgChildMap.Attributes["value"] = tagAnnotationFvRsDomAttFvAEPg.Value.ValueString() + } + FvRsDomAttFvAEPgChildren = append(FvRsDomAttFvAEPgChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsDomAttFvAEPgChildMap}) + tagAnnotationIdentifier := TagAnnotationIdentifier{} + tagAnnotationIdentifier.Key = tagAnnotationFvRsDomAttFvAEPg.Key + tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) + } + for _, tagAnnotationFvRsDomAttFvAEPg := range tagAnnotationFvRsDomAttFvAEPgState { + delete := true + for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { + if tagAnnotationIdentifier.Key == tagAnnotationFvRsDomAttFvAEPg.Key { + delete = false + break + } + } + if delete { + tagAnnotationFvRsDomAttFvAEPgChildMapForDelete := NewAciObject() + tagAnnotationFvRsDomAttFvAEPgChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationFvRsDomAttFvAEPgChildMapForDelete.Attributes["key"] = tagAnnotationFvRsDomAttFvAEPg.Key.ValueString() + FvRsDomAttFvAEPgChildren = append(FvRsDomAttFvAEPgChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsDomAttFvAEPgChildMapForDelete}) + } + } } - if !fvRsDomAtt.TDn.IsUnknown() && !fvRsDomAtt.TDn.IsNull() { - childMap["attributes"]["tDn"] = fvRsDomAtt.TDn.ValueString() + + var tagTagFvRsDomAttFvAEPgPlan, tagTagFvRsDomAttFvAEPgState []TagTagFvRsDomAttFvAEPgResourceModel + fvRsDomAttFvAEPg.TagTag.ElementsAs(ctx, &tagTagFvRsDomAttFvAEPgPlan, false) + for _, tagTagFvRsDomAttFvAEPgstate := range fvRsDomAttFvAEPgState { + tagTagFvRsDomAttFvAEPgstate.TagTag.ElementsAs(ctx, &tagTagFvRsDomAttFvAEPgState, false) } - if !fvRsDomAtt.Untagged.IsUnknown() && !fvRsDomAtt.Untagged.IsNull() { - childMap["attributes"]["untagged"] = fvRsDomAtt.Untagged.ValueString() + if !fvRsDomAttFvAEPg.TagTag.IsNull() && !fvRsDomAttFvAEPg.TagTag.IsUnknown() { + tagTagIdentifiers := []TagTagIdentifier{} + for _, tagTagFvRsDomAttFvAEPg := range tagTagFvRsDomAttFvAEPgPlan { + tagTagFvRsDomAttFvAEPgChildMap := NewAciObject() + if !tagTagFvRsDomAttFvAEPg.Key.IsNull() && !tagTagFvRsDomAttFvAEPg.Key.IsUnknown() { + tagTagFvRsDomAttFvAEPgChildMap.Attributes["key"] = tagTagFvRsDomAttFvAEPg.Key.ValueString() + } + if !tagTagFvRsDomAttFvAEPg.Value.IsNull() && !tagTagFvRsDomAttFvAEPg.Value.IsUnknown() { + tagTagFvRsDomAttFvAEPgChildMap.Attributes["value"] = tagTagFvRsDomAttFvAEPg.Value.ValueString() + } + FvRsDomAttFvAEPgChildren = append(FvRsDomAttFvAEPgChildren, map[string]interface{}{"tagTag": tagTagFvRsDomAttFvAEPgChildMap}) + tagTagIdentifier := TagTagIdentifier{} + tagTagIdentifier.Key = tagTagFvRsDomAttFvAEPg.Key + tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) + } + for _, tagTagFvRsDomAttFvAEPg := range tagTagFvRsDomAttFvAEPgState { + delete := true + for _, tagTagIdentifier := range tagTagIdentifiers { + if tagTagIdentifier.Key == tagTagFvRsDomAttFvAEPg.Key { + delete = false + break + } + } + if delete { + tagTagFvRsDomAttFvAEPgChildMapForDelete := NewAciObject() + tagTagFvRsDomAttFvAEPgChildMapForDelete.Attributes["status"] = "deleted" + tagTagFvRsDomAttFvAEPgChildMapForDelete.Attributes["key"] = tagTagFvRsDomAttFvAEPg.Key.ValueString() + FvRsDomAttFvAEPgChildren = append(FvRsDomAttFvAEPgChildren, map[string]interface{}{"tagTag": tagTagFvRsDomAttFvAEPgChildMapForDelete}) + } + } } + childMap.Children = FvRsDomAttFvAEPgChildren childPayloads = append(childPayloads, map[string]interface{}{"fvRsDomAtt": childMap}) fvRsDomAttIdentifier := FvRsDomAttIdentifier{} - fvRsDomAttIdentifier.TDn = fvRsDomAtt.TDn + fvRsDomAttIdentifier.TDn = fvRsDomAttFvAEPg.TDn fvRsDomAttIdentifiers = append(fvRsDomAttIdentifiers, fvRsDomAttIdentifier) } - for _, fvRsDomAtt := range fvRsDomAttState { + for _, fvRsDomAtt := range fvRsDomAttFvAEPgState { delete := true for _, fvRsDomAttIdentifier := range fvRsDomAttIdentifiers { if fvRsDomAttIdentifier.TDn == fvRsDomAtt.TDn { @@ -5026,10 +8525,10 @@ func getFvAEPgFvRsDomAttChildPayloads(ctx context.Context, diags *diag.Diagnosti } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["tDn"] = fvRsDomAtt.TDn.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"fvRsDomAtt": childMap}) + fvRsDomAttChildMapForDelete := NewAciObject() + fvRsDomAttChildMapForDelete.Attributes["status"] = "deleted" + fvRsDomAttChildMapForDelete.Attributes["tDn"] = fvRsDomAtt.TDn.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"fvRsDomAtt": fvRsDomAttChildMapForDelete}) } } } else { @@ -5038,23 +8537,99 @@ func getFvAEPgFvRsDomAttChildPayloads(ctx context.Context, diags *diag.Diagnosti return childPayloads } -func getFvAEPgFvRsDppPolChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvAEPgResourceModel, fvRsDppPolPlan, fvRsDppPolState FvRsDppPolFvAEPgResourceModel) []map[string]interface{} { +func getFvAEPgFvRsDppPolChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvAEPgResourceModel, fvRsDppPolFvAEPgPlan, fvRsDppPolFvAEPgState FvRsDppPolFvAEPgResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.FvRsDppPol.IsUnknown() { - childMap := map[string]map[string]interface{}{"attributes": {}} + if !data.FvRsDppPol.IsNull() && !data.FvRsDppPol.IsUnknown() { + FvRsDppPolFvAEPgChildren := make([]map[string]interface{}, 0) + childMap := NewAciObject() if !IsEmptySingleNestedAttribute(data.FvRsDppPol.Attributes()) { - if !fvRsDppPolPlan.Annotation.IsUnknown() && !fvRsDppPolPlan.Annotation.IsNull() { - childMap["attributes"]["annotation"] = fvRsDppPolPlan.Annotation.ValueString() + if !fvRsDppPolFvAEPgPlan.Annotation.IsUnknown() && !fvRsDppPolFvAEPgPlan.Annotation.IsNull() { + childMap.Attributes["annotation"] = fvRsDppPolFvAEPgPlan.Annotation.ValueString() } else { - childMap["attributes"]["annotation"] = globalAnnotation + childMap.Attributes["annotation"] = globalAnnotation } - if !fvRsDppPolPlan.TnQosDppPolName.IsUnknown() && !fvRsDppPolPlan.TnQosDppPolName.IsNull() { - childMap["attributes"]["tnQosDppPolName"] = fvRsDppPolPlan.TnQosDppPolName.ValueString() + if !fvRsDppPolFvAEPgPlan.TnQosDppPolName.IsUnknown() && !fvRsDppPolFvAEPgPlan.TnQosDppPolName.IsNull() { + childMap.Attributes["tnQosDppPolName"] = fvRsDppPolFvAEPgPlan.TnQosDppPolName.ValueString() } } else { - childMap["attributes"]["status"] = "deleted" + childMap.Attributes["status"] = "deleted" + } + + var tagAnnotationFvRsDppPolFvAEPgPlan, tagAnnotationFvRsDppPolFvAEPgState []TagAnnotationFvRsDppPolFvAEPgResourceModel + fvRsDppPolFvAEPgPlan.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsDppPolFvAEPgPlan, false) + if !fvRsDppPolFvAEPgState.TagAnnotation.IsNull() { + fvRsDppPolFvAEPgState.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsDppPolFvAEPgState, false) + } + if !fvRsDppPolFvAEPgPlan.TagAnnotation.IsNull() && !fvRsDppPolFvAEPgPlan.TagAnnotation.IsUnknown() { + tagAnnotationIdentifiers := []TagAnnotationIdentifier{} + for _, tagAnnotationFvRsDppPolFvAEPg := range tagAnnotationFvRsDppPolFvAEPgPlan { + tagAnnotationFvRsDppPolFvAEPgChildMap := NewAciObject() + if !tagAnnotationFvRsDppPolFvAEPg.Key.IsNull() && !tagAnnotationFvRsDppPolFvAEPg.Key.IsUnknown() { + tagAnnotationFvRsDppPolFvAEPgChildMap.Attributes["key"] = tagAnnotationFvRsDppPolFvAEPg.Key.ValueString() + } + if !tagAnnotationFvRsDppPolFvAEPg.Value.IsNull() && !tagAnnotationFvRsDppPolFvAEPg.Value.IsUnknown() { + tagAnnotationFvRsDppPolFvAEPgChildMap.Attributes["value"] = tagAnnotationFvRsDppPolFvAEPg.Value.ValueString() + } + FvRsDppPolFvAEPgChildren = append(FvRsDppPolFvAEPgChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsDppPolFvAEPgChildMap}) + tagAnnotationIdentifier := TagAnnotationIdentifier{} + tagAnnotationIdentifier.Key = tagAnnotationFvRsDppPolFvAEPg.Key + tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) + } + for _, tagAnnotationFvRsDppPolFvAEPg := range tagAnnotationFvRsDppPolFvAEPgState { + delete := true + for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { + if tagAnnotationIdentifier.Key == tagAnnotationFvRsDppPolFvAEPg.Key { + delete = false + break + } + } + if delete { + tagAnnotationFvRsDppPolFvAEPgChildMapForDelete := NewAciObject() + tagAnnotationFvRsDppPolFvAEPgChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationFvRsDppPolFvAEPgChildMapForDelete.Attributes["key"] = tagAnnotationFvRsDppPolFvAEPg.Key.ValueString() + FvRsDppPolFvAEPgChildren = append(FvRsDppPolFvAEPgChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsDppPolFvAEPgChildMapForDelete}) + } + } + } + + var tagTagFvRsDppPolFvAEPgPlan, tagTagFvRsDppPolFvAEPgState []TagTagFvRsDppPolFvAEPgResourceModel + fvRsDppPolFvAEPgPlan.TagTag.ElementsAs(ctx, &tagTagFvRsDppPolFvAEPgPlan, false) + if !fvRsDppPolFvAEPgState.TagTag.IsNull() { + fvRsDppPolFvAEPgState.TagTag.ElementsAs(ctx, &tagTagFvRsDppPolFvAEPgState, false) + } + if !fvRsDppPolFvAEPgPlan.TagTag.IsNull() && !fvRsDppPolFvAEPgPlan.TagTag.IsUnknown() { + tagTagIdentifiers := []TagTagIdentifier{} + for _, tagTagFvRsDppPolFvAEPg := range tagTagFvRsDppPolFvAEPgPlan { + tagTagFvRsDppPolFvAEPgChildMap := NewAciObject() + if !tagTagFvRsDppPolFvAEPg.Key.IsNull() && !tagTagFvRsDppPolFvAEPg.Key.IsUnknown() { + tagTagFvRsDppPolFvAEPgChildMap.Attributes["key"] = tagTagFvRsDppPolFvAEPg.Key.ValueString() + } + if !tagTagFvRsDppPolFvAEPg.Value.IsNull() && !tagTagFvRsDppPolFvAEPg.Value.IsUnknown() { + tagTagFvRsDppPolFvAEPgChildMap.Attributes["value"] = tagTagFvRsDppPolFvAEPg.Value.ValueString() + } + FvRsDppPolFvAEPgChildren = append(FvRsDppPolFvAEPgChildren, map[string]interface{}{"tagTag": tagTagFvRsDppPolFvAEPgChildMap}) + tagTagIdentifier := TagTagIdentifier{} + tagTagIdentifier.Key = tagTagFvRsDppPolFvAEPg.Key + tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) + } + for _, tagTagFvRsDppPolFvAEPg := range tagTagFvRsDppPolFvAEPgState { + delete := true + for _, tagTagIdentifier := range tagTagIdentifiers { + if tagTagIdentifier.Key == tagTagFvRsDppPolFvAEPg.Key { + delete = false + break + } + } + if delete { + tagTagFvRsDppPolFvAEPgChildMapForDelete := NewAciObject() + tagTagFvRsDppPolFvAEPgChildMapForDelete.Attributes["status"] = "deleted" + tagTagFvRsDppPolFvAEPgChildMapForDelete.Attributes["key"] = tagTagFvRsDppPolFvAEPg.Key.ValueString() + FvRsDppPolFvAEPgChildren = append(FvRsDppPolFvAEPgChildren, map[string]interface{}{"tagTag": tagTagFvRsDppPolFvAEPgChildMapForDelete}) + } + } } + childMap.Children = FvRsDppPolFvAEPgChildren childPayloads = append(childPayloads, map[string]interface{}{"fvRsDppPol": childMap}) } else { FvRsDppPolObject, _ := types.ObjectValueFrom(ctx, FvRsDppPolFvAEPgType, getEmptyFvRsDppPolFvAEPgResourceModel()) @@ -5063,36 +8638,112 @@ func getFvAEPgFvRsDppPolChildPayloads(ctx context.Context, diags *diag.Diagnosti return childPayloads } -func getFvAEPgFvRsFcPathAttChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvAEPgResourceModel, fvRsFcPathAttPlan, fvRsFcPathAttState []FvRsFcPathAttFvAEPgResourceModel) []map[string]interface{} { +func getFvAEPgFvRsFcPathAttChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvAEPgResourceModel, fvRsFcPathAttFvAEPgPlan, fvRsFcPathAttFvAEPgState []FvRsFcPathAttFvAEPgResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.FvRsFcPathAtt.IsUnknown() { + if !data.FvRsFcPathAtt.IsNull() && !data.FvRsFcPathAtt.IsUnknown() { fvRsFcPathAttIdentifiers := []FvRsFcPathAttIdentifier{} - for _, fvRsFcPathAtt := range fvRsFcPathAttPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !fvRsFcPathAtt.Annotation.IsUnknown() && !fvRsFcPathAtt.Annotation.IsNull() { - childMap["attributes"]["annotation"] = fvRsFcPathAtt.Annotation.ValueString() + for _, fvRsFcPathAttFvAEPg := range fvRsFcPathAttFvAEPgPlan { + FvRsFcPathAttFvAEPgChildren := make([]map[string]interface{}, 0) + childMap := NewAciObject() + if !fvRsFcPathAttFvAEPg.Annotation.IsNull() && !fvRsFcPathAttFvAEPg.Annotation.IsUnknown() { + childMap.Attributes["annotation"] = fvRsFcPathAttFvAEPg.Annotation.ValueString() } else { - childMap["attributes"]["annotation"] = globalAnnotation + childMap.Attributes["annotation"] = globalAnnotation } - if !fvRsFcPathAtt.Descr.IsUnknown() && !fvRsFcPathAtt.Descr.IsNull() { - childMap["attributes"]["descr"] = fvRsFcPathAtt.Descr.ValueString() + if !fvRsFcPathAttFvAEPg.Descr.IsNull() && !fvRsFcPathAttFvAEPg.Descr.IsUnknown() { + childMap.Attributes["descr"] = fvRsFcPathAttFvAEPg.Descr.ValueString() } - if !fvRsFcPathAtt.TDn.IsUnknown() && !fvRsFcPathAtt.TDn.IsNull() { - childMap["attributes"]["tDn"] = fvRsFcPathAtt.TDn.ValueString() + if !fvRsFcPathAttFvAEPg.TDn.IsNull() && !fvRsFcPathAttFvAEPg.TDn.IsUnknown() { + childMap.Attributes["tDn"] = fvRsFcPathAttFvAEPg.TDn.ValueString() } - if !fvRsFcPathAtt.Vsan.IsUnknown() && !fvRsFcPathAtt.Vsan.IsNull() { - childMap["attributes"]["vsan"] = fvRsFcPathAtt.Vsan.ValueString() + if !fvRsFcPathAttFvAEPg.Vsan.IsNull() && !fvRsFcPathAttFvAEPg.Vsan.IsUnknown() { + childMap.Attributes["vsan"] = fvRsFcPathAttFvAEPg.Vsan.ValueString() } - if !fvRsFcPathAtt.VsanMode.IsUnknown() && !fvRsFcPathAtt.VsanMode.IsNull() { - childMap["attributes"]["vsanMode"] = fvRsFcPathAtt.VsanMode.ValueString() + if !fvRsFcPathAttFvAEPg.VsanMode.IsNull() && !fvRsFcPathAttFvAEPg.VsanMode.IsUnknown() { + childMap.Attributes["vsanMode"] = fvRsFcPathAttFvAEPg.VsanMode.ValueString() } + + var tagAnnotationFvRsFcPathAttFvAEPgPlan, tagAnnotationFvRsFcPathAttFvAEPgState []TagAnnotationFvRsFcPathAttFvAEPgResourceModel + fvRsFcPathAttFvAEPg.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsFcPathAttFvAEPgPlan, false) + for _, tagAnnotationFvRsFcPathAttFvAEPgstate := range fvRsFcPathAttFvAEPgState { + tagAnnotationFvRsFcPathAttFvAEPgstate.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsFcPathAttFvAEPgState, false) + } + if !fvRsFcPathAttFvAEPg.TagAnnotation.IsNull() && !fvRsFcPathAttFvAEPg.TagAnnotation.IsUnknown() { + tagAnnotationIdentifiers := []TagAnnotationIdentifier{} + for _, tagAnnotationFvRsFcPathAttFvAEPg := range tagAnnotationFvRsFcPathAttFvAEPgPlan { + tagAnnotationFvRsFcPathAttFvAEPgChildMap := NewAciObject() + if !tagAnnotationFvRsFcPathAttFvAEPg.Key.IsNull() && !tagAnnotationFvRsFcPathAttFvAEPg.Key.IsUnknown() { + tagAnnotationFvRsFcPathAttFvAEPgChildMap.Attributes["key"] = tagAnnotationFvRsFcPathAttFvAEPg.Key.ValueString() + } + if !tagAnnotationFvRsFcPathAttFvAEPg.Value.IsNull() && !tagAnnotationFvRsFcPathAttFvAEPg.Value.IsUnknown() { + tagAnnotationFvRsFcPathAttFvAEPgChildMap.Attributes["value"] = tagAnnotationFvRsFcPathAttFvAEPg.Value.ValueString() + } + FvRsFcPathAttFvAEPgChildren = append(FvRsFcPathAttFvAEPgChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsFcPathAttFvAEPgChildMap}) + tagAnnotationIdentifier := TagAnnotationIdentifier{} + tagAnnotationIdentifier.Key = tagAnnotationFvRsFcPathAttFvAEPg.Key + tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) + } + for _, tagAnnotationFvRsFcPathAttFvAEPg := range tagAnnotationFvRsFcPathAttFvAEPgState { + delete := true + for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { + if tagAnnotationIdentifier.Key == tagAnnotationFvRsFcPathAttFvAEPg.Key { + delete = false + break + } + } + if delete { + tagAnnotationFvRsFcPathAttFvAEPgChildMapForDelete := NewAciObject() + tagAnnotationFvRsFcPathAttFvAEPgChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationFvRsFcPathAttFvAEPgChildMapForDelete.Attributes["key"] = tagAnnotationFvRsFcPathAttFvAEPg.Key.ValueString() + FvRsFcPathAttFvAEPgChildren = append(FvRsFcPathAttFvAEPgChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsFcPathAttFvAEPgChildMapForDelete}) + } + } + } + + var tagTagFvRsFcPathAttFvAEPgPlan, tagTagFvRsFcPathAttFvAEPgState []TagTagFvRsFcPathAttFvAEPgResourceModel + fvRsFcPathAttFvAEPg.TagTag.ElementsAs(ctx, &tagTagFvRsFcPathAttFvAEPgPlan, false) + for _, tagTagFvRsFcPathAttFvAEPgstate := range fvRsFcPathAttFvAEPgState { + tagTagFvRsFcPathAttFvAEPgstate.TagTag.ElementsAs(ctx, &tagTagFvRsFcPathAttFvAEPgState, false) + } + if !fvRsFcPathAttFvAEPg.TagTag.IsNull() && !fvRsFcPathAttFvAEPg.TagTag.IsUnknown() { + tagTagIdentifiers := []TagTagIdentifier{} + for _, tagTagFvRsFcPathAttFvAEPg := range tagTagFvRsFcPathAttFvAEPgPlan { + tagTagFvRsFcPathAttFvAEPgChildMap := NewAciObject() + if !tagTagFvRsFcPathAttFvAEPg.Key.IsNull() && !tagTagFvRsFcPathAttFvAEPg.Key.IsUnknown() { + tagTagFvRsFcPathAttFvAEPgChildMap.Attributes["key"] = tagTagFvRsFcPathAttFvAEPg.Key.ValueString() + } + if !tagTagFvRsFcPathAttFvAEPg.Value.IsNull() && !tagTagFvRsFcPathAttFvAEPg.Value.IsUnknown() { + tagTagFvRsFcPathAttFvAEPgChildMap.Attributes["value"] = tagTagFvRsFcPathAttFvAEPg.Value.ValueString() + } + FvRsFcPathAttFvAEPgChildren = append(FvRsFcPathAttFvAEPgChildren, map[string]interface{}{"tagTag": tagTagFvRsFcPathAttFvAEPgChildMap}) + tagTagIdentifier := TagTagIdentifier{} + tagTagIdentifier.Key = tagTagFvRsFcPathAttFvAEPg.Key + tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) + } + for _, tagTagFvRsFcPathAttFvAEPg := range tagTagFvRsFcPathAttFvAEPgState { + delete := true + for _, tagTagIdentifier := range tagTagIdentifiers { + if tagTagIdentifier.Key == tagTagFvRsFcPathAttFvAEPg.Key { + delete = false + break + } + } + if delete { + tagTagFvRsFcPathAttFvAEPgChildMapForDelete := NewAciObject() + tagTagFvRsFcPathAttFvAEPgChildMapForDelete.Attributes["status"] = "deleted" + tagTagFvRsFcPathAttFvAEPgChildMapForDelete.Attributes["key"] = tagTagFvRsFcPathAttFvAEPg.Key.ValueString() + FvRsFcPathAttFvAEPgChildren = append(FvRsFcPathAttFvAEPgChildren, map[string]interface{}{"tagTag": tagTagFvRsFcPathAttFvAEPgChildMapForDelete}) + } + } + } + childMap.Children = FvRsFcPathAttFvAEPgChildren childPayloads = append(childPayloads, map[string]interface{}{"fvRsFcPathAtt": childMap}) fvRsFcPathAttIdentifier := FvRsFcPathAttIdentifier{} - fvRsFcPathAttIdentifier.TDn = fvRsFcPathAtt.TDn + fvRsFcPathAttIdentifier.TDn = fvRsFcPathAttFvAEPg.TDn fvRsFcPathAttIdentifiers = append(fvRsFcPathAttIdentifiers, fvRsFcPathAttIdentifier) } - for _, fvRsFcPathAtt := range fvRsFcPathAttState { + for _, fvRsFcPathAtt := range fvRsFcPathAttFvAEPgState { delete := true for _, fvRsFcPathAttIdentifier := range fvRsFcPathAttIdentifiers { if fvRsFcPathAttIdentifier.TDn == fvRsFcPathAtt.TDn { @@ -5101,10 +8752,10 @@ func getFvAEPgFvRsFcPathAttChildPayloads(ctx context.Context, diags *diag.Diagno } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["tDn"] = fvRsFcPathAtt.TDn.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"fvRsFcPathAtt": childMap}) + fvRsFcPathAttChildMapForDelete := NewAciObject() + fvRsFcPathAttChildMapForDelete.Attributes["status"] = "deleted" + fvRsFcPathAttChildMapForDelete.Attributes["tDn"] = fvRsFcPathAtt.TDn.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"fvRsFcPathAtt": fvRsFcPathAttChildMapForDelete}) } } } else { @@ -5113,27 +8764,103 @@ func getFvAEPgFvRsFcPathAttChildPayloads(ctx context.Context, diags *diag.Diagno return childPayloads } -func getFvAEPgFvRsIntraEpgChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvAEPgResourceModel, fvRsIntraEpgPlan, fvRsIntraEpgState []FvRsIntraEpgFvAEPgResourceModel) []map[string]interface{} { +func getFvAEPgFvRsIntraEpgChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvAEPgResourceModel, fvRsIntraEpgFvAEPgPlan, fvRsIntraEpgFvAEPgState []FvRsIntraEpgFvAEPgResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.FvRsIntraEpg.IsUnknown() { + if !data.FvRsIntraEpg.IsNull() && !data.FvRsIntraEpg.IsUnknown() { fvRsIntraEpgIdentifiers := []FvRsIntraEpgIdentifier{} - for _, fvRsIntraEpg := range fvRsIntraEpgPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !fvRsIntraEpg.Annotation.IsUnknown() && !fvRsIntraEpg.Annotation.IsNull() { - childMap["attributes"]["annotation"] = fvRsIntraEpg.Annotation.ValueString() + for _, fvRsIntraEpgFvAEPg := range fvRsIntraEpgFvAEPgPlan { + FvRsIntraEpgFvAEPgChildren := make([]map[string]interface{}, 0) + childMap := NewAciObject() + if !fvRsIntraEpgFvAEPg.Annotation.IsNull() && !fvRsIntraEpgFvAEPg.Annotation.IsUnknown() { + childMap.Attributes["annotation"] = fvRsIntraEpgFvAEPg.Annotation.ValueString() } else { - childMap["attributes"]["annotation"] = globalAnnotation + childMap.Attributes["annotation"] = globalAnnotation + } + if !fvRsIntraEpgFvAEPg.TnVzBrCPName.IsNull() && !fvRsIntraEpgFvAEPg.TnVzBrCPName.IsUnknown() { + childMap.Attributes["tnVzBrCPName"] = fvRsIntraEpgFvAEPg.TnVzBrCPName.ValueString() + } + + var tagAnnotationFvRsIntraEpgFvAEPgPlan, tagAnnotationFvRsIntraEpgFvAEPgState []TagAnnotationFvRsIntraEpgFvAEPgResourceModel + fvRsIntraEpgFvAEPg.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsIntraEpgFvAEPgPlan, false) + for _, tagAnnotationFvRsIntraEpgFvAEPgstate := range fvRsIntraEpgFvAEPgState { + tagAnnotationFvRsIntraEpgFvAEPgstate.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsIntraEpgFvAEPgState, false) + } + if !fvRsIntraEpgFvAEPg.TagAnnotation.IsNull() && !fvRsIntraEpgFvAEPg.TagAnnotation.IsUnknown() { + tagAnnotationIdentifiers := []TagAnnotationIdentifier{} + for _, tagAnnotationFvRsIntraEpgFvAEPg := range tagAnnotationFvRsIntraEpgFvAEPgPlan { + tagAnnotationFvRsIntraEpgFvAEPgChildMap := NewAciObject() + if !tagAnnotationFvRsIntraEpgFvAEPg.Key.IsNull() && !tagAnnotationFvRsIntraEpgFvAEPg.Key.IsUnknown() { + tagAnnotationFvRsIntraEpgFvAEPgChildMap.Attributes["key"] = tagAnnotationFvRsIntraEpgFvAEPg.Key.ValueString() + } + if !tagAnnotationFvRsIntraEpgFvAEPg.Value.IsNull() && !tagAnnotationFvRsIntraEpgFvAEPg.Value.IsUnknown() { + tagAnnotationFvRsIntraEpgFvAEPgChildMap.Attributes["value"] = tagAnnotationFvRsIntraEpgFvAEPg.Value.ValueString() + } + FvRsIntraEpgFvAEPgChildren = append(FvRsIntraEpgFvAEPgChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsIntraEpgFvAEPgChildMap}) + tagAnnotationIdentifier := TagAnnotationIdentifier{} + tagAnnotationIdentifier.Key = tagAnnotationFvRsIntraEpgFvAEPg.Key + tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) + } + for _, tagAnnotationFvRsIntraEpgFvAEPg := range tagAnnotationFvRsIntraEpgFvAEPgState { + delete := true + for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { + if tagAnnotationIdentifier.Key == tagAnnotationFvRsIntraEpgFvAEPg.Key { + delete = false + break + } + } + if delete { + tagAnnotationFvRsIntraEpgFvAEPgChildMapForDelete := NewAciObject() + tagAnnotationFvRsIntraEpgFvAEPgChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationFvRsIntraEpgFvAEPgChildMapForDelete.Attributes["key"] = tagAnnotationFvRsIntraEpgFvAEPg.Key.ValueString() + FvRsIntraEpgFvAEPgChildren = append(FvRsIntraEpgFvAEPgChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsIntraEpgFvAEPgChildMapForDelete}) + } + } + } + + var tagTagFvRsIntraEpgFvAEPgPlan, tagTagFvRsIntraEpgFvAEPgState []TagTagFvRsIntraEpgFvAEPgResourceModel + fvRsIntraEpgFvAEPg.TagTag.ElementsAs(ctx, &tagTagFvRsIntraEpgFvAEPgPlan, false) + for _, tagTagFvRsIntraEpgFvAEPgstate := range fvRsIntraEpgFvAEPgState { + tagTagFvRsIntraEpgFvAEPgstate.TagTag.ElementsAs(ctx, &tagTagFvRsIntraEpgFvAEPgState, false) } - if !fvRsIntraEpg.TnVzBrCPName.IsUnknown() && !fvRsIntraEpg.TnVzBrCPName.IsNull() { - childMap["attributes"]["tnVzBrCPName"] = fvRsIntraEpg.TnVzBrCPName.ValueString() + if !fvRsIntraEpgFvAEPg.TagTag.IsNull() && !fvRsIntraEpgFvAEPg.TagTag.IsUnknown() { + tagTagIdentifiers := []TagTagIdentifier{} + for _, tagTagFvRsIntraEpgFvAEPg := range tagTagFvRsIntraEpgFvAEPgPlan { + tagTagFvRsIntraEpgFvAEPgChildMap := NewAciObject() + if !tagTagFvRsIntraEpgFvAEPg.Key.IsNull() && !tagTagFvRsIntraEpgFvAEPg.Key.IsUnknown() { + tagTagFvRsIntraEpgFvAEPgChildMap.Attributes["key"] = tagTagFvRsIntraEpgFvAEPg.Key.ValueString() + } + if !tagTagFvRsIntraEpgFvAEPg.Value.IsNull() && !tagTagFvRsIntraEpgFvAEPg.Value.IsUnknown() { + tagTagFvRsIntraEpgFvAEPgChildMap.Attributes["value"] = tagTagFvRsIntraEpgFvAEPg.Value.ValueString() + } + FvRsIntraEpgFvAEPgChildren = append(FvRsIntraEpgFvAEPgChildren, map[string]interface{}{"tagTag": tagTagFvRsIntraEpgFvAEPgChildMap}) + tagTagIdentifier := TagTagIdentifier{} + tagTagIdentifier.Key = tagTagFvRsIntraEpgFvAEPg.Key + tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) + } + for _, tagTagFvRsIntraEpgFvAEPg := range tagTagFvRsIntraEpgFvAEPgState { + delete := true + for _, tagTagIdentifier := range tagTagIdentifiers { + if tagTagIdentifier.Key == tagTagFvRsIntraEpgFvAEPg.Key { + delete = false + break + } + } + if delete { + tagTagFvRsIntraEpgFvAEPgChildMapForDelete := NewAciObject() + tagTagFvRsIntraEpgFvAEPgChildMapForDelete.Attributes["status"] = "deleted" + tagTagFvRsIntraEpgFvAEPgChildMapForDelete.Attributes["key"] = tagTagFvRsIntraEpgFvAEPg.Key.ValueString() + FvRsIntraEpgFvAEPgChildren = append(FvRsIntraEpgFvAEPgChildren, map[string]interface{}{"tagTag": tagTagFvRsIntraEpgFvAEPgChildMapForDelete}) + } + } } + childMap.Children = FvRsIntraEpgFvAEPgChildren childPayloads = append(childPayloads, map[string]interface{}{"fvRsIntraEpg": childMap}) fvRsIntraEpgIdentifier := FvRsIntraEpgIdentifier{} - fvRsIntraEpgIdentifier.TnVzBrCPName = fvRsIntraEpg.TnVzBrCPName + fvRsIntraEpgIdentifier.TnVzBrCPName = fvRsIntraEpgFvAEPg.TnVzBrCPName fvRsIntraEpgIdentifiers = append(fvRsIntraEpgIdentifiers, fvRsIntraEpgIdentifier) } - for _, fvRsIntraEpg := range fvRsIntraEpgState { + for _, fvRsIntraEpg := range fvRsIntraEpgFvAEPgState { delete := true for _, fvRsIntraEpgIdentifier := range fvRsIntraEpgIdentifiers { if fvRsIntraEpgIdentifier.TnVzBrCPName == fvRsIntraEpg.TnVzBrCPName { @@ -5142,10 +8869,10 @@ func getFvAEPgFvRsIntraEpgChildPayloads(ctx context.Context, diags *diag.Diagnos } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["tnVzBrCPName"] = fvRsIntraEpg.TnVzBrCPName.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"fvRsIntraEpg": childMap}) + fvRsIntraEpgChildMapForDelete := NewAciObject() + fvRsIntraEpgChildMapForDelete.Attributes["status"] = "deleted" + fvRsIntraEpgChildMapForDelete.Attributes["tnVzBrCPName"] = fvRsIntraEpg.TnVzBrCPName.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"fvRsIntraEpg": fvRsIntraEpgChildMapForDelete}) } } } else { @@ -5154,39 +8881,115 @@ func getFvAEPgFvRsIntraEpgChildPayloads(ctx context.Context, diags *diag.Diagnos return childPayloads } -func getFvAEPgFvRsNodeAttChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvAEPgResourceModel, fvRsNodeAttPlan, fvRsNodeAttState []FvRsNodeAttFvAEPgResourceModel) []map[string]interface{} { +func getFvAEPgFvRsNodeAttChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvAEPgResourceModel, fvRsNodeAttFvAEPgPlan, fvRsNodeAttFvAEPgState []FvRsNodeAttFvAEPgResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.FvRsNodeAtt.IsUnknown() { + if !data.FvRsNodeAtt.IsNull() && !data.FvRsNodeAtt.IsUnknown() { fvRsNodeAttIdentifiers := []FvRsNodeAttIdentifier{} - for _, fvRsNodeAtt := range fvRsNodeAttPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !fvRsNodeAtt.Annotation.IsUnknown() && !fvRsNodeAtt.Annotation.IsNull() { - childMap["attributes"]["annotation"] = fvRsNodeAtt.Annotation.ValueString() + for _, fvRsNodeAttFvAEPg := range fvRsNodeAttFvAEPgPlan { + FvRsNodeAttFvAEPgChildren := make([]map[string]interface{}, 0) + childMap := NewAciObject() + if !fvRsNodeAttFvAEPg.Annotation.IsNull() && !fvRsNodeAttFvAEPg.Annotation.IsUnknown() { + childMap.Attributes["annotation"] = fvRsNodeAttFvAEPg.Annotation.ValueString() } else { - childMap["attributes"]["annotation"] = globalAnnotation + childMap.Attributes["annotation"] = globalAnnotation } - if !fvRsNodeAtt.Descr.IsUnknown() && !fvRsNodeAtt.Descr.IsNull() { - childMap["attributes"]["descr"] = fvRsNodeAtt.Descr.ValueString() + if !fvRsNodeAttFvAEPg.Descr.IsNull() && !fvRsNodeAttFvAEPg.Descr.IsUnknown() { + childMap.Attributes["descr"] = fvRsNodeAttFvAEPg.Descr.ValueString() } - if !fvRsNodeAtt.Encap.IsUnknown() && !fvRsNodeAtt.Encap.IsNull() { - childMap["attributes"]["encap"] = fvRsNodeAtt.Encap.ValueString() + if !fvRsNodeAttFvAEPg.Encap.IsNull() && !fvRsNodeAttFvAEPg.Encap.IsUnknown() { + childMap.Attributes["encap"] = fvRsNodeAttFvAEPg.Encap.ValueString() } - if !fvRsNodeAtt.InstrImedcy.IsUnknown() && !fvRsNodeAtt.InstrImedcy.IsNull() { - childMap["attributes"]["instrImedcy"] = fvRsNodeAtt.InstrImedcy.ValueString() + if !fvRsNodeAttFvAEPg.InstrImedcy.IsNull() && !fvRsNodeAttFvAEPg.InstrImedcy.IsUnknown() { + childMap.Attributes["instrImedcy"] = fvRsNodeAttFvAEPg.InstrImedcy.ValueString() + } + if !fvRsNodeAttFvAEPg.Mode.IsNull() && !fvRsNodeAttFvAEPg.Mode.IsUnknown() { + childMap.Attributes["mode"] = fvRsNodeAttFvAEPg.Mode.ValueString() + } + if !fvRsNodeAttFvAEPg.TDn.IsNull() && !fvRsNodeAttFvAEPg.TDn.IsUnknown() { + childMap.Attributes["tDn"] = fvRsNodeAttFvAEPg.TDn.ValueString() + } + + var tagAnnotationFvRsNodeAttFvAEPgPlan, tagAnnotationFvRsNodeAttFvAEPgState []TagAnnotationFvRsNodeAttFvAEPgResourceModel + fvRsNodeAttFvAEPg.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsNodeAttFvAEPgPlan, false) + for _, tagAnnotationFvRsNodeAttFvAEPgstate := range fvRsNodeAttFvAEPgState { + tagAnnotationFvRsNodeAttFvAEPgstate.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsNodeAttFvAEPgState, false) + } + if !fvRsNodeAttFvAEPg.TagAnnotation.IsNull() && !fvRsNodeAttFvAEPg.TagAnnotation.IsUnknown() { + tagAnnotationIdentifiers := []TagAnnotationIdentifier{} + for _, tagAnnotationFvRsNodeAttFvAEPg := range tagAnnotationFvRsNodeAttFvAEPgPlan { + tagAnnotationFvRsNodeAttFvAEPgChildMap := NewAciObject() + if !tagAnnotationFvRsNodeAttFvAEPg.Key.IsNull() && !tagAnnotationFvRsNodeAttFvAEPg.Key.IsUnknown() { + tagAnnotationFvRsNodeAttFvAEPgChildMap.Attributes["key"] = tagAnnotationFvRsNodeAttFvAEPg.Key.ValueString() + } + if !tagAnnotationFvRsNodeAttFvAEPg.Value.IsNull() && !tagAnnotationFvRsNodeAttFvAEPg.Value.IsUnknown() { + tagAnnotationFvRsNodeAttFvAEPgChildMap.Attributes["value"] = tagAnnotationFvRsNodeAttFvAEPg.Value.ValueString() + } + FvRsNodeAttFvAEPgChildren = append(FvRsNodeAttFvAEPgChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsNodeAttFvAEPgChildMap}) + tagAnnotationIdentifier := TagAnnotationIdentifier{} + tagAnnotationIdentifier.Key = tagAnnotationFvRsNodeAttFvAEPg.Key + tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) + } + for _, tagAnnotationFvRsNodeAttFvAEPg := range tagAnnotationFvRsNodeAttFvAEPgState { + delete := true + for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { + if tagAnnotationIdentifier.Key == tagAnnotationFvRsNodeAttFvAEPg.Key { + delete = false + break + } + } + if delete { + tagAnnotationFvRsNodeAttFvAEPgChildMapForDelete := NewAciObject() + tagAnnotationFvRsNodeAttFvAEPgChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationFvRsNodeAttFvAEPgChildMapForDelete.Attributes["key"] = tagAnnotationFvRsNodeAttFvAEPg.Key.ValueString() + FvRsNodeAttFvAEPgChildren = append(FvRsNodeAttFvAEPgChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsNodeAttFvAEPgChildMapForDelete}) + } + } } - if !fvRsNodeAtt.Mode.IsUnknown() && !fvRsNodeAtt.Mode.IsNull() { - childMap["attributes"]["mode"] = fvRsNodeAtt.Mode.ValueString() + + var tagTagFvRsNodeAttFvAEPgPlan, tagTagFvRsNodeAttFvAEPgState []TagTagFvRsNodeAttFvAEPgResourceModel + fvRsNodeAttFvAEPg.TagTag.ElementsAs(ctx, &tagTagFvRsNodeAttFvAEPgPlan, false) + for _, tagTagFvRsNodeAttFvAEPgstate := range fvRsNodeAttFvAEPgState { + tagTagFvRsNodeAttFvAEPgstate.TagTag.ElementsAs(ctx, &tagTagFvRsNodeAttFvAEPgState, false) } - if !fvRsNodeAtt.TDn.IsUnknown() && !fvRsNodeAtt.TDn.IsNull() { - childMap["attributes"]["tDn"] = fvRsNodeAtt.TDn.ValueString() + if !fvRsNodeAttFvAEPg.TagTag.IsNull() && !fvRsNodeAttFvAEPg.TagTag.IsUnknown() { + tagTagIdentifiers := []TagTagIdentifier{} + for _, tagTagFvRsNodeAttFvAEPg := range tagTagFvRsNodeAttFvAEPgPlan { + tagTagFvRsNodeAttFvAEPgChildMap := NewAciObject() + if !tagTagFvRsNodeAttFvAEPg.Key.IsNull() && !tagTagFvRsNodeAttFvAEPg.Key.IsUnknown() { + tagTagFvRsNodeAttFvAEPgChildMap.Attributes["key"] = tagTagFvRsNodeAttFvAEPg.Key.ValueString() + } + if !tagTagFvRsNodeAttFvAEPg.Value.IsNull() && !tagTagFvRsNodeAttFvAEPg.Value.IsUnknown() { + tagTagFvRsNodeAttFvAEPgChildMap.Attributes["value"] = tagTagFvRsNodeAttFvAEPg.Value.ValueString() + } + FvRsNodeAttFvAEPgChildren = append(FvRsNodeAttFvAEPgChildren, map[string]interface{}{"tagTag": tagTagFvRsNodeAttFvAEPgChildMap}) + tagTagIdentifier := TagTagIdentifier{} + tagTagIdentifier.Key = tagTagFvRsNodeAttFvAEPg.Key + tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) + } + for _, tagTagFvRsNodeAttFvAEPg := range tagTagFvRsNodeAttFvAEPgState { + delete := true + for _, tagTagIdentifier := range tagTagIdentifiers { + if tagTagIdentifier.Key == tagTagFvRsNodeAttFvAEPg.Key { + delete = false + break + } + } + if delete { + tagTagFvRsNodeAttFvAEPgChildMapForDelete := NewAciObject() + tagTagFvRsNodeAttFvAEPgChildMapForDelete.Attributes["status"] = "deleted" + tagTagFvRsNodeAttFvAEPgChildMapForDelete.Attributes["key"] = tagTagFvRsNodeAttFvAEPg.Key.ValueString() + FvRsNodeAttFvAEPgChildren = append(FvRsNodeAttFvAEPgChildren, map[string]interface{}{"tagTag": tagTagFvRsNodeAttFvAEPgChildMapForDelete}) + } + } } + childMap.Children = FvRsNodeAttFvAEPgChildren childPayloads = append(childPayloads, map[string]interface{}{"fvRsNodeAtt": childMap}) fvRsNodeAttIdentifier := FvRsNodeAttIdentifier{} - fvRsNodeAttIdentifier.TDn = fvRsNodeAtt.TDn + fvRsNodeAttIdentifier.TDn = fvRsNodeAttFvAEPg.TDn fvRsNodeAttIdentifiers = append(fvRsNodeAttIdentifiers, fvRsNodeAttIdentifier) } - for _, fvRsNodeAtt := range fvRsNodeAttState { + for _, fvRsNodeAtt := range fvRsNodeAttFvAEPgState { delete := true for _, fvRsNodeAttIdentifier := range fvRsNodeAttIdentifiers { if fvRsNodeAttIdentifier.TDn == fvRsNodeAtt.TDn { @@ -5195,10 +8998,10 @@ func getFvAEPgFvRsNodeAttChildPayloads(ctx context.Context, diags *diag.Diagnost } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["tDn"] = fvRsNodeAtt.TDn.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"fvRsNodeAtt": childMap}) + fvRsNodeAttChildMapForDelete := NewAciObject() + fvRsNodeAttChildMapForDelete.Attributes["status"] = "deleted" + fvRsNodeAttChildMapForDelete.Attributes["tDn"] = fvRsNodeAtt.TDn.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"fvRsNodeAtt": fvRsNodeAttChildMapForDelete}) } } } else { @@ -5207,42 +9010,118 @@ func getFvAEPgFvRsNodeAttChildPayloads(ctx context.Context, diags *diag.Diagnost return childPayloads } -func getFvAEPgFvRsPathAttChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvAEPgResourceModel, fvRsPathAttPlan, fvRsPathAttState []FvRsPathAttFvAEPgResourceModel) []map[string]interface{} { +func getFvAEPgFvRsPathAttChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvAEPgResourceModel, fvRsPathAttFvAEPgPlan, fvRsPathAttFvAEPgState []FvRsPathAttFvAEPgResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.FvRsPathAtt.IsUnknown() { + if !data.FvRsPathAtt.IsNull() && !data.FvRsPathAtt.IsUnknown() { fvRsPathAttIdentifiers := []FvRsPathAttIdentifier{} - for _, fvRsPathAtt := range fvRsPathAttPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !fvRsPathAtt.Annotation.IsUnknown() && !fvRsPathAtt.Annotation.IsNull() { - childMap["attributes"]["annotation"] = fvRsPathAtt.Annotation.ValueString() + for _, fvRsPathAttFvAEPg := range fvRsPathAttFvAEPgPlan { + FvRsPathAttFvAEPgChildren := make([]map[string]interface{}, 0) + childMap := NewAciObject() + if !fvRsPathAttFvAEPg.Annotation.IsNull() && !fvRsPathAttFvAEPg.Annotation.IsUnknown() { + childMap.Attributes["annotation"] = fvRsPathAttFvAEPg.Annotation.ValueString() } else { - childMap["attributes"]["annotation"] = globalAnnotation + childMap.Attributes["annotation"] = globalAnnotation + } + if !fvRsPathAttFvAEPg.Descr.IsNull() && !fvRsPathAttFvAEPg.Descr.IsUnknown() { + childMap.Attributes["descr"] = fvRsPathAttFvAEPg.Descr.ValueString() + } + if !fvRsPathAttFvAEPg.Encap.IsNull() && !fvRsPathAttFvAEPg.Encap.IsUnknown() { + childMap.Attributes["encap"] = fvRsPathAttFvAEPg.Encap.ValueString() + } + if !fvRsPathAttFvAEPg.InstrImedcy.IsNull() && !fvRsPathAttFvAEPg.InstrImedcy.IsUnknown() { + childMap.Attributes["instrImedcy"] = fvRsPathAttFvAEPg.InstrImedcy.ValueString() + } + if !fvRsPathAttFvAEPg.Mode.IsNull() && !fvRsPathAttFvAEPg.Mode.IsUnknown() { + childMap.Attributes["mode"] = fvRsPathAttFvAEPg.Mode.ValueString() } - if !fvRsPathAtt.Descr.IsUnknown() && !fvRsPathAtt.Descr.IsNull() { - childMap["attributes"]["descr"] = fvRsPathAtt.Descr.ValueString() + if !fvRsPathAttFvAEPg.PrimaryEncap.IsNull() && !fvRsPathAttFvAEPg.PrimaryEncap.IsUnknown() { + childMap.Attributes["primaryEncap"] = fvRsPathAttFvAEPg.PrimaryEncap.ValueString() } - if !fvRsPathAtt.Encap.IsUnknown() && !fvRsPathAtt.Encap.IsNull() { - childMap["attributes"]["encap"] = fvRsPathAtt.Encap.ValueString() + if !fvRsPathAttFvAEPg.TDn.IsNull() && !fvRsPathAttFvAEPg.TDn.IsUnknown() { + childMap.Attributes["tDn"] = fvRsPathAttFvAEPg.TDn.ValueString() } - if !fvRsPathAtt.InstrImedcy.IsUnknown() && !fvRsPathAtt.InstrImedcy.IsNull() { - childMap["attributes"]["instrImedcy"] = fvRsPathAtt.InstrImedcy.ValueString() + + var tagAnnotationFvRsPathAttFvAEPgPlan, tagAnnotationFvRsPathAttFvAEPgState []TagAnnotationFvRsPathAttFvAEPgResourceModel + fvRsPathAttFvAEPg.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsPathAttFvAEPgPlan, false) + for _, tagAnnotationFvRsPathAttFvAEPgstate := range fvRsPathAttFvAEPgState { + tagAnnotationFvRsPathAttFvAEPgstate.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsPathAttFvAEPgState, false) } - if !fvRsPathAtt.Mode.IsUnknown() && !fvRsPathAtt.Mode.IsNull() { - childMap["attributes"]["mode"] = fvRsPathAtt.Mode.ValueString() + if !fvRsPathAttFvAEPg.TagAnnotation.IsNull() && !fvRsPathAttFvAEPg.TagAnnotation.IsUnknown() { + tagAnnotationIdentifiers := []TagAnnotationIdentifier{} + for _, tagAnnotationFvRsPathAttFvAEPg := range tagAnnotationFvRsPathAttFvAEPgPlan { + tagAnnotationFvRsPathAttFvAEPgChildMap := NewAciObject() + if !tagAnnotationFvRsPathAttFvAEPg.Key.IsNull() && !tagAnnotationFvRsPathAttFvAEPg.Key.IsUnknown() { + tagAnnotationFvRsPathAttFvAEPgChildMap.Attributes["key"] = tagAnnotationFvRsPathAttFvAEPg.Key.ValueString() + } + if !tagAnnotationFvRsPathAttFvAEPg.Value.IsNull() && !tagAnnotationFvRsPathAttFvAEPg.Value.IsUnknown() { + tagAnnotationFvRsPathAttFvAEPgChildMap.Attributes["value"] = tagAnnotationFvRsPathAttFvAEPg.Value.ValueString() + } + FvRsPathAttFvAEPgChildren = append(FvRsPathAttFvAEPgChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsPathAttFvAEPgChildMap}) + tagAnnotationIdentifier := TagAnnotationIdentifier{} + tagAnnotationIdentifier.Key = tagAnnotationFvRsPathAttFvAEPg.Key + tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) + } + for _, tagAnnotationFvRsPathAttFvAEPg := range tagAnnotationFvRsPathAttFvAEPgState { + delete := true + for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { + if tagAnnotationIdentifier.Key == tagAnnotationFvRsPathAttFvAEPg.Key { + delete = false + break + } + } + if delete { + tagAnnotationFvRsPathAttFvAEPgChildMapForDelete := NewAciObject() + tagAnnotationFvRsPathAttFvAEPgChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationFvRsPathAttFvAEPgChildMapForDelete.Attributes["key"] = tagAnnotationFvRsPathAttFvAEPg.Key.ValueString() + FvRsPathAttFvAEPgChildren = append(FvRsPathAttFvAEPgChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsPathAttFvAEPgChildMapForDelete}) + } + } } - if !fvRsPathAtt.PrimaryEncap.IsUnknown() && !fvRsPathAtt.PrimaryEncap.IsNull() { - childMap["attributes"]["primaryEncap"] = fvRsPathAtt.PrimaryEncap.ValueString() + + var tagTagFvRsPathAttFvAEPgPlan, tagTagFvRsPathAttFvAEPgState []TagTagFvRsPathAttFvAEPgResourceModel + fvRsPathAttFvAEPg.TagTag.ElementsAs(ctx, &tagTagFvRsPathAttFvAEPgPlan, false) + for _, tagTagFvRsPathAttFvAEPgstate := range fvRsPathAttFvAEPgState { + tagTagFvRsPathAttFvAEPgstate.TagTag.ElementsAs(ctx, &tagTagFvRsPathAttFvAEPgState, false) } - if !fvRsPathAtt.TDn.IsUnknown() && !fvRsPathAtt.TDn.IsNull() { - childMap["attributes"]["tDn"] = fvRsPathAtt.TDn.ValueString() + if !fvRsPathAttFvAEPg.TagTag.IsNull() && !fvRsPathAttFvAEPg.TagTag.IsUnknown() { + tagTagIdentifiers := []TagTagIdentifier{} + for _, tagTagFvRsPathAttFvAEPg := range tagTagFvRsPathAttFvAEPgPlan { + tagTagFvRsPathAttFvAEPgChildMap := NewAciObject() + if !tagTagFvRsPathAttFvAEPg.Key.IsNull() && !tagTagFvRsPathAttFvAEPg.Key.IsUnknown() { + tagTagFvRsPathAttFvAEPgChildMap.Attributes["key"] = tagTagFvRsPathAttFvAEPg.Key.ValueString() + } + if !tagTagFvRsPathAttFvAEPg.Value.IsNull() && !tagTagFvRsPathAttFvAEPg.Value.IsUnknown() { + tagTagFvRsPathAttFvAEPgChildMap.Attributes["value"] = tagTagFvRsPathAttFvAEPg.Value.ValueString() + } + FvRsPathAttFvAEPgChildren = append(FvRsPathAttFvAEPgChildren, map[string]interface{}{"tagTag": tagTagFvRsPathAttFvAEPgChildMap}) + tagTagIdentifier := TagTagIdentifier{} + tagTagIdentifier.Key = tagTagFvRsPathAttFvAEPg.Key + tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) + } + for _, tagTagFvRsPathAttFvAEPg := range tagTagFvRsPathAttFvAEPgState { + delete := true + for _, tagTagIdentifier := range tagTagIdentifiers { + if tagTagIdentifier.Key == tagTagFvRsPathAttFvAEPg.Key { + delete = false + break + } + } + if delete { + tagTagFvRsPathAttFvAEPgChildMapForDelete := NewAciObject() + tagTagFvRsPathAttFvAEPgChildMapForDelete.Attributes["status"] = "deleted" + tagTagFvRsPathAttFvAEPgChildMapForDelete.Attributes["key"] = tagTagFvRsPathAttFvAEPg.Key.ValueString() + FvRsPathAttFvAEPgChildren = append(FvRsPathAttFvAEPgChildren, map[string]interface{}{"tagTag": tagTagFvRsPathAttFvAEPgChildMapForDelete}) + } + } } + childMap.Children = FvRsPathAttFvAEPgChildren childPayloads = append(childPayloads, map[string]interface{}{"fvRsPathAtt": childMap}) fvRsPathAttIdentifier := FvRsPathAttIdentifier{} - fvRsPathAttIdentifier.TDn = fvRsPathAtt.TDn + fvRsPathAttIdentifier.TDn = fvRsPathAttFvAEPg.TDn fvRsPathAttIdentifiers = append(fvRsPathAttIdentifiers, fvRsPathAttIdentifier) } - for _, fvRsPathAtt := range fvRsPathAttState { + for _, fvRsPathAtt := range fvRsPathAttFvAEPgState { delete := true for _, fvRsPathAttIdentifier := range fvRsPathAttIdentifiers { if fvRsPathAttIdentifier.TDn == fvRsPathAtt.TDn { @@ -5251,10 +9130,10 @@ func getFvAEPgFvRsPathAttChildPayloads(ctx context.Context, diags *diag.Diagnost } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["tDn"] = fvRsPathAtt.TDn.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"fvRsPathAtt": childMap}) + fvRsPathAttChildMapForDelete := NewAciObject() + fvRsPathAttChildMapForDelete.Attributes["status"] = "deleted" + fvRsPathAttChildMapForDelete.Attributes["tDn"] = fvRsPathAtt.TDn.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"fvRsPathAtt": fvRsPathAttChildMapForDelete}) } } } else { @@ -5263,27 +9142,103 @@ func getFvAEPgFvRsPathAttChildPayloads(ctx context.Context, diags *diag.Diagnost return childPayloads } -func getFvAEPgFvRsProtByChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvAEPgResourceModel, fvRsProtByPlan, fvRsProtByState []FvRsProtByFvAEPgResourceModel) []map[string]interface{} { +func getFvAEPgFvRsProtByChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvAEPgResourceModel, fvRsProtByFvAEPgPlan, fvRsProtByFvAEPgState []FvRsProtByFvAEPgResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.FvRsProtBy.IsUnknown() { + if !data.FvRsProtBy.IsNull() && !data.FvRsProtBy.IsUnknown() { fvRsProtByIdentifiers := []FvRsProtByIdentifier{} - for _, fvRsProtBy := range fvRsProtByPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !fvRsProtBy.Annotation.IsUnknown() && !fvRsProtBy.Annotation.IsNull() { - childMap["attributes"]["annotation"] = fvRsProtBy.Annotation.ValueString() + for _, fvRsProtByFvAEPg := range fvRsProtByFvAEPgPlan { + FvRsProtByFvAEPgChildren := make([]map[string]interface{}, 0) + childMap := NewAciObject() + if !fvRsProtByFvAEPg.Annotation.IsNull() && !fvRsProtByFvAEPg.Annotation.IsUnknown() { + childMap.Attributes["annotation"] = fvRsProtByFvAEPg.Annotation.ValueString() } else { - childMap["attributes"]["annotation"] = globalAnnotation + childMap.Attributes["annotation"] = globalAnnotation } - if !fvRsProtBy.TnVzTabooName.IsUnknown() && !fvRsProtBy.TnVzTabooName.IsNull() { - childMap["attributes"]["tnVzTabooName"] = fvRsProtBy.TnVzTabooName.ValueString() + if !fvRsProtByFvAEPg.TnVzTabooName.IsNull() && !fvRsProtByFvAEPg.TnVzTabooName.IsUnknown() { + childMap.Attributes["tnVzTabooName"] = fvRsProtByFvAEPg.TnVzTabooName.ValueString() + } + + var tagAnnotationFvRsProtByFvAEPgPlan, tagAnnotationFvRsProtByFvAEPgState []TagAnnotationFvRsProtByFvAEPgResourceModel + fvRsProtByFvAEPg.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsProtByFvAEPgPlan, false) + for _, tagAnnotationFvRsProtByFvAEPgstate := range fvRsProtByFvAEPgState { + tagAnnotationFvRsProtByFvAEPgstate.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsProtByFvAEPgState, false) + } + if !fvRsProtByFvAEPg.TagAnnotation.IsNull() && !fvRsProtByFvAEPg.TagAnnotation.IsUnknown() { + tagAnnotationIdentifiers := []TagAnnotationIdentifier{} + for _, tagAnnotationFvRsProtByFvAEPg := range tagAnnotationFvRsProtByFvAEPgPlan { + tagAnnotationFvRsProtByFvAEPgChildMap := NewAciObject() + if !tagAnnotationFvRsProtByFvAEPg.Key.IsNull() && !tagAnnotationFvRsProtByFvAEPg.Key.IsUnknown() { + tagAnnotationFvRsProtByFvAEPgChildMap.Attributes["key"] = tagAnnotationFvRsProtByFvAEPg.Key.ValueString() + } + if !tagAnnotationFvRsProtByFvAEPg.Value.IsNull() && !tagAnnotationFvRsProtByFvAEPg.Value.IsUnknown() { + tagAnnotationFvRsProtByFvAEPgChildMap.Attributes["value"] = tagAnnotationFvRsProtByFvAEPg.Value.ValueString() + } + FvRsProtByFvAEPgChildren = append(FvRsProtByFvAEPgChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsProtByFvAEPgChildMap}) + tagAnnotationIdentifier := TagAnnotationIdentifier{} + tagAnnotationIdentifier.Key = tagAnnotationFvRsProtByFvAEPg.Key + tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) + } + for _, tagAnnotationFvRsProtByFvAEPg := range tagAnnotationFvRsProtByFvAEPgState { + delete := true + for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { + if tagAnnotationIdentifier.Key == tagAnnotationFvRsProtByFvAEPg.Key { + delete = false + break + } + } + if delete { + tagAnnotationFvRsProtByFvAEPgChildMapForDelete := NewAciObject() + tagAnnotationFvRsProtByFvAEPgChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationFvRsProtByFvAEPgChildMapForDelete.Attributes["key"] = tagAnnotationFvRsProtByFvAEPg.Key.ValueString() + FvRsProtByFvAEPgChildren = append(FvRsProtByFvAEPgChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsProtByFvAEPgChildMapForDelete}) + } + } + } + + var tagTagFvRsProtByFvAEPgPlan, tagTagFvRsProtByFvAEPgState []TagTagFvRsProtByFvAEPgResourceModel + fvRsProtByFvAEPg.TagTag.ElementsAs(ctx, &tagTagFvRsProtByFvAEPgPlan, false) + for _, tagTagFvRsProtByFvAEPgstate := range fvRsProtByFvAEPgState { + tagTagFvRsProtByFvAEPgstate.TagTag.ElementsAs(ctx, &tagTagFvRsProtByFvAEPgState, false) + } + if !fvRsProtByFvAEPg.TagTag.IsNull() && !fvRsProtByFvAEPg.TagTag.IsUnknown() { + tagTagIdentifiers := []TagTagIdentifier{} + for _, tagTagFvRsProtByFvAEPg := range tagTagFvRsProtByFvAEPgPlan { + tagTagFvRsProtByFvAEPgChildMap := NewAciObject() + if !tagTagFvRsProtByFvAEPg.Key.IsNull() && !tagTagFvRsProtByFvAEPg.Key.IsUnknown() { + tagTagFvRsProtByFvAEPgChildMap.Attributes["key"] = tagTagFvRsProtByFvAEPg.Key.ValueString() + } + if !tagTagFvRsProtByFvAEPg.Value.IsNull() && !tagTagFvRsProtByFvAEPg.Value.IsUnknown() { + tagTagFvRsProtByFvAEPgChildMap.Attributes["value"] = tagTagFvRsProtByFvAEPg.Value.ValueString() + } + FvRsProtByFvAEPgChildren = append(FvRsProtByFvAEPgChildren, map[string]interface{}{"tagTag": tagTagFvRsProtByFvAEPgChildMap}) + tagTagIdentifier := TagTagIdentifier{} + tagTagIdentifier.Key = tagTagFvRsProtByFvAEPg.Key + tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) + } + for _, tagTagFvRsProtByFvAEPg := range tagTagFvRsProtByFvAEPgState { + delete := true + for _, tagTagIdentifier := range tagTagIdentifiers { + if tagTagIdentifier.Key == tagTagFvRsProtByFvAEPg.Key { + delete = false + break + } + } + if delete { + tagTagFvRsProtByFvAEPgChildMapForDelete := NewAciObject() + tagTagFvRsProtByFvAEPgChildMapForDelete.Attributes["status"] = "deleted" + tagTagFvRsProtByFvAEPgChildMapForDelete.Attributes["key"] = tagTagFvRsProtByFvAEPg.Key.ValueString() + FvRsProtByFvAEPgChildren = append(FvRsProtByFvAEPgChildren, map[string]interface{}{"tagTag": tagTagFvRsProtByFvAEPgChildMapForDelete}) + } + } } + childMap.Children = FvRsProtByFvAEPgChildren childPayloads = append(childPayloads, map[string]interface{}{"fvRsProtBy": childMap}) fvRsProtByIdentifier := FvRsProtByIdentifier{} - fvRsProtByIdentifier.TnVzTabooName = fvRsProtBy.TnVzTabooName + fvRsProtByIdentifier.TnVzTabooName = fvRsProtByFvAEPg.TnVzTabooName fvRsProtByIdentifiers = append(fvRsProtByIdentifiers, fvRsProtByIdentifier) } - for _, fvRsProtBy := range fvRsProtByState { + for _, fvRsProtBy := range fvRsProtByFvAEPgState { delete := true for _, fvRsProtByIdentifier := range fvRsProtByIdentifiers { if fvRsProtByIdentifier.TnVzTabooName == fvRsProtBy.TnVzTabooName { @@ -5292,10 +9247,10 @@ func getFvAEPgFvRsProtByChildPayloads(ctx context.Context, diags *diag.Diagnosti } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["tnVzTabooName"] = fvRsProtBy.TnVzTabooName.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"fvRsProtBy": childMap}) + fvRsProtByChildMapForDelete := NewAciObject() + fvRsProtByChildMapForDelete.Attributes["status"] = "deleted" + fvRsProtByChildMapForDelete.Attributes["tnVzTabooName"] = fvRsProtBy.TnVzTabooName.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"fvRsProtBy": fvRsProtByChildMapForDelete}) } } } else { @@ -5304,33 +9259,109 @@ func getFvAEPgFvRsProtByChildPayloads(ctx context.Context, diags *diag.Diagnosti return childPayloads } -func getFvAEPgFvRsProvChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvAEPgResourceModel, fvRsProvPlan, fvRsProvState []FvRsProvFvAEPgResourceModel) []map[string]interface{} { +func getFvAEPgFvRsProvChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvAEPgResourceModel, fvRsProvFvAEPgPlan, fvRsProvFvAEPgState []FvRsProvFvAEPgResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.FvRsProv.IsUnknown() { + if !data.FvRsProv.IsNull() && !data.FvRsProv.IsUnknown() { fvRsProvIdentifiers := []FvRsProvIdentifier{} - for _, fvRsProv := range fvRsProvPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !fvRsProv.Annotation.IsUnknown() && !fvRsProv.Annotation.IsNull() { - childMap["attributes"]["annotation"] = fvRsProv.Annotation.ValueString() + for _, fvRsProvFvAEPg := range fvRsProvFvAEPgPlan { + FvRsProvFvAEPgChildren := make([]map[string]interface{}, 0) + childMap := NewAciObject() + if !fvRsProvFvAEPg.Annotation.IsNull() && !fvRsProvFvAEPg.Annotation.IsUnknown() { + childMap.Attributes["annotation"] = fvRsProvFvAEPg.Annotation.ValueString() } else { - childMap["attributes"]["annotation"] = globalAnnotation + childMap.Attributes["annotation"] = globalAnnotation + } + if !fvRsProvFvAEPg.MatchT.IsNull() && !fvRsProvFvAEPg.MatchT.IsUnknown() { + childMap.Attributes["matchT"] = fvRsProvFvAEPg.MatchT.ValueString() + } + if !fvRsProvFvAEPg.Prio.IsNull() && !fvRsProvFvAEPg.Prio.IsUnknown() { + childMap.Attributes["prio"] = fvRsProvFvAEPg.Prio.ValueString() + } + if !fvRsProvFvAEPg.TnVzBrCPName.IsNull() && !fvRsProvFvAEPg.TnVzBrCPName.IsUnknown() { + childMap.Attributes["tnVzBrCPName"] = fvRsProvFvAEPg.TnVzBrCPName.ValueString() + } + + var tagAnnotationFvRsProvFvAEPgPlan, tagAnnotationFvRsProvFvAEPgState []TagAnnotationFvRsProvFvAEPgResourceModel + fvRsProvFvAEPg.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsProvFvAEPgPlan, false) + for _, tagAnnotationFvRsProvFvAEPgstate := range fvRsProvFvAEPgState { + tagAnnotationFvRsProvFvAEPgstate.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsProvFvAEPgState, false) } - if !fvRsProv.MatchT.IsUnknown() && !fvRsProv.MatchT.IsNull() { - childMap["attributes"]["matchT"] = fvRsProv.MatchT.ValueString() + if !fvRsProvFvAEPg.TagAnnotation.IsNull() && !fvRsProvFvAEPg.TagAnnotation.IsUnknown() { + tagAnnotationIdentifiers := []TagAnnotationIdentifier{} + for _, tagAnnotationFvRsProvFvAEPg := range tagAnnotationFvRsProvFvAEPgPlan { + tagAnnotationFvRsProvFvAEPgChildMap := NewAciObject() + if !tagAnnotationFvRsProvFvAEPg.Key.IsNull() && !tagAnnotationFvRsProvFvAEPg.Key.IsUnknown() { + tagAnnotationFvRsProvFvAEPgChildMap.Attributes["key"] = tagAnnotationFvRsProvFvAEPg.Key.ValueString() + } + if !tagAnnotationFvRsProvFvAEPg.Value.IsNull() && !tagAnnotationFvRsProvFvAEPg.Value.IsUnknown() { + tagAnnotationFvRsProvFvAEPgChildMap.Attributes["value"] = tagAnnotationFvRsProvFvAEPg.Value.ValueString() + } + FvRsProvFvAEPgChildren = append(FvRsProvFvAEPgChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsProvFvAEPgChildMap}) + tagAnnotationIdentifier := TagAnnotationIdentifier{} + tagAnnotationIdentifier.Key = tagAnnotationFvRsProvFvAEPg.Key + tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) + } + for _, tagAnnotationFvRsProvFvAEPg := range tagAnnotationFvRsProvFvAEPgState { + delete := true + for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { + if tagAnnotationIdentifier.Key == tagAnnotationFvRsProvFvAEPg.Key { + delete = false + break + } + } + if delete { + tagAnnotationFvRsProvFvAEPgChildMapForDelete := NewAciObject() + tagAnnotationFvRsProvFvAEPgChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationFvRsProvFvAEPgChildMapForDelete.Attributes["key"] = tagAnnotationFvRsProvFvAEPg.Key.ValueString() + FvRsProvFvAEPgChildren = append(FvRsProvFvAEPgChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsProvFvAEPgChildMapForDelete}) + } + } } - if !fvRsProv.Prio.IsUnknown() && !fvRsProv.Prio.IsNull() { - childMap["attributes"]["prio"] = fvRsProv.Prio.ValueString() + + var tagTagFvRsProvFvAEPgPlan, tagTagFvRsProvFvAEPgState []TagTagFvRsProvFvAEPgResourceModel + fvRsProvFvAEPg.TagTag.ElementsAs(ctx, &tagTagFvRsProvFvAEPgPlan, false) + for _, tagTagFvRsProvFvAEPgstate := range fvRsProvFvAEPgState { + tagTagFvRsProvFvAEPgstate.TagTag.ElementsAs(ctx, &tagTagFvRsProvFvAEPgState, false) } - if !fvRsProv.TnVzBrCPName.IsUnknown() && !fvRsProv.TnVzBrCPName.IsNull() { - childMap["attributes"]["tnVzBrCPName"] = fvRsProv.TnVzBrCPName.ValueString() + if !fvRsProvFvAEPg.TagTag.IsNull() && !fvRsProvFvAEPg.TagTag.IsUnknown() { + tagTagIdentifiers := []TagTagIdentifier{} + for _, tagTagFvRsProvFvAEPg := range tagTagFvRsProvFvAEPgPlan { + tagTagFvRsProvFvAEPgChildMap := NewAciObject() + if !tagTagFvRsProvFvAEPg.Key.IsNull() && !tagTagFvRsProvFvAEPg.Key.IsUnknown() { + tagTagFvRsProvFvAEPgChildMap.Attributes["key"] = tagTagFvRsProvFvAEPg.Key.ValueString() + } + if !tagTagFvRsProvFvAEPg.Value.IsNull() && !tagTagFvRsProvFvAEPg.Value.IsUnknown() { + tagTagFvRsProvFvAEPgChildMap.Attributes["value"] = tagTagFvRsProvFvAEPg.Value.ValueString() + } + FvRsProvFvAEPgChildren = append(FvRsProvFvAEPgChildren, map[string]interface{}{"tagTag": tagTagFvRsProvFvAEPgChildMap}) + tagTagIdentifier := TagTagIdentifier{} + tagTagIdentifier.Key = tagTagFvRsProvFvAEPg.Key + tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) + } + for _, tagTagFvRsProvFvAEPg := range tagTagFvRsProvFvAEPgState { + delete := true + for _, tagTagIdentifier := range tagTagIdentifiers { + if tagTagIdentifier.Key == tagTagFvRsProvFvAEPg.Key { + delete = false + break + } + } + if delete { + tagTagFvRsProvFvAEPgChildMapForDelete := NewAciObject() + tagTagFvRsProvFvAEPgChildMapForDelete.Attributes["status"] = "deleted" + tagTagFvRsProvFvAEPgChildMapForDelete.Attributes["key"] = tagTagFvRsProvFvAEPg.Key.ValueString() + FvRsProvFvAEPgChildren = append(FvRsProvFvAEPgChildren, map[string]interface{}{"tagTag": tagTagFvRsProvFvAEPgChildMapForDelete}) + } + } } + childMap.Children = FvRsProvFvAEPgChildren childPayloads = append(childPayloads, map[string]interface{}{"fvRsProv": childMap}) fvRsProvIdentifier := FvRsProvIdentifier{} - fvRsProvIdentifier.TnVzBrCPName = fvRsProv.TnVzBrCPName + fvRsProvIdentifier.TnVzBrCPName = fvRsProvFvAEPg.TnVzBrCPName fvRsProvIdentifiers = append(fvRsProvIdentifiers, fvRsProvIdentifier) } - for _, fvRsProv := range fvRsProvState { + for _, fvRsProv := range fvRsProvFvAEPgState { delete := true for _, fvRsProvIdentifier := range fvRsProvIdentifiers { if fvRsProvIdentifier.TnVzBrCPName == fvRsProv.TnVzBrCPName { @@ -5339,10 +9370,10 @@ func getFvAEPgFvRsProvChildPayloads(ctx context.Context, diags *diag.Diagnostics } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["tnVzBrCPName"] = fvRsProv.TnVzBrCPName.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"fvRsProv": childMap}) + fvRsProvChildMapForDelete := NewAciObject() + fvRsProvChildMapForDelete.Attributes["status"] = "deleted" + fvRsProvChildMapForDelete.Attributes["tnVzBrCPName"] = fvRsProv.TnVzBrCPName.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"fvRsProv": fvRsProvChildMapForDelete}) } } } else { @@ -5351,27 +9382,103 @@ func getFvAEPgFvRsProvChildPayloads(ctx context.Context, diags *diag.Diagnostics return childPayloads } -func getFvAEPgFvRsSecInheritedChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvAEPgResourceModel, fvRsSecInheritedPlan, fvRsSecInheritedState []FvRsSecInheritedFvAEPgResourceModel) []map[string]interface{} { +func getFvAEPgFvRsSecInheritedChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvAEPgResourceModel, fvRsSecInheritedFvAEPgPlan, fvRsSecInheritedFvAEPgState []FvRsSecInheritedFvAEPgResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.FvRsSecInherited.IsUnknown() { + if !data.FvRsSecInherited.IsNull() && !data.FvRsSecInherited.IsUnknown() { fvRsSecInheritedIdentifiers := []FvRsSecInheritedIdentifier{} - for _, fvRsSecInherited := range fvRsSecInheritedPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !fvRsSecInherited.Annotation.IsUnknown() && !fvRsSecInherited.Annotation.IsNull() { - childMap["attributes"]["annotation"] = fvRsSecInherited.Annotation.ValueString() + for _, fvRsSecInheritedFvAEPg := range fvRsSecInheritedFvAEPgPlan { + FvRsSecInheritedFvAEPgChildren := make([]map[string]interface{}, 0) + childMap := NewAciObject() + if !fvRsSecInheritedFvAEPg.Annotation.IsNull() && !fvRsSecInheritedFvAEPg.Annotation.IsUnknown() { + childMap.Attributes["annotation"] = fvRsSecInheritedFvAEPg.Annotation.ValueString() } else { - childMap["attributes"]["annotation"] = globalAnnotation + childMap.Attributes["annotation"] = globalAnnotation + } + if !fvRsSecInheritedFvAEPg.TDn.IsNull() && !fvRsSecInheritedFvAEPg.TDn.IsUnknown() { + childMap.Attributes["tDn"] = fvRsSecInheritedFvAEPg.TDn.ValueString() + } + + var tagAnnotationFvRsSecInheritedFvAEPgPlan, tagAnnotationFvRsSecInheritedFvAEPgState []TagAnnotationFvRsSecInheritedFvAEPgResourceModel + fvRsSecInheritedFvAEPg.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsSecInheritedFvAEPgPlan, false) + for _, tagAnnotationFvRsSecInheritedFvAEPgstate := range fvRsSecInheritedFvAEPgState { + tagAnnotationFvRsSecInheritedFvAEPgstate.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsSecInheritedFvAEPgState, false) + } + if !fvRsSecInheritedFvAEPg.TagAnnotation.IsNull() && !fvRsSecInheritedFvAEPg.TagAnnotation.IsUnknown() { + tagAnnotationIdentifiers := []TagAnnotationIdentifier{} + for _, tagAnnotationFvRsSecInheritedFvAEPg := range tagAnnotationFvRsSecInheritedFvAEPgPlan { + tagAnnotationFvRsSecInheritedFvAEPgChildMap := NewAciObject() + if !tagAnnotationFvRsSecInheritedFvAEPg.Key.IsNull() && !tagAnnotationFvRsSecInheritedFvAEPg.Key.IsUnknown() { + tagAnnotationFvRsSecInheritedFvAEPgChildMap.Attributes["key"] = tagAnnotationFvRsSecInheritedFvAEPg.Key.ValueString() + } + if !tagAnnotationFvRsSecInheritedFvAEPg.Value.IsNull() && !tagAnnotationFvRsSecInheritedFvAEPg.Value.IsUnknown() { + tagAnnotationFvRsSecInheritedFvAEPgChildMap.Attributes["value"] = tagAnnotationFvRsSecInheritedFvAEPg.Value.ValueString() + } + FvRsSecInheritedFvAEPgChildren = append(FvRsSecInheritedFvAEPgChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsSecInheritedFvAEPgChildMap}) + tagAnnotationIdentifier := TagAnnotationIdentifier{} + tagAnnotationIdentifier.Key = tagAnnotationFvRsSecInheritedFvAEPg.Key + tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) + } + for _, tagAnnotationFvRsSecInheritedFvAEPg := range tagAnnotationFvRsSecInheritedFvAEPgState { + delete := true + for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { + if tagAnnotationIdentifier.Key == tagAnnotationFvRsSecInheritedFvAEPg.Key { + delete = false + break + } + } + if delete { + tagAnnotationFvRsSecInheritedFvAEPgChildMapForDelete := NewAciObject() + tagAnnotationFvRsSecInheritedFvAEPgChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationFvRsSecInheritedFvAEPgChildMapForDelete.Attributes["key"] = tagAnnotationFvRsSecInheritedFvAEPg.Key.ValueString() + FvRsSecInheritedFvAEPgChildren = append(FvRsSecInheritedFvAEPgChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsSecInheritedFvAEPgChildMapForDelete}) + } + } + } + + var tagTagFvRsSecInheritedFvAEPgPlan, tagTagFvRsSecInheritedFvAEPgState []TagTagFvRsSecInheritedFvAEPgResourceModel + fvRsSecInheritedFvAEPg.TagTag.ElementsAs(ctx, &tagTagFvRsSecInheritedFvAEPgPlan, false) + for _, tagTagFvRsSecInheritedFvAEPgstate := range fvRsSecInheritedFvAEPgState { + tagTagFvRsSecInheritedFvAEPgstate.TagTag.ElementsAs(ctx, &tagTagFvRsSecInheritedFvAEPgState, false) } - if !fvRsSecInherited.TDn.IsUnknown() && !fvRsSecInherited.TDn.IsNull() { - childMap["attributes"]["tDn"] = fvRsSecInherited.TDn.ValueString() + if !fvRsSecInheritedFvAEPg.TagTag.IsNull() && !fvRsSecInheritedFvAEPg.TagTag.IsUnknown() { + tagTagIdentifiers := []TagTagIdentifier{} + for _, tagTagFvRsSecInheritedFvAEPg := range tagTagFvRsSecInheritedFvAEPgPlan { + tagTagFvRsSecInheritedFvAEPgChildMap := NewAciObject() + if !tagTagFvRsSecInheritedFvAEPg.Key.IsNull() && !tagTagFvRsSecInheritedFvAEPg.Key.IsUnknown() { + tagTagFvRsSecInheritedFvAEPgChildMap.Attributes["key"] = tagTagFvRsSecInheritedFvAEPg.Key.ValueString() + } + if !tagTagFvRsSecInheritedFvAEPg.Value.IsNull() && !tagTagFvRsSecInheritedFvAEPg.Value.IsUnknown() { + tagTagFvRsSecInheritedFvAEPgChildMap.Attributes["value"] = tagTagFvRsSecInheritedFvAEPg.Value.ValueString() + } + FvRsSecInheritedFvAEPgChildren = append(FvRsSecInheritedFvAEPgChildren, map[string]interface{}{"tagTag": tagTagFvRsSecInheritedFvAEPgChildMap}) + tagTagIdentifier := TagTagIdentifier{} + tagTagIdentifier.Key = tagTagFvRsSecInheritedFvAEPg.Key + tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) + } + for _, tagTagFvRsSecInheritedFvAEPg := range tagTagFvRsSecInheritedFvAEPgState { + delete := true + for _, tagTagIdentifier := range tagTagIdentifiers { + if tagTagIdentifier.Key == tagTagFvRsSecInheritedFvAEPg.Key { + delete = false + break + } + } + if delete { + tagTagFvRsSecInheritedFvAEPgChildMapForDelete := NewAciObject() + tagTagFvRsSecInheritedFvAEPgChildMapForDelete.Attributes["status"] = "deleted" + tagTagFvRsSecInheritedFvAEPgChildMapForDelete.Attributes["key"] = tagTagFvRsSecInheritedFvAEPg.Key.ValueString() + FvRsSecInheritedFvAEPgChildren = append(FvRsSecInheritedFvAEPgChildren, map[string]interface{}{"tagTag": tagTagFvRsSecInheritedFvAEPgChildMapForDelete}) + } + } } + childMap.Children = FvRsSecInheritedFvAEPgChildren childPayloads = append(childPayloads, map[string]interface{}{"fvRsSecInherited": childMap}) fvRsSecInheritedIdentifier := FvRsSecInheritedIdentifier{} - fvRsSecInheritedIdentifier.TDn = fvRsSecInherited.TDn + fvRsSecInheritedIdentifier.TDn = fvRsSecInheritedFvAEPg.TDn fvRsSecInheritedIdentifiers = append(fvRsSecInheritedIdentifiers, fvRsSecInheritedIdentifier) } - for _, fvRsSecInherited := range fvRsSecInheritedState { + for _, fvRsSecInherited := range fvRsSecInheritedFvAEPgState { delete := true for _, fvRsSecInheritedIdentifier := range fvRsSecInheritedIdentifiers { if fvRsSecInheritedIdentifier.TDn == fvRsSecInherited.TDn { @@ -5380,10 +9487,10 @@ func getFvAEPgFvRsSecInheritedChildPayloads(ctx context.Context, diags *diag.Dia } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["tDn"] = fvRsSecInherited.TDn.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"fvRsSecInherited": childMap}) + fvRsSecInheritedChildMapForDelete := NewAciObject() + fvRsSecInheritedChildMapForDelete.Attributes["status"] = "deleted" + fvRsSecInheritedChildMapForDelete.Attributes["tDn"] = fvRsSecInherited.TDn.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"fvRsSecInherited": fvRsSecInheritedChildMapForDelete}) } } } else { @@ -5392,23 +9499,99 @@ func getFvAEPgFvRsSecInheritedChildPayloads(ctx context.Context, diags *diag.Dia return childPayloads } -func getFvAEPgFvRsTrustCtrlChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvAEPgResourceModel, fvRsTrustCtrlPlan, fvRsTrustCtrlState FvRsTrustCtrlFvAEPgResourceModel) []map[string]interface{} { +func getFvAEPgFvRsTrustCtrlChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvAEPgResourceModel, fvRsTrustCtrlFvAEPgPlan, fvRsTrustCtrlFvAEPgState FvRsTrustCtrlFvAEPgResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.FvRsTrustCtrl.IsUnknown() { - childMap := map[string]map[string]interface{}{"attributes": {}} + if !data.FvRsTrustCtrl.IsNull() && !data.FvRsTrustCtrl.IsUnknown() { + FvRsTrustCtrlFvAEPgChildren := make([]map[string]interface{}, 0) + childMap := NewAciObject() if !IsEmptySingleNestedAttribute(data.FvRsTrustCtrl.Attributes()) { - if !fvRsTrustCtrlPlan.Annotation.IsUnknown() && !fvRsTrustCtrlPlan.Annotation.IsNull() { - childMap["attributes"]["annotation"] = fvRsTrustCtrlPlan.Annotation.ValueString() + if !fvRsTrustCtrlFvAEPgPlan.Annotation.IsUnknown() && !fvRsTrustCtrlFvAEPgPlan.Annotation.IsNull() { + childMap.Attributes["annotation"] = fvRsTrustCtrlFvAEPgPlan.Annotation.ValueString() } else { - childMap["attributes"]["annotation"] = globalAnnotation + childMap.Attributes["annotation"] = globalAnnotation } - if !fvRsTrustCtrlPlan.TnFhsTrustCtrlPolName.IsUnknown() && !fvRsTrustCtrlPlan.TnFhsTrustCtrlPolName.IsNull() { - childMap["attributes"]["tnFhsTrustCtrlPolName"] = fvRsTrustCtrlPlan.TnFhsTrustCtrlPolName.ValueString() + if !fvRsTrustCtrlFvAEPgPlan.TnFhsTrustCtrlPolName.IsUnknown() && !fvRsTrustCtrlFvAEPgPlan.TnFhsTrustCtrlPolName.IsNull() { + childMap.Attributes["tnFhsTrustCtrlPolName"] = fvRsTrustCtrlFvAEPgPlan.TnFhsTrustCtrlPolName.ValueString() } } else { - childMap["attributes"]["status"] = "deleted" + childMap.Attributes["status"] = "deleted" + } + + var tagAnnotationFvRsTrustCtrlFvAEPgPlan, tagAnnotationFvRsTrustCtrlFvAEPgState []TagAnnotationFvRsTrustCtrlFvAEPgResourceModel + fvRsTrustCtrlFvAEPgPlan.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsTrustCtrlFvAEPgPlan, false) + if !fvRsTrustCtrlFvAEPgState.TagAnnotation.IsNull() { + fvRsTrustCtrlFvAEPgState.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsTrustCtrlFvAEPgState, false) + } + if !fvRsTrustCtrlFvAEPgPlan.TagAnnotation.IsNull() && !fvRsTrustCtrlFvAEPgPlan.TagAnnotation.IsUnknown() { + tagAnnotationIdentifiers := []TagAnnotationIdentifier{} + for _, tagAnnotationFvRsTrustCtrlFvAEPg := range tagAnnotationFvRsTrustCtrlFvAEPgPlan { + tagAnnotationFvRsTrustCtrlFvAEPgChildMap := NewAciObject() + if !tagAnnotationFvRsTrustCtrlFvAEPg.Key.IsNull() && !tagAnnotationFvRsTrustCtrlFvAEPg.Key.IsUnknown() { + tagAnnotationFvRsTrustCtrlFvAEPgChildMap.Attributes["key"] = tagAnnotationFvRsTrustCtrlFvAEPg.Key.ValueString() + } + if !tagAnnotationFvRsTrustCtrlFvAEPg.Value.IsNull() && !tagAnnotationFvRsTrustCtrlFvAEPg.Value.IsUnknown() { + tagAnnotationFvRsTrustCtrlFvAEPgChildMap.Attributes["value"] = tagAnnotationFvRsTrustCtrlFvAEPg.Value.ValueString() + } + FvRsTrustCtrlFvAEPgChildren = append(FvRsTrustCtrlFvAEPgChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsTrustCtrlFvAEPgChildMap}) + tagAnnotationIdentifier := TagAnnotationIdentifier{} + tagAnnotationIdentifier.Key = tagAnnotationFvRsTrustCtrlFvAEPg.Key + tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) + } + for _, tagAnnotationFvRsTrustCtrlFvAEPg := range tagAnnotationFvRsTrustCtrlFvAEPgState { + delete := true + for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { + if tagAnnotationIdentifier.Key == tagAnnotationFvRsTrustCtrlFvAEPg.Key { + delete = false + break + } + } + if delete { + tagAnnotationFvRsTrustCtrlFvAEPgChildMapForDelete := NewAciObject() + tagAnnotationFvRsTrustCtrlFvAEPgChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationFvRsTrustCtrlFvAEPgChildMapForDelete.Attributes["key"] = tagAnnotationFvRsTrustCtrlFvAEPg.Key.ValueString() + FvRsTrustCtrlFvAEPgChildren = append(FvRsTrustCtrlFvAEPgChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsTrustCtrlFvAEPgChildMapForDelete}) + } + } + } + + var tagTagFvRsTrustCtrlFvAEPgPlan, tagTagFvRsTrustCtrlFvAEPgState []TagTagFvRsTrustCtrlFvAEPgResourceModel + fvRsTrustCtrlFvAEPgPlan.TagTag.ElementsAs(ctx, &tagTagFvRsTrustCtrlFvAEPgPlan, false) + if !fvRsTrustCtrlFvAEPgState.TagTag.IsNull() { + fvRsTrustCtrlFvAEPgState.TagTag.ElementsAs(ctx, &tagTagFvRsTrustCtrlFvAEPgState, false) + } + if !fvRsTrustCtrlFvAEPgPlan.TagTag.IsNull() && !fvRsTrustCtrlFvAEPgPlan.TagTag.IsUnknown() { + tagTagIdentifiers := []TagTagIdentifier{} + for _, tagTagFvRsTrustCtrlFvAEPg := range tagTagFvRsTrustCtrlFvAEPgPlan { + tagTagFvRsTrustCtrlFvAEPgChildMap := NewAciObject() + if !tagTagFvRsTrustCtrlFvAEPg.Key.IsNull() && !tagTagFvRsTrustCtrlFvAEPg.Key.IsUnknown() { + tagTagFvRsTrustCtrlFvAEPgChildMap.Attributes["key"] = tagTagFvRsTrustCtrlFvAEPg.Key.ValueString() + } + if !tagTagFvRsTrustCtrlFvAEPg.Value.IsNull() && !tagTagFvRsTrustCtrlFvAEPg.Value.IsUnknown() { + tagTagFvRsTrustCtrlFvAEPgChildMap.Attributes["value"] = tagTagFvRsTrustCtrlFvAEPg.Value.ValueString() + } + FvRsTrustCtrlFvAEPgChildren = append(FvRsTrustCtrlFvAEPgChildren, map[string]interface{}{"tagTag": tagTagFvRsTrustCtrlFvAEPgChildMap}) + tagTagIdentifier := TagTagIdentifier{} + tagTagIdentifier.Key = tagTagFvRsTrustCtrlFvAEPg.Key + tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) + } + for _, tagTagFvRsTrustCtrlFvAEPg := range tagTagFvRsTrustCtrlFvAEPgState { + delete := true + for _, tagTagIdentifier := range tagTagIdentifiers { + if tagTagIdentifier.Key == tagTagFvRsTrustCtrlFvAEPg.Key { + delete = false + break + } + } + if delete { + tagTagFvRsTrustCtrlFvAEPgChildMapForDelete := NewAciObject() + tagTagFvRsTrustCtrlFvAEPgChildMapForDelete.Attributes["status"] = "deleted" + tagTagFvRsTrustCtrlFvAEPgChildMapForDelete.Attributes["key"] = tagTagFvRsTrustCtrlFvAEPg.Key.ValueString() + FvRsTrustCtrlFvAEPgChildren = append(FvRsTrustCtrlFvAEPgChildren, map[string]interface{}{"tagTag": tagTagFvRsTrustCtrlFvAEPgChildMapForDelete}) + } + } } + childMap.Children = FvRsTrustCtrlFvAEPgChildren childPayloads = append(childPayloads, map[string]interface{}{"fvRsTrustCtrl": childMap}) } else { FvRsTrustCtrlObject, _ := types.ObjectValueFrom(ctx, FvRsTrustCtrlFvAEPgType, getEmptyFvRsTrustCtrlFvAEPgResourceModel()) @@ -5417,25 +9600,25 @@ func getFvAEPgFvRsTrustCtrlChildPayloads(ctx context.Context, diags *diag.Diagno return childPayloads } -func getFvAEPgTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvAEPgResourceModel, tagAnnotationPlan, tagAnnotationState []TagAnnotationFvAEPgResourceModel) []map[string]interface{} { +func getFvAEPgTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvAEPgResourceModel, tagAnnotationFvAEPgPlan, tagAnnotationFvAEPgState []TagAnnotationFvAEPgResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagAnnotation.IsUnknown() { + if !data.TagAnnotation.IsNull() && !data.TagAnnotation.IsUnknown() { tagAnnotationIdentifiers := []TagAnnotationIdentifier{} - for _, tagAnnotation := range tagAnnotationPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagAnnotation.Key.IsUnknown() && !tagAnnotation.Key.IsNull() { - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() + for _, tagAnnotationFvAEPg := range tagAnnotationFvAEPgPlan { + childMap := NewAciObject() + if !tagAnnotationFvAEPg.Key.IsNull() && !tagAnnotationFvAEPg.Key.IsUnknown() { + childMap.Attributes["key"] = tagAnnotationFvAEPg.Key.ValueString() } - if !tagAnnotation.Value.IsUnknown() && !tagAnnotation.Value.IsNull() { - childMap["attributes"]["value"] = tagAnnotation.Value.ValueString() + if !tagAnnotationFvAEPg.Value.IsNull() && !tagAnnotationFvAEPg.Value.IsUnknown() { + childMap.Attributes["value"] = tagAnnotationFvAEPg.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) tagAnnotationIdentifier := TagAnnotationIdentifier{} - tagAnnotationIdentifier.Key = tagAnnotation.Key + tagAnnotationIdentifier.Key = tagAnnotationFvAEPg.Key tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) } - for _, tagAnnotation := range tagAnnotationState { + for _, tagAnnotation := range tagAnnotationFvAEPgState { delete := true for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { if tagAnnotationIdentifier.Key == tagAnnotation.Key { @@ -5444,10 +9627,10 @@ func getFvAEPgTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagno } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) + tagAnnotationChildMapForDelete := NewAciObject() + tagAnnotationChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationChildMapForDelete.Attributes["key"] = tagAnnotation.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": tagAnnotationChildMapForDelete}) } } } else { @@ -5456,25 +9639,25 @@ func getFvAEPgTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagno return childPayloads } -func getFvAEPgTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvAEPgResourceModel, tagTagPlan, tagTagState []TagTagFvAEPgResourceModel) []map[string]interface{} { +func getFvAEPgTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvAEPgResourceModel, tagTagFvAEPgPlan, tagTagFvAEPgState []TagTagFvAEPgResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagTag.IsUnknown() { + if !data.TagTag.IsNull() && !data.TagTag.IsUnknown() { tagTagIdentifiers := []TagTagIdentifier{} - for _, tagTag := range tagTagPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagTag.Key.IsUnknown() && !tagTag.Key.IsNull() { - childMap["attributes"]["key"] = tagTag.Key.ValueString() + for _, tagTagFvAEPg := range tagTagFvAEPgPlan { + childMap := NewAciObject() + if !tagTagFvAEPg.Key.IsNull() && !tagTagFvAEPg.Key.IsUnknown() { + childMap.Attributes["key"] = tagTagFvAEPg.Key.ValueString() } - if !tagTag.Value.IsUnknown() && !tagTag.Value.IsNull() { - childMap["attributes"]["value"] = tagTag.Value.ValueString() + if !tagTagFvAEPg.Value.IsNull() && !tagTagFvAEPg.Value.IsUnknown() { + childMap.Attributes["value"] = tagTagFvAEPg.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) tagTagIdentifier := TagTagIdentifier{} - tagTagIdentifier.Key = tagTag.Key + tagTagIdentifier.Key = tagTagFvAEPg.Key tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) } - for _, tagTag := range tagTagState { + for _, tagTag := range tagTagFvAEPgState { delete := true for _, tagTagIdentifier := range tagTagIdentifiers { if tagTagIdentifier.Key == tagTag.Key { @@ -5483,10 +9666,10 @@ func getFvAEPgTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagTag.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) + tagTagChildMapForDelete := NewAciObject() + tagTagChildMapForDelete.Attributes["status"] = "deleted" + tagTagChildMapForDelete.Attributes["key"] = tagTag.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagTag": tagTagChildMapForDelete}) } } } else { diff --git a/internal/provider/resource_aci_application_epg_test.go b/internal/provider/resource_aci_application_epg_test.go index 72d298725..0a54c0421 100644 --- a/internal/provider/resource_aci_application_epg_test.go +++ b/internal/provider/resource_aci_application_epg_test.go @@ -49,7 +49,7 @@ func TestAccResourceFvAEPgWithFvAp(t *testing.T) { resource.TestCheckResourceAttr("aci_application_epg.allow_test_2", "priority", "unspecified"), resource.TestCheckResourceAttr("aci_application_epg.allow_test", "useg_epg", "no"), resource.TestCheckResourceAttr("aci_application_epg.allow_test_2", "useg_epg", "no"), - composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)", ">=", resource.TestCheckResourceAttr("aci_application_epg.allow_test", "admin_state", "no"), resource.TestCheckResourceAttr("aci_application_epg.allow_test_2", "admin_state", "no"), resource.TestCheckResourceAttr("aci_application_epg.allow_test", "has_multicast_source", "no"), @@ -107,7 +107,7 @@ func TestAccResourceFvAEPgWithFvAp(t *testing.T) { resource.TestCheckResourceAttr("aci_application_epg.allow_test_2", "priority", "unspecified"), resource.TestCheckResourceAttr("aci_application_epg.allow_test", "useg_epg", "no"), resource.TestCheckResourceAttr("aci_application_epg.allow_test_2", "useg_epg", "no"), - composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)", ">=", resource.TestCheckResourceAttr("aci_application_epg.allow_test", "admin_state", "no"), resource.TestCheckResourceAttr("aci_application_epg.allow_test_2", "admin_state", "no"), resource.TestCheckResourceAttr("aci_application_epg.allow_test", "has_multicast_source", "no"), @@ -140,7 +140,7 @@ func TestAccResourceFvAEPgWithFvAp(t *testing.T) { resource.TestCheckResourceAttr("aci_application_epg.test", "preferred_group_member", "exclude"), resource.TestCheckResourceAttr("aci_application_epg.test", "priority", "unspecified"), resource.TestCheckResourceAttr("aci_application_epg.test", "useg_epg", "no"), - composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)", ">=", resource.TestCheckResourceAttr("aci_application_epg.test", "admin_state", "no"), resource.TestCheckResourceAttr("aci_application_epg.test", "has_multicast_source", "no")), resource.TestCheckResourceAttrSet("aci_application_epg.test", "pc_tag"), @@ -163,7 +163,7 @@ func TestAccResourceFvAEPgWithFvAp(t *testing.T) { resource.TestCheckResourceAttr("aci_application_epg.test", "preferred_group_member", "exclude"), resource.TestCheckResourceAttr("aci_application_epg.test", "priority", "level1"), resource.TestCheckResourceAttr("aci_application_epg.test", "useg_epg", "no"), - composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)", ">=", resource.TestCheckResourceAttr("aci_application_epg.test", "admin_state", "no"), resource.TestCheckResourceAttr("aci_application_epg.test", "has_multicast_source", "no")), resource.TestCheckResourceAttrSet("aci_application_epg.test", "pc_tag"), @@ -195,7 +195,7 @@ func TestAccResourceFvAEPgWithFvAp(t *testing.T) { resource.TestCheckResourceAttr("aci_application_epg.test", "preferred_group_member", "exclude"), resource.TestCheckResourceAttr("aci_application_epg.test", "priority", "unspecified"), resource.TestCheckResourceAttr("aci_application_epg.test", "useg_epg", "no"), - composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)", ">=", resource.TestCheckResourceAttr("aci_application_epg.test", "admin_state", "no"), resource.TestCheckResourceAttr("aci_application_epg.test", "has_multicast_source", "no")), resource.TestCheckResourceAttrSet("aci_application_epg.test", "pc_tag"), @@ -224,7 +224,7 @@ func TestAccResourceFvAEPgWithFvAp(t *testing.T) { resource.TestCheckResourceAttr("aci_application_epg.test", "preferred_group_member", "exclude"), resource.TestCheckResourceAttr("aci_application_epg.test", "priority", "unspecified"), resource.TestCheckResourceAttr("aci_application_epg.test", "useg_epg", "no"), - composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)", ">=", resource.TestCheckResourceAttr("aci_application_epg.test", "admin_state", "no"), resource.TestCheckResourceAttr("aci_application_epg.test", "has_multicast_source", "no")), resource.TestCheckResourceAttrSet("aci_application_epg.test", "pc_tag"), @@ -239,7 +239,7 @@ func TestAccResourceFvAEPgWithFvAp(t *testing.T) { resource.TestCheckResourceAttr("aci_application_epg.test", "epg_useg_block_statement.name_alias", "name_alias_1"), resource.TestCheckResourceAttr("aci_application_epg.test", "epg_useg_block_statement.owner_key", "owner_key_1"), resource.TestCheckResourceAttr("aci_application_epg.test", "epg_useg_block_statement.owner_tag", "owner_tag_1"), - composeAggregateTestCheckFuncWithVersion(t, "4.1(1i)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.1(1i)", ">=", resource.TestCheckResourceAttr("aci_application_epg.test", "epg_useg_block_statement.precedence", "1"), resource.TestCheckResourceAttr("aci_application_epg.test", "epg_useg_block_statement.scope", "scope-bd")), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_application_epg_monitoring_policy.annotation", "annotation_1"), @@ -278,11 +278,11 @@ func TestAccResourceFvAEPgWithFvAp(t *testing.T) { resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.switching_mode", "AVE"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.target_dn", "uni/vmmp-VMware/dom-domain_1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.untagged", "no"), - composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)", ">=", resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.binding_type", "dynamicBinding"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.number_of_ports", "1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.port_allocation", "elastic")), - composeAggregateTestCheckFuncWithVersion(t, "4.2(3j)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.2(3j)", ">=", resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.custom_epg_name", "custom_epg_name_1")), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.annotation", "annotation_2"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.class_preference", "useg"), @@ -302,11 +302,11 @@ func TestAccResourceFvAEPgWithFvAp(t *testing.T) { resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.switching_mode", "native"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.target_dn", "uni/vmmp-VMware/dom-domain_2"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.untagged", "yes"), - composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)", ">=", resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.binding_type", "ephemeral"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.number_of_ports", "0"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.port_allocation", "fixed")), - composeAggregateTestCheckFuncWithVersion(t, "4.2(3j)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.2(3j)", ">=", resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.custom_epg_name", "custom_epg_name_2")), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.0.annotation", "annotation_1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.0.description", "description_1"), @@ -397,36 +397,136 @@ func TestAccResourceFvAEPgWithFvAp(t *testing.T) { resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.1.value", "test_value"), resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.#", "2"), resource.TestCheckResourceAttr("aci_application_epg.test", "epg_useg_block_statement.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "epg_useg_block_statement.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_application_epg.test", "epg_useg_block_statement.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "epg_useg_block_statement.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "epg_useg_block_statement.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.#", "2"), + resource.TestCheckResourceAttr("aci_application_epg.test", "epg_useg_block_statement.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_application_epg.test", "epg_useg_block_statement.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "epg_useg_block_statement.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "epg_useg_block_statement.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "tags.#", "2"), resource.TestCheckResourceAttr("aci_application_epg.test", "epg_useg_block_statement.description", "description_1"), resource.TestCheckResourceAttr("aci_application_epg.test", "epg_useg_block_statement.match", "all"), resource.TestCheckResourceAttr("aci_application_epg.test", "epg_useg_block_statement.name", "criterion"), resource.TestCheckResourceAttr("aci_application_epg.test", "epg_useg_block_statement.name_alias", "name_alias_1"), resource.TestCheckResourceAttr("aci_application_epg.test", "epg_useg_block_statement.owner_key", "owner_key_1"), resource.TestCheckResourceAttr("aci_application_epg.test", "epg_useg_block_statement.owner_tag", "owner_tag_1"), - composeAggregateTestCheckFuncWithVersion(t, "4.1(1i)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.1(1i)", ">=", resource.TestCheckResourceAttr("aci_application_epg.test", "epg_useg_block_statement.precedence", "1"), resource.TestCheckResourceAttr("aci_application_epg.test", "epg_useg_block_statement.scope", "scope-bd")), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_application_epg_monitoring_policy.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_application_epg_monitoring_policy.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_application_epg_monitoring_policy.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_application_epg_monitoring_policy.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_application_epg_monitoring_policy.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.#", "2"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_application_epg_monitoring_policy.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_application_epg_monitoring_policy.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_application_epg_monitoring_policy.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_application_epg_monitoring_policy.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "tags.#", "2"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_application_epg_monitoring_policy.monitoring_policy_name", "monitoring_policy_name_1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_bridge_domain.annotation", "annotation_1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_bridge_domain.bridge_domain_name", "bridge_domain_name_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_bridge_domain.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_bridge_domain.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_bridge_domain.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_bridge_domain.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.#", "2"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_bridge_domain.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_bridge_domain.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_bridge_domain.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_bridge_domain.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "tags.#", "2"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_consumed_contracts.0.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_consumed_contracts.0.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_consumed_contracts.0.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_consumed_contracts.0.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_consumed_contracts.0.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.#", "2"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_consumed_contracts.0.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_consumed_contracts.0.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_consumed_contracts.0.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_consumed_contracts.0.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "tags.#", "2"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_consumed_contracts.0.contract_name", "contract_name_0"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_consumed_contracts.0.priority", "level1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_consumed_contracts.1.annotation", "annotation_2"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_consumed_contracts.1.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_consumed_contracts.1.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_consumed_contracts.1.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_consumed_contracts.1.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.#", "2"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_consumed_contracts.1.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_consumed_contracts.1.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_consumed_contracts.1.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_consumed_contracts.1.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "tags.#", "2"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_consumed_contracts.1.contract_name", "contract_name_1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_consumed_contracts.1.priority", "level2"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_consumed_contracts.#", "2"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_contract_masters.0.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_contract_masters.0.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_contract_masters.0.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_contract_masters.0.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_contract_masters.0.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.#", "2"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_contract_masters.0.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_contract_masters.0.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_contract_masters.0.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_contract_masters.0.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "tags.#", "2"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_contract_masters.0.target_dn", "uni/tn-test_tenant/ap-test_ap/epg-epg_2"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_contract_masters.1.annotation", "annotation_2"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_contract_masters.1.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_contract_masters.1.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_contract_masters.1.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_contract_masters.1.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.#", "2"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_contract_masters.1.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_contract_masters.1.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_contract_masters.1.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_contract_masters.1.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "tags.#", "2"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_contract_masters.1.target_dn", "uni/tn-test_tenant/ap-test_ap/epg-epg_3"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_contract_masters.#", "2"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_custom_qos_policy.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_custom_qos_policy.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_custom_qos_policy.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_custom_qos_policy.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_custom_qos_policy.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.#", "2"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_custom_qos_policy.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_custom_qos_policy.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_custom_qos_policy.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_custom_qos_policy.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "tags.#", "2"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_custom_qos_policy.custom_qos_policy_name", "custom_qos_policy_name_1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_data_plane_policing_policy.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_data_plane_policing_policy.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_data_plane_policing_policy.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_data_plane_policing_policy.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_data_plane_policing_policy.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.#", "2"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_data_plane_policing_policy.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_data_plane_policing_policy.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_data_plane_policing_policy.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_data_plane_policing_policy.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "tags.#", "2"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_data_plane_policing_policy.data_plane_policing_policy_name", "data_plane_policing_policy_name_1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.#", "2"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "tags.#", "2"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.class_preference", "encap"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.delimiter", "@"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.deployment_immediacy", "immediate"), @@ -444,13 +544,23 @@ func TestAccResourceFvAEPgWithFvAp(t *testing.T) { resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.switching_mode", "AVE"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.target_dn", "uni/vmmp-VMware/dom-domain_1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.untagged", "no"), - composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)", ">=", resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.binding_type", "dynamicBinding"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.number_of_ports", "1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.port_allocation", "elastic")), - composeAggregateTestCheckFuncWithVersion(t, "4.2(3j)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.2(3j)", ">=", resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.custom_epg_name", "custom_epg_name_1")), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.annotation", "annotation_2"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.#", "2"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "tags.#", "2"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.class_preference", "useg"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.delimiter", ""), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.deployment_immediacy", "lazy"), @@ -468,52 +578,152 @@ func TestAccResourceFvAEPgWithFvAp(t *testing.T) { resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.switching_mode", "native"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.target_dn", "uni/vmmp-VMware/dom-domain_2"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.untagged", "yes"), - composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)", ">=", resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.binding_type", "ephemeral"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.number_of_ports", "0"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.port_allocation", "fixed")), - composeAggregateTestCheckFuncWithVersion(t, "4.2(3j)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.2(3j)", ">=", resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.custom_epg_name", "custom_epg_name_2")), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.#", "2"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.0.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.0.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.0.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.0.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.0.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.#", "2"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.0.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.0.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.0.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.0.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "tags.#", "2"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.0.description", "description_1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.0.target_dn", "topology/pod-1/paths-101/pathep-[eth1/1]"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.0.vsan", "vsan-10"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.0.vsan_mode", "native"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.1.annotation", "annotation_2"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.1.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.1.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.1.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.1.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.#", "2"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.1.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.1.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.1.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.1.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "tags.#", "2"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.1.description", "description_2"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.1.target_dn", "topology/pod-1/paths-101/pathep-[eth1/2]"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.1.vsan", "unknown"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.1.vsan_mode", "regular"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.#", "2"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.0.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.0.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.0.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.0.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.0.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.#", "2"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.0.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.0.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.0.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.0.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "tags.#", "2"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.0.imported_contract_name", "imported_contract_name_0"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.0.priority", "level1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.1.annotation", "annotation_2"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.1.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.1.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.1.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.1.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.#", "2"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.1.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.1.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.1.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.1.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "tags.#", "2"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.1.imported_contract_name", "imported_contract_name_1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.1.priority", "level2"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.#", "2"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_intra_epg_contracts.0.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_intra_epg_contracts.0.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_intra_epg_contracts.0.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_intra_epg_contracts.0.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_intra_epg_contracts.0.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.#", "2"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_intra_epg_contracts.0.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_intra_epg_contracts.0.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_intra_epg_contracts.0.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_intra_epg_contracts.0.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "tags.#", "2"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_intra_epg_contracts.0.contract_name", "contract_name_0"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_intra_epg_contracts.1.annotation", "annotation_2"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_intra_epg_contracts.1.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_intra_epg_contracts.1.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_intra_epg_contracts.1.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_intra_epg_contracts.1.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.#", "2"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_intra_epg_contracts.1.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_intra_epg_contracts.1.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_intra_epg_contracts.1.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_intra_epg_contracts.1.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "tags.#", "2"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_intra_epg_contracts.1.contract_name", "contract_name_1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_intra_epg_contracts.#", "2"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.0.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.0.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.0.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.0.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.0.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.#", "2"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.0.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.0.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.0.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.0.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "tags.#", "2"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.0.contract_name", "contract_name_0"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.0.match_criteria", "All"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.0.priority", "level1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.1.annotation", "annotation_2"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.1.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.1.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.1.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.1.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.#", "2"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.1.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.1.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.1.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.1.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "tags.#", "2"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.1.contract_name", "contract_name_1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.1.match_criteria", "AtleastOne"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.1.priority", "level2"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.#", "2"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.0.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.0.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.0.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.0.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.0.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.#", "2"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.0.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.0.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.0.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.0.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "tags.#", "2"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.0.deployment_immediacy", "immediate"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.0.description", "description_1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.0.encapsulation", "vlan-100"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.0.mode", "native"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.0.target_dn", "topology/pod-1/node-101"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.1.annotation", "annotation_2"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.1.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.1.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.1.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.1.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.#", "2"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.1.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.1.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.1.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.1.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "tags.#", "2"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.1.deployment_immediacy", "lazy"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.1.description", "description_2"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.1.encapsulation", "vlan-101"), @@ -521,6 +731,16 @@ func TestAccResourceFvAEPgWithFvAp(t *testing.T) { resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.1.target_dn", "topology/pod-1/node-102"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.#", "2"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.0.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.0.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.0.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.0.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.0.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.#", "2"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.0.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.0.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.0.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.0.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "tags.#", "2"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.0.deployment_immediacy", "immediate"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.0.description", "description_1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.0.encapsulation", "vlan-202"), @@ -528,6 +748,16 @@ func TestAccResourceFvAEPgWithFvAp(t *testing.T) { resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.0.primary_encapsulation", "vlan-203"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.0.target_dn", "topology/pod-1/paths-101/pathep-[eth1/1]"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.1.annotation", "annotation_2"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.1.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.1.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.1.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.1.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.#", "2"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.1.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.1.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.1.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.1.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "tags.#", "2"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.1.deployment_immediacy", "lazy"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.1.description", "description_2"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.1.encapsulation", "vlan-201"), @@ -536,11 +766,41 @@ func TestAccResourceFvAEPgWithFvAp(t *testing.T) { resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.1.target_dn", "topology/pod-1/paths-101/pathep-[eth1/2]"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.#", "2"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_taboo_contracts.0.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_taboo_contracts.0.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_taboo_contracts.0.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_taboo_contracts.0.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_taboo_contracts.0.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.#", "2"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_taboo_contracts.0.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_taboo_contracts.0.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_taboo_contracts.0.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_taboo_contracts.0.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "tags.#", "2"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_taboo_contracts.0.taboo_contract_name", "taboo_contract_name_0"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_taboo_contracts.1.annotation", "annotation_2"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_taboo_contracts.1.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_taboo_contracts.1.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_taboo_contracts.1.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_taboo_contracts.1.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.#", "2"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_taboo_contracts.1.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_taboo_contracts.1.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_taboo_contracts.1.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_taboo_contracts.1.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "tags.#", "2"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_taboo_contracts.1.taboo_contract_name", "taboo_contract_name_1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_taboo_contracts.#", "2"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_trust_control_policy.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_trust_control_policy.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_trust_control_policy.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_trust_control_policy.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_trust_control_policy.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.#", "2"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_trust_control_policy.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_trust_control_policy.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_trust_control_policy.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_trust_control_policy.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "tags.#", "2"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_trust_control_policy.trust_control_policy_name", "trust_control_policy_name_1"), resource.TestCheckResourceAttr("aci_application_epg.test", "tags.0.key", "key_0"), resource.TestCheckResourceAttr("aci_application_epg.test", "tags.0.value", "value_1"), @@ -560,16 +820,46 @@ func TestAccResourceFvAEPgWithFvAp(t *testing.T) { resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.#", "1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_bridge_domain.annotation", "annotation_1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_bridge_domain.bridge_domain_name", "bridge_domain_name_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_bridge_domain.annotations.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_bridge_domain.annotations.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_bridge_domain.annotations.#", "1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_bridge_domain.tags.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_bridge_domain.tags.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_bridge_domain.tags.#", "1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_consumed_contracts.0.annotation", "annotation_2"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_consumed_contracts.0.annotations.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_consumed_contracts.0.annotations.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_consumed_contracts.0.annotations.#", "1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_consumed_contracts.0.tags.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_consumed_contracts.0.tags.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_consumed_contracts.0.tags.#", "1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_consumed_contracts.0.contract_name", "contract_name_1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_consumed_contracts.0.priority", "level2"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_consumed_contracts.#", "1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_contract_masters.0.annotation", "annotation_2"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_contract_masters.0.annotations.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_contract_masters.0.annotations.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_contract_masters.0.annotations.#", "1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_contract_masters.0.tags.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_contract_masters.0.tags.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_contract_masters.0.tags.#", "1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_contract_masters.0.target_dn", "uni/tn-test_tenant/ap-test_ap/epg-epg_3"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_contract_masters.#", "1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_custom_qos_policy.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_custom_qos_policy.annotations.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_custom_qos_policy.annotations.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_custom_qos_policy.annotations.#", "1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_custom_qos_policy.tags.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_custom_qos_policy.tags.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_custom_qos_policy.tags.#", "1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_custom_qos_policy.custom_qos_policy_name", "custom_qos_policy_name_1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.annotation", "annotation_2"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.annotations.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.annotations.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.annotations.#", "1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.tags.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.tags.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.tags.#", "1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.class_preference", "useg"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.delimiter", ""), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.deployment_immediacy", "lazy"), @@ -587,32 +877,62 @@ func TestAccResourceFvAEPgWithFvAp(t *testing.T) { resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.switching_mode", "native"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.target_dn", "uni/vmmp-VMware/dom-domain_2"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.untagged", "yes"), - composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)", ">=", resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.binding_type", "ephemeral"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.number_of_ports", "0"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.port_allocation", "fixed")), - composeAggregateTestCheckFuncWithVersion(t, "4.2(3j)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.2(3j)", ">=", resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.custom_epg_name", "custom_epg_name_2")), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.#", "1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.0.annotation", "annotation_2"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.0.annotations.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.0.annotations.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.0.annotations.#", "1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.0.tags.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.0.tags.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.0.tags.#", "1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.0.description", "description_2"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.0.target_dn", "topology/pod-1/paths-101/pathep-[eth1/2]"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.0.vsan", "unknown"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.0.vsan_mode", "regular"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.#", "1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.0.annotation", "annotation_2"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.0.annotations.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.0.annotations.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.0.annotations.#", "1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.0.tags.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.0.tags.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.0.tags.#", "1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.0.imported_contract_name", "imported_contract_name_1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.0.priority", "level2"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.#", "1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_intra_epg_contracts.0.annotation", "annotation_2"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_intra_epg_contracts.0.annotations.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_intra_epg_contracts.0.annotations.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_intra_epg_contracts.0.annotations.#", "1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_intra_epg_contracts.0.tags.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_intra_epg_contracts.0.tags.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_intra_epg_contracts.0.tags.#", "1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_intra_epg_contracts.0.contract_name", "contract_name_1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_intra_epg_contracts.#", "1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.0.annotation", "annotation_2"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.0.annotations.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.0.annotations.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.0.annotations.#", "1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.0.tags.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.0.tags.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.0.tags.#", "1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.0.contract_name", "contract_name_1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.0.match_criteria", "AtleastOne"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.0.priority", "level2"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.#", "1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.0.annotation", "annotation_2"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.0.annotations.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.0.annotations.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.0.annotations.#", "1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.0.tags.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.0.tags.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.0.tags.#", "1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.0.deployment_immediacy", "lazy"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.0.description", "description_2"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.0.encapsulation", "vlan-101"), @@ -620,6 +940,12 @@ func TestAccResourceFvAEPgWithFvAp(t *testing.T) { resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.0.target_dn", "topology/pod-1/node-102"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.#", "1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.0.annotation", "annotation_2"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.0.annotations.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.0.annotations.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.0.annotations.#", "1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.0.tags.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.0.tags.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.0.tags.#", "1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.0.deployment_immediacy", "lazy"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.0.description", "description_2"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.0.encapsulation", "vlan-201"), @@ -628,6 +954,12 @@ func TestAccResourceFvAEPgWithFvAp(t *testing.T) { resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.0.target_dn", "topology/pod-1/paths-101/pathep-[eth1/2]"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.#", "1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_taboo_contracts.0.annotation", "annotation_2"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_taboo_contracts.0.annotations.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_taboo_contracts.0.annotations.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_taboo_contracts.0.annotations.#", "1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_taboo_contracts.0.tags.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_taboo_contracts.0.tags.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_taboo_contracts.0.tags.#", "1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_taboo_contracts.0.taboo_contract_name", "taboo_contract_name_1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_taboo_contracts.#", "1"), resource.TestCheckResourceAttr("aci_application_epg.test", "tags.0.key", "key_1"), @@ -640,6 +972,8 @@ func TestAccResourceFvAEPgWithFvAp(t *testing.T) { knownvalue.MapExact( map[string]knownvalue.Check{ "annotation": knownvalue.Null(), + "annotations": knownvalue.Null(), + "tags": knownvalue.Null(), "description": knownvalue.Null(), "match": knownvalue.Null(), "name": knownvalue.Null(), @@ -656,6 +990,8 @@ func TestAccResourceFvAEPgWithFvAp(t *testing.T) { knownvalue.MapExact( map[string]knownvalue.Check{ "annotation": knownvalue.Null(), + "annotations": knownvalue.Null(), + "tags": knownvalue.Null(), "monitoring_policy_name": knownvalue.Null(), }, ), @@ -665,6 +1001,8 @@ func TestAccResourceFvAEPgWithFvAp(t *testing.T) { knownvalue.MapExact( map[string]knownvalue.Check{ "annotation": knownvalue.Null(), + "annotations": knownvalue.Null(), + "tags": knownvalue.Null(), "data_plane_policing_policy_name": knownvalue.Null(), }, ), @@ -674,6 +1012,8 @@ func TestAccResourceFvAEPgWithFvAp(t *testing.T) { knownvalue.MapExact( map[string]knownvalue.Check{ "annotation": knownvalue.Null(), + "annotations": knownvalue.Null(), + "tags": knownvalue.Null(), "trust_control_policy_name": knownvalue.Null(), }, ), @@ -689,9 +1029,13 @@ func TestAccResourceFvAEPgWithFvAp(t *testing.T) { resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.#", "0"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_bridge_domain.annotation", "annotation_1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_bridge_domain.bridge_domain_name", "bridge_domain_name_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_bridge_domain.annotations.#", "0"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_bridge_domain.tags.#", "0"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_consumed_contracts.#", "0"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_contract_masters.#", "0"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_custom_qos_policy.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_custom_qos_policy.annotations.#", "0"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_custom_qos_policy.tags.#", "0"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_custom_qos_policy.custom_qos_policy_name", "custom_qos_policy_name_1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.#", "0"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.#", "0"), @@ -709,6 +1053,8 @@ func TestAccResourceFvAEPgWithFvAp(t *testing.T) { knownvalue.MapExact( map[string]knownvalue.Check{ "annotation": knownvalue.Null(), + "annotations": knownvalue.Null(), + "tags": knownvalue.Null(), "description": knownvalue.Null(), "match": knownvalue.Null(), "name": knownvalue.Null(), @@ -725,6 +1071,8 @@ func TestAccResourceFvAEPgWithFvAp(t *testing.T) { knownvalue.MapExact( map[string]knownvalue.Check{ "annotation": knownvalue.Null(), + "annotations": knownvalue.Null(), + "tags": knownvalue.Null(), "monitoring_policy_name": knownvalue.Null(), }, ), @@ -734,6 +1082,8 @@ func TestAccResourceFvAEPgWithFvAp(t *testing.T) { knownvalue.MapExact( map[string]knownvalue.Check{ "annotation": knownvalue.Null(), + "annotations": knownvalue.Null(), + "tags": knownvalue.Null(), "data_plane_policing_policy_name": knownvalue.Null(), }, ), @@ -743,6 +1093,8 @@ func TestAccResourceFvAEPgWithFvAp(t *testing.T) { knownvalue.MapExact( map[string]knownvalue.Check{ "annotation": knownvalue.Null(), + "annotations": knownvalue.Null(), + "tags": knownvalue.Null(), "trust_control_policy_name": knownvalue.Null(), }, ), @@ -837,17 +1189,37 @@ resource "aci_application_epg" "test" { parent_dn = aci_application_profile.test.id name = "test_name" annotations = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] epg_useg_block_statement = { annotation = "annotation_1" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] description = "description_1" match = "all" name = "criterion" @@ -859,205 +1231,705 @@ resource "aci_application_epg" "test" { } relation_to_application_epg_monitoring_policy = { annotation = "annotation_1" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] monitoring_policy_name = "monitoring_policy_name_1" } relation_to_bridge_domain = { annotation = "annotation_1" bridge_domain_name = "bridge_domain_name_1" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] } relation_to_consumed_contracts = [ - { - annotation = "annotation_1" - contract_name = "contract_name_0" - priority = "level1" - }, - { - annotation = "annotation_2" - contract_name = "contract_name_1" - priority = "level2" - }, + { + annotation = "annotation_1" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + contract_name = "contract_name_0" + priority = "level1" + }, + { + annotation = "annotation_2" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + contract_name = "contract_name_1" + priority = "level2" + }, ] relation_to_contract_masters = [ - { - annotation = "annotation_1" - target_dn = aci_application_epg.test_application_epg_0.id - }, - { - annotation = "annotation_2" - target_dn = aci_application_epg.test_application_epg_1.id - }, + { + annotation = "annotation_1" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + target_dn = aci_application_epg.test_application_epg_0.id + }, + { + annotation = "annotation_2" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + target_dn = aci_application_epg.test_application_epg_1.id + }, ] relation_to_custom_qos_policy = { annotation = "annotation_1" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] custom_qos_policy_name = "custom_qos_policy_name_1" } relation_to_data_plane_policing_policy = { annotation = "annotation_1" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] data_plane_policing_policy_name = "data_plane_policing_policy_name_1" } relation_to_domains = [ - { - annotation = "annotation_1" - class_preference = "encap" - delimiter = "@" - deployment_immediacy = "immediate" - enable_netflow = "disabled" - encapsulation = "vlan-100" - encapsulation_mode = "auto" - epg_cos = "Cos0" - epg_cos_pref = "disabled" - lag_policy_name = "lag_policy_name_1" - netflow_direction = "both" - primary_encapsulation = "vlan-200" - primary_encapsulation_inner = "vlan-300" - resolution_immediacy = "immediate" - secondary_encapsulation_inner = "vlan-400" - switching_mode = "AVE" - target_dn = "uni/vmmp-VMware/dom-domain_1" - untagged = "no" - binding_type = provider::aci::compare_versions(data.aci_system.version.version,">=","4.0(1h)") ? "dynamicBinding" : null - number_of_ports = provider::aci::compare_versions(data.aci_system.version.version,">=","4.0(1h)") ? "1" : null - port_allocation = provider::aci::compare_versions(data.aci_system.version.version,">=","4.0(1h)") ? "elastic" : null - custom_epg_name = provider::aci::compare_versions(data.aci_system.version.version,">=","4.2(3j)") ? "custom_epg_name_1" : null - }, - { - annotation = "annotation_2" - class_preference = "useg" - delimiter = "" - deployment_immediacy = "lazy" - enable_netflow = "enabled" - encapsulation = "unknown" - encapsulation_mode = "vlan" - epg_cos = "Cos1" - epg_cos_pref = "enabled" - lag_policy_name = "lag_policy_name_2" - netflow_direction = "egress" - primary_encapsulation = "unknown" - primary_encapsulation_inner = "unknown" - resolution_immediacy = "lazy" - secondary_encapsulation_inner = "unknown" - switching_mode = "native" - target_dn = "uni/vmmp-VMware/dom-domain_2" - untagged = "yes" - binding_type = provider::aci::compare_versions(data.aci_system.version.version,">=","4.0(1h)") ? "ephemeral" : null - number_of_ports = provider::aci::compare_versions(data.aci_system.version.version,">=","4.0(1h)") ? "0" : null - port_allocation = provider::aci::compare_versions(data.aci_system.version.version,">=","4.0(1h)") ? "fixed" : null - custom_epg_name = provider::aci::compare_versions(data.aci_system.version.version,">=","4.2(3j)") ? "custom_epg_name_2" : null - }, + { + annotation = "annotation_1" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + class_preference = "encap" + delimiter = "@" + deployment_immediacy = "immediate" + enable_netflow = "disabled" + encapsulation = "vlan-100" + encapsulation_mode = "auto" + epg_cos = "Cos0" + epg_cos_pref = "disabled" + lag_policy_name = "lag_policy_name_1" + netflow_direction = "both" + primary_encapsulation = "vlan-200" + primary_encapsulation_inner = "vlan-300" + resolution_immediacy = "immediate" + secondary_encapsulation_inner = "vlan-400" + switching_mode = "AVE" + target_dn = "uni/vmmp-VMware/dom-domain_1" + untagged = "no" + binding_type = provider::aci::compare_versions(data.aci_system.version.version,">=","4.0(1h)") ? "dynamicBinding" : null + number_of_ports = provider::aci::compare_versions(data.aci_system.version.version,">=","4.0(1h)") ? "1" : null + port_allocation = provider::aci::compare_versions(data.aci_system.version.version,">=","4.0(1h)") ? "elastic" : null + custom_epg_name = provider::aci::compare_versions(data.aci_system.version.version,">=","4.2(3j)") ? "custom_epg_name_1" : null + }, + { + annotation = "annotation_2" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + class_preference = "useg" + delimiter = "" + deployment_immediacy = "lazy" + enable_netflow = "enabled" + encapsulation = "unknown" + encapsulation_mode = "vlan" + epg_cos = "Cos1" + epg_cos_pref = "enabled" + lag_policy_name = "lag_policy_name_2" + netflow_direction = "egress" + primary_encapsulation = "unknown" + primary_encapsulation_inner = "unknown" + resolution_immediacy = "lazy" + secondary_encapsulation_inner = "unknown" + switching_mode = "native" + target_dn = "uni/vmmp-VMware/dom-domain_2" + untagged = "yes" + binding_type = provider::aci::compare_versions(data.aci_system.version.version,">=","4.0(1h)") ? "ephemeral" : null + number_of_ports = provider::aci::compare_versions(data.aci_system.version.version,">=","4.0(1h)") ? "0" : null + port_allocation = provider::aci::compare_versions(data.aci_system.version.version,">=","4.0(1h)") ? "fixed" : null + custom_epg_name = provider::aci::compare_versions(data.aci_system.version.version,">=","4.2(3j)") ? "custom_epg_name_2" : null + }, ] relation_to_fibre_channel_paths = [ - { - annotation = "annotation_1" - description = "description_1" - target_dn = "topology/pod-1/paths-101/pathep-[eth1/1]" - vsan = "vsan-10" - vsan_mode = "native" - }, - { - annotation = "annotation_2" - description = "description_2" - target_dn = "topology/pod-1/paths-101/pathep-[eth1/2]" - vsan = "unknown" - vsan_mode = "regular" - }, + { + annotation = "annotation_1" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + description = "description_1" + target_dn = "topology/pod-1/paths-101/pathep-[eth1/1]" + vsan = "vsan-10" + vsan_mode = "native" + }, + { + annotation = "annotation_2" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + description = "description_2" + target_dn = "topology/pod-1/paths-101/pathep-[eth1/2]" + vsan = "unknown" + vsan_mode = "regular" + }, ] relation_to_imported_contracts = [ - { - annotation = "annotation_1" - imported_contract_name = "imported_contract_name_0" - priority = "level1" - }, - { - annotation = "annotation_2" - imported_contract_name = "imported_contract_name_1" - priority = "level2" - }, + { + annotation = "annotation_1" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + imported_contract_name = "imported_contract_name_0" + priority = "level1" + }, + { + annotation = "annotation_2" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + imported_contract_name = "imported_contract_name_1" + priority = "level2" + }, ] relation_to_intra_epg_contracts = [ - { - annotation = "annotation_1" - contract_name = "contract_name_0" - }, - { - annotation = "annotation_2" - contract_name = "contract_name_1" - }, + { + annotation = "annotation_1" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + contract_name = "contract_name_0" + }, + { + annotation = "annotation_2" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + contract_name = "contract_name_1" + }, ] relation_to_provided_contracts = [ - { - annotation = "annotation_1" - contract_name = "contract_name_0" - match_criteria = "All" - priority = "level1" - }, - { - annotation = "annotation_2" - contract_name = "contract_name_1" - match_criteria = "AtleastOne" - priority = "level2" - }, + { + annotation = "annotation_1" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + contract_name = "contract_name_0" + match_criteria = "All" + priority = "level1" + }, + { + annotation = "annotation_2" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + contract_name = "contract_name_1" + match_criteria = "AtleastOne" + priority = "level2" + }, ] relation_to_static_leafs = [ - { - annotation = "annotation_1" - deployment_immediacy = "immediate" - description = "description_1" - encapsulation = "vlan-100" - mode = "native" - target_dn = "topology/pod-1/node-101" - }, - { - annotation = "annotation_2" - deployment_immediacy = "lazy" - description = "description_2" - encapsulation = "vlan-101" - mode = "regular" - target_dn = "topology/pod-1/node-102" - }, + { + annotation = "annotation_1" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + deployment_immediacy = "immediate" + description = "description_1" + encapsulation = "vlan-100" + mode = "native" + target_dn = "topology/pod-1/node-101" + }, + { + annotation = "annotation_2" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + deployment_immediacy = "lazy" + description = "description_2" + encapsulation = "vlan-101" + mode = "regular" + target_dn = "topology/pod-1/node-102" + }, ] relation_to_static_paths = [ - { - annotation = "annotation_1" - deployment_immediacy = "immediate" - description = "description_1" - encapsulation = "vlan-202" - mode = "native" - primary_encapsulation = "vlan-203" - target_dn = "topology/pod-1/paths-101/pathep-[eth1/1]" - }, - { - annotation = "annotation_2" - deployment_immediacy = "lazy" - description = "description_2" - encapsulation = "vlan-201" - mode = "regular" - primary_encapsulation = "unknown" - target_dn = "topology/pod-1/paths-101/pathep-[eth1/2]" - }, + { + annotation = "annotation_1" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + deployment_immediacy = "immediate" + description = "description_1" + encapsulation = "vlan-202" + mode = "native" + primary_encapsulation = "vlan-203" + target_dn = "topology/pod-1/paths-101/pathep-[eth1/1]" + }, + { + annotation = "annotation_2" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + deployment_immediacy = "lazy" + description = "description_2" + encapsulation = "vlan-201" + mode = "regular" + primary_encapsulation = "unknown" + target_dn = "topology/pod-1/paths-101/pathep-[eth1/2]" + }, ] relation_to_taboo_contracts = [ - { - annotation = "annotation_1" - taboo_contract_name = "taboo_contract_name_0" - }, - { - annotation = "annotation_2" - taboo_contract_name = "taboo_contract_name_1" - }, + { + annotation = "annotation_1" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + taboo_contract_name = "taboo_contract_name_0" + }, + { + annotation = "annotation_2" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + taboo_contract_name = "taboo_contract_name_1" + }, ] relation_to_trust_control_policy = { annotation = "annotation_1" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] trust_control_policy_name = "trust_control_policy_name_1" } tags = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] } ` @@ -1081,9 +1953,37 @@ resource "aci_application_epg" "test" { ] epg_useg_block_statement = {} relation_to_application_epg_monitoring_policy = {} + relation_to_bridge_domain = { + annotation = "annotation_1" + bridge_domain_name = "bridge_domain_name_1" + annotations = [ + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_1" + value = "test_value" + }, + ] + } relation_to_consumed_contracts = [ { annotation = "annotation_2" + annotations = [ + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_1" + value = "test_value" + }, + ] contract_name = "contract_name_1" priority = "level2" }, @@ -1091,13 +1991,53 @@ resource "aci_application_epg" "test" { relation_to_contract_masters = [ { annotation = "annotation_2" + annotations = [ + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_1" + value = "test_value" + }, + ] target_dn = aci_application_epg.test_application_epg_1.id }, ] + relation_to_custom_qos_policy = { + annotation = "annotation_1" + annotations = [ + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_1" + value = "test_value" + }, + ] + custom_qos_policy_name = "custom_qos_policy_name_1" + } relation_to_data_plane_policing_policy = {} relation_to_domains = [ { annotation = "annotation_2" + annotations = [ + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_1" + value = "test_value" + }, + ] class_preference = "useg" delimiter = "" deployment_immediacy = "lazy" @@ -1124,6 +2064,18 @@ resource "aci_application_epg" "test" { relation_to_fibre_channel_paths = [ { annotation = "annotation_2" + annotations = [ + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_1" + value = "test_value" + }, + ] description = "description_2" target_dn = "topology/pod-1/paths-101/pathep-[eth1/2]" vsan = "unknown" @@ -1133,6 +2085,18 @@ resource "aci_application_epg" "test" { relation_to_imported_contracts = [ { annotation = "annotation_2" + annotations = [ + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_1" + value = "test_value" + }, + ] imported_contract_name = "imported_contract_name_1" priority = "level2" }, @@ -1140,12 +2104,36 @@ resource "aci_application_epg" "test" { relation_to_intra_epg_contracts = [ { annotation = "annotation_2" + annotations = [ + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_1" + value = "test_value" + }, + ] contract_name = "contract_name_1" }, ] relation_to_provided_contracts = [ { annotation = "annotation_2" + annotations = [ + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_1" + value = "test_value" + }, + ] contract_name = "contract_name_1" match_criteria = "AtleastOne" priority = "level2" @@ -1154,6 +2142,18 @@ resource "aci_application_epg" "test" { relation_to_static_leafs = [ { annotation = "annotation_2" + annotations = [ + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_1" + value = "test_value" + }, + ] deployment_immediacy = "lazy" description = "description_2" encapsulation = "vlan-101" @@ -1164,6 +2164,18 @@ resource "aci_application_epg" "test" { relation_to_static_paths = [ { annotation = "annotation_2" + annotations = [ + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_1" + value = "test_value" + }, + ] deployment_immediacy = "lazy" description = "description_2" encapsulation = "vlan-201" @@ -1175,6 +2187,18 @@ resource "aci_application_epg" "test" { relation_to_taboo_contracts = [ { annotation = "annotation_2" + annotations = [ + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_1" + value = "test_value" + }, + ] taboo_contract_name = "taboo_contract_name_1" }, ] @@ -1195,8 +2219,20 @@ resource "aci_application_epg" "test" { annotations = [] epg_useg_block_statement = {} relation_to_application_epg_monitoring_policy = {} + relation_to_bridge_domain = { + annotation = "annotation_1" + bridge_domain_name = "bridge_domain_name_1" + annotations = [] + tags = [] + } relation_to_consumed_contracts = [] relation_to_contract_masters = [] + relation_to_custom_qos_policy = { + annotation = "annotation_1" + annotations = [] + tags = [] + custom_qos_policy_name = "custom_qos_policy_name_1" + } relation_to_data_plane_policing_policy = {} relation_to_domains = [] relation_to_fibre_channel_paths = [] diff --git a/internal/provider/resource_aci_bridge_domain.go b/internal/provider/resource_aci_bridge_domain.go index 03d60a9e5..192a61023 100644 --- a/internal/provider/resource_aci_bridge_domain.go +++ b/internal/provider/resource_aci_bridge_domain.go @@ -159,6 +159,8 @@ func getEmptyFvBDResourceModel() *FvBDResourceModel { "name_alias": types.StringType, "owner_key": types.StringType, "owner_tag": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvAccPFvBDType}, + "tags": types.SetType{ElemType: TagTagFvAccPFvBDType}, }), FvRogueExceptionMac: types.SetNull(types.ObjectType{ AttrTypes: map[string]attr.Type{ @@ -167,58 +169,82 @@ func getEmptyFvBDResourceModel() *FvBDResourceModel { "mac": types.StringType, "name": types.StringType, "name_alias": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvRogueExceptionMacFvBDType}, + "tags": types.SetType{ElemType: TagTagFvRogueExceptionMacFvBDType}, }, }), FvRsABDPolMonPol: types.ObjectNull(map[string]attr.Type{ "annotation": types.StringType, "monitoring_policy_name": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvRsABDPolMonPolFvBDType}, + "tags": types.SetType{ElemType: TagTagFvRsABDPolMonPolFvBDType}, }), FvRsBDToFhs: types.ObjectNull(map[string]attr.Type{ "annotation": types.StringType, "first_hop_security_policy_name": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvRsBDToFhsFvBDType}, + "tags": types.SetType{ElemType: TagTagFvRsBDToFhsFvBDType}, }), FvRsBDToNdP: types.ObjectNull(map[string]attr.Type{ "annotation": types.StringType, "neighbor_discovery_interface_policy_name": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvRsBDToNdPFvBDType}, + "tags": types.SetType{ElemType: TagTagFvRsBDToNdPFvBDType}, }), FvRsBDToNetflowMonitorPol: types.SetNull(types.ObjectType{ AttrTypes: map[string]attr.Type{ "annotation": types.StringType, "filter_type": types.StringType, "netflow_monitor_policy_name": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvRsBDToNetflowMonitorPolFvBDType}, + "tags": types.SetType{ElemType: TagTagFvRsBDToNetflowMonitorPolFvBDType}, }, }), FvRsBDToOut: types.SetNull(types.ObjectType{ AttrTypes: map[string]attr.Type{ "annotation": types.StringType, "l3_outside_name": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvRsBDToOutFvBDType}, + "tags": types.SetType{ElemType: TagTagFvRsBDToOutFvBDType}, }, }), FvRsBDToProfile: types.ObjectNull(map[string]attr.Type{ "annotation": types.StringType, "l3_outside_name": types.StringType, "route_control_profile_name": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvRsBDToProfileFvBDType}, + "tags": types.SetType{ElemType: TagTagFvRsBDToProfileFvBDType}, }), FvRsBDToRelayP: types.ObjectNull(map[string]attr.Type{ "annotation": types.StringType, "dhcp_relay_policy_name": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvRsBDToRelayPFvBDType}, + "tags": types.SetType{ElemType: TagTagFvRsBDToRelayPFvBDType}, }), FvRsBdToEpRet: types.ObjectNull(map[string]attr.Type{ "annotation": types.StringType, "resolve_action": types.StringType, "end_point_retention_policy_name": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvRsBdToEpRetFvBDType}, + "tags": types.SetType{ElemType: TagTagFvRsBdToEpRetFvBDType}, }), FvRsCtx: types.ObjectNull(map[string]attr.Type{ - "annotation": types.StringType, - "vrf_name": types.StringType, + "annotation": types.StringType, + "vrf_name": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvRsCtxFvBDType}, + "tags": types.SetType{ElemType: TagTagFvRsCtxFvBDType}, }), FvRsIgmpsn: types.ObjectNull(map[string]attr.Type{ "annotation": types.StringType, "igmp_snooping_policy_name": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvRsIgmpsnFvBDType}, + "tags": types.SetType{ElemType: TagTagFvRsIgmpsnFvBDType}, }), FvRsMldsn: types.ObjectNull(map[string]attr.Type{ "annotation": types.StringType, "mld_snooping_policy_name": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvRsMldsnFvBDType}, + "tags": types.SetType{ElemType: TagTagFvRsMldsnFvBDType}, }), TagAnnotation: types.SetNull(types.ObjectType{ AttrTypes: map[string]attr.Type{ @@ -265,13 +291,15 @@ func getEmptyFvBDResourceModel() *FvBDResourceModel { // FvAccPFvBDResourceModel describes the resource data model for the children without relation ships. type FvAccPFvBDResourceModel struct { - Annotation types.String `tfsdk:"annotation"` - Descr types.String `tfsdk:"description"` - Encap types.String `tfsdk:"encapsulation"` - Name types.String `tfsdk:"name"` - NameAlias types.String `tfsdk:"name_alias"` - OwnerKey types.String `tfsdk:"owner_key"` - OwnerTag types.String `tfsdk:"owner_tag"` + Annotation types.String `tfsdk:"annotation"` + Descr types.String `tfsdk:"description"` + Encap types.String `tfsdk:"encapsulation"` + Name types.String `tfsdk:"name"` + NameAlias types.String `tfsdk:"name_alias"` + OwnerKey types.String `tfsdk:"owner_key"` + OwnerTag types.String `tfsdk:"owner_tag"` + TagAnnotation types.Set `tfsdk:"annotations"` + TagTag types.Set `tfsdk:"tags"` } func getEmptyFvAccPFvBDResourceModel() FvAccPFvBDResourceModel { @@ -283,6 +311,18 @@ func getEmptyFvAccPFvBDResourceModel() FvAccPFvBDResourceModel { NameAlias: basetypes.NewStringNull(), OwnerKey: basetypes.NewStringNull(), OwnerTag: basetypes.NewStringNull(), + TagAnnotation: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), } } @@ -294,15 +334,59 @@ var FvAccPFvBDType = map[string]attr.Type{ "name_alias": types.StringType, "owner_key": types.StringType, "owner_tag": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvAccPFvBDType}, + "tags": types.SetType{ElemType: TagTagFvAccPFvBDType}, +} + +// TagAnnotationFvAccPFvBDResourceModel describes the resource data model for the children without relation ships. +type TagAnnotationFvAccPFvBDResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagAnnotationFvAccPFvBDResourceModel() TagAnnotationFvAccPFvBDResourceModel { + return TagAnnotationFvAccPFvBDResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagAnnotationFvAccPFvBDType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + +// TagTagFvAccPFvBDResourceModel describes the resource data model for the children without relation ships. +type TagTagFvAccPFvBDResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagTagFvAccPFvBDResourceModel() TagTagFvAccPFvBDResourceModel { + return TagTagFvAccPFvBDResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagTagFvAccPFvBDType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, } // FvRogueExceptionMacFvBDResourceModel describes the resource data model for the children without relation ships. type FvRogueExceptionMacFvBDResourceModel struct { - Annotation types.String `tfsdk:"annotation"` - Descr types.String `tfsdk:"description"` - Mac types.String `tfsdk:"mac"` - Name types.String `tfsdk:"name"` - NameAlias types.String `tfsdk:"name_alias"` + Annotation types.String `tfsdk:"annotation"` + Descr types.String `tfsdk:"description"` + Mac types.String `tfsdk:"mac"` + Name types.String `tfsdk:"name"` + NameAlias types.String `tfsdk:"name_alias"` + TagAnnotation types.Set `tfsdk:"annotations"` + TagTag types.Set `tfsdk:"tags"` } func getEmptyFvRogueExceptionMacFvBDResourceModel() FvRogueExceptionMacFvBDResourceModel { @@ -312,61 +396,293 @@ func getEmptyFvRogueExceptionMacFvBDResourceModel() FvRogueExceptionMacFvBDResou Mac: basetypes.NewStringNull(), Name: basetypes.NewStringNull(), NameAlias: basetypes.NewStringNull(), + TagAnnotation: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + } +} + +var FvRogueExceptionMacFvBDType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "annotation": types.StringType, + "description": types.StringType, + "mac": types.StringType, + "name": types.StringType, + "name_alias": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvRogueExceptionMacFvBDType}, + "tags": types.SetType{ElemType: TagTagFvRogueExceptionMacFvBDType}, + }, +} + +// TagAnnotationFvRogueExceptionMacFvBDResourceModel describes the resource data model for the children without relation ships. +type TagAnnotationFvRogueExceptionMacFvBDResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagAnnotationFvRogueExceptionMacFvBDResourceModel() TagAnnotationFvRogueExceptionMacFvBDResourceModel { + return TagAnnotationFvRogueExceptionMacFvBDResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagAnnotationFvRogueExceptionMacFvBDType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + +// TagTagFvRogueExceptionMacFvBDResourceModel describes the resource data model for the children without relation ships. +type TagTagFvRogueExceptionMacFvBDResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagTagFvRogueExceptionMacFvBDResourceModel() TagTagFvRogueExceptionMacFvBDResourceModel { + return TagTagFvRogueExceptionMacFvBDResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), } } +var TagTagFvRogueExceptionMacFvBDType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // FvRsABDPolMonPolFvBDResourceModel describes the resource data model for the children without relation ships. type FvRsABDPolMonPolFvBDResourceModel struct { Annotation types.String `tfsdk:"annotation"` TnMonEPGPolName types.String `tfsdk:"monitoring_policy_name"` + TagAnnotation types.Set `tfsdk:"annotations"` + TagTag types.Set `tfsdk:"tags"` } func getEmptyFvRsABDPolMonPolFvBDResourceModel() FvRsABDPolMonPolFvBDResourceModel { return FvRsABDPolMonPolFvBDResourceModel{ Annotation: basetypes.NewStringNull(), TnMonEPGPolName: basetypes.NewStringNull(), + TagAnnotation: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), } } var FvRsABDPolMonPolFvBDType = map[string]attr.Type{ "annotation": types.StringType, "monitoring_policy_name": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvRsABDPolMonPolFvBDType}, + "tags": types.SetType{ElemType: TagTagFvRsABDPolMonPolFvBDType}, +} + +// TagAnnotationFvRsABDPolMonPolFvBDResourceModel describes the resource data model for the children without relation ships. +type TagAnnotationFvRsABDPolMonPolFvBDResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagAnnotationFvRsABDPolMonPolFvBDResourceModel() TagAnnotationFvRsABDPolMonPolFvBDResourceModel { + return TagAnnotationFvRsABDPolMonPolFvBDResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagAnnotationFvRsABDPolMonPolFvBDType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + +// TagTagFvRsABDPolMonPolFvBDResourceModel describes the resource data model for the children without relation ships. +type TagTagFvRsABDPolMonPolFvBDResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagTagFvRsABDPolMonPolFvBDResourceModel() TagTagFvRsABDPolMonPolFvBDResourceModel { + return TagTagFvRsABDPolMonPolFvBDResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagTagFvRsABDPolMonPolFvBDType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, } // FvRsBDToFhsFvBDResourceModel describes the resource data model for the children without relation ships. type FvRsBDToFhsFvBDResourceModel struct { Annotation types.String `tfsdk:"annotation"` TnFhsBDPolName types.String `tfsdk:"first_hop_security_policy_name"` + TagAnnotation types.Set `tfsdk:"annotations"` + TagTag types.Set `tfsdk:"tags"` } func getEmptyFvRsBDToFhsFvBDResourceModel() FvRsBDToFhsFvBDResourceModel { return FvRsBDToFhsFvBDResourceModel{ Annotation: basetypes.NewStringNull(), TnFhsBDPolName: basetypes.NewStringNull(), + TagAnnotation: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), } } var FvRsBDToFhsFvBDType = map[string]attr.Type{ "annotation": types.StringType, "first_hop_security_policy_name": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvRsBDToFhsFvBDType}, + "tags": types.SetType{ElemType: TagTagFvRsBDToFhsFvBDType}, +} + +// TagAnnotationFvRsBDToFhsFvBDResourceModel describes the resource data model for the children without relation ships. +type TagAnnotationFvRsBDToFhsFvBDResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagAnnotationFvRsBDToFhsFvBDResourceModel() TagAnnotationFvRsBDToFhsFvBDResourceModel { + return TagAnnotationFvRsBDToFhsFvBDResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagAnnotationFvRsBDToFhsFvBDType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + +// TagTagFvRsBDToFhsFvBDResourceModel describes the resource data model for the children without relation ships. +type TagTagFvRsBDToFhsFvBDResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagTagFvRsBDToFhsFvBDResourceModel() TagTagFvRsBDToFhsFvBDResourceModel { + return TagTagFvRsBDToFhsFvBDResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagTagFvRsBDToFhsFvBDType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, } // FvRsBDToNdPFvBDResourceModel describes the resource data model for the children without relation ships. type FvRsBDToNdPFvBDResourceModel struct { Annotation types.String `tfsdk:"annotation"` TnNdIfPolName types.String `tfsdk:"neighbor_discovery_interface_policy_name"` + TagAnnotation types.Set `tfsdk:"annotations"` + TagTag types.Set `tfsdk:"tags"` } func getEmptyFvRsBDToNdPFvBDResourceModel() FvRsBDToNdPFvBDResourceModel { return FvRsBDToNdPFvBDResourceModel{ Annotation: basetypes.NewStringNull(), TnNdIfPolName: basetypes.NewStringNull(), + TagAnnotation: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), } } var FvRsBDToNdPFvBDType = map[string]attr.Type{ "annotation": types.StringType, "neighbor_discovery_interface_policy_name": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvRsBDToNdPFvBDType}, + "tags": types.SetType{ElemType: TagTagFvRsBDToNdPFvBDType}, +} + +// TagAnnotationFvRsBDToNdPFvBDResourceModel describes the resource data model for the children without relation ships. +type TagAnnotationFvRsBDToNdPFvBDResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagAnnotationFvRsBDToNdPFvBDResourceModel() TagAnnotationFvRsBDToNdPFvBDResourceModel { + return TagAnnotationFvRsBDToNdPFvBDResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagAnnotationFvRsBDToNdPFvBDType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + +// TagTagFvRsBDToNdPFvBDResourceModel describes the resource data model for the children without relation ships. +type TagTagFvRsBDToNdPFvBDResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagTagFvRsBDToNdPFvBDResourceModel() TagTagFvRsBDToNdPFvBDResourceModel { + return TagTagFvRsBDToNdPFvBDResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagTagFvRsBDToNdPFvBDType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, } // FvRsBDToNetflowMonitorPolFvBDResourceModel describes the resource data model for the children without relation ships. @@ -374,6 +690,8 @@ type FvRsBDToNetflowMonitorPolFvBDResourceModel struct { Annotation types.String `tfsdk:"annotation"` FltType types.String `tfsdk:"filter_type"` TnNetflowMonitorPolName types.String `tfsdk:"netflow_monitor_policy_name"` + TagAnnotation types.Set `tfsdk:"annotations"` + TagTag types.Set `tfsdk:"tags"` } func getEmptyFvRsBDToNetflowMonitorPolFvBDResourceModel() FvRsBDToNetflowMonitorPolFvBDResourceModel { @@ -381,27 +699,154 @@ func getEmptyFvRsBDToNetflowMonitorPolFvBDResourceModel() FvRsBDToNetflowMonitor Annotation: basetypes.NewStringNull(), FltType: basetypes.NewStringNull(), TnNetflowMonitorPolName: basetypes.NewStringNull(), + TagAnnotation: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + } +} + +var FvRsBDToNetflowMonitorPolFvBDType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "annotation": types.StringType, + "filter_type": types.StringType, + "netflow_monitor_policy_name": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvRsBDToNetflowMonitorPolFvBDType}, + "tags": types.SetType{ElemType: TagTagFvRsBDToNetflowMonitorPolFvBDType}, + }, +} + +// TagAnnotationFvRsBDToNetflowMonitorPolFvBDResourceModel describes the resource data model for the children without relation ships. +type TagAnnotationFvRsBDToNetflowMonitorPolFvBDResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagAnnotationFvRsBDToNetflowMonitorPolFvBDResourceModel() TagAnnotationFvRsBDToNetflowMonitorPolFvBDResourceModel { + return TagAnnotationFvRsBDToNetflowMonitorPolFvBDResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagAnnotationFvRsBDToNetflowMonitorPolFvBDType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + +// TagTagFvRsBDToNetflowMonitorPolFvBDResourceModel describes the resource data model for the children without relation ships. +type TagTagFvRsBDToNetflowMonitorPolFvBDResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagTagFvRsBDToNetflowMonitorPolFvBDResourceModel() TagTagFvRsBDToNetflowMonitorPolFvBDResourceModel { + return TagTagFvRsBDToNetflowMonitorPolFvBDResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), } } +var TagTagFvRsBDToNetflowMonitorPolFvBDType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // FvRsBDToOutFvBDResourceModel describes the resource data model for the children without relation ships. type FvRsBDToOutFvBDResourceModel struct { Annotation types.String `tfsdk:"annotation"` TnL3extOutName types.String `tfsdk:"l3_outside_name"` + TagAnnotation types.Set `tfsdk:"annotations"` + TagTag types.Set `tfsdk:"tags"` } func getEmptyFvRsBDToOutFvBDResourceModel() FvRsBDToOutFvBDResourceModel { return FvRsBDToOutFvBDResourceModel{ Annotation: basetypes.NewStringNull(), TnL3extOutName: basetypes.NewStringNull(), + TagAnnotation: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), } } +var FvRsBDToOutFvBDType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "annotation": types.StringType, + "l3_outside_name": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvRsBDToOutFvBDType}, + "tags": types.SetType{ElemType: TagTagFvRsBDToOutFvBDType}, + }, +} + +// TagAnnotationFvRsBDToOutFvBDResourceModel describes the resource data model for the children without relation ships. +type TagAnnotationFvRsBDToOutFvBDResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagAnnotationFvRsBDToOutFvBDResourceModel() TagAnnotationFvRsBDToOutFvBDResourceModel { + return TagAnnotationFvRsBDToOutFvBDResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagAnnotationFvRsBDToOutFvBDType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + +// TagTagFvRsBDToOutFvBDResourceModel describes the resource data model for the children without relation ships. +type TagTagFvRsBDToOutFvBDResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagTagFvRsBDToOutFvBDResourceModel() TagTagFvRsBDToOutFvBDResourceModel { + return TagTagFvRsBDToOutFvBDResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagTagFvRsBDToOutFvBDType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // FvRsBDToProfileFvBDResourceModel describes the resource data model for the children without relation ships. type FvRsBDToProfileFvBDResourceModel struct { Annotation types.String `tfsdk:"annotation"` TnL3extOutName types.String `tfsdk:"l3_outside_name"` TnRtctrlProfileName types.String `tfsdk:"route_control_profile_name"` + TagAnnotation types.Set `tfsdk:"annotations"` + TagTag types.Set `tfsdk:"tags"` } func getEmptyFvRsBDToProfileFvBDResourceModel() FvRsBDToProfileFvBDResourceModel { @@ -409,6 +854,18 @@ func getEmptyFvRsBDToProfileFvBDResourceModel() FvRsBDToProfileFvBDResourceModel Annotation: basetypes.NewStringNull(), TnL3extOutName: basetypes.NewStringNull(), TnRtctrlProfileName: basetypes.NewStringNull(), + TagAnnotation: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), } } @@ -416,99 +873,421 @@ var FvRsBDToProfileFvBDType = map[string]attr.Type{ "annotation": types.StringType, "l3_outside_name": types.StringType, "route_control_profile_name": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvRsBDToProfileFvBDType}, + "tags": types.SetType{ElemType: TagTagFvRsBDToProfileFvBDType}, +} + +// TagAnnotationFvRsBDToProfileFvBDResourceModel describes the resource data model for the children without relation ships. +type TagAnnotationFvRsBDToProfileFvBDResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagAnnotationFvRsBDToProfileFvBDResourceModel() TagAnnotationFvRsBDToProfileFvBDResourceModel { + return TagAnnotationFvRsBDToProfileFvBDResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagAnnotationFvRsBDToProfileFvBDType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + +// TagTagFvRsBDToProfileFvBDResourceModel describes the resource data model for the children without relation ships. +type TagTagFvRsBDToProfileFvBDResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagTagFvRsBDToProfileFvBDResourceModel() TagTagFvRsBDToProfileFvBDResourceModel { + return TagTagFvRsBDToProfileFvBDResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagTagFvRsBDToProfileFvBDType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, } // FvRsBDToRelayPFvBDResourceModel describes the resource data model for the children without relation ships. type FvRsBDToRelayPFvBDResourceModel struct { Annotation types.String `tfsdk:"annotation"` TnDhcpRelayPName types.String `tfsdk:"dhcp_relay_policy_name"` + TagAnnotation types.Set `tfsdk:"annotations"` + TagTag types.Set `tfsdk:"tags"` +} + +func getEmptyFvRsBDToRelayPFvBDResourceModel() FvRsBDToRelayPFvBDResourceModel { + return FvRsBDToRelayPFvBDResourceModel{ + Annotation: basetypes.NewStringNull(), + TnDhcpRelayPName: basetypes.NewStringNull(), + TagAnnotation: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + } +} + +var FvRsBDToRelayPFvBDType = map[string]attr.Type{ + "annotation": types.StringType, + "dhcp_relay_policy_name": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvRsBDToRelayPFvBDType}, + "tags": types.SetType{ElemType: TagTagFvRsBDToRelayPFvBDType}, +} + +// TagAnnotationFvRsBDToRelayPFvBDResourceModel describes the resource data model for the children without relation ships. +type TagAnnotationFvRsBDToRelayPFvBDResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagAnnotationFvRsBDToRelayPFvBDResourceModel() TagAnnotationFvRsBDToRelayPFvBDResourceModel { + return TagAnnotationFvRsBDToRelayPFvBDResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagAnnotationFvRsBDToRelayPFvBDType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + +// TagTagFvRsBDToRelayPFvBDResourceModel describes the resource data model for the children without relation ships. +type TagTagFvRsBDToRelayPFvBDResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagTagFvRsBDToRelayPFvBDResourceModel() TagTagFvRsBDToRelayPFvBDResourceModel { + return TagTagFvRsBDToRelayPFvBDResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagTagFvRsBDToRelayPFvBDType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + +// FvRsBdToEpRetFvBDResourceModel describes the resource data model for the children without relation ships. +type FvRsBdToEpRetFvBDResourceModel struct { + Annotation types.String `tfsdk:"annotation"` + ResolveAct types.String `tfsdk:"resolve_action"` + TnFvEpRetPolName types.String `tfsdk:"end_point_retention_policy_name"` + TagAnnotation types.Set `tfsdk:"annotations"` + TagTag types.Set `tfsdk:"tags"` +} + +func getEmptyFvRsBdToEpRetFvBDResourceModel() FvRsBdToEpRetFvBDResourceModel { + return FvRsBdToEpRetFvBDResourceModel{ + Annotation: basetypes.NewStringNull(), + ResolveAct: basetypes.NewStringNull(), + TnFvEpRetPolName: basetypes.NewStringNull(), + TagAnnotation: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + } +} + +var FvRsBdToEpRetFvBDType = map[string]attr.Type{ + "annotation": types.StringType, + "resolve_action": types.StringType, + "end_point_retention_policy_name": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvRsBdToEpRetFvBDType}, + "tags": types.SetType{ElemType: TagTagFvRsBdToEpRetFvBDType}, } -func getEmptyFvRsBDToRelayPFvBDResourceModel() FvRsBDToRelayPFvBDResourceModel { - return FvRsBDToRelayPFvBDResourceModel{ - Annotation: basetypes.NewStringNull(), - TnDhcpRelayPName: basetypes.NewStringNull(), +// TagAnnotationFvRsBdToEpRetFvBDResourceModel describes the resource data model for the children without relation ships. +type TagAnnotationFvRsBdToEpRetFvBDResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagAnnotationFvRsBdToEpRetFvBDResourceModel() TagAnnotationFvRsBdToEpRetFvBDResourceModel { + return TagAnnotationFvRsBdToEpRetFvBDResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), } } -var FvRsBDToRelayPFvBDType = map[string]attr.Type{ - "annotation": types.StringType, - "dhcp_relay_policy_name": types.StringType, +var TagAnnotationFvRsBdToEpRetFvBDType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, } -// FvRsBdToEpRetFvBDResourceModel describes the resource data model for the children without relation ships. -type FvRsBdToEpRetFvBDResourceModel struct { - Annotation types.String `tfsdk:"annotation"` - ResolveAct types.String `tfsdk:"resolve_action"` - TnFvEpRetPolName types.String `tfsdk:"end_point_retention_policy_name"` +// TagTagFvRsBdToEpRetFvBDResourceModel describes the resource data model for the children without relation ships. +type TagTagFvRsBdToEpRetFvBDResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` } -func getEmptyFvRsBdToEpRetFvBDResourceModel() FvRsBdToEpRetFvBDResourceModel { - return FvRsBdToEpRetFvBDResourceModel{ - Annotation: basetypes.NewStringNull(), - ResolveAct: basetypes.NewStringNull(), - TnFvEpRetPolName: basetypes.NewStringNull(), +func getEmptyTagTagFvRsBdToEpRetFvBDResourceModel() TagTagFvRsBdToEpRetFvBDResourceModel { + return TagTagFvRsBdToEpRetFvBDResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), } } -var FvRsBdToEpRetFvBDType = map[string]attr.Type{ - "annotation": types.StringType, - "resolve_action": types.StringType, - "end_point_retention_policy_name": types.StringType, +var TagTagFvRsBdToEpRetFvBDType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, } // FvRsCtxFvBDResourceModel describes the resource data model for the children without relation ships. type FvRsCtxFvBDResourceModel struct { - Annotation types.String `tfsdk:"annotation"` - TnFvCtxName types.String `tfsdk:"vrf_name"` + Annotation types.String `tfsdk:"annotation"` + TnFvCtxName types.String `tfsdk:"vrf_name"` + TagAnnotation types.Set `tfsdk:"annotations"` + TagTag types.Set `tfsdk:"tags"` } func getEmptyFvRsCtxFvBDResourceModel() FvRsCtxFvBDResourceModel { return FvRsCtxFvBDResourceModel{ Annotation: basetypes.NewStringNull(), TnFvCtxName: basetypes.NewStringNull(), + TagAnnotation: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), } } var FvRsCtxFvBDType = map[string]attr.Type{ - "annotation": types.StringType, - "vrf_name": types.StringType, + "annotation": types.StringType, + "vrf_name": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvRsCtxFvBDType}, + "tags": types.SetType{ElemType: TagTagFvRsCtxFvBDType}, +} + +// TagAnnotationFvRsCtxFvBDResourceModel describes the resource data model for the children without relation ships. +type TagAnnotationFvRsCtxFvBDResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagAnnotationFvRsCtxFvBDResourceModel() TagAnnotationFvRsCtxFvBDResourceModel { + return TagAnnotationFvRsCtxFvBDResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagAnnotationFvRsCtxFvBDType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + +// TagTagFvRsCtxFvBDResourceModel describes the resource data model for the children without relation ships. +type TagTagFvRsCtxFvBDResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagTagFvRsCtxFvBDResourceModel() TagTagFvRsCtxFvBDResourceModel { + return TagTagFvRsCtxFvBDResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagTagFvRsCtxFvBDType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, } // FvRsIgmpsnFvBDResourceModel describes the resource data model for the children without relation ships. type FvRsIgmpsnFvBDResourceModel struct { Annotation types.String `tfsdk:"annotation"` TnIgmpSnoopPolName types.String `tfsdk:"igmp_snooping_policy_name"` + TagAnnotation types.Set `tfsdk:"annotations"` + TagTag types.Set `tfsdk:"tags"` } func getEmptyFvRsIgmpsnFvBDResourceModel() FvRsIgmpsnFvBDResourceModel { return FvRsIgmpsnFvBDResourceModel{ Annotation: basetypes.NewStringNull(), TnIgmpSnoopPolName: basetypes.NewStringNull(), + TagAnnotation: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), } } var FvRsIgmpsnFvBDType = map[string]attr.Type{ "annotation": types.StringType, "igmp_snooping_policy_name": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvRsIgmpsnFvBDType}, + "tags": types.SetType{ElemType: TagTagFvRsIgmpsnFvBDType}, +} + +// TagAnnotationFvRsIgmpsnFvBDResourceModel describes the resource data model for the children without relation ships. +type TagAnnotationFvRsIgmpsnFvBDResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagAnnotationFvRsIgmpsnFvBDResourceModel() TagAnnotationFvRsIgmpsnFvBDResourceModel { + return TagAnnotationFvRsIgmpsnFvBDResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagAnnotationFvRsIgmpsnFvBDType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + +// TagTagFvRsIgmpsnFvBDResourceModel describes the resource data model for the children without relation ships. +type TagTagFvRsIgmpsnFvBDResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagTagFvRsIgmpsnFvBDResourceModel() TagTagFvRsIgmpsnFvBDResourceModel { + return TagTagFvRsIgmpsnFvBDResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagTagFvRsIgmpsnFvBDType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, } // FvRsMldsnFvBDResourceModel describes the resource data model for the children without relation ships. type FvRsMldsnFvBDResourceModel struct { Annotation types.String `tfsdk:"annotation"` TnMldSnoopPolName types.String `tfsdk:"mld_snooping_policy_name"` + TagAnnotation types.Set `tfsdk:"annotations"` + TagTag types.Set `tfsdk:"tags"` } func getEmptyFvRsMldsnFvBDResourceModel() FvRsMldsnFvBDResourceModel { return FvRsMldsnFvBDResourceModel{ Annotation: basetypes.NewStringNull(), TnMldSnoopPolName: basetypes.NewStringNull(), + TagAnnotation: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), } } var FvRsMldsnFvBDType = map[string]attr.Type{ "annotation": types.StringType, "mld_snooping_policy_name": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvRsMldsnFvBDType}, + "tags": types.SetType{ElemType: TagTagFvRsMldsnFvBDType}, +} + +// TagAnnotationFvRsMldsnFvBDResourceModel describes the resource data model for the children without relation ships. +type TagAnnotationFvRsMldsnFvBDResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagAnnotationFvRsMldsnFvBDResourceModel() TagAnnotationFvRsMldsnFvBDResourceModel { + return TagAnnotationFvRsMldsnFvBDResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagAnnotationFvRsMldsnFvBDType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + +// TagTagFvRsMldsnFvBDResourceModel describes the resource data model for the children without relation ships. +type TagTagFvRsMldsnFvBDResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagTagFvRsMldsnFvBDResourceModel() TagTagFvRsMldsnFvBDResourceModel { + return TagTagFvRsMldsnFvBDResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagTagFvRsMldsnFvBDType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, } // TagAnnotationFvBDResourceModel describes the resource data model for the children without relation ships. @@ -524,6 +1303,13 @@ func getEmptyTagAnnotationFvBDResourceModel() TagAnnotationFvBDResourceModel { } } +var TagAnnotationFvBDType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // TagTagFvBDResourceModel describes the resource data model for the children without relation ships. type TagTagFvBDResourceModel struct { Key types.String `tfsdk:"key"` @@ -537,6 +1323,13 @@ func getEmptyTagTagFvBDResourceModel() TagTagFvBDResourceModel { } } +var TagTagFvBDType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + type FvBDIdentifier struct { Name types.String } @@ -884,6 +1677,8 @@ func (r *FvBDResource) UpgradeState(ctx context.Context) map[int64]resource.Stat "mac": basetypes.StringType{}, "name": basetypes.StringType{}, "name_alias": basetypes.StringType{}, + "annotations": basetypes.SetType{ElemType: TagAnnotationFvRogueExceptionMacFvBDType}, + "tags": basetypes.SetType{ElemType: TagTagFvRogueExceptionMacFvBDType}, }, }, ) @@ -891,6 +1686,18 @@ func (r *FvBDResource) UpgradeState(ctx context.Context) map[int64]resource.Stat FvRsABDPolMonPolObject := FvRsABDPolMonPolFvBDResourceModel{ Annotation: basetypes.NewStringNull(), TnMonEPGPolName: basetypes.NewStringValue(GetMOName(priorStateData.FvRsABDPolMonPol.ValueString())), + TagAnnotation: basetypes.NewSetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: basetypes.NewSetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), } fvRsABDPolMonPolObject, _ := types.ObjectValueFrom(ctx, FvRsABDPolMonPolFvBDType, FvRsABDPolMonPolObject) upgradedStateData.FvRsABDPolMonPol = fvRsABDPolMonPolObject @@ -898,6 +1705,18 @@ func (r *FvBDResource) UpgradeState(ctx context.Context) map[int64]resource.Stat FvRsBDToFhsObject := FvRsBDToFhsFvBDResourceModel{ Annotation: basetypes.NewStringNull(), TnFhsBDPolName: basetypes.NewStringValue(GetMOName(priorStateData.FvRsBDToFhs.ValueString())), + TagAnnotation: basetypes.NewSetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: basetypes.NewSetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), } fvRsBDToFhsObject, _ := types.ObjectValueFrom(ctx, FvRsBDToFhsFvBDType, FvRsBDToFhsObject) upgradedStateData.FvRsBDToFhs = fvRsBDToFhsObject @@ -905,6 +1724,18 @@ func (r *FvBDResource) UpgradeState(ctx context.Context) map[int64]resource.Stat FvRsBDToNdPObject := FvRsBDToNdPFvBDResourceModel{ Annotation: basetypes.NewStringNull(), TnNdIfPolName: basetypes.NewStringValue(GetMOName(priorStateData.FvRsBDToNdP.ValueString())), + TagAnnotation: basetypes.NewSetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: basetypes.NewSetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), } fvRsBDToNdPObject, _ := types.ObjectValueFrom(ctx, FvRsBDToNdPFvBDType, FvRsBDToNdPObject) upgradedStateData.FvRsBDToNdP = fvRsBDToNdPObject @@ -917,17 +1748,22 @@ func (r *FvBDResource) UpgradeState(ctx context.Context) map[int64]resource.Stat Annotation: basetypes.NewStringNull(), FltType: priorStateDataFvRsBDToNetflowMonitorPol.FltType, TnNetflowMonitorPolName: priorStateDataFvRsBDToNetflowMonitorPol.TnNetflowMonitorPolName, + TagAnnotation: basetypes.NewSetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: basetypes.NewSetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), } FvRsBDToNetflowMonitorPolList = append(FvRsBDToNetflowMonitorPolList, FvRsBDToNetflowMonitorPol) } - FvRsBDToNetflowMonitorPolType := types.ObjectType{ - AttrTypes: map[string]attr.Type{ - "annotation": basetypes.StringType{}, - "filter_type": basetypes.StringType{}, - "netflow_monitor_policy_name": basetypes.StringType{}, - }, - } - FvRsBDToNetflowMonitorPolSet, _ := types.SetValueFrom(ctx, FvRsBDToNetflowMonitorPolType, FvRsBDToNetflowMonitorPolList) + FvRsBDToNetflowMonitorPolSet, _ := types.SetValueFrom(ctx, FvRsBDToNetflowMonitorPolFvBDType, FvRsBDToNetflowMonitorPolList) upgradedStateData.FvRsBDToNetflowMonitorPol = FvRsBDToNetflowMonitorPolSet FvRsBDToOutList := make([]FvRsBDToOutFvBDResourceModel, 0) @@ -937,22 +1773,40 @@ func (r *FvBDResource) UpgradeState(ctx context.Context) map[int64]resource.Stat FvRsBDToOut := FvRsBDToOutFvBDResourceModel{ Annotation: basetypes.NewStringNull(), TnL3extOutName: basetypes.NewStringValue(GetMOName(priorStateDataFvRsBDToOut)), + TagAnnotation: basetypes.NewSetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: basetypes.NewSetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), } FvRsBDToOutList = append(FvRsBDToOutList, FvRsBDToOut) } - FvRsBDToOutType := types.ObjectType{ - AttrTypes: map[string]attr.Type{ - "annotation": basetypes.StringType{}, - "l3_outside_name": basetypes.StringType{}, - }, - } - FvRsBDToOutSet, _ := types.SetValueFrom(ctx, FvRsBDToOutType, FvRsBDToOutList) + FvRsBDToOutSet, _ := types.SetValueFrom(ctx, FvRsBDToOutFvBDType, FvRsBDToOutList) upgradedStateData.FvRsBDToOut = FvRsBDToOutSet FvRsBDToProfileObject := FvRsBDToProfileFvBDResourceModel{ Annotation: basetypes.NewStringNull(), TnL3extOutName: basetypes.NewStringNull(), TnRtctrlProfileName: basetypes.NewStringValue(GetMOName(priorStateData.FvRsBDToProfile.ValueString())), + TagAnnotation: basetypes.NewSetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: basetypes.NewSetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), } fvRsBDToProfileObject, _ := types.ObjectValueFrom(ctx, FvRsBDToProfileFvBDType, FvRsBDToProfileObject) upgradedStateData.FvRsBDToProfile = fvRsBDToProfileObject @@ -960,6 +1814,18 @@ func (r *FvBDResource) UpgradeState(ctx context.Context) map[int64]resource.Stat FvRsBDToRelayPObject := FvRsBDToRelayPFvBDResourceModel{ Annotation: basetypes.NewStringNull(), TnDhcpRelayPName: basetypes.NewStringValue(GetMOName(priorStateData.FvRsBDToRelayP.ValueString())), + TagAnnotation: basetypes.NewSetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: basetypes.NewSetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), } fvRsBDToRelayPObject, _ := types.ObjectValueFrom(ctx, FvRsBDToRelayPFvBDType, FvRsBDToRelayPObject) upgradedStateData.FvRsBDToRelayP = fvRsBDToRelayPObject @@ -968,6 +1834,18 @@ func (r *FvBDResource) UpgradeState(ctx context.Context) map[int64]resource.Stat Annotation: basetypes.NewStringNull(), ResolveAct: basetypes.NewStringNull(), TnFvEpRetPolName: basetypes.NewStringValue(GetMOName(priorStateData.FvRsBdToEpRet.ValueString())), + TagAnnotation: basetypes.NewSetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: basetypes.NewSetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), } fvRsBdToEpRetObject, _ := types.ObjectValueFrom(ctx, FvRsBdToEpRetFvBDType, FvRsBdToEpRetObject) upgradedStateData.FvRsBdToEpRet = fvRsBdToEpRetObject @@ -975,6 +1853,18 @@ func (r *FvBDResource) UpgradeState(ctx context.Context) map[int64]resource.Stat FvRsCtxObject := FvRsCtxFvBDResourceModel{ Annotation: basetypes.NewStringNull(), TnFvCtxName: basetypes.NewStringValue(GetMOName(priorStateData.FvRsCtx.ValueString())), + TagAnnotation: basetypes.NewSetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: basetypes.NewSetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), } fvRsCtxObject, _ := types.ObjectValueFrom(ctx, FvRsCtxFvBDType, FvRsCtxObject) upgradedStateData.FvRsCtx = fvRsCtxObject @@ -982,6 +1872,18 @@ func (r *FvBDResource) UpgradeState(ctx context.Context) map[int64]resource.Stat FvRsIgmpsnObject := FvRsIgmpsnFvBDResourceModel{ Annotation: basetypes.NewStringNull(), TnIgmpSnoopPolName: basetypes.NewStringValue(GetMOName(priorStateData.FvRsIgmpsn.ValueString())), + TagAnnotation: basetypes.NewSetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: basetypes.NewSetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), } fvRsIgmpsnObject, _ := types.ObjectValueFrom(ctx, FvRsIgmpsnFvBDType, FvRsIgmpsnObject) upgradedStateData.FvRsIgmpsn = fvRsIgmpsnObject @@ -989,6 +1891,18 @@ func (r *FvBDResource) UpgradeState(ctx context.Context) map[int64]resource.Stat FvRsMldsnObject := FvRsMldsnFvBDResourceModel{ Annotation: basetypes.NewStringNull(), TnMldSnoopPolName: basetypes.NewStringValue(GetMOName(priorStateData.FvRsMldsn.ValueString())), + TagAnnotation: basetypes.NewSetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: basetypes.NewSetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), } fvRsMldsnObject, _ := types.ObjectValueFrom(ctx, FvRsMldsnFvBDType, FvRsMldsnObject) upgradedStateData.FvRsMldsn = fvRsMldsnObject @@ -1400,10 +2314,26 @@ func (r *FvBDResource) ModifyPlan(ctx context.Context, req resource.ModifyPlanRe } } } else if !configData.DeprecatedFvRsBdToEpRet.IsNull() { + var newAttributeValues FvRsBdToEpRetFvBDResourceModel + tagAnnotationFvRsBdToEpRetFvBDValue, _ := types.SetValueFrom(ctx, TagAnnotationFvRsBdToEpRetFvBDType, make([]TagAnnotationFvRsBdToEpRetFvBDResourceModel, 0)) + tagTagFvRsBdToEpRetFvBDValue, _ := types.SetValueFrom(ctx, TagTagFvRsBdToEpRetFvBDType, make([]TagTagFvRsBdToEpRetFvBDResourceModel, 0)) + annotationValue := planData.Annotation + if stateData != nil { + stateData.FvRsBdToEpRet.As(ctx, &newAttributeValues, basetypes.ObjectAsOptions{}) + annotationValue = newAttributeValues.Annotation + tagAnnotationFvRsBdToEpRetFvBDValue = newAttributeValues.TagAnnotation + tagTagFvRsBdToEpRetFvBDValue = newAttributeValues.TagTag + } + tnFvEpRetPolNameValue := basetypes.NewStringUnknown() + if !configData.DeprecatedFvRsBdToEpRet.IsUnknown() { + tnFvEpRetPolNameValue = basetypes.NewStringValue(GetMOName(configData.DeprecatedFvRsBdToEpRet.ValueString())) + } FvRsBdToEpRet := FvRsBdToEpRetFvBDResourceModel{ - Annotation: planData.Annotation, + Annotation: annotationValue, ResolveAct: basetypes.NewStringNull(), - TnFvEpRetPolName: basetypes.NewStringValue(GetMOName(configData.DeprecatedFvRsBdToEpRet.ValueString())), + TnFvEpRetPolName: tnFvEpRetPolNameValue, + TagAnnotation: tagAnnotationFvRsBdToEpRetFvBDValue, + TagTag: tagTagFvRsBdToEpRetFvBDValue, } FvRsBdToEpRetObject, _ := types.ObjectValueFrom(ctx, FvRsBdToEpRetFvBDType, FvRsBdToEpRet) planData.FvRsBdToEpRet = FvRsBdToEpRetObject @@ -1423,9 +2353,25 @@ func (r *FvBDResource) ModifyPlan(ctx context.Context, req resource.ModifyPlanRe } } } else if !configData.DeprecatedFvRsBDToFhs.IsNull() { + var newAttributeValues FvRsBDToFhsFvBDResourceModel + tagAnnotationFvRsBDToFhsFvBDValue, _ := types.SetValueFrom(ctx, TagAnnotationFvRsBDToFhsFvBDType, make([]TagAnnotationFvRsBDToFhsFvBDResourceModel, 0)) + tagTagFvRsBDToFhsFvBDValue, _ := types.SetValueFrom(ctx, TagTagFvRsBDToFhsFvBDType, make([]TagTagFvRsBDToFhsFvBDResourceModel, 0)) + annotationValue := planData.Annotation + if stateData != nil { + stateData.FvRsBDToFhs.As(ctx, &newAttributeValues, basetypes.ObjectAsOptions{}) + annotationValue = newAttributeValues.Annotation + tagAnnotationFvRsBDToFhsFvBDValue = newAttributeValues.TagAnnotation + tagTagFvRsBDToFhsFvBDValue = newAttributeValues.TagTag + } + tnFhsBDPolNameValue := basetypes.NewStringUnknown() + if !configData.DeprecatedFvRsBDToFhs.IsUnknown() { + tnFhsBDPolNameValue = basetypes.NewStringValue(GetMOName(configData.DeprecatedFvRsBDToFhs.ValueString())) + } FvRsBDToFhs := FvRsBDToFhsFvBDResourceModel{ - Annotation: planData.Annotation, - TnFhsBDPolName: basetypes.NewStringValue(GetMOName(configData.DeprecatedFvRsBDToFhs.ValueString())), + Annotation: annotationValue, + TnFhsBDPolName: tnFhsBDPolNameValue, + TagAnnotation: tagAnnotationFvRsBDToFhsFvBDValue, + TagTag: tagTagFvRsBDToFhsFvBDValue, } FvRsBDToFhsObject, _ := types.ObjectValueFrom(ctx, FvRsBDToFhsFvBDType, FvRsBDToFhs) planData.FvRsBDToFhs = FvRsBDToFhsObject @@ -1445,9 +2391,25 @@ func (r *FvBDResource) ModifyPlan(ctx context.Context, req resource.ModifyPlanRe } } } else if !configData.DeprecatedFvRsIgmpsn.IsNull() { + var newAttributeValues FvRsIgmpsnFvBDResourceModel + tagAnnotationFvRsIgmpsnFvBDValue, _ := types.SetValueFrom(ctx, TagAnnotationFvRsIgmpsnFvBDType, make([]TagAnnotationFvRsIgmpsnFvBDResourceModel, 0)) + tagTagFvRsIgmpsnFvBDValue, _ := types.SetValueFrom(ctx, TagTagFvRsIgmpsnFvBDType, make([]TagTagFvRsIgmpsnFvBDResourceModel, 0)) + annotationValue := planData.Annotation + if stateData != nil { + stateData.FvRsIgmpsn.As(ctx, &newAttributeValues, basetypes.ObjectAsOptions{}) + annotationValue = newAttributeValues.Annotation + tagAnnotationFvRsIgmpsnFvBDValue = newAttributeValues.TagAnnotation + tagTagFvRsIgmpsnFvBDValue = newAttributeValues.TagTag + } + tnIgmpSnoopPolNameValue := basetypes.NewStringUnknown() + if !configData.DeprecatedFvRsIgmpsn.IsUnknown() { + tnIgmpSnoopPolNameValue = basetypes.NewStringValue(GetMOName(configData.DeprecatedFvRsIgmpsn.ValueString())) + } FvRsIgmpsn := FvRsIgmpsnFvBDResourceModel{ - Annotation: planData.Annotation, - TnIgmpSnoopPolName: basetypes.NewStringValue(GetMOName(configData.DeprecatedFvRsIgmpsn.ValueString())), + Annotation: annotationValue, + TnIgmpSnoopPolName: tnIgmpSnoopPolNameValue, + TagAnnotation: tagAnnotationFvRsIgmpsnFvBDValue, + TagTag: tagTagFvRsIgmpsnFvBDValue, } FvRsIgmpsnObject, _ := types.ObjectValueFrom(ctx, FvRsIgmpsnFvBDType, FvRsIgmpsn) planData.FvRsIgmpsn = FvRsIgmpsnObject @@ -1479,7 +2441,7 @@ func (r *FvBDResource) ModifyPlan(ctx context.Context, req resource.ModifyPlanRe } } else if !configData.DeprecatedFvRsBDToOut.IsNull() { FvRsBDToOutList := make([]FvRsBDToOutFvBDResourceModel, 0) - var attributeValues []string + var attributeValues []basetypes.StringValue var newAttributeValues []FvRsBDToOutFvBDResourceModel configData.DeprecatedFvRsBDToOut.ElementsAs(ctx, &attributeValues, false) if stateData != nil { @@ -1489,14 +2451,18 @@ func (r *FvBDResource) ModifyPlan(ctx context.Context, req resource.ModifyPlanRe FvRsBDToOutValue := FvRsBDToOutFvBDResourceModel{} foundAttributeValue := false for _, newAttributeValue := range newAttributeValues { - if newAttributeValue.TnL3extOutName.ValueString() == GetMOName(attributeValue) { + if newAttributeValue.TnL3extOutName.ValueString() == GetMOName(attributeValue.ValueString()) { FvRsBDToOutValue = newAttributeValue foundAttributeValue = true break } } + tnL3extOutNameValue := basetypes.NewStringUnknown() + if !attributeValue.IsUnknown() { + tnL3extOutNameValue = basetypes.NewStringValue(GetMOName(attributeValue.ValueString())) + } FvRsBDToOut := FvRsBDToOutFvBDResourceModel{ - TnL3extOutName: basetypes.NewStringValue(GetMOName(attributeValue)), + TnL3extOutName: tnL3extOutNameValue, } if foundAttributeValue { @@ -1504,15 +2470,13 @@ func (r *FvBDResource) ModifyPlan(ctx context.Context, req resource.ModifyPlanRe } else { FvRsBDToOut.Annotation = planData.Annotation } + tagAnnotationFvRsBDToOutFvBDValue, _ := types.SetValueFrom(ctx, TagAnnotationFvRsBDToOutFvBDType, make([]TagAnnotationFvRsBDToOutFvBDResourceModel, 0)) + FvRsBDToOut.TagAnnotation = tagAnnotationFvRsBDToOutFvBDValue + tagTagFvRsBDToOutFvBDValue, _ := types.SetValueFrom(ctx, TagTagFvRsBDToOutFvBDType, make([]TagTagFvRsBDToOutFvBDResourceModel, 0)) + FvRsBDToOut.TagTag = tagTagFvRsBDToOutFvBDValue FvRsBDToOutList = append(FvRsBDToOutList, FvRsBDToOut) } - FvRsBDToOutType := types.ObjectType{ - AttrTypes: map[string]attr.Type{ - "annotation": basetypes.StringType{}, - "l3_outside_name": basetypes.StringType{}, - }, - } - FvRsBDToOutSet, _ := types.SetValueFrom(ctx, FvRsBDToOutType, FvRsBDToOutList) + FvRsBDToOutSet, _ := types.SetValueFrom(ctx, FvRsBDToOutFvBDType, FvRsBDToOutList) planData.FvRsBDToOut = FvRsBDToOutSet } else if stateData != nil { // used to replace use state for unknown planData.DeprecatedFvRsBDToOut = stateData.DeprecatedFvRsBDToOut @@ -1530,9 +2494,25 @@ func (r *FvBDResource) ModifyPlan(ctx context.Context, req resource.ModifyPlanRe } } } else if !configData.DeprecatedFvRsMldsn.IsNull() { + var newAttributeValues FvRsMldsnFvBDResourceModel + tagAnnotationFvRsMldsnFvBDValue, _ := types.SetValueFrom(ctx, TagAnnotationFvRsMldsnFvBDType, make([]TagAnnotationFvRsMldsnFvBDResourceModel, 0)) + tagTagFvRsMldsnFvBDValue, _ := types.SetValueFrom(ctx, TagTagFvRsMldsnFvBDType, make([]TagTagFvRsMldsnFvBDResourceModel, 0)) + annotationValue := planData.Annotation + if stateData != nil { + stateData.FvRsMldsn.As(ctx, &newAttributeValues, basetypes.ObjectAsOptions{}) + annotationValue = newAttributeValues.Annotation + tagAnnotationFvRsMldsnFvBDValue = newAttributeValues.TagAnnotation + tagTagFvRsMldsnFvBDValue = newAttributeValues.TagTag + } + tnMldSnoopPolNameValue := basetypes.NewStringUnknown() + if !configData.DeprecatedFvRsMldsn.IsUnknown() { + tnMldSnoopPolNameValue = basetypes.NewStringValue(GetMOName(configData.DeprecatedFvRsMldsn.ValueString())) + } FvRsMldsn := FvRsMldsnFvBDResourceModel{ - Annotation: planData.Annotation, - TnMldSnoopPolName: basetypes.NewStringValue(GetMOName(configData.DeprecatedFvRsMldsn.ValueString())), + Annotation: annotationValue, + TnMldSnoopPolName: tnMldSnoopPolNameValue, + TagAnnotation: tagAnnotationFvRsMldsnFvBDValue, + TagTag: tagTagFvRsMldsnFvBDValue, } FvRsMldsnObject, _ := types.ObjectValueFrom(ctx, FvRsMldsnFvBDType, FvRsMldsn) planData.FvRsMldsn = FvRsMldsnObject @@ -1552,9 +2532,25 @@ func (r *FvBDResource) ModifyPlan(ctx context.Context, req resource.ModifyPlanRe } } } else if !configData.DeprecatedFvRsABDPolMonPol.IsNull() { + var newAttributeValues FvRsABDPolMonPolFvBDResourceModel + tagAnnotationFvRsABDPolMonPolFvBDValue, _ := types.SetValueFrom(ctx, TagAnnotationFvRsABDPolMonPolFvBDType, make([]TagAnnotationFvRsABDPolMonPolFvBDResourceModel, 0)) + tagTagFvRsABDPolMonPolFvBDValue, _ := types.SetValueFrom(ctx, TagTagFvRsABDPolMonPolFvBDType, make([]TagTagFvRsABDPolMonPolFvBDResourceModel, 0)) + annotationValue := planData.Annotation + if stateData != nil { + stateData.FvRsABDPolMonPol.As(ctx, &newAttributeValues, basetypes.ObjectAsOptions{}) + annotationValue = newAttributeValues.Annotation + tagAnnotationFvRsABDPolMonPolFvBDValue = newAttributeValues.TagAnnotation + tagTagFvRsABDPolMonPolFvBDValue = newAttributeValues.TagTag + } + tnMonEPGPolNameValue := basetypes.NewStringUnknown() + if !configData.DeprecatedFvRsABDPolMonPol.IsUnknown() { + tnMonEPGPolNameValue = basetypes.NewStringValue(GetMOName(configData.DeprecatedFvRsABDPolMonPol.ValueString())) + } FvRsABDPolMonPol := FvRsABDPolMonPolFvBDResourceModel{ - Annotation: planData.Annotation, - TnMonEPGPolName: basetypes.NewStringValue(GetMOName(configData.DeprecatedFvRsABDPolMonPol.ValueString())), + Annotation: annotationValue, + TnMonEPGPolName: tnMonEPGPolNameValue, + TagAnnotation: tagAnnotationFvRsABDPolMonPolFvBDValue, + TagTag: tagTagFvRsABDPolMonPolFvBDValue, } FvRsABDPolMonPolObject, _ := types.ObjectValueFrom(ctx, FvRsABDPolMonPolFvBDType, FvRsABDPolMonPol) planData.FvRsABDPolMonPol = FvRsABDPolMonPolObject @@ -1574,9 +2570,25 @@ func (r *FvBDResource) ModifyPlan(ctx context.Context, req resource.ModifyPlanRe } } } else if !configData.DeprecatedFvRsBDToNdP.IsNull() { + var newAttributeValues FvRsBDToNdPFvBDResourceModel + tagAnnotationFvRsBDToNdPFvBDValue, _ := types.SetValueFrom(ctx, TagAnnotationFvRsBDToNdPFvBDType, make([]TagAnnotationFvRsBDToNdPFvBDResourceModel, 0)) + tagTagFvRsBDToNdPFvBDValue, _ := types.SetValueFrom(ctx, TagTagFvRsBDToNdPFvBDType, make([]TagTagFvRsBDToNdPFvBDResourceModel, 0)) + annotationValue := planData.Annotation + if stateData != nil { + stateData.FvRsBDToNdP.As(ctx, &newAttributeValues, basetypes.ObjectAsOptions{}) + annotationValue = newAttributeValues.Annotation + tagAnnotationFvRsBDToNdPFvBDValue = newAttributeValues.TagAnnotation + tagTagFvRsBDToNdPFvBDValue = newAttributeValues.TagTag + } + tnNdIfPolNameValue := basetypes.NewStringUnknown() + if !configData.DeprecatedFvRsBDToNdP.IsUnknown() { + tnNdIfPolNameValue = basetypes.NewStringValue(GetMOName(configData.DeprecatedFvRsBDToNdP.ValueString())) + } FvRsBDToNdP := FvRsBDToNdPFvBDResourceModel{ - Annotation: planData.Annotation, - TnNdIfPolName: basetypes.NewStringValue(GetMOName(configData.DeprecatedFvRsBDToNdP.ValueString())), + Annotation: annotationValue, + TnNdIfPolName: tnNdIfPolNameValue, + TagAnnotation: tagAnnotationFvRsBDToNdPFvBDValue, + TagTag: tagTagFvRsBDToNdPFvBDValue, } FvRsBDToNdPObject, _ := types.ObjectValueFrom(ctx, FvRsBDToNdPFvBDType, FvRsBDToNdP) planData.FvRsBDToNdP = FvRsBDToNdPObject @@ -1596,9 +2608,25 @@ func (r *FvBDResource) ModifyPlan(ctx context.Context, req resource.ModifyPlanRe } } } else if !configData.DeprecatedFvRsBDToRelayP.IsNull() { + var newAttributeValues FvRsBDToRelayPFvBDResourceModel + tagAnnotationFvRsBDToRelayPFvBDValue, _ := types.SetValueFrom(ctx, TagAnnotationFvRsBDToRelayPFvBDType, make([]TagAnnotationFvRsBDToRelayPFvBDResourceModel, 0)) + tagTagFvRsBDToRelayPFvBDValue, _ := types.SetValueFrom(ctx, TagTagFvRsBDToRelayPFvBDType, make([]TagTagFvRsBDToRelayPFvBDResourceModel, 0)) + annotationValue := planData.Annotation + if stateData != nil { + stateData.FvRsBDToRelayP.As(ctx, &newAttributeValues, basetypes.ObjectAsOptions{}) + annotationValue = newAttributeValues.Annotation + tagAnnotationFvRsBDToRelayPFvBDValue = newAttributeValues.TagAnnotation + tagTagFvRsBDToRelayPFvBDValue = newAttributeValues.TagTag + } + tnDhcpRelayPNameValue := basetypes.NewStringUnknown() + if !configData.DeprecatedFvRsBDToRelayP.IsUnknown() { + tnDhcpRelayPNameValue = basetypes.NewStringValue(GetMOName(configData.DeprecatedFvRsBDToRelayP.ValueString())) + } FvRsBDToRelayP := FvRsBDToRelayPFvBDResourceModel{ - Annotation: planData.Annotation, - TnDhcpRelayPName: basetypes.NewStringValue(GetMOName(configData.DeprecatedFvRsBDToRelayP.ValueString())), + Annotation: annotationValue, + TnDhcpRelayPName: tnDhcpRelayPNameValue, + TagAnnotation: tagAnnotationFvRsBDToRelayPFvBDValue, + TagTag: tagTagFvRsBDToRelayPFvBDValue, } FvRsBDToRelayPObject, _ := types.ObjectValueFrom(ctx, FvRsBDToRelayPFvBDType, FvRsBDToRelayP) planData.FvRsBDToRelayP = FvRsBDToRelayPObject @@ -1618,10 +2646,26 @@ func (r *FvBDResource) ModifyPlan(ctx context.Context, req resource.ModifyPlanRe } } } else if !configData.DeprecatedFvRsBDToProfile.IsNull() { + var newAttributeValues FvRsBDToProfileFvBDResourceModel + tagAnnotationFvRsBDToProfileFvBDValue, _ := types.SetValueFrom(ctx, TagAnnotationFvRsBDToProfileFvBDType, make([]TagAnnotationFvRsBDToProfileFvBDResourceModel, 0)) + tagTagFvRsBDToProfileFvBDValue, _ := types.SetValueFrom(ctx, TagTagFvRsBDToProfileFvBDType, make([]TagTagFvRsBDToProfileFvBDResourceModel, 0)) + annotationValue := planData.Annotation + if stateData != nil { + stateData.FvRsBDToProfile.As(ctx, &newAttributeValues, basetypes.ObjectAsOptions{}) + annotationValue = newAttributeValues.Annotation + tagAnnotationFvRsBDToProfileFvBDValue = newAttributeValues.TagAnnotation + tagTagFvRsBDToProfileFvBDValue = newAttributeValues.TagTag + } + tnRtctrlProfileNameValue := basetypes.NewStringUnknown() + if !configData.DeprecatedFvRsBDToProfile.IsUnknown() { + tnRtctrlProfileNameValue = basetypes.NewStringValue(GetMOName(configData.DeprecatedFvRsBDToProfile.ValueString())) + } FvRsBDToProfile := FvRsBDToProfileFvBDResourceModel{ - Annotation: planData.Annotation, + Annotation: annotationValue, TnL3extOutName: basetypes.NewStringValue(""), - TnRtctrlProfileName: basetypes.NewStringValue(GetMOName(configData.DeprecatedFvRsBDToProfile.ValueString())), + TnRtctrlProfileName: tnRtctrlProfileNameValue, + TagAnnotation: tagAnnotationFvRsBDToProfileFvBDValue, + TagTag: tagTagFvRsBDToProfileFvBDValue, } FvRsBDToProfileObject, _ := types.ObjectValueFrom(ctx, FvRsBDToProfileFvBDType, FvRsBDToProfile) planData.FvRsBDToProfile = FvRsBDToProfileObject @@ -1641,9 +2685,25 @@ func (r *FvBDResource) ModifyPlan(ctx context.Context, req resource.ModifyPlanRe } } } else if !configData.DeprecatedFvRsCtx.IsNull() { + var newAttributeValues FvRsCtxFvBDResourceModel + tagAnnotationFvRsCtxFvBDValue, _ := types.SetValueFrom(ctx, TagAnnotationFvRsCtxFvBDType, make([]TagAnnotationFvRsCtxFvBDResourceModel, 0)) + tagTagFvRsCtxFvBDValue, _ := types.SetValueFrom(ctx, TagTagFvRsCtxFvBDType, make([]TagTagFvRsCtxFvBDResourceModel, 0)) + annotationValue := planData.Annotation + if stateData != nil { + stateData.FvRsCtx.As(ctx, &newAttributeValues, basetypes.ObjectAsOptions{}) + annotationValue = newAttributeValues.Annotation + tagAnnotationFvRsCtxFvBDValue = newAttributeValues.TagAnnotation + tagTagFvRsCtxFvBDValue = newAttributeValues.TagTag + } + tnFvCtxNameValue := basetypes.NewStringUnknown() + if !configData.DeprecatedFvRsCtx.IsUnknown() { + tnFvCtxNameValue = basetypes.NewStringValue(GetMOName(configData.DeprecatedFvRsCtx.ValueString())) + } FvRsCtx := FvRsCtxFvBDResourceModel{ - Annotation: planData.Annotation, - TnFvCtxName: basetypes.NewStringValue(GetMOName(configData.DeprecatedFvRsCtx.ValueString())), + Annotation: annotationValue, + TnFvCtxName: tnFvCtxNameValue, + TagAnnotation: tagAnnotationFvRsCtxFvBDValue, + TagTag: tagTagFvRsCtxFvBDValue, } FvRsCtxObject, _ := types.ObjectValueFrom(ctx, FvRsCtxFvBDType, FvRsCtx) planData.FvRsCtx = FvRsCtxObject @@ -1652,30 +2712,33 @@ func (r *FvBDResource) ModifyPlan(ctx context.Context, req resource.ModifyPlanRe } planData.DeprecatedFvRsBDToNetflowMonitorPol = types.SetNull(deprecatedFvRsBDToNetflowMonitorPolType) - if !configData.DeprecatedFvRsBDToNetflowMonitorPol.IsNull() && stateData != nil { + if !configData.DeprecatedFvRsBDToNetflowMonitorPol.IsNull() { FvRsBDToNetflowMonitorPolList := make([]FvRsBDToNetflowMonitorPolFvBDResourceModel, 0) var attributeValues []FvRsBDToNetflowMonitorPolFvBDResourceModelV1 var newAttributeValues []FvRsBDToNetflowMonitorPolFvBDResourceModel configData.DeprecatedFvRsBDToNetflowMonitorPol.ElementsAs(ctx, &attributeValues, false) - stateData.FvRsBDToNetflowMonitorPol.ElementsAs(ctx, &newAttributeValues, false) + if stateData != nil { + stateData.FvRsBDToNetflowMonitorPol.ElementsAs(ctx, &newAttributeValues, false) + } for _, attributeValue := range attributeValues { + tnNetflowMonitorPolNameValue := basetypes.NewStringUnknown() + if !attributeValue.TnNetflowMonitorPolName.IsUnknown() { + tnNetflowMonitorPolNameValue = basetypes.NewStringValue(GetMOName(attributeValue.TnNetflowMonitorPolName.ValueString())) + } FvRsBDToNetflowMonitorPol := FvRsBDToNetflowMonitorPolFvBDResourceModel{ - Annotation: planData.Annotation, - FltType: attributeValue.FltType, + Annotation: planData.Annotation, + FltType: attributeValue.FltType, + TnNetflowMonitorPolName: tnNetflowMonitorPolNameValue, } - + tagAnnotationFvRsBDToNetflowMonitorPolFvBDValue, _ := types.SetValueFrom(ctx, TagAnnotationFvRsBDToNetflowMonitorPolFvBDType, make([]TagAnnotationFvRsBDToNetflowMonitorPolFvBDResourceModel, 0)) + FvRsBDToNetflowMonitorPol.TagAnnotation = tagAnnotationFvRsBDToNetflowMonitorPolFvBDValue + tagTagFvRsBDToNetflowMonitorPolFvBDValue, _ := types.SetValueFrom(ctx, TagTagFvRsBDToNetflowMonitorPolFvBDType, make([]TagTagFvRsBDToNetflowMonitorPolFvBDResourceModel, 0)) + FvRsBDToNetflowMonitorPol.TagTag = tagTagFvRsBDToNetflowMonitorPolFvBDValue FvRsBDToNetflowMonitorPolList = append(FvRsBDToNetflowMonitorPolList, FvRsBDToNetflowMonitorPol) } - FvRsBDToNetflowMonitorPolType := types.ObjectType{ - AttrTypes: map[string]attr.Type{ - "annotation": basetypes.StringType{}, - "filter_type": basetypes.StringType{}, - "netflow_monitor_policy_name": basetypes.StringType{}, - }, - } - FvRsBDToNetflowMonitorPolSet, _ := types.SetValueFrom(ctx, FvRsBDToNetflowMonitorPolType, FvRsBDToNetflowMonitorPolList) + FvRsBDToNetflowMonitorPolSet, _ := types.SetValueFrom(ctx, FvRsBDToNetflowMonitorPolFvBDType, FvRsBDToNetflowMonitorPolList) planData.FvRsBDToNetflowMonitorPol = FvRsBDToNetflowMonitorPolSet } @@ -2368,7 +3431,59 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, - MarkdownDescription: `A tag for enabling clients to add their own data. For example, to indicate who created this object.`, + MarkdownDescription: `A tag for enabling clients to add their own data. For example, to indicate who created this object.`, + }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, }, }, }, @@ -2420,6 +3535,58 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r }, MarkdownDescription: `The name alias of the Rogue Coop Exception object.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, }, @@ -2447,6 +3614,58 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r }, MarkdownDescription: `The name of the Monitoring Policy object.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, "relation_to_first_hop_security_policy": schema.SingleNestedAttribute{ @@ -2473,6 +3692,58 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r }, MarkdownDescription: `The name of the First Hop Security Policy object.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, "relation_to_neighbor_discovery_interface_policy": schema.SingleNestedAttribute{ @@ -2499,6 +3770,58 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r }, MarkdownDescription: `The name of the Neighbor Discovery Interface Policy object.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, "relation_to_netflow_monitor_policies": schema.SetNestedAttribute{ @@ -2536,6 +3859,58 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r }, MarkdownDescription: `The name of the NetFlow Monitor Policy object.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, }, @@ -2563,6 +3938,58 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r }, MarkdownDescription: `The name of the L3 Outside object.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, }, @@ -2598,6 +4025,58 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r }, MarkdownDescription: `The name of the Route Control Profile object.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, "relation_to_dhcp_relay_policy": schema.SingleNestedAttribute{ @@ -2624,6 +4103,58 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r }, MarkdownDescription: `The name of the DHCP Relay Policy object.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, "relation_to_end_point_retention_policy": schema.SingleNestedAttribute{ @@ -2661,6 +4192,58 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r }, MarkdownDescription: `The name of the Endpoint Retention Policy object.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, "relation_to_vrf": schema.SingleNestedAttribute{ @@ -2687,6 +4270,58 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r }, MarkdownDescription: `The name of the VRF object.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, "relation_to_igmp_snooping_policy": schema.SingleNestedAttribute{ @@ -2713,6 +4348,58 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r }, MarkdownDescription: `The name of the IGMP Snooping Policy object.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, "relation_to_mld_snooping_policy": schema.SingleNestedAttribute{ @@ -2739,6 +4426,58 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r }, MarkdownDescription: `The name of the MLD Snooping Policy object.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, "annotations": schema.SetNestedAttribute{ @@ -3119,7 +4858,7 @@ func (r *FvBDResource) ImportState(ctx context.Context, req resource.ImportState } func getAndSetFvBDAttributes(ctx context.Context, diags *diag.Diagnostics, client *client.Client, data *FvBDResourceModel) { - requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=children&rsp-subtree-class=%s", data.Id.ValueString(), "fvBD,fvAccP,fvRogueExceptionMac,fvRsABDPolMonPol,fvRsBDToFhs,fvRsBDToNdP,fvRsBDToNetflowMonitorPol,fvRsBDToOut,fvRsBDToProfile,fvRsBDToRelayP,fvRsBdToEpRet,fvRsCtx,fvRsIgmpsn,fvRsMldsn,tagAnnotation,tagTag"), "GET", nil) + requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=full&rsp-subtree-class=%s", data.Id.ValueString(), "fvBD,fvAccP,fvRogueExceptionMac,fvRsABDPolMonPol,fvRsBDToFhs,fvRsBDToNdP,fvRsBDToNetflowMonitorPol,fvRsBDToOut,fvRsBDToProfile,fvRsBDToRelayP,fvRsBdToEpRet,fvRsCtx,fvRsIgmpsn,fvRsMldsn,tagAnnotation,tagTag,tagAnnotation,tagTag,tagAnnotation,tagTag,tagAnnotation,tagTag,tagAnnotation,tagTag,tagAnnotation,tagTag,tagAnnotation,tagTag,tagAnnotation,tagTag,tagAnnotation,tagTag,tagAnnotation,tagTag,tagAnnotation,tagTag,tagAnnotation,tagTag,tagAnnotation,tagTag,tagAnnotation,tagTag"), "GET", nil) readData := getEmptyFvBDResourceModel() @@ -3265,7 +5004,47 @@ func getAndSetFvBDAttributes(ctx context.Context, diags *diag.Diagnostics, clien if childAttributeName == "ownerTag" { FvAccPFvBD.OwnerTag = basetypes.NewStringValue(childAttributeValue.(string)) } + + } + TagAnnotationFvAccPFvBDList := make([]TagAnnotationFvAccPFvBDResourceModel, 0) + TagTagFvAccPFvBDList := make([]TagTagFvAccPFvBDResourceModel, 0) + childrenOfFvAccPFvBD, childrenOfFvAccPFvBDExist := childClassDetails.(map[string]interface{})["children"] + if childrenOfFvAccPFvBDExist { + for _, childFvAccPFvBD := range childrenOfFvAccPFvBD.([]interface{}) { + for childClassNameFvAccPFvBD, childClassDetailsFvAccPFvBD := range childFvAccPFvBD.(map[string]interface{}) { + if childClassNameFvAccPFvBD == "tagAnnotation" { + TagAnnotationFvAccPFvBD := getEmptyTagAnnotationFvAccPFvBDResourceModel() + tagAnnotationchildAttributeValue := childClassDetailsFvAccPFvBD.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagAnnotationchildAttributeValue { + if childAttributeName == "key" { + TagAnnotationFvAccPFvBD.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagAnnotationFvAccPFvBD.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagAnnotationFvAccPFvBDList = append(TagAnnotationFvAccPFvBDList, TagAnnotationFvAccPFvBD) + } + if childClassNameFvAccPFvBD == "tagTag" { + TagTagFvAccPFvBD := getEmptyTagTagFvAccPFvBDResourceModel() + tagTagchildAttributeValue := childClassDetailsFvAccPFvBD.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagTagchildAttributeValue { + if childAttributeName == "key" { + TagTagFvAccPFvBD.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagTagFvAccPFvBD.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagTagFvAccPFvBDList = append(TagTagFvAccPFvBDList, TagTagFvAccPFvBD) + } + } + } } + TagAnnotationFvAccPFvBDSet, _ := types.SetValueFrom(ctx, TagAnnotationFvAccPFvBDType, TagAnnotationFvAccPFvBDList) + FvAccPFvBD.TagAnnotation = TagAnnotationFvAccPFvBDSet + TagTagFvAccPFvBDSet, _ := types.SetValueFrom(ctx, TagTagFvAccPFvBDType, TagTagFvAccPFvBDList) + FvAccPFvBD.TagTag = TagTagFvAccPFvBDSet FvAccPFvBDList = append(FvAccPFvBDList, FvAccPFvBD) } if childClassName == "fvRogueExceptionMac" { @@ -3286,7 +5065,47 @@ func getAndSetFvBDAttributes(ctx context.Context, diags *diag.Diagnostics, clien if childAttributeName == "nameAlias" { FvRogueExceptionMacFvBD.NameAlias = basetypes.NewStringValue(childAttributeValue.(string)) } + + } + TagAnnotationFvRogueExceptionMacFvBDList := make([]TagAnnotationFvRogueExceptionMacFvBDResourceModel, 0) + TagTagFvRogueExceptionMacFvBDList := make([]TagTagFvRogueExceptionMacFvBDResourceModel, 0) + childrenOfFvRogueExceptionMacFvBD, childrenOfFvRogueExceptionMacFvBDExist := childClassDetails.(map[string]interface{})["children"] + if childrenOfFvRogueExceptionMacFvBDExist { + for _, childFvRogueExceptionMacFvBD := range childrenOfFvRogueExceptionMacFvBD.([]interface{}) { + for childClassNameFvRogueExceptionMacFvBD, childClassDetailsFvRogueExceptionMacFvBD := range childFvRogueExceptionMacFvBD.(map[string]interface{}) { + if childClassNameFvRogueExceptionMacFvBD == "tagAnnotation" { + TagAnnotationFvRogueExceptionMacFvBD := getEmptyTagAnnotationFvRogueExceptionMacFvBDResourceModel() + tagAnnotationchildAttributeValue := childClassDetailsFvRogueExceptionMacFvBD.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagAnnotationchildAttributeValue { + if childAttributeName == "key" { + TagAnnotationFvRogueExceptionMacFvBD.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagAnnotationFvRogueExceptionMacFvBD.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagAnnotationFvRogueExceptionMacFvBDList = append(TagAnnotationFvRogueExceptionMacFvBDList, TagAnnotationFvRogueExceptionMacFvBD) + } + if childClassNameFvRogueExceptionMacFvBD == "tagTag" { + TagTagFvRogueExceptionMacFvBD := getEmptyTagTagFvRogueExceptionMacFvBDResourceModel() + tagTagchildAttributeValue := childClassDetailsFvRogueExceptionMacFvBD.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagTagchildAttributeValue { + if childAttributeName == "key" { + TagTagFvRogueExceptionMacFvBD.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagTagFvRogueExceptionMacFvBD.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagTagFvRogueExceptionMacFvBDList = append(TagTagFvRogueExceptionMacFvBDList, TagTagFvRogueExceptionMacFvBD) + } + } + } } + TagAnnotationFvRogueExceptionMacFvBDSet, _ := types.SetValueFrom(ctx, TagAnnotationFvRogueExceptionMacFvBDType, TagAnnotationFvRogueExceptionMacFvBDList) + FvRogueExceptionMacFvBD.TagAnnotation = TagAnnotationFvRogueExceptionMacFvBDSet + TagTagFvRogueExceptionMacFvBDSet, _ := types.SetValueFrom(ctx, TagTagFvRogueExceptionMacFvBDType, TagTagFvRogueExceptionMacFvBDList) + FvRogueExceptionMacFvBD.TagTag = TagTagFvRogueExceptionMacFvBDSet FvRogueExceptionMacFvBDList = append(FvRogueExceptionMacFvBDList, FvRogueExceptionMacFvBD) } if childClassName == "fvRsABDPolMonPol" { @@ -3298,7 +5117,47 @@ func getAndSetFvBDAttributes(ctx context.Context, diags *diag.Diagnostics, clien if childAttributeName == "tnMonEPGPolName" { FvRsABDPolMonPolFvBD.TnMonEPGPolName = basetypes.NewStringValue(childAttributeValue.(string)) } + + } + TagAnnotationFvRsABDPolMonPolFvBDList := make([]TagAnnotationFvRsABDPolMonPolFvBDResourceModel, 0) + TagTagFvRsABDPolMonPolFvBDList := make([]TagTagFvRsABDPolMonPolFvBDResourceModel, 0) + childrenOfFvRsABDPolMonPolFvBD, childrenOfFvRsABDPolMonPolFvBDExist := childClassDetails.(map[string]interface{})["children"] + if childrenOfFvRsABDPolMonPolFvBDExist { + for _, childFvRsABDPolMonPolFvBD := range childrenOfFvRsABDPolMonPolFvBD.([]interface{}) { + for childClassNameFvRsABDPolMonPolFvBD, childClassDetailsFvRsABDPolMonPolFvBD := range childFvRsABDPolMonPolFvBD.(map[string]interface{}) { + if childClassNameFvRsABDPolMonPolFvBD == "tagAnnotation" { + TagAnnotationFvRsABDPolMonPolFvBD := getEmptyTagAnnotationFvRsABDPolMonPolFvBDResourceModel() + tagAnnotationchildAttributeValue := childClassDetailsFvRsABDPolMonPolFvBD.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagAnnotationchildAttributeValue { + if childAttributeName == "key" { + TagAnnotationFvRsABDPolMonPolFvBD.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagAnnotationFvRsABDPolMonPolFvBD.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagAnnotationFvRsABDPolMonPolFvBDList = append(TagAnnotationFvRsABDPolMonPolFvBDList, TagAnnotationFvRsABDPolMonPolFvBD) + } + if childClassNameFvRsABDPolMonPolFvBD == "tagTag" { + TagTagFvRsABDPolMonPolFvBD := getEmptyTagTagFvRsABDPolMonPolFvBDResourceModel() + tagTagchildAttributeValue := childClassDetailsFvRsABDPolMonPolFvBD.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagTagchildAttributeValue { + if childAttributeName == "key" { + TagTagFvRsABDPolMonPolFvBD.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagTagFvRsABDPolMonPolFvBD.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagTagFvRsABDPolMonPolFvBDList = append(TagTagFvRsABDPolMonPolFvBDList, TagTagFvRsABDPolMonPolFvBD) + } + } + } } + TagAnnotationFvRsABDPolMonPolFvBDSet, _ := types.SetValueFrom(ctx, TagAnnotationFvRsABDPolMonPolFvBDType, TagAnnotationFvRsABDPolMonPolFvBDList) + FvRsABDPolMonPolFvBD.TagAnnotation = TagAnnotationFvRsABDPolMonPolFvBDSet + TagTagFvRsABDPolMonPolFvBDSet, _ := types.SetValueFrom(ctx, TagTagFvRsABDPolMonPolFvBDType, TagTagFvRsABDPolMonPolFvBDList) + FvRsABDPolMonPolFvBD.TagTag = TagTagFvRsABDPolMonPolFvBDSet FvRsABDPolMonPolFvBDList = append(FvRsABDPolMonPolFvBDList, FvRsABDPolMonPolFvBD) } if childClassName == "fvRsBDToFhs" { @@ -3310,7 +5169,47 @@ func getAndSetFvBDAttributes(ctx context.Context, diags *diag.Diagnostics, clien if childAttributeName == "tnFhsBDPolName" { FvRsBDToFhsFvBD.TnFhsBDPolName = basetypes.NewStringValue(childAttributeValue.(string)) } + + } + TagAnnotationFvRsBDToFhsFvBDList := make([]TagAnnotationFvRsBDToFhsFvBDResourceModel, 0) + TagTagFvRsBDToFhsFvBDList := make([]TagTagFvRsBDToFhsFvBDResourceModel, 0) + childrenOfFvRsBDToFhsFvBD, childrenOfFvRsBDToFhsFvBDExist := childClassDetails.(map[string]interface{})["children"] + if childrenOfFvRsBDToFhsFvBDExist { + for _, childFvRsBDToFhsFvBD := range childrenOfFvRsBDToFhsFvBD.([]interface{}) { + for childClassNameFvRsBDToFhsFvBD, childClassDetailsFvRsBDToFhsFvBD := range childFvRsBDToFhsFvBD.(map[string]interface{}) { + if childClassNameFvRsBDToFhsFvBD == "tagAnnotation" { + TagAnnotationFvRsBDToFhsFvBD := getEmptyTagAnnotationFvRsBDToFhsFvBDResourceModel() + tagAnnotationchildAttributeValue := childClassDetailsFvRsBDToFhsFvBD.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagAnnotationchildAttributeValue { + if childAttributeName == "key" { + TagAnnotationFvRsBDToFhsFvBD.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagAnnotationFvRsBDToFhsFvBD.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagAnnotationFvRsBDToFhsFvBDList = append(TagAnnotationFvRsBDToFhsFvBDList, TagAnnotationFvRsBDToFhsFvBD) + } + if childClassNameFvRsBDToFhsFvBD == "tagTag" { + TagTagFvRsBDToFhsFvBD := getEmptyTagTagFvRsBDToFhsFvBDResourceModel() + tagTagchildAttributeValue := childClassDetailsFvRsBDToFhsFvBD.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagTagchildAttributeValue { + if childAttributeName == "key" { + TagTagFvRsBDToFhsFvBD.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagTagFvRsBDToFhsFvBD.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagTagFvRsBDToFhsFvBDList = append(TagTagFvRsBDToFhsFvBDList, TagTagFvRsBDToFhsFvBD) + } + } + } } + TagAnnotationFvRsBDToFhsFvBDSet, _ := types.SetValueFrom(ctx, TagAnnotationFvRsBDToFhsFvBDType, TagAnnotationFvRsBDToFhsFvBDList) + FvRsBDToFhsFvBD.TagAnnotation = TagAnnotationFvRsBDToFhsFvBDSet + TagTagFvRsBDToFhsFvBDSet, _ := types.SetValueFrom(ctx, TagTagFvRsBDToFhsFvBDType, TagTagFvRsBDToFhsFvBDList) + FvRsBDToFhsFvBD.TagTag = TagTagFvRsBDToFhsFvBDSet FvRsBDToFhsFvBDList = append(FvRsBDToFhsFvBDList, FvRsBDToFhsFvBD) } if childClassName == "fvRsBDToNdP" { @@ -3322,7 +5221,47 @@ func getAndSetFvBDAttributes(ctx context.Context, diags *diag.Diagnostics, clien if childAttributeName == "tnNdIfPolName" { FvRsBDToNdPFvBD.TnNdIfPolName = basetypes.NewStringValue(childAttributeValue.(string)) } + + } + TagAnnotationFvRsBDToNdPFvBDList := make([]TagAnnotationFvRsBDToNdPFvBDResourceModel, 0) + TagTagFvRsBDToNdPFvBDList := make([]TagTagFvRsBDToNdPFvBDResourceModel, 0) + childrenOfFvRsBDToNdPFvBD, childrenOfFvRsBDToNdPFvBDExist := childClassDetails.(map[string]interface{})["children"] + if childrenOfFvRsBDToNdPFvBDExist { + for _, childFvRsBDToNdPFvBD := range childrenOfFvRsBDToNdPFvBD.([]interface{}) { + for childClassNameFvRsBDToNdPFvBD, childClassDetailsFvRsBDToNdPFvBD := range childFvRsBDToNdPFvBD.(map[string]interface{}) { + if childClassNameFvRsBDToNdPFvBD == "tagAnnotation" { + TagAnnotationFvRsBDToNdPFvBD := getEmptyTagAnnotationFvRsBDToNdPFvBDResourceModel() + tagAnnotationchildAttributeValue := childClassDetailsFvRsBDToNdPFvBD.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagAnnotationchildAttributeValue { + if childAttributeName == "key" { + TagAnnotationFvRsBDToNdPFvBD.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagAnnotationFvRsBDToNdPFvBD.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagAnnotationFvRsBDToNdPFvBDList = append(TagAnnotationFvRsBDToNdPFvBDList, TagAnnotationFvRsBDToNdPFvBD) + } + if childClassNameFvRsBDToNdPFvBD == "tagTag" { + TagTagFvRsBDToNdPFvBD := getEmptyTagTagFvRsBDToNdPFvBDResourceModel() + tagTagchildAttributeValue := childClassDetailsFvRsBDToNdPFvBD.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagTagchildAttributeValue { + if childAttributeName == "key" { + TagTagFvRsBDToNdPFvBD.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagTagFvRsBDToNdPFvBD.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagTagFvRsBDToNdPFvBDList = append(TagTagFvRsBDToNdPFvBDList, TagTagFvRsBDToNdPFvBD) + } + } + } } + TagAnnotationFvRsBDToNdPFvBDSet, _ := types.SetValueFrom(ctx, TagAnnotationFvRsBDToNdPFvBDType, TagAnnotationFvRsBDToNdPFvBDList) + FvRsBDToNdPFvBD.TagAnnotation = TagAnnotationFvRsBDToNdPFvBDSet + TagTagFvRsBDToNdPFvBDSet, _ := types.SetValueFrom(ctx, TagTagFvRsBDToNdPFvBDType, TagTagFvRsBDToNdPFvBDList) + FvRsBDToNdPFvBD.TagTag = TagTagFvRsBDToNdPFvBDSet FvRsBDToNdPFvBDList = append(FvRsBDToNdPFvBDList, FvRsBDToNdPFvBD) } if childClassName == "fvRsBDToNetflowMonitorPol" { @@ -3337,7 +5276,47 @@ func getAndSetFvBDAttributes(ctx context.Context, diags *diag.Diagnostics, clien if childAttributeName == "tnNetflowMonitorPolName" { FvRsBDToNetflowMonitorPolFvBD.TnNetflowMonitorPolName = basetypes.NewStringValue(childAttributeValue.(string)) } + + } + TagAnnotationFvRsBDToNetflowMonitorPolFvBDList := make([]TagAnnotationFvRsBDToNetflowMonitorPolFvBDResourceModel, 0) + TagTagFvRsBDToNetflowMonitorPolFvBDList := make([]TagTagFvRsBDToNetflowMonitorPolFvBDResourceModel, 0) + childrenOfFvRsBDToNetflowMonitorPolFvBD, childrenOfFvRsBDToNetflowMonitorPolFvBDExist := childClassDetails.(map[string]interface{})["children"] + if childrenOfFvRsBDToNetflowMonitorPolFvBDExist { + for _, childFvRsBDToNetflowMonitorPolFvBD := range childrenOfFvRsBDToNetflowMonitorPolFvBD.([]interface{}) { + for childClassNameFvRsBDToNetflowMonitorPolFvBD, childClassDetailsFvRsBDToNetflowMonitorPolFvBD := range childFvRsBDToNetflowMonitorPolFvBD.(map[string]interface{}) { + if childClassNameFvRsBDToNetflowMonitorPolFvBD == "tagAnnotation" { + TagAnnotationFvRsBDToNetflowMonitorPolFvBD := getEmptyTagAnnotationFvRsBDToNetflowMonitorPolFvBDResourceModel() + tagAnnotationchildAttributeValue := childClassDetailsFvRsBDToNetflowMonitorPolFvBD.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagAnnotationchildAttributeValue { + if childAttributeName == "key" { + TagAnnotationFvRsBDToNetflowMonitorPolFvBD.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagAnnotationFvRsBDToNetflowMonitorPolFvBD.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagAnnotationFvRsBDToNetflowMonitorPolFvBDList = append(TagAnnotationFvRsBDToNetflowMonitorPolFvBDList, TagAnnotationFvRsBDToNetflowMonitorPolFvBD) + } + if childClassNameFvRsBDToNetflowMonitorPolFvBD == "tagTag" { + TagTagFvRsBDToNetflowMonitorPolFvBD := getEmptyTagTagFvRsBDToNetflowMonitorPolFvBDResourceModel() + tagTagchildAttributeValue := childClassDetailsFvRsBDToNetflowMonitorPolFvBD.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagTagchildAttributeValue { + if childAttributeName == "key" { + TagTagFvRsBDToNetflowMonitorPolFvBD.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagTagFvRsBDToNetflowMonitorPolFvBD.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagTagFvRsBDToNetflowMonitorPolFvBDList = append(TagTagFvRsBDToNetflowMonitorPolFvBDList, TagTagFvRsBDToNetflowMonitorPolFvBD) + } + } + } } + TagAnnotationFvRsBDToNetflowMonitorPolFvBDSet, _ := types.SetValueFrom(ctx, TagAnnotationFvRsBDToNetflowMonitorPolFvBDType, TagAnnotationFvRsBDToNetflowMonitorPolFvBDList) + FvRsBDToNetflowMonitorPolFvBD.TagAnnotation = TagAnnotationFvRsBDToNetflowMonitorPolFvBDSet + TagTagFvRsBDToNetflowMonitorPolFvBDSet, _ := types.SetValueFrom(ctx, TagTagFvRsBDToNetflowMonitorPolFvBDType, TagTagFvRsBDToNetflowMonitorPolFvBDList) + FvRsBDToNetflowMonitorPolFvBD.TagTag = TagTagFvRsBDToNetflowMonitorPolFvBDSet FvRsBDToNetflowMonitorPolFvBDList = append(FvRsBDToNetflowMonitorPolFvBDList, FvRsBDToNetflowMonitorPolFvBD) } if childClassName == "fvRsBDToOut" { @@ -3349,7 +5328,47 @@ func getAndSetFvBDAttributes(ctx context.Context, diags *diag.Diagnostics, clien if childAttributeName == "tnL3extOutName" { FvRsBDToOutFvBD.TnL3extOutName = basetypes.NewStringValue(childAttributeValue.(string)) } + + } + TagAnnotationFvRsBDToOutFvBDList := make([]TagAnnotationFvRsBDToOutFvBDResourceModel, 0) + TagTagFvRsBDToOutFvBDList := make([]TagTagFvRsBDToOutFvBDResourceModel, 0) + childrenOfFvRsBDToOutFvBD, childrenOfFvRsBDToOutFvBDExist := childClassDetails.(map[string]interface{})["children"] + if childrenOfFvRsBDToOutFvBDExist { + for _, childFvRsBDToOutFvBD := range childrenOfFvRsBDToOutFvBD.([]interface{}) { + for childClassNameFvRsBDToOutFvBD, childClassDetailsFvRsBDToOutFvBD := range childFvRsBDToOutFvBD.(map[string]interface{}) { + if childClassNameFvRsBDToOutFvBD == "tagAnnotation" { + TagAnnotationFvRsBDToOutFvBD := getEmptyTagAnnotationFvRsBDToOutFvBDResourceModel() + tagAnnotationchildAttributeValue := childClassDetailsFvRsBDToOutFvBD.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagAnnotationchildAttributeValue { + if childAttributeName == "key" { + TagAnnotationFvRsBDToOutFvBD.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagAnnotationFvRsBDToOutFvBD.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagAnnotationFvRsBDToOutFvBDList = append(TagAnnotationFvRsBDToOutFvBDList, TagAnnotationFvRsBDToOutFvBD) + } + if childClassNameFvRsBDToOutFvBD == "tagTag" { + TagTagFvRsBDToOutFvBD := getEmptyTagTagFvRsBDToOutFvBDResourceModel() + tagTagchildAttributeValue := childClassDetailsFvRsBDToOutFvBD.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagTagchildAttributeValue { + if childAttributeName == "key" { + TagTagFvRsBDToOutFvBD.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagTagFvRsBDToOutFvBD.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagTagFvRsBDToOutFvBDList = append(TagTagFvRsBDToOutFvBDList, TagTagFvRsBDToOutFvBD) + } + } + } } + TagAnnotationFvRsBDToOutFvBDSet, _ := types.SetValueFrom(ctx, TagAnnotationFvRsBDToOutFvBDType, TagAnnotationFvRsBDToOutFvBDList) + FvRsBDToOutFvBD.TagAnnotation = TagAnnotationFvRsBDToOutFvBDSet + TagTagFvRsBDToOutFvBDSet, _ := types.SetValueFrom(ctx, TagTagFvRsBDToOutFvBDType, TagTagFvRsBDToOutFvBDList) + FvRsBDToOutFvBD.TagTag = TagTagFvRsBDToOutFvBDSet FvRsBDToOutFvBDList = append(FvRsBDToOutFvBDList, FvRsBDToOutFvBD) } if childClassName == "fvRsBDToProfile" { @@ -3364,7 +5383,47 @@ func getAndSetFvBDAttributes(ctx context.Context, diags *diag.Diagnostics, clien if childAttributeName == "tnRtctrlProfileName" { FvRsBDToProfileFvBD.TnRtctrlProfileName = basetypes.NewStringValue(childAttributeValue.(string)) } + + } + TagAnnotationFvRsBDToProfileFvBDList := make([]TagAnnotationFvRsBDToProfileFvBDResourceModel, 0) + TagTagFvRsBDToProfileFvBDList := make([]TagTagFvRsBDToProfileFvBDResourceModel, 0) + childrenOfFvRsBDToProfileFvBD, childrenOfFvRsBDToProfileFvBDExist := childClassDetails.(map[string]interface{})["children"] + if childrenOfFvRsBDToProfileFvBDExist { + for _, childFvRsBDToProfileFvBD := range childrenOfFvRsBDToProfileFvBD.([]interface{}) { + for childClassNameFvRsBDToProfileFvBD, childClassDetailsFvRsBDToProfileFvBD := range childFvRsBDToProfileFvBD.(map[string]interface{}) { + if childClassNameFvRsBDToProfileFvBD == "tagAnnotation" { + TagAnnotationFvRsBDToProfileFvBD := getEmptyTagAnnotationFvRsBDToProfileFvBDResourceModel() + tagAnnotationchildAttributeValue := childClassDetailsFvRsBDToProfileFvBD.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagAnnotationchildAttributeValue { + if childAttributeName == "key" { + TagAnnotationFvRsBDToProfileFvBD.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagAnnotationFvRsBDToProfileFvBD.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagAnnotationFvRsBDToProfileFvBDList = append(TagAnnotationFvRsBDToProfileFvBDList, TagAnnotationFvRsBDToProfileFvBD) + } + if childClassNameFvRsBDToProfileFvBD == "tagTag" { + TagTagFvRsBDToProfileFvBD := getEmptyTagTagFvRsBDToProfileFvBDResourceModel() + tagTagchildAttributeValue := childClassDetailsFvRsBDToProfileFvBD.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagTagchildAttributeValue { + if childAttributeName == "key" { + TagTagFvRsBDToProfileFvBD.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagTagFvRsBDToProfileFvBD.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagTagFvRsBDToProfileFvBDList = append(TagTagFvRsBDToProfileFvBDList, TagTagFvRsBDToProfileFvBD) + } + } + } } + TagAnnotationFvRsBDToProfileFvBDSet, _ := types.SetValueFrom(ctx, TagAnnotationFvRsBDToProfileFvBDType, TagAnnotationFvRsBDToProfileFvBDList) + FvRsBDToProfileFvBD.TagAnnotation = TagAnnotationFvRsBDToProfileFvBDSet + TagTagFvRsBDToProfileFvBDSet, _ := types.SetValueFrom(ctx, TagTagFvRsBDToProfileFvBDType, TagTagFvRsBDToProfileFvBDList) + FvRsBDToProfileFvBD.TagTag = TagTagFvRsBDToProfileFvBDSet FvRsBDToProfileFvBDList = append(FvRsBDToProfileFvBDList, FvRsBDToProfileFvBD) } if childClassName == "fvRsBDToRelayP" { @@ -3376,7 +5435,47 @@ func getAndSetFvBDAttributes(ctx context.Context, diags *diag.Diagnostics, clien if childAttributeName == "tnDhcpRelayPName" { FvRsBDToRelayPFvBD.TnDhcpRelayPName = basetypes.NewStringValue(childAttributeValue.(string)) } + + } + TagAnnotationFvRsBDToRelayPFvBDList := make([]TagAnnotationFvRsBDToRelayPFvBDResourceModel, 0) + TagTagFvRsBDToRelayPFvBDList := make([]TagTagFvRsBDToRelayPFvBDResourceModel, 0) + childrenOfFvRsBDToRelayPFvBD, childrenOfFvRsBDToRelayPFvBDExist := childClassDetails.(map[string]interface{})["children"] + if childrenOfFvRsBDToRelayPFvBDExist { + for _, childFvRsBDToRelayPFvBD := range childrenOfFvRsBDToRelayPFvBD.([]interface{}) { + for childClassNameFvRsBDToRelayPFvBD, childClassDetailsFvRsBDToRelayPFvBD := range childFvRsBDToRelayPFvBD.(map[string]interface{}) { + if childClassNameFvRsBDToRelayPFvBD == "tagAnnotation" { + TagAnnotationFvRsBDToRelayPFvBD := getEmptyTagAnnotationFvRsBDToRelayPFvBDResourceModel() + tagAnnotationchildAttributeValue := childClassDetailsFvRsBDToRelayPFvBD.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagAnnotationchildAttributeValue { + if childAttributeName == "key" { + TagAnnotationFvRsBDToRelayPFvBD.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagAnnotationFvRsBDToRelayPFvBD.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagAnnotationFvRsBDToRelayPFvBDList = append(TagAnnotationFvRsBDToRelayPFvBDList, TagAnnotationFvRsBDToRelayPFvBD) + } + if childClassNameFvRsBDToRelayPFvBD == "tagTag" { + TagTagFvRsBDToRelayPFvBD := getEmptyTagTagFvRsBDToRelayPFvBDResourceModel() + tagTagchildAttributeValue := childClassDetailsFvRsBDToRelayPFvBD.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagTagchildAttributeValue { + if childAttributeName == "key" { + TagTagFvRsBDToRelayPFvBD.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagTagFvRsBDToRelayPFvBD.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagTagFvRsBDToRelayPFvBDList = append(TagTagFvRsBDToRelayPFvBDList, TagTagFvRsBDToRelayPFvBD) + } + } + } } + TagAnnotationFvRsBDToRelayPFvBDSet, _ := types.SetValueFrom(ctx, TagAnnotationFvRsBDToRelayPFvBDType, TagAnnotationFvRsBDToRelayPFvBDList) + FvRsBDToRelayPFvBD.TagAnnotation = TagAnnotationFvRsBDToRelayPFvBDSet + TagTagFvRsBDToRelayPFvBDSet, _ := types.SetValueFrom(ctx, TagTagFvRsBDToRelayPFvBDType, TagTagFvRsBDToRelayPFvBDList) + FvRsBDToRelayPFvBD.TagTag = TagTagFvRsBDToRelayPFvBDSet FvRsBDToRelayPFvBDList = append(FvRsBDToRelayPFvBDList, FvRsBDToRelayPFvBD) } if childClassName == "fvRsBdToEpRet" { @@ -3391,7 +5490,47 @@ func getAndSetFvBDAttributes(ctx context.Context, diags *diag.Diagnostics, clien if childAttributeName == "tnFvEpRetPolName" { FvRsBdToEpRetFvBD.TnFvEpRetPolName = basetypes.NewStringValue(childAttributeValue.(string)) } + + } + TagAnnotationFvRsBdToEpRetFvBDList := make([]TagAnnotationFvRsBdToEpRetFvBDResourceModel, 0) + TagTagFvRsBdToEpRetFvBDList := make([]TagTagFvRsBdToEpRetFvBDResourceModel, 0) + childrenOfFvRsBdToEpRetFvBD, childrenOfFvRsBdToEpRetFvBDExist := childClassDetails.(map[string]interface{})["children"] + if childrenOfFvRsBdToEpRetFvBDExist { + for _, childFvRsBdToEpRetFvBD := range childrenOfFvRsBdToEpRetFvBD.([]interface{}) { + for childClassNameFvRsBdToEpRetFvBD, childClassDetailsFvRsBdToEpRetFvBD := range childFvRsBdToEpRetFvBD.(map[string]interface{}) { + if childClassNameFvRsBdToEpRetFvBD == "tagAnnotation" { + TagAnnotationFvRsBdToEpRetFvBD := getEmptyTagAnnotationFvRsBdToEpRetFvBDResourceModel() + tagAnnotationchildAttributeValue := childClassDetailsFvRsBdToEpRetFvBD.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagAnnotationchildAttributeValue { + if childAttributeName == "key" { + TagAnnotationFvRsBdToEpRetFvBD.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagAnnotationFvRsBdToEpRetFvBD.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagAnnotationFvRsBdToEpRetFvBDList = append(TagAnnotationFvRsBdToEpRetFvBDList, TagAnnotationFvRsBdToEpRetFvBD) + } + if childClassNameFvRsBdToEpRetFvBD == "tagTag" { + TagTagFvRsBdToEpRetFvBD := getEmptyTagTagFvRsBdToEpRetFvBDResourceModel() + tagTagchildAttributeValue := childClassDetailsFvRsBdToEpRetFvBD.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagTagchildAttributeValue { + if childAttributeName == "key" { + TagTagFvRsBdToEpRetFvBD.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagTagFvRsBdToEpRetFvBD.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagTagFvRsBdToEpRetFvBDList = append(TagTagFvRsBdToEpRetFvBDList, TagTagFvRsBdToEpRetFvBD) + } + } + } } + TagAnnotationFvRsBdToEpRetFvBDSet, _ := types.SetValueFrom(ctx, TagAnnotationFvRsBdToEpRetFvBDType, TagAnnotationFvRsBdToEpRetFvBDList) + FvRsBdToEpRetFvBD.TagAnnotation = TagAnnotationFvRsBdToEpRetFvBDSet + TagTagFvRsBdToEpRetFvBDSet, _ := types.SetValueFrom(ctx, TagTagFvRsBdToEpRetFvBDType, TagTagFvRsBdToEpRetFvBDList) + FvRsBdToEpRetFvBD.TagTag = TagTagFvRsBdToEpRetFvBDSet FvRsBdToEpRetFvBDList = append(FvRsBdToEpRetFvBDList, FvRsBdToEpRetFvBD) } if childClassName == "fvRsCtx" { @@ -3403,7 +5542,47 @@ func getAndSetFvBDAttributes(ctx context.Context, diags *diag.Diagnostics, clien if childAttributeName == "tnFvCtxName" { FvRsCtxFvBD.TnFvCtxName = basetypes.NewStringValue(childAttributeValue.(string)) } + + } + TagAnnotationFvRsCtxFvBDList := make([]TagAnnotationFvRsCtxFvBDResourceModel, 0) + TagTagFvRsCtxFvBDList := make([]TagTagFvRsCtxFvBDResourceModel, 0) + childrenOfFvRsCtxFvBD, childrenOfFvRsCtxFvBDExist := childClassDetails.(map[string]interface{})["children"] + if childrenOfFvRsCtxFvBDExist { + for _, childFvRsCtxFvBD := range childrenOfFvRsCtxFvBD.([]interface{}) { + for childClassNameFvRsCtxFvBD, childClassDetailsFvRsCtxFvBD := range childFvRsCtxFvBD.(map[string]interface{}) { + if childClassNameFvRsCtxFvBD == "tagAnnotation" { + TagAnnotationFvRsCtxFvBD := getEmptyTagAnnotationFvRsCtxFvBDResourceModel() + tagAnnotationchildAttributeValue := childClassDetailsFvRsCtxFvBD.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagAnnotationchildAttributeValue { + if childAttributeName == "key" { + TagAnnotationFvRsCtxFvBD.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagAnnotationFvRsCtxFvBD.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagAnnotationFvRsCtxFvBDList = append(TagAnnotationFvRsCtxFvBDList, TagAnnotationFvRsCtxFvBD) + } + if childClassNameFvRsCtxFvBD == "tagTag" { + TagTagFvRsCtxFvBD := getEmptyTagTagFvRsCtxFvBDResourceModel() + tagTagchildAttributeValue := childClassDetailsFvRsCtxFvBD.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagTagchildAttributeValue { + if childAttributeName == "key" { + TagTagFvRsCtxFvBD.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagTagFvRsCtxFvBD.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagTagFvRsCtxFvBDList = append(TagTagFvRsCtxFvBDList, TagTagFvRsCtxFvBD) + } + } + } } + TagAnnotationFvRsCtxFvBDSet, _ := types.SetValueFrom(ctx, TagAnnotationFvRsCtxFvBDType, TagAnnotationFvRsCtxFvBDList) + FvRsCtxFvBD.TagAnnotation = TagAnnotationFvRsCtxFvBDSet + TagTagFvRsCtxFvBDSet, _ := types.SetValueFrom(ctx, TagTagFvRsCtxFvBDType, TagTagFvRsCtxFvBDList) + FvRsCtxFvBD.TagTag = TagTagFvRsCtxFvBDSet FvRsCtxFvBDList = append(FvRsCtxFvBDList, FvRsCtxFvBD) } if childClassName == "fvRsIgmpsn" { @@ -3415,7 +5594,47 @@ func getAndSetFvBDAttributes(ctx context.Context, diags *diag.Diagnostics, clien if childAttributeName == "tnIgmpSnoopPolName" { FvRsIgmpsnFvBD.TnIgmpSnoopPolName = basetypes.NewStringValue(childAttributeValue.(string)) } + + } + TagAnnotationFvRsIgmpsnFvBDList := make([]TagAnnotationFvRsIgmpsnFvBDResourceModel, 0) + TagTagFvRsIgmpsnFvBDList := make([]TagTagFvRsIgmpsnFvBDResourceModel, 0) + childrenOfFvRsIgmpsnFvBD, childrenOfFvRsIgmpsnFvBDExist := childClassDetails.(map[string]interface{})["children"] + if childrenOfFvRsIgmpsnFvBDExist { + for _, childFvRsIgmpsnFvBD := range childrenOfFvRsIgmpsnFvBD.([]interface{}) { + for childClassNameFvRsIgmpsnFvBD, childClassDetailsFvRsIgmpsnFvBD := range childFvRsIgmpsnFvBD.(map[string]interface{}) { + if childClassNameFvRsIgmpsnFvBD == "tagAnnotation" { + TagAnnotationFvRsIgmpsnFvBD := getEmptyTagAnnotationFvRsIgmpsnFvBDResourceModel() + tagAnnotationchildAttributeValue := childClassDetailsFvRsIgmpsnFvBD.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagAnnotationchildAttributeValue { + if childAttributeName == "key" { + TagAnnotationFvRsIgmpsnFvBD.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagAnnotationFvRsIgmpsnFvBD.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagAnnotationFvRsIgmpsnFvBDList = append(TagAnnotationFvRsIgmpsnFvBDList, TagAnnotationFvRsIgmpsnFvBD) + } + if childClassNameFvRsIgmpsnFvBD == "tagTag" { + TagTagFvRsIgmpsnFvBD := getEmptyTagTagFvRsIgmpsnFvBDResourceModel() + tagTagchildAttributeValue := childClassDetailsFvRsIgmpsnFvBD.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagTagchildAttributeValue { + if childAttributeName == "key" { + TagTagFvRsIgmpsnFvBD.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagTagFvRsIgmpsnFvBD.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagTagFvRsIgmpsnFvBDList = append(TagTagFvRsIgmpsnFvBDList, TagTagFvRsIgmpsnFvBD) + } + } + } } + TagAnnotationFvRsIgmpsnFvBDSet, _ := types.SetValueFrom(ctx, TagAnnotationFvRsIgmpsnFvBDType, TagAnnotationFvRsIgmpsnFvBDList) + FvRsIgmpsnFvBD.TagAnnotation = TagAnnotationFvRsIgmpsnFvBDSet + TagTagFvRsIgmpsnFvBDSet, _ := types.SetValueFrom(ctx, TagTagFvRsIgmpsnFvBDType, TagTagFvRsIgmpsnFvBDList) + FvRsIgmpsnFvBD.TagTag = TagTagFvRsIgmpsnFvBDSet FvRsIgmpsnFvBDList = append(FvRsIgmpsnFvBDList, FvRsIgmpsnFvBD) } if childClassName == "fvRsMldsn" { @@ -3427,7 +5646,47 @@ func getAndSetFvBDAttributes(ctx context.Context, diags *diag.Diagnostics, clien if childAttributeName == "tnMldSnoopPolName" { FvRsMldsnFvBD.TnMldSnoopPolName = basetypes.NewStringValue(childAttributeValue.(string)) } + + } + TagAnnotationFvRsMldsnFvBDList := make([]TagAnnotationFvRsMldsnFvBDResourceModel, 0) + TagTagFvRsMldsnFvBDList := make([]TagTagFvRsMldsnFvBDResourceModel, 0) + childrenOfFvRsMldsnFvBD, childrenOfFvRsMldsnFvBDExist := childClassDetails.(map[string]interface{})["children"] + if childrenOfFvRsMldsnFvBDExist { + for _, childFvRsMldsnFvBD := range childrenOfFvRsMldsnFvBD.([]interface{}) { + for childClassNameFvRsMldsnFvBD, childClassDetailsFvRsMldsnFvBD := range childFvRsMldsnFvBD.(map[string]interface{}) { + if childClassNameFvRsMldsnFvBD == "tagAnnotation" { + TagAnnotationFvRsMldsnFvBD := getEmptyTagAnnotationFvRsMldsnFvBDResourceModel() + tagAnnotationchildAttributeValue := childClassDetailsFvRsMldsnFvBD.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagAnnotationchildAttributeValue { + if childAttributeName == "key" { + TagAnnotationFvRsMldsnFvBD.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagAnnotationFvRsMldsnFvBD.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagAnnotationFvRsMldsnFvBDList = append(TagAnnotationFvRsMldsnFvBDList, TagAnnotationFvRsMldsnFvBD) + } + if childClassNameFvRsMldsnFvBD == "tagTag" { + TagTagFvRsMldsnFvBD := getEmptyTagTagFvRsMldsnFvBDResourceModel() + tagTagchildAttributeValue := childClassDetailsFvRsMldsnFvBD.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagTagchildAttributeValue { + if childAttributeName == "key" { + TagTagFvRsMldsnFvBD.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagTagFvRsMldsnFvBD.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagTagFvRsMldsnFvBDList = append(TagTagFvRsMldsnFvBDList, TagTagFvRsMldsnFvBD) + } + } + } } + TagAnnotationFvRsMldsnFvBDSet, _ := types.SetValueFrom(ctx, TagAnnotationFvRsMldsnFvBDType, TagAnnotationFvRsMldsnFvBDList) + FvRsMldsnFvBD.TagAnnotation = TagAnnotationFvRsMldsnFvBDSet + TagTagFvRsMldsnFvBDSet, _ := types.SetValueFrom(ctx, TagTagFvRsMldsnFvBDType, TagTagFvRsMldsnFvBDList) + FvRsMldsnFvBD.TagTag = TagTagFvRsMldsnFvBDSet FvRsMldsnFvBDList = append(FvRsMldsnFvBDList, FvRsMldsnFvBD) } if childClassName == "tagAnnotation" { @@ -3439,6 +5698,7 @@ func getAndSetFvBDAttributes(ctx context.Context, diags *diag.Diagnostics, clien if childAttributeName == "value" { TagAnnotationFvBD.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagAnnotationFvBDList = append(TagAnnotationFvBDList, TagAnnotationFvBD) } @@ -3451,6 +5711,7 @@ func getAndSetFvBDAttributes(ctx context.Context, diags *diag.Diagnostics, clien if childAttributeName == "value" { TagTagFvBD.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagTagFvBDList = append(TagTagFvBDList, TagTagFvBD) } @@ -3575,38 +5836,113 @@ func setFvBDId(ctx context.Context, data *FvBDResourceModel) { data.Id = types.StringValue(fmt.Sprintf("%s/%s", data.ParentDn.ValueString(), rn)) } -func getFvBDFvAccPChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvBDResourceModel, fvAccPPlan, fvAccPState FvAccPFvBDResourceModel) []map[string]interface{} { - +func getFvBDFvAccPChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvBDResourceModel, fvAccPFvBDPlan, fvAccPFvBDState FvAccPFvBDResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.FvAccP.IsUnknown() { - childMap := map[string]map[string]interface{}{"attributes": {}} + if !data.FvAccP.IsNull() && !data.FvAccP.IsUnknown() { + FvAccPFvBDChildren := make([]map[string]interface{}, 0) + childMap := NewAciObject() if !IsEmptySingleNestedAttribute(data.FvAccP.Attributes()) { - if !fvAccPPlan.Annotation.IsUnknown() && !fvAccPPlan.Annotation.IsNull() { - childMap["attributes"]["annotation"] = fvAccPPlan.Annotation.ValueString() + if !fvAccPFvBDPlan.Annotation.IsUnknown() && !fvAccPFvBDPlan.Annotation.IsNull() { + childMap.Attributes["annotation"] = fvAccPFvBDPlan.Annotation.ValueString() } else { - childMap["attributes"]["annotation"] = globalAnnotation + childMap.Attributes["annotation"] = globalAnnotation } - if !fvAccPPlan.Descr.IsUnknown() && !fvAccPPlan.Descr.IsNull() { - childMap["attributes"]["descr"] = fvAccPPlan.Descr.ValueString() + if !fvAccPFvBDPlan.Descr.IsUnknown() && !fvAccPFvBDPlan.Descr.IsNull() { + childMap.Attributes["descr"] = fvAccPFvBDPlan.Descr.ValueString() } - if !fvAccPPlan.Encap.IsUnknown() && !fvAccPPlan.Encap.IsNull() { - childMap["attributes"]["encap"] = fvAccPPlan.Encap.ValueString() + if !fvAccPFvBDPlan.Encap.IsUnknown() && !fvAccPFvBDPlan.Encap.IsNull() { + childMap.Attributes["encap"] = fvAccPFvBDPlan.Encap.ValueString() } - if !fvAccPPlan.Name.IsUnknown() && !fvAccPPlan.Name.IsNull() { - childMap["attributes"]["name"] = fvAccPPlan.Name.ValueString() + if !fvAccPFvBDPlan.Name.IsUnknown() && !fvAccPFvBDPlan.Name.IsNull() { + childMap.Attributes["name"] = fvAccPFvBDPlan.Name.ValueString() } - if !fvAccPPlan.NameAlias.IsUnknown() && !fvAccPPlan.NameAlias.IsNull() { - childMap["attributes"]["nameAlias"] = fvAccPPlan.NameAlias.ValueString() + if !fvAccPFvBDPlan.NameAlias.IsUnknown() && !fvAccPFvBDPlan.NameAlias.IsNull() { + childMap.Attributes["nameAlias"] = fvAccPFvBDPlan.NameAlias.ValueString() } - if !fvAccPPlan.OwnerKey.IsUnknown() && !fvAccPPlan.OwnerKey.IsNull() { - childMap["attributes"]["ownerKey"] = fvAccPPlan.OwnerKey.ValueString() + if !fvAccPFvBDPlan.OwnerKey.IsUnknown() && !fvAccPFvBDPlan.OwnerKey.IsNull() { + childMap.Attributes["ownerKey"] = fvAccPFvBDPlan.OwnerKey.ValueString() } - if !fvAccPPlan.OwnerTag.IsUnknown() && !fvAccPPlan.OwnerTag.IsNull() { - childMap["attributes"]["ownerTag"] = fvAccPPlan.OwnerTag.ValueString() + if !fvAccPFvBDPlan.OwnerTag.IsUnknown() && !fvAccPFvBDPlan.OwnerTag.IsNull() { + childMap.Attributes["ownerTag"] = fvAccPFvBDPlan.OwnerTag.ValueString() } } else { - childMap["attributes"]["status"] = "deleted" + childMap.Attributes["status"] = "deleted" + } + + var tagAnnotationFvAccPFvBDPlan, tagAnnotationFvAccPFvBDState []TagAnnotationFvAccPFvBDResourceModel + fvAccPFvBDPlan.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvAccPFvBDPlan, false) + if !fvAccPFvBDState.TagAnnotation.IsNull() { + fvAccPFvBDState.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvAccPFvBDState, false) + } + if !fvAccPFvBDPlan.TagAnnotation.IsNull() && !fvAccPFvBDPlan.TagAnnotation.IsUnknown() { + tagAnnotationIdentifiers := []TagAnnotationIdentifier{} + for _, tagAnnotationFvAccPFvBD := range tagAnnotationFvAccPFvBDPlan { + tagAnnotationFvAccPFvBDChildMap := NewAciObject() + if !tagAnnotationFvAccPFvBD.Key.IsNull() && !tagAnnotationFvAccPFvBD.Key.IsUnknown() { + tagAnnotationFvAccPFvBDChildMap.Attributes["key"] = tagAnnotationFvAccPFvBD.Key.ValueString() + } + if !tagAnnotationFvAccPFvBD.Value.IsNull() && !tagAnnotationFvAccPFvBD.Value.IsUnknown() { + tagAnnotationFvAccPFvBDChildMap.Attributes["value"] = tagAnnotationFvAccPFvBD.Value.ValueString() + } + FvAccPFvBDChildren = append(FvAccPFvBDChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvAccPFvBDChildMap}) + tagAnnotationIdentifier := TagAnnotationIdentifier{} + tagAnnotationIdentifier.Key = tagAnnotationFvAccPFvBD.Key + tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) + } + for _, tagAnnotationFvAccPFvBD := range tagAnnotationFvAccPFvBDState { + delete := true + for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { + if tagAnnotationIdentifier.Key == tagAnnotationFvAccPFvBD.Key { + delete = false + break + } + } + if delete { + tagAnnotationFvAccPFvBDChildMapForDelete := NewAciObject() + tagAnnotationFvAccPFvBDChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationFvAccPFvBDChildMapForDelete.Attributes["key"] = tagAnnotationFvAccPFvBD.Key.ValueString() + FvAccPFvBDChildren = append(FvAccPFvBDChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvAccPFvBDChildMapForDelete}) + } + } + } + + var tagTagFvAccPFvBDPlan, tagTagFvAccPFvBDState []TagTagFvAccPFvBDResourceModel + fvAccPFvBDPlan.TagTag.ElementsAs(ctx, &tagTagFvAccPFvBDPlan, false) + if !fvAccPFvBDState.TagTag.IsNull() { + fvAccPFvBDState.TagTag.ElementsAs(ctx, &tagTagFvAccPFvBDState, false) + } + if !fvAccPFvBDPlan.TagTag.IsNull() && !fvAccPFvBDPlan.TagTag.IsUnknown() { + tagTagIdentifiers := []TagTagIdentifier{} + for _, tagTagFvAccPFvBD := range tagTagFvAccPFvBDPlan { + tagTagFvAccPFvBDChildMap := NewAciObject() + if !tagTagFvAccPFvBD.Key.IsNull() && !tagTagFvAccPFvBD.Key.IsUnknown() { + tagTagFvAccPFvBDChildMap.Attributes["key"] = tagTagFvAccPFvBD.Key.ValueString() + } + if !tagTagFvAccPFvBD.Value.IsNull() && !tagTagFvAccPFvBD.Value.IsUnknown() { + tagTagFvAccPFvBDChildMap.Attributes["value"] = tagTagFvAccPFvBD.Value.ValueString() + } + FvAccPFvBDChildren = append(FvAccPFvBDChildren, map[string]interface{}{"tagTag": tagTagFvAccPFvBDChildMap}) + tagTagIdentifier := TagTagIdentifier{} + tagTagIdentifier.Key = tagTagFvAccPFvBD.Key + tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) + } + for _, tagTagFvAccPFvBD := range tagTagFvAccPFvBDState { + delete := true + for _, tagTagIdentifier := range tagTagIdentifiers { + if tagTagIdentifier.Key == tagTagFvAccPFvBD.Key { + delete = false + break + } + } + if delete { + tagTagFvAccPFvBDChildMapForDelete := NewAciObject() + tagTagFvAccPFvBDChildMapForDelete.Attributes["status"] = "deleted" + tagTagFvAccPFvBDChildMapForDelete.Attributes["key"] = tagTagFvAccPFvBD.Key.ValueString() + FvAccPFvBDChildren = append(FvAccPFvBDChildren, map[string]interface{}{"tagTag": tagTagFvAccPFvBDChildMapForDelete}) + } + } } + childMap.Children = FvAccPFvBDChildren childPayloads = append(childPayloads, map[string]interface{}{"fvAccP": childMap}) } else { FvAccPObject, _ := types.ObjectValueFrom(ctx, FvAccPFvBDType, getEmptyFvAccPFvBDResourceModel()) @@ -3615,36 +5951,112 @@ func getFvBDFvAccPChildPayloads(ctx context.Context, diags *diag.Diagnostics, da return childPayloads } -func getFvBDFvRogueExceptionMacChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvBDResourceModel, fvRogueExceptionMacPlan, fvRogueExceptionMacState []FvRogueExceptionMacFvBDResourceModel) []map[string]interface{} { +func getFvBDFvRogueExceptionMacChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvBDResourceModel, fvRogueExceptionMacFvBDPlan, fvRogueExceptionMacFvBDState []FvRogueExceptionMacFvBDResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.FvRogueExceptionMac.IsUnknown() { + if !data.FvRogueExceptionMac.IsNull() && !data.FvRogueExceptionMac.IsUnknown() { fvRogueExceptionMacIdentifiers := []FvRogueExceptionMacIdentifier{} - for _, fvRogueExceptionMac := range fvRogueExceptionMacPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !fvRogueExceptionMac.Annotation.IsUnknown() && !fvRogueExceptionMac.Annotation.IsNull() { - childMap["attributes"]["annotation"] = fvRogueExceptionMac.Annotation.ValueString() + for _, fvRogueExceptionMacFvBD := range fvRogueExceptionMacFvBDPlan { + FvRogueExceptionMacFvBDChildren := make([]map[string]interface{}, 0) + childMap := NewAciObject() + if !fvRogueExceptionMacFvBD.Annotation.IsNull() && !fvRogueExceptionMacFvBD.Annotation.IsUnknown() { + childMap.Attributes["annotation"] = fvRogueExceptionMacFvBD.Annotation.ValueString() } else { - childMap["attributes"]["annotation"] = globalAnnotation + childMap.Attributes["annotation"] = globalAnnotation + } + if !fvRogueExceptionMacFvBD.Descr.IsNull() && !fvRogueExceptionMacFvBD.Descr.IsUnknown() { + childMap.Attributes["descr"] = fvRogueExceptionMacFvBD.Descr.ValueString() + } + if !fvRogueExceptionMacFvBD.Mac.IsNull() && !fvRogueExceptionMacFvBD.Mac.IsUnknown() { + childMap.Attributes["mac"] = fvRogueExceptionMacFvBD.Mac.ValueString() } - if !fvRogueExceptionMac.Descr.IsUnknown() && !fvRogueExceptionMac.Descr.IsNull() { - childMap["attributes"]["descr"] = fvRogueExceptionMac.Descr.ValueString() + if !fvRogueExceptionMacFvBD.Name.IsNull() && !fvRogueExceptionMacFvBD.Name.IsUnknown() { + childMap.Attributes["name"] = fvRogueExceptionMacFvBD.Name.ValueString() } - if !fvRogueExceptionMac.Mac.IsUnknown() && !fvRogueExceptionMac.Mac.IsNull() { - childMap["attributes"]["mac"] = fvRogueExceptionMac.Mac.ValueString() + if !fvRogueExceptionMacFvBD.NameAlias.IsNull() && !fvRogueExceptionMacFvBD.NameAlias.IsUnknown() { + childMap.Attributes["nameAlias"] = fvRogueExceptionMacFvBD.NameAlias.ValueString() } - if !fvRogueExceptionMac.Name.IsUnknown() && !fvRogueExceptionMac.Name.IsNull() { - childMap["attributes"]["name"] = fvRogueExceptionMac.Name.ValueString() + + var tagAnnotationFvRogueExceptionMacFvBDPlan, tagAnnotationFvRogueExceptionMacFvBDState []TagAnnotationFvRogueExceptionMacFvBDResourceModel + fvRogueExceptionMacFvBD.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRogueExceptionMacFvBDPlan, false) + for _, tagAnnotationFvRogueExceptionMacFvBDstate := range fvRogueExceptionMacFvBDState { + tagAnnotationFvRogueExceptionMacFvBDstate.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRogueExceptionMacFvBDState, false) + } + if !fvRogueExceptionMacFvBD.TagAnnotation.IsNull() && !fvRogueExceptionMacFvBD.TagAnnotation.IsUnknown() { + tagAnnotationIdentifiers := []TagAnnotationIdentifier{} + for _, tagAnnotationFvRogueExceptionMacFvBD := range tagAnnotationFvRogueExceptionMacFvBDPlan { + tagAnnotationFvRogueExceptionMacFvBDChildMap := NewAciObject() + if !tagAnnotationFvRogueExceptionMacFvBD.Key.IsNull() && !tagAnnotationFvRogueExceptionMacFvBD.Key.IsUnknown() { + tagAnnotationFvRogueExceptionMacFvBDChildMap.Attributes["key"] = tagAnnotationFvRogueExceptionMacFvBD.Key.ValueString() + } + if !tagAnnotationFvRogueExceptionMacFvBD.Value.IsNull() && !tagAnnotationFvRogueExceptionMacFvBD.Value.IsUnknown() { + tagAnnotationFvRogueExceptionMacFvBDChildMap.Attributes["value"] = tagAnnotationFvRogueExceptionMacFvBD.Value.ValueString() + } + FvRogueExceptionMacFvBDChildren = append(FvRogueExceptionMacFvBDChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRogueExceptionMacFvBDChildMap}) + tagAnnotationIdentifier := TagAnnotationIdentifier{} + tagAnnotationIdentifier.Key = tagAnnotationFvRogueExceptionMacFvBD.Key + tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) + } + for _, tagAnnotationFvRogueExceptionMacFvBD := range tagAnnotationFvRogueExceptionMacFvBDState { + delete := true + for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { + if tagAnnotationIdentifier.Key == tagAnnotationFvRogueExceptionMacFvBD.Key { + delete = false + break + } + } + if delete { + tagAnnotationFvRogueExceptionMacFvBDChildMapForDelete := NewAciObject() + tagAnnotationFvRogueExceptionMacFvBDChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationFvRogueExceptionMacFvBDChildMapForDelete.Attributes["key"] = tagAnnotationFvRogueExceptionMacFvBD.Key.ValueString() + FvRogueExceptionMacFvBDChildren = append(FvRogueExceptionMacFvBDChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRogueExceptionMacFvBDChildMapForDelete}) + } + } + } + + var tagTagFvRogueExceptionMacFvBDPlan, tagTagFvRogueExceptionMacFvBDState []TagTagFvRogueExceptionMacFvBDResourceModel + fvRogueExceptionMacFvBD.TagTag.ElementsAs(ctx, &tagTagFvRogueExceptionMacFvBDPlan, false) + for _, tagTagFvRogueExceptionMacFvBDstate := range fvRogueExceptionMacFvBDState { + tagTagFvRogueExceptionMacFvBDstate.TagTag.ElementsAs(ctx, &tagTagFvRogueExceptionMacFvBDState, false) } - if !fvRogueExceptionMac.NameAlias.IsUnknown() && !fvRogueExceptionMac.NameAlias.IsNull() { - childMap["attributes"]["nameAlias"] = fvRogueExceptionMac.NameAlias.ValueString() + if !fvRogueExceptionMacFvBD.TagTag.IsNull() && !fvRogueExceptionMacFvBD.TagTag.IsUnknown() { + tagTagIdentifiers := []TagTagIdentifier{} + for _, tagTagFvRogueExceptionMacFvBD := range tagTagFvRogueExceptionMacFvBDPlan { + tagTagFvRogueExceptionMacFvBDChildMap := NewAciObject() + if !tagTagFvRogueExceptionMacFvBD.Key.IsNull() && !tagTagFvRogueExceptionMacFvBD.Key.IsUnknown() { + tagTagFvRogueExceptionMacFvBDChildMap.Attributes["key"] = tagTagFvRogueExceptionMacFvBD.Key.ValueString() + } + if !tagTagFvRogueExceptionMacFvBD.Value.IsNull() && !tagTagFvRogueExceptionMacFvBD.Value.IsUnknown() { + tagTagFvRogueExceptionMacFvBDChildMap.Attributes["value"] = tagTagFvRogueExceptionMacFvBD.Value.ValueString() + } + FvRogueExceptionMacFvBDChildren = append(FvRogueExceptionMacFvBDChildren, map[string]interface{}{"tagTag": tagTagFvRogueExceptionMacFvBDChildMap}) + tagTagIdentifier := TagTagIdentifier{} + tagTagIdentifier.Key = tagTagFvRogueExceptionMacFvBD.Key + tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) + } + for _, tagTagFvRogueExceptionMacFvBD := range tagTagFvRogueExceptionMacFvBDState { + delete := true + for _, tagTagIdentifier := range tagTagIdentifiers { + if tagTagIdentifier.Key == tagTagFvRogueExceptionMacFvBD.Key { + delete = false + break + } + } + if delete { + tagTagFvRogueExceptionMacFvBDChildMapForDelete := NewAciObject() + tagTagFvRogueExceptionMacFvBDChildMapForDelete.Attributes["status"] = "deleted" + tagTagFvRogueExceptionMacFvBDChildMapForDelete.Attributes["key"] = tagTagFvRogueExceptionMacFvBD.Key.ValueString() + FvRogueExceptionMacFvBDChildren = append(FvRogueExceptionMacFvBDChildren, map[string]interface{}{"tagTag": tagTagFvRogueExceptionMacFvBDChildMapForDelete}) + } + } } + childMap.Children = FvRogueExceptionMacFvBDChildren childPayloads = append(childPayloads, map[string]interface{}{"fvRogueExceptionMac": childMap}) fvRogueExceptionMacIdentifier := FvRogueExceptionMacIdentifier{} - fvRogueExceptionMacIdentifier.Mac = fvRogueExceptionMac.Mac + fvRogueExceptionMacIdentifier.Mac = fvRogueExceptionMacFvBD.Mac fvRogueExceptionMacIdentifiers = append(fvRogueExceptionMacIdentifiers, fvRogueExceptionMacIdentifier) } - for _, fvRogueExceptionMac := range fvRogueExceptionMacState { + for _, fvRogueExceptionMac := range fvRogueExceptionMacFvBDState { delete := true for _, fvRogueExceptionMacIdentifier := range fvRogueExceptionMacIdentifiers { if fvRogueExceptionMacIdentifier.Mac == fvRogueExceptionMac.Mac { @@ -3653,10 +6065,10 @@ func getFvBDFvRogueExceptionMacChildPayloads(ctx context.Context, diags *diag.Di } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["mac"] = fvRogueExceptionMac.Mac.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"fvRogueExceptionMac": childMap}) + fvRogueExceptionMacChildMapForDelete := NewAciObject() + fvRogueExceptionMacChildMapForDelete.Attributes["status"] = "deleted" + fvRogueExceptionMacChildMapForDelete.Attributes["mac"] = fvRogueExceptionMac.Mac.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"fvRogueExceptionMac": fvRogueExceptionMacChildMapForDelete}) } } } else { @@ -3665,23 +6077,99 @@ func getFvBDFvRogueExceptionMacChildPayloads(ctx context.Context, diags *diag.Di return childPayloads } -func getFvBDFvRsABDPolMonPolChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvBDResourceModel, fvRsABDPolMonPolPlan, fvRsABDPolMonPolState FvRsABDPolMonPolFvBDResourceModel) []map[string]interface{} { +func getFvBDFvRsABDPolMonPolChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvBDResourceModel, fvRsABDPolMonPolFvBDPlan, fvRsABDPolMonPolFvBDState FvRsABDPolMonPolFvBDResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.FvRsABDPolMonPol.IsUnknown() { - childMap := map[string]map[string]interface{}{"attributes": {}} + if !data.FvRsABDPolMonPol.IsNull() && !data.FvRsABDPolMonPol.IsUnknown() { + FvRsABDPolMonPolFvBDChildren := make([]map[string]interface{}, 0) + childMap := NewAciObject() if !IsEmptySingleNestedAttribute(data.FvRsABDPolMonPol.Attributes()) { - if !fvRsABDPolMonPolPlan.Annotation.IsUnknown() && !fvRsABDPolMonPolPlan.Annotation.IsNull() { - childMap["attributes"]["annotation"] = fvRsABDPolMonPolPlan.Annotation.ValueString() + if !fvRsABDPolMonPolFvBDPlan.Annotation.IsUnknown() && !fvRsABDPolMonPolFvBDPlan.Annotation.IsNull() { + childMap.Attributes["annotation"] = fvRsABDPolMonPolFvBDPlan.Annotation.ValueString() } else { - childMap["attributes"]["annotation"] = globalAnnotation + childMap.Attributes["annotation"] = globalAnnotation } - if !fvRsABDPolMonPolPlan.TnMonEPGPolName.IsUnknown() && !fvRsABDPolMonPolPlan.TnMonEPGPolName.IsNull() { - childMap["attributes"]["tnMonEPGPolName"] = fvRsABDPolMonPolPlan.TnMonEPGPolName.ValueString() + if !fvRsABDPolMonPolFvBDPlan.TnMonEPGPolName.IsUnknown() && !fvRsABDPolMonPolFvBDPlan.TnMonEPGPolName.IsNull() { + childMap.Attributes["tnMonEPGPolName"] = fvRsABDPolMonPolFvBDPlan.TnMonEPGPolName.ValueString() } } else { - childMap["attributes"]["status"] = "deleted" + childMap.Attributes["status"] = "deleted" + } + + var tagAnnotationFvRsABDPolMonPolFvBDPlan, tagAnnotationFvRsABDPolMonPolFvBDState []TagAnnotationFvRsABDPolMonPolFvBDResourceModel + fvRsABDPolMonPolFvBDPlan.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsABDPolMonPolFvBDPlan, false) + if !fvRsABDPolMonPolFvBDState.TagAnnotation.IsNull() { + fvRsABDPolMonPolFvBDState.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsABDPolMonPolFvBDState, false) + } + if !fvRsABDPolMonPolFvBDPlan.TagAnnotation.IsNull() && !fvRsABDPolMonPolFvBDPlan.TagAnnotation.IsUnknown() { + tagAnnotationIdentifiers := []TagAnnotationIdentifier{} + for _, tagAnnotationFvRsABDPolMonPolFvBD := range tagAnnotationFvRsABDPolMonPolFvBDPlan { + tagAnnotationFvRsABDPolMonPolFvBDChildMap := NewAciObject() + if !tagAnnotationFvRsABDPolMonPolFvBD.Key.IsNull() && !tagAnnotationFvRsABDPolMonPolFvBD.Key.IsUnknown() { + tagAnnotationFvRsABDPolMonPolFvBDChildMap.Attributes["key"] = tagAnnotationFvRsABDPolMonPolFvBD.Key.ValueString() + } + if !tagAnnotationFvRsABDPolMonPolFvBD.Value.IsNull() && !tagAnnotationFvRsABDPolMonPolFvBD.Value.IsUnknown() { + tagAnnotationFvRsABDPolMonPolFvBDChildMap.Attributes["value"] = tagAnnotationFvRsABDPolMonPolFvBD.Value.ValueString() + } + FvRsABDPolMonPolFvBDChildren = append(FvRsABDPolMonPolFvBDChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsABDPolMonPolFvBDChildMap}) + tagAnnotationIdentifier := TagAnnotationIdentifier{} + tagAnnotationIdentifier.Key = tagAnnotationFvRsABDPolMonPolFvBD.Key + tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) + } + for _, tagAnnotationFvRsABDPolMonPolFvBD := range tagAnnotationFvRsABDPolMonPolFvBDState { + delete := true + for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { + if tagAnnotationIdentifier.Key == tagAnnotationFvRsABDPolMonPolFvBD.Key { + delete = false + break + } + } + if delete { + tagAnnotationFvRsABDPolMonPolFvBDChildMapForDelete := NewAciObject() + tagAnnotationFvRsABDPolMonPolFvBDChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationFvRsABDPolMonPolFvBDChildMapForDelete.Attributes["key"] = tagAnnotationFvRsABDPolMonPolFvBD.Key.ValueString() + FvRsABDPolMonPolFvBDChildren = append(FvRsABDPolMonPolFvBDChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsABDPolMonPolFvBDChildMapForDelete}) + } + } + } + + var tagTagFvRsABDPolMonPolFvBDPlan, tagTagFvRsABDPolMonPolFvBDState []TagTagFvRsABDPolMonPolFvBDResourceModel + fvRsABDPolMonPolFvBDPlan.TagTag.ElementsAs(ctx, &tagTagFvRsABDPolMonPolFvBDPlan, false) + if !fvRsABDPolMonPolFvBDState.TagTag.IsNull() { + fvRsABDPolMonPolFvBDState.TagTag.ElementsAs(ctx, &tagTagFvRsABDPolMonPolFvBDState, false) + } + if !fvRsABDPolMonPolFvBDPlan.TagTag.IsNull() && !fvRsABDPolMonPolFvBDPlan.TagTag.IsUnknown() { + tagTagIdentifiers := []TagTagIdentifier{} + for _, tagTagFvRsABDPolMonPolFvBD := range tagTagFvRsABDPolMonPolFvBDPlan { + tagTagFvRsABDPolMonPolFvBDChildMap := NewAciObject() + if !tagTagFvRsABDPolMonPolFvBD.Key.IsNull() && !tagTagFvRsABDPolMonPolFvBD.Key.IsUnknown() { + tagTagFvRsABDPolMonPolFvBDChildMap.Attributes["key"] = tagTagFvRsABDPolMonPolFvBD.Key.ValueString() + } + if !tagTagFvRsABDPolMonPolFvBD.Value.IsNull() && !tagTagFvRsABDPolMonPolFvBD.Value.IsUnknown() { + tagTagFvRsABDPolMonPolFvBDChildMap.Attributes["value"] = tagTagFvRsABDPolMonPolFvBD.Value.ValueString() + } + FvRsABDPolMonPolFvBDChildren = append(FvRsABDPolMonPolFvBDChildren, map[string]interface{}{"tagTag": tagTagFvRsABDPolMonPolFvBDChildMap}) + tagTagIdentifier := TagTagIdentifier{} + tagTagIdentifier.Key = tagTagFvRsABDPolMonPolFvBD.Key + tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) + } + for _, tagTagFvRsABDPolMonPolFvBD := range tagTagFvRsABDPolMonPolFvBDState { + delete := true + for _, tagTagIdentifier := range tagTagIdentifiers { + if tagTagIdentifier.Key == tagTagFvRsABDPolMonPolFvBD.Key { + delete = false + break + } + } + if delete { + tagTagFvRsABDPolMonPolFvBDChildMapForDelete := NewAciObject() + tagTagFvRsABDPolMonPolFvBDChildMapForDelete.Attributes["status"] = "deleted" + tagTagFvRsABDPolMonPolFvBDChildMapForDelete.Attributes["key"] = tagTagFvRsABDPolMonPolFvBD.Key.ValueString() + FvRsABDPolMonPolFvBDChildren = append(FvRsABDPolMonPolFvBDChildren, map[string]interface{}{"tagTag": tagTagFvRsABDPolMonPolFvBDChildMapForDelete}) + } + } } + childMap.Children = FvRsABDPolMonPolFvBDChildren childPayloads = append(childPayloads, map[string]interface{}{"fvRsABDPolMonPol": childMap}) } else { FvRsABDPolMonPolObject, _ := types.ObjectValueFrom(ctx, FvRsABDPolMonPolFvBDType, getEmptyFvRsABDPolMonPolFvBDResourceModel()) @@ -3690,23 +6178,99 @@ func getFvBDFvRsABDPolMonPolChildPayloads(ctx context.Context, diags *diag.Diagn return childPayloads } -func getFvBDFvRsBDToFhsChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvBDResourceModel, fvRsBDToFhsPlan, fvRsBDToFhsState FvRsBDToFhsFvBDResourceModel) []map[string]interface{} { +func getFvBDFvRsBDToFhsChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvBDResourceModel, fvRsBDToFhsFvBDPlan, fvRsBDToFhsFvBDState FvRsBDToFhsFvBDResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.FvRsBDToFhs.IsUnknown() { - childMap := map[string]map[string]interface{}{"attributes": {}} + if !data.FvRsBDToFhs.IsNull() && !data.FvRsBDToFhs.IsUnknown() { + FvRsBDToFhsFvBDChildren := make([]map[string]interface{}, 0) + childMap := NewAciObject() if !IsEmptySingleNestedAttribute(data.FvRsBDToFhs.Attributes()) { - if !fvRsBDToFhsPlan.Annotation.IsUnknown() && !fvRsBDToFhsPlan.Annotation.IsNull() { - childMap["attributes"]["annotation"] = fvRsBDToFhsPlan.Annotation.ValueString() + if !fvRsBDToFhsFvBDPlan.Annotation.IsUnknown() && !fvRsBDToFhsFvBDPlan.Annotation.IsNull() { + childMap.Attributes["annotation"] = fvRsBDToFhsFvBDPlan.Annotation.ValueString() } else { - childMap["attributes"]["annotation"] = globalAnnotation + childMap.Attributes["annotation"] = globalAnnotation } - if !fvRsBDToFhsPlan.TnFhsBDPolName.IsUnknown() && !fvRsBDToFhsPlan.TnFhsBDPolName.IsNull() { - childMap["attributes"]["tnFhsBDPolName"] = fvRsBDToFhsPlan.TnFhsBDPolName.ValueString() + if !fvRsBDToFhsFvBDPlan.TnFhsBDPolName.IsUnknown() && !fvRsBDToFhsFvBDPlan.TnFhsBDPolName.IsNull() { + childMap.Attributes["tnFhsBDPolName"] = fvRsBDToFhsFvBDPlan.TnFhsBDPolName.ValueString() } } else { - childMap["attributes"]["status"] = "deleted" + childMap.Attributes["status"] = "deleted" + } + + var tagAnnotationFvRsBDToFhsFvBDPlan, tagAnnotationFvRsBDToFhsFvBDState []TagAnnotationFvRsBDToFhsFvBDResourceModel + fvRsBDToFhsFvBDPlan.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsBDToFhsFvBDPlan, false) + if !fvRsBDToFhsFvBDState.TagAnnotation.IsNull() { + fvRsBDToFhsFvBDState.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsBDToFhsFvBDState, false) + } + if !fvRsBDToFhsFvBDPlan.TagAnnotation.IsNull() && !fvRsBDToFhsFvBDPlan.TagAnnotation.IsUnknown() { + tagAnnotationIdentifiers := []TagAnnotationIdentifier{} + for _, tagAnnotationFvRsBDToFhsFvBD := range tagAnnotationFvRsBDToFhsFvBDPlan { + tagAnnotationFvRsBDToFhsFvBDChildMap := NewAciObject() + if !tagAnnotationFvRsBDToFhsFvBD.Key.IsNull() && !tagAnnotationFvRsBDToFhsFvBD.Key.IsUnknown() { + tagAnnotationFvRsBDToFhsFvBDChildMap.Attributes["key"] = tagAnnotationFvRsBDToFhsFvBD.Key.ValueString() + } + if !tagAnnotationFvRsBDToFhsFvBD.Value.IsNull() && !tagAnnotationFvRsBDToFhsFvBD.Value.IsUnknown() { + tagAnnotationFvRsBDToFhsFvBDChildMap.Attributes["value"] = tagAnnotationFvRsBDToFhsFvBD.Value.ValueString() + } + FvRsBDToFhsFvBDChildren = append(FvRsBDToFhsFvBDChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsBDToFhsFvBDChildMap}) + tagAnnotationIdentifier := TagAnnotationIdentifier{} + tagAnnotationIdentifier.Key = tagAnnotationFvRsBDToFhsFvBD.Key + tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) + } + for _, tagAnnotationFvRsBDToFhsFvBD := range tagAnnotationFvRsBDToFhsFvBDState { + delete := true + for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { + if tagAnnotationIdentifier.Key == tagAnnotationFvRsBDToFhsFvBD.Key { + delete = false + break + } + } + if delete { + tagAnnotationFvRsBDToFhsFvBDChildMapForDelete := NewAciObject() + tagAnnotationFvRsBDToFhsFvBDChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationFvRsBDToFhsFvBDChildMapForDelete.Attributes["key"] = tagAnnotationFvRsBDToFhsFvBD.Key.ValueString() + FvRsBDToFhsFvBDChildren = append(FvRsBDToFhsFvBDChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsBDToFhsFvBDChildMapForDelete}) + } + } + } + + var tagTagFvRsBDToFhsFvBDPlan, tagTagFvRsBDToFhsFvBDState []TagTagFvRsBDToFhsFvBDResourceModel + fvRsBDToFhsFvBDPlan.TagTag.ElementsAs(ctx, &tagTagFvRsBDToFhsFvBDPlan, false) + if !fvRsBDToFhsFvBDState.TagTag.IsNull() { + fvRsBDToFhsFvBDState.TagTag.ElementsAs(ctx, &tagTagFvRsBDToFhsFvBDState, false) + } + if !fvRsBDToFhsFvBDPlan.TagTag.IsNull() && !fvRsBDToFhsFvBDPlan.TagTag.IsUnknown() { + tagTagIdentifiers := []TagTagIdentifier{} + for _, tagTagFvRsBDToFhsFvBD := range tagTagFvRsBDToFhsFvBDPlan { + tagTagFvRsBDToFhsFvBDChildMap := NewAciObject() + if !tagTagFvRsBDToFhsFvBD.Key.IsNull() && !tagTagFvRsBDToFhsFvBD.Key.IsUnknown() { + tagTagFvRsBDToFhsFvBDChildMap.Attributes["key"] = tagTagFvRsBDToFhsFvBD.Key.ValueString() + } + if !tagTagFvRsBDToFhsFvBD.Value.IsNull() && !tagTagFvRsBDToFhsFvBD.Value.IsUnknown() { + tagTagFvRsBDToFhsFvBDChildMap.Attributes["value"] = tagTagFvRsBDToFhsFvBD.Value.ValueString() + } + FvRsBDToFhsFvBDChildren = append(FvRsBDToFhsFvBDChildren, map[string]interface{}{"tagTag": tagTagFvRsBDToFhsFvBDChildMap}) + tagTagIdentifier := TagTagIdentifier{} + tagTagIdentifier.Key = tagTagFvRsBDToFhsFvBD.Key + tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) + } + for _, tagTagFvRsBDToFhsFvBD := range tagTagFvRsBDToFhsFvBDState { + delete := true + for _, tagTagIdentifier := range tagTagIdentifiers { + if tagTagIdentifier.Key == tagTagFvRsBDToFhsFvBD.Key { + delete = false + break + } + } + if delete { + tagTagFvRsBDToFhsFvBDChildMapForDelete := NewAciObject() + tagTagFvRsBDToFhsFvBDChildMapForDelete.Attributes["status"] = "deleted" + tagTagFvRsBDToFhsFvBDChildMapForDelete.Attributes["key"] = tagTagFvRsBDToFhsFvBD.Key.ValueString() + FvRsBDToFhsFvBDChildren = append(FvRsBDToFhsFvBDChildren, map[string]interface{}{"tagTag": tagTagFvRsBDToFhsFvBDChildMapForDelete}) + } + } } + childMap.Children = FvRsBDToFhsFvBDChildren childPayloads = append(childPayloads, map[string]interface{}{"fvRsBDToFhs": childMap}) } else { FvRsBDToFhsObject, _ := types.ObjectValueFrom(ctx, FvRsBDToFhsFvBDType, getEmptyFvRsBDToFhsFvBDResourceModel()) @@ -3715,21 +6279,97 @@ func getFvBDFvRsBDToFhsChildPayloads(ctx context.Context, diags *diag.Diagnostic return childPayloads } -func getFvBDFvRsBDToNdPChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvBDResourceModel, fvRsBDToNdPPlan, fvRsBDToNdPState FvRsBDToNdPFvBDResourceModel) []map[string]interface{} { +func getFvBDFvRsBDToNdPChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvBDResourceModel, fvRsBDToNdPFvBDPlan, fvRsBDToNdPFvBDState FvRsBDToNdPFvBDResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.FvRsBDToNdP.IsUnknown() { - childMap := map[string]map[string]interface{}{"attributes": {}} + if !data.FvRsBDToNdP.IsNull() && !data.FvRsBDToNdP.IsUnknown() { + FvRsBDToNdPFvBDChildren := make([]map[string]interface{}, 0) + childMap := NewAciObject() if !IsEmptySingleNestedAttribute(data.FvRsBDToNdP.Attributes()) { - if !fvRsBDToNdPPlan.Annotation.IsUnknown() && !fvRsBDToNdPPlan.Annotation.IsNull() { - childMap["attributes"]["annotation"] = fvRsBDToNdPPlan.Annotation.ValueString() + if !fvRsBDToNdPFvBDPlan.Annotation.IsUnknown() && !fvRsBDToNdPFvBDPlan.Annotation.IsNull() { + childMap.Attributes["annotation"] = fvRsBDToNdPFvBDPlan.Annotation.ValueString() } else { - childMap["attributes"]["annotation"] = globalAnnotation + childMap.Attributes["annotation"] = globalAnnotation + } + if !fvRsBDToNdPFvBDPlan.TnNdIfPolName.IsUnknown() && !fvRsBDToNdPFvBDPlan.TnNdIfPolName.IsNull() { + childMap.Attributes["tnNdIfPolName"] = fvRsBDToNdPFvBDPlan.TnNdIfPolName.ValueString() + } + } + + var tagAnnotationFvRsBDToNdPFvBDPlan, tagAnnotationFvRsBDToNdPFvBDState []TagAnnotationFvRsBDToNdPFvBDResourceModel + fvRsBDToNdPFvBDPlan.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsBDToNdPFvBDPlan, false) + if !fvRsBDToNdPFvBDState.TagAnnotation.IsNull() { + fvRsBDToNdPFvBDState.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsBDToNdPFvBDState, false) + } + if !fvRsBDToNdPFvBDPlan.TagAnnotation.IsNull() && !fvRsBDToNdPFvBDPlan.TagAnnotation.IsUnknown() { + tagAnnotationIdentifiers := []TagAnnotationIdentifier{} + for _, tagAnnotationFvRsBDToNdPFvBD := range tagAnnotationFvRsBDToNdPFvBDPlan { + tagAnnotationFvRsBDToNdPFvBDChildMap := NewAciObject() + if !tagAnnotationFvRsBDToNdPFvBD.Key.IsNull() && !tagAnnotationFvRsBDToNdPFvBD.Key.IsUnknown() { + tagAnnotationFvRsBDToNdPFvBDChildMap.Attributes["key"] = tagAnnotationFvRsBDToNdPFvBD.Key.ValueString() + } + if !tagAnnotationFvRsBDToNdPFvBD.Value.IsNull() && !tagAnnotationFvRsBDToNdPFvBD.Value.IsUnknown() { + tagAnnotationFvRsBDToNdPFvBDChildMap.Attributes["value"] = tagAnnotationFvRsBDToNdPFvBD.Value.ValueString() + } + FvRsBDToNdPFvBDChildren = append(FvRsBDToNdPFvBDChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsBDToNdPFvBDChildMap}) + tagAnnotationIdentifier := TagAnnotationIdentifier{} + tagAnnotationIdentifier.Key = tagAnnotationFvRsBDToNdPFvBD.Key + tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) + } + for _, tagAnnotationFvRsBDToNdPFvBD := range tagAnnotationFvRsBDToNdPFvBDState { + delete := true + for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { + if tagAnnotationIdentifier.Key == tagAnnotationFvRsBDToNdPFvBD.Key { + delete = false + break + } + } + if delete { + tagAnnotationFvRsBDToNdPFvBDChildMapForDelete := NewAciObject() + tagAnnotationFvRsBDToNdPFvBDChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationFvRsBDToNdPFvBDChildMapForDelete.Attributes["key"] = tagAnnotationFvRsBDToNdPFvBD.Key.ValueString() + FvRsBDToNdPFvBDChildren = append(FvRsBDToNdPFvBDChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsBDToNdPFvBDChildMapForDelete}) + } + } + } + + var tagTagFvRsBDToNdPFvBDPlan, tagTagFvRsBDToNdPFvBDState []TagTagFvRsBDToNdPFvBDResourceModel + fvRsBDToNdPFvBDPlan.TagTag.ElementsAs(ctx, &tagTagFvRsBDToNdPFvBDPlan, false) + if !fvRsBDToNdPFvBDState.TagTag.IsNull() { + fvRsBDToNdPFvBDState.TagTag.ElementsAs(ctx, &tagTagFvRsBDToNdPFvBDState, false) + } + if !fvRsBDToNdPFvBDPlan.TagTag.IsNull() && !fvRsBDToNdPFvBDPlan.TagTag.IsUnknown() { + tagTagIdentifiers := []TagTagIdentifier{} + for _, tagTagFvRsBDToNdPFvBD := range tagTagFvRsBDToNdPFvBDPlan { + tagTagFvRsBDToNdPFvBDChildMap := NewAciObject() + if !tagTagFvRsBDToNdPFvBD.Key.IsNull() && !tagTagFvRsBDToNdPFvBD.Key.IsUnknown() { + tagTagFvRsBDToNdPFvBDChildMap.Attributes["key"] = tagTagFvRsBDToNdPFvBD.Key.ValueString() + } + if !tagTagFvRsBDToNdPFvBD.Value.IsNull() && !tagTagFvRsBDToNdPFvBD.Value.IsUnknown() { + tagTagFvRsBDToNdPFvBDChildMap.Attributes["value"] = tagTagFvRsBDToNdPFvBD.Value.ValueString() + } + FvRsBDToNdPFvBDChildren = append(FvRsBDToNdPFvBDChildren, map[string]interface{}{"tagTag": tagTagFvRsBDToNdPFvBDChildMap}) + tagTagIdentifier := TagTagIdentifier{} + tagTagIdentifier.Key = tagTagFvRsBDToNdPFvBD.Key + tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) } - if !fvRsBDToNdPPlan.TnNdIfPolName.IsUnknown() && !fvRsBDToNdPPlan.TnNdIfPolName.IsNull() { - childMap["attributes"]["tnNdIfPolName"] = fvRsBDToNdPPlan.TnNdIfPolName.ValueString() + for _, tagTagFvRsBDToNdPFvBD := range tagTagFvRsBDToNdPFvBDState { + delete := true + for _, tagTagIdentifier := range tagTagIdentifiers { + if tagTagIdentifier.Key == tagTagFvRsBDToNdPFvBD.Key { + delete = false + break + } + } + if delete { + tagTagFvRsBDToNdPFvBDChildMapForDelete := NewAciObject() + tagTagFvRsBDToNdPFvBDChildMapForDelete.Attributes["status"] = "deleted" + tagTagFvRsBDToNdPFvBDChildMapForDelete.Attributes["key"] = tagTagFvRsBDToNdPFvBD.Key.ValueString() + FvRsBDToNdPFvBDChildren = append(FvRsBDToNdPFvBDChildren, map[string]interface{}{"tagTag": tagTagFvRsBDToNdPFvBDChildMapForDelete}) + } } } + childMap.Children = FvRsBDToNdPFvBDChildren childPayloads = append(childPayloads, map[string]interface{}{"fvRsBDToNdP": childMap}) } else { FvRsBDToNdPObject, _ := types.ObjectValueFrom(ctx, FvRsBDToNdPFvBDType, getEmptyFvRsBDToNdPFvBDResourceModel()) @@ -3738,31 +6378,107 @@ func getFvBDFvRsBDToNdPChildPayloads(ctx context.Context, diags *diag.Diagnostic return childPayloads } -func getFvBDFvRsBDToNetflowMonitorPolChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvBDResourceModel, fvRsBDToNetflowMonitorPolPlan, fvRsBDToNetflowMonitorPolState []FvRsBDToNetflowMonitorPolFvBDResourceModel) []map[string]interface{} { +func getFvBDFvRsBDToNetflowMonitorPolChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvBDResourceModel, fvRsBDToNetflowMonitorPolFvBDPlan, fvRsBDToNetflowMonitorPolFvBDState []FvRsBDToNetflowMonitorPolFvBDResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.FvRsBDToNetflowMonitorPol.IsUnknown() { + if !data.FvRsBDToNetflowMonitorPol.IsNull() && !data.FvRsBDToNetflowMonitorPol.IsUnknown() { fvRsBDToNetflowMonitorPolIdentifiers := []FvRsBDToNetflowMonitorPolIdentifier{} - for _, fvRsBDToNetflowMonitorPol := range fvRsBDToNetflowMonitorPolPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !fvRsBDToNetflowMonitorPol.Annotation.IsUnknown() && !fvRsBDToNetflowMonitorPol.Annotation.IsNull() { - childMap["attributes"]["annotation"] = fvRsBDToNetflowMonitorPol.Annotation.ValueString() + for _, fvRsBDToNetflowMonitorPolFvBD := range fvRsBDToNetflowMonitorPolFvBDPlan { + FvRsBDToNetflowMonitorPolFvBDChildren := make([]map[string]interface{}, 0) + childMap := NewAciObject() + if !fvRsBDToNetflowMonitorPolFvBD.Annotation.IsNull() && !fvRsBDToNetflowMonitorPolFvBD.Annotation.IsUnknown() { + childMap.Attributes["annotation"] = fvRsBDToNetflowMonitorPolFvBD.Annotation.ValueString() } else { - childMap["attributes"]["annotation"] = globalAnnotation + childMap.Attributes["annotation"] = globalAnnotation + } + if !fvRsBDToNetflowMonitorPolFvBD.FltType.IsNull() && !fvRsBDToNetflowMonitorPolFvBD.FltType.IsUnknown() { + childMap.Attributes["fltType"] = fvRsBDToNetflowMonitorPolFvBD.FltType.ValueString() + } + if !fvRsBDToNetflowMonitorPolFvBD.TnNetflowMonitorPolName.IsNull() && !fvRsBDToNetflowMonitorPolFvBD.TnNetflowMonitorPolName.IsUnknown() { + childMap.Attributes["tnNetflowMonitorPolName"] = fvRsBDToNetflowMonitorPolFvBD.TnNetflowMonitorPolName.ValueString() + } + + var tagAnnotationFvRsBDToNetflowMonitorPolFvBDPlan, tagAnnotationFvRsBDToNetflowMonitorPolFvBDState []TagAnnotationFvRsBDToNetflowMonitorPolFvBDResourceModel + fvRsBDToNetflowMonitorPolFvBD.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsBDToNetflowMonitorPolFvBDPlan, false) + for _, tagAnnotationFvRsBDToNetflowMonitorPolFvBDstate := range fvRsBDToNetflowMonitorPolFvBDState { + tagAnnotationFvRsBDToNetflowMonitorPolFvBDstate.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsBDToNetflowMonitorPolFvBDState, false) + } + if !fvRsBDToNetflowMonitorPolFvBD.TagAnnotation.IsNull() && !fvRsBDToNetflowMonitorPolFvBD.TagAnnotation.IsUnknown() { + tagAnnotationIdentifiers := []TagAnnotationIdentifier{} + for _, tagAnnotationFvRsBDToNetflowMonitorPolFvBD := range tagAnnotationFvRsBDToNetflowMonitorPolFvBDPlan { + tagAnnotationFvRsBDToNetflowMonitorPolFvBDChildMap := NewAciObject() + if !tagAnnotationFvRsBDToNetflowMonitorPolFvBD.Key.IsNull() && !tagAnnotationFvRsBDToNetflowMonitorPolFvBD.Key.IsUnknown() { + tagAnnotationFvRsBDToNetflowMonitorPolFvBDChildMap.Attributes["key"] = tagAnnotationFvRsBDToNetflowMonitorPolFvBD.Key.ValueString() + } + if !tagAnnotationFvRsBDToNetflowMonitorPolFvBD.Value.IsNull() && !tagAnnotationFvRsBDToNetflowMonitorPolFvBD.Value.IsUnknown() { + tagAnnotationFvRsBDToNetflowMonitorPolFvBDChildMap.Attributes["value"] = tagAnnotationFvRsBDToNetflowMonitorPolFvBD.Value.ValueString() + } + FvRsBDToNetflowMonitorPolFvBDChildren = append(FvRsBDToNetflowMonitorPolFvBDChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsBDToNetflowMonitorPolFvBDChildMap}) + tagAnnotationIdentifier := TagAnnotationIdentifier{} + tagAnnotationIdentifier.Key = tagAnnotationFvRsBDToNetflowMonitorPolFvBD.Key + tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) + } + for _, tagAnnotationFvRsBDToNetflowMonitorPolFvBD := range tagAnnotationFvRsBDToNetflowMonitorPolFvBDState { + delete := true + for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { + if tagAnnotationIdentifier.Key == tagAnnotationFvRsBDToNetflowMonitorPolFvBD.Key { + delete = false + break + } + } + if delete { + tagAnnotationFvRsBDToNetflowMonitorPolFvBDChildMapForDelete := NewAciObject() + tagAnnotationFvRsBDToNetflowMonitorPolFvBDChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationFvRsBDToNetflowMonitorPolFvBDChildMapForDelete.Attributes["key"] = tagAnnotationFvRsBDToNetflowMonitorPolFvBD.Key.ValueString() + FvRsBDToNetflowMonitorPolFvBDChildren = append(FvRsBDToNetflowMonitorPolFvBDChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsBDToNetflowMonitorPolFvBDChildMapForDelete}) + } + } } - if !fvRsBDToNetflowMonitorPol.FltType.IsUnknown() && !fvRsBDToNetflowMonitorPol.FltType.IsNull() { - childMap["attributes"]["fltType"] = fvRsBDToNetflowMonitorPol.FltType.ValueString() + + var tagTagFvRsBDToNetflowMonitorPolFvBDPlan, tagTagFvRsBDToNetflowMonitorPolFvBDState []TagTagFvRsBDToNetflowMonitorPolFvBDResourceModel + fvRsBDToNetflowMonitorPolFvBD.TagTag.ElementsAs(ctx, &tagTagFvRsBDToNetflowMonitorPolFvBDPlan, false) + for _, tagTagFvRsBDToNetflowMonitorPolFvBDstate := range fvRsBDToNetflowMonitorPolFvBDState { + tagTagFvRsBDToNetflowMonitorPolFvBDstate.TagTag.ElementsAs(ctx, &tagTagFvRsBDToNetflowMonitorPolFvBDState, false) } - if !fvRsBDToNetflowMonitorPol.TnNetflowMonitorPolName.IsUnknown() && !fvRsBDToNetflowMonitorPol.TnNetflowMonitorPolName.IsNull() { - childMap["attributes"]["tnNetflowMonitorPolName"] = fvRsBDToNetflowMonitorPol.TnNetflowMonitorPolName.ValueString() + if !fvRsBDToNetflowMonitorPolFvBD.TagTag.IsNull() && !fvRsBDToNetflowMonitorPolFvBD.TagTag.IsUnknown() { + tagTagIdentifiers := []TagTagIdentifier{} + for _, tagTagFvRsBDToNetflowMonitorPolFvBD := range tagTagFvRsBDToNetflowMonitorPolFvBDPlan { + tagTagFvRsBDToNetflowMonitorPolFvBDChildMap := NewAciObject() + if !tagTagFvRsBDToNetflowMonitorPolFvBD.Key.IsNull() && !tagTagFvRsBDToNetflowMonitorPolFvBD.Key.IsUnknown() { + tagTagFvRsBDToNetflowMonitorPolFvBDChildMap.Attributes["key"] = tagTagFvRsBDToNetflowMonitorPolFvBD.Key.ValueString() + } + if !tagTagFvRsBDToNetflowMonitorPolFvBD.Value.IsNull() && !tagTagFvRsBDToNetflowMonitorPolFvBD.Value.IsUnknown() { + tagTagFvRsBDToNetflowMonitorPolFvBDChildMap.Attributes["value"] = tagTagFvRsBDToNetflowMonitorPolFvBD.Value.ValueString() + } + FvRsBDToNetflowMonitorPolFvBDChildren = append(FvRsBDToNetflowMonitorPolFvBDChildren, map[string]interface{}{"tagTag": tagTagFvRsBDToNetflowMonitorPolFvBDChildMap}) + tagTagIdentifier := TagTagIdentifier{} + tagTagIdentifier.Key = tagTagFvRsBDToNetflowMonitorPolFvBD.Key + tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) + } + for _, tagTagFvRsBDToNetflowMonitorPolFvBD := range tagTagFvRsBDToNetflowMonitorPolFvBDState { + delete := true + for _, tagTagIdentifier := range tagTagIdentifiers { + if tagTagIdentifier.Key == tagTagFvRsBDToNetflowMonitorPolFvBD.Key { + delete = false + break + } + } + if delete { + tagTagFvRsBDToNetflowMonitorPolFvBDChildMapForDelete := NewAciObject() + tagTagFvRsBDToNetflowMonitorPolFvBDChildMapForDelete.Attributes["status"] = "deleted" + tagTagFvRsBDToNetflowMonitorPolFvBDChildMapForDelete.Attributes["key"] = tagTagFvRsBDToNetflowMonitorPolFvBD.Key.ValueString() + FvRsBDToNetflowMonitorPolFvBDChildren = append(FvRsBDToNetflowMonitorPolFvBDChildren, map[string]interface{}{"tagTag": tagTagFvRsBDToNetflowMonitorPolFvBDChildMapForDelete}) + } + } } + childMap.Children = FvRsBDToNetflowMonitorPolFvBDChildren childPayloads = append(childPayloads, map[string]interface{}{"fvRsBDToNetflowMonitorPol": childMap}) fvRsBDToNetflowMonitorPolIdentifier := FvRsBDToNetflowMonitorPolIdentifier{} - fvRsBDToNetflowMonitorPolIdentifier.FltType = fvRsBDToNetflowMonitorPol.FltType - fvRsBDToNetflowMonitorPolIdentifier.TnNetflowMonitorPolName = fvRsBDToNetflowMonitorPol.TnNetflowMonitorPolName + fvRsBDToNetflowMonitorPolIdentifier.FltType = fvRsBDToNetflowMonitorPolFvBD.FltType + fvRsBDToNetflowMonitorPolIdentifier.TnNetflowMonitorPolName = fvRsBDToNetflowMonitorPolFvBD.TnNetflowMonitorPolName fvRsBDToNetflowMonitorPolIdentifiers = append(fvRsBDToNetflowMonitorPolIdentifiers, fvRsBDToNetflowMonitorPolIdentifier) } - for _, fvRsBDToNetflowMonitorPol := range fvRsBDToNetflowMonitorPolState { + for _, fvRsBDToNetflowMonitorPol := range fvRsBDToNetflowMonitorPolFvBDState { delete := true for _, fvRsBDToNetflowMonitorPolIdentifier := range fvRsBDToNetflowMonitorPolIdentifiers { if fvRsBDToNetflowMonitorPolIdentifier.FltType == fvRsBDToNetflowMonitorPol.FltType && @@ -3772,11 +6488,11 @@ func getFvBDFvRsBDToNetflowMonitorPolChildPayloads(ctx context.Context, diags *d } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["fltType"] = fvRsBDToNetflowMonitorPol.FltType.ValueString() - childMap["attributes"]["tnNetflowMonitorPolName"] = fvRsBDToNetflowMonitorPol.TnNetflowMonitorPolName.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"fvRsBDToNetflowMonitorPol": childMap}) + fvRsBDToNetflowMonitorPolChildMapForDelete := NewAciObject() + fvRsBDToNetflowMonitorPolChildMapForDelete.Attributes["status"] = "deleted" + fvRsBDToNetflowMonitorPolChildMapForDelete.Attributes["fltType"] = fvRsBDToNetflowMonitorPol.FltType.ValueString() + fvRsBDToNetflowMonitorPolChildMapForDelete.Attributes["tnNetflowMonitorPolName"] = fvRsBDToNetflowMonitorPol.TnNetflowMonitorPolName.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"fvRsBDToNetflowMonitorPol": fvRsBDToNetflowMonitorPolChildMapForDelete}) } } } else { @@ -3785,27 +6501,103 @@ func getFvBDFvRsBDToNetflowMonitorPolChildPayloads(ctx context.Context, diags *d return childPayloads } -func getFvBDFvRsBDToOutChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvBDResourceModel, fvRsBDToOutPlan, fvRsBDToOutState []FvRsBDToOutFvBDResourceModel) []map[string]interface{} { +func getFvBDFvRsBDToOutChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvBDResourceModel, fvRsBDToOutFvBDPlan, fvRsBDToOutFvBDState []FvRsBDToOutFvBDResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.FvRsBDToOut.IsUnknown() { + if !data.FvRsBDToOut.IsNull() && !data.FvRsBDToOut.IsUnknown() { fvRsBDToOutIdentifiers := []FvRsBDToOutIdentifier{} - for _, fvRsBDToOut := range fvRsBDToOutPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !fvRsBDToOut.Annotation.IsUnknown() && !fvRsBDToOut.Annotation.IsNull() { - childMap["attributes"]["annotation"] = fvRsBDToOut.Annotation.ValueString() + for _, fvRsBDToOutFvBD := range fvRsBDToOutFvBDPlan { + FvRsBDToOutFvBDChildren := make([]map[string]interface{}, 0) + childMap := NewAciObject() + if !fvRsBDToOutFvBD.Annotation.IsNull() && !fvRsBDToOutFvBD.Annotation.IsUnknown() { + childMap.Attributes["annotation"] = fvRsBDToOutFvBD.Annotation.ValueString() } else { - childMap["attributes"]["annotation"] = globalAnnotation + childMap.Attributes["annotation"] = globalAnnotation + } + if !fvRsBDToOutFvBD.TnL3extOutName.IsNull() && !fvRsBDToOutFvBD.TnL3extOutName.IsUnknown() { + childMap.Attributes["tnL3extOutName"] = fvRsBDToOutFvBD.TnL3extOutName.ValueString() + } + + var tagAnnotationFvRsBDToOutFvBDPlan, tagAnnotationFvRsBDToOutFvBDState []TagAnnotationFvRsBDToOutFvBDResourceModel + fvRsBDToOutFvBD.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsBDToOutFvBDPlan, false) + for _, tagAnnotationFvRsBDToOutFvBDstate := range fvRsBDToOutFvBDState { + tagAnnotationFvRsBDToOutFvBDstate.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsBDToOutFvBDState, false) + } + if !fvRsBDToOutFvBD.TagAnnotation.IsNull() && !fvRsBDToOutFvBD.TagAnnotation.IsUnknown() { + tagAnnotationIdentifiers := []TagAnnotationIdentifier{} + for _, tagAnnotationFvRsBDToOutFvBD := range tagAnnotationFvRsBDToOutFvBDPlan { + tagAnnotationFvRsBDToOutFvBDChildMap := NewAciObject() + if !tagAnnotationFvRsBDToOutFvBD.Key.IsNull() && !tagAnnotationFvRsBDToOutFvBD.Key.IsUnknown() { + tagAnnotationFvRsBDToOutFvBDChildMap.Attributes["key"] = tagAnnotationFvRsBDToOutFvBD.Key.ValueString() + } + if !tagAnnotationFvRsBDToOutFvBD.Value.IsNull() && !tagAnnotationFvRsBDToOutFvBD.Value.IsUnknown() { + tagAnnotationFvRsBDToOutFvBDChildMap.Attributes["value"] = tagAnnotationFvRsBDToOutFvBD.Value.ValueString() + } + FvRsBDToOutFvBDChildren = append(FvRsBDToOutFvBDChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsBDToOutFvBDChildMap}) + tagAnnotationIdentifier := TagAnnotationIdentifier{} + tagAnnotationIdentifier.Key = tagAnnotationFvRsBDToOutFvBD.Key + tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) + } + for _, tagAnnotationFvRsBDToOutFvBD := range tagAnnotationFvRsBDToOutFvBDState { + delete := true + for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { + if tagAnnotationIdentifier.Key == tagAnnotationFvRsBDToOutFvBD.Key { + delete = false + break + } + } + if delete { + tagAnnotationFvRsBDToOutFvBDChildMapForDelete := NewAciObject() + tagAnnotationFvRsBDToOutFvBDChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationFvRsBDToOutFvBDChildMapForDelete.Attributes["key"] = tagAnnotationFvRsBDToOutFvBD.Key.ValueString() + FvRsBDToOutFvBDChildren = append(FvRsBDToOutFvBDChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsBDToOutFvBDChildMapForDelete}) + } + } + } + + var tagTagFvRsBDToOutFvBDPlan, tagTagFvRsBDToOutFvBDState []TagTagFvRsBDToOutFvBDResourceModel + fvRsBDToOutFvBD.TagTag.ElementsAs(ctx, &tagTagFvRsBDToOutFvBDPlan, false) + for _, tagTagFvRsBDToOutFvBDstate := range fvRsBDToOutFvBDState { + tagTagFvRsBDToOutFvBDstate.TagTag.ElementsAs(ctx, &tagTagFvRsBDToOutFvBDState, false) } - if !fvRsBDToOut.TnL3extOutName.IsUnknown() && !fvRsBDToOut.TnL3extOutName.IsNull() { - childMap["attributes"]["tnL3extOutName"] = fvRsBDToOut.TnL3extOutName.ValueString() + if !fvRsBDToOutFvBD.TagTag.IsNull() && !fvRsBDToOutFvBD.TagTag.IsUnknown() { + tagTagIdentifiers := []TagTagIdentifier{} + for _, tagTagFvRsBDToOutFvBD := range tagTagFvRsBDToOutFvBDPlan { + tagTagFvRsBDToOutFvBDChildMap := NewAciObject() + if !tagTagFvRsBDToOutFvBD.Key.IsNull() && !tagTagFvRsBDToOutFvBD.Key.IsUnknown() { + tagTagFvRsBDToOutFvBDChildMap.Attributes["key"] = tagTagFvRsBDToOutFvBD.Key.ValueString() + } + if !tagTagFvRsBDToOutFvBD.Value.IsNull() && !tagTagFvRsBDToOutFvBD.Value.IsUnknown() { + tagTagFvRsBDToOutFvBDChildMap.Attributes["value"] = tagTagFvRsBDToOutFvBD.Value.ValueString() + } + FvRsBDToOutFvBDChildren = append(FvRsBDToOutFvBDChildren, map[string]interface{}{"tagTag": tagTagFvRsBDToOutFvBDChildMap}) + tagTagIdentifier := TagTagIdentifier{} + tagTagIdentifier.Key = tagTagFvRsBDToOutFvBD.Key + tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) + } + for _, tagTagFvRsBDToOutFvBD := range tagTagFvRsBDToOutFvBDState { + delete := true + for _, tagTagIdentifier := range tagTagIdentifiers { + if tagTagIdentifier.Key == tagTagFvRsBDToOutFvBD.Key { + delete = false + break + } + } + if delete { + tagTagFvRsBDToOutFvBDChildMapForDelete := NewAciObject() + tagTagFvRsBDToOutFvBDChildMapForDelete.Attributes["status"] = "deleted" + tagTagFvRsBDToOutFvBDChildMapForDelete.Attributes["key"] = tagTagFvRsBDToOutFvBD.Key.ValueString() + FvRsBDToOutFvBDChildren = append(FvRsBDToOutFvBDChildren, map[string]interface{}{"tagTag": tagTagFvRsBDToOutFvBDChildMapForDelete}) + } + } } + childMap.Children = FvRsBDToOutFvBDChildren childPayloads = append(childPayloads, map[string]interface{}{"fvRsBDToOut": childMap}) fvRsBDToOutIdentifier := FvRsBDToOutIdentifier{} - fvRsBDToOutIdentifier.TnL3extOutName = fvRsBDToOut.TnL3extOutName + fvRsBDToOutIdentifier.TnL3extOutName = fvRsBDToOutFvBD.TnL3extOutName fvRsBDToOutIdentifiers = append(fvRsBDToOutIdentifiers, fvRsBDToOutIdentifier) } - for _, fvRsBDToOut := range fvRsBDToOutState { + for _, fvRsBDToOut := range fvRsBDToOutFvBDState { delete := true for _, fvRsBDToOutIdentifier := range fvRsBDToOutIdentifiers { if fvRsBDToOutIdentifier.TnL3extOutName == fvRsBDToOut.TnL3extOutName { @@ -3814,10 +6606,10 @@ func getFvBDFvRsBDToOutChildPayloads(ctx context.Context, diags *diag.Diagnostic } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["tnL3extOutName"] = fvRsBDToOut.TnL3extOutName.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"fvRsBDToOut": childMap}) + fvRsBDToOutChildMapForDelete := NewAciObject() + fvRsBDToOutChildMapForDelete.Attributes["status"] = "deleted" + fvRsBDToOutChildMapForDelete.Attributes["tnL3extOutName"] = fvRsBDToOut.TnL3extOutName.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"fvRsBDToOut": fvRsBDToOutChildMapForDelete}) } } } else { @@ -3826,26 +6618,102 @@ func getFvBDFvRsBDToOutChildPayloads(ctx context.Context, diags *diag.Diagnostic return childPayloads } -func getFvBDFvRsBDToProfileChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvBDResourceModel, fvRsBDToProfilePlan, fvRsBDToProfileState FvRsBDToProfileFvBDResourceModel) []map[string]interface{} { +func getFvBDFvRsBDToProfileChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvBDResourceModel, fvRsBDToProfileFvBDPlan, fvRsBDToProfileFvBDState FvRsBDToProfileFvBDResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.FvRsBDToProfile.IsUnknown() { - childMap := map[string]map[string]interface{}{"attributes": {}} + if !data.FvRsBDToProfile.IsNull() && !data.FvRsBDToProfile.IsUnknown() { + FvRsBDToProfileFvBDChildren := make([]map[string]interface{}, 0) + childMap := NewAciObject() if !IsEmptySingleNestedAttribute(data.FvRsBDToProfile.Attributes()) { - if !fvRsBDToProfilePlan.Annotation.IsUnknown() && !fvRsBDToProfilePlan.Annotation.IsNull() { - childMap["attributes"]["annotation"] = fvRsBDToProfilePlan.Annotation.ValueString() + if !fvRsBDToProfileFvBDPlan.Annotation.IsUnknown() && !fvRsBDToProfileFvBDPlan.Annotation.IsNull() { + childMap.Attributes["annotation"] = fvRsBDToProfileFvBDPlan.Annotation.ValueString() } else { - childMap["attributes"]["annotation"] = globalAnnotation + childMap.Attributes["annotation"] = globalAnnotation } - if !fvRsBDToProfilePlan.TnL3extOutName.IsUnknown() && !fvRsBDToProfilePlan.TnL3extOutName.IsNull() { - childMap["attributes"]["tnL3extOutName"] = fvRsBDToProfilePlan.TnL3extOutName.ValueString() + if !fvRsBDToProfileFvBDPlan.TnL3extOutName.IsUnknown() && !fvRsBDToProfileFvBDPlan.TnL3extOutName.IsNull() { + childMap.Attributes["tnL3extOutName"] = fvRsBDToProfileFvBDPlan.TnL3extOutName.ValueString() } - if !fvRsBDToProfilePlan.TnRtctrlProfileName.IsUnknown() && !fvRsBDToProfilePlan.TnRtctrlProfileName.IsNull() { - childMap["attributes"]["tnRtctrlProfileName"] = fvRsBDToProfilePlan.TnRtctrlProfileName.ValueString() + if !fvRsBDToProfileFvBDPlan.TnRtctrlProfileName.IsUnknown() && !fvRsBDToProfileFvBDPlan.TnRtctrlProfileName.IsNull() { + childMap.Attributes["tnRtctrlProfileName"] = fvRsBDToProfileFvBDPlan.TnRtctrlProfileName.ValueString() } } else { - childMap["attributes"]["status"] = "deleted" + childMap.Attributes["status"] = "deleted" + } + + var tagAnnotationFvRsBDToProfileFvBDPlan, tagAnnotationFvRsBDToProfileFvBDState []TagAnnotationFvRsBDToProfileFvBDResourceModel + fvRsBDToProfileFvBDPlan.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsBDToProfileFvBDPlan, false) + if !fvRsBDToProfileFvBDState.TagAnnotation.IsNull() { + fvRsBDToProfileFvBDState.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsBDToProfileFvBDState, false) + } + if !fvRsBDToProfileFvBDPlan.TagAnnotation.IsNull() && !fvRsBDToProfileFvBDPlan.TagAnnotation.IsUnknown() { + tagAnnotationIdentifiers := []TagAnnotationIdentifier{} + for _, tagAnnotationFvRsBDToProfileFvBD := range tagAnnotationFvRsBDToProfileFvBDPlan { + tagAnnotationFvRsBDToProfileFvBDChildMap := NewAciObject() + if !tagAnnotationFvRsBDToProfileFvBD.Key.IsNull() && !tagAnnotationFvRsBDToProfileFvBD.Key.IsUnknown() { + tagAnnotationFvRsBDToProfileFvBDChildMap.Attributes["key"] = tagAnnotationFvRsBDToProfileFvBD.Key.ValueString() + } + if !tagAnnotationFvRsBDToProfileFvBD.Value.IsNull() && !tagAnnotationFvRsBDToProfileFvBD.Value.IsUnknown() { + tagAnnotationFvRsBDToProfileFvBDChildMap.Attributes["value"] = tagAnnotationFvRsBDToProfileFvBD.Value.ValueString() + } + FvRsBDToProfileFvBDChildren = append(FvRsBDToProfileFvBDChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsBDToProfileFvBDChildMap}) + tagAnnotationIdentifier := TagAnnotationIdentifier{} + tagAnnotationIdentifier.Key = tagAnnotationFvRsBDToProfileFvBD.Key + tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) + } + for _, tagAnnotationFvRsBDToProfileFvBD := range tagAnnotationFvRsBDToProfileFvBDState { + delete := true + for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { + if tagAnnotationIdentifier.Key == tagAnnotationFvRsBDToProfileFvBD.Key { + delete = false + break + } + } + if delete { + tagAnnotationFvRsBDToProfileFvBDChildMapForDelete := NewAciObject() + tagAnnotationFvRsBDToProfileFvBDChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationFvRsBDToProfileFvBDChildMapForDelete.Attributes["key"] = tagAnnotationFvRsBDToProfileFvBD.Key.ValueString() + FvRsBDToProfileFvBDChildren = append(FvRsBDToProfileFvBDChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsBDToProfileFvBDChildMapForDelete}) + } + } + } + + var tagTagFvRsBDToProfileFvBDPlan, tagTagFvRsBDToProfileFvBDState []TagTagFvRsBDToProfileFvBDResourceModel + fvRsBDToProfileFvBDPlan.TagTag.ElementsAs(ctx, &tagTagFvRsBDToProfileFvBDPlan, false) + if !fvRsBDToProfileFvBDState.TagTag.IsNull() { + fvRsBDToProfileFvBDState.TagTag.ElementsAs(ctx, &tagTagFvRsBDToProfileFvBDState, false) + } + if !fvRsBDToProfileFvBDPlan.TagTag.IsNull() && !fvRsBDToProfileFvBDPlan.TagTag.IsUnknown() { + tagTagIdentifiers := []TagTagIdentifier{} + for _, tagTagFvRsBDToProfileFvBD := range tagTagFvRsBDToProfileFvBDPlan { + tagTagFvRsBDToProfileFvBDChildMap := NewAciObject() + if !tagTagFvRsBDToProfileFvBD.Key.IsNull() && !tagTagFvRsBDToProfileFvBD.Key.IsUnknown() { + tagTagFvRsBDToProfileFvBDChildMap.Attributes["key"] = tagTagFvRsBDToProfileFvBD.Key.ValueString() + } + if !tagTagFvRsBDToProfileFvBD.Value.IsNull() && !tagTagFvRsBDToProfileFvBD.Value.IsUnknown() { + tagTagFvRsBDToProfileFvBDChildMap.Attributes["value"] = tagTagFvRsBDToProfileFvBD.Value.ValueString() + } + FvRsBDToProfileFvBDChildren = append(FvRsBDToProfileFvBDChildren, map[string]interface{}{"tagTag": tagTagFvRsBDToProfileFvBDChildMap}) + tagTagIdentifier := TagTagIdentifier{} + tagTagIdentifier.Key = tagTagFvRsBDToProfileFvBD.Key + tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) + } + for _, tagTagFvRsBDToProfileFvBD := range tagTagFvRsBDToProfileFvBDState { + delete := true + for _, tagTagIdentifier := range tagTagIdentifiers { + if tagTagIdentifier.Key == tagTagFvRsBDToProfileFvBD.Key { + delete = false + break + } + } + if delete { + tagTagFvRsBDToProfileFvBDChildMapForDelete := NewAciObject() + tagTagFvRsBDToProfileFvBDChildMapForDelete.Attributes["status"] = "deleted" + tagTagFvRsBDToProfileFvBDChildMapForDelete.Attributes["key"] = tagTagFvRsBDToProfileFvBD.Key.ValueString() + FvRsBDToProfileFvBDChildren = append(FvRsBDToProfileFvBDChildren, map[string]interface{}{"tagTag": tagTagFvRsBDToProfileFvBDChildMapForDelete}) + } + } } + childMap.Children = FvRsBDToProfileFvBDChildren childPayloads = append(childPayloads, map[string]interface{}{"fvRsBDToProfile": childMap}) } else { FvRsBDToProfileObject, _ := types.ObjectValueFrom(ctx, FvRsBDToProfileFvBDType, getEmptyFvRsBDToProfileFvBDResourceModel()) @@ -3854,23 +6722,99 @@ func getFvBDFvRsBDToProfileChildPayloads(ctx context.Context, diags *diag.Diagno return childPayloads } -func getFvBDFvRsBDToRelayPChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvBDResourceModel, fvRsBDToRelayPPlan, fvRsBDToRelayPState FvRsBDToRelayPFvBDResourceModel) []map[string]interface{} { +func getFvBDFvRsBDToRelayPChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvBDResourceModel, fvRsBDToRelayPFvBDPlan, fvRsBDToRelayPFvBDState FvRsBDToRelayPFvBDResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.FvRsBDToRelayP.IsUnknown() { - childMap := map[string]map[string]interface{}{"attributes": {}} + if !data.FvRsBDToRelayP.IsNull() && !data.FvRsBDToRelayP.IsUnknown() { + FvRsBDToRelayPFvBDChildren := make([]map[string]interface{}, 0) + childMap := NewAciObject() if !IsEmptySingleNestedAttribute(data.FvRsBDToRelayP.Attributes()) { - if !fvRsBDToRelayPPlan.Annotation.IsUnknown() && !fvRsBDToRelayPPlan.Annotation.IsNull() { - childMap["attributes"]["annotation"] = fvRsBDToRelayPPlan.Annotation.ValueString() + if !fvRsBDToRelayPFvBDPlan.Annotation.IsUnknown() && !fvRsBDToRelayPFvBDPlan.Annotation.IsNull() { + childMap.Attributes["annotation"] = fvRsBDToRelayPFvBDPlan.Annotation.ValueString() } else { - childMap["attributes"]["annotation"] = globalAnnotation + childMap.Attributes["annotation"] = globalAnnotation } - if !fvRsBDToRelayPPlan.TnDhcpRelayPName.IsUnknown() && !fvRsBDToRelayPPlan.TnDhcpRelayPName.IsNull() { - childMap["attributes"]["tnDhcpRelayPName"] = fvRsBDToRelayPPlan.TnDhcpRelayPName.ValueString() + if !fvRsBDToRelayPFvBDPlan.TnDhcpRelayPName.IsUnknown() && !fvRsBDToRelayPFvBDPlan.TnDhcpRelayPName.IsNull() { + childMap.Attributes["tnDhcpRelayPName"] = fvRsBDToRelayPFvBDPlan.TnDhcpRelayPName.ValueString() } } else { - childMap["attributes"]["status"] = "deleted" + childMap.Attributes["status"] = "deleted" + } + + var tagAnnotationFvRsBDToRelayPFvBDPlan, tagAnnotationFvRsBDToRelayPFvBDState []TagAnnotationFvRsBDToRelayPFvBDResourceModel + fvRsBDToRelayPFvBDPlan.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsBDToRelayPFvBDPlan, false) + if !fvRsBDToRelayPFvBDState.TagAnnotation.IsNull() { + fvRsBDToRelayPFvBDState.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsBDToRelayPFvBDState, false) + } + if !fvRsBDToRelayPFvBDPlan.TagAnnotation.IsNull() && !fvRsBDToRelayPFvBDPlan.TagAnnotation.IsUnknown() { + tagAnnotationIdentifiers := []TagAnnotationIdentifier{} + for _, tagAnnotationFvRsBDToRelayPFvBD := range tagAnnotationFvRsBDToRelayPFvBDPlan { + tagAnnotationFvRsBDToRelayPFvBDChildMap := NewAciObject() + if !tagAnnotationFvRsBDToRelayPFvBD.Key.IsNull() && !tagAnnotationFvRsBDToRelayPFvBD.Key.IsUnknown() { + tagAnnotationFvRsBDToRelayPFvBDChildMap.Attributes["key"] = tagAnnotationFvRsBDToRelayPFvBD.Key.ValueString() + } + if !tagAnnotationFvRsBDToRelayPFvBD.Value.IsNull() && !tagAnnotationFvRsBDToRelayPFvBD.Value.IsUnknown() { + tagAnnotationFvRsBDToRelayPFvBDChildMap.Attributes["value"] = tagAnnotationFvRsBDToRelayPFvBD.Value.ValueString() + } + FvRsBDToRelayPFvBDChildren = append(FvRsBDToRelayPFvBDChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsBDToRelayPFvBDChildMap}) + tagAnnotationIdentifier := TagAnnotationIdentifier{} + tagAnnotationIdentifier.Key = tagAnnotationFvRsBDToRelayPFvBD.Key + tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) + } + for _, tagAnnotationFvRsBDToRelayPFvBD := range tagAnnotationFvRsBDToRelayPFvBDState { + delete := true + for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { + if tagAnnotationIdentifier.Key == tagAnnotationFvRsBDToRelayPFvBD.Key { + delete = false + break + } + } + if delete { + tagAnnotationFvRsBDToRelayPFvBDChildMapForDelete := NewAciObject() + tagAnnotationFvRsBDToRelayPFvBDChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationFvRsBDToRelayPFvBDChildMapForDelete.Attributes["key"] = tagAnnotationFvRsBDToRelayPFvBD.Key.ValueString() + FvRsBDToRelayPFvBDChildren = append(FvRsBDToRelayPFvBDChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsBDToRelayPFvBDChildMapForDelete}) + } + } + } + + var tagTagFvRsBDToRelayPFvBDPlan, tagTagFvRsBDToRelayPFvBDState []TagTagFvRsBDToRelayPFvBDResourceModel + fvRsBDToRelayPFvBDPlan.TagTag.ElementsAs(ctx, &tagTagFvRsBDToRelayPFvBDPlan, false) + if !fvRsBDToRelayPFvBDState.TagTag.IsNull() { + fvRsBDToRelayPFvBDState.TagTag.ElementsAs(ctx, &tagTagFvRsBDToRelayPFvBDState, false) + } + if !fvRsBDToRelayPFvBDPlan.TagTag.IsNull() && !fvRsBDToRelayPFvBDPlan.TagTag.IsUnknown() { + tagTagIdentifiers := []TagTagIdentifier{} + for _, tagTagFvRsBDToRelayPFvBD := range tagTagFvRsBDToRelayPFvBDPlan { + tagTagFvRsBDToRelayPFvBDChildMap := NewAciObject() + if !tagTagFvRsBDToRelayPFvBD.Key.IsNull() && !tagTagFvRsBDToRelayPFvBD.Key.IsUnknown() { + tagTagFvRsBDToRelayPFvBDChildMap.Attributes["key"] = tagTagFvRsBDToRelayPFvBD.Key.ValueString() + } + if !tagTagFvRsBDToRelayPFvBD.Value.IsNull() && !tagTagFvRsBDToRelayPFvBD.Value.IsUnknown() { + tagTagFvRsBDToRelayPFvBDChildMap.Attributes["value"] = tagTagFvRsBDToRelayPFvBD.Value.ValueString() + } + FvRsBDToRelayPFvBDChildren = append(FvRsBDToRelayPFvBDChildren, map[string]interface{}{"tagTag": tagTagFvRsBDToRelayPFvBDChildMap}) + tagTagIdentifier := TagTagIdentifier{} + tagTagIdentifier.Key = tagTagFvRsBDToRelayPFvBD.Key + tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) + } + for _, tagTagFvRsBDToRelayPFvBD := range tagTagFvRsBDToRelayPFvBDState { + delete := true + for _, tagTagIdentifier := range tagTagIdentifiers { + if tagTagIdentifier.Key == tagTagFvRsBDToRelayPFvBD.Key { + delete = false + break + } + } + if delete { + tagTagFvRsBDToRelayPFvBDChildMapForDelete := NewAciObject() + tagTagFvRsBDToRelayPFvBDChildMapForDelete.Attributes["status"] = "deleted" + tagTagFvRsBDToRelayPFvBDChildMapForDelete.Attributes["key"] = tagTagFvRsBDToRelayPFvBD.Key.ValueString() + FvRsBDToRelayPFvBDChildren = append(FvRsBDToRelayPFvBDChildren, map[string]interface{}{"tagTag": tagTagFvRsBDToRelayPFvBDChildMapForDelete}) + } + } } + childMap.Children = FvRsBDToRelayPFvBDChildren childPayloads = append(childPayloads, map[string]interface{}{"fvRsBDToRelayP": childMap}) } else { FvRsBDToRelayPObject, _ := types.ObjectValueFrom(ctx, FvRsBDToRelayPFvBDType, getEmptyFvRsBDToRelayPFvBDResourceModel()) @@ -3879,24 +6823,100 @@ func getFvBDFvRsBDToRelayPChildPayloads(ctx context.Context, diags *diag.Diagnos return childPayloads } -func getFvBDFvRsBdToEpRetChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvBDResourceModel, fvRsBdToEpRetPlan, fvRsBdToEpRetState FvRsBdToEpRetFvBDResourceModel) []map[string]interface{} { +func getFvBDFvRsBdToEpRetChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvBDResourceModel, fvRsBdToEpRetFvBDPlan, fvRsBdToEpRetFvBDState FvRsBdToEpRetFvBDResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.FvRsBdToEpRet.IsUnknown() { - childMap := map[string]map[string]interface{}{"attributes": {}} + if !data.FvRsBdToEpRet.IsNull() && !data.FvRsBdToEpRet.IsUnknown() { + FvRsBdToEpRetFvBDChildren := make([]map[string]interface{}, 0) + childMap := NewAciObject() if !IsEmptySingleNestedAttribute(data.FvRsBdToEpRet.Attributes()) { - if !fvRsBdToEpRetPlan.Annotation.IsUnknown() && !fvRsBdToEpRetPlan.Annotation.IsNull() { - childMap["attributes"]["annotation"] = fvRsBdToEpRetPlan.Annotation.ValueString() + if !fvRsBdToEpRetFvBDPlan.Annotation.IsUnknown() && !fvRsBdToEpRetFvBDPlan.Annotation.IsNull() { + childMap.Attributes["annotation"] = fvRsBdToEpRetFvBDPlan.Annotation.ValueString() } else { - childMap["attributes"]["annotation"] = globalAnnotation + childMap.Attributes["annotation"] = globalAnnotation + } + if !fvRsBdToEpRetFvBDPlan.ResolveAct.IsUnknown() && !fvRsBdToEpRetFvBDPlan.ResolveAct.IsNull() { + childMap.Attributes["resolveAct"] = fvRsBdToEpRetFvBDPlan.ResolveAct.ValueString() + } + if !fvRsBdToEpRetFvBDPlan.TnFvEpRetPolName.IsUnknown() && !fvRsBdToEpRetFvBDPlan.TnFvEpRetPolName.IsNull() { + childMap.Attributes["tnFvEpRetPolName"] = fvRsBdToEpRetFvBDPlan.TnFvEpRetPolName.ValueString() + } + } + + var tagAnnotationFvRsBdToEpRetFvBDPlan, tagAnnotationFvRsBdToEpRetFvBDState []TagAnnotationFvRsBdToEpRetFvBDResourceModel + fvRsBdToEpRetFvBDPlan.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsBdToEpRetFvBDPlan, false) + if !fvRsBdToEpRetFvBDState.TagAnnotation.IsNull() { + fvRsBdToEpRetFvBDState.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsBdToEpRetFvBDState, false) + } + if !fvRsBdToEpRetFvBDPlan.TagAnnotation.IsNull() && !fvRsBdToEpRetFvBDPlan.TagAnnotation.IsUnknown() { + tagAnnotationIdentifiers := []TagAnnotationIdentifier{} + for _, tagAnnotationFvRsBdToEpRetFvBD := range tagAnnotationFvRsBdToEpRetFvBDPlan { + tagAnnotationFvRsBdToEpRetFvBDChildMap := NewAciObject() + if !tagAnnotationFvRsBdToEpRetFvBD.Key.IsNull() && !tagAnnotationFvRsBdToEpRetFvBD.Key.IsUnknown() { + tagAnnotationFvRsBdToEpRetFvBDChildMap.Attributes["key"] = tagAnnotationFvRsBdToEpRetFvBD.Key.ValueString() + } + if !tagAnnotationFvRsBdToEpRetFvBD.Value.IsNull() && !tagAnnotationFvRsBdToEpRetFvBD.Value.IsUnknown() { + tagAnnotationFvRsBdToEpRetFvBDChildMap.Attributes["value"] = tagAnnotationFvRsBdToEpRetFvBD.Value.ValueString() + } + FvRsBdToEpRetFvBDChildren = append(FvRsBdToEpRetFvBDChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsBdToEpRetFvBDChildMap}) + tagAnnotationIdentifier := TagAnnotationIdentifier{} + tagAnnotationIdentifier.Key = tagAnnotationFvRsBdToEpRetFvBD.Key + tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) } - if !fvRsBdToEpRetPlan.ResolveAct.IsUnknown() && !fvRsBdToEpRetPlan.ResolveAct.IsNull() { - childMap["attributes"]["resolveAct"] = fvRsBdToEpRetPlan.ResolveAct.ValueString() + for _, tagAnnotationFvRsBdToEpRetFvBD := range tagAnnotationFvRsBdToEpRetFvBDState { + delete := true + for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { + if tagAnnotationIdentifier.Key == tagAnnotationFvRsBdToEpRetFvBD.Key { + delete = false + break + } + } + if delete { + tagAnnotationFvRsBdToEpRetFvBDChildMapForDelete := NewAciObject() + tagAnnotationFvRsBdToEpRetFvBDChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationFvRsBdToEpRetFvBDChildMapForDelete.Attributes["key"] = tagAnnotationFvRsBdToEpRetFvBD.Key.ValueString() + FvRsBdToEpRetFvBDChildren = append(FvRsBdToEpRetFvBDChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsBdToEpRetFvBDChildMapForDelete}) + } + } + } + + var tagTagFvRsBdToEpRetFvBDPlan, tagTagFvRsBdToEpRetFvBDState []TagTagFvRsBdToEpRetFvBDResourceModel + fvRsBdToEpRetFvBDPlan.TagTag.ElementsAs(ctx, &tagTagFvRsBdToEpRetFvBDPlan, false) + if !fvRsBdToEpRetFvBDState.TagTag.IsNull() { + fvRsBdToEpRetFvBDState.TagTag.ElementsAs(ctx, &tagTagFvRsBdToEpRetFvBDState, false) + } + if !fvRsBdToEpRetFvBDPlan.TagTag.IsNull() && !fvRsBdToEpRetFvBDPlan.TagTag.IsUnknown() { + tagTagIdentifiers := []TagTagIdentifier{} + for _, tagTagFvRsBdToEpRetFvBD := range tagTagFvRsBdToEpRetFvBDPlan { + tagTagFvRsBdToEpRetFvBDChildMap := NewAciObject() + if !tagTagFvRsBdToEpRetFvBD.Key.IsNull() && !tagTagFvRsBdToEpRetFvBD.Key.IsUnknown() { + tagTagFvRsBdToEpRetFvBDChildMap.Attributes["key"] = tagTagFvRsBdToEpRetFvBD.Key.ValueString() + } + if !tagTagFvRsBdToEpRetFvBD.Value.IsNull() && !tagTagFvRsBdToEpRetFvBD.Value.IsUnknown() { + tagTagFvRsBdToEpRetFvBDChildMap.Attributes["value"] = tagTagFvRsBdToEpRetFvBD.Value.ValueString() + } + FvRsBdToEpRetFvBDChildren = append(FvRsBdToEpRetFvBDChildren, map[string]interface{}{"tagTag": tagTagFvRsBdToEpRetFvBDChildMap}) + tagTagIdentifier := TagTagIdentifier{} + tagTagIdentifier.Key = tagTagFvRsBdToEpRetFvBD.Key + tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) } - if !fvRsBdToEpRetPlan.TnFvEpRetPolName.IsUnknown() && !fvRsBdToEpRetPlan.TnFvEpRetPolName.IsNull() { - childMap["attributes"]["tnFvEpRetPolName"] = fvRsBdToEpRetPlan.TnFvEpRetPolName.ValueString() + for _, tagTagFvRsBdToEpRetFvBD := range tagTagFvRsBdToEpRetFvBDState { + delete := true + for _, tagTagIdentifier := range tagTagIdentifiers { + if tagTagIdentifier.Key == tagTagFvRsBdToEpRetFvBD.Key { + delete = false + break + } + } + if delete { + tagTagFvRsBdToEpRetFvBDChildMapForDelete := NewAciObject() + tagTagFvRsBdToEpRetFvBDChildMapForDelete.Attributes["status"] = "deleted" + tagTagFvRsBdToEpRetFvBDChildMapForDelete.Attributes["key"] = tagTagFvRsBdToEpRetFvBD.Key.ValueString() + FvRsBdToEpRetFvBDChildren = append(FvRsBdToEpRetFvBDChildren, map[string]interface{}{"tagTag": tagTagFvRsBdToEpRetFvBDChildMapForDelete}) + } } } + childMap.Children = FvRsBdToEpRetFvBDChildren childPayloads = append(childPayloads, map[string]interface{}{"fvRsBdToEpRet": childMap}) } else { FvRsBdToEpRetObject, _ := types.ObjectValueFrom(ctx, FvRsBdToEpRetFvBDType, getEmptyFvRsBdToEpRetFvBDResourceModel()) @@ -3905,21 +6925,97 @@ func getFvBDFvRsBdToEpRetChildPayloads(ctx context.Context, diags *diag.Diagnost return childPayloads } -func getFvBDFvRsCtxChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvBDResourceModel, fvRsCtxPlan, fvRsCtxState FvRsCtxFvBDResourceModel) []map[string]interface{} { +func getFvBDFvRsCtxChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvBDResourceModel, fvRsCtxFvBDPlan, fvRsCtxFvBDState FvRsCtxFvBDResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.FvRsCtx.IsUnknown() { - childMap := map[string]map[string]interface{}{"attributes": {}} + if !data.FvRsCtx.IsNull() && !data.FvRsCtx.IsUnknown() { + FvRsCtxFvBDChildren := make([]map[string]interface{}, 0) + childMap := NewAciObject() if !IsEmptySingleNestedAttribute(data.FvRsCtx.Attributes()) { - if !fvRsCtxPlan.Annotation.IsUnknown() && !fvRsCtxPlan.Annotation.IsNull() { - childMap["attributes"]["annotation"] = fvRsCtxPlan.Annotation.ValueString() + if !fvRsCtxFvBDPlan.Annotation.IsUnknown() && !fvRsCtxFvBDPlan.Annotation.IsNull() { + childMap.Attributes["annotation"] = fvRsCtxFvBDPlan.Annotation.ValueString() } else { - childMap["attributes"]["annotation"] = globalAnnotation + childMap.Attributes["annotation"] = globalAnnotation + } + if !fvRsCtxFvBDPlan.TnFvCtxName.IsUnknown() && !fvRsCtxFvBDPlan.TnFvCtxName.IsNull() { + childMap.Attributes["tnFvCtxName"] = fvRsCtxFvBDPlan.TnFvCtxName.ValueString() + } + } + + var tagAnnotationFvRsCtxFvBDPlan, tagAnnotationFvRsCtxFvBDState []TagAnnotationFvRsCtxFvBDResourceModel + fvRsCtxFvBDPlan.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsCtxFvBDPlan, false) + if !fvRsCtxFvBDState.TagAnnotation.IsNull() { + fvRsCtxFvBDState.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsCtxFvBDState, false) + } + if !fvRsCtxFvBDPlan.TagAnnotation.IsNull() && !fvRsCtxFvBDPlan.TagAnnotation.IsUnknown() { + tagAnnotationIdentifiers := []TagAnnotationIdentifier{} + for _, tagAnnotationFvRsCtxFvBD := range tagAnnotationFvRsCtxFvBDPlan { + tagAnnotationFvRsCtxFvBDChildMap := NewAciObject() + if !tagAnnotationFvRsCtxFvBD.Key.IsNull() && !tagAnnotationFvRsCtxFvBD.Key.IsUnknown() { + tagAnnotationFvRsCtxFvBDChildMap.Attributes["key"] = tagAnnotationFvRsCtxFvBD.Key.ValueString() + } + if !tagAnnotationFvRsCtxFvBD.Value.IsNull() && !tagAnnotationFvRsCtxFvBD.Value.IsUnknown() { + tagAnnotationFvRsCtxFvBDChildMap.Attributes["value"] = tagAnnotationFvRsCtxFvBD.Value.ValueString() + } + FvRsCtxFvBDChildren = append(FvRsCtxFvBDChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsCtxFvBDChildMap}) + tagAnnotationIdentifier := TagAnnotationIdentifier{} + tagAnnotationIdentifier.Key = tagAnnotationFvRsCtxFvBD.Key + tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) + } + for _, tagAnnotationFvRsCtxFvBD := range tagAnnotationFvRsCtxFvBDState { + delete := true + for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { + if tagAnnotationIdentifier.Key == tagAnnotationFvRsCtxFvBD.Key { + delete = false + break + } + } + if delete { + tagAnnotationFvRsCtxFvBDChildMapForDelete := NewAciObject() + tagAnnotationFvRsCtxFvBDChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationFvRsCtxFvBDChildMapForDelete.Attributes["key"] = tagAnnotationFvRsCtxFvBD.Key.ValueString() + FvRsCtxFvBDChildren = append(FvRsCtxFvBDChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsCtxFvBDChildMapForDelete}) + } + } + } + + var tagTagFvRsCtxFvBDPlan, tagTagFvRsCtxFvBDState []TagTagFvRsCtxFvBDResourceModel + fvRsCtxFvBDPlan.TagTag.ElementsAs(ctx, &tagTagFvRsCtxFvBDPlan, false) + if !fvRsCtxFvBDState.TagTag.IsNull() { + fvRsCtxFvBDState.TagTag.ElementsAs(ctx, &tagTagFvRsCtxFvBDState, false) + } + if !fvRsCtxFvBDPlan.TagTag.IsNull() && !fvRsCtxFvBDPlan.TagTag.IsUnknown() { + tagTagIdentifiers := []TagTagIdentifier{} + for _, tagTagFvRsCtxFvBD := range tagTagFvRsCtxFvBDPlan { + tagTagFvRsCtxFvBDChildMap := NewAciObject() + if !tagTagFvRsCtxFvBD.Key.IsNull() && !tagTagFvRsCtxFvBD.Key.IsUnknown() { + tagTagFvRsCtxFvBDChildMap.Attributes["key"] = tagTagFvRsCtxFvBD.Key.ValueString() + } + if !tagTagFvRsCtxFvBD.Value.IsNull() && !tagTagFvRsCtxFvBD.Value.IsUnknown() { + tagTagFvRsCtxFvBDChildMap.Attributes["value"] = tagTagFvRsCtxFvBD.Value.ValueString() + } + FvRsCtxFvBDChildren = append(FvRsCtxFvBDChildren, map[string]interface{}{"tagTag": tagTagFvRsCtxFvBDChildMap}) + tagTagIdentifier := TagTagIdentifier{} + tagTagIdentifier.Key = tagTagFvRsCtxFvBD.Key + tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) } - if !fvRsCtxPlan.TnFvCtxName.IsUnknown() && !fvRsCtxPlan.TnFvCtxName.IsNull() { - childMap["attributes"]["tnFvCtxName"] = fvRsCtxPlan.TnFvCtxName.ValueString() + for _, tagTagFvRsCtxFvBD := range tagTagFvRsCtxFvBDState { + delete := true + for _, tagTagIdentifier := range tagTagIdentifiers { + if tagTagIdentifier.Key == tagTagFvRsCtxFvBD.Key { + delete = false + break + } + } + if delete { + tagTagFvRsCtxFvBDChildMapForDelete := NewAciObject() + tagTagFvRsCtxFvBDChildMapForDelete.Attributes["status"] = "deleted" + tagTagFvRsCtxFvBDChildMapForDelete.Attributes["key"] = tagTagFvRsCtxFvBD.Key.ValueString() + FvRsCtxFvBDChildren = append(FvRsCtxFvBDChildren, map[string]interface{}{"tagTag": tagTagFvRsCtxFvBDChildMapForDelete}) + } } } + childMap.Children = FvRsCtxFvBDChildren childPayloads = append(childPayloads, map[string]interface{}{"fvRsCtx": childMap}) } else { FvRsCtxObject, _ := types.ObjectValueFrom(ctx, FvRsCtxFvBDType, getEmptyFvRsCtxFvBDResourceModel()) @@ -3928,21 +7024,97 @@ func getFvBDFvRsCtxChildPayloads(ctx context.Context, diags *diag.Diagnostics, d return childPayloads } -func getFvBDFvRsIgmpsnChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvBDResourceModel, fvRsIgmpsnPlan, fvRsIgmpsnState FvRsIgmpsnFvBDResourceModel) []map[string]interface{} { +func getFvBDFvRsIgmpsnChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvBDResourceModel, fvRsIgmpsnFvBDPlan, fvRsIgmpsnFvBDState FvRsIgmpsnFvBDResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.FvRsIgmpsn.IsUnknown() { - childMap := map[string]map[string]interface{}{"attributes": {}} + if !data.FvRsIgmpsn.IsNull() && !data.FvRsIgmpsn.IsUnknown() { + FvRsIgmpsnFvBDChildren := make([]map[string]interface{}, 0) + childMap := NewAciObject() if !IsEmptySingleNestedAttribute(data.FvRsIgmpsn.Attributes()) { - if !fvRsIgmpsnPlan.Annotation.IsUnknown() && !fvRsIgmpsnPlan.Annotation.IsNull() { - childMap["attributes"]["annotation"] = fvRsIgmpsnPlan.Annotation.ValueString() + if !fvRsIgmpsnFvBDPlan.Annotation.IsUnknown() && !fvRsIgmpsnFvBDPlan.Annotation.IsNull() { + childMap.Attributes["annotation"] = fvRsIgmpsnFvBDPlan.Annotation.ValueString() } else { - childMap["attributes"]["annotation"] = globalAnnotation + childMap.Attributes["annotation"] = globalAnnotation + } + if !fvRsIgmpsnFvBDPlan.TnIgmpSnoopPolName.IsUnknown() && !fvRsIgmpsnFvBDPlan.TnIgmpSnoopPolName.IsNull() { + childMap.Attributes["tnIgmpSnoopPolName"] = fvRsIgmpsnFvBDPlan.TnIgmpSnoopPolName.ValueString() + } + } + + var tagAnnotationFvRsIgmpsnFvBDPlan, tagAnnotationFvRsIgmpsnFvBDState []TagAnnotationFvRsIgmpsnFvBDResourceModel + fvRsIgmpsnFvBDPlan.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsIgmpsnFvBDPlan, false) + if !fvRsIgmpsnFvBDState.TagAnnotation.IsNull() { + fvRsIgmpsnFvBDState.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsIgmpsnFvBDState, false) + } + if !fvRsIgmpsnFvBDPlan.TagAnnotation.IsNull() && !fvRsIgmpsnFvBDPlan.TagAnnotation.IsUnknown() { + tagAnnotationIdentifiers := []TagAnnotationIdentifier{} + for _, tagAnnotationFvRsIgmpsnFvBD := range tagAnnotationFvRsIgmpsnFvBDPlan { + tagAnnotationFvRsIgmpsnFvBDChildMap := NewAciObject() + if !tagAnnotationFvRsIgmpsnFvBD.Key.IsNull() && !tagAnnotationFvRsIgmpsnFvBD.Key.IsUnknown() { + tagAnnotationFvRsIgmpsnFvBDChildMap.Attributes["key"] = tagAnnotationFvRsIgmpsnFvBD.Key.ValueString() + } + if !tagAnnotationFvRsIgmpsnFvBD.Value.IsNull() && !tagAnnotationFvRsIgmpsnFvBD.Value.IsUnknown() { + tagAnnotationFvRsIgmpsnFvBDChildMap.Attributes["value"] = tagAnnotationFvRsIgmpsnFvBD.Value.ValueString() + } + FvRsIgmpsnFvBDChildren = append(FvRsIgmpsnFvBDChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsIgmpsnFvBDChildMap}) + tagAnnotationIdentifier := TagAnnotationIdentifier{} + tagAnnotationIdentifier.Key = tagAnnotationFvRsIgmpsnFvBD.Key + tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) + } + for _, tagAnnotationFvRsIgmpsnFvBD := range tagAnnotationFvRsIgmpsnFvBDState { + delete := true + for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { + if tagAnnotationIdentifier.Key == tagAnnotationFvRsIgmpsnFvBD.Key { + delete = false + break + } + } + if delete { + tagAnnotationFvRsIgmpsnFvBDChildMapForDelete := NewAciObject() + tagAnnotationFvRsIgmpsnFvBDChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationFvRsIgmpsnFvBDChildMapForDelete.Attributes["key"] = tagAnnotationFvRsIgmpsnFvBD.Key.ValueString() + FvRsIgmpsnFvBDChildren = append(FvRsIgmpsnFvBDChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsIgmpsnFvBDChildMapForDelete}) + } } - if !fvRsIgmpsnPlan.TnIgmpSnoopPolName.IsUnknown() && !fvRsIgmpsnPlan.TnIgmpSnoopPolName.IsNull() { - childMap["attributes"]["tnIgmpSnoopPolName"] = fvRsIgmpsnPlan.TnIgmpSnoopPolName.ValueString() + } + + var tagTagFvRsIgmpsnFvBDPlan, tagTagFvRsIgmpsnFvBDState []TagTagFvRsIgmpsnFvBDResourceModel + fvRsIgmpsnFvBDPlan.TagTag.ElementsAs(ctx, &tagTagFvRsIgmpsnFvBDPlan, false) + if !fvRsIgmpsnFvBDState.TagTag.IsNull() { + fvRsIgmpsnFvBDState.TagTag.ElementsAs(ctx, &tagTagFvRsIgmpsnFvBDState, false) + } + if !fvRsIgmpsnFvBDPlan.TagTag.IsNull() && !fvRsIgmpsnFvBDPlan.TagTag.IsUnknown() { + tagTagIdentifiers := []TagTagIdentifier{} + for _, tagTagFvRsIgmpsnFvBD := range tagTagFvRsIgmpsnFvBDPlan { + tagTagFvRsIgmpsnFvBDChildMap := NewAciObject() + if !tagTagFvRsIgmpsnFvBD.Key.IsNull() && !tagTagFvRsIgmpsnFvBD.Key.IsUnknown() { + tagTagFvRsIgmpsnFvBDChildMap.Attributes["key"] = tagTagFvRsIgmpsnFvBD.Key.ValueString() + } + if !tagTagFvRsIgmpsnFvBD.Value.IsNull() && !tagTagFvRsIgmpsnFvBD.Value.IsUnknown() { + tagTagFvRsIgmpsnFvBDChildMap.Attributes["value"] = tagTagFvRsIgmpsnFvBD.Value.ValueString() + } + FvRsIgmpsnFvBDChildren = append(FvRsIgmpsnFvBDChildren, map[string]interface{}{"tagTag": tagTagFvRsIgmpsnFvBDChildMap}) + tagTagIdentifier := TagTagIdentifier{} + tagTagIdentifier.Key = tagTagFvRsIgmpsnFvBD.Key + tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) + } + for _, tagTagFvRsIgmpsnFvBD := range tagTagFvRsIgmpsnFvBDState { + delete := true + for _, tagTagIdentifier := range tagTagIdentifiers { + if tagTagIdentifier.Key == tagTagFvRsIgmpsnFvBD.Key { + delete = false + break + } + } + if delete { + tagTagFvRsIgmpsnFvBDChildMapForDelete := NewAciObject() + tagTagFvRsIgmpsnFvBDChildMapForDelete.Attributes["status"] = "deleted" + tagTagFvRsIgmpsnFvBDChildMapForDelete.Attributes["key"] = tagTagFvRsIgmpsnFvBD.Key.ValueString() + FvRsIgmpsnFvBDChildren = append(FvRsIgmpsnFvBDChildren, map[string]interface{}{"tagTag": tagTagFvRsIgmpsnFvBDChildMapForDelete}) + } } } + childMap.Children = FvRsIgmpsnFvBDChildren childPayloads = append(childPayloads, map[string]interface{}{"fvRsIgmpsn": childMap}) } else { FvRsIgmpsnObject, _ := types.ObjectValueFrom(ctx, FvRsIgmpsnFvBDType, getEmptyFvRsIgmpsnFvBDResourceModel()) @@ -3951,21 +7123,97 @@ func getFvBDFvRsIgmpsnChildPayloads(ctx context.Context, diags *diag.Diagnostics return childPayloads } -func getFvBDFvRsMldsnChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvBDResourceModel, fvRsMldsnPlan, fvRsMldsnState FvRsMldsnFvBDResourceModel) []map[string]interface{} { +func getFvBDFvRsMldsnChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvBDResourceModel, fvRsMldsnFvBDPlan, fvRsMldsnFvBDState FvRsMldsnFvBDResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.FvRsMldsn.IsUnknown() { - childMap := map[string]map[string]interface{}{"attributes": {}} + if !data.FvRsMldsn.IsNull() && !data.FvRsMldsn.IsUnknown() { + FvRsMldsnFvBDChildren := make([]map[string]interface{}, 0) + childMap := NewAciObject() if !IsEmptySingleNestedAttribute(data.FvRsMldsn.Attributes()) { - if !fvRsMldsnPlan.Annotation.IsUnknown() && !fvRsMldsnPlan.Annotation.IsNull() { - childMap["attributes"]["annotation"] = fvRsMldsnPlan.Annotation.ValueString() + if !fvRsMldsnFvBDPlan.Annotation.IsUnknown() && !fvRsMldsnFvBDPlan.Annotation.IsNull() { + childMap.Attributes["annotation"] = fvRsMldsnFvBDPlan.Annotation.ValueString() } else { - childMap["attributes"]["annotation"] = globalAnnotation + childMap.Attributes["annotation"] = globalAnnotation + } + if !fvRsMldsnFvBDPlan.TnMldSnoopPolName.IsUnknown() && !fvRsMldsnFvBDPlan.TnMldSnoopPolName.IsNull() { + childMap.Attributes["tnMldSnoopPolName"] = fvRsMldsnFvBDPlan.TnMldSnoopPolName.ValueString() + } + } + + var tagAnnotationFvRsMldsnFvBDPlan, tagAnnotationFvRsMldsnFvBDState []TagAnnotationFvRsMldsnFvBDResourceModel + fvRsMldsnFvBDPlan.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsMldsnFvBDPlan, false) + if !fvRsMldsnFvBDState.TagAnnotation.IsNull() { + fvRsMldsnFvBDState.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsMldsnFvBDState, false) + } + if !fvRsMldsnFvBDPlan.TagAnnotation.IsNull() && !fvRsMldsnFvBDPlan.TagAnnotation.IsUnknown() { + tagAnnotationIdentifiers := []TagAnnotationIdentifier{} + for _, tagAnnotationFvRsMldsnFvBD := range tagAnnotationFvRsMldsnFvBDPlan { + tagAnnotationFvRsMldsnFvBDChildMap := NewAciObject() + if !tagAnnotationFvRsMldsnFvBD.Key.IsNull() && !tagAnnotationFvRsMldsnFvBD.Key.IsUnknown() { + tagAnnotationFvRsMldsnFvBDChildMap.Attributes["key"] = tagAnnotationFvRsMldsnFvBD.Key.ValueString() + } + if !tagAnnotationFvRsMldsnFvBD.Value.IsNull() && !tagAnnotationFvRsMldsnFvBD.Value.IsUnknown() { + tagAnnotationFvRsMldsnFvBDChildMap.Attributes["value"] = tagAnnotationFvRsMldsnFvBD.Value.ValueString() + } + FvRsMldsnFvBDChildren = append(FvRsMldsnFvBDChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsMldsnFvBDChildMap}) + tagAnnotationIdentifier := TagAnnotationIdentifier{} + tagAnnotationIdentifier.Key = tagAnnotationFvRsMldsnFvBD.Key + tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) + } + for _, tagAnnotationFvRsMldsnFvBD := range tagAnnotationFvRsMldsnFvBDState { + delete := true + for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { + if tagAnnotationIdentifier.Key == tagAnnotationFvRsMldsnFvBD.Key { + delete = false + break + } + } + if delete { + tagAnnotationFvRsMldsnFvBDChildMapForDelete := NewAciObject() + tagAnnotationFvRsMldsnFvBDChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationFvRsMldsnFvBDChildMapForDelete.Attributes["key"] = tagAnnotationFvRsMldsnFvBD.Key.ValueString() + FvRsMldsnFvBDChildren = append(FvRsMldsnFvBDChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsMldsnFvBDChildMapForDelete}) + } + } + } + + var tagTagFvRsMldsnFvBDPlan, tagTagFvRsMldsnFvBDState []TagTagFvRsMldsnFvBDResourceModel + fvRsMldsnFvBDPlan.TagTag.ElementsAs(ctx, &tagTagFvRsMldsnFvBDPlan, false) + if !fvRsMldsnFvBDState.TagTag.IsNull() { + fvRsMldsnFvBDState.TagTag.ElementsAs(ctx, &tagTagFvRsMldsnFvBDState, false) + } + if !fvRsMldsnFvBDPlan.TagTag.IsNull() && !fvRsMldsnFvBDPlan.TagTag.IsUnknown() { + tagTagIdentifiers := []TagTagIdentifier{} + for _, tagTagFvRsMldsnFvBD := range tagTagFvRsMldsnFvBDPlan { + tagTagFvRsMldsnFvBDChildMap := NewAciObject() + if !tagTagFvRsMldsnFvBD.Key.IsNull() && !tagTagFvRsMldsnFvBD.Key.IsUnknown() { + tagTagFvRsMldsnFvBDChildMap.Attributes["key"] = tagTagFvRsMldsnFvBD.Key.ValueString() + } + if !tagTagFvRsMldsnFvBD.Value.IsNull() && !tagTagFvRsMldsnFvBD.Value.IsUnknown() { + tagTagFvRsMldsnFvBDChildMap.Attributes["value"] = tagTagFvRsMldsnFvBD.Value.ValueString() + } + FvRsMldsnFvBDChildren = append(FvRsMldsnFvBDChildren, map[string]interface{}{"tagTag": tagTagFvRsMldsnFvBDChildMap}) + tagTagIdentifier := TagTagIdentifier{} + tagTagIdentifier.Key = tagTagFvRsMldsnFvBD.Key + tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) } - if !fvRsMldsnPlan.TnMldSnoopPolName.IsUnknown() && !fvRsMldsnPlan.TnMldSnoopPolName.IsNull() { - childMap["attributes"]["tnMldSnoopPolName"] = fvRsMldsnPlan.TnMldSnoopPolName.ValueString() + for _, tagTagFvRsMldsnFvBD := range tagTagFvRsMldsnFvBDState { + delete := true + for _, tagTagIdentifier := range tagTagIdentifiers { + if tagTagIdentifier.Key == tagTagFvRsMldsnFvBD.Key { + delete = false + break + } + } + if delete { + tagTagFvRsMldsnFvBDChildMapForDelete := NewAciObject() + tagTagFvRsMldsnFvBDChildMapForDelete.Attributes["status"] = "deleted" + tagTagFvRsMldsnFvBDChildMapForDelete.Attributes["key"] = tagTagFvRsMldsnFvBD.Key.ValueString() + FvRsMldsnFvBDChildren = append(FvRsMldsnFvBDChildren, map[string]interface{}{"tagTag": tagTagFvRsMldsnFvBDChildMapForDelete}) + } } } + childMap.Children = FvRsMldsnFvBDChildren childPayloads = append(childPayloads, map[string]interface{}{"fvRsMldsn": childMap}) } else { FvRsMldsnObject, _ := types.ObjectValueFrom(ctx, FvRsMldsnFvBDType, getEmptyFvRsMldsnFvBDResourceModel()) @@ -3974,25 +7222,25 @@ func getFvBDFvRsMldsnChildPayloads(ctx context.Context, diags *diag.Diagnostics, return childPayloads } -func getFvBDTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvBDResourceModel, tagAnnotationPlan, tagAnnotationState []TagAnnotationFvBDResourceModel) []map[string]interface{} { +func getFvBDTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvBDResourceModel, tagAnnotationFvBDPlan, tagAnnotationFvBDState []TagAnnotationFvBDResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagAnnotation.IsUnknown() { + if !data.TagAnnotation.IsNull() && !data.TagAnnotation.IsUnknown() { tagAnnotationIdentifiers := []TagAnnotationIdentifier{} - for _, tagAnnotation := range tagAnnotationPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagAnnotation.Key.IsUnknown() && !tagAnnotation.Key.IsNull() { - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() + for _, tagAnnotationFvBD := range tagAnnotationFvBDPlan { + childMap := NewAciObject() + if !tagAnnotationFvBD.Key.IsNull() && !tagAnnotationFvBD.Key.IsUnknown() { + childMap.Attributes["key"] = tagAnnotationFvBD.Key.ValueString() } - if !tagAnnotation.Value.IsUnknown() && !tagAnnotation.Value.IsNull() { - childMap["attributes"]["value"] = tagAnnotation.Value.ValueString() + if !tagAnnotationFvBD.Value.IsNull() && !tagAnnotationFvBD.Value.IsUnknown() { + childMap.Attributes["value"] = tagAnnotationFvBD.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) tagAnnotationIdentifier := TagAnnotationIdentifier{} - tagAnnotationIdentifier.Key = tagAnnotation.Key + tagAnnotationIdentifier.Key = tagAnnotationFvBD.Key tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) } - for _, tagAnnotation := range tagAnnotationState { + for _, tagAnnotation := range tagAnnotationFvBDState { delete := true for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { if tagAnnotationIdentifier.Key == tagAnnotation.Key { @@ -4001,10 +7249,10 @@ func getFvBDTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnost } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) + tagAnnotationChildMapForDelete := NewAciObject() + tagAnnotationChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationChildMapForDelete.Attributes["key"] = tagAnnotation.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": tagAnnotationChildMapForDelete}) } } } else { @@ -4013,25 +7261,25 @@ func getFvBDTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnost return childPayloads } -func getFvBDTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvBDResourceModel, tagTagPlan, tagTagState []TagTagFvBDResourceModel) []map[string]interface{} { +func getFvBDTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvBDResourceModel, tagTagFvBDPlan, tagTagFvBDState []TagTagFvBDResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagTag.IsUnknown() { + if !data.TagTag.IsNull() && !data.TagTag.IsUnknown() { tagTagIdentifiers := []TagTagIdentifier{} - for _, tagTag := range tagTagPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagTag.Key.IsUnknown() && !tagTag.Key.IsNull() { - childMap["attributes"]["key"] = tagTag.Key.ValueString() + for _, tagTagFvBD := range tagTagFvBDPlan { + childMap := NewAciObject() + if !tagTagFvBD.Key.IsNull() && !tagTagFvBD.Key.IsUnknown() { + childMap.Attributes["key"] = tagTagFvBD.Key.ValueString() } - if !tagTag.Value.IsUnknown() && !tagTag.Value.IsNull() { - childMap["attributes"]["value"] = tagTag.Value.ValueString() + if !tagTagFvBD.Value.IsNull() && !tagTagFvBD.Value.IsUnknown() { + childMap.Attributes["value"] = tagTagFvBD.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) tagTagIdentifier := TagTagIdentifier{} - tagTagIdentifier.Key = tagTag.Key + tagTagIdentifier.Key = tagTagFvBD.Key tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) } - for _, tagTag := range tagTagState { + for _, tagTag := range tagTagFvBDState { delete := true for _, tagTagIdentifier := range tagTagIdentifiers { if tagTagIdentifier.Key == tagTag.Key { @@ -4040,10 +7288,10 @@ func getFvBDTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, da } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagTag.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) + tagTagChildMapForDelete := NewAciObject() + tagTagChildMapForDelete.Attributes["status"] = "deleted" + tagTagChildMapForDelete.Attributes["key"] = tagTag.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagTag": tagTagChildMapForDelete}) } } } else { diff --git a/internal/provider/resource_aci_bridge_domain_test.go b/internal/provider/resource_aci_bridge_domain_test.go index e00321473..dff02c20a 100644 --- a/internal/provider/resource_aci_bridge_domain_test.go +++ b/internal/provider/resource_aci_bridge_domain_test.go @@ -69,16 +69,16 @@ func TestAccResourceFvBDWithFvTenant(t *testing.T) { resource.TestCheckResourceAttr("aci_bridge_domain.allow_test_2", "pim", "no"), resource.TestCheckResourceAttr("aci_bridge_domain.allow_test", "unicast_routing", "yes"), resource.TestCheckResourceAttr("aci_bridge_domain.allow_test_2", "unicast_routing", "yes"), - composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)", ">=", resource.TestCheckResourceAttr("aci_bridge_domain.allow_test", "advertise_host_routes", "no"), resource.TestCheckResourceAttr("aci_bridge_domain.allow_test_2", "advertise_host_routes", "no")), - composeAggregateTestCheckFuncWithVersion(t, "4.1(1i)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.1(1i)", ">=", resource.TestCheckResourceAttr("aci_bridge_domain.allow_test", "ipv6_l3_unknown_multicast_flooding", "flood"), resource.TestCheckResourceAttr("aci_bridge_domain.allow_test_2", "ipv6_l3_unknown_multicast_flooding", "flood")), - composeAggregateTestCheckFuncWithVersion(t, "4.2(1i)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.2(1i)", ">=", resource.TestCheckResourceAttr("aci_bridge_domain.allow_test", "pim_ipv6", "no"), resource.TestCheckResourceAttr("aci_bridge_domain.allow_test_2", "pim_ipv6", "no")), - composeAggregateTestCheckFuncWithVersion(t, "5.2(5c)", ">", + composeAggregateTestCheckFuncWithVersion(t, "5.2(5c)", ">=", resource.TestCheckResourceAttr("aci_bridge_domain.allow_test", "drop_arp_with_multicast_smac", "yes"), resource.TestCheckResourceAttr("aci_bridge_domain.allow_test_2", "drop_arp_with_multicast_smac", "yes")), resource.TestCheckResourceAttr("aci_bridge_domain.allow_test", "virtual_mac_address", "not-applicable"), @@ -155,16 +155,16 @@ func TestAccResourceFvBDWithFvTenant(t *testing.T) { resource.TestCheckResourceAttr("aci_bridge_domain.allow_test_2", "pim", "no"), resource.TestCheckResourceAttr("aci_bridge_domain.allow_test", "unicast_routing", "yes"), resource.TestCheckResourceAttr("aci_bridge_domain.allow_test_2", "unicast_routing", "yes"), - composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)", ">=", resource.TestCheckResourceAttr("aci_bridge_domain.allow_test", "advertise_host_routes", "no"), resource.TestCheckResourceAttr("aci_bridge_domain.allow_test_2", "advertise_host_routes", "no")), - composeAggregateTestCheckFuncWithVersion(t, "4.1(1i)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.1(1i)", ">=", resource.TestCheckResourceAttr("aci_bridge_domain.allow_test", "ipv6_l3_unknown_multicast_flooding", "flood"), resource.TestCheckResourceAttr("aci_bridge_domain.allow_test_2", "ipv6_l3_unknown_multicast_flooding", "flood")), - composeAggregateTestCheckFuncWithVersion(t, "4.2(1i)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.2(1i)", ">=", resource.TestCheckResourceAttr("aci_bridge_domain.allow_test", "pim_ipv6", "no"), resource.TestCheckResourceAttr("aci_bridge_domain.allow_test_2", "pim_ipv6", "no")), - composeAggregateTestCheckFuncWithVersion(t, "5.2(5c)", ">", + composeAggregateTestCheckFuncWithVersion(t, "5.2(5c)", ">=", resource.TestCheckResourceAttr("aci_bridge_domain.allow_test", "drop_arp_with_multicast_smac", "yes"), resource.TestCheckResourceAttr("aci_bridge_domain.allow_test_2", "drop_arp_with_multicast_smac", "yes")), resource.TestCheckResourceAttr("aci_bridge_domain.allow_test", "virtual_mac_address", "not-applicable"), @@ -205,13 +205,13 @@ func TestAccResourceFvBDWithFvTenant(t *testing.T) { resource.TestCheckResourceAttr("aci_bridge_domain.test", "owner_tag", ""), resource.TestCheckResourceAttr("aci_bridge_domain.test", "pim", "no"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "unicast_routing", "yes"), - composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)", ">=", resource.TestCheckResourceAttr("aci_bridge_domain.test", "advertise_host_routes", "no")), - composeAggregateTestCheckFuncWithVersion(t, "4.1(1i)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.1(1i)", ">=", resource.TestCheckResourceAttr("aci_bridge_domain.test", "ipv6_l3_unknown_multicast_flooding", "flood")), - composeAggregateTestCheckFuncWithVersion(t, "4.2(1i)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.2(1i)", ">=", resource.TestCheckResourceAttr("aci_bridge_domain.test", "pim_ipv6", "no")), - composeAggregateTestCheckFuncWithVersion(t, "5.2(5c)", ">", + composeAggregateTestCheckFuncWithVersion(t, "5.2(5c)", ">=", resource.TestCheckResourceAttr("aci_bridge_domain.test", "drop_arp_with_multicast_smac", "yes")), resource.TestCheckResourceAttr("aci_bridge_domain.test", "virtual_mac_address", "not-applicable"), ), @@ -243,13 +243,13 @@ func TestAccResourceFvBDWithFvTenant(t *testing.T) { resource.TestCheckResourceAttr("aci_bridge_domain.test", "owner_tag", "owner_tag_1"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "pim", "no"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "unicast_routing", "no"), - composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)", ">=", resource.TestCheckResourceAttr("aci_bridge_domain.test", "advertise_host_routes", "no")), - composeAggregateTestCheckFuncWithVersion(t, "4.1(1i)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.1(1i)", ">=", resource.TestCheckResourceAttr("aci_bridge_domain.test", "ipv6_l3_unknown_multicast_flooding", "flood")), - composeAggregateTestCheckFuncWithVersion(t, "4.2(1i)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.2(1i)", ">=", resource.TestCheckResourceAttr("aci_bridge_domain.test", "pim_ipv6", "no")), - composeAggregateTestCheckFuncWithVersion(t, "5.2(5c)", ">", + composeAggregateTestCheckFuncWithVersion(t, "5.2(5c)", ">=", resource.TestCheckResourceAttr("aci_bridge_domain.test", "drop_arp_with_multicast_smac", "no")), resource.TestCheckResourceAttr("aci_bridge_domain.test", "virtual_mac_address", "00:22:BD:F8:19:FB"), ), @@ -289,13 +289,13 @@ func TestAccResourceFvBDWithFvTenant(t *testing.T) { resource.TestCheckResourceAttr("aci_bridge_domain.test", "owner_tag", ""), resource.TestCheckResourceAttr("aci_bridge_domain.test", "pim", "no"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "unicast_routing", "yes"), - composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)", ">=", resource.TestCheckResourceAttr("aci_bridge_domain.test", "advertise_host_routes", "no")), - composeAggregateTestCheckFuncWithVersion(t, "4.1(1i)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.1(1i)", ">=", resource.TestCheckResourceAttr("aci_bridge_domain.test", "ipv6_l3_unknown_multicast_flooding", "flood")), - composeAggregateTestCheckFuncWithVersion(t, "4.2(1i)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.2(1i)", ">=", resource.TestCheckResourceAttr("aci_bridge_domain.test", "pim_ipv6", "no")), - composeAggregateTestCheckFuncWithVersion(t, "5.2(5c)", ">", + composeAggregateTestCheckFuncWithVersion(t, "5.2(5c)", ">=", resource.TestCheckResourceAttr("aci_bridge_domain.test", "drop_arp_with_multicast_smac", "yes")), resource.TestCheckResourceAttr("aci_bridge_domain.test", "virtual_mac_address", "not-applicable"), ), @@ -333,13 +333,13 @@ func TestAccResourceFvBDWithFvTenant(t *testing.T) { resource.TestCheckResourceAttr("aci_bridge_domain.test", "owner_tag", ""), resource.TestCheckResourceAttr("aci_bridge_domain.test", "pim", "no"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "unicast_routing", "yes"), - composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)", ">=", resource.TestCheckResourceAttr("aci_bridge_domain.test", "advertise_host_routes", "no")), - composeAggregateTestCheckFuncWithVersion(t, "4.1(1i)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.1(1i)", ">=", resource.TestCheckResourceAttr("aci_bridge_domain.test", "ipv6_l3_unknown_multicast_flooding", "flood")), - composeAggregateTestCheckFuncWithVersion(t, "4.2(1i)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.2(1i)", ">=", resource.TestCheckResourceAttr("aci_bridge_domain.test", "pim_ipv6", "no")), - composeAggregateTestCheckFuncWithVersion(t, "5.2(5c)", ">", + composeAggregateTestCheckFuncWithVersion(t, "5.2(5c)", ">=", resource.TestCheckResourceAttr("aci_bridge_domain.test", "drop_arp_with_multicast_smac", "yes")), resource.TestCheckResourceAttr("aci_bridge_domain.test", "virtual_mac_address", "not-applicable"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "annotations.0.key", "key_0"), @@ -421,6 +421,16 @@ func TestAccResourceFvBDWithFvTenant(t *testing.T) { resource.TestCheckResourceAttr("aci_bridge_domain.test", "annotations.1.value", "test_value"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "annotations.#", "2"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "legacy_mode.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "legacy_mode.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "legacy_mode.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "legacy_mode.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "legacy_mode.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "annotations.#", "2"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "legacy_mode.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "legacy_mode.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "legacy_mode.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "legacy_mode.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "tags.#", "2"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "legacy_mode.description", "description_1"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "legacy_mode.encapsulation", "vlan-100"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "legacy_mode.name", "name_1"), @@ -428,43 +438,193 @@ func TestAccResourceFvBDWithFvTenant(t *testing.T) { resource.TestCheckResourceAttr("aci_bridge_domain.test", "legacy_mode.owner_key", "owner_key_1"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "legacy_mode.owner_tag", "owner_tag_1"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_dhcp_relay_policy.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_dhcp_relay_policy.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_dhcp_relay_policy.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_dhcp_relay_policy.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_dhcp_relay_policy.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "annotations.#", "2"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_dhcp_relay_policy.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_dhcp_relay_policy.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_dhcp_relay_policy.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_dhcp_relay_policy.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "tags.#", "2"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_dhcp_relay_policy.dhcp_relay_policy_name", "dhcp_relay_policy_name_1"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_end_point_retention_policy.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_end_point_retention_policy.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_end_point_retention_policy.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_end_point_retention_policy.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_end_point_retention_policy.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "annotations.#", "2"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_end_point_retention_policy.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_end_point_retention_policy.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_end_point_retention_policy.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_end_point_retention_policy.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "tags.#", "2"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_end_point_retention_policy.end_point_retention_policy_name", "end_point_retention_policy_name_1"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_end_point_retention_policy.resolve_action", "inherit"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_first_hop_security_policy.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_first_hop_security_policy.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_first_hop_security_policy.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_first_hop_security_policy.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_first_hop_security_policy.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "annotations.#", "2"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_first_hop_security_policy.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_first_hop_security_policy.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_first_hop_security_policy.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_first_hop_security_policy.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "tags.#", "2"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_first_hop_security_policy.first_hop_security_policy_name", "first_hop_security_policy_name_1"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_igmp_snooping_policy.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_igmp_snooping_policy.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_igmp_snooping_policy.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_igmp_snooping_policy.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_igmp_snooping_policy.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "annotations.#", "2"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_igmp_snooping_policy.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_igmp_snooping_policy.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_igmp_snooping_policy.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_igmp_snooping_policy.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "tags.#", "2"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_igmp_snooping_policy.igmp_snooping_policy_name", "igmp_snooping_policy_name_1"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_l3_outsides.0.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_l3_outsides.0.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_l3_outsides.0.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_l3_outsides.0.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_l3_outsides.0.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "annotations.#", "2"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_l3_outsides.0.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_l3_outsides.0.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_l3_outsides.0.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_l3_outsides.0.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "tags.#", "2"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_l3_outsides.0.l3_outside_name", "l3_outside_name_0"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_l3_outsides.1.annotation", "annotation_2"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_l3_outsides.1.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_l3_outsides.1.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_l3_outsides.1.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_l3_outsides.1.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "annotations.#", "2"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_l3_outsides.1.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_l3_outsides.1.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_l3_outsides.1.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_l3_outsides.1.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "tags.#", "2"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_l3_outsides.1.l3_outside_name", "l3_outside_name_1"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_l3_outsides.#", "2"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_mld_snooping_policy.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_mld_snooping_policy.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_mld_snooping_policy.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_mld_snooping_policy.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_mld_snooping_policy.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "annotations.#", "2"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_mld_snooping_policy.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_mld_snooping_policy.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_mld_snooping_policy.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_mld_snooping_policy.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "tags.#", "2"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_mld_snooping_policy.mld_snooping_policy_name", "mld_snooping_policy_name_1"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_monitor_policy.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_monitor_policy.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_monitor_policy.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_monitor_policy.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_monitor_policy.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "annotations.#", "2"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_monitor_policy.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_monitor_policy.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_monitor_policy.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_monitor_policy.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "tags.#", "2"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_monitor_policy.monitoring_policy_name", "monitoring_policy_name_1"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_neighbor_discovery_interface_policy.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_neighbor_discovery_interface_policy.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_neighbor_discovery_interface_policy.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_neighbor_discovery_interface_policy.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_neighbor_discovery_interface_policy.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "annotations.#", "2"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_neighbor_discovery_interface_policy.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_neighbor_discovery_interface_policy.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_neighbor_discovery_interface_policy.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_neighbor_discovery_interface_policy.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "tags.#", "2"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_neighbor_discovery_interface_policy.neighbor_discovery_interface_policy_name", "neighbor_discovery_interface_policy_name_1"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_netflow_monitor_policies.0.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_netflow_monitor_policies.0.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_netflow_monitor_policies.0.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_netflow_monitor_policies.0.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_netflow_monitor_policies.0.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "annotations.#", "2"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_netflow_monitor_policies.0.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_netflow_monitor_policies.0.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_netflow_monitor_policies.0.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_netflow_monitor_policies.0.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "tags.#", "2"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_netflow_monitor_policies.0.filter_type", "ce"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_netflow_monitor_policies.0.netflow_monitor_policy_name", "netflow_monitor_policy_name_0"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_netflow_monitor_policies.1.annotation", "annotation_2"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_netflow_monitor_policies.1.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_netflow_monitor_policies.1.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_netflow_monitor_policies.1.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_netflow_monitor_policies.1.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "annotations.#", "2"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_netflow_monitor_policies.1.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_netflow_monitor_policies.1.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_netflow_monitor_policies.1.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_netflow_monitor_policies.1.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "tags.#", "2"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_netflow_monitor_policies.1.filter_type", "ipv4"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_netflow_monitor_policies.1.netflow_monitor_policy_name", "netflow_monitor_policy_name_1"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_netflow_monitor_policies.#", "2"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_route_control_profile.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_route_control_profile.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_route_control_profile.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_route_control_profile.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_route_control_profile.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "annotations.#", "2"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_route_control_profile.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_route_control_profile.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_route_control_profile.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_route_control_profile.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "tags.#", "2"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_route_control_profile.l3_outside_name", "l3_outside_name_1"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_route_control_profile.route_control_profile_name", "route_control_profile_name_1"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_vrf.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_vrf.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_vrf.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_vrf.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_vrf.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "annotations.#", "2"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_vrf.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_vrf.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_vrf.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_vrf.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "tags.#", "2"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_vrf.vrf_name", "vrf_name_1"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "rogue_coop_exceptions.0.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "rogue_coop_exceptions.0.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "rogue_coop_exceptions.0.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "rogue_coop_exceptions.0.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "rogue_coop_exceptions.0.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "annotations.#", "2"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "rogue_coop_exceptions.0.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "rogue_coop_exceptions.0.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "rogue_coop_exceptions.0.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "rogue_coop_exceptions.0.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "tags.#", "2"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "rogue_coop_exceptions.0.description", "description_1"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "rogue_coop_exceptions.0.mac", "00:00:00:00:00:00"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "rogue_coop_exceptions.0.name", "name_1"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "rogue_coop_exceptions.0.name_alias", "name_alias_1"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "rogue_coop_exceptions.1.annotation", "annotation_2"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "rogue_coop_exceptions.1.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "rogue_coop_exceptions.1.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "rogue_coop_exceptions.1.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "rogue_coop_exceptions.1.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "annotations.#", "2"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "rogue_coop_exceptions.1.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "rogue_coop_exceptions.1.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "rogue_coop_exceptions.1.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "rogue_coop_exceptions.1.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "tags.#", "2"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "rogue_coop_exceptions.1.description", "description_2"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "rogue_coop_exceptions.1.mac", "00:00:00:00:00:01"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "rogue_coop_exceptions.1.name", "name_2"), @@ -486,24 +646,72 @@ func TestAccResourceFvBDWithFvTenant(t *testing.T) { resource.TestCheckResourceAttr("aci_bridge_domain.test", "annotations.0.value", "test_value"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "annotations.#", "1"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_end_point_retention_policy.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_end_point_retention_policy.annotations.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_end_point_retention_policy.annotations.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_end_point_retention_policy.annotations.#", "1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_end_point_retention_policy.tags.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_end_point_retention_policy.tags.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_end_point_retention_policy.tags.#", "1"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_end_point_retention_policy.end_point_retention_policy_name", "end_point_retention_policy_name_1"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_end_point_retention_policy.resolve_action", "inherit"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_igmp_snooping_policy.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_igmp_snooping_policy.annotations.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_igmp_snooping_policy.annotations.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_igmp_snooping_policy.annotations.#", "1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_igmp_snooping_policy.tags.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_igmp_snooping_policy.tags.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_igmp_snooping_policy.tags.#", "1"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_igmp_snooping_policy.igmp_snooping_policy_name", "igmp_snooping_policy_name_1"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_l3_outsides.0.annotation", "annotation_2"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_l3_outsides.0.annotations.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_l3_outsides.0.annotations.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_l3_outsides.0.annotations.#", "1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_l3_outsides.0.tags.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_l3_outsides.0.tags.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_l3_outsides.0.tags.#", "1"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_l3_outsides.0.l3_outside_name", "l3_outside_name_1"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_l3_outsides.#", "1"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_mld_snooping_policy.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_mld_snooping_policy.annotations.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_mld_snooping_policy.annotations.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_mld_snooping_policy.annotations.#", "1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_mld_snooping_policy.tags.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_mld_snooping_policy.tags.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_mld_snooping_policy.tags.#", "1"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_mld_snooping_policy.mld_snooping_policy_name", "mld_snooping_policy_name_1"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_neighbor_discovery_interface_policy.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_neighbor_discovery_interface_policy.annotations.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_neighbor_discovery_interface_policy.annotations.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_neighbor_discovery_interface_policy.annotations.#", "1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_neighbor_discovery_interface_policy.tags.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_neighbor_discovery_interface_policy.tags.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_neighbor_discovery_interface_policy.tags.#", "1"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_neighbor_discovery_interface_policy.neighbor_discovery_interface_policy_name", "neighbor_discovery_interface_policy_name_1"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_netflow_monitor_policies.0.annotation", "annotation_2"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_netflow_monitor_policies.0.annotations.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_netflow_monitor_policies.0.annotations.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_netflow_monitor_policies.0.annotations.#", "1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_netflow_monitor_policies.0.tags.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_netflow_monitor_policies.0.tags.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_netflow_monitor_policies.0.tags.#", "1"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_netflow_monitor_policies.0.filter_type", "ipv4"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_netflow_monitor_policies.0.netflow_monitor_policy_name", "netflow_monitor_policy_name_1"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_netflow_monitor_policies.#", "1"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_vrf.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_vrf.annotations.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_vrf.annotations.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_vrf.annotations.#", "1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_vrf.tags.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_vrf.tags.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_vrf.tags.#", "1"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_vrf.vrf_name", "vrf_name_1"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "rogue_coop_exceptions.0.annotation", "annotation_2"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "rogue_coop_exceptions.0.annotations.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "rogue_coop_exceptions.0.annotations.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "rogue_coop_exceptions.0.annotations.#", "1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "rogue_coop_exceptions.0.tags.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "rogue_coop_exceptions.0.tags.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "rogue_coop_exceptions.0.tags.#", "1"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "rogue_coop_exceptions.0.description", "description_2"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "rogue_coop_exceptions.0.mac", "00:00:00:00:00:01"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "rogue_coop_exceptions.0.name", "name_2"), @@ -519,6 +727,8 @@ func TestAccResourceFvBDWithFvTenant(t *testing.T) { knownvalue.MapExact( map[string]knownvalue.Check{ "annotation": knownvalue.Null(), + "annotations": knownvalue.Null(), + "tags": knownvalue.Null(), "description": knownvalue.Null(), "encapsulation": knownvalue.Null(), "name": knownvalue.Null(), @@ -533,6 +743,8 @@ func TestAccResourceFvBDWithFvTenant(t *testing.T) { knownvalue.MapExact( map[string]knownvalue.Check{ "annotation": knownvalue.Null(), + "annotations": knownvalue.Null(), + "tags": knownvalue.Null(), "dhcp_relay_policy_name": knownvalue.Null(), }, ), @@ -542,6 +754,8 @@ func TestAccResourceFvBDWithFvTenant(t *testing.T) { knownvalue.MapExact( map[string]knownvalue.Check{ "annotation": knownvalue.Null(), + "annotations": knownvalue.Null(), + "tags": knownvalue.Null(), "first_hop_security_policy_name": knownvalue.Null(), }, ), @@ -551,6 +765,8 @@ func TestAccResourceFvBDWithFvTenant(t *testing.T) { knownvalue.MapExact( map[string]knownvalue.Check{ "annotation": knownvalue.Null(), + "annotations": knownvalue.Null(), + "tags": knownvalue.Null(), "monitoring_policy_name": knownvalue.Null(), }, ), @@ -560,6 +776,8 @@ func TestAccResourceFvBDWithFvTenant(t *testing.T) { knownvalue.MapExact( map[string]knownvalue.Check{ "annotation": knownvalue.Null(), + "annotations": knownvalue.Null(), + "tags": knownvalue.Null(), "l3_outside_name": knownvalue.Null(), "route_control_profile_name": knownvalue.Null(), }, @@ -574,17 +792,27 @@ func TestAccResourceFvBDWithFvTenant(t *testing.T) { Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttr("aci_bridge_domain.test", "annotations.#", "0"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_end_point_retention_policy.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_end_point_retention_policy.annotations.#", "0"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_end_point_retention_policy.tags.#", "0"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_end_point_retention_policy.end_point_retention_policy_name", "end_point_retention_policy_name_1"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_end_point_retention_policy.resolve_action", "inherit"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_igmp_snooping_policy.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_igmp_snooping_policy.annotations.#", "0"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_igmp_snooping_policy.tags.#", "0"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_igmp_snooping_policy.igmp_snooping_policy_name", "igmp_snooping_policy_name_1"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_l3_outsides.#", "0"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_mld_snooping_policy.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_mld_snooping_policy.annotations.#", "0"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_mld_snooping_policy.tags.#", "0"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_mld_snooping_policy.mld_snooping_policy_name", "mld_snooping_policy_name_1"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_neighbor_discovery_interface_policy.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_neighbor_discovery_interface_policy.annotations.#", "0"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_neighbor_discovery_interface_policy.tags.#", "0"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_neighbor_discovery_interface_policy.neighbor_discovery_interface_policy_name", "neighbor_discovery_interface_policy_name_1"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_netflow_monitor_policies.#", "0"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_vrf.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_vrf.annotations.#", "0"), + resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_vrf.tags.#", "0"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_vrf.vrf_name", "vrf_name_1"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "rogue_coop_exceptions.#", "0"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "tags.#", "0"), @@ -595,6 +823,8 @@ func TestAccResourceFvBDWithFvTenant(t *testing.T) { knownvalue.MapExact( map[string]knownvalue.Check{ "annotation": knownvalue.Null(), + "annotations": knownvalue.Null(), + "tags": knownvalue.Null(), "description": knownvalue.Null(), "encapsulation": knownvalue.Null(), "name": knownvalue.Null(), @@ -609,6 +839,8 @@ func TestAccResourceFvBDWithFvTenant(t *testing.T) { knownvalue.MapExact( map[string]knownvalue.Check{ "annotation": knownvalue.Null(), + "annotations": knownvalue.Null(), + "tags": knownvalue.Null(), "dhcp_relay_policy_name": knownvalue.Null(), }, ), @@ -618,6 +850,8 @@ func TestAccResourceFvBDWithFvTenant(t *testing.T) { knownvalue.MapExact( map[string]knownvalue.Check{ "annotation": knownvalue.Null(), + "annotations": knownvalue.Null(), + "tags": knownvalue.Null(), "first_hop_security_policy_name": knownvalue.Null(), }, ), @@ -627,6 +861,8 @@ func TestAccResourceFvBDWithFvTenant(t *testing.T) { knownvalue.MapExact( map[string]knownvalue.Check{ "annotation": knownvalue.Null(), + "annotations": knownvalue.Null(), + "tags": knownvalue.Null(), "monitoring_policy_name": knownvalue.Null(), }, ), @@ -636,6 +872,8 @@ func TestAccResourceFvBDWithFvTenant(t *testing.T) { knownvalue.MapExact( map[string]knownvalue.Check{ "annotation": knownvalue.Null(), + "annotations": knownvalue.Null(), + "tags": knownvalue.Null(), "l3_outside_name": knownvalue.Null(), "route_control_profile_name": knownvalue.Null(), }, @@ -737,17 +975,37 @@ resource "aci_bridge_domain" "test" { parent_dn = aci_tenant.test.id name = "test_name" annotations = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] legacy_mode = { annotation = "annotation_1" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] description = "description_1" encapsulation = "vlan-100" name = "name_1" @@ -757,89 +1015,389 @@ resource "aci_bridge_domain" "test" { } relation_to_dhcp_relay_policy = { annotation = "annotation_1" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] dhcp_relay_policy_name = "dhcp_relay_policy_name_1" } relation_to_end_point_retention_policy = { annotation = "annotation_1" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] end_point_retention_policy_name = "end_point_retention_policy_name_1" resolve_action = "inherit" } relation_to_first_hop_security_policy = { annotation = "annotation_1" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] first_hop_security_policy_name = "first_hop_security_policy_name_1" } relation_to_igmp_snooping_policy = { annotation = "annotation_1" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] igmp_snooping_policy_name = "igmp_snooping_policy_name_1" } relation_to_l3_outsides = [ - { - annotation = "annotation_1" - l3_outside_name = "l3_outside_name_0" - }, - { - annotation = "annotation_2" - l3_outside_name = "l3_outside_name_1" - }, + { + annotation = "annotation_1" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + l3_outside_name = "l3_outside_name_0" + }, + { + annotation = "annotation_2" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + l3_outside_name = "l3_outside_name_1" + }, ] relation_to_mld_snooping_policy = { annotation = "annotation_1" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] mld_snooping_policy_name = "mld_snooping_policy_name_1" } relation_to_monitor_policy = { annotation = "annotation_1" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] monitoring_policy_name = "monitoring_policy_name_1" } relation_to_neighbor_discovery_interface_policy = { annotation = "annotation_1" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] neighbor_discovery_interface_policy_name = "neighbor_discovery_interface_policy_name_1" } relation_to_netflow_monitor_policies = [ - { - annotation = "annotation_1" - filter_type = "ce" - netflow_monitor_policy_name = "netflow_monitor_policy_name_0" - }, - { - annotation = "annotation_2" - filter_type = "ipv4" - netflow_monitor_policy_name = "netflow_monitor_policy_name_1" - }, + { + annotation = "annotation_1" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + filter_type = "ce" + netflow_monitor_policy_name = "netflow_monitor_policy_name_0" + }, + { + annotation = "annotation_2" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + filter_type = "ipv4" + netflow_monitor_policy_name = "netflow_monitor_policy_name_1" + }, ] relation_to_route_control_profile = { annotation = "annotation_1" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] l3_outside_name = "l3_outside_name_1" route_control_profile_name = "route_control_profile_name_1" } relation_to_vrf = { annotation = "annotation_1" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] vrf_name = "vrf_name_1" } rogue_coop_exceptions = [ - { - annotation = "annotation_1" - description = "description_1" - mac = "00:00:00:00:00:00" - name = "name_1" - name_alias = "name_alias_1" - }, - { - annotation = "annotation_2" - description = "description_2" - mac = "00:00:00:00:00:01" - name = "name_2" - name_alias = "name_alias_2" - }, + { + annotation = "annotation_1" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + description = "description_1" + mac = "00:00:00:00:00:00" + name = "name_1" + name_alias = "name_alias_1" + }, + { + annotation = "annotation_2" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + description = "description_2" + mac = "00:00:00:00:00:01" + name = "name_2" + name_alias = "name_alias_2" + }, ] tags = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] } ` @@ -863,25 +1421,142 @@ resource "aci_bridge_domain" "test" { ] legacy_mode = {} relation_to_dhcp_relay_policy = {} + relation_to_end_point_retention_policy = { + annotation = "annotation_1" + annotations = [ + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_1" + value = "test_value" + }, + ] + end_point_retention_policy_name = "end_point_retention_policy_name_1" + resolve_action = "inherit" + } relation_to_first_hop_security_policy = {} + relation_to_igmp_snooping_policy = { + annotation = "annotation_1" + annotations = [ + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_1" + value = "test_value" + }, + ] + igmp_snooping_policy_name = "igmp_snooping_policy_name_1" + } relation_to_l3_outsides = [ { annotation = "annotation_2" + annotations = [ + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_1" + value = "test_value" + }, + ] l3_outside_name = "l3_outside_name_1" }, ] + relation_to_mld_snooping_policy = { + annotation = "annotation_1" + annotations = [ + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_1" + value = "test_value" + }, + ] + mld_snooping_policy_name = "mld_snooping_policy_name_1" + } relation_to_monitor_policy = {} + relation_to_neighbor_discovery_interface_policy = { + annotation = "annotation_1" + annotations = [ + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_1" + value = "test_value" + }, + ] + neighbor_discovery_interface_policy_name = "neighbor_discovery_interface_policy_name_1" + } relation_to_netflow_monitor_policies = [ { annotation = "annotation_2" + annotations = [ + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_1" + value = "test_value" + }, + ] filter_type = "ipv4" netflow_monitor_policy_name = "netflow_monitor_policy_name_1" }, ] relation_to_route_control_profile = {} + relation_to_vrf = { + annotation = "annotation_1" + annotations = [ + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_1" + value = "test_value" + }, + ] + vrf_name = "vrf_name_1" + } rogue_coop_exceptions = [ { annotation = "annotation_2" + annotations = [ + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_1" + value = "test_value" + }, + ] description = "description_2" mac = "00:00:00:00:00:01" name = "name_2" @@ -904,11 +1579,42 @@ resource "aci_bridge_domain" "test" { annotations = [] legacy_mode = {} relation_to_dhcp_relay_policy = {} + relation_to_end_point_retention_policy = { + annotation = "annotation_1" + annotations = [] + tags = [] + end_point_retention_policy_name = "end_point_retention_policy_name_1" + resolve_action = "inherit" + } relation_to_first_hop_security_policy = {} + relation_to_igmp_snooping_policy = { + annotation = "annotation_1" + annotations = [] + tags = [] + igmp_snooping_policy_name = "igmp_snooping_policy_name_1" + } relation_to_l3_outsides = [] + relation_to_mld_snooping_policy = { + annotation = "annotation_1" + annotations = [] + tags = [] + mld_snooping_policy_name = "mld_snooping_policy_name_1" + } relation_to_monitor_policy = {} + relation_to_neighbor_discovery_interface_policy = { + annotation = "annotation_1" + annotations = [] + tags = [] + neighbor_discovery_interface_policy_name = "neighbor_discovery_interface_policy_name_1" + } relation_to_netflow_monitor_policies = [] relation_to_route_control_profile = {} + relation_to_vrf = { + annotation = "annotation_1" + annotations = [] + tags = [] + vrf_name = "vrf_name_1" + } rogue_coop_exceptions = [] tags = [] } diff --git a/internal/provider/resource_aci_certificate_authority.go b/internal/provider/resource_aci_certificate_authority.go index a5164e85b..c91022ef3 100644 --- a/internal/provider/resource_aci_certificate_authority.go +++ b/internal/provider/resource_aci_certificate_authority.go @@ -93,6 +93,13 @@ func getEmptyTagAnnotationPkiTPResourceModel() TagAnnotationPkiTPResourceModel { } } +var TagAnnotationPkiTPType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // TagTagPkiTPResourceModel describes the resource data model for the children without relation ships. type TagTagPkiTPResourceModel struct { Key types.String `tfsdk:"key"` @@ -106,6 +113,13 @@ func getEmptyTagTagPkiTPResourceModel() TagTagPkiTPResourceModel { } } +var TagTagPkiTPType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + type PkiTPIdentifier struct { Name types.String } @@ -486,7 +500,7 @@ func (r *PkiTPResource) ImportState(ctx context.Context, req resource.ImportStat } func getAndSetPkiTPAttributes(ctx context.Context, diags *diag.Diagnostics, client *client.Client, data *PkiTPResourceModel) { - requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=children&rsp-subtree-class=%s", data.Id.ValueString(), "pkiTP,tagAnnotation,tagTag"), "GET", nil) + requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=full&rsp-subtree-class=%s", data.Id.ValueString(), "pkiTP,tagAnnotation,tagTag"), "GET", nil) readData := getEmptyPkiTPResourceModel() @@ -541,6 +555,7 @@ func getAndSetPkiTPAttributes(ctx context.Context, diags *diag.Diagnostics, clie if childAttributeName == "value" { TagAnnotationPkiTP.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagAnnotationPkiTPList = append(TagAnnotationPkiTPList, TagAnnotationPkiTP) } @@ -553,6 +568,7 @@ func getAndSetPkiTPAttributes(ctx context.Context, diags *diag.Diagnostics, clie if childAttributeName == "value" { TagTagPkiTP.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagTagPkiTPList = append(TagTagPkiTPList, TagTagPkiTP) } @@ -621,25 +637,24 @@ func setPkiTPId(ctx context.Context, data *PkiTPResourceModel) { data.Id = types.StringValue(id) } -func getPkiTPTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *PkiTPResourceModel, tagAnnotationPlan, tagAnnotationState []TagAnnotationPkiTPResourceModel) []map[string]interface{} { - +func getPkiTPTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *PkiTPResourceModel, tagAnnotationPkiTPPlan, tagAnnotationPkiTPState []TagAnnotationPkiTPResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagAnnotation.IsUnknown() { + if !data.TagAnnotation.IsNull() && !data.TagAnnotation.IsUnknown() { tagAnnotationIdentifiers := []TagAnnotationIdentifier{} - for _, tagAnnotation := range tagAnnotationPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagAnnotation.Key.IsUnknown() && !tagAnnotation.Key.IsNull() { - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() + for _, tagAnnotationPkiTP := range tagAnnotationPkiTPPlan { + childMap := NewAciObject() + if !tagAnnotationPkiTP.Key.IsNull() && !tagAnnotationPkiTP.Key.IsUnknown() { + childMap.Attributes["key"] = tagAnnotationPkiTP.Key.ValueString() } - if !tagAnnotation.Value.IsUnknown() && !tagAnnotation.Value.IsNull() { - childMap["attributes"]["value"] = tagAnnotation.Value.ValueString() + if !tagAnnotationPkiTP.Value.IsNull() && !tagAnnotationPkiTP.Value.IsUnknown() { + childMap.Attributes["value"] = tagAnnotationPkiTP.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) tagAnnotationIdentifier := TagAnnotationIdentifier{} - tagAnnotationIdentifier.Key = tagAnnotation.Key + tagAnnotationIdentifier.Key = tagAnnotationPkiTP.Key tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) } - for _, tagAnnotation := range tagAnnotationState { + for _, tagAnnotation := range tagAnnotationPkiTPState { delete := true for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { if tagAnnotationIdentifier.Key == tagAnnotation.Key { @@ -648,10 +663,10 @@ func getPkiTPTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnos } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) + tagAnnotationChildMapForDelete := NewAciObject() + tagAnnotationChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationChildMapForDelete.Attributes["key"] = tagAnnotation.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": tagAnnotationChildMapForDelete}) } } } else { @@ -660,25 +675,25 @@ func getPkiTPTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnos return childPayloads } -func getPkiTPTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *PkiTPResourceModel, tagTagPlan, tagTagState []TagTagPkiTPResourceModel) []map[string]interface{} { +func getPkiTPTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *PkiTPResourceModel, tagTagPkiTPPlan, tagTagPkiTPState []TagTagPkiTPResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagTag.IsUnknown() { + if !data.TagTag.IsNull() && !data.TagTag.IsUnknown() { tagTagIdentifiers := []TagTagIdentifier{} - for _, tagTag := range tagTagPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagTag.Key.IsUnknown() && !tagTag.Key.IsNull() { - childMap["attributes"]["key"] = tagTag.Key.ValueString() + for _, tagTagPkiTP := range tagTagPkiTPPlan { + childMap := NewAciObject() + if !tagTagPkiTP.Key.IsNull() && !tagTagPkiTP.Key.IsUnknown() { + childMap.Attributes["key"] = tagTagPkiTP.Key.ValueString() } - if !tagTag.Value.IsUnknown() && !tagTag.Value.IsNull() { - childMap["attributes"]["value"] = tagTag.Value.ValueString() + if !tagTagPkiTP.Value.IsNull() && !tagTagPkiTP.Value.IsUnknown() { + childMap.Attributes["value"] = tagTagPkiTP.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) tagTagIdentifier := TagTagIdentifier{} - tagTagIdentifier.Key = tagTag.Key + tagTagIdentifier.Key = tagTagPkiTP.Key tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) } - for _, tagTag := range tagTagState { + for _, tagTag := range tagTagPkiTPState { delete := true for _, tagTagIdentifier := range tagTagIdentifiers { if tagTagIdentifier.Key == tagTag.Key { @@ -687,10 +702,10 @@ func getPkiTPTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, d } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagTag.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) + tagTagChildMapForDelete := NewAciObject() + tagTagChildMapForDelete.Attributes["status"] = "deleted" + tagTagChildMapForDelete.Attributes["key"] = tagTag.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagTag": tagTagChildMapForDelete}) } } } else { diff --git a/internal/provider/resource_aci_certificate_authority_test.go b/internal/provider/resource_aci_certificate_authority_test.go index 23bf511b3..80c4336a9 100644 --- a/internal/provider/resource_aci_certificate_authority_test.go +++ b/internal/provider/resource_aci_certificate_authority_test.go @@ -477,24 +477,24 @@ resource "aci_certificate_authority" "test" { certificate_chain = "-----BEGIN CERTIFICATE-----\nMIICODCCAaGgAwIBAgIJAIt8XMntue0VMA0GCSqGSIb3DQEBCwUAMDQxDjAMBgNV\nBAMMBUFkbWluMRUwEwYDVQQKDAxZb3VyIENvbXBhbnkxCzAJBgNVBAYTAlVTMCAX\nDTE4MDEwOTAwNTk0NFoYDzIxMTcxMjE2MDA1OTQ0WjA0MQ4wDAYDVQQDDAVBZG1p\nbjEVMBMGA1UECgwMWW91ciBDb21wYW55MQswCQYDVQQGEwJVUzCBnzANBgkqhkiG\n9w0BAQEFAAOBjQAwgYkCgYEAohG/7axtt7CbSaMP7r+2mhTKbNgh0Ww36C7Ta14i\nv+VmLyKkQHnXinKGhp6uy3Nug+15a+eIu7CrgpBVMQeCiWfsnwRocKcQJWIYDrWl\nXHxGQn31yYKR6mylE7Dcj3rMFybnyhezr5D8GcP85YRPmwG9H2hO/0Y1FUnWu9Iw\nAQkCAwEAAaNQME4wHQYDVR0OBBYEFD0jLXfpkrU/ChzRvfruRs/fy1VXMB8GA1Ud\nIwQYMBaAFD0jLXfpkrU/ChzRvfruRs/fy1VXMAwGA1UdEwQFMAMBAf8wDQYJKoZI\nhvcNAQELBQADgYEAOmvre+5tgZ0+F3DgsfxNQqLTrGiBgGCIymPkP/cBXXkNuJyl\n3ac7tArHQc7WEA4U2R2rZbEq8FC3UJJm4nUVtCPvEh3G9OhN2xwYev79yt6pIn/l\nKU0Td2OpVyo0eLqjoX5u2G90IBWzhyjFbo+CcKMrSVKj1YOdG0E3OuiJf00=\n-----END CERTIFICATE-----" name = "test_name" annotations = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] tags = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] } ` @@ -587,24 +587,24 @@ resource "aci_certificate_authority" "test" { certificate_chain = "-----BEGIN CERTIFICATE-----\nMIICODCCAaGgAwIBAgIJAIt8XMntue0VMA0GCSqGSIb3DQEBCwUAMDQxDjAMBgNV\nBAMMBUFkbWluMRUwEwYDVQQKDAxZb3VyIENvbXBhbnkxCzAJBgNVBAYTAlVTMCAX\nDTE4MDEwOTAwNTk0NFoYDzIxMTcxMjE2MDA1OTQ0WjA0MQ4wDAYDVQQDDAVBZG1p\nbjEVMBMGA1UECgwMWW91ciBDb21wYW55MQswCQYDVQQGEwJVUzCBnzANBgkqhkiG\n9w0BAQEFAAOBjQAwgYkCgYEAohG/7axtt7CbSaMP7r+2mhTKbNgh0Ww36C7Ta14i\nv+VmLyKkQHnXinKGhp6uy3Nug+15a+eIu7CrgpBVMQeCiWfsnwRocKcQJWIYDrWl\nXHxGQn31yYKR6mylE7Dcj3rMFybnyhezr5D8GcP85YRPmwG9H2hO/0Y1FUnWu9Iw\nAQkCAwEAAaNQME4wHQYDVR0OBBYEFD0jLXfpkrU/ChzRvfruRs/fy1VXMB8GA1Ud\nIwQYMBaAFD0jLXfpkrU/ChzRvfruRs/fy1VXMAwGA1UdEwQFMAMBAf8wDQYJKoZI\nhvcNAQELBQADgYEAOmvre+5tgZ0+F3DgsfxNQqLTrGiBgGCIymPkP/cBXXkNuJyl\n3ac7tArHQc7WEA4U2R2rZbEq8FC3UJJm4nUVtCPvEh3G9OhN2xwYev79yt6pIn/l\nKU0Td2OpVyo0eLqjoX5u2G90IBWzhyjFbo+CcKMrSVKj1YOdG0E3OuiJf00=\n-----END CERTIFICATE-----" name = "test_name" annotations = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] tags = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] } ` diff --git a/internal/provider/resource_aci_custom_qos_policy.go b/internal/provider/resource_aci_custom_qos_policy.go index e68c065bd..67eba93aa 100644 --- a/internal/provider/resource_aci_custom_qos_policy.go +++ b/internal/provider/resource_aci_custom_qos_policy.go @@ -90,6 +90,13 @@ func getEmptyTagAnnotationQosCustomPolResourceModel() TagAnnotationQosCustomPolR } } +var TagAnnotationQosCustomPolType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // TagTagQosCustomPolResourceModel describes the resource data model for the children without relation ships. type TagTagQosCustomPolResourceModel struct { Key types.String `tfsdk:"key"` @@ -103,6 +110,13 @@ func getEmptyTagTagQosCustomPolResourceModel() TagTagQosCustomPolResourceModel { } } +var TagTagQosCustomPolType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + type QosCustomPolIdentifier struct { Name types.String } @@ -452,7 +466,7 @@ func (r *QosCustomPolResource) ImportState(ctx context.Context, req resource.Imp } func getAndSetQosCustomPolAttributes(ctx context.Context, diags *diag.Diagnostics, client *client.Client, data *QosCustomPolResourceModel) { - requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=children&rsp-subtree-class=%s", data.Id.ValueString(), "qosCustomPol,tagAnnotation,tagTag"), "GET", nil) + requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=full&rsp-subtree-class=%s", data.Id.ValueString(), "qosCustomPol,tagAnnotation,tagTag"), "GET", nil) readData := getEmptyQosCustomPolResourceModel() @@ -504,6 +518,7 @@ func getAndSetQosCustomPolAttributes(ctx context.Context, diags *diag.Diagnostic if childAttributeName == "value" { TagAnnotationQosCustomPol.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagAnnotationQosCustomPolList = append(TagAnnotationQosCustomPolList, TagAnnotationQosCustomPol) } @@ -516,6 +531,7 @@ func getAndSetQosCustomPolAttributes(ctx context.Context, diags *diag.Diagnostic if childAttributeName == "value" { TagTagQosCustomPol.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagTagQosCustomPolList = append(TagTagQosCustomPolList, TagTagQosCustomPol) } @@ -563,25 +579,24 @@ func setQosCustomPolId(ctx context.Context, data *QosCustomPolResourceModel) { data.Id = types.StringValue(fmt.Sprintf("%s/%s", data.ParentDn.ValueString(), rn)) } -func getQosCustomPolTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *QosCustomPolResourceModel, tagAnnotationPlan, tagAnnotationState []TagAnnotationQosCustomPolResourceModel) []map[string]interface{} { - +func getQosCustomPolTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *QosCustomPolResourceModel, tagAnnotationQosCustomPolPlan, tagAnnotationQosCustomPolState []TagAnnotationQosCustomPolResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagAnnotation.IsUnknown() { + if !data.TagAnnotation.IsNull() && !data.TagAnnotation.IsUnknown() { tagAnnotationIdentifiers := []TagAnnotationIdentifier{} - for _, tagAnnotation := range tagAnnotationPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagAnnotation.Key.IsUnknown() && !tagAnnotation.Key.IsNull() { - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() + for _, tagAnnotationQosCustomPol := range tagAnnotationQosCustomPolPlan { + childMap := NewAciObject() + if !tagAnnotationQosCustomPol.Key.IsNull() && !tagAnnotationQosCustomPol.Key.IsUnknown() { + childMap.Attributes["key"] = tagAnnotationQosCustomPol.Key.ValueString() } - if !tagAnnotation.Value.IsUnknown() && !tagAnnotation.Value.IsNull() { - childMap["attributes"]["value"] = tagAnnotation.Value.ValueString() + if !tagAnnotationQosCustomPol.Value.IsNull() && !tagAnnotationQosCustomPol.Value.IsUnknown() { + childMap.Attributes["value"] = tagAnnotationQosCustomPol.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) tagAnnotationIdentifier := TagAnnotationIdentifier{} - tagAnnotationIdentifier.Key = tagAnnotation.Key + tagAnnotationIdentifier.Key = tagAnnotationQosCustomPol.Key tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) } - for _, tagAnnotation := range tagAnnotationState { + for _, tagAnnotation := range tagAnnotationQosCustomPolState { delete := true for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { if tagAnnotationIdentifier.Key == tagAnnotation.Key { @@ -590,10 +605,10 @@ func getQosCustomPolTagAnnotationChildPayloads(ctx context.Context, diags *diag. } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) + tagAnnotationChildMapForDelete := NewAciObject() + tagAnnotationChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationChildMapForDelete.Attributes["key"] = tagAnnotation.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": tagAnnotationChildMapForDelete}) } } } else { @@ -602,25 +617,25 @@ func getQosCustomPolTagAnnotationChildPayloads(ctx context.Context, diags *diag. return childPayloads } -func getQosCustomPolTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *QosCustomPolResourceModel, tagTagPlan, tagTagState []TagTagQosCustomPolResourceModel) []map[string]interface{} { +func getQosCustomPolTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *QosCustomPolResourceModel, tagTagQosCustomPolPlan, tagTagQosCustomPolState []TagTagQosCustomPolResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagTag.IsUnknown() { + if !data.TagTag.IsNull() && !data.TagTag.IsUnknown() { tagTagIdentifiers := []TagTagIdentifier{} - for _, tagTag := range tagTagPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagTag.Key.IsUnknown() && !tagTag.Key.IsNull() { - childMap["attributes"]["key"] = tagTag.Key.ValueString() + for _, tagTagQosCustomPol := range tagTagQosCustomPolPlan { + childMap := NewAciObject() + if !tagTagQosCustomPol.Key.IsNull() && !tagTagQosCustomPol.Key.IsUnknown() { + childMap.Attributes["key"] = tagTagQosCustomPol.Key.ValueString() } - if !tagTag.Value.IsUnknown() && !tagTag.Value.IsNull() { - childMap["attributes"]["value"] = tagTag.Value.ValueString() + if !tagTagQosCustomPol.Value.IsNull() && !tagTagQosCustomPol.Value.IsUnknown() { + childMap.Attributes["value"] = tagTagQosCustomPol.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) tagTagIdentifier := TagTagIdentifier{} - tagTagIdentifier.Key = tagTag.Key + tagTagIdentifier.Key = tagTagQosCustomPol.Key tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) } - for _, tagTag := range tagTagState { + for _, tagTag := range tagTagQosCustomPolState { delete := true for _, tagTagIdentifier := range tagTagIdentifiers { if tagTagIdentifier.Key == tagTag.Key { @@ -629,10 +644,10 @@ func getQosCustomPolTagTagChildPayloads(ctx context.Context, diags *diag.Diagnos } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagTag.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) + tagTagChildMapForDelete := NewAciObject() + tagTagChildMapForDelete.Attributes["status"] = "deleted" + tagTagChildMapForDelete.Attributes["key"] = tagTag.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagTag": tagTagChildMapForDelete}) } } } else { diff --git a/internal/provider/resource_aci_custom_qos_policy_test.go b/internal/provider/resource_aci_custom_qos_policy_test.go index 791188ba0..b0e384336 100644 --- a/internal/provider/resource_aci_custom_qos_policy_test.go +++ b/internal/provider/resource_aci_custom_qos_policy_test.go @@ -259,24 +259,24 @@ resource "aci_custom_qos_policy" "test" { parent_dn = aci_tenant.test.id name = "test_name" annotations = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] tags = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] } ` diff --git a/internal/provider/resource_aci_data_plane_policing_policy.go b/internal/provider/resource_aci_data_plane_policing_policy.go index 9ec05062e..5349561f6 100644 --- a/internal/provider/resource_aci_data_plane_policing_policy.go +++ b/internal/provider/resource_aci_data_plane_policing_policy.go @@ -136,6 +136,13 @@ func getEmptyTagAnnotationQosDppPolResourceModel() TagAnnotationQosDppPolResourc } } +var TagAnnotationQosDppPolType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // TagTagQosDppPolResourceModel describes the resource data model for the children without relation ships. type TagTagQosDppPolResourceModel struct { Key types.String `tfsdk:"key"` @@ -149,6 +156,13 @@ func getEmptyTagTagQosDppPolResourceModel() TagTagQosDppPolResourceModel { } } +var TagTagQosDppPolType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + type QosDppPolIdentifier struct { Name types.String } @@ -778,7 +792,7 @@ func (r *QosDppPolResource) ImportState(ctx context.Context, req resource.Import } func getAndSetQosDppPolAttributes(ctx context.Context, diags *diag.Diagnostics, client *client.Client, data *QosDppPolResourceModel) { - requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=children&rsp-subtree-class=%s", data.Id.ValueString(), "qosDppPol,tagAnnotation,tagTag"), "GET", nil) + requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=full&rsp-subtree-class=%s", data.Id.ValueString(), "qosDppPol,tagAnnotation,tagTag"), "GET", nil) readData := getEmptyQosDppPolResourceModel() @@ -893,6 +907,7 @@ func getAndSetQosDppPolAttributes(ctx context.Context, diags *diag.Diagnostics, if childAttributeName == "value" { TagAnnotationQosDppPol.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagAnnotationQosDppPolList = append(TagAnnotationQosDppPolList, TagAnnotationQosDppPol) } @@ -905,6 +920,7 @@ func getAndSetQosDppPolAttributes(ctx context.Context, diags *diag.Diagnostics, if childAttributeName == "value" { TagTagQosDppPol.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagTagQosDppPolList = append(TagTagQosDppPolList, TagTagQosDppPol) } @@ -952,25 +968,24 @@ func setQosDppPolId(ctx context.Context, data *QosDppPolResourceModel) { data.Id = types.StringValue(fmt.Sprintf("%s/%s", data.ParentDn.ValueString(), rn)) } -func getQosDppPolTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *QosDppPolResourceModel, tagAnnotationPlan, tagAnnotationState []TagAnnotationQosDppPolResourceModel) []map[string]interface{} { - +func getQosDppPolTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *QosDppPolResourceModel, tagAnnotationQosDppPolPlan, tagAnnotationQosDppPolState []TagAnnotationQosDppPolResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagAnnotation.IsUnknown() { + if !data.TagAnnotation.IsNull() && !data.TagAnnotation.IsUnknown() { tagAnnotationIdentifiers := []TagAnnotationIdentifier{} - for _, tagAnnotation := range tagAnnotationPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagAnnotation.Key.IsUnknown() && !tagAnnotation.Key.IsNull() { - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() + for _, tagAnnotationQosDppPol := range tagAnnotationQosDppPolPlan { + childMap := NewAciObject() + if !tagAnnotationQosDppPol.Key.IsNull() && !tagAnnotationQosDppPol.Key.IsUnknown() { + childMap.Attributes["key"] = tagAnnotationQosDppPol.Key.ValueString() } - if !tagAnnotation.Value.IsUnknown() && !tagAnnotation.Value.IsNull() { - childMap["attributes"]["value"] = tagAnnotation.Value.ValueString() + if !tagAnnotationQosDppPol.Value.IsNull() && !tagAnnotationQosDppPol.Value.IsUnknown() { + childMap.Attributes["value"] = tagAnnotationQosDppPol.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) tagAnnotationIdentifier := TagAnnotationIdentifier{} - tagAnnotationIdentifier.Key = tagAnnotation.Key + tagAnnotationIdentifier.Key = tagAnnotationQosDppPol.Key tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) } - for _, tagAnnotation := range tagAnnotationState { + for _, tagAnnotation := range tagAnnotationQosDppPolState { delete := true for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { if tagAnnotationIdentifier.Key == tagAnnotation.Key { @@ -979,10 +994,10 @@ func getQosDppPolTagAnnotationChildPayloads(ctx context.Context, diags *diag.Dia } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) + tagAnnotationChildMapForDelete := NewAciObject() + tagAnnotationChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationChildMapForDelete.Attributes["key"] = tagAnnotation.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": tagAnnotationChildMapForDelete}) } } } else { @@ -991,25 +1006,25 @@ func getQosDppPolTagAnnotationChildPayloads(ctx context.Context, diags *diag.Dia return childPayloads } -func getQosDppPolTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *QosDppPolResourceModel, tagTagPlan, tagTagState []TagTagQosDppPolResourceModel) []map[string]interface{} { +func getQosDppPolTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *QosDppPolResourceModel, tagTagQosDppPolPlan, tagTagQosDppPolState []TagTagQosDppPolResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagTag.IsUnknown() { + if !data.TagTag.IsNull() && !data.TagTag.IsUnknown() { tagTagIdentifiers := []TagTagIdentifier{} - for _, tagTag := range tagTagPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagTag.Key.IsUnknown() && !tagTag.Key.IsNull() { - childMap["attributes"]["key"] = tagTag.Key.ValueString() + for _, tagTagQosDppPol := range tagTagQosDppPolPlan { + childMap := NewAciObject() + if !tagTagQosDppPol.Key.IsNull() && !tagTagQosDppPol.Key.IsUnknown() { + childMap.Attributes["key"] = tagTagQosDppPol.Key.ValueString() } - if !tagTag.Value.IsUnknown() && !tagTag.Value.IsNull() { - childMap["attributes"]["value"] = tagTag.Value.ValueString() + if !tagTagQosDppPol.Value.IsNull() && !tagTagQosDppPol.Value.IsUnknown() { + childMap.Attributes["value"] = tagTagQosDppPol.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) tagTagIdentifier := TagTagIdentifier{} - tagTagIdentifier.Key = tagTag.Key + tagTagIdentifier.Key = tagTagQosDppPol.Key tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) } - for _, tagTag := range tagTagState { + for _, tagTag := range tagTagQosDppPolState { delete := true for _, tagTagIdentifier := range tagTagIdentifiers { if tagTagIdentifier.Key == tagTag.Key { @@ -1018,10 +1033,10 @@ func getQosDppPolTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostic } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagTag.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) + tagTagChildMapForDelete := NewAciObject() + tagTagChildMapForDelete.Attributes["status"] = "deleted" + tagTagChildMapForDelete.Attributes["key"] = tagTag.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagTag": tagTagChildMapForDelete}) } } } else { diff --git a/internal/provider/resource_aci_data_plane_policing_policy_test.go b/internal/provider/resource_aci_data_plane_policing_policy_test.go index 47210cb0e..555826734 100644 --- a/internal/provider/resource_aci_data_plane_policing_policy_test.go +++ b/internal/provider/resource_aci_data_plane_policing_policy_test.go @@ -485,24 +485,24 @@ resource "aci_data_plane_policing_policy" "test" { parent_dn = aci_tenant.test.id name = "test_name" annotations = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] tags = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] } ` diff --git a/internal/provider/resource_aci_endpoint_security_group.go b/internal/provider/resource_aci_endpoint_security_group.go index 508a3c3cc..3279aa9f6 100644 --- a/internal/provider/resource_aci_endpoint_security_group.go +++ b/internal/provider/resource_aci_endpoint_security_group.go @@ -99,6 +99,8 @@ func getEmptyFvESgResourceModel() *FvESgResourceModel { "annotation": types.StringType, "priority": types.StringType, "contract_name": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvRsConsFvESgType}, + "tags": types.SetType{ElemType: TagTagFvRsConsFvESgType}, }, }), FvRsConsIf: types.SetNull(types.ObjectType{ @@ -106,12 +108,16 @@ func getEmptyFvESgResourceModel() *FvESgResourceModel { "annotation": types.StringType, "priority": types.StringType, "imported_contract_name": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvRsConsIfFvESgType}, + "tags": types.SetType{ElemType: TagTagFvRsConsIfFvESgType}, }, }), FvRsIntraEpg: types.SetNull(types.ObjectType{ AttrTypes: map[string]attr.Type{ "annotation": types.StringType, "contract_name": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvRsIntraEpgFvESgType}, + "tags": types.SetType{ElemType: TagTagFvRsIntraEpgFvESgType}, }, }), FvRsProv: types.SetNull(types.ObjectType{ @@ -120,16 +126,22 @@ func getEmptyFvESgResourceModel() *FvESgResourceModel { "match_criteria": types.StringType, "priority": types.StringType, "contract_name": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvRsProvFvESgType}, + "tags": types.SetType{ElemType: TagTagFvRsProvFvESgType}, }, }), FvRsScope: types.ObjectNull(map[string]attr.Type{ - "annotation": types.StringType, - "vrf_name": types.StringType, + "annotation": types.StringType, + "vrf_name": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvRsScopeFvESgType}, + "tags": types.SetType{ElemType: TagTagFvRsScopeFvESgType}, }), FvRsSecInherited: types.SetNull(types.ObjectType{ AttrTypes: map[string]attr.Type{ - "annotation": types.StringType, - "target_dn": types.StringType, + "annotation": types.StringType, + "target_dn": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvRsSecInheritedFvESgType}, + "tags": types.SetType{ElemType: TagTagFvRsSecInheritedFvESgType}, }, }), TagAnnotation: types.SetNull(types.ObjectType{ @@ -161,9 +173,11 @@ func getEmptyFvESgResourceModel() *FvESgResourceModel { // FvRsConsFvESgResourceModel describes the resource data model for the children without relation ships. type FvRsConsFvESgResourceModel struct { - Annotation types.String `tfsdk:"annotation"` - Prio customTypes.FvRsConsPrioStringValue `tfsdk:"priority"` - TnVzBrCPName types.String `tfsdk:"contract_name"` + Annotation types.String `tfsdk:"annotation"` + Prio customTypes.FvRsConsPrioStringValue `tfsdk:"priority"` + TnVzBrCPName types.String `tfsdk:"contract_name"` + TagAnnotation types.Set `tfsdk:"annotations"` + TagTag types.Set `tfsdk:"tags"` } func getEmptyFvRsConsFvESgResourceModel() FvRsConsFvESgResourceModel { @@ -171,14 +185,78 @@ func getEmptyFvRsConsFvESgResourceModel() FvRsConsFvESgResourceModel { Annotation: basetypes.NewStringNull(), Prio: customTypes.NewFvRsConsPrioStringNull(), TnVzBrCPName: basetypes.NewStringNull(), + TagAnnotation: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), } } +var FvRsConsFvESgType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "annotation": types.StringType, + "priority": types.StringType, + "contract_name": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvRsConsFvESgType}, + "tags": types.SetType{ElemType: TagTagFvRsConsFvESgType}, + }, +} + +// TagAnnotationFvRsConsFvESgResourceModel describes the resource data model for the children without relation ships. +type TagAnnotationFvRsConsFvESgResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagAnnotationFvRsConsFvESgResourceModel() TagAnnotationFvRsConsFvESgResourceModel { + return TagAnnotationFvRsConsFvESgResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagAnnotationFvRsConsFvESgType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + +// TagTagFvRsConsFvESgResourceModel describes the resource data model for the children without relation ships. +type TagTagFvRsConsFvESgResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagTagFvRsConsFvESgResourceModel() TagTagFvRsConsFvESgResourceModel { + return TagTagFvRsConsFvESgResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagTagFvRsConsFvESgType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // FvRsConsIfFvESgResourceModel describes the resource data model for the children without relation ships. type FvRsConsIfFvESgResourceModel struct { - Annotation types.String `tfsdk:"annotation"` - Prio customTypes.FvRsConsIfPrioStringValue `tfsdk:"priority"` - TnVzCPIfName types.String `tfsdk:"imported_contract_name"` + Annotation types.String `tfsdk:"annotation"` + Prio customTypes.FvRsConsIfPrioStringValue `tfsdk:"priority"` + TnVzCPIfName types.String `tfsdk:"imported_contract_name"` + TagAnnotation types.Set `tfsdk:"annotations"` + TagTag types.Set `tfsdk:"tags"` } func getEmptyFvRsConsIfFvESgResourceModel() FvRsConsIfFvESgResourceModel { @@ -186,28 +264,155 @@ func getEmptyFvRsConsIfFvESgResourceModel() FvRsConsIfFvESgResourceModel { Annotation: basetypes.NewStringNull(), Prio: customTypes.NewFvRsConsIfPrioStringNull(), TnVzCPIfName: basetypes.NewStringNull(), + TagAnnotation: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), } } +var FvRsConsIfFvESgType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "annotation": types.StringType, + "priority": types.StringType, + "imported_contract_name": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvRsConsIfFvESgType}, + "tags": types.SetType{ElemType: TagTagFvRsConsIfFvESgType}, + }, +} + +// TagAnnotationFvRsConsIfFvESgResourceModel describes the resource data model for the children without relation ships. +type TagAnnotationFvRsConsIfFvESgResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagAnnotationFvRsConsIfFvESgResourceModel() TagAnnotationFvRsConsIfFvESgResourceModel { + return TagAnnotationFvRsConsIfFvESgResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagAnnotationFvRsConsIfFvESgType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + +// TagTagFvRsConsIfFvESgResourceModel describes the resource data model for the children without relation ships. +type TagTagFvRsConsIfFvESgResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagTagFvRsConsIfFvESgResourceModel() TagTagFvRsConsIfFvESgResourceModel { + return TagTagFvRsConsIfFvESgResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagTagFvRsConsIfFvESgType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // FvRsIntraEpgFvESgResourceModel describes the resource data model for the children without relation ships. type FvRsIntraEpgFvESgResourceModel struct { - Annotation types.String `tfsdk:"annotation"` - TnVzBrCPName types.String `tfsdk:"contract_name"` + Annotation types.String `tfsdk:"annotation"` + TnVzBrCPName types.String `tfsdk:"contract_name"` + TagAnnotation types.Set `tfsdk:"annotations"` + TagTag types.Set `tfsdk:"tags"` } func getEmptyFvRsIntraEpgFvESgResourceModel() FvRsIntraEpgFvESgResourceModel { return FvRsIntraEpgFvESgResourceModel{ Annotation: basetypes.NewStringNull(), TnVzBrCPName: basetypes.NewStringNull(), + TagAnnotation: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + } +} + +var FvRsIntraEpgFvESgType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "annotation": types.StringType, + "contract_name": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvRsIntraEpgFvESgType}, + "tags": types.SetType{ElemType: TagTagFvRsIntraEpgFvESgType}, + }, +} + +// TagAnnotationFvRsIntraEpgFvESgResourceModel describes the resource data model for the children without relation ships. +type TagAnnotationFvRsIntraEpgFvESgResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagAnnotationFvRsIntraEpgFvESgResourceModel() TagAnnotationFvRsIntraEpgFvESgResourceModel { + return TagAnnotationFvRsIntraEpgFvESgResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagAnnotationFvRsIntraEpgFvESgType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + +// TagTagFvRsIntraEpgFvESgResourceModel describes the resource data model for the children without relation ships. +type TagTagFvRsIntraEpgFvESgResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagTagFvRsIntraEpgFvESgResourceModel() TagTagFvRsIntraEpgFvESgResourceModel { + return TagTagFvRsIntraEpgFvESgResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), } } +var TagTagFvRsIntraEpgFvESgType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // FvRsProvFvESgResourceModel describes the resource data model for the children without relation ships. type FvRsProvFvESgResourceModel struct { - Annotation types.String `tfsdk:"annotation"` - MatchT types.String `tfsdk:"match_criteria"` - Prio customTypes.FvRsProvPrioStringValue `tfsdk:"priority"` - TnVzBrCPName types.String `tfsdk:"contract_name"` + Annotation types.String `tfsdk:"annotation"` + MatchT types.String `tfsdk:"match_criteria"` + Prio customTypes.FvRsProvPrioStringValue `tfsdk:"priority"` + TnVzBrCPName types.String `tfsdk:"contract_name"` + TagAnnotation types.Set `tfsdk:"annotations"` + TagTag types.Set `tfsdk:"tags"` } func getEmptyFvRsProvFvESgResourceModel() FvRsProvFvESgResourceModel { @@ -216,40 +421,222 @@ func getEmptyFvRsProvFvESgResourceModel() FvRsProvFvESgResourceModel { MatchT: basetypes.NewStringNull(), Prio: customTypes.NewFvRsProvPrioStringNull(), TnVzBrCPName: basetypes.NewStringNull(), + TagAnnotation: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), } } +var FvRsProvFvESgType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "annotation": types.StringType, + "match_criteria": types.StringType, + "priority": types.StringType, + "contract_name": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvRsProvFvESgType}, + "tags": types.SetType{ElemType: TagTagFvRsProvFvESgType}, + }, +} + +// TagAnnotationFvRsProvFvESgResourceModel describes the resource data model for the children without relation ships. +type TagAnnotationFvRsProvFvESgResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagAnnotationFvRsProvFvESgResourceModel() TagAnnotationFvRsProvFvESgResourceModel { + return TagAnnotationFvRsProvFvESgResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagAnnotationFvRsProvFvESgType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + +// TagTagFvRsProvFvESgResourceModel describes the resource data model for the children without relation ships. +type TagTagFvRsProvFvESgResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagTagFvRsProvFvESgResourceModel() TagTagFvRsProvFvESgResourceModel { + return TagTagFvRsProvFvESgResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagTagFvRsProvFvESgType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // FvRsScopeFvESgResourceModel describes the resource data model for the children without relation ships. type FvRsScopeFvESgResourceModel struct { - Annotation types.String `tfsdk:"annotation"` - TnFvCtxName types.String `tfsdk:"vrf_name"` + Annotation types.String `tfsdk:"annotation"` + TnFvCtxName types.String `tfsdk:"vrf_name"` + TagAnnotation types.Set `tfsdk:"annotations"` + TagTag types.Set `tfsdk:"tags"` } func getEmptyFvRsScopeFvESgResourceModel() FvRsScopeFvESgResourceModel { return FvRsScopeFvESgResourceModel{ Annotation: basetypes.NewStringNull(), TnFvCtxName: basetypes.NewStringNull(), + TagAnnotation: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), } } var FvRsScopeFvESgType = map[string]attr.Type{ - "annotation": types.StringType, - "vrf_name": types.StringType, + "annotation": types.StringType, + "vrf_name": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvRsScopeFvESgType}, + "tags": types.SetType{ElemType: TagTagFvRsScopeFvESgType}, +} + +// TagAnnotationFvRsScopeFvESgResourceModel describes the resource data model for the children without relation ships. +type TagAnnotationFvRsScopeFvESgResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagAnnotationFvRsScopeFvESgResourceModel() TagAnnotationFvRsScopeFvESgResourceModel { + return TagAnnotationFvRsScopeFvESgResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagAnnotationFvRsScopeFvESgType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + +// TagTagFvRsScopeFvESgResourceModel describes the resource data model for the children without relation ships. +type TagTagFvRsScopeFvESgResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagTagFvRsScopeFvESgResourceModel() TagTagFvRsScopeFvESgResourceModel { + return TagTagFvRsScopeFvESgResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagTagFvRsScopeFvESgType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, } // FvRsSecInheritedFvESgResourceModel describes the resource data model for the children without relation ships. type FvRsSecInheritedFvESgResourceModel struct { - Annotation types.String `tfsdk:"annotation"` - TDn types.String `tfsdk:"target_dn"` + Annotation types.String `tfsdk:"annotation"` + TDn types.String `tfsdk:"target_dn"` + TagAnnotation types.Set `tfsdk:"annotations"` + TagTag types.Set `tfsdk:"tags"` } func getEmptyFvRsSecInheritedFvESgResourceModel() FvRsSecInheritedFvESgResourceModel { return FvRsSecInheritedFvESgResourceModel{ Annotation: basetypes.NewStringNull(), TDn: basetypes.NewStringNull(), + TagAnnotation: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + } +} + +var FvRsSecInheritedFvESgType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "annotation": types.StringType, + "target_dn": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvRsSecInheritedFvESgType}, + "tags": types.SetType{ElemType: TagTagFvRsSecInheritedFvESgType}, + }, +} + +// TagAnnotationFvRsSecInheritedFvESgResourceModel describes the resource data model for the children without relation ships. +type TagAnnotationFvRsSecInheritedFvESgResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagAnnotationFvRsSecInheritedFvESgResourceModel() TagAnnotationFvRsSecInheritedFvESgResourceModel { + return TagAnnotationFvRsSecInheritedFvESgResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagAnnotationFvRsSecInheritedFvESgType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + +// TagTagFvRsSecInheritedFvESgResourceModel describes the resource data model for the children without relation ships. +type TagTagFvRsSecInheritedFvESgResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagTagFvRsSecInheritedFvESgResourceModel() TagTagFvRsSecInheritedFvESgResourceModel { + return TagTagFvRsSecInheritedFvESgResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), } } +var TagTagFvRsSecInheritedFvESgType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // TagAnnotationFvESgResourceModel describes the resource data model for the children without relation ships. type TagAnnotationFvESgResourceModel struct { Key types.String `tfsdk:"key"` @@ -263,6 +650,13 @@ func getEmptyTagAnnotationFvESgResourceModel() TagAnnotationFvESgResourceModel { } } +var TagAnnotationFvESgType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // TagTagFvESgResourceModel describes the resource data model for the children without relation ships. type TagTagFvESgResourceModel struct { Key types.String `tfsdk:"key"` @@ -276,6 +670,13 @@ func getEmptyTagTagFvESgResourceModel() TagTagFvESgResourceModel { } } +var TagTagFvESgType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + type FvESgIdentifier struct { Name types.String } @@ -512,17 +913,22 @@ func (r *FvESgResource) UpgradeState(ctx context.Context) map[int64]resource.Sta Annotation: basetypes.NewStringNull(), Prio: customTypes.FvRsConsPrioStringValue{StringValue: priorStateDataFvRsCons.Prio}, TnVzBrCPName: priorStateDataFvRsCons.TargetDn, + TagAnnotation: basetypes.NewSetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: basetypes.NewSetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), } FvRsConsList = append(FvRsConsList, FvRsCons) } - FvRsConsType := types.ObjectType{ - AttrTypes: map[string]attr.Type{ - "annotation": basetypes.StringType{}, - "priority": basetypes.StringType{}, - "contract_name": basetypes.StringType{}, - }, - } - FvRsConsSet, _ := types.SetValueFrom(ctx, FvRsConsType, FvRsConsList) + FvRsConsSet, _ := types.SetValueFrom(ctx, FvRsConsFvESgType, FvRsConsList) upgradedStateData.FvRsCons = FvRsConsSet FvRsConsIfList := make([]FvRsConsIfFvESgResourceModel, 0) @@ -533,17 +939,22 @@ func (r *FvESgResource) UpgradeState(ctx context.Context) map[int64]resource.Sta Annotation: basetypes.NewStringNull(), Prio: customTypes.FvRsConsIfPrioStringValue{StringValue: priorStateDataFvRsConsIf.Prio}, TnVzCPIfName: priorStateDataFvRsConsIf.TargetDn, + TagAnnotation: basetypes.NewSetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: basetypes.NewSetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), } FvRsConsIfList = append(FvRsConsIfList, FvRsConsIf) } - FvRsConsIfType := types.ObjectType{ - AttrTypes: map[string]attr.Type{ - "annotation": basetypes.StringType{}, - "priority": basetypes.StringType{}, - "imported_contract_name": basetypes.StringType{}, - }, - } - FvRsConsIfSet, _ := types.SetValueFrom(ctx, FvRsConsIfType, FvRsConsIfList) + FvRsConsIfSet, _ := types.SetValueFrom(ctx, FvRsConsIfFvESgType, FvRsConsIfList) upgradedStateData.FvRsConsIf = FvRsConsIfSet FvRsIntraEpgList := make([]FvRsIntraEpgFvESgResourceModel, 0) @@ -553,16 +964,22 @@ func (r *FvESgResource) UpgradeState(ctx context.Context) map[int64]resource.Sta FvRsIntraEpg := FvRsIntraEpgFvESgResourceModel{ Annotation: basetypes.NewStringNull(), TnVzBrCPName: basetypes.NewStringValue(GetMOName(priorStateDataFvRsIntraEpg)), + TagAnnotation: basetypes.NewSetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: basetypes.NewSetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), } FvRsIntraEpgList = append(FvRsIntraEpgList, FvRsIntraEpg) } - FvRsIntraEpgType := types.ObjectType{ - AttrTypes: map[string]attr.Type{ - "annotation": basetypes.StringType{}, - "contract_name": basetypes.StringType{}, - }, - } - FvRsIntraEpgSet, _ := types.SetValueFrom(ctx, FvRsIntraEpgType, FvRsIntraEpgList) + FvRsIntraEpgSet, _ := types.SetValueFrom(ctx, FvRsIntraEpgFvESgType, FvRsIntraEpgList) upgradedStateData.FvRsIntraEpg = FvRsIntraEpgSet FvRsProvList := make([]FvRsProvFvESgResourceModel, 0) @@ -574,23 +991,39 @@ func (r *FvESgResource) UpgradeState(ctx context.Context) map[int64]resource.Sta MatchT: priorStateDataFvRsProv.MatchT, Prio: customTypes.FvRsProvPrioStringValue{StringValue: priorStateDataFvRsProv.Prio}, TnVzBrCPName: priorStateDataFvRsProv.TargetDn, + TagAnnotation: basetypes.NewSetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: basetypes.NewSetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), } FvRsProvList = append(FvRsProvList, FvRsProv) } - FvRsProvType := types.ObjectType{ - AttrTypes: map[string]attr.Type{ - "annotation": basetypes.StringType{}, - "match_criteria": basetypes.StringType{}, - "priority": basetypes.StringType{}, - "contract_name": basetypes.StringType{}, - }, - } - FvRsProvSet, _ := types.SetValueFrom(ctx, FvRsProvType, FvRsProvList) + FvRsProvSet, _ := types.SetValueFrom(ctx, FvRsProvFvESgType, FvRsProvList) upgradedStateData.FvRsProv = FvRsProvSet FvRsScopeObject := FvRsScopeFvESgResourceModel{ Annotation: basetypes.NewStringNull(), TnFvCtxName: basetypes.NewStringValue(GetMOName(priorStateData.FvRsScope.ValueString())), + TagAnnotation: basetypes.NewSetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: basetypes.NewSetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), } fvRsScopeObject, _ := types.ObjectValueFrom(ctx, FvRsScopeFvESgType, FvRsScopeObject) upgradedStateData.FvRsScope = fvRsScopeObject @@ -602,16 +1035,22 @@ func (r *FvESgResource) UpgradeState(ctx context.Context) map[int64]resource.Sta FvRsSecInherited := FvRsSecInheritedFvESgResourceModel{ Annotation: basetypes.NewStringNull(), TDn: basetypes.NewStringValue(priorStateDataFvRsSecInherited), + TagAnnotation: basetypes.NewSetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: basetypes.NewSetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), } FvRsSecInheritedList = append(FvRsSecInheritedList, FvRsSecInherited) } - FvRsSecInheritedType := types.ObjectType{ - AttrTypes: map[string]attr.Type{ - "annotation": basetypes.StringType{}, - "target_dn": basetypes.StringType{}, - }, - } - FvRsSecInheritedSet, _ := types.SetValueFrom(ctx, FvRsSecInheritedType, FvRsSecInheritedList) + FvRsSecInheritedSet, _ := types.SetValueFrom(ctx, FvRsSecInheritedFvESgType, FvRsSecInheritedList) upgradedStateData.FvRsSecInherited = FvRsSecInheritedSet upgradedStateData.TagAnnotation = types.SetNull( @@ -813,7 +1252,7 @@ func (r *FvESgResource) ModifyPlan(ctx context.Context, req resource.ModifyPlanR } } else if !configData.DeprecatedFvRsSecInherited.IsNull() { FvRsSecInheritedList := make([]FvRsSecInheritedFvESgResourceModel, 0) - var attributeValues []string + var attributeValues []basetypes.StringValue var newAttributeValues []FvRsSecInheritedFvESgResourceModel configData.DeprecatedFvRsSecInherited.ElementsAs(ctx, &attributeValues, false) if stateData != nil { @@ -823,14 +1262,18 @@ func (r *FvESgResource) ModifyPlan(ctx context.Context, req resource.ModifyPlanR FvRsSecInheritedValue := FvRsSecInheritedFvESgResourceModel{} foundAttributeValue := false for _, newAttributeValue := range newAttributeValues { - if newAttributeValue.TDn.ValueString() == attributeValue { + if newAttributeValue.TDn.ValueString() == attributeValue.ValueString() { FvRsSecInheritedValue = newAttributeValue foundAttributeValue = true break } } + tDnValue := basetypes.NewStringUnknown() + if !attributeValue.IsUnknown() { + tDnValue = basetypes.NewStringValue(attributeValue.ValueString()) + } FvRsSecInherited := FvRsSecInheritedFvESgResourceModel{ - TDn: basetypes.NewStringValue(attributeValue), + TDn: tDnValue, } if foundAttributeValue { @@ -838,15 +1281,13 @@ func (r *FvESgResource) ModifyPlan(ctx context.Context, req resource.ModifyPlanR } else { FvRsSecInherited.Annotation = planData.Annotation } + tagAnnotationFvRsSecInheritedFvESgValue, _ := types.SetValueFrom(ctx, TagAnnotationFvRsSecInheritedFvESgType, make([]TagAnnotationFvRsSecInheritedFvESgResourceModel, 0)) + FvRsSecInherited.TagAnnotation = tagAnnotationFvRsSecInheritedFvESgValue + tagTagFvRsSecInheritedFvESgValue, _ := types.SetValueFrom(ctx, TagTagFvRsSecInheritedFvESgType, make([]TagTagFvRsSecInheritedFvESgResourceModel, 0)) + FvRsSecInherited.TagTag = tagTagFvRsSecInheritedFvESgValue FvRsSecInheritedList = append(FvRsSecInheritedList, FvRsSecInherited) } - FvRsSecInheritedType := types.ObjectType{ - AttrTypes: map[string]attr.Type{ - "annotation": basetypes.StringType{}, - "target_dn": basetypes.StringType{}, - }, - } - FvRsSecInheritedSet, _ := types.SetValueFrom(ctx, FvRsSecInheritedType, FvRsSecInheritedList) + FvRsSecInheritedSet, _ := types.SetValueFrom(ctx, FvRsSecInheritedFvESgType, FvRsSecInheritedList) planData.FvRsSecInherited = FvRsSecInheritedSet } else if stateData != nil { // used to replace use state for unknown planData.DeprecatedFvRsSecInherited = stateData.DeprecatedFvRsSecInherited @@ -876,7 +1317,7 @@ func (r *FvESgResource) ModifyPlan(ctx context.Context, req resource.ModifyPlanR } } else if !configData.DeprecatedFvRsIntraEpg.IsNull() { FvRsIntraEpgList := make([]FvRsIntraEpgFvESgResourceModel, 0) - var attributeValues []string + var attributeValues []basetypes.StringValue var newAttributeValues []FvRsIntraEpgFvESgResourceModel configData.DeprecatedFvRsIntraEpg.ElementsAs(ctx, &attributeValues, false) if stateData != nil { @@ -886,14 +1327,18 @@ func (r *FvESgResource) ModifyPlan(ctx context.Context, req resource.ModifyPlanR FvRsIntraEpgValue := FvRsIntraEpgFvESgResourceModel{} foundAttributeValue := false for _, newAttributeValue := range newAttributeValues { - if newAttributeValue.TnVzBrCPName.ValueString() == GetMOName(attributeValue) { + if newAttributeValue.TnVzBrCPName.ValueString() == GetMOName(attributeValue.ValueString()) { FvRsIntraEpgValue = newAttributeValue foundAttributeValue = true break } } + tnVzBrCPNameValue := basetypes.NewStringUnknown() + if !attributeValue.IsUnknown() { + tnVzBrCPNameValue = basetypes.NewStringValue(GetMOName(attributeValue.ValueString())) + } FvRsIntraEpg := FvRsIntraEpgFvESgResourceModel{ - TnVzBrCPName: basetypes.NewStringValue(GetMOName(attributeValue)), + TnVzBrCPName: tnVzBrCPNameValue, } if foundAttributeValue { @@ -901,15 +1346,13 @@ func (r *FvESgResource) ModifyPlan(ctx context.Context, req resource.ModifyPlanR } else { FvRsIntraEpg.Annotation = planData.Annotation } + tagAnnotationFvRsIntraEpgFvESgValue, _ := types.SetValueFrom(ctx, TagAnnotationFvRsIntraEpgFvESgType, make([]TagAnnotationFvRsIntraEpgFvESgResourceModel, 0)) + FvRsIntraEpg.TagAnnotation = tagAnnotationFvRsIntraEpgFvESgValue + tagTagFvRsIntraEpgFvESgValue, _ := types.SetValueFrom(ctx, TagTagFvRsIntraEpgFvESgType, make([]TagTagFvRsIntraEpgFvESgResourceModel, 0)) + FvRsIntraEpg.TagTag = tagTagFvRsIntraEpgFvESgValue FvRsIntraEpgList = append(FvRsIntraEpgList, FvRsIntraEpg) } - FvRsIntraEpgType := types.ObjectType{ - AttrTypes: map[string]attr.Type{ - "annotation": basetypes.StringType{}, - "contract_name": basetypes.StringType{}, - }, - } - FvRsIntraEpgSet, _ := types.SetValueFrom(ctx, FvRsIntraEpgType, FvRsIntraEpgList) + FvRsIntraEpgSet, _ := types.SetValueFrom(ctx, FvRsIntraEpgFvESgType, FvRsIntraEpgList) planData.FvRsIntraEpg = FvRsIntraEpgSet } else if stateData != nil { // used to replace use state for unknown planData.DeprecatedFvRsIntraEpg = stateData.DeprecatedFvRsIntraEpg @@ -927,9 +1370,25 @@ func (r *FvESgResource) ModifyPlan(ctx context.Context, req resource.ModifyPlanR } } } else if !configData.DeprecatedFvRsScope.IsNull() { + var newAttributeValues FvRsScopeFvESgResourceModel + tagAnnotationFvRsScopeFvESgValue, _ := types.SetValueFrom(ctx, TagAnnotationFvRsScopeFvESgType, make([]TagAnnotationFvRsScopeFvESgResourceModel, 0)) + tagTagFvRsScopeFvESgValue, _ := types.SetValueFrom(ctx, TagTagFvRsScopeFvESgType, make([]TagTagFvRsScopeFvESgResourceModel, 0)) + annotationValue := planData.Annotation + if stateData != nil { + stateData.FvRsScope.As(ctx, &newAttributeValues, basetypes.ObjectAsOptions{}) + annotationValue = newAttributeValues.Annotation + tagAnnotationFvRsScopeFvESgValue = newAttributeValues.TagAnnotation + tagTagFvRsScopeFvESgValue = newAttributeValues.TagTag + } + tnFvCtxNameValue := basetypes.NewStringUnknown() + if !configData.DeprecatedFvRsScope.IsUnknown() { + tnFvCtxNameValue = basetypes.NewStringValue(GetMOName(configData.DeprecatedFvRsScope.ValueString())) + } FvRsScope := FvRsScopeFvESgResourceModel{ - Annotation: planData.Annotation, - TnFvCtxName: basetypes.NewStringValue(GetMOName(configData.DeprecatedFvRsScope.ValueString())), + Annotation: annotationValue, + TnFvCtxName: tnFvCtxNameValue, + TagAnnotation: tagAnnotationFvRsScopeFvESgValue, + TagTag: tagTagFvRsScopeFvESgValue, } FvRsScopeObject, _ := types.ObjectValueFrom(ctx, FvRsScopeFvESgType, FvRsScope) planData.FvRsScope = FvRsScopeObject @@ -938,12 +1397,14 @@ func (r *FvESgResource) ModifyPlan(ctx context.Context, req resource.ModifyPlanR } planData.DeprecatedFvRsCons = types.SetNull(deprecatedFvRsConsType) - if !configData.DeprecatedFvRsCons.IsNull() && stateData != nil { + if !configData.DeprecatedFvRsCons.IsNull() { FvRsConsList := make([]FvRsConsFvESgResourceModel, 0) var attributeValues []FvRsConsFvESgResourceModelV1 var newAttributeValues []FvRsConsFvESgResourceModel configData.DeprecatedFvRsCons.ElementsAs(ctx, &attributeValues, false) - stateData.FvRsCons.ElementsAs(ctx, &newAttributeValues, false) + if stateData != nil { + stateData.FvRsCons.ElementsAs(ctx, &newAttributeValues, false) + } for _, attributeValue := range attributeValues { plannedFvRsCons := FvRsConsFvESgResourceModel{} foundAttributeValue := false @@ -954,39 +1415,42 @@ func (r *FvESgResource) ModifyPlan(ctx context.Context, req resource.ModifyPlanR break } } + tnVzBrCPNameValue := basetypes.NewStringUnknown() + if !attributeValue.TargetDn.IsUnknown() { + tnVzBrCPNameValue = basetypes.NewStringValue(GetMOName(attributeValue.TargetDn.ValueString())) + } FvRsCons := FvRsConsFvESgResourceModel{ - Annotation: planData.Annotation, - Prio: customTypes.FvRsConsPrioStringValue{StringValue: attributeValue.Prio}, + Annotation: planData.Annotation, + Prio: customTypes.FvRsConsPrioStringValue{StringValue: attributeValue.Prio}, + TnVzBrCPName: tnVzBrCPNameValue, } if foundAttributeValue { FvRsCons.TnVzBrCPName = plannedFvRsCons.TnVzBrCPName } else { - FvRsCons.TnVzBrCPName = basetypes.NewStringValue(GetMOName(attributeValue.TargetDn.ValueString())) + FvRsCons.TnVzBrCPName = tnVzBrCPNameValue } - + tagAnnotationFvRsConsFvESgValue, _ := types.SetValueFrom(ctx, TagAnnotationFvRsConsFvESgType, make([]TagAnnotationFvRsConsFvESgResourceModel, 0)) + FvRsCons.TagAnnotation = tagAnnotationFvRsConsFvESgValue + tagTagFvRsConsFvESgValue, _ := types.SetValueFrom(ctx, TagTagFvRsConsFvESgType, make([]TagTagFvRsConsFvESgResourceModel, 0)) + FvRsCons.TagTag = tagTagFvRsConsFvESgValue FvRsConsList = append(FvRsConsList, FvRsCons) } - FvRsConsType := types.ObjectType{ - AttrTypes: map[string]attr.Type{ - "annotation": basetypes.StringType{}, - "priority": basetypes.StringType{}, - "contract_name": basetypes.StringType{}, - }, - } - FvRsConsSet, _ := types.SetValueFrom(ctx, FvRsConsType, FvRsConsList) + FvRsConsSet, _ := types.SetValueFrom(ctx, FvRsConsFvESgType, FvRsConsList) planData.FvRsCons = FvRsConsSet } planData.DeprecatedFvRsConsIf = types.SetNull(deprecatedFvRsConsIfType) - if !configData.DeprecatedFvRsConsIf.IsNull() && stateData != nil { + if !configData.DeprecatedFvRsConsIf.IsNull() { FvRsConsIfList := make([]FvRsConsIfFvESgResourceModel, 0) var attributeValues []FvRsConsIfFvESgResourceModelV1 var newAttributeValues []FvRsConsIfFvESgResourceModel configData.DeprecatedFvRsConsIf.ElementsAs(ctx, &attributeValues, false) - stateData.FvRsConsIf.ElementsAs(ctx, &newAttributeValues, false) + if stateData != nil { + stateData.FvRsConsIf.ElementsAs(ctx, &newAttributeValues, false) + } for _, attributeValue := range attributeValues { plannedFvRsConsIf := FvRsConsIfFvESgResourceModel{} foundAttributeValue := false @@ -997,39 +1461,42 @@ func (r *FvESgResource) ModifyPlan(ctx context.Context, req resource.ModifyPlanR break } } + tnVzCPIfNameValue := basetypes.NewStringUnknown() + if !attributeValue.TargetDn.IsUnknown() { + tnVzCPIfNameValue = basetypes.NewStringValue(GetMOName(attributeValue.TargetDn.ValueString())) + } FvRsConsIf := FvRsConsIfFvESgResourceModel{ - Annotation: planData.Annotation, - Prio: customTypes.FvRsConsIfPrioStringValue{StringValue: attributeValue.Prio}, + Annotation: planData.Annotation, + Prio: customTypes.FvRsConsIfPrioStringValue{StringValue: attributeValue.Prio}, + TnVzCPIfName: tnVzCPIfNameValue, } if foundAttributeValue { FvRsConsIf.TnVzCPIfName = plannedFvRsConsIf.TnVzCPIfName } else { - FvRsConsIf.TnVzCPIfName = basetypes.NewStringValue(GetMOName(attributeValue.TargetDn.ValueString())) + FvRsConsIf.TnVzCPIfName = tnVzCPIfNameValue } - + tagAnnotationFvRsConsIfFvESgValue, _ := types.SetValueFrom(ctx, TagAnnotationFvRsConsIfFvESgType, make([]TagAnnotationFvRsConsIfFvESgResourceModel, 0)) + FvRsConsIf.TagAnnotation = tagAnnotationFvRsConsIfFvESgValue + tagTagFvRsConsIfFvESgValue, _ := types.SetValueFrom(ctx, TagTagFvRsConsIfFvESgType, make([]TagTagFvRsConsIfFvESgResourceModel, 0)) + FvRsConsIf.TagTag = tagTagFvRsConsIfFvESgValue FvRsConsIfList = append(FvRsConsIfList, FvRsConsIf) } - FvRsConsIfType := types.ObjectType{ - AttrTypes: map[string]attr.Type{ - "annotation": basetypes.StringType{}, - "priority": basetypes.StringType{}, - "imported_contract_name": basetypes.StringType{}, - }, - } - FvRsConsIfSet, _ := types.SetValueFrom(ctx, FvRsConsIfType, FvRsConsIfList) + FvRsConsIfSet, _ := types.SetValueFrom(ctx, FvRsConsIfFvESgType, FvRsConsIfList) planData.FvRsConsIf = FvRsConsIfSet } planData.DeprecatedFvRsProv = types.SetNull(deprecatedFvRsProvType) - if !configData.DeprecatedFvRsProv.IsNull() && stateData != nil { + if !configData.DeprecatedFvRsProv.IsNull() { FvRsProvList := make([]FvRsProvFvESgResourceModel, 0) var attributeValues []FvRsProvFvESgResourceModelV1 var newAttributeValues []FvRsProvFvESgResourceModel configData.DeprecatedFvRsProv.ElementsAs(ctx, &attributeValues, false) - stateData.FvRsProv.ElementsAs(ctx, &newAttributeValues, false) + if stateData != nil { + stateData.FvRsProv.ElementsAs(ctx, &newAttributeValues, false) + } for _, attributeValue := range attributeValues { plannedFvRsProv := FvRsProvFvESgResourceModel{} foundAttributeValue := false @@ -1040,31 +1507,31 @@ func (r *FvESgResource) ModifyPlan(ctx context.Context, req resource.ModifyPlanR break } } + tnVzBrCPNameValue := basetypes.NewStringUnknown() + if !attributeValue.TargetDn.IsUnknown() { + tnVzBrCPNameValue = basetypes.NewStringValue(GetMOName(attributeValue.TargetDn.ValueString())) + } FvRsProv := FvRsProvFvESgResourceModel{ - Annotation: planData.Annotation, - MatchT: attributeValue.MatchT, - Prio: customTypes.FvRsProvPrioStringValue{StringValue: attributeValue.Prio}, + Annotation: planData.Annotation, + MatchT: attributeValue.MatchT, + Prio: customTypes.FvRsProvPrioStringValue{StringValue: attributeValue.Prio}, + TnVzBrCPName: tnVzBrCPNameValue, } if foundAttributeValue { FvRsProv.TnVzBrCPName = plannedFvRsProv.TnVzBrCPName } else { - FvRsProv.TnVzBrCPName = basetypes.NewStringValue(GetMOName(attributeValue.TargetDn.ValueString())) + FvRsProv.TnVzBrCPName = tnVzBrCPNameValue } - + tagAnnotationFvRsProvFvESgValue, _ := types.SetValueFrom(ctx, TagAnnotationFvRsProvFvESgType, make([]TagAnnotationFvRsProvFvESgResourceModel, 0)) + FvRsProv.TagAnnotation = tagAnnotationFvRsProvFvESgValue + tagTagFvRsProvFvESgValue, _ := types.SetValueFrom(ctx, TagTagFvRsProvFvESgType, make([]TagTagFvRsProvFvESgResourceModel, 0)) + FvRsProv.TagTag = tagTagFvRsProvFvESgValue FvRsProvList = append(FvRsProvList, FvRsProv) } - FvRsProvType := types.ObjectType{ - AttrTypes: map[string]attr.Type{ - "annotation": basetypes.StringType{}, - "match_criteria": basetypes.StringType{}, - "priority": basetypes.StringType{}, - "contract_name": basetypes.StringType{}, - }, - } - FvRsProvSet, _ := types.SetValueFrom(ctx, FvRsProvType, FvRsProvList) + FvRsProvSet, _ := types.SetValueFrom(ctx, FvRsProvFvESgType, FvRsProvList) planData.FvRsProv = FvRsProvSet } @@ -1269,7 +1736,11 @@ func (r *FvESgResource) Schema(ctx context.Context, req resource.SchemaRequest, MarkdownDescription: `Parameter used to determine whether communication between endpoints within the ESG is blocked.`, }, "pc_tag": schema.StringAttribute{ - Computed: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + SetToStringNullWhenStateIsNullPlanIsUnknownDuringUpdate(), + }, MarkdownDescription: `The classification tag used for policy enforcement and zoning.`, }, "preferred_group_member": schema.StringAttribute{ @@ -1340,6 +1811,74 @@ func (r *FvESgResource) Schema(ctx context.Context, req resource.SchemaRequest, }, MarkdownDescription: `The consumer contract name.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, }, @@ -1387,6 +1926,74 @@ func (r *FvESgResource) Schema(ctx context.Context, req resource.SchemaRequest, }, MarkdownDescription: `The contract interface name.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, }, @@ -1423,6 +2030,74 @@ func (r *FvESgResource) Schema(ctx context.Context, req resource.SchemaRequest, }, MarkdownDescription: `The contract name.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, }, @@ -1481,6 +2156,74 @@ func (r *FvESgResource) Schema(ctx context.Context, req resource.SchemaRequest, }, MarkdownDescription: `The provider contract name.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, }, @@ -1510,6 +2253,74 @@ func (r *FvESgResource) Schema(ctx context.Context, req resource.SchemaRequest, Validators: []validator.String{}, MarkdownDescription: `The name of the VRF object.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, "relation_to_contract_masters": schema.SetNestedAttribute{ @@ -1541,6 +2352,74 @@ func (r *FvESgResource) Schema(ctx context.Context, req resource.SchemaRequest, }, MarkdownDescription: `The distinguished name of the target.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + MakeStringRequired(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, }, @@ -1930,7 +2809,7 @@ func (r *FvESgResource) ImportState(ctx context.Context, req resource.ImportStat } func getAndSetFvESgAttributes(ctx context.Context, diags *diag.Diagnostics, client *client.Client, data *FvESgResourceModel) { - requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=children&rsp-subtree-class=%s", data.Id.ValueString(), "fvESg,fvRsCons,fvRsConsIf,fvRsIntraEpg,fvRsProv,fvRsScope,fvRsSecInherited,tagAnnotation,tagTag"), "GET", nil) + requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=full&rsp-subtree-class=%s", data.Id.ValueString(), "fvESg,fvRsCons,fvRsConsIf,fvRsIntraEpg,fvRsProv,fvRsScope,fvRsSecInherited,tagAnnotation,tagTag,tagAnnotation,tagTag,tagAnnotation,tagTag,tagAnnotation,tagTag,tagAnnotation,tagTag,tagAnnotation,tagTag,tagAnnotation,tagTag"), "GET", nil) readData := getEmptyFvESgResourceModel() @@ -2003,7 +2882,47 @@ func getAndSetFvESgAttributes(ctx context.Context, diags *diag.Diagnostics, clie if childAttributeName == "tnVzBrCPName" { FvRsConsFvESg.TnVzBrCPName = basetypes.NewStringValue(childAttributeValue.(string)) } + + } + TagAnnotationFvRsConsFvESgList := make([]TagAnnotationFvRsConsFvESgResourceModel, 0) + TagTagFvRsConsFvESgList := make([]TagTagFvRsConsFvESgResourceModel, 0) + childrenOfFvRsConsFvESg, childrenOfFvRsConsFvESgExist := childClassDetails.(map[string]interface{})["children"] + if childrenOfFvRsConsFvESgExist { + for _, childFvRsConsFvESg := range childrenOfFvRsConsFvESg.([]interface{}) { + for childClassNameFvRsConsFvESg, childClassDetailsFvRsConsFvESg := range childFvRsConsFvESg.(map[string]interface{}) { + if childClassNameFvRsConsFvESg == "tagAnnotation" { + TagAnnotationFvRsConsFvESg := getEmptyTagAnnotationFvRsConsFvESgResourceModel() + tagAnnotationchildAttributeValue := childClassDetailsFvRsConsFvESg.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagAnnotationchildAttributeValue { + if childAttributeName == "key" { + TagAnnotationFvRsConsFvESg.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagAnnotationFvRsConsFvESg.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagAnnotationFvRsConsFvESgList = append(TagAnnotationFvRsConsFvESgList, TagAnnotationFvRsConsFvESg) + } + if childClassNameFvRsConsFvESg == "tagTag" { + TagTagFvRsConsFvESg := getEmptyTagTagFvRsConsFvESgResourceModel() + tagTagchildAttributeValue := childClassDetailsFvRsConsFvESg.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagTagchildAttributeValue { + if childAttributeName == "key" { + TagTagFvRsConsFvESg.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagTagFvRsConsFvESg.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagTagFvRsConsFvESgList = append(TagTagFvRsConsFvESgList, TagTagFvRsConsFvESg) + } + } + } } + TagAnnotationFvRsConsFvESgSet, _ := types.SetValueFrom(ctx, TagAnnotationFvRsConsFvESgType, TagAnnotationFvRsConsFvESgList) + FvRsConsFvESg.TagAnnotation = TagAnnotationFvRsConsFvESgSet + TagTagFvRsConsFvESgSet, _ := types.SetValueFrom(ctx, TagTagFvRsConsFvESgType, TagTagFvRsConsFvESgList) + FvRsConsFvESg.TagTag = TagTagFvRsConsFvESgSet FvRsConsFvESgList = append(FvRsConsFvESgList, FvRsConsFvESg) } if childClassName == "fvRsConsIf" { @@ -2018,7 +2937,47 @@ func getAndSetFvESgAttributes(ctx context.Context, diags *diag.Diagnostics, clie if childAttributeName == "tnVzCPIfName" { FvRsConsIfFvESg.TnVzCPIfName = basetypes.NewStringValue(childAttributeValue.(string)) } + + } + TagAnnotationFvRsConsIfFvESgList := make([]TagAnnotationFvRsConsIfFvESgResourceModel, 0) + TagTagFvRsConsIfFvESgList := make([]TagTagFvRsConsIfFvESgResourceModel, 0) + childrenOfFvRsConsIfFvESg, childrenOfFvRsConsIfFvESgExist := childClassDetails.(map[string]interface{})["children"] + if childrenOfFvRsConsIfFvESgExist { + for _, childFvRsConsIfFvESg := range childrenOfFvRsConsIfFvESg.([]interface{}) { + for childClassNameFvRsConsIfFvESg, childClassDetailsFvRsConsIfFvESg := range childFvRsConsIfFvESg.(map[string]interface{}) { + if childClassNameFvRsConsIfFvESg == "tagAnnotation" { + TagAnnotationFvRsConsIfFvESg := getEmptyTagAnnotationFvRsConsIfFvESgResourceModel() + tagAnnotationchildAttributeValue := childClassDetailsFvRsConsIfFvESg.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagAnnotationchildAttributeValue { + if childAttributeName == "key" { + TagAnnotationFvRsConsIfFvESg.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagAnnotationFvRsConsIfFvESg.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagAnnotationFvRsConsIfFvESgList = append(TagAnnotationFvRsConsIfFvESgList, TagAnnotationFvRsConsIfFvESg) + } + if childClassNameFvRsConsIfFvESg == "tagTag" { + TagTagFvRsConsIfFvESg := getEmptyTagTagFvRsConsIfFvESgResourceModel() + tagTagchildAttributeValue := childClassDetailsFvRsConsIfFvESg.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagTagchildAttributeValue { + if childAttributeName == "key" { + TagTagFvRsConsIfFvESg.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagTagFvRsConsIfFvESg.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagTagFvRsConsIfFvESgList = append(TagTagFvRsConsIfFvESgList, TagTagFvRsConsIfFvESg) + } + } + } } + TagAnnotationFvRsConsIfFvESgSet, _ := types.SetValueFrom(ctx, TagAnnotationFvRsConsIfFvESgType, TagAnnotationFvRsConsIfFvESgList) + FvRsConsIfFvESg.TagAnnotation = TagAnnotationFvRsConsIfFvESgSet + TagTagFvRsConsIfFvESgSet, _ := types.SetValueFrom(ctx, TagTagFvRsConsIfFvESgType, TagTagFvRsConsIfFvESgList) + FvRsConsIfFvESg.TagTag = TagTagFvRsConsIfFvESgSet FvRsConsIfFvESgList = append(FvRsConsIfFvESgList, FvRsConsIfFvESg) } if childClassName == "fvRsIntraEpg" { @@ -2030,7 +2989,47 @@ func getAndSetFvESgAttributes(ctx context.Context, diags *diag.Diagnostics, clie if childAttributeName == "tnVzBrCPName" { FvRsIntraEpgFvESg.TnVzBrCPName = basetypes.NewStringValue(childAttributeValue.(string)) } + + } + TagAnnotationFvRsIntraEpgFvESgList := make([]TagAnnotationFvRsIntraEpgFvESgResourceModel, 0) + TagTagFvRsIntraEpgFvESgList := make([]TagTagFvRsIntraEpgFvESgResourceModel, 0) + childrenOfFvRsIntraEpgFvESg, childrenOfFvRsIntraEpgFvESgExist := childClassDetails.(map[string]interface{})["children"] + if childrenOfFvRsIntraEpgFvESgExist { + for _, childFvRsIntraEpgFvESg := range childrenOfFvRsIntraEpgFvESg.([]interface{}) { + for childClassNameFvRsIntraEpgFvESg, childClassDetailsFvRsIntraEpgFvESg := range childFvRsIntraEpgFvESg.(map[string]interface{}) { + if childClassNameFvRsIntraEpgFvESg == "tagAnnotation" { + TagAnnotationFvRsIntraEpgFvESg := getEmptyTagAnnotationFvRsIntraEpgFvESgResourceModel() + tagAnnotationchildAttributeValue := childClassDetailsFvRsIntraEpgFvESg.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagAnnotationchildAttributeValue { + if childAttributeName == "key" { + TagAnnotationFvRsIntraEpgFvESg.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagAnnotationFvRsIntraEpgFvESg.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagAnnotationFvRsIntraEpgFvESgList = append(TagAnnotationFvRsIntraEpgFvESgList, TagAnnotationFvRsIntraEpgFvESg) + } + if childClassNameFvRsIntraEpgFvESg == "tagTag" { + TagTagFvRsIntraEpgFvESg := getEmptyTagTagFvRsIntraEpgFvESgResourceModel() + tagTagchildAttributeValue := childClassDetailsFvRsIntraEpgFvESg.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagTagchildAttributeValue { + if childAttributeName == "key" { + TagTagFvRsIntraEpgFvESg.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagTagFvRsIntraEpgFvESg.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagTagFvRsIntraEpgFvESgList = append(TagTagFvRsIntraEpgFvESgList, TagTagFvRsIntraEpgFvESg) + } + } + } } + TagAnnotationFvRsIntraEpgFvESgSet, _ := types.SetValueFrom(ctx, TagAnnotationFvRsIntraEpgFvESgType, TagAnnotationFvRsIntraEpgFvESgList) + FvRsIntraEpgFvESg.TagAnnotation = TagAnnotationFvRsIntraEpgFvESgSet + TagTagFvRsIntraEpgFvESgSet, _ := types.SetValueFrom(ctx, TagTagFvRsIntraEpgFvESgType, TagTagFvRsIntraEpgFvESgList) + FvRsIntraEpgFvESg.TagTag = TagTagFvRsIntraEpgFvESgSet FvRsIntraEpgFvESgList = append(FvRsIntraEpgFvESgList, FvRsIntraEpgFvESg) } if childClassName == "fvRsProv" { @@ -2048,7 +3047,47 @@ func getAndSetFvESgAttributes(ctx context.Context, diags *diag.Diagnostics, clie if childAttributeName == "tnVzBrCPName" { FvRsProvFvESg.TnVzBrCPName = basetypes.NewStringValue(childAttributeValue.(string)) } + + } + TagAnnotationFvRsProvFvESgList := make([]TagAnnotationFvRsProvFvESgResourceModel, 0) + TagTagFvRsProvFvESgList := make([]TagTagFvRsProvFvESgResourceModel, 0) + childrenOfFvRsProvFvESg, childrenOfFvRsProvFvESgExist := childClassDetails.(map[string]interface{})["children"] + if childrenOfFvRsProvFvESgExist { + for _, childFvRsProvFvESg := range childrenOfFvRsProvFvESg.([]interface{}) { + for childClassNameFvRsProvFvESg, childClassDetailsFvRsProvFvESg := range childFvRsProvFvESg.(map[string]interface{}) { + if childClassNameFvRsProvFvESg == "tagAnnotation" { + TagAnnotationFvRsProvFvESg := getEmptyTagAnnotationFvRsProvFvESgResourceModel() + tagAnnotationchildAttributeValue := childClassDetailsFvRsProvFvESg.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagAnnotationchildAttributeValue { + if childAttributeName == "key" { + TagAnnotationFvRsProvFvESg.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagAnnotationFvRsProvFvESg.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagAnnotationFvRsProvFvESgList = append(TagAnnotationFvRsProvFvESgList, TagAnnotationFvRsProvFvESg) + } + if childClassNameFvRsProvFvESg == "tagTag" { + TagTagFvRsProvFvESg := getEmptyTagTagFvRsProvFvESgResourceModel() + tagTagchildAttributeValue := childClassDetailsFvRsProvFvESg.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagTagchildAttributeValue { + if childAttributeName == "key" { + TagTagFvRsProvFvESg.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagTagFvRsProvFvESg.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagTagFvRsProvFvESgList = append(TagTagFvRsProvFvESgList, TagTagFvRsProvFvESg) + } + } + } } + TagAnnotationFvRsProvFvESgSet, _ := types.SetValueFrom(ctx, TagAnnotationFvRsProvFvESgType, TagAnnotationFvRsProvFvESgList) + FvRsProvFvESg.TagAnnotation = TagAnnotationFvRsProvFvESgSet + TagTagFvRsProvFvESgSet, _ := types.SetValueFrom(ctx, TagTagFvRsProvFvESgType, TagTagFvRsProvFvESgList) + FvRsProvFvESg.TagTag = TagTagFvRsProvFvESgSet FvRsProvFvESgList = append(FvRsProvFvESgList, FvRsProvFvESg) } if childClassName == "fvRsScope" { @@ -2060,7 +3099,47 @@ func getAndSetFvESgAttributes(ctx context.Context, diags *diag.Diagnostics, clie if childAttributeName == "tnFvCtxName" { FvRsScopeFvESg.TnFvCtxName = basetypes.NewStringValue(childAttributeValue.(string)) } + + } + TagAnnotationFvRsScopeFvESgList := make([]TagAnnotationFvRsScopeFvESgResourceModel, 0) + TagTagFvRsScopeFvESgList := make([]TagTagFvRsScopeFvESgResourceModel, 0) + childrenOfFvRsScopeFvESg, childrenOfFvRsScopeFvESgExist := childClassDetails.(map[string]interface{})["children"] + if childrenOfFvRsScopeFvESgExist { + for _, childFvRsScopeFvESg := range childrenOfFvRsScopeFvESg.([]interface{}) { + for childClassNameFvRsScopeFvESg, childClassDetailsFvRsScopeFvESg := range childFvRsScopeFvESg.(map[string]interface{}) { + if childClassNameFvRsScopeFvESg == "tagAnnotation" { + TagAnnotationFvRsScopeFvESg := getEmptyTagAnnotationFvRsScopeFvESgResourceModel() + tagAnnotationchildAttributeValue := childClassDetailsFvRsScopeFvESg.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagAnnotationchildAttributeValue { + if childAttributeName == "key" { + TagAnnotationFvRsScopeFvESg.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagAnnotationFvRsScopeFvESg.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagAnnotationFvRsScopeFvESgList = append(TagAnnotationFvRsScopeFvESgList, TagAnnotationFvRsScopeFvESg) + } + if childClassNameFvRsScopeFvESg == "tagTag" { + TagTagFvRsScopeFvESg := getEmptyTagTagFvRsScopeFvESgResourceModel() + tagTagchildAttributeValue := childClassDetailsFvRsScopeFvESg.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagTagchildAttributeValue { + if childAttributeName == "key" { + TagTagFvRsScopeFvESg.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagTagFvRsScopeFvESg.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagTagFvRsScopeFvESgList = append(TagTagFvRsScopeFvESgList, TagTagFvRsScopeFvESg) + } + } + } } + TagAnnotationFvRsScopeFvESgSet, _ := types.SetValueFrom(ctx, TagAnnotationFvRsScopeFvESgType, TagAnnotationFvRsScopeFvESgList) + FvRsScopeFvESg.TagAnnotation = TagAnnotationFvRsScopeFvESgSet + TagTagFvRsScopeFvESgSet, _ := types.SetValueFrom(ctx, TagTagFvRsScopeFvESgType, TagTagFvRsScopeFvESgList) + FvRsScopeFvESg.TagTag = TagTagFvRsScopeFvESgSet FvRsScopeFvESgList = append(FvRsScopeFvESgList, FvRsScopeFvESg) } if childClassName == "fvRsSecInherited" { @@ -2072,7 +3151,47 @@ func getAndSetFvESgAttributes(ctx context.Context, diags *diag.Diagnostics, clie if childAttributeName == "tDn" { FvRsSecInheritedFvESg.TDn = basetypes.NewStringValue(childAttributeValue.(string)) } + + } + TagAnnotationFvRsSecInheritedFvESgList := make([]TagAnnotationFvRsSecInheritedFvESgResourceModel, 0) + TagTagFvRsSecInheritedFvESgList := make([]TagTagFvRsSecInheritedFvESgResourceModel, 0) + childrenOfFvRsSecInheritedFvESg, childrenOfFvRsSecInheritedFvESgExist := childClassDetails.(map[string]interface{})["children"] + if childrenOfFvRsSecInheritedFvESgExist { + for _, childFvRsSecInheritedFvESg := range childrenOfFvRsSecInheritedFvESg.([]interface{}) { + for childClassNameFvRsSecInheritedFvESg, childClassDetailsFvRsSecInheritedFvESg := range childFvRsSecInheritedFvESg.(map[string]interface{}) { + if childClassNameFvRsSecInheritedFvESg == "tagAnnotation" { + TagAnnotationFvRsSecInheritedFvESg := getEmptyTagAnnotationFvRsSecInheritedFvESgResourceModel() + tagAnnotationchildAttributeValue := childClassDetailsFvRsSecInheritedFvESg.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagAnnotationchildAttributeValue { + if childAttributeName == "key" { + TagAnnotationFvRsSecInheritedFvESg.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagAnnotationFvRsSecInheritedFvESg.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagAnnotationFvRsSecInheritedFvESgList = append(TagAnnotationFvRsSecInheritedFvESgList, TagAnnotationFvRsSecInheritedFvESg) + } + if childClassNameFvRsSecInheritedFvESg == "tagTag" { + TagTagFvRsSecInheritedFvESg := getEmptyTagTagFvRsSecInheritedFvESgResourceModel() + tagTagchildAttributeValue := childClassDetailsFvRsSecInheritedFvESg.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagTagchildAttributeValue { + if childAttributeName == "key" { + TagTagFvRsSecInheritedFvESg.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagTagFvRsSecInheritedFvESg.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagTagFvRsSecInheritedFvESgList = append(TagTagFvRsSecInheritedFvESgList, TagTagFvRsSecInheritedFvESg) + } + } + } } + TagAnnotationFvRsSecInheritedFvESgSet, _ := types.SetValueFrom(ctx, TagAnnotationFvRsSecInheritedFvESgType, TagAnnotationFvRsSecInheritedFvESgList) + FvRsSecInheritedFvESg.TagAnnotation = TagAnnotationFvRsSecInheritedFvESgSet + TagTagFvRsSecInheritedFvESgSet, _ := types.SetValueFrom(ctx, TagTagFvRsSecInheritedFvESgType, TagTagFvRsSecInheritedFvESgList) + FvRsSecInheritedFvESg.TagTag = TagTagFvRsSecInheritedFvESgSet FvRsSecInheritedFvESgList = append(FvRsSecInheritedFvESgList, FvRsSecInheritedFvESg) } if childClassName == "tagAnnotation" { @@ -2084,6 +3203,7 @@ func getAndSetFvESgAttributes(ctx context.Context, diags *diag.Diagnostics, clie if childAttributeName == "value" { TagAnnotationFvESg.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagAnnotationFvESgList = append(TagAnnotationFvESgList, TagAnnotationFvESg) } @@ -2096,6 +3216,7 @@ func getAndSetFvESgAttributes(ctx context.Context, diags *diag.Diagnostics, clie if childAttributeName == "value" { TagTagFvESg.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagTagFvESgList = append(TagTagFvESgList, TagTagFvESg) } @@ -2161,30 +3282,105 @@ func setFvESgId(ctx context.Context, data *FvESgResourceModel) { data.Id = types.StringValue(fmt.Sprintf("%s/%s", data.ParentDn.ValueString(), rn)) } -func getFvESgFvRsConsChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvESgResourceModel, fvRsConsPlan, fvRsConsState []FvRsConsFvESgResourceModel) []map[string]interface{} { - +func getFvESgFvRsConsChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvESgResourceModel, fvRsConsFvESgPlan, fvRsConsFvESgState []FvRsConsFvESgResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.FvRsCons.IsUnknown() { + if !data.FvRsCons.IsNull() && !data.FvRsCons.IsUnknown() { fvRsConsIdentifiers := []FvRsConsIdentifier{} - for _, fvRsCons := range fvRsConsPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !fvRsCons.Annotation.IsUnknown() && !fvRsCons.Annotation.IsNull() { - childMap["attributes"]["annotation"] = fvRsCons.Annotation.ValueString() + for _, fvRsConsFvESg := range fvRsConsFvESgPlan { + FvRsConsFvESgChildren := make([]map[string]interface{}, 0) + childMap := NewAciObject() + if !fvRsConsFvESg.Annotation.IsNull() && !fvRsConsFvESg.Annotation.IsUnknown() { + childMap.Attributes["annotation"] = fvRsConsFvESg.Annotation.ValueString() } else { - childMap["attributes"]["annotation"] = globalAnnotation + childMap.Attributes["annotation"] = globalAnnotation + } + if !fvRsConsFvESg.Prio.IsNull() && !fvRsConsFvESg.Prio.IsUnknown() { + childMap.Attributes["prio"] = fvRsConsFvESg.Prio.ValueString() + } + if !fvRsConsFvESg.TnVzBrCPName.IsNull() && !fvRsConsFvESg.TnVzBrCPName.IsUnknown() { + childMap.Attributes["tnVzBrCPName"] = fvRsConsFvESg.TnVzBrCPName.ValueString() + } + + var tagAnnotationFvRsConsFvESgPlan, tagAnnotationFvRsConsFvESgState []TagAnnotationFvRsConsFvESgResourceModel + fvRsConsFvESg.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsConsFvESgPlan, false) + for _, tagAnnotationFvRsConsFvESgstate := range fvRsConsFvESgState { + tagAnnotationFvRsConsFvESgstate.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsConsFvESgState, false) + } + if !fvRsConsFvESg.TagAnnotation.IsNull() && !fvRsConsFvESg.TagAnnotation.IsUnknown() { + tagAnnotationIdentifiers := []TagAnnotationIdentifier{} + for _, tagAnnotationFvRsConsFvESg := range tagAnnotationFvRsConsFvESgPlan { + tagAnnotationFvRsConsFvESgChildMap := NewAciObject() + if !tagAnnotationFvRsConsFvESg.Key.IsNull() && !tagAnnotationFvRsConsFvESg.Key.IsUnknown() { + tagAnnotationFvRsConsFvESgChildMap.Attributes["key"] = tagAnnotationFvRsConsFvESg.Key.ValueString() + } + if !tagAnnotationFvRsConsFvESg.Value.IsNull() && !tagAnnotationFvRsConsFvESg.Value.IsUnknown() { + tagAnnotationFvRsConsFvESgChildMap.Attributes["value"] = tagAnnotationFvRsConsFvESg.Value.ValueString() + } + FvRsConsFvESgChildren = append(FvRsConsFvESgChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsConsFvESgChildMap}) + tagAnnotationIdentifier := TagAnnotationIdentifier{} + tagAnnotationIdentifier.Key = tagAnnotationFvRsConsFvESg.Key + tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) + } + for _, tagAnnotationFvRsConsFvESg := range tagAnnotationFvRsConsFvESgState { + delete := true + for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { + if tagAnnotationIdentifier.Key == tagAnnotationFvRsConsFvESg.Key { + delete = false + break + } + } + if delete { + tagAnnotationFvRsConsFvESgChildMapForDelete := NewAciObject() + tagAnnotationFvRsConsFvESgChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationFvRsConsFvESgChildMapForDelete.Attributes["key"] = tagAnnotationFvRsConsFvESg.Key.ValueString() + FvRsConsFvESgChildren = append(FvRsConsFvESgChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsConsFvESgChildMapForDelete}) + } + } } - if !fvRsCons.Prio.IsUnknown() && !fvRsCons.Prio.IsNull() { - childMap["attributes"]["prio"] = fvRsCons.Prio.ValueString() + + var tagTagFvRsConsFvESgPlan, tagTagFvRsConsFvESgState []TagTagFvRsConsFvESgResourceModel + fvRsConsFvESg.TagTag.ElementsAs(ctx, &tagTagFvRsConsFvESgPlan, false) + for _, tagTagFvRsConsFvESgstate := range fvRsConsFvESgState { + tagTagFvRsConsFvESgstate.TagTag.ElementsAs(ctx, &tagTagFvRsConsFvESgState, false) } - if !fvRsCons.TnVzBrCPName.IsUnknown() && !fvRsCons.TnVzBrCPName.IsNull() { - childMap["attributes"]["tnVzBrCPName"] = fvRsCons.TnVzBrCPName.ValueString() + if !fvRsConsFvESg.TagTag.IsNull() && !fvRsConsFvESg.TagTag.IsUnknown() { + tagTagIdentifiers := []TagTagIdentifier{} + for _, tagTagFvRsConsFvESg := range tagTagFvRsConsFvESgPlan { + tagTagFvRsConsFvESgChildMap := NewAciObject() + if !tagTagFvRsConsFvESg.Key.IsNull() && !tagTagFvRsConsFvESg.Key.IsUnknown() { + tagTagFvRsConsFvESgChildMap.Attributes["key"] = tagTagFvRsConsFvESg.Key.ValueString() + } + if !tagTagFvRsConsFvESg.Value.IsNull() && !tagTagFvRsConsFvESg.Value.IsUnknown() { + tagTagFvRsConsFvESgChildMap.Attributes["value"] = tagTagFvRsConsFvESg.Value.ValueString() + } + FvRsConsFvESgChildren = append(FvRsConsFvESgChildren, map[string]interface{}{"tagTag": tagTagFvRsConsFvESgChildMap}) + tagTagIdentifier := TagTagIdentifier{} + tagTagIdentifier.Key = tagTagFvRsConsFvESg.Key + tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) + } + for _, tagTagFvRsConsFvESg := range tagTagFvRsConsFvESgState { + delete := true + for _, tagTagIdentifier := range tagTagIdentifiers { + if tagTagIdentifier.Key == tagTagFvRsConsFvESg.Key { + delete = false + break + } + } + if delete { + tagTagFvRsConsFvESgChildMapForDelete := NewAciObject() + tagTagFvRsConsFvESgChildMapForDelete.Attributes["status"] = "deleted" + tagTagFvRsConsFvESgChildMapForDelete.Attributes["key"] = tagTagFvRsConsFvESg.Key.ValueString() + FvRsConsFvESgChildren = append(FvRsConsFvESgChildren, map[string]interface{}{"tagTag": tagTagFvRsConsFvESgChildMapForDelete}) + } + } } + childMap.Children = FvRsConsFvESgChildren childPayloads = append(childPayloads, map[string]interface{}{"fvRsCons": childMap}) fvRsConsIdentifier := FvRsConsIdentifier{} - fvRsConsIdentifier.TnVzBrCPName = fvRsCons.TnVzBrCPName + fvRsConsIdentifier.TnVzBrCPName = fvRsConsFvESg.TnVzBrCPName fvRsConsIdentifiers = append(fvRsConsIdentifiers, fvRsConsIdentifier) } - for _, fvRsCons := range fvRsConsState { + for _, fvRsCons := range fvRsConsFvESgState { delete := true for _, fvRsConsIdentifier := range fvRsConsIdentifiers { if fvRsConsIdentifier.TnVzBrCPName == fvRsCons.TnVzBrCPName { @@ -2193,10 +3389,10 @@ func getFvESgFvRsConsChildPayloads(ctx context.Context, diags *diag.Diagnostics, } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["tnVzBrCPName"] = fvRsCons.TnVzBrCPName.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"fvRsCons": childMap}) + fvRsConsChildMapForDelete := NewAciObject() + fvRsConsChildMapForDelete.Attributes["status"] = "deleted" + fvRsConsChildMapForDelete.Attributes["tnVzBrCPName"] = fvRsCons.TnVzBrCPName.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"fvRsCons": fvRsConsChildMapForDelete}) } } } else { @@ -2205,30 +3401,106 @@ func getFvESgFvRsConsChildPayloads(ctx context.Context, diags *diag.Diagnostics, return childPayloads } -func getFvESgFvRsConsIfChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvESgResourceModel, fvRsConsIfPlan, fvRsConsIfState []FvRsConsIfFvESgResourceModel) []map[string]interface{} { +func getFvESgFvRsConsIfChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvESgResourceModel, fvRsConsIfFvESgPlan, fvRsConsIfFvESgState []FvRsConsIfFvESgResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.FvRsConsIf.IsUnknown() { + if !data.FvRsConsIf.IsNull() && !data.FvRsConsIf.IsUnknown() { fvRsConsIfIdentifiers := []FvRsConsIfIdentifier{} - for _, fvRsConsIf := range fvRsConsIfPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !fvRsConsIf.Annotation.IsUnknown() && !fvRsConsIf.Annotation.IsNull() { - childMap["attributes"]["annotation"] = fvRsConsIf.Annotation.ValueString() + for _, fvRsConsIfFvESg := range fvRsConsIfFvESgPlan { + FvRsConsIfFvESgChildren := make([]map[string]interface{}, 0) + childMap := NewAciObject() + if !fvRsConsIfFvESg.Annotation.IsNull() && !fvRsConsIfFvESg.Annotation.IsUnknown() { + childMap.Attributes["annotation"] = fvRsConsIfFvESg.Annotation.ValueString() } else { - childMap["attributes"]["annotation"] = globalAnnotation + childMap.Attributes["annotation"] = globalAnnotation + } + if !fvRsConsIfFvESg.Prio.IsNull() && !fvRsConsIfFvESg.Prio.IsUnknown() { + childMap.Attributes["prio"] = fvRsConsIfFvESg.Prio.ValueString() + } + if !fvRsConsIfFvESg.TnVzCPIfName.IsNull() && !fvRsConsIfFvESg.TnVzCPIfName.IsUnknown() { + childMap.Attributes["tnVzCPIfName"] = fvRsConsIfFvESg.TnVzCPIfName.ValueString() + } + + var tagAnnotationFvRsConsIfFvESgPlan, tagAnnotationFvRsConsIfFvESgState []TagAnnotationFvRsConsIfFvESgResourceModel + fvRsConsIfFvESg.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsConsIfFvESgPlan, false) + for _, tagAnnotationFvRsConsIfFvESgstate := range fvRsConsIfFvESgState { + tagAnnotationFvRsConsIfFvESgstate.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsConsIfFvESgState, false) + } + if !fvRsConsIfFvESg.TagAnnotation.IsNull() && !fvRsConsIfFvESg.TagAnnotation.IsUnknown() { + tagAnnotationIdentifiers := []TagAnnotationIdentifier{} + for _, tagAnnotationFvRsConsIfFvESg := range tagAnnotationFvRsConsIfFvESgPlan { + tagAnnotationFvRsConsIfFvESgChildMap := NewAciObject() + if !tagAnnotationFvRsConsIfFvESg.Key.IsNull() && !tagAnnotationFvRsConsIfFvESg.Key.IsUnknown() { + tagAnnotationFvRsConsIfFvESgChildMap.Attributes["key"] = tagAnnotationFvRsConsIfFvESg.Key.ValueString() + } + if !tagAnnotationFvRsConsIfFvESg.Value.IsNull() && !tagAnnotationFvRsConsIfFvESg.Value.IsUnknown() { + tagAnnotationFvRsConsIfFvESgChildMap.Attributes["value"] = tagAnnotationFvRsConsIfFvESg.Value.ValueString() + } + FvRsConsIfFvESgChildren = append(FvRsConsIfFvESgChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsConsIfFvESgChildMap}) + tagAnnotationIdentifier := TagAnnotationIdentifier{} + tagAnnotationIdentifier.Key = tagAnnotationFvRsConsIfFvESg.Key + tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) + } + for _, tagAnnotationFvRsConsIfFvESg := range tagAnnotationFvRsConsIfFvESgState { + delete := true + for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { + if tagAnnotationIdentifier.Key == tagAnnotationFvRsConsIfFvESg.Key { + delete = false + break + } + } + if delete { + tagAnnotationFvRsConsIfFvESgChildMapForDelete := NewAciObject() + tagAnnotationFvRsConsIfFvESgChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationFvRsConsIfFvESgChildMapForDelete.Attributes["key"] = tagAnnotationFvRsConsIfFvESg.Key.ValueString() + FvRsConsIfFvESgChildren = append(FvRsConsIfFvESgChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsConsIfFvESgChildMapForDelete}) + } + } } - if !fvRsConsIf.Prio.IsUnknown() && !fvRsConsIf.Prio.IsNull() { - childMap["attributes"]["prio"] = fvRsConsIf.Prio.ValueString() + + var tagTagFvRsConsIfFvESgPlan, tagTagFvRsConsIfFvESgState []TagTagFvRsConsIfFvESgResourceModel + fvRsConsIfFvESg.TagTag.ElementsAs(ctx, &tagTagFvRsConsIfFvESgPlan, false) + for _, tagTagFvRsConsIfFvESgstate := range fvRsConsIfFvESgState { + tagTagFvRsConsIfFvESgstate.TagTag.ElementsAs(ctx, &tagTagFvRsConsIfFvESgState, false) } - if !fvRsConsIf.TnVzCPIfName.IsUnknown() && !fvRsConsIf.TnVzCPIfName.IsNull() { - childMap["attributes"]["tnVzCPIfName"] = fvRsConsIf.TnVzCPIfName.ValueString() + if !fvRsConsIfFvESg.TagTag.IsNull() && !fvRsConsIfFvESg.TagTag.IsUnknown() { + tagTagIdentifiers := []TagTagIdentifier{} + for _, tagTagFvRsConsIfFvESg := range tagTagFvRsConsIfFvESgPlan { + tagTagFvRsConsIfFvESgChildMap := NewAciObject() + if !tagTagFvRsConsIfFvESg.Key.IsNull() && !tagTagFvRsConsIfFvESg.Key.IsUnknown() { + tagTagFvRsConsIfFvESgChildMap.Attributes["key"] = tagTagFvRsConsIfFvESg.Key.ValueString() + } + if !tagTagFvRsConsIfFvESg.Value.IsNull() && !tagTagFvRsConsIfFvESg.Value.IsUnknown() { + tagTagFvRsConsIfFvESgChildMap.Attributes["value"] = tagTagFvRsConsIfFvESg.Value.ValueString() + } + FvRsConsIfFvESgChildren = append(FvRsConsIfFvESgChildren, map[string]interface{}{"tagTag": tagTagFvRsConsIfFvESgChildMap}) + tagTagIdentifier := TagTagIdentifier{} + tagTagIdentifier.Key = tagTagFvRsConsIfFvESg.Key + tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) + } + for _, tagTagFvRsConsIfFvESg := range tagTagFvRsConsIfFvESgState { + delete := true + for _, tagTagIdentifier := range tagTagIdentifiers { + if tagTagIdentifier.Key == tagTagFvRsConsIfFvESg.Key { + delete = false + break + } + } + if delete { + tagTagFvRsConsIfFvESgChildMapForDelete := NewAciObject() + tagTagFvRsConsIfFvESgChildMapForDelete.Attributes["status"] = "deleted" + tagTagFvRsConsIfFvESgChildMapForDelete.Attributes["key"] = tagTagFvRsConsIfFvESg.Key.ValueString() + FvRsConsIfFvESgChildren = append(FvRsConsIfFvESgChildren, map[string]interface{}{"tagTag": tagTagFvRsConsIfFvESgChildMapForDelete}) + } + } } + childMap.Children = FvRsConsIfFvESgChildren childPayloads = append(childPayloads, map[string]interface{}{"fvRsConsIf": childMap}) fvRsConsIfIdentifier := FvRsConsIfIdentifier{} - fvRsConsIfIdentifier.TnVzCPIfName = fvRsConsIf.TnVzCPIfName + fvRsConsIfIdentifier.TnVzCPIfName = fvRsConsIfFvESg.TnVzCPIfName fvRsConsIfIdentifiers = append(fvRsConsIfIdentifiers, fvRsConsIfIdentifier) } - for _, fvRsConsIf := range fvRsConsIfState { + for _, fvRsConsIf := range fvRsConsIfFvESgState { delete := true for _, fvRsConsIfIdentifier := range fvRsConsIfIdentifiers { if fvRsConsIfIdentifier.TnVzCPIfName == fvRsConsIf.TnVzCPIfName { @@ -2237,10 +3509,10 @@ func getFvESgFvRsConsIfChildPayloads(ctx context.Context, diags *diag.Diagnostic } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["tnVzCPIfName"] = fvRsConsIf.TnVzCPIfName.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"fvRsConsIf": childMap}) + fvRsConsIfChildMapForDelete := NewAciObject() + fvRsConsIfChildMapForDelete.Attributes["status"] = "deleted" + fvRsConsIfChildMapForDelete.Attributes["tnVzCPIfName"] = fvRsConsIf.TnVzCPIfName.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"fvRsConsIf": fvRsConsIfChildMapForDelete}) } } } else { @@ -2249,27 +3521,103 @@ func getFvESgFvRsConsIfChildPayloads(ctx context.Context, diags *diag.Diagnostic return childPayloads } -func getFvESgFvRsIntraEpgChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvESgResourceModel, fvRsIntraEpgPlan, fvRsIntraEpgState []FvRsIntraEpgFvESgResourceModel) []map[string]interface{} { +func getFvESgFvRsIntraEpgChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvESgResourceModel, fvRsIntraEpgFvESgPlan, fvRsIntraEpgFvESgState []FvRsIntraEpgFvESgResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.FvRsIntraEpg.IsUnknown() { + if !data.FvRsIntraEpg.IsNull() && !data.FvRsIntraEpg.IsUnknown() { fvRsIntraEpgIdentifiers := []FvRsIntraEpgIdentifier{} - for _, fvRsIntraEpg := range fvRsIntraEpgPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !fvRsIntraEpg.Annotation.IsUnknown() && !fvRsIntraEpg.Annotation.IsNull() { - childMap["attributes"]["annotation"] = fvRsIntraEpg.Annotation.ValueString() + for _, fvRsIntraEpgFvESg := range fvRsIntraEpgFvESgPlan { + FvRsIntraEpgFvESgChildren := make([]map[string]interface{}, 0) + childMap := NewAciObject() + if !fvRsIntraEpgFvESg.Annotation.IsNull() && !fvRsIntraEpgFvESg.Annotation.IsUnknown() { + childMap.Attributes["annotation"] = fvRsIntraEpgFvESg.Annotation.ValueString() } else { - childMap["attributes"]["annotation"] = globalAnnotation + childMap.Attributes["annotation"] = globalAnnotation + } + if !fvRsIntraEpgFvESg.TnVzBrCPName.IsNull() && !fvRsIntraEpgFvESg.TnVzBrCPName.IsUnknown() { + childMap.Attributes["tnVzBrCPName"] = fvRsIntraEpgFvESg.TnVzBrCPName.ValueString() + } + + var tagAnnotationFvRsIntraEpgFvESgPlan, tagAnnotationFvRsIntraEpgFvESgState []TagAnnotationFvRsIntraEpgFvESgResourceModel + fvRsIntraEpgFvESg.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsIntraEpgFvESgPlan, false) + for _, tagAnnotationFvRsIntraEpgFvESgstate := range fvRsIntraEpgFvESgState { + tagAnnotationFvRsIntraEpgFvESgstate.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsIntraEpgFvESgState, false) + } + if !fvRsIntraEpgFvESg.TagAnnotation.IsNull() && !fvRsIntraEpgFvESg.TagAnnotation.IsUnknown() { + tagAnnotationIdentifiers := []TagAnnotationIdentifier{} + for _, tagAnnotationFvRsIntraEpgFvESg := range tagAnnotationFvRsIntraEpgFvESgPlan { + tagAnnotationFvRsIntraEpgFvESgChildMap := NewAciObject() + if !tagAnnotationFvRsIntraEpgFvESg.Key.IsNull() && !tagAnnotationFvRsIntraEpgFvESg.Key.IsUnknown() { + tagAnnotationFvRsIntraEpgFvESgChildMap.Attributes["key"] = tagAnnotationFvRsIntraEpgFvESg.Key.ValueString() + } + if !tagAnnotationFvRsIntraEpgFvESg.Value.IsNull() && !tagAnnotationFvRsIntraEpgFvESg.Value.IsUnknown() { + tagAnnotationFvRsIntraEpgFvESgChildMap.Attributes["value"] = tagAnnotationFvRsIntraEpgFvESg.Value.ValueString() + } + FvRsIntraEpgFvESgChildren = append(FvRsIntraEpgFvESgChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsIntraEpgFvESgChildMap}) + tagAnnotationIdentifier := TagAnnotationIdentifier{} + tagAnnotationIdentifier.Key = tagAnnotationFvRsIntraEpgFvESg.Key + tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) + } + for _, tagAnnotationFvRsIntraEpgFvESg := range tagAnnotationFvRsIntraEpgFvESgState { + delete := true + for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { + if tagAnnotationIdentifier.Key == tagAnnotationFvRsIntraEpgFvESg.Key { + delete = false + break + } + } + if delete { + tagAnnotationFvRsIntraEpgFvESgChildMapForDelete := NewAciObject() + tagAnnotationFvRsIntraEpgFvESgChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationFvRsIntraEpgFvESgChildMapForDelete.Attributes["key"] = tagAnnotationFvRsIntraEpgFvESg.Key.ValueString() + FvRsIntraEpgFvESgChildren = append(FvRsIntraEpgFvESgChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsIntraEpgFvESgChildMapForDelete}) + } + } + } + + var tagTagFvRsIntraEpgFvESgPlan, tagTagFvRsIntraEpgFvESgState []TagTagFvRsIntraEpgFvESgResourceModel + fvRsIntraEpgFvESg.TagTag.ElementsAs(ctx, &tagTagFvRsIntraEpgFvESgPlan, false) + for _, tagTagFvRsIntraEpgFvESgstate := range fvRsIntraEpgFvESgState { + tagTagFvRsIntraEpgFvESgstate.TagTag.ElementsAs(ctx, &tagTagFvRsIntraEpgFvESgState, false) } - if !fvRsIntraEpg.TnVzBrCPName.IsUnknown() && !fvRsIntraEpg.TnVzBrCPName.IsNull() { - childMap["attributes"]["tnVzBrCPName"] = fvRsIntraEpg.TnVzBrCPName.ValueString() + if !fvRsIntraEpgFvESg.TagTag.IsNull() && !fvRsIntraEpgFvESg.TagTag.IsUnknown() { + tagTagIdentifiers := []TagTagIdentifier{} + for _, tagTagFvRsIntraEpgFvESg := range tagTagFvRsIntraEpgFvESgPlan { + tagTagFvRsIntraEpgFvESgChildMap := NewAciObject() + if !tagTagFvRsIntraEpgFvESg.Key.IsNull() && !tagTagFvRsIntraEpgFvESg.Key.IsUnknown() { + tagTagFvRsIntraEpgFvESgChildMap.Attributes["key"] = tagTagFvRsIntraEpgFvESg.Key.ValueString() + } + if !tagTagFvRsIntraEpgFvESg.Value.IsNull() && !tagTagFvRsIntraEpgFvESg.Value.IsUnknown() { + tagTagFvRsIntraEpgFvESgChildMap.Attributes["value"] = tagTagFvRsIntraEpgFvESg.Value.ValueString() + } + FvRsIntraEpgFvESgChildren = append(FvRsIntraEpgFvESgChildren, map[string]interface{}{"tagTag": tagTagFvRsIntraEpgFvESgChildMap}) + tagTagIdentifier := TagTagIdentifier{} + tagTagIdentifier.Key = tagTagFvRsIntraEpgFvESg.Key + tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) + } + for _, tagTagFvRsIntraEpgFvESg := range tagTagFvRsIntraEpgFvESgState { + delete := true + for _, tagTagIdentifier := range tagTagIdentifiers { + if tagTagIdentifier.Key == tagTagFvRsIntraEpgFvESg.Key { + delete = false + break + } + } + if delete { + tagTagFvRsIntraEpgFvESgChildMapForDelete := NewAciObject() + tagTagFvRsIntraEpgFvESgChildMapForDelete.Attributes["status"] = "deleted" + tagTagFvRsIntraEpgFvESgChildMapForDelete.Attributes["key"] = tagTagFvRsIntraEpgFvESg.Key.ValueString() + FvRsIntraEpgFvESgChildren = append(FvRsIntraEpgFvESgChildren, map[string]interface{}{"tagTag": tagTagFvRsIntraEpgFvESgChildMapForDelete}) + } + } } + childMap.Children = FvRsIntraEpgFvESgChildren childPayloads = append(childPayloads, map[string]interface{}{"fvRsIntraEpg": childMap}) fvRsIntraEpgIdentifier := FvRsIntraEpgIdentifier{} - fvRsIntraEpgIdentifier.TnVzBrCPName = fvRsIntraEpg.TnVzBrCPName + fvRsIntraEpgIdentifier.TnVzBrCPName = fvRsIntraEpgFvESg.TnVzBrCPName fvRsIntraEpgIdentifiers = append(fvRsIntraEpgIdentifiers, fvRsIntraEpgIdentifier) } - for _, fvRsIntraEpg := range fvRsIntraEpgState { + for _, fvRsIntraEpg := range fvRsIntraEpgFvESgState { delete := true for _, fvRsIntraEpgIdentifier := range fvRsIntraEpgIdentifiers { if fvRsIntraEpgIdentifier.TnVzBrCPName == fvRsIntraEpg.TnVzBrCPName { @@ -2278,10 +3626,10 @@ func getFvESgFvRsIntraEpgChildPayloads(ctx context.Context, diags *diag.Diagnost } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["tnVzBrCPName"] = fvRsIntraEpg.TnVzBrCPName.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"fvRsIntraEpg": childMap}) + fvRsIntraEpgChildMapForDelete := NewAciObject() + fvRsIntraEpgChildMapForDelete.Attributes["status"] = "deleted" + fvRsIntraEpgChildMapForDelete.Attributes["tnVzBrCPName"] = fvRsIntraEpg.TnVzBrCPName.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"fvRsIntraEpg": fvRsIntraEpgChildMapForDelete}) } } } else { @@ -2290,33 +3638,109 @@ func getFvESgFvRsIntraEpgChildPayloads(ctx context.Context, diags *diag.Diagnost return childPayloads } -func getFvESgFvRsProvChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvESgResourceModel, fvRsProvPlan, fvRsProvState []FvRsProvFvESgResourceModel) []map[string]interface{} { +func getFvESgFvRsProvChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvESgResourceModel, fvRsProvFvESgPlan, fvRsProvFvESgState []FvRsProvFvESgResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.FvRsProv.IsUnknown() { + if !data.FvRsProv.IsNull() && !data.FvRsProv.IsUnknown() { fvRsProvIdentifiers := []FvRsProvIdentifier{} - for _, fvRsProv := range fvRsProvPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !fvRsProv.Annotation.IsUnknown() && !fvRsProv.Annotation.IsNull() { - childMap["attributes"]["annotation"] = fvRsProv.Annotation.ValueString() + for _, fvRsProvFvESg := range fvRsProvFvESgPlan { + FvRsProvFvESgChildren := make([]map[string]interface{}, 0) + childMap := NewAciObject() + if !fvRsProvFvESg.Annotation.IsNull() && !fvRsProvFvESg.Annotation.IsUnknown() { + childMap.Attributes["annotation"] = fvRsProvFvESg.Annotation.ValueString() } else { - childMap["attributes"]["annotation"] = globalAnnotation + childMap.Attributes["annotation"] = globalAnnotation + } + if !fvRsProvFvESg.MatchT.IsNull() && !fvRsProvFvESg.MatchT.IsUnknown() { + childMap.Attributes["matchT"] = fvRsProvFvESg.MatchT.ValueString() + } + if !fvRsProvFvESg.Prio.IsNull() && !fvRsProvFvESg.Prio.IsUnknown() { + childMap.Attributes["prio"] = fvRsProvFvESg.Prio.ValueString() } - if !fvRsProv.MatchT.IsUnknown() && !fvRsProv.MatchT.IsNull() { - childMap["attributes"]["matchT"] = fvRsProv.MatchT.ValueString() + if !fvRsProvFvESg.TnVzBrCPName.IsNull() && !fvRsProvFvESg.TnVzBrCPName.IsUnknown() { + childMap.Attributes["tnVzBrCPName"] = fvRsProvFvESg.TnVzBrCPName.ValueString() + } + + var tagAnnotationFvRsProvFvESgPlan, tagAnnotationFvRsProvFvESgState []TagAnnotationFvRsProvFvESgResourceModel + fvRsProvFvESg.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsProvFvESgPlan, false) + for _, tagAnnotationFvRsProvFvESgstate := range fvRsProvFvESgState { + tagAnnotationFvRsProvFvESgstate.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsProvFvESgState, false) + } + if !fvRsProvFvESg.TagAnnotation.IsNull() && !fvRsProvFvESg.TagAnnotation.IsUnknown() { + tagAnnotationIdentifiers := []TagAnnotationIdentifier{} + for _, tagAnnotationFvRsProvFvESg := range tagAnnotationFvRsProvFvESgPlan { + tagAnnotationFvRsProvFvESgChildMap := NewAciObject() + if !tagAnnotationFvRsProvFvESg.Key.IsNull() && !tagAnnotationFvRsProvFvESg.Key.IsUnknown() { + tagAnnotationFvRsProvFvESgChildMap.Attributes["key"] = tagAnnotationFvRsProvFvESg.Key.ValueString() + } + if !tagAnnotationFvRsProvFvESg.Value.IsNull() && !tagAnnotationFvRsProvFvESg.Value.IsUnknown() { + tagAnnotationFvRsProvFvESgChildMap.Attributes["value"] = tagAnnotationFvRsProvFvESg.Value.ValueString() + } + FvRsProvFvESgChildren = append(FvRsProvFvESgChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsProvFvESgChildMap}) + tagAnnotationIdentifier := TagAnnotationIdentifier{} + tagAnnotationIdentifier.Key = tagAnnotationFvRsProvFvESg.Key + tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) + } + for _, tagAnnotationFvRsProvFvESg := range tagAnnotationFvRsProvFvESgState { + delete := true + for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { + if tagAnnotationIdentifier.Key == tagAnnotationFvRsProvFvESg.Key { + delete = false + break + } + } + if delete { + tagAnnotationFvRsProvFvESgChildMapForDelete := NewAciObject() + tagAnnotationFvRsProvFvESgChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationFvRsProvFvESgChildMapForDelete.Attributes["key"] = tagAnnotationFvRsProvFvESg.Key.ValueString() + FvRsProvFvESgChildren = append(FvRsProvFvESgChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsProvFvESgChildMapForDelete}) + } + } } - if !fvRsProv.Prio.IsUnknown() && !fvRsProv.Prio.IsNull() { - childMap["attributes"]["prio"] = fvRsProv.Prio.ValueString() + + var tagTagFvRsProvFvESgPlan, tagTagFvRsProvFvESgState []TagTagFvRsProvFvESgResourceModel + fvRsProvFvESg.TagTag.ElementsAs(ctx, &tagTagFvRsProvFvESgPlan, false) + for _, tagTagFvRsProvFvESgstate := range fvRsProvFvESgState { + tagTagFvRsProvFvESgstate.TagTag.ElementsAs(ctx, &tagTagFvRsProvFvESgState, false) } - if !fvRsProv.TnVzBrCPName.IsUnknown() && !fvRsProv.TnVzBrCPName.IsNull() { - childMap["attributes"]["tnVzBrCPName"] = fvRsProv.TnVzBrCPName.ValueString() + if !fvRsProvFvESg.TagTag.IsNull() && !fvRsProvFvESg.TagTag.IsUnknown() { + tagTagIdentifiers := []TagTagIdentifier{} + for _, tagTagFvRsProvFvESg := range tagTagFvRsProvFvESgPlan { + tagTagFvRsProvFvESgChildMap := NewAciObject() + if !tagTagFvRsProvFvESg.Key.IsNull() && !tagTagFvRsProvFvESg.Key.IsUnknown() { + tagTagFvRsProvFvESgChildMap.Attributes["key"] = tagTagFvRsProvFvESg.Key.ValueString() + } + if !tagTagFvRsProvFvESg.Value.IsNull() && !tagTagFvRsProvFvESg.Value.IsUnknown() { + tagTagFvRsProvFvESgChildMap.Attributes["value"] = tagTagFvRsProvFvESg.Value.ValueString() + } + FvRsProvFvESgChildren = append(FvRsProvFvESgChildren, map[string]interface{}{"tagTag": tagTagFvRsProvFvESgChildMap}) + tagTagIdentifier := TagTagIdentifier{} + tagTagIdentifier.Key = tagTagFvRsProvFvESg.Key + tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) + } + for _, tagTagFvRsProvFvESg := range tagTagFvRsProvFvESgState { + delete := true + for _, tagTagIdentifier := range tagTagIdentifiers { + if tagTagIdentifier.Key == tagTagFvRsProvFvESg.Key { + delete = false + break + } + } + if delete { + tagTagFvRsProvFvESgChildMapForDelete := NewAciObject() + tagTagFvRsProvFvESgChildMapForDelete.Attributes["status"] = "deleted" + tagTagFvRsProvFvESgChildMapForDelete.Attributes["key"] = tagTagFvRsProvFvESg.Key.ValueString() + FvRsProvFvESgChildren = append(FvRsProvFvESgChildren, map[string]interface{}{"tagTag": tagTagFvRsProvFvESgChildMapForDelete}) + } + } } + childMap.Children = FvRsProvFvESgChildren childPayloads = append(childPayloads, map[string]interface{}{"fvRsProv": childMap}) fvRsProvIdentifier := FvRsProvIdentifier{} - fvRsProvIdentifier.TnVzBrCPName = fvRsProv.TnVzBrCPName + fvRsProvIdentifier.TnVzBrCPName = fvRsProvFvESg.TnVzBrCPName fvRsProvIdentifiers = append(fvRsProvIdentifiers, fvRsProvIdentifier) } - for _, fvRsProv := range fvRsProvState { + for _, fvRsProv := range fvRsProvFvESgState { delete := true for _, fvRsProvIdentifier := range fvRsProvIdentifiers { if fvRsProvIdentifier.TnVzBrCPName == fvRsProv.TnVzBrCPName { @@ -2325,10 +3749,10 @@ func getFvESgFvRsProvChildPayloads(ctx context.Context, diags *diag.Diagnostics, } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["tnVzBrCPName"] = fvRsProv.TnVzBrCPName.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"fvRsProv": childMap}) + fvRsProvChildMapForDelete := NewAciObject() + fvRsProvChildMapForDelete.Attributes["status"] = "deleted" + fvRsProvChildMapForDelete.Attributes["tnVzBrCPName"] = fvRsProv.TnVzBrCPName.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"fvRsProv": fvRsProvChildMapForDelete}) } } } else { @@ -2337,21 +3761,97 @@ func getFvESgFvRsProvChildPayloads(ctx context.Context, diags *diag.Diagnostics, return childPayloads } -func getFvESgFvRsScopeChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvESgResourceModel, fvRsScopePlan, fvRsScopeState FvRsScopeFvESgResourceModel) []map[string]interface{} { +func getFvESgFvRsScopeChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvESgResourceModel, fvRsScopeFvESgPlan, fvRsScopeFvESgState FvRsScopeFvESgResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.FvRsScope.IsUnknown() { - childMap := map[string]map[string]interface{}{"attributes": {}} + if !data.FvRsScope.IsNull() && !data.FvRsScope.IsUnknown() { + FvRsScopeFvESgChildren := make([]map[string]interface{}, 0) + childMap := NewAciObject() if !IsEmptySingleNestedAttribute(data.FvRsScope.Attributes()) { - if !fvRsScopePlan.Annotation.IsUnknown() && !fvRsScopePlan.Annotation.IsNull() { - childMap["attributes"]["annotation"] = fvRsScopePlan.Annotation.ValueString() + if !fvRsScopeFvESgPlan.Annotation.IsUnknown() && !fvRsScopeFvESgPlan.Annotation.IsNull() { + childMap.Attributes["annotation"] = fvRsScopeFvESgPlan.Annotation.ValueString() } else { - childMap["attributes"]["annotation"] = globalAnnotation + childMap.Attributes["annotation"] = globalAnnotation + } + if !fvRsScopeFvESgPlan.TnFvCtxName.IsUnknown() && !fvRsScopeFvESgPlan.TnFvCtxName.IsNull() { + childMap.Attributes["tnFvCtxName"] = fvRsScopeFvESgPlan.TnFvCtxName.ValueString() + } + } + + var tagAnnotationFvRsScopeFvESgPlan, tagAnnotationFvRsScopeFvESgState []TagAnnotationFvRsScopeFvESgResourceModel + fvRsScopeFvESgPlan.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsScopeFvESgPlan, false) + if !fvRsScopeFvESgState.TagAnnotation.IsNull() { + fvRsScopeFvESgState.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsScopeFvESgState, false) + } + if !fvRsScopeFvESgPlan.TagAnnotation.IsNull() && !fvRsScopeFvESgPlan.TagAnnotation.IsUnknown() { + tagAnnotationIdentifiers := []TagAnnotationIdentifier{} + for _, tagAnnotationFvRsScopeFvESg := range tagAnnotationFvRsScopeFvESgPlan { + tagAnnotationFvRsScopeFvESgChildMap := NewAciObject() + if !tagAnnotationFvRsScopeFvESg.Key.IsNull() && !tagAnnotationFvRsScopeFvESg.Key.IsUnknown() { + tagAnnotationFvRsScopeFvESgChildMap.Attributes["key"] = tagAnnotationFvRsScopeFvESg.Key.ValueString() + } + if !tagAnnotationFvRsScopeFvESg.Value.IsNull() && !tagAnnotationFvRsScopeFvESg.Value.IsUnknown() { + tagAnnotationFvRsScopeFvESgChildMap.Attributes["value"] = tagAnnotationFvRsScopeFvESg.Value.ValueString() + } + FvRsScopeFvESgChildren = append(FvRsScopeFvESgChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsScopeFvESgChildMap}) + tagAnnotationIdentifier := TagAnnotationIdentifier{} + tagAnnotationIdentifier.Key = tagAnnotationFvRsScopeFvESg.Key + tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) + } + for _, tagAnnotationFvRsScopeFvESg := range tagAnnotationFvRsScopeFvESgState { + delete := true + for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { + if tagAnnotationIdentifier.Key == tagAnnotationFvRsScopeFvESg.Key { + delete = false + break + } + } + if delete { + tagAnnotationFvRsScopeFvESgChildMapForDelete := NewAciObject() + tagAnnotationFvRsScopeFvESgChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationFvRsScopeFvESgChildMapForDelete.Attributes["key"] = tagAnnotationFvRsScopeFvESg.Key.ValueString() + FvRsScopeFvESgChildren = append(FvRsScopeFvESgChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsScopeFvESgChildMapForDelete}) + } + } + } + + var tagTagFvRsScopeFvESgPlan, tagTagFvRsScopeFvESgState []TagTagFvRsScopeFvESgResourceModel + fvRsScopeFvESgPlan.TagTag.ElementsAs(ctx, &tagTagFvRsScopeFvESgPlan, false) + if !fvRsScopeFvESgState.TagTag.IsNull() { + fvRsScopeFvESgState.TagTag.ElementsAs(ctx, &tagTagFvRsScopeFvESgState, false) + } + if !fvRsScopeFvESgPlan.TagTag.IsNull() && !fvRsScopeFvESgPlan.TagTag.IsUnknown() { + tagTagIdentifiers := []TagTagIdentifier{} + for _, tagTagFvRsScopeFvESg := range tagTagFvRsScopeFvESgPlan { + tagTagFvRsScopeFvESgChildMap := NewAciObject() + if !tagTagFvRsScopeFvESg.Key.IsNull() && !tagTagFvRsScopeFvESg.Key.IsUnknown() { + tagTagFvRsScopeFvESgChildMap.Attributes["key"] = tagTagFvRsScopeFvESg.Key.ValueString() + } + if !tagTagFvRsScopeFvESg.Value.IsNull() && !tagTagFvRsScopeFvESg.Value.IsUnknown() { + tagTagFvRsScopeFvESgChildMap.Attributes["value"] = tagTagFvRsScopeFvESg.Value.ValueString() + } + FvRsScopeFvESgChildren = append(FvRsScopeFvESgChildren, map[string]interface{}{"tagTag": tagTagFvRsScopeFvESgChildMap}) + tagTagIdentifier := TagTagIdentifier{} + tagTagIdentifier.Key = tagTagFvRsScopeFvESg.Key + tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) } - if !fvRsScopePlan.TnFvCtxName.IsUnknown() && !fvRsScopePlan.TnFvCtxName.IsNull() { - childMap["attributes"]["tnFvCtxName"] = fvRsScopePlan.TnFvCtxName.ValueString() + for _, tagTagFvRsScopeFvESg := range tagTagFvRsScopeFvESgState { + delete := true + for _, tagTagIdentifier := range tagTagIdentifiers { + if tagTagIdentifier.Key == tagTagFvRsScopeFvESg.Key { + delete = false + break + } + } + if delete { + tagTagFvRsScopeFvESgChildMapForDelete := NewAciObject() + tagTagFvRsScopeFvESgChildMapForDelete.Attributes["status"] = "deleted" + tagTagFvRsScopeFvESgChildMapForDelete.Attributes["key"] = tagTagFvRsScopeFvESg.Key.ValueString() + FvRsScopeFvESgChildren = append(FvRsScopeFvESgChildren, map[string]interface{}{"tagTag": tagTagFvRsScopeFvESgChildMapForDelete}) + } } } + childMap.Children = FvRsScopeFvESgChildren childPayloads = append(childPayloads, map[string]interface{}{"fvRsScope": childMap}) } else { FvRsScopeObject, _ := types.ObjectValueFrom(ctx, FvRsScopeFvESgType, getEmptyFvRsScopeFvESgResourceModel()) @@ -2360,27 +3860,103 @@ func getFvESgFvRsScopeChildPayloads(ctx context.Context, diags *diag.Diagnostics return childPayloads } -func getFvESgFvRsSecInheritedChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvESgResourceModel, fvRsSecInheritedPlan, fvRsSecInheritedState []FvRsSecInheritedFvESgResourceModel) []map[string]interface{} { +func getFvESgFvRsSecInheritedChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvESgResourceModel, fvRsSecInheritedFvESgPlan, fvRsSecInheritedFvESgState []FvRsSecInheritedFvESgResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.FvRsSecInherited.IsUnknown() { + if !data.FvRsSecInherited.IsNull() && !data.FvRsSecInherited.IsUnknown() { fvRsSecInheritedIdentifiers := []FvRsSecInheritedIdentifier{} - for _, fvRsSecInherited := range fvRsSecInheritedPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !fvRsSecInherited.Annotation.IsUnknown() && !fvRsSecInherited.Annotation.IsNull() { - childMap["attributes"]["annotation"] = fvRsSecInherited.Annotation.ValueString() + for _, fvRsSecInheritedFvESg := range fvRsSecInheritedFvESgPlan { + FvRsSecInheritedFvESgChildren := make([]map[string]interface{}, 0) + childMap := NewAciObject() + if !fvRsSecInheritedFvESg.Annotation.IsNull() && !fvRsSecInheritedFvESg.Annotation.IsUnknown() { + childMap.Attributes["annotation"] = fvRsSecInheritedFvESg.Annotation.ValueString() } else { - childMap["attributes"]["annotation"] = globalAnnotation + childMap.Attributes["annotation"] = globalAnnotation + } + if !fvRsSecInheritedFvESg.TDn.IsNull() && !fvRsSecInheritedFvESg.TDn.IsUnknown() { + childMap.Attributes["tDn"] = fvRsSecInheritedFvESg.TDn.ValueString() + } + + var tagAnnotationFvRsSecInheritedFvESgPlan, tagAnnotationFvRsSecInheritedFvESgState []TagAnnotationFvRsSecInheritedFvESgResourceModel + fvRsSecInheritedFvESg.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsSecInheritedFvESgPlan, false) + for _, tagAnnotationFvRsSecInheritedFvESgstate := range fvRsSecInheritedFvESgState { + tagAnnotationFvRsSecInheritedFvESgstate.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsSecInheritedFvESgState, false) + } + if !fvRsSecInheritedFvESg.TagAnnotation.IsNull() && !fvRsSecInheritedFvESg.TagAnnotation.IsUnknown() { + tagAnnotationIdentifiers := []TagAnnotationIdentifier{} + for _, tagAnnotationFvRsSecInheritedFvESg := range tagAnnotationFvRsSecInheritedFvESgPlan { + tagAnnotationFvRsSecInheritedFvESgChildMap := NewAciObject() + if !tagAnnotationFvRsSecInheritedFvESg.Key.IsNull() && !tagAnnotationFvRsSecInheritedFvESg.Key.IsUnknown() { + tagAnnotationFvRsSecInheritedFvESgChildMap.Attributes["key"] = tagAnnotationFvRsSecInheritedFvESg.Key.ValueString() + } + if !tagAnnotationFvRsSecInheritedFvESg.Value.IsNull() && !tagAnnotationFvRsSecInheritedFvESg.Value.IsUnknown() { + tagAnnotationFvRsSecInheritedFvESgChildMap.Attributes["value"] = tagAnnotationFvRsSecInheritedFvESg.Value.ValueString() + } + FvRsSecInheritedFvESgChildren = append(FvRsSecInheritedFvESgChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsSecInheritedFvESgChildMap}) + tagAnnotationIdentifier := TagAnnotationIdentifier{} + tagAnnotationIdentifier.Key = tagAnnotationFvRsSecInheritedFvESg.Key + tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) + } + for _, tagAnnotationFvRsSecInheritedFvESg := range tagAnnotationFvRsSecInheritedFvESgState { + delete := true + for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { + if tagAnnotationIdentifier.Key == tagAnnotationFvRsSecInheritedFvESg.Key { + delete = false + break + } + } + if delete { + tagAnnotationFvRsSecInheritedFvESgChildMapForDelete := NewAciObject() + tagAnnotationFvRsSecInheritedFvESgChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationFvRsSecInheritedFvESgChildMapForDelete.Attributes["key"] = tagAnnotationFvRsSecInheritedFvESg.Key.ValueString() + FvRsSecInheritedFvESgChildren = append(FvRsSecInheritedFvESgChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsSecInheritedFvESgChildMapForDelete}) + } + } + } + + var tagTagFvRsSecInheritedFvESgPlan, tagTagFvRsSecInheritedFvESgState []TagTagFvRsSecInheritedFvESgResourceModel + fvRsSecInheritedFvESg.TagTag.ElementsAs(ctx, &tagTagFvRsSecInheritedFvESgPlan, false) + for _, tagTagFvRsSecInheritedFvESgstate := range fvRsSecInheritedFvESgState { + tagTagFvRsSecInheritedFvESgstate.TagTag.ElementsAs(ctx, &tagTagFvRsSecInheritedFvESgState, false) } - if !fvRsSecInherited.TDn.IsUnknown() && !fvRsSecInherited.TDn.IsNull() { - childMap["attributes"]["tDn"] = fvRsSecInherited.TDn.ValueString() + if !fvRsSecInheritedFvESg.TagTag.IsNull() && !fvRsSecInheritedFvESg.TagTag.IsUnknown() { + tagTagIdentifiers := []TagTagIdentifier{} + for _, tagTagFvRsSecInheritedFvESg := range tagTagFvRsSecInheritedFvESgPlan { + tagTagFvRsSecInheritedFvESgChildMap := NewAciObject() + if !tagTagFvRsSecInheritedFvESg.Key.IsNull() && !tagTagFvRsSecInheritedFvESg.Key.IsUnknown() { + tagTagFvRsSecInheritedFvESgChildMap.Attributes["key"] = tagTagFvRsSecInheritedFvESg.Key.ValueString() + } + if !tagTagFvRsSecInheritedFvESg.Value.IsNull() && !tagTagFvRsSecInheritedFvESg.Value.IsUnknown() { + tagTagFvRsSecInheritedFvESgChildMap.Attributes["value"] = tagTagFvRsSecInheritedFvESg.Value.ValueString() + } + FvRsSecInheritedFvESgChildren = append(FvRsSecInheritedFvESgChildren, map[string]interface{}{"tagTag": tagTagFvRsSecInheritedFvESgChildMap}) + tagTagIdentifier := TagTagIdentifier{} + tagTagIdentifier.Key = tagTagFvRsSecInheritedFvESg.Key + tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) + } + for _, tagTagFvRsSecInheritedFvESg := range tagTagFvRsSecInheritedFvESgState { + delete := true + for _, tagTagIdentifier := range tagTagIdentifiers { + if tagTagIdentifier.Key == tagTagFvRsSecInheritedFvESg.Key { + delete = false + break + } + } + if delete { + tagTagFvRsSecInheritedFvESgChildMapForDelete := NewAciObject() + tagTagFvRsSecInheritedFvESgChildMapForDelete.Attributes["status"] = "deleted" + tagTagFvRsSecInheritedFvESgChildMapForDelete.Attributes["key"] = tagTagFvRsSecInheritedFvESg.Key.ValueString() + FvRsSecInheritedFvESgChildren = append(FvRsSecInheritedFvESgChildren, map[string]interface{}{"tagTag": tagTagFvRsSecInheritedFvESgChildMapForDelete}) + } + } } + childMap.Children = FvRsSecInheritedFvESgChildren childPayloads = append(childPayloads, map[string]interface{}{"fvRsSecInherited": childMap}) fvRsSecInheritedIdentifier := FvRsSecInheritedIdentifier{} - fvRsSecInheritedIdentifier.TDn = fvRsSecInherited.TDn + fvRsSecInheritedIdentifier.TDn = fvRsSecInheritedFvESg.TDn fvRsSecInheritedIdentifiers = append(fvRsSecInheritedIdentifiers, fvRsSecInheritedIdentifier) } - for _, fvRsSecInherited := range fvRsSecInheritedState { + for _, fvRsSecInherited := range fvRsSecInheritedFvESgState { delete := true for _, fvRsSecInheritedIdentifier := range fvRsSecInheritedIdentifiers { if fvRsSecInheritedIdentifier.TDn == fvRsSecInherited.TDn { @@ -2389,10 +3965,10 @@ func getFvESgFvRsSecInheritedChildPayloads(ctx context.Context, diags *diag.Diag } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["tDn"] = fvRsSecInherited.TDn.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"fvRsSecInherited": childMap}) + fvRsSecInheritedChildMapForDelete := NewAciObject() + fvRsSecInheritedChildMapForDelete.Attributes["status"] = "deleted" + fvRsSecInheritedChildMapForDelete.Attributes["tDn"] = fvRsSecInherited.TDn.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"fvRsSecInherited": fvRsSecInheritedChildMapForDelete}) } } } else { @@ -2401,25 +3977,25 @@ func getFvESgFvRsSecInheritedChildPayloads(ctx context.Context, diags *diag.Diag return childPayloads } -func getFvESgTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvESgResourceModel, tagAnnotationPlan, tagAnnotationState []TagAnnotationFvESgResourceModel) []map[string]interface{} { +func getFvESgTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvESgResourceModel, tagAnnotationFvESgPlan, tagAnnotationFvESgState []TagAnnotationFvESgResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagAnnotation.IsUnknown() { + if !data.TagAnnotation.IsNull() && !data.TagAnnotation.IsUnknown() { tagAnnotationIdentifiers := []TagAnnotationIdentifier{} - for _, tagAnnotation := range tagAnnotationPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagAnnotation.Key.IsUnknown() && !tagAnnotation.Key.IsNull() { - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() + for _, tagAnnotationFvESg := range tagAnnotationFvESgPlan { + childMap := NewAciObject() + if !tagAnnotationFvESg.Key.IsNull() && !tagAnnotationFvESg.Key.IsUnknown() { + childMap.Attributes["key"] = tagAnnotationFvESg.Key.ValueString() } - if !tagAnnotation.Value.IsUnknown() && !tagAnnotation.Value.IsNull() { - childMap["attributes"]["value"] = tagAnnotation.Value.ValueString() + if !tagAnnotationFvESg.Value.IsNull() && !tagAnnotationFvESg.Value.IsUnknown() { + childMap.Attributes["value"] = tagAnnotationFvESg.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) tagAnnotationIdentifier := TagAnnotationIdentifier{} - tagAnnotationIdentifier.Key = tagAnnotation.Key + tagAnnotationIdentifier.Key = tagAnnotationFvESg.Key tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) } - for _, tagAnnotation := range tagAnnotationState { + for _, tagAnnotation := range tagAnnotationFvESgState { delete := true for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { if tagAnnotationIdentifier.Key == tagAnnotation.Key { @@ -2428,10 +4004,10 @@ func getFvESgTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnos } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) + tagAnnotationChildMapForDelete := NewAciObject() + tagAnnotationChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationChildMapForDelete.Attributes["key"] = tagAnnotation.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": tagAnnotationChildMapForDelete}) } } } else { @@ -2440,25 +4016,25 @@ func getFvESgTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnos return childPayloads } -func getFvESgTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvESgResourceModel, tagTagPlan, tagTagState []TagTagFvESgResourceModel) []map[string]interface{} { +func getFvESgTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvESgResourceModel, tagTagFvESgPlan, tagTagFvESgState []TagTagFvESgResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagTag.IsUnknown() { + if !data.TagTag.IsNull() && !data.TagTag.IsUnknown() { tagTagIdentifiers := []TagTagIdentifier{} - for _, tagTag := range tagTagPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagTag.Key.IsUnknown() && !tagTag.Key.IsNull() { - childMap["attributes"]["key"] = tagTag.Key.ValueString() + for _, tagTagFvESg := range tagTagFvESgPlan { + childMap := NewAciObject() + if !tagTagFvESg.Key.IsNull() && !tagTagFvESg.Key.IsUnknown() { + childMap.Attributes["key"] = tagTagFvESg.Key.ValueString() } - if !tagTag.Value.IsUnknown() && !tagTag.Value.IsNull() { - childMap["attributes"]["value"] = tagTag.Value.ValueString() + if !tagTagFvESg.Value.IsNull() && !tagTagFvESg.Value.IsUnknown() { + childMap.Attributes["value"] = tagTagFvESg.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) tagTagIdentifier := TagTagIdentifier{} - tagTagIdentifier.Key = tagTag.Key + tagTagIdentifier.Key = tagTagFvESg.Key tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) } - for _, tagTag := range tagTagState { + for _, tagTag := range tagTagFvESgState { delete := true for _, tagTagIdentifier := range tagTagIdentifiers { if tagTagIdentifier.Key == tagTag.Key { @@ -2467,10 +4043,10 @@ func getFvESgTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, d } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagTag.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) + tagTagChildMapForDelete := NewAciObject() + tagTagChildMapForDelete.Attributes["status"] = "deleted" + tagTagChildMapForDelete.Attributes["key"] = tagTag.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagTag": tagTagChildMapForDelete}) } } } else { diff --git a/internal/provider/resource_aci_endpoint_security_group_test.go b/internal/provider/resource_aci_endpoint_security_group_test.go index 116c922a1..2a79ac864 100644 --- a/internal/provider/resource_aci_endpoint_security_group_test.go +++ b/internal/provider/resource_aci_endpoint_security_group_test.go @@ -38,7 +38,7 @@ func TestAccResourceFvESgWithFvAp(t *testing.T) { resource.TestCheckResourceAttr("aci_endpoint_security_group.allow_test_2", "name_alias", ""), resource.TestCheckResourceAttr("aci_endpoint_security_group.allow_test", "preferred_group_member", "exclude"), resource.TestCheckResourceAttr("aci_endpoint_security_group.allow_test_2", "preferred_group_member", "exclude"), - composeAggregateTestCheckFuncWithVersion(t, "5.2(1g)", ">", + composeAggregateTestCheckFuncWithVersion(t, "5.2(1g)", ">=", resource.TestCheckResourceAttr("aci_endpoint_security_group.allow_test", "admin_state", "no"), resource.TestCheckResourceAttr("aci_endpoint_security_group.allow_test_2", "admin_state", "no")), resource.TestCheckResourceAttrSet("aci_endpoint_security_group.allow_test", "pc_tag"), @@ -86,7 +86,7 @@ func TestAccResourceFvESgWithFvAp(t *testing.T) { resource.TestCheckResourceAttr("aci_endpoint_security_group.allow_test_2", "name_alias", ""), resource.TestCheckResourceAttr("aci_endpoint_security_group.allow_test", "preferred_group_member", "exclude"), resource.TestCheckResourceAttr("aci_endpoint_security_group.allow_test_2", "preferred_group_member", "exclude"), - composeAggregateTestCheckFuncWithVersion(t, "5.2(1g)", ">", + composeAggregateTestCheckFuncWithVersion(t, "5.2(1g)", ">=", resource.TestCheckResourceAttr("aci_endpoint_security_group.allow_test", "admin_state", "no"), resource.TestCheckResourceAttr("aci_endpoint_security_group.allow_test_2", "admin_state", "no")), resource.TestCheckResourceAttrSet("aci_endpoint_security_group.allow_test", "pc_tag"), @@ -113,7 +113,7 @@ func TestAccResourceFvESgWithFvAp(t *testing.T) { resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "match_criteria", "AtleastOne"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "name_alias", ""), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "preferred_group_member", "exclude"), - composeAggregateTestCheckFuncWithVersion(t, "5.2(1g)", ">", + composeAggregateTestCheckFuncWithVersion(t, "5.2(1g)", ">=", resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "admin_state", "no")), resource.TestCheckResourceAttrSet("aci_endpoint_security_group.test", "pc_tag"), ), @@ -131,7 +131,7 @@ func TestAccResourceFvESgWithFvAp(t *testing.T) { resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "match_criteria", "All"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "name_alias", "name_alias_1"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "preferred_group_member", "exclude"), - composeAggregateTestCheckFuncWithVersion(t, "5.2(1g)", ">", + composeAggregateTestCheckFuncWithVersion(t, "5.2(1g)", ">=", resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "admin_state", "no")), resource.TestCheckResourceAttrSet("aci_endpoint_security_group.test", "pc_tag"), ), @@ -158,7 +158,7 @@ func TestAccResourceFvESgWithFvAp(t *testing.T) { resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "match_criteria", "AtleastOne"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "name_alias", ""), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "preferred_group_member", "exclude"), - composeAggregateTestCheckFuncWithVersion(t, "5.2(1g)", ">", + composeAggregateTestCheckFuncWithVersion(t, "5.2(1g)", ">=", resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "admin_state", "no")), resource.TestCheckResourceAttrSet("aci_endpoint_security_group.test", "pc_tag"), ), @@ -182,7 +182,7 @@ func TestAccResourceFvESgWithFvAp(t *testing.T) { resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "match_criteria", "AtleastOne"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "name_alias", ""), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "preferred_group_member", "exclude"), - composeAggregateTestCheckFuncWithVersion(t, "5.2(1g)", ">", + composeAggregateTestCheckFuncWithVersion(t, "5.2(1g)", ">=", resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "admin_state", "no")), resource.TestCheckResourceAttrSet("aci_endpoint_security_group.test", "pc_tag"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "annotations.0.key", "key_0"), @@ -248,39 +248,149 @@ func TestAccResourceFvESgWithFvAp(t *testing.T) { resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "annotations.1.value", "test_value"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "annotations.#", "2"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_consumed_contracts.0.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_consumed_contracts.0.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_consumed_contracts.0.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_consumed_contracts.0.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_consumed_contracts.0.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "annotations.#", "2"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_consumed_contracts.0.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_consumed_contracts.0.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_consumed_contracts.0.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_consumed_contracts.0.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "tags.#", "2"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_consumed_contracts.0.contract_name", "contract_name_0"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_consumed_contracts.0.priority", "level1"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_consumed_contracts.1.annotation", "annotation_2"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_consumed_contracts.1.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_consumed_contracts.1.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_consumed_contracts.1.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_consumed_contracts.1.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "annotations.#", "2"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_consumed_contracts.1.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_consumed_contracts.1.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_consumed_contracts.1.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_consumed_contracts.1.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "tags.#", "2"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_consumed_contracts.1.contract_name", "contract_name_1"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_consumed_contracts.1.priority", "level2"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_consumed_contracts.#", "2"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_contract_masters.0.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_contract_masters.0.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_contract_masters.0.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_contract_masters.0.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_contract_masters.0.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "annotations.#", "2"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_contract_masters.0.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_contract_masters.0.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_contract_masters.0.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_contract_masters.0.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "tags.#", "2"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_contract_masters.0.target_dn", "uni/tn-test_tenant/ap-test_ap/esg-esg_0"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_contract_masters.1.annotation", "annotation_2"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_contract_masters.1.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_contract_masters.1.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_contract_masters.1.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_contract_masters.1.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "annotations.#", "2"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_contract_masters.1.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_contract_masters.1.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_contract_masters.1.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_contract_masters.1.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "tags.#", "2"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_contract_masters.1.target_dn", "uni/tn-test_tenant/ap-test_ap/esg-esg_1"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_contract_masters.#", "2"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_imported_contracts.0.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_imported_contracts.0.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_imported_contracts.0.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_imported_contracts.0.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_imported_contracts.0.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "annotations.#", "2"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_imported_contracts.0.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_imported_contracts.0.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_imported_contracts.0.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_imported_contracts.0.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "tags.#", "2"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_imported_contracts.0.imported_contract_name", "imported_contract_name_0"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_imported_contracts.0.priority", "level1"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_imported_contracts.1.annotation", "annotation_2"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_imported_contracts.1.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_imported_contracts.1.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_imported_contracts.1.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_imported_contracts.1.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "annotations.#", "2"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_imported_contracts.1.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_imported_contracts.1.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_imported_contracts.1.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_imported_contracts.1.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "tags.#", "2"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_imported_contracts.1.imported_contract_name", "imported_contract_name_1"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_imported_contracts.1.priority", "level2"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_imported_contracts.#", "2"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_intra_epg_contracts.0.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_intra_epg_contracts.0.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_intra_epg_contracts.0.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_intra_epg_contracts.0.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_intra_epg_contracts.0.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "annotations.#", "2"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_intra_epg_contracts.0.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_intra_epg_contracts.0.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_intra_epg_contracts.0.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_intra_epg_contracts.0.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "tags.#", "2"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_intra_epg_contracts.0.contract_name", "contract_name_0"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_intra_epg_contracts.1.annotation", "annotation_2"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_intra_epg_contracts.1.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_intra_epg_contracts.1.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_intra_epg_contracts.1.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_intra_epg_contracts.1.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "annotations.#", "2"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_intra_epg_contracts.1.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_intra_epg_contracts.1.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_intra_epg_contracts.1.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_intra_epg_contracts.1.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "tags.#", "2"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_intra_epg_contracts.1.contract_name", "contract_name_1"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_intra_epg_contracts.#", "2"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_provided_contracts.0.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_provided_contracts.0.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_provided_contracts.0.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_provided_contracts.0.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_provided_contracts.0.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "annotations.#", "2"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_provided_contracts.0.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_provided_contracts.0.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_provided_contracts.0.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_provided_contracts.0.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "tags.#", "2"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_provided_contracts.0.contract_name", "contract_name_0"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_provided_contracts.0.match_criteria", "All"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_provided_contracts.0.priority", "level1"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_provided_contracts.1.annotation", "annotation_2"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_provided_contracts.1.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_provided_contracts.1.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_provided_contracts.1.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_provided_contracts.1.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "annotations.#", "2"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_provided_contracts.1.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_provided_contracts.1.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_provided_contracts.1.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_provided_contracts.1.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "tags.#", "2"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_provided_contracts.1.contract_name", "contract_name_1"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_provided_contracts.1.match_criteria", "AtleastOne"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_provided_contracts.1.priority", "level2"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_provided_contracts.#", "2"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_vrf.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_vrf.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_vrf.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_vrf.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_vrf.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "annotations.#", "2"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_vrf.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_vrf.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_vrf.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_vrf.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "tags.#", "2"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_vrf.vrf_name", "vrf_name_1"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "tags.0.key", "key_0"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "tags.0.value", "value_1"), @@ -299,25 +409,61 @@ func TestAccResourceFvESgWithFvAp(t *testing.T) { resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "annotations.0.value", "test_value"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "annotations.#", "1"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_consumed_contracts.0.annotation", "annotation_2"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_consumed_contracts.0.annotations.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_consumed_contracts.0.annotations.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_consumed_contracts.0.annotations.#", "1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_consumed_contracts.0.tags.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_consumed_contracts.0.tags.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_consumed_contracts.0.tags.#", "1"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_consumed_contracts.0.contract_name", "contract_name_1"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_consumed_contracts.0.priority", "level2"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_consumed_contracts.#", "1"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_contract_masters.0.annotation", "annotation_2"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_contract_masters.0.annotations.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_contract_masters.0.annotations.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_contract_masters.0.annotations.#", "1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_contract_masters.0.tags.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_contract_masters.0.tags.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_contract_masters.0.tags.#", "1"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_contract_masters.0.target_dn", "uni/tn-test_tenant/ap-test_ap/esg-esg_1"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_contract_masters.#", "1"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_imported_contracts.0.annotation", "annotation_2"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_imported_contracts.0.annotations.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_imported_contracts.0.annotations.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_imported_contracts.0.annotations.#", "1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_imported_contracts.0.tags.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_imported_contracts.0.tags.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_imported_contracts.0.tags.#", "1"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_imported_contracts.0.imported_contract_name", "imported_contract_name_1"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_imported_contracts.0.priority", "level2"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_imported_contracts.#", "1"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_intra_epg_contracts.0.annotation", "annotation_2"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_intra_epg_contracts.0.annotations.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_intra_epg_contracts.0.annotations.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_intra_epg_contracts.0.annotations.#", "1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_intra_epg_contracts.0.tags.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_intra_epg_contracts.0.tags.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_intra_epg_contracts.0.tags.#", "1"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_intra_epg_contracts.0.contract_name", "contract_name_1"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_intra_epg_contracts.#", "1"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_provided_contracts.0.annotation", "annotation_2"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_provided_contracts.0.annotations.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_provided_contracts.0.annotations.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_provided_contracts.0.annotations.#", "1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_provided_contracts.0.tags.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_provided_contracts.0.tags.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_provided_contracts.0.tags.#", "1"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_provided_contracts.0.contract_name", "contract_name_1"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_provided_contracts.0.match_criteria", "AtleastOne"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_provided_contracts.0.priority", "level2"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_provided_contracts.#", "1"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_vrf.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_vrf.annotations.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_vrf.annotations.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_vrf.annotations.#", "1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_vrf.tags.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_vrf.tags.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_vrf.tags.#", "1"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_vrf.vrf_name", "vrf_name_1"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "tags.0.key", "key_1"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "tags.0.value", "test_value"), @@ -337,6 +483,8 @@ func TestAccResourceFvESgWithFvAp(t *testing.T) { resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_intra_epg_contracts.#", "0"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_provided_contracts.#", "0"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_vrf.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_vrf.annotations.#", "0"), + resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_vrf.tags.#", "0"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_vrf.vrf_name", "vrf_name_1"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "tags.#", "0"), ), @@ -410,86 +558,306 @@ resource "aci_endpoint_security_group" "test" { parent_dn = aci_application_profile.test.id name = "test_name" annotations = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] relation_to_consumed_contracts = [ - { - annotation = "annotation_1" - contract_name = "contract_name_0" - priority = "level1" - }, - { - annotation = "annotation_2" - contract_name = "contract_name_1" - priority = "level2" - }, + { + annotation = "annotation_1" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + contract_name = "contract_name_0" + priority = "level1" + }, + { + annotation = "annotation_2" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + contract_name = "contract_name_1" + priority = "level2" + }, ] relation_to_contract_masters = [ - { - annotation = "annotation_1" - target_dn = aci_endpoint_security_group.test_endpoint_security_group_0.id - }, - { - annotation = "annotation_2" - target_dn = aci_endpoint_security_group.test_endpoint_security_group_1.id - }, + { + annotation = "annotation_1" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + target_dn = aci_endpoint_security_group.test_endpoint_security_group_0.id + }, + { + annotation = "annotation_2" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + target_dn = aci_endpoint_security_group.test_endpoint_security_group_1.id + }, ] relation_to_imported_contracts = [ - { - annotation = "annotation_1" - imported_contract_name = "imported_contract_name_0" - priority = "level1" - }, - { - annotation = "annotation_2" - imported_contract_name = "imported_contract_name_1" - priority = "level2" - }, + { + annotation = "annotation_1" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + imported_contract_name = "imported_contract_name_0" + priority = "level1" + }, + { + annotation = "annotation_2" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + imported_contract_name = "imported_contract_name_1" + priority = "level2" + }, ] relation_to_intra_epg_contracts = [ - { - annotation = "annotation_1" - contract_name = "contract_name_0" - }, - { - annotation = "annotation_2" - contract_name = "contract_name_1" - }, + { + annotation = "annotation_1" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + contract_name = "contract_name_0" + }, + { + annotation = "annotation_2" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + contract_name = "contract_name_1" + }, ] relation_to_provided_contracts = [ - { - annotation = "annotation_1" - contract_name = "contract_name_0" - match_criteria = "All" - priority = "level1" - }, - { - annotation = "annotation_2" - contract_name = "contract_name_1" - match_criteria = "AtleastOne" - priority = "level2" - }, + { + annotation = "annotation_1" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + contract_name = "contract_name_0" + match_criteria = "All" + priority = "level1" + }, + { + annotation = "annotation_2" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + contract_name = "contract_name_1" + match_criteria = "AtleastOne" + priority = "level2" + }, ] relation_to_vrf = { annotation = "annotation_1" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] vrf_name = "vrf_name_1" } tags = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] } ` @@ -514,6 +882,18 @@ resource "aci_endpoint_security_group" "test" { relation_to_consumed_contracts = [ { annotation = "annotation_2" + annotations = [ + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_1" + value = "test_value" + }, + ] contract_name = "contract_name_1" priority = "level2" }, @@ -521,12 +901,36 @@ resource "aci_endpoint_security_group" "test" { relation_to_contract_masters = [ { annotation = "annotation_2" + annotations = [ + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_1" + value = "test_value" + }, + ] target_dn = aci_endpoint_security_group.test_endpoint_security_group_1.id }, ] relation_to_imported_contracts = [ { annotation = "annotation_2" + annotations = [ + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_1" + value = "test_value" + }, + ] imported_contract_name = "imported_contract_name_1" priority = "level2" }, @@ -534,17 +938,57 @@ resource "aci_endpoint_security_group" "test" { relation_to_intra_epg_contracts = [ { annotation = "annotation_2" + annotations = [ + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_1" + value = "test_value" + }, + ] contract_name = "contract_name_1" }, ] relation_to_provided_contracts = [ { annotation = "annotation_2" + annotations = [ + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_1" + value = "test_value" + }, + ] contract_name = "contract_name_1" match_criteria = "AtleastOne" priority = "level2" }, ] + relation_to_vrf = { + annotation = "annotation_1" + annotations = [ + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_1" + value = "test_value" + }, + ] + vrf_name = "vrf_name_1" + } tags = [ { key = "key_1" @@ -564,6 +1008,12 @@ resource "aci_endpoint_security_group" "test" { relation_to_imported_contracts = [] relation_to_intra_epg_contracts = [] relation_to_provided_contracts = [] + relation_to_vrf = { + annotation = "annotation_1" + annotations = [] + tags = [] + vrf_name = "vrf_name_1" + } tags = [] } ` diff --git a/internal/provider/resource_aci_endpoint_tag_ip.go b/internal/provider/resource_aci_endpoint_tag_ip.go index fba9b361d..1300f50a7 100644 --- a/internal/provider/resource_aci_endpoint_tag_ip.go +++ b/internal/provider/resource_aci_endpoint_tag_ip.go @@ -91,6 +91,13 @@ func getEmptyTagAnnotationFvEpIpTagResourceModel() TagAnnotationFvEpIpTagResourc } } +var TagAnnotationFvEpIpTagType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // TagTagFvEpIpTagResourceModel describes the resource data model for the children without relation ships. type TagTagFvEpIpTagResourceModel struct { Key types.String `tfsdk:"key"` @@ -104,6 +111,13 @@ func getEmptyTagTagFvEpIpTagResourceModel() TagTagFvEpIpTagResourceModel { } } +var TagTagFvEpIpTagType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + type FvEpIpTagIdentifier struct { CtxName types.String Ip types.String @@ -454,7 +468,7 @@ func (r *FvEpIpTagResource) ImportState(ctx context.Context, req resource.Import } func getAndSetFvEpIpTagAttributes(ctx context.Context, diags *diag.Diagnostics, client *client.Client, data *FvEpIpTagResourceModel) { - requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=children&rsp-subtree-class=%s", data.Id.ValueString(), "fvEpIpTag,tagAnnotation,tagTag"), "GET", nil) + requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=full&rsp-subtree-class=%s", data.Id.ValueString(), "fvEpIpTag,tagAnnotation,tagTag"), "GET", nil) readData := getEmptyFvEpIpTagResourceModel() @@ -506,6 +520,7 @@ func getAndSetFvEpIpTagAttributes(ctx context.Context, diags *diag.Diagnostics, if childAttributeName == "value" { TagAnnotationFvEpIpTag.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagAnnotationFvEpIpTagList = append(TagAnnotationFvEpIpTagList, TagAnnotationFvEpIpTag) } @@ -518,6 +533,7 @@ func getAndSetFvEpIpTagAttributes(ctx context.Context, diags *diag.Diagnostics, if childAttributeName == "value" { TagTagFvEpIpTag.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagTagFvEpIpTagList = append(TagTagFvEpIpTagList, TagTagFvEpIpTag) } @@ -567,25 +583,24 @@ func setFvEpIpTagId(ctx context.Context, data *FvEpIpTagResourceModel) { data.Id = types.StringValue(fmt.Sprintf("%s/%s", data.ParentDn.ValueString(), rn)) } -func getFvEpIpTagTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvEpIpTagResourceModel, tagAnnotationPlan, tagAnnotationState []TagAnnotationFvEpIpTagResourceModel) []map[string]interface{} { - +func getFvEpIpTagTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvEpIpTagResourceModel, tagAnnotationFvEpIpTagPlan, tagAnnotationFvEpIpTagState []TagAnnotationFvEpIpTagResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagAnnotation.IsUnknown() { + if !data.TagAnnotation.IsNull() && !data.TagAnnotation.IsUnknown() { tagAnnotationIdentifiers := []TagAnnotationIdentifier{} - for _, tagAnnotation := range tagAnnotationPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagAnnotation.Key.IsUnknown() && !tagAnnotation.Key.IsNull() { - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() + for _, tagAnnotationFvEpIpTag := range tagAnnotationFvEpIpTagPlan { + childMap := NewAciObject() + if !tagAnnotationFvEpIpTag.Key.IsNull() && !tagAnnotationFvEpIpTag.Key.IsUnknown() { + childMap.Attributes["key"] = tagAnnotationFvEpIpTag.Key.ValueString() } - if !tagAnnotation.Value.IsUnknown() && !tagAnnotation.Value.IsNull() { - childMap["attributes"]["value"] = tagAnnotation.Value.ValueString() + if !tagAnnotationFvEpIpTag.Value.IsNull() && !tagAnnotationFvEpIpTag.Value.IsUnknown() { + childMap.Attributes["value"] = tagAnnotationFvEpIpTag.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) tagAnnotationIdentifier := TagAnnotationIdentifier{} - tagAnnotationIdentifier.Key = tagAnnotation.Key + tagAnnotationIdentifier.Key = tagAnnotationFvEpIpTag.Key tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) } - for _, tagAnnotation := range tagAnnotationState { + for _, tagAnnotation := range tagAnnotationFvEpIpTagState { delete := true for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { if tagAnnotationIdentifier.Key == tagAnnotation.Key { @@ -594,10 +609,10 @@ func getFvEpIpTagTagAnnotationChildPayloads(ctx context.Context, diags *diag.Dia } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) + tagAnnotationChildMapForDelete := NewAciObject() + tagAnnotationChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationChildMapForDelete.Attributes["key"] = tagAnnotation.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": tagAnnotationChildMapForDelete}) } } } else { @@ -606,25 +621,25 @@ func getFvEpIpTagTagAnnotationChildPayloads(ctx context.Context, diags *diag.Dia return childPayloads } -func getFvEpIpTagTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvEpIpTagResourceModel, tagTagPlan, tagTagState []TagTagFvEpIpTagResourceModel) []map[string]interface{} { +func getFvEpIpTagTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvEpIpTagResourceModel, tagTagFvEpIpTagPlan, tagTagFvEpIpTagState []TagTagFvEpIpTagResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagTag.IsUnknown() { + if !data.TagTag.IsNull() && !data.TagTag.IsUnknown() { tagTagIdentifiers := []TagTagIdentifier{} - for _, tagTag := range tagTagPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagTag.Key.IsUnknown() && !tagTag.Key.IsNull() { - childMap["attributes"]["key"] = tagTag.Key.ValueString() + for _, tagTagFvEpIpTag := range tagTagFvEpIpTagPlan { + childMap := NewAciObject() + if !tagTagFvEpIpTag.Key.IsNull() && !tagTagFvEpIpTag.Key.IsUnknown() { + childMap.Attributes["key"] = tagTagFvEpIpTag.Key.ValueString() } - if !tagTag.Value.IsUnknown() && !tagTag.Value.IsNull() { - childMap["attributes"]["value"] = tagTag.Value.ValueString() + if !tagTagFvEpIpTag.Value.IsNull() && !tagTagFvEpIpTag.Value.IsUnknown() { + childMap.Attributes["value"] = tagTagFvEpIpTag.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) tagTagIdentifier := TagTagIdentifier{} - tagTagIdentifier.Key = tagTag.Key + tagTagIdentifier.Key = tagTagFvEpIpTag.Key tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) } - for _, tagTag := range tagTagState { + for _, tagTag := range tagTagFvEpIpTagState { delete := true for _, tagTagIdentifier := range tagTagIdentifiers { if tagTagIdentifier.Key == tagTag.Key { @@ -633,10 +648,10 @@ func getFvEpIpTagTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostic } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagTag.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) + tagTagChildMapForDelete := NewAciObject() + tagTagChildMapForDelete.Attributes["status"] = "deleted" + tagTagChildMapForDelete.Attributes["key"] = tagTag.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagTag": tagTagChildMapForDelete}) } } } else { diff --git a/internal/provider/resource_aci_endpoint_tag_ip_test.go b/internal/provider/resource_aci_endpoint_tag_ip_test.go index a48f8c3c4..2adcc4bb3 100644 --- a/internal/provider/resource_aci_endpoint_tag_ip_test.go +++ b/internal/provider/resource_aci_endpoint_tag_ip_test.go @@ -264,24 +264,24 @@ resource "aci_endpoint_tag_ip" "test" { ip = "10.0.0.2" vrf_name = "test_ctx_name" annotations = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] tags = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] } ` diff --git a/internal/provider/resource_aci_endpoint_tag_mac.go b/internal/provider/resource_aci_endpoint_tag_mac.go index 47039bdd1..8408a81ab 100644 --- a/internal/provider/resource_aci_endpoint_tag_mac.go +++ b/internal/provider/resource_aci_endpoint_tag_mac.go @@ -91,6 +91,13 @@ func getEmptyTagAnnotationFvEpMacTagResourceModel() TagAnnotationFvEpMacTagResou } } +var TagAnnotationFvEpMacTagType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // TagTagFvEpMacTagResourceModel describes the resource data model for the children without relation ships. type TagTagFvEpMacTagResourceModel struct { Key types.String `tfsdk:"key"` @@ -104,6 +111,13 @@ func getEmptyTagTagFvEpMacTagResourceModel() TagTagFvEpMacTagResourceModel { } } +var TagTagFvEpMacTagType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + type FvEpMacTagIdentifier struct { BdName types.String Mac types.String @@ -454,7 +468,7 @@ func (r *FvEpMacTagResource) ImportState(ctx context.Context, req resource.Impor } func getAndSetFvEpMacTagAttributes(ctx context.Context, diags *diag.Diagnostics, client *client.Client, data *FvEpMacTagResourceModel) { - requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=children&rsp-subtree-class=%s", data.Id.ValueString(), "fvEpMacTag,tagAnnotation,tagTag"), "GET", nil) + requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=full&rsp-subtree-class=%s", data.Id.ValueString(), "fvEpMacTag,tagAnnotation,tagTag"), "GET", nil) readData := getEmptyFvEpMacTagResourceModel() @@ -506,6 +520,7 @@ func getAndSetFvEpMacTagAttributes(ctx context.Context, diags *diag.Diagnostics, if childAttributeName == "value" { TagAnnotationFvEpMacTag.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagAnnotationFvEpMacTagList = append(TagAnnotationFvEpMacTagList, TagAnnotationFvEpMacTag) } @@ -518,6 +533,7 @@ func getAndSetFvEpMacTagAttributes(ctx context.Context, diags *diag.Diagnostics, if childAttributeName == "value" { TagTagFvEpMacTag.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagTagFvEpMacTagList = append(TagTagFvEpMacTagList, TagTagFvEpMacTag) } @@ -567,25 +583,24 @@ func setFvEpMacTagId(ctx context.Context, data *FvEpMacTagResourceModel) { data.Id = types.StringValue(fmt.Sprintf("%s/%s", data.ParentDn.ValueString(), rn)) } -func getFvEpMacTagTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvEpMacTagResourceModel, tagAnnotationPlan, tagAnnotationState []TagAnnotationFvEpMacTagResourceModel) []map[string]interface{} { - +func getFvEpMacTagTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvEpMacTagResourceModel, tagAnnotationFvEpMacTagPlan, tagAnnotationFvEpMacTagState []TagAnnotationFvEpMacTagResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagAnnotation.IsUnknown() { + if !data.TagAnnotation.IsNull() && !data.TagAnnotation.IsUnknown() { tagAnnotationIdentifiers := []TagAnnotationIdentifier{} - for _, tagAnnotation := range tagAnnotationPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagAnnotation.Key.IsUnknown() && !tagAnnotation.Key.IsNull() { - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() + for _, tagAnnotationFvEpMacTag := range tagAnnotationFvEpMacTagPlan { + childMap := NewAciObject() + if !tagAnnotationFvEpMacTag.Key.IsNull() && !tagAnnotationFvEpMacTag.Key.IsUnknown() { + childMap.Attributes["key"] = tagAnnotationFvEpMacTag.Key.ValueString() } - if !tagAnnotation.Value.IsUnknown() && !tagAnnotation.Value.IsNull() { - childMap["attributes"]["value"] = tagAnnotation.Value.ValueString() + if !tagAnnotationFvEpMacTag.Value.IsNull() && !tagAnnotationFvEpMacTag.Value.IsUnknown() { + childMap.Attributes["value"] = tagAnnotationFvEpMacTag.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) tagAnnotationIdentifier := TagAnnotationIdentifier{} - tagAnnotationIdentifier.Key = tagAnnotation.Key + tagAnnotationIdentifier.Key = tagAnnotationFvEpMacTag.Key tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) } - for _, tagAnnotation := range tagAnnotationState { + for _, tagAnnotation := range tagAnnotationFvEpMacTagState { delete := true for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { if tagAnnotationIdentifier.Key == tagAnnotation.Key { @@ -594,10 +609,10 @@ func getFvEpMacTagTagAnnotationChildPayloads(ctx context.Context, diags *diag.Di } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) + tagAnnotationChildMapForDelete := NewAciObject() + tagAnnotationChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationChildMapForDelete.Attributes["key"] = tagAnnotation.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": tagAnnotationChildMapForDelete}) } } } else { @@ -606,25 +621,25 @@ func getFvEpMacTagTagAnnotationChildPayloads(ctx context.Context, diags *diag.Di return childPayloads } -func getFvEpMacTagTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvEpMacTagResourceModel, tagTagPlan, tagTagState []TagTagFvEpMacTagResourceModel) []map[string]interface{} { +func getFvEpMacTagTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvEpMacTagResourceModel, tagTagFvEpMacTagPlan, tagTagFvEpMacTagState []TagTagFvEpMacTagResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagTag.IsUnknown() { + if !data.TagTag.IsNull() && !data.TagTag.IsUnknown() { tagTagIdentifiers := []TagTagIdentifier{} - for _, tagTag := range tagTagPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagTag.Key.IsUnknown() && !tagTag.Key.IsNull() { - childMap["attributes"]["key"] = tagTag.Key.ValueString() + for _, tagTagFvEpMacTag := range tagTagFvEpMacTagPlan { + childMap := NewAciObject() + if !tagTagFvEpMacTag.Key.IsNull() && !tagTagFvEpMacTag.Key.IsUnknown() { + childMap.Attributes["key"] = tagTagFvEpMacTag.Key.ValueString() } - if !tagTag.Value.IsUnknown() && !tagTag.Value.IsNull() { - childMap["attributes"]["value"] = tagTag.Value.ValueString() + if !tagTagFvEpMacTag.Value.IsNull() && !tagTagFvEpMacTag.Value.IsUnknown() { + childMap.Attributes["value"] = tagTagFvEpMacTag.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) tagTagIdentifier := TagTagIdentifier{} - tagTagIdentifier.Key = tagTag.Key + tagTagIdentifier.Key = tagTagFvEpMacTag.Key tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) } - for _, tagTag := range tagTagState { + for _, tagTag := range tagTagFvEpMacTagState { delete := true for _, tagTagIdentifier := range tagTagIdentifiers { if tagTagIdentifier.Key == tagTag.Key { @@ -633,10 +648,10 @@ func getFvEpMacTagTagTagChildPayloads(ctx context.Context, diags *diag.Diagnosti } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagTag.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) + tagTagChildMapForDelete := NewAciObject() + tagTagChildMapForDelete.Attributes["status"] = "deleted" + tagTagChildMapForDelete.Attributes["key"] = tagTag.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagTag": tagTagChildMapForDelete}) } } } else { diff --git a/internal/provider/resource_aci_endpoint_tag_mac_test.go b/internal/provider/resource_aci_endpoint_tag_mac_test.go index acc74c19a..2a85044f2 100644 --- a/internal/provider/resource_aci_endpoint_tag_mac_test.go +++ b/internal/provider/resource_aci_endpoint_tag_mac_test.go @@ -264,24 +264,24 @@ resource "aci_endpoint_tag_mac" "test" { bd_name = "test_bd_name" mac = "00:00:00:00:00:01" annotations = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] tags = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] } ` diff --git a/internal/provider/resource_aci_epg_useg_ad_group_attribute.go b/internal/provider/resource_aci_epg_useg_ad_group_attribute.go index ba8844413..272ef1544 100644 --- a/internal/provider/resource_aci_epg_useg_ad_group_attribute.go +++ b/internal/provider/resource_aci_epg_useg_ad_group_attribute.go @@ -92,6 +92,13 @@ func getEmptyTagAnnotationFvIdGroupAttrResourceModel() TagAnnotationFvIdGroupAtt } } +var TagAnnotationFvIdGroupAttrType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // TagTagFvIdGroupAttrResourceModel describes the resource data model for the children without relation ships. type TagTagFvIdGroupAttrResourceModel struct { Key types.String `tfsdk:"key"` @@ -105,6 +112,13 @@ func getEmptyTagTagFvIdGroupAttrResourceModel() TagTagFvIdGroupAttrResourceModel } } +var TagTagFvIdGroupAttrType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + type FvIdGroupAttrIdentifier struct { Selector types.String } @@ -463,7 +477,7 @@ func (r *FvIdGroupAttrResource) ImportState(ctx context.Context, req resource.Im } func getAndSetFvIdGroupAttrAttributes(ctx context.Context, diags *diag.Diagnostics, client *client.Client, data *FvIdGroupAttrResourceModel) { - requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=children&rsp-subtree-class=%s", data.Id.ValueString(), "fvIdGroupAttr,tagAnnotation,tagTag"), "GET", nil) + requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=full&rsp-subtree-class=%s", data.Id.ValueString(), "fvIdGroupAttr,tagAnnotation,tagTag"), "GET", nil) readData := getEmptyFvIdGroupAttrResourceModel() @@ -518,6 +532,7 @@ func getAndSetFvIdGroupAttrAttributes(ctx context.Context, diags *diag.Diagnosti if childAttributeName == "value" { TagAnnotationFvIdGroupAttr.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagAnnotationFvIdGroupAttrList = append(TagAnnotationFvIdGroupAttrList, TagAnnotationFvIdGroupAttr) } @@ -530,6 +545,7 @@ func getAndSetFvIdGroupAttrAttributes(ctx context.Context, diags *diag.Diagnosti if childAttributeName == "value" { TagTagFvIdGroupAttr.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagTagFvIdGroupAttrList = append(TagTagFvIdGroupAttrList, TagTagFvIdGroupAttr) } @@ -577,25 +593,24 @@ func setFvIdGroupAttrId(ctx context.Context, data *FvIdGroupAttrResourceModel) { data.Id = types.StringValue(fmt.Sprintf("%s/%s", data.ParentDn.ValueString(), rn)) } -func getFvIdGroupAttrTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvIdGroupAttrResourceModel, tagAnnotationPlan, tagAnnotationState []TagAnnotationFvIdGroupAttrResourceModel) []map[string]interface{} { - +func getFvIdGroupAttrTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvIdGroupAttrResourceModel, tagAnnotationFvIdGroupAttrPlan, tagAnnotationFvIdGroupAttrState []TagAnnotationFvIdGroupAttrResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagAnnotation.IsUnknown() { + if !data.TagAnnotation.IsNull() && !data.TagAnnotation.IsUnknown() { tagAnnotationIdentifiers := []TagAnnotationIdentifier{} - for _, tagAnnotation := range tagAnnotationPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagAnnotation.Key.IsUnknown() && !tagAnnotation.Key.IsNull() { - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() + for _, tagAnnotationFvIdGroupAttr := range tagAnnotationFvIdGroupAttrPlan { + childMap := NewAciObject() + if !tagAnnotationFvIdGroupAttr.Key.IsNull() && !tagAnnotationFvIdGroupAttr.Key.IsUnknown() { + childMap.Attributes["key"] = tagAnnotationFvIdGroupAttr.Key.ValueString() } - if !tagAnnotation.Value.IsUnknown() && !tagAnnotation.Value.IsNull() { - childMap["attributes"]["value"] = tagAnnotation.Value.ValueString() + if !tagAnnotationFvIdGroupAttr.Value.IsNull() && !tagAnnotationFvIdGroupAttr.Value.IsUnknown() { + childMap.Attributes["value"] = tagAnnotationFvIdGroupAttr.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) tagAnnotationIdentifier := TagAnnotationIdentifier{} - tagAnnotationIdentifier.Key = tagAnnotation.Key + tagAnnotationIdentifier.Key = tagAnnotationFvIdGroupAttr.Key tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) } - for _, tagAnnotation := range tagAnnotationState { + for _, tagAnnotation := range tagAnnotationFvIdGroupAttrState { delete := true for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { if tagAnnotationIdentifier.Key == tagAnnotation.Key { @@ -604,10 +619,10 @@ func getFvIdGroupAttrTagAnnotationChildPayloads(ctx context.Context, diags *diag } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) + tagAnnotationChildMapForDelete := NewAciObject() + tagAnnotationChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationChildMapForDelete.Attributes["key"] = tagAnnotation.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": tagAnnotationChildMapForDelete}) } } } else { @@ -616,25 +631,25 @@ func getFvIdGroupAttrTagAnnotationChildPayloads(ctx context.Context, diags *diag return childPayloads } -func getFvIdGroupAttrTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvIdGroupAttrResourceModel, tagTagPlan, tagTagState []TagTagFvIdGroupAttrResourceModel) []map[string]interface{} { +func getFvIdGroupAttrTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvIdGroupAttrResourceModel, tagTagFvIdGroupAttrPlan, tagTagFvIdGroupAttrState []TagTagFvIdGroupAttrResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagTag.IsUnknown() { + if !data.TagTag.IsNull() && !data.TagTag.IsUnknown() { tagTagIdentifiers := []TagTagIdentifier{} - for _, tagTag := range tagTagPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagTag.Key.IsUnknown() && !tagTag.Key.IsNull() { - childMap["attributes"]["key"] = tagTag.Key.ValueString() + for _, tagTagFvIdGroupAttr := range tagTagFvIdGroupAttrPlan { + childMap := NewAciObject() + if !tagTagFvIdGroupAttr.Key.IsNull() && !tagTagFvIdGroupAttr.Key.IsUnknown() { + childMap.Attributes["key"] = tagTagFvIdGroupAttr.Key.ValueString() } - if !tagTag.Value.IsUnknown() && !tagTag.Value.IsNull() { - childMap["attributes"]["value"] = tagTag.Value.ValueString() + if !tagTagFvIdGroupAttr.Value.IsNull() && !tagTagFvIdGroupAttr.Value.IsUnknown() { + childMap.Attributes["value"] = tagTagFvIdGroupAttr.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) tagTagIdentifier := TagTagIdentifier{} - tagTagIdentifier.Key = tagTag.Key + tagTagIdentifier.Key = tagTagFvIdGroupAttr.Key tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) } - for _, tagTag := range tagTagState { + for _, tagTag := range tagTagFvIdGroupAttrState { delete := true for _, tagTagIdentifier := range tagTagIdentifiers { if tagTagIdentifier.Key == tagTag.Key { @@ -643,10 +658,10 @@ func getFvIdGroupAttrTagTagChildPayloads(ctx context.Context, diags *diag.Diagno } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagTag.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) + tagTagChildMapForDelete := NewAciObject() + tagTagChildMapForDelete.Attributes["status"] = "deleted" + tagTagChildMapForDelete.Attributes["key"] = tagTag.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagTag": tagTagChildMapForDelete}) } } } else { diff --git a/internal/provider/resource_aci_epg_useg_ad_group_attribute_test.go b/internal/provider/resource_aci_epg_useg_ad_group_attribute_test.go index 2303669ca..4adeb0c2f 100644 --- a/internal/provider/resource_aci_epg_useg_ad_group_attribute_test.go +++ b/internal/provider/resource_aci_epg_useg_ad_group_attribute_test.go @@ -269,24 +269,24 @@ resource "aci_epg_useg_ad_group_attribute" "test" { parent_dn = aci_epg_useg_block_statement.test.id selector = "adepg/authsvr-common-sg1-ISE_1/grpcont/dom-cisco.com/grp-Eng" annotations = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] tags = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] } ` diff --git a/internal/provider/resource_aci_epg_useg_block_statement.go b/internal/provider/resource_aci_epg_useg_block_statement.go index c899255b5..ef48597f5 100644 --- a/internal/provider/resource_aci_epg_useg_block_statement.go +++ b/internal/provider/resource_aci_epg_useg_block_statement.go @@ -98,6 +98,13 @@ func getEmptyTagAnnotationFvCrtrnResourceModel() TagAnnotationFvCrtrnResourceMod } } +var TagAnnotationFvCrtrnType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // TagTagFvCrtrnResourceModel describes the resource data model for the children without relation ships. type TagTagFvCrtrnResourceModel struct { Key types.String `tfsdk:"key"` @@ -111,6 +118,13 @@ func getEmptyTagTagFvCrtrnResourceModel() TagTagFvCrtrnResourceModel { } } +var TagTagFvCrtrnType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + func (r *FvCrtrnResource) ModifyPlan(ctx context.Context, req resource.ModifyPlanRequest, resp *resource.ModifyPlanResponse) { if !req.Plan.Raw.IsNull() { var planData, stateData *FvCrtrnResourceModel @@ -489,7 +503,7 @@ func (r *FvCrtrnResource) ImportState(ctx context.Context, req resource.ImportSt } func getAndSetFvCrtrnAttributes(ctx context.Context, diags *diag.Diagnostics, client *client.Client, data *FvCrtrnResourceModel) { - requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=children&rsp-subtree-class=%s", data.Id.ValueString(), "fvCrtrn,tagAnnotation,tagTag"), "GET", nil) + requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=full&rsp-subtree-class=%s", data.Id.ValueString(), "fvCrtrn,tagAnnotation,tagTag"), "GET", nil) readData := getEmptyFvCrtrnResourceModel() @@ -550,6 +564,7 @@ func getAndSetFvCrtrnAttributes(ctx context.Context, diags *diag.Diagnostics, cl if childAttributeName == "value" { TagAnnotationFvCrtrn.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagAnnotationFvCrtrnList = append(TagAnnotationFvCrtrnList, TagAnnotationFvCrtrn) } @@ -562,6 +577,7 @@ func getAndSetFvCrtrnAttributes(ctx context.Context, diags *diag.Diagnostics, cl if childAttributeName == "value" { TagTagFvCrtrn.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagTagFvCrtrnList = append(TagTagFvCrtrnList, TagTagFvCrtrn) } @@ -609,25 +625,24 @@ func setFvCrtrnId(ctx context.Context, data *FvCrtrnResourceModel) { data.Id = types.StringValue(fmt.Sprintf("%s/%s", data.ParentDn.ValueString(), rn)) } -func getFvCrtrnTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvCrtrnResourceModel, tagAnnotationPlan, tagAnnotationState []TagAnnotationFvCrtrnResourceModel) []map[string]interface{} { - +func getFvCrtrnTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvCrtrnResourceModel, tagAnnotationFvCrtrnPlan, tagAnnotationFvCrtrnState []TagAnnotationFvCrtrnResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagAnnotation.IsUnknown() { + if !data.TagAnnotation.IsNull() && !data.TagAnnotation.IsUnknown() { tagAnnotationIdentifiers := []TagAnnotationIdentifier{} - for _, tagAnnotation := range tagAnnotationPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagAnnotation.Key.IsUnknown() && !tagAnnotation.Key.IsNull() { - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() + for _, tagAnnotationFvCrtrn := range tagAnnotationFvCrtrnPlan { + childMap := NewAciObject() + if !tagAnnotationFvCrtrn.Key.IsNull() && !tagAnnotationFvCrtrn.Key.IsUnknown() { + childMap.Attributes["key"] = tagAnnotationFvCrtrn.Key.ValueString() } - if !tagAnnotation.Value.IsUnknown() && !tagAnnotation.Value.IsNull() { - childMap["attributes"]["value"] = tagAnnotation.Value.ValueString() + if !tagAnnotationFvCrtrn.Value.IsNull() && !tagAnnotationFvCrtrn.Value.IsUnknown() { + childMap.Attributes["value"] = tagAnnotationFvCrtrn.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) tagAnnotationIdentifier := TagAnnotationIdentifier{} - tagAnnotationIdentifier.Key = tagAnnotation.Key + tagAnnotationIdentifier.Key = tagAnnotationFvCrtrn.Key tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) } - for _, tagAnnotation := range tagAnnotationState { + for _, tagAnnotation := range tagAnnotationFvCrtrnState { delete := true for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { if tagAnnotationIdentifier.Key == tagAnnotation.Key { @@ -636,10 +651,10 @@ func getFvCrtrnTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagn } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) + tagAnnotationChildMapForDelete := NewAciObject() + tagAnnotationChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationChildMapForDelete.Attributes["key"] = tagAnnotation.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": tagAnnotationChildMapForDelete}) } } } else { @@ -648,25 +663,25 @@ func getFvCrtrnTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagn return childPayloads } -func getFvCrtrnTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvCrtrnResourceModel, tagTagPlan, tagTagState []TagTagFvCrtrnResourceModel) []map[string]interface{} { +func getFvCrtrnTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvCrtrnResourceModel, tagTagFvCrtrnPlan, tagTagFvCrtrnState []TagTagFvCrtrnResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagTag.IsUnknown() { + if !data.TagTag.IsNull() && !data.TagTag.IsUnknown() { tagTagIdentifiers := []TagTagIdentifier{} - for _, tagTag := range tagTagPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagTag.Key.IsUnknown() && !tagTag.Key.IsNull() { - childMap["attributes"]["key"] = tagTag.Key.ValueString() + for _, tagTagFvCrtrn := range tagTagFvCrtrnPlan { + childMap := NewAciObject() + if !tagTagFvCrtrn.Key.IsNull() && !tagTagFvCrtrn.Key.IsUnknown() { + childMap.Attributes["key"] = tagTagFvCrtrn.Key.ValueString() } - if !tagTag.Value.IsUnknown() && !tagTag.Value.IsNull() { - childMap["attributes"]["value"] = tagTag.Value.ValueString() + if !tagTagFvCrtrn.Value.IsNull() && !tagTagFvCrtrn.Value.IsUnknown() { + childMap.Attributes["value"] = tagTagFvCrtrn.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) tagTagIdentifier := TagTagIdentifier{} - tagTagIdentifier.Key = tagTag.Key + tagTagIdentifier.Key = tagTagFvCrtrn.Key tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) } - for _, tagTag := range tagTagState { + for _, tagTag := range tagTagFvCrtrnState { delete := true for _, tagTagIdentifier := range tagTagIdentifiers { if tagTagIdentifier.Key == tagTag.Key { @@ -675,10 +690,10 @@ func getFvCrtrnTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagTag.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) + tagTagChildMapForDelete := NewAciObject() + tagTagChildMapForDelete.Attributes["status"] = "deleted" + tagTagChildMapForDelete.Attributes["key"] = tagTag.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagTag": tagTagChildMapForDelete}) } } } else { diff --git a/internal/provider/resource_aci_epg_useg_block_statement_test.go b/internal/provider/resource_aci_epg_useg_block_statement_test.go index 43a6d7d61..87ee6422d 100644 --- a/internal/provider/resource_aci_epg_useg_block_statement_test.go +++ b/internal/provider/resource_aci_epg_useg_block_statement_test.go @@ -36,7 +36,7 @@ func TestAccResourceFvCrtrnWithFvAEPg(t *testing.T) { resource.TestCheckResourceAttr("aci_epg_useg_block_statement.allow_test_2", "owner_key", ""), resource.TestCheckResourceAttr("aci_epg_useg_block_statement.allow_test", "owner_tag", ""), resource.TestCheckResourceAttr("aci_epg_useg_block_statement.allow_test_2", "owner_tag", ""), - composeAggregateTestCheckFuncWithVersion(t, "4.1(1i)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.1(1i)", ">=", resource.TestCheckResourceAttr("aci_epg_useg_block_statement.allow_test", "precedence", "0"), resource.TestCheckResourceAttr("aci_epg_useg_block_statement.allow_test_2", "precedence", "0"), resource.TestCheckResourceAttr("aci_epg_useg_block_statement.allow_test", "scope", "scope-bd"), @@ -83,7 +83,7 @@ func TestAccResourceFvCrtrnWithFvAEPg(t *testing.T) { resource.TestCheckResourceAttr("aci_epg_useg_block_statement.allow_test_2", "owner_key", ""), resource.TestCheckResourceAttr("aci_epg_useg_block_statement.allow_test", "owner_tag", ""), resource.TestCheckResourceAttr("aci_epg_useg_block_statement.allow_test_2", "owner_tag", ""), - composeAggregateTestCheckFuncWithVersion(t, "4.1(1i)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.1(1i)", ">=", resource.TestCheckResourceAttr("aci_epg_useg_block_statement.allow_test", "precedence", "0"), resource.TestCheckResourceAttr("aci_epg_useg_block_statement.allow_test_2", "precedence", "0"), resource.TestCheckResourceAttr("aci_epg_useg_block_statement.allow_test", "scope", "scope-bd"), @@ -109,7 +109,7 @@ func TestAccResourceFvCrtrnWithFvAEPg(t *testing.T) { resource.TestCheckResourceAttr("aci_epg_useg_block_statement.test", "name_alias", ""), resource.TestCheckResourceAttr("aci_epg_useg_block_statement.test", "owner_key", ""), resource.TestCheckResourceAttr("aci_epg_useg_block_statement.test", "owner_tag", ""), - composeAggregateTestCheckFuncWithVersion(t, "4.1(1i)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.1(1i)", ">=", resource.TestCheckResourceAttr("aci_epg_useg_block_statement.test", "precedence", "0"), resource.TestCheckResourceAttr("aci_epg_useg_block_statement.test", "scope", "scope-bd")), ), @@ -126,7 +126,7 @@ func TestAccResourceFvCrtrnWithFvAEPg(t *testing.T) { resource.TestCheckResourceAttr("aci_epg_useg_block_statement.test", "name_alias", "name_alias_1"), resource.TestCheckResourceAttr("aci_epg_useg_block_statement.test", "owner_key", "owner_key_1"), resource.TestCheckResourceAttr("aci_epg_useg_block_statement.test", "owner_tag", "owner_tag_1"), - composeAggregateTestCheckFuncWithVersion(t, "4.1(1i)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.1(1i)", ">=", resource.TestCheckResourceAttr("aci_epg_useg_block_statement.test", "precedence", "1"), resource.TestCheckResourceAttr("aci_epg_useg_block_statement.test", "scope", "scope-bd")), ), @@ -161,7 +161,7 @@ func TestAccResourceFvCrtrnWithFvAEPg(t *testing.T) { resource.TestCheckResourceAttr("aci_epg_useg_block_statement.test", "name_alias", ""), resource.TestCheckResourceAttr("aci_epg_useg_block_statement.test", "owner_key", ""), resource.TestCheckResourceAttr("aci_epg_useg_block_statement.test", "owner_tag", ""), - composeAggregateTestCheckFuncWithVersion(t, "4.1(1i)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.1(1i)", ">=", resource.TestCheckResourceAttr("aci_epg_useg_block_statement.test", "precedence", "0"), resource.TestCheckResourceAttr("aci_epg_useg_block_statement.test", "scope", "scope-bd")), resource.TestCheckResourceAttr("aci_epg_useg_block_statement.test", "annotations.0.key", "key_0"), @@ -278,24 +278,24 @@ const testConfigFvCrtrnChildrenDependencyWithFvAEPg = testConfigFvAEPgMin + ` resource "aci_epg_useg_block_statement" "test" { parent_dn = aci_application_epg.test.id annotations = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] tags = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] } ` diff --git a/internal/provider/resource_aci_epg_useg_dns_attribute.go b/internal/provider/resource_aci_epg_useg_dns_attribute.go index 14cbdab18..9bc1d0f3c 100644 --- a/internal/provider/resource_aci_epg_useg_dns_attribute.go +++ b/internal/provider/resource_aci_epg_useg_dns_attribute.go @@ -92,6 +92,13 @@ func getEmptyTagAnnotationFvDnsAttrResourceModel() TagAnnotationFvDnsAttrResourc } } +var TagAnnotationFvDnsAttrType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // TagTagFvDnsAttrResourceModel describes the resource data model for the children without relation ships. type TagTagFvDnsAttrResourceModel struct { Key types.String `tfsdk:"key"` @@ -105,6 +112,13 @@ func getEmptyTagTagFvDnsAttrResourceModel() TagTagFvDnsAttrResourceModel { } } +var TagTagFvDnsAttrType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + type FvDnsAttrIdentifier struct { Name types.String } @@ -463,7 +477,7 @@ func (r *FvDnsAttrResource) ImportState(ctx context.Context, req resource.Import } func getAndSetFvDnsAttrAttributes(ctx context.Context, diags *diag.Diagnostics, client *client.Client, data *FvDnsAttrResourceModel) { - requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=children&rsp-subtree-class=%s", data.Id.ValueString(), "fvDnsAttr,tagAnnotation,tagTag"), "GET", nil) + requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=full&rsp-subtree-class=%s", data.Id.ValueString(), "fvDnsAttr,tagAnnotation,tagTag"), "GET", nil) readData := getEmptyFvDnsAttrResourceModel() @@ -518,6 +532,7 @@ func getAndSetFvDnsAttrAttributes(ctx context.Context, diags *diag.Diagnostics, if childAttributeName == "value" { TagAnnotationFvDnsAttr.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagAnnotationFvDnsAttrList = append(TagAnnotationFvDnsAttrList, TagAnnotationFvDnsAttr) } @@ -530,6 +545,7 @@ func getAndSetFvDnsAttrAttributes(ctx context.Context, diags *diag.Diagnostics, if childAttributeName == "value" { TagTagFvDnsAttr.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagTagFvDnsAttrList = append(TagTagFvDnsAttrList, TagTagFvDnsAttr) } @@ -577,25 +593,24 @@ func setFvDnsAttrId(ctx context.Context, data *FvDnsAttrResourceModel) { data.Id = types.StringValue(fmt.Sprintf("%s/%s", data.ParentDn.ValueString(), rn)) } -func getFvDnsAttrTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvDnsAttrResourceModel, tagAnnotationPlan, tagAnnotationState []TagAnnotationFvDnsAttrResourceModel) []map[string]interface{} { - +func getFvDnsAttrTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvDnsAttrResourceModel, tagAnnotationFvDnsAttrPlan, tagAnnotationFvDnsAttrState []TagAnnotationFvDnsAttrResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagAnnotation.IsUnknown() { + if !data.TagAnnotation.IsNull() && !data.TagAnnotation.IsUnknown() { tagAnnotationIdentifiers := []TagAnnotationIdentifier{} - for _, tagAnnotation := range tagAnnotationPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagAnnotation.Key.IsUnknown() && !tagAnnotation.Key.IsNull() { - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() + for _, tagAnnotationFvDnsAttr := range tagAnnotationFvDnsAttrPlan { + childMap := NewAciObject() + if !tagAnnotationFvDnsAttr.Key.IsNull() && !tagAnnotationFvDnsAttr.Key.IsUnknown() { + childMap.Attributes["key"] = tagAnnotationFvDnsAttr.Key.ValueString() } - if !tagAnnotation.Value.IsUnknown() && !tagAnnotation.Value.IsNull() { - childMap["attributes"]["value"] = tagAnnotation.Value.ValueString() + if !tagAnnotationFvDnsAttr.Value.IsNull() && !tagAnnotationFvDnsAttr.Value.IsUnknown() { + childMap.Attributes["value"] = tagAnnotationFvDnsAttr.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) tagAnnotationIdentifier := TagAnnotationIdentifier{} - tagAnnotationIdentifier.Key = tagAnnotation.Key + tagAnnotationIdentifier.Key = tagAnnotationFvDnsAttr.Key tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) } - for _, tagAnnotation := range tagAnnotationState { + for _, tagAnnotation := range tagAnnotationFvDnsAttrState { delete := true for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { if tagAnnotationIdentifier.Key == tagAnnotation.Key { @@ -604,10 +619,10 @@ func getFvDnsAttrTagAnnotationChildPayloads(ctx context.Context, diags *diag.Dia } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) + tagAnnotationChildMapForDelete := NewAciObject() + tagAnnotationChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationChildMapForDelete.Attributes["key"] = tagAnnotation.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": tagAnnotationChildMapForDelete}) } } } else { @@ -616,25 +631,25 @@ func getFvDnsAttrTagAnnotationChildPayloads(ctx context.Context, diags *diag.Dia return childPayloads } -func getFvDnsAttrTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvDnsAttrResourceModel, tagTagPlan, tagTagState []TagTagFvDnsAttrResourceModel) []map[string]interface{} { +func getFvDnsAttrTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvDnsAttrResourceModel, tagTagFvDnsAttrPlan, tagTagFvDnsAttrState []TagTagFvDnsAttrResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagTag.IsUnknown() { + if !data.TagTag.IsNull() && !data.TagTag.IsUnknown() { tagTagIdentifiers := []TagTagIdentifier{} - for _, tagTag := range tagTagPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagTag.Key.IsUnknown() && !tagTag.Key.IsNull() { - childMap["attributes"]["key"] = tagTag.Key.ValueString() + for _, tagTagFvDnsAttr := range tagTagFvDnsAttrPlan { + childMap := NewAciObject() + if !tagTagFvDnsAttr.Key.IsNull() && !tagTagFvDnsAttr.Key.IsUnknown() { + childMap.Attributes["key"] = tagTagFvDnsAttr.Key.ValueString() } - if !tagTag.Value.IsUnknown() && !tagTag.Value.IsNull() { - childMap["attributes"]["value"] = tagTag.Value.ValueString() + if !tagTagFvDnsAttr.Value.IsNull() && !tagTagFvDnsAttr.Value.IsUnknown() { + childMap.Attributes["value"] = tagTagFvDnsAttr.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) tagTagIdentifier := TagTagIdentifier{} - tagTagIdentifier.Key = tagTag.Key + tagTagIdentifier.Key = tagTagFvDnsAttr.Key tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) } - for _, tagTag := range tagTagState { + for _, tagTag := range tagTagFvDnsAttrState { delete := true for _, tagTagIdentifier := range tagTagIdentifiers { if tagTagIdentifier.Key == tagTag.Key { @@ -643,10 +658,10 @@ func getFvDnsAttrTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostic } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagTag.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) + tagTagChildMapForDelete := NewAciObject() + tagTagChildMapForDelete.Attributes["status"] = "deleted" + tagTagChildMapForDelete.Attributes["key"] = tagTag.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagTag": tagTagChildMapForDelete}) } } } else { diff --git a/internal/provider/resource_aci_epg_useg_dns_attribute_test.go b/internal/provider/resource_aci_epg_useg_dns_attribute_test.go index 0b05550d0..6564fb9c8 100644 --- a/internal/provider/resource_aci_epg_useg_dns_attribute_test.go +++ b/internal/provider/resource_aci_epg_useg_dns_attribute_test.go @@ -269,24 +269,24 @@ resource "aci_epg_useg_dns_attribute" "test" { parent_dn = aci_epg_useg_block_statement.test.id name = "dns_attribute" annotations = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] tags = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] } ` diff --git a/internal/provider/resource_aci_epg_useg_ip_attribute.go b/internal/provider/resource_aci_epg_useg_ip_attribute.go index fdc04df85..88a7b085e 100644 --- a/internal/provider/resource_aci_epg_useg_ip_attribute.go +++ b/internal/provider/resource_aci_epg_useg_ip_attribute.go @@ -96,6 +96,13 @@ func getEmptyTagAnnotationFvIpAttrResourceModel() TagAnnotationFvIpAttrResourceM } } +var TagAnnotationFvIpAttrType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // TagTagFvIpAttrResourceModel describes the resource data model for the children without relation ships. type TagTagFvIpAttrResourceModel struct { Key types.String `tfsdk:"key"` @@ -109,6 +116,13 @@ func getEmptyTagTagFvIpAttrResourceModel() TagTagFvIpAttrResourceModel { } } +var TagTagFvIpAttrType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + type FvIpAttrIdentifier struct { Name types.String } @@ -478,7 +492,7 @@ func (r *FvIpAttrResource) ImportState(ctx context.Context, req resource.ImportS } func getAndSetFvIpAttrAttributes(ctx context.Context, diags *diag.Diagnostics, client *client.Client, data *FvIpAttrResourceModel) { - requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=children&rsp-subtree-class=%s", data.Id.ValueString(), "fvIpAttr,tagAnnotation,tagTag"), "GET", nil) + requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=full&rsp-subtree-class=%s", data.Id.ValueString(), "fvIpAttr,tagAnnotation,tagTag"), "GET", nil) readData := getEmptyFvIpAttrResourceModel() @@ -536,6 +550,7 @@ func getAndSetFvIpAttrAttributes(ctx context.Context, diags *diag.Diagnostics, c if childAttributeName == "value" { TagAnnotationFvIpAttr.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagAnnotationFvIpAttrList = append(TagAnnotationFvIpAttrList, TagAnnotationFvIpAttr) } @@ -548,6 +563,7 @@ func getAndSetFvIpAttrAttributes(ctx context.Context, diags *diag.Diagnostics, c if childAttributeName == "value" { TagTagFvIpAttr.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagTagFvIpAttrList = append(TagTagFvIpAttrList, TagTagFvIpAttr) } @@ -595,25 +611,24 @@ func setFvIpAttrId(ctx context.Context, data *FvIpAttrResourceModel) { data.Id = types.StringValue(fmt.Sprintf("%s/%s", data.ParentDn.ValueString(), rn)) } -func getFvIpAttrTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvIpAttrResourceModel, tagAnnotationPlan, tagAnnotationState []TagAnnotationFvIpAttrResourceModel) []map[string]interface{} { - +func getFvIpAttrTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvIpAttrResourceModel, tagAnnotationFvIpAttrPlan, tagAnnotationFvIpAttrState []TagAnnotationFvIpAttrResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagAnnotation.IsUnknown() { + if !data.TagAnnotation.IsNull() && !data.TagAnnotation.IsUnknown() { tagAnnotationIdentifiers := []TagAnnotationIdentifier{} - for _, tagAnnotation := range tagAnnotationPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagAnnotation.Key.IsUnknown() && !tagAnnotation.Key.IsNull() { - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() + for _, tagAnnotationFvIpAttr := range tagAnnotationFvIpAttrPlan { + childMap := NewAciObject() + if !tagAnnotationFvIpAttr.Key.IsNull() && !tagAnnotationFvIpAttr.Key.IsUnknown() { + childMap.Attributes["key"] = tagAnnotationFvIpAttr.Key.ValueString() } - if !tagAnnotation.Value.IsUnknown() && !tagAnnotation.Value.IsNull() { - childMap["attributes"]["value"] = tagAnnotation.Value.ValueString() + if !tagAnnotationFvIpAttr.Value.IsNull() && !tagAnnotationFvIpAttr.Value.IsUnknown() { + childMap.Attributes["value"] = tagAnnotationFvIpAttr.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) tagAnnotationIdentifier := TagAnnotationIdentifier{} - tagAnnotationIdentifier.Key = tagAnnotation.Key + tagAnnotationIdentifier.Key = tagAnnotationFvIpAttr.Key tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) } - for _, tagAnnotation := range tagAnnotationState { + for _, tagAnnotation := range tagAnnotationFvIpAttrState { delete := true for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { if tagAnnotationIdentifier.Key == tagAnnotation.Key { @@ -622,10 +637,10 @@ func getFvIpAttrTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diag } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) + tagAnnotationChildMapForDelete := NewAciObject() + tagAnnotationChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationChildMapForDelete.Attributes["key"] = tagAnnotation.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": tagAnnotationChildMapForDelete}) } } } else { @@ -634,25 +649,25 @@ func getFvIpAttrTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diag return childPayloads } -func getFvIpAttrTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvIpAttrResourceModel, tagTagPlan, tagTagState []TagTagFvIpAttrResourceModel) []map[string]interface{} { +func getFvIpAttrTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvIpAttrResourceModel, tagTagFvIpAttrPlan, tagTagFvIpAttrState []TagTagFvIpAttrResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagTag.IsUnknown() { + if !data.TagTag.IsNull() && !data.TagTag.IsUnknown() { tagTagIdentifiers := []TagTagIdentifier{} - for _, tagTag := range tagTagPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagTag.Key.IsUnknown() && !tagTag.Key.IsNull() { - childMap["attributes"]["key"] = tagTag.Key.ValueString() + for _, tagTagFvIpAttr := range tagTagFvIpAttrPlan { + childMap := NewAciObject() + if !tagTagFvIpAttr.Key.IsNull() && !tagTagFvIpAttr.Key.IsUnknown() { + childMap.Attributes["key"] = tagTagFvIpAttr.Key.ValueString() } - if !tagTag.Value.IsUnknown() && !tagTag.Value.IsNull() { - childMap["attributes"]["value"] = tagTag.Value.ValueString() + if !tagTagFvIpAttr.Value.IsNull() && !tagTagFvIpAttr.Value.IsUnknown() { + childMap.Attributes["value"] = tagTagFvIpAttr.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) tagTagIdentifier := TagTagIdentifier{} - tagTagIdentifier.Key = tagTag.Key + tagTagIdentifier.Key = tagTagFvIpAttr.Key tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) } - for _, tagTag := range tagTagState { + for _, tagTag := range tagTagFvIpAttrState { delete := true for _, tagTagIdentifier := range tagTagIdentifiers { if tagTagIdentifier.Key == tagTag.Key { @@ -661,10 +676,10 @@ func getFvIpAttrTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagTag.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) + tagTagChildMapForDelete := NewAciObject() + tagTagChildMapForDelete.Attributes["status"] = "deleted" + tagTagChildMapForDelete.Attributes["key"] = tagTag.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagTag": tagTagChildMapForDelete}) } } } else { diff --git a/internal/provider/resource_aci_epg_useg_ip_attribute_test.go b/internal/provider/resource_aci_epg_useg_ip_attribute_test.go index 09327e576..bb043d3ae 100644 --- a/internal/provider/resource_aci_epg_useg_ip_attribute_test.go +++ b/internal/provider/resource_aci_epg_useg_ip_attribute_test.go @@ -284,24 +284,24 @@ resource "aci_epg_useg_ip_attribute" "test" { ip = "131.107.1.200" name = "131" annotations = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] tags = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] } ` diff --git a/internal/provider/resource_aci_epg_useg_mac_attribute.go b/internal/provider/resource_aci_epg_useg_mac_attribute.go index e632a5b9d..fe8a5e9ac 100644 --- a/internal/provider/resource_aci_epg_useg_mac_attribute.go +++ b/internal/provider/resource_aci_epg_useg_mac_attribute.go @@ -92,6 +92,13 @@ func getEmptyTagAnnotationFvMacAttrResourceModel() TagAnnotationFvMacAttrResourc } } +var TagAnnotationFvMacAttrType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // TagTagFvMacAttrResourceModel describes the resource data model for the children without relation ships. type TagTagFvMacAttrResourceModel struct { Key types.String `tfsdk:"key"` @@ -105,6 +112,13 @@ func getEmptyTagTagFvMacAttrResourceModel() TagTagFvMacAttrResourceModel { } } +var TagTagFvMacAttrType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + type FvMacAttrIdentifier struct { Name types.String } @@ -462,7 +476,7 @@ func (r *FvMacAttrResource) ImportState(ctx context.Context, req resource.Import } func getAndSetFvMacAttrAttributes(ctx context.Context, diags *diag.Diagnostics, client *client.Client, data *FvMacAttrResourceModel) { - requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=children&rsp-subtree-class=%s", data.Id.ValueString(), "fvMacAttr,tagAnnotation,tagTag"), "GET", nil) + requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=full&rsp-subtree-class=%s", data.Id.ValueString(), "fvMacAttr,tagAnnotation,tagTag"), "GET", nil) readData := getEmptyFvMacAttrResourceModel() @@ -517,6 +531,7 @@ func getAndSetFvMacAttrAttributes(ctx context.Context, diags *diag.Diagnostics, if childAttributeName == "value" { TagAnnotationFvMacAttr.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagAnnotationFvMacAttrList = append(TagAnnotationFvMacAttrList, TagAnnotationFvMacAttr) } @@ -529,6 +544,7 @@ func getAndSetFvMacAttrAttributes(ctx context.Context, diags *diag.Diagnostics, if childAttributeName == "value" { TagTagFvMacAttr.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagTagFvMacAttrList = append(TagTagFvMacAttrList, TagTagFvMacAttr) } @@ -576,25 +592,24 @@ func setFvMacAttrId(ctx context.Context, data *FvMacAttrResourceModel) { data.Id = types.StringValue(fmt.Sprintf("%s/%s", data.ParentDn.ValueString(), rn)) } -func getFvMacAttrTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvMacAttrResourceModel, tagAnnotationPlan, tagAnnotationState []TagAnnotationFvMacAttrResourceModel) []map[string]interface{} { - +func getFvMacAttrTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvMacAttrResourceModel, tagAnnotationFvMacAttrPlan, tagAnnotationFvMacAttrState []TagAnnotationFvMacAttrResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagAnnotation.IsUnknown() { + if !data.TagAnnotation.IsNull() && !data.TagAnnotation.IsUnknown() { tagAnnotationIdentifiers := []TagAnnotationIdentifier{} - for _, tagAnnotation := range tagAnnotationPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagAnnotation.Key.IsUnknown() && !tagAnnotation.Key.IsNull() { - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() + for _, tagAnnotationFvMacAttr := range tagAnnotationFvMacAttrPlan { + childMap := NewAciObject() + if !tagAnnotationFvMacAttr.Key.IsNull() && !tagAnnotationFvMacAttr.Key.IsUnknown() { + childMap.Attributes["key"] = tagAnnotationFvMacAttr.Key.ValueString() } - if !tagAnnotation.Value.IsUnknown() && !tagAnnotation.Value.IsNull() { - childMap["attributes"]["value"] = tagAnnotation.Value.ValueString() + if !tagAnnotationFvMacAttr.Value.IsNull() && !tagAnnotationFvMacAttr.Value.IsUnknown() { + childMap.Attributes["value"] = tagAnnotationFvMacAttr.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) tagAnnotationIdentifier := TagAnnotationIdentifier{} - tagAnnotationIdentifier.Key = tagAnnotation.Key + tagAnnotationIdentifier.Key = tagAnnotationFvMacAttr.Key tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) } - for _, tagAnnotation := range tagAnnotationState { + for _, tagAnnotation := range tagAnnotationFvMacAttrState { delete := true for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { if tagAnnotationIdentifier.Key == tagAnnotation.Key { @@ -603,10 +618,10 @@ func getFvMacAttrTagAnnotationChildPayloads(ctx context.Context, diags *diag.Dia } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) + tagAnnotationChildMapForDelete := NewAciObject() + tagAnnotationChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationChildMapForDelete.Attributes["key"] = tagAnnotation.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": tagAnnotationChildMapForDelete}) } } } else { @@ -615,25 +630,25 @@ func getFvMacAttrTagAnnotationChildPayloads(ctx context.Context, diags *diag.Dia return childPayloads } -func getFvMacAttrTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvMacAttrResourceModel, tagTagPlan, tagTagState []TagTagFvMacAttrResourceModel) []map[string]interface{} { +func getFvMacAttrTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvMacAttrResourceModel, tagTagFvMacAttrPlan, tagTagFvMacAttrState []TagTagFvMacAttrResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagTag.IsUnknown() { + if !data.TagTag.IsNull() && !data.TagTag.IsUnknown() { tagTagIdentifiers := []TagTagIdentifier{} - for _, tagTag := range tagTagPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagTag.Key.IsUnknown() && !tagTag.Key.IsNull() { - childMap["attributes"]["key"] = tagTag.Key.ValueString() + for _, tagTagFvMacAttr := range tagTagFvMacAttrPlan { + childMap := NewAciObject() + if !tagTagFvMacAttr.Key.IsNull() && !tagTagFvMacAttr.Key.IsUnknown() { + childMap.Attributes["key"] = tagTagFvMacAttr.Key.ValueString() } - if !tagTag.Value.IsUnknown() && !tagTag.Value.IsNull() { - childMap["attributes"]["value"] = tagTag.Value.ValueString() + if !tagTagFvMacAttr.Value.IsNull() && !tagTagFvMacAttr.Value.IsUnknown() { + childMap.Attributes["value"] = tagTagFvMacAttr.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) tagTagIdentifier := TagTagIdentifier{} - tagTagIdentifier.Key = tagTag.Key + tagTagIdentifier.Key = tagTagFvMacAttr.Key tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) } - for _, tagTag := range tagTagState { + for _, tagTag := range tagTagFvMacAttrState { delete := true for _, tagTagIdentifier := range tagTagIdentifiers { if tagTagIdentifier.Key == tagTag.Key { @@ -642,10 +657,10 @@ func getFvMacAttrTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostic } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagTag.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) + tagTagChildMapForDelete := NewAciObject() + tagTagChildMapForDelete.Attributes["status"] = "deleted" + tagTagChildMapForDelete.Attributes["key"] = tagTag.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagTag": tagTagChildMapForDelete}) } } } else { diff --git a/internal/provider/resource_aci_epg_useg_mac_attribute_test.go b/internal/provider/resource_aci_epg_useg_mac_attribute_test.go index 36ada02a3..f40692b4b 100644 --- a/internal/provider/resource_aci_epg_useg_mac_attribute_test.go +++ b/internal/provider/resource_aci_epg_useg_mac_attribute_test.go @@ -274,24 +274,24 @@ resource "aci_epg_useg_mac_attribute" "test" { mac = "AA:BB:CC:DD:EE:FF" name = "mac_attr" annotations = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] tags = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] } ` diff --git a/internal/provider/resource_aci_epg_useg_sub_block_statement.go b/internal/provider/resource_aci_epg_useg_sub_block_statement.go index 0575c3061..57b0d3ce2 100644 --- a/internal/provider/resource_aci_epg_useg_sub_block_statement.go +++ b/internal/provider/resource_aci_epg_useg_sub_block_statement.go @@ -94,6 +94,13 @@ func getEmptyTagAnnotationFvSCrtrnResourceModel() TagAnnotationFvSCrtrnResourceM } } +var TagAnnotationFvSCrtrnType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // TagTagFvSCrtrnResourceModel describes the resource data model for the children without relation ships. type TagTagFvSCrtrnResourceModel struct { Key types.String `tfsdk:"key"` @@ -107,6 +114,13 @@ func getEmptyTagTagFvSCrtrnResourceModel() TagTagFvSCrtrnResourceModel { } } +var TagTagFvSCrtrnType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + type FvSCrtrnIdentifier struct { Name types.String } @@ -468,7 +482,7 @@ func (r *FvSCrtrnResource) ImportState(ctx context.Context, req resource.ImportS } func getAndSetFvSCrtrnAttributes(ctx context.Context, diags *diag.Diagnostics, client *client.Client, data *FvSCrtrnResourceModel) { - requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=children&rsp-subtree-class=%s", data.Id.ValueString(), "fvSCrtrn,tagAnnotation,tagTag"), "GET", nil) + requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=full&rsp-subtree-class=%s", data.Id.ValueString(), "fvSCrtrn,tagAnnotation,tagTag"), "GET", nil) readData := getEmptyFvSCrtrnResourceModel() @@ -523,6 +537,7 @@ func getAndSetFvSCrtrnAttributes(ctx context.Context, diags *diag.Diagnostics, c if childAttributeName == "value" { TagAnnotationFvSCrtrn.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagAnnotationFvSCrtrnList = append(TagAnnotationFvSCrtrnList, TagAnnotationFvSCrtrn) } @@ -535,6 +550,7 @@ func getAndSetFvSCrtrnAttributes(ctx context.Context, diags *diag.Diagnostics, c if childAttributeName == "value" { TagTagFvSCrtrn.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagTagFvSCrtrnList = append(TagTagFvSCrtrnList, TagTagFvSCrtrn) } @@ -582,25 +598,24 @@ func setFvSCrtrnId(ctx context.Context, data *FvSCrtrnResourceModel) { data.Id = types.StringValue(fmt.Sprintf("%s/%s", data.ParentDn.ValueString(), rn)) } -func getFvSCrtrnTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvSCrtrnResourceModel, tagAnnotationPlan, tagAnnotationState []TagAnnotationFvSCrtrnResourceModel) []map[string]interface{} { - +func getFvSCrtrnTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvSCrtrnResourceModel, tagAnnotationFvSCrtrnPlan, tagAnnotationFvSCrtrnState []TagAnnotationFvSCrtrnResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagAnnotation.IsUnknown() { + if !data.TagAnnotation.IsNull() && !data.TagAnnotation.IsUnknown() { tagAnnotationIdentifiers := []TagAnnotationIdentifier{} - for _, tagAnnotation := range tagAnnotationPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagAnnotation.Key.IsUnknown() && !tagAnnotation.Key.IsNull() { - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() + for _, tagAnnotationFvSCrtrn := range tagAnnotationFvSCrtrnPlan { + childMap := NewAciObject() + if !tagAnnotationFvSCrtrn.Key.IsNull() && !tagAnnotationFvSCrtrn.Key.IsUnknown() { + childMap.Attributes["key"] = tagAnnotationFvSCrtrn.Key.ValueString() } - if !tagAnnotation.Value.IsUnknown() && !tagAnnotation.Value.IsNull() { - childMap["attributes"]["value"] = tagAnnotation.Value.ValueString() + if !tagAnnotationFvSCrtrn.Value.IsNull() && !tagAnnotationFvSCrtrn.Value.IsUnknown() { + childMap.Attributes["value"] = tagAnnotationFvSCrtrn.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) tagAnnotationIdentifier := TagAnnotationIdentifier{} - tagAnnotationIdentifier.Key = tagAnnotation.Key + tagAnnotationIdentifier.Key = tagAnnotationFvSCrtrn.Key tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) } - for _, tagAnnotation := range tagAnnotationState { + for _, tagAnnotation := range tagAnnotationFvSCrtrnState { delete := true for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { if tagAnnotationIdentifier.Key == tagAnnotation.Key { @@ -609,10 +624,10 @@ func getFvSCrtrnTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diag } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) + tagAnnotationChildMapForDelete := NewAciObject() + tagAnnotationChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationChildMapForDelete.Attributes["key"] = tagAnnotation.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": tagAnnotationChildMapForDelete}) } } } else { @@ -621,25 +636,25 @@ func getFvSCrtrnTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diag return childPayloads } -func getFvSCrtrnTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvSCrtrnResourceModel, tagTagPlan, tagTagState []TagTagFvSCrtrnResourceModel) []map[string]interface{} { +func getFvSCrtrnTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvSCrtrnResourceModel, tagTagFvSCrtrnPlan, tagTagFvSCrtrnState []TagTagFvSCrtrnResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagTag.IsUnknown() { + if !data.TagTag.IsNull() && !data.TagTag.IsUnknown() { tagTagIdentifiers := []TagTagIdentifier{} - for _, tagTag := range tagTagPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagTag.Key.IsUnknown() && !tagTag.Key.IsNull() { - childMap["attributes"]["key"] = tagTag.Key.ValueString() + for _, tagTagFvSCrtrn := range tagTagFvSCrtrnPlan { + childMap := NewAciObject() + if !tagTagFvSCrtrn.Key.IsNull() && !tagTagFvSCrtrn.Key.IsUnknown() { + childMap.Attributes["key"] = tagTagFvSCrtrn.Key.ValueString() } - if !tagTag.Value.IsUnknown() && !tagTag.Value.IsNull() { - childMap["attributes"]["value"] = tagTag.Value.ValueString() + if !tagTagFvSCrtrn.Value.IsNull() && !tagTagFvSCrtrn.Value.IsUnknown() { + childMap.Attributes["value"] = tagTagFvSCrtrn.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) tagTagIdentifier := TagTagIdentifier{} - tagTagIdentifier.Key = tagTag.Key + tagTagIdentifier.Key = tagTagFvSCrtrn.Key tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) } - for _, tagTag := range tagTagState { + for _, tagTag := range tagTagFvSCrtrnState { delete := true for _, tagTagIdentifier := range tagTagIdentifiers { if tagTagIdentifier.Key == tagTag.Key { @@ -648,10 +663,10 @@ func getFvSCrtrnTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagTag.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) + tagTagChildMapForDelete := NewAciObject() + tagTagChildMapForDelete.Attributes["status"] = "deleted" + tagTagChildMapForDelete.Attributes["key"] = tagTag.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagTag": tagTagChildMapForDelete}) } } } else { diff --git a/internal/provider/resource_aci_epg_useg_sub_block_statement_test.go b/internal/provider/resource_aci_epg_useg_sub_block_statement_test.go index 33e4d5530..bb2ae0821 100644 --- a/internal/provider/resource_aci_epg_useg_sub_block_statement_test.go +++ b/internal/provider/resource_aci_epg_useg_sub_block_statement_test.go @@ -477,24 +477,24 @@ resource "aci_epg_useg_sub_block_statement" "test" { parent_dn = aci_epg_useg_block_statement.test.id name = "sub_criterion" annotations = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] tags = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] } ` @@ -583,24 +583,24 @@ resource "aci_epg_useg_sub_block_statement" "test_1" { parent_dn = aci_epg_useg_sub_block_statement.test.id name = "sub_criterion" annotations = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] tags = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] } ` diff --git a/internal/provider/resource_aci_epg_useg_vm_attribute.go b/internal/provider/resource_aci_epg_useg_vm_attribute.go index 0ce239f36..044e46b3f 100644 --- a/internal/provider/resource_aci_epg_useg_vm_attribute.go +++ b/internal/provider/resource_aci_epg_useg_vm_attribute.go @@ -102,6 +102,13 @@ func getEmptyTagAnnotationFvVmAttrResourceModel() TagAnnotationFvVmAttrResourceM } } +var TagAnnotationFvVmAttrType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // TagTagFvVmAttrResourceModel describes the resource data model for the children without relation ships. type TagTagFvVmAttrResourceModel struct { Key types.String `tfsdk:"key"` @@ -115,6 +122,13 @@ func getEmptyTagTagFvVmAttrResourceModel() TagTagFvVmAttrResourceModel { } } +var TagTagFvVmAttrType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + type FvVmAttrIdentifier struct { Name types.String } @@ -514,7 +528,7 @@ func (r *FvVmAttrResource) ImportState(ctx context.Context, req resource.ImportS } func getAndSetFvVmAttrAttributes(ctx context.Context, diags *diag.Diagnostics, client *client.Client, data *FvVmAttrResourceModel) { - requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=children&rsp-subtree-class=%s", data.Id.ValueString(), "fvVmAttr,tagAnnotation,tagTag"), "GET", nil) + requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=full&rsp-subtree-class=%s", data.Id.ValueString(), "fvVmAttr,tagAnnotation,tagTag"), "GET", nil) readData := getEmptyFvVmAttrResourceModel() @@ -581,6 +595,7 @@ func getAndSetFvVmAttrAttributes(ctx context.Context, diags *diag.Diagnostics, c if childAttributeName == "value" { TagAnnotationFvVmAttr.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagAnnotationFvVmAttrList = append(TagAnnotationFvVmAttrList, TagAnnotationFvVmAttr) } @@ -593,6 +608,7 @@ func getAndSetFvVmAttrAttributes(ctx context.Context, diags *diag.Diagnostics, c if childAttributeName == "value" { TagTagFvVmAttr.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagTagFvVmAttrList = append(TagTagFvVmAttrList, TagTagFvVmAttr) } @@ -640,25 +656,24 @@ func setFvVmAttrId(ctx context.Context, data *FvVmAttrResourceModel) { data.Id = types.StringValue(fmt.Sprintf("%s/%s", data.ParentDn.ValueString(), rn)) } -func getFvVmAttrTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvVmAttrResourceModel, tagAnnotationPlan, tagAnnotationState []TagAnnotationFvVmAttrResourceModel) []map[string]interface{} { - +func getFvVmAttrTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvVmAttrResourceModel, tagAnnotationFvVmAttrPlan, tagAnnotationFvVmAttrState []TagAnnotationFvVmAttrResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagAnnotation.IsUnknown() { + if !data.TagAnnotation.IsNull() && !data.TagAnnotation.IsUnknown() { tagAnnotationIdentifiers := []TagAnnotationIdentifier{} - for _, tagAnnotation := range tagAnnotationPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagAnnotation.Key.IsUnknown() && !tagAnnotation.Key.IsNull() { - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() + for _, tagAnnotationFvVmAttr := range tagAnnotationFvVmAttrPlan { + childMap := NewAciObject() + if !tagAnnotationFvVmAttr.Key.IsNull() && !tagAnnotationFvVmAttr.Key.IsUnknown() { + childMap.Attributes["key"] = tagAnnotationFvVmAttr.Key.ValueString() } - if !tagAnnotation.Value.IsUnknown() && !tagAnnotation.Value.IsNull() { - childMap["attributes"]["value"] = tagAnnotation.Value.ValueString() + if !tagAnnotationFvVmAttr.Value.IsNull() && !tagAnnotationFvVmAttr.Value.IsUnknown() { + childMap.Attributes["value"] = tagAnnotationFvVmAttr.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) tagAnnotationIdentifier := TagAnnotationIdentifier{} - tagAnnotationIdentifier.Key = tagAnnotation.Key + tagAnnotationIdentifier.Key = tagAnnotationFvVmAttr.Key tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) } - for _, tagAnnotation := range tagAnnotationState { + for _, tagAnnotation := range tagAnnotationFvVmAttrState { delete := true for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { if tagAnnotationIdentifier.Key == tagAnnotation.Key { @@ -667,10 +682,10 @@ func getFvVmAttrTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diag } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) + tagAnnotationChildMapForDelete := NewAciObject() + tagAnnotationChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationChildMapForDelete.Attributes["key"] = tagAnnotation.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": tagAnnotationChildMapForDelete}) } } } else { @@ -679,25 +694,25 @@ func getFvVmAttrTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diag return childPayloads } -func getFvVmAttrTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvVmAttrResourceModel, tagTagPlan, tagTagState []TagTagFvVmAttrResourceModel) []map[string]interface{} { +func getFvVmAttrTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvVmAttrResourceModel, tagTagFvVmAttrPlan, tagTagFvVmAttrState []TagTagFvVmAttrResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagTag.IsUnknown() { + if !data.TagTag.IsNull() && !data.TagTag.IsUnknown() { tagTagIdentifiers := []TagTagIdentifier{} - for _, tagTag := range tagTagPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagTag.Key.IsUnknown() && !tagTag.Key.IsNull() { - childMap["attributes"]["key"] = tagTag.Key.ValueString() + for _, tagTagFvVmAttr := range tagTagFvVmAttrPlan { + childMap := NewAciObject() + if !tagTagFvVmAttr.Key.IsNull() && !tagTagFvVmAttr.Key.IsUnknown() { + childMap.Attributes["key"] = tagTagFvVmAttr.Key.ValueString() } - if !tagTag.Value.IsUnknown() && !tagTag.Value.IsNull() { - childMap["attributes"]["value"] = tagTag.Value.ValueString() + if !tagTagFvVmAttr.Value.IsNull() && !tagTagFvVmAttr.Value.IsUnknown() { + childMap.Attributes["value"] = tagTagFvVmAttr.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) tagTagIdentifier := TagTagIdentifier{} - tagTagIdentifier.Key = tagTag.Key + tagTagIdentifier.Key = tagTagFvVmAttr.Key tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) } - for _, tagTag := range tagTagState { + for _, tagTag := range tagTagFvVmAttrState { delete := true for _, tagTagIdentifier := range tagTagIdentifiers { if tagTagIdentifier.Key == tagTag.Key { @@ -706,10 +721,10 @@ func getFvVmAttrTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagTag.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) + tagTagChildMapForDelete := NewAciObject() + tagTagChildMapForDelete.Attributes["status"] = "deleted" + tagTagChildMapForDelete.Attributes["key"] = tagTag.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagTag": tagTagChildMapForDelete}) } } } else { diff --git a/internal/provider/resource_aci_epg_useg_vm_attribute_test.go b/internal/provider/resource_aci_epg_useg_vm_attribute_test.go index f76a59b02..17cd20893 100644 --- a/internal/provider/resource_aci_epg_useg_vm_attribute_test.go +++ b/internal/provider/resource_aci_epg_useg_vm_attribute_test.go @@ -555,24 +555,24 @@ resource "aci_epg_useg_vm_attribute" "test" { name = "vm_attribute" value = "default_value" annotations = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] tags = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] } ` @@ -676,24 +676,24 @@ resource "aci_epg_useg_vm_attribute" "test" { name = "vm_attribute" value = "default_value" annotations = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] tags = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] } ` diff --git a/internal/provider/resource_aci_external_management_network_instance_profile.go b/internal/provider/resource_aci_external_management_network_instance_profile.go index 5752b3d9d..458166b1e 100644 --- a/internal/provider/resource_aci_external_management_network_instance_profile.go +++ b/internal/provider/resource_aci_external_management_network_instance_profile.go @@ -69,6 +69,8 @@ func getEmptyMgmtInstPResourceModel() *MgmtInstPResourceModel { "annotation": types.StringType, "priority": types.StringType, "out_of_band_contract_name": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationMgmtRsOoBConsMgmtInstPType}, + "tags": types.SetType{ElemType: TagTagMgmtRsOoBConsMgmtInstPType}, }, }), TagAnnotation: types.SetNull(types.ObjectType{ @@ -91,6 +93,8 @@ type MgmtRsOoBConsMgmtInstPResourceModel struct { Annotation types.String `tfsdk:"annotation"` Prio customTypes.MgmtRsOoBConsPrioStringValue `tfsdk:"priority"` TnVzOOBBrCPName types.String `tfsdk:"out_of_band_contract_name"` + TagAnnotation types.Set `tfsdk:"annotations"` + TagTag types.Set `tfsdk:"tags"` } func getEmptyMgmtRsOoBConsMgmtInstPResourceModel() MgmtRsOoBConsMgmtInstPResourceModel { @@ -98,9 +102,71 @@ func getEmptyMgmtRsOoBConsMgmtInstPResourceModel() MgmtRsOoBConsMgmtInstPResourc Annotation: basetypes.NewStringNull(), Prio: customTypes.NewMgmtRsOoBConsPrioStringNull(), TnVzOOBBrCPName: basetypes.NewStringNull(), + TagAnnotation: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + } +} + +var MgmtRsOoBConsMgmtInstPType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "annotation": types.StringType, + "priority": types.StringType, + "out_of_band_contract_name": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationMgmtRsOoBConsMgmtInstPType}, + "tags": types.SetType{ElemType: TagTagMgmtRsOoBConsMgmtInstPType}, + }, +} + +// TagAnnotationMgmtRsOoBConsMgmtInstPResourceModel describes the resource data model for the children without relation ships. +type TagAnnotationMgmtRsOoBConsMgmtInstPResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagAnnotationMgmtRsOoBConsMgmtInstPResourceModel() TagAnnotationMgmtRsOoBConsMgmtInstPResourceModel { + return TagAnnotationMgmtRsOoBConsMgmtInstPResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagAnnotationMgmtRsOoBConsMgmtInstPType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + +// TagTagMgmtRsOoBConsMgmtInstPResourceModel describes the resource data model for the children without relation ships. +type TagTagMgmtRsOoBConsMgmtInstPResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagTagMgmtRsOoBConsMgmtInstPResourceModel() TagTagMgmtRsOoBConsMgmtInstPResourceModel { + return TagTagMgmtRsOoBConsMgmtInstPResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), } } +var TagTagMgmtRsOoBConsMgmtInstPType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // TagAnnotationMgmtInstPResourceModel describes the resource data model for the children without relation ships. type TagAnnotationMgmtInstPResourceModel struct { Key types.String `tfsdk:"key"` @@ -114,6 +180,13 @@ func getEmptyTagAnnotationMgmtInstPResourceModel() TagAnnotationMgmtInstPResourc } } +var TagAnnotationMgmtInstPType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // TagTagMgmtInstPResourceModel describes the resource data model for the children without relation ships. type TagTagMgmtInstPResourceModel struct { Key types.String `tfsdk:"key"` @@ -127,6 +200,13 @@ func getEmptyTagTagMgmtInstPResourceModel() TagTagMgmtInstPResourceModel { } } +var TagTagMgmtInstPType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + type MgmtInstPIdentifier struct { Name types.String } @@ -268,6 +348,58 @@ func (r *MgmtInstPResource) Schema(ctx context.Context, req resource.SchemaReque }, MarkdownDescription: `The name of the Out Of Band Contract object.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, }, @@ -514,7 +646,7 @@ func (r *MgmtInstPResource) ImportState(ctx context.Context, req resource.Import } func getAndSetMgmtInstPAttributes(ctx context.Context, diags *diag.Diagnostics, client *client.Client, data *MgmtInstPResourceModel) { - requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=children&rsp-subtree-class=%s", data.Id.ValueString(), "mgmtInstP,mgmtRsOoBCons,tagAnnotation,tagTag"), "GET", nil) + requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=full&rsp-subtree-class=%s", data.Id.ValueString(), "mgmtInstP,mgmtRsOoBCons,tagAnnotation,tagTag,tagAnnotation,tagTag"), "GET", nil) readData := getEmptyMgmtInstPResourceModel() @@ -566,7 +698,47 @@ func getAndSetMgmtInstPAttributes(ctx context.Context, diags *diag.Diagnostics, if childAttributeName == "tnVzOOBBrCPName" { MgmtRsOoBConsMgmtInstP.TnVzOOBBrCPName = basetypes.NewStringValue(childAttributeValue.(string)) } + } + TagAnnotationMgmtRsOoBConsMgmtInstPList := make([]TagAnnotationMgmtRsOoBConsMgmtInstPResourceModel, 0) + TagTagMgmtRsOoBConsMgmtInstPList := make([]TagTagMgmtRsOoBConsMgmtInstPResourceModel, 0) + childrenOfMgmtRsOoBConsMgmtInstP, childrenOfMgmtRsOoBConsMgmtInstPExist := childClassDetails.(map[string]interface{})["children"] + if childrenOfMgmtRsOoBConsMgmtInstPExist { + for _, childMgmtRsOoBConsMgmtInstP := range childrenOfMgmtRsOoBConsMgmtInstP.([]interface{}) { + for childClassNameMgmtRsOoBConsMgmtInstP, childClassDetailsMgmtRsOoBConsMgmtInstP := range childMgmtRsOoBConsMgmtInstP.(map[string]interface{}) { + if childClassNameMgmtRsOoBConsMgmtInstP == "tagAnnotation" { + TagAnnotationMgmtRsOoBConsMgmtInstP := getEmptyTagAnnotationMgmtRsOoBConsMgmtInstPResourceModel() + tagAnnotationchildAttributeValue := childClassDetailsMgmtRsOoBConsMgmtInstP.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagAnnotationchildAttributeValue { + if childAttributeName == "key" { + TagAnnotationMgmtRsOoBConsMgmtInstP.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagAnnotationMgmtRsOoBConsMgmtInstP.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagAnnotationMgmtRsOoBConsMgmtInstPList = append(TagAnnotationMgmtRsOoBConsMgmtInstPList, TagAnnotationMgmtRsOoBConsMgmtInstP) + } + if childClassNameMgmtRsOoBConsMgmtInstP == "tagTag" { + TagTagMgmtRsOoBConsMgmtInstP := getEmptyTagTagMgmtRsOoBConsMgmtInstPResourceModel() + tagTagchildAttributeValue := childClassDetailsMgmtRsOoBConsMgmtInstP.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagTagchildAttributeValue { + if childAttributeName == "key" { + TagTagMgmtRsOoBConsMgmtInstP.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagTagMgmtRsOoBConsMgmtInstP.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagTagMgmtRsOoBConsMgmtInstPList = append(TagTagMgmtRsOoBConsMgmtInstPList, TagTagMgmtRsOoBConsMgmtInstP) + } + } + } + } + TagAnnotationMgmtRsOoBConsMgmtInstPSet, _ := types.SetValueFrom(ctx, TagAnnotationMgmtRsOoBConsMgmtInstPType, TagAnnotationMgmtRsOoBConsMgmtInstPList) + MgmtRsOoBConsMgmtInstP.TagAnnotation = TagAnnotationMgmtRsOoBConsMgmtInstPSet + TagTagMgmtRsOoBConsMgmtInstPSet, _ := types.SetValueFrom(ctx, TagTagMgmtRsOoBConsMgmtInstPType, TagTagMgmtRsOoBConsMgmtInstPList) + MgmtRsOoBConsMgmtInstP.TagTag = TagTagMgmtRsOoBConsMgmtInstPSet MgmtRsOoBConsMgmtInstPList = append(MgmtRsOoBConsMgmtInstPList, MgmtRsOoBConsMgmtInstP) } if childClassName == "tagAnnotation" { @@ -578,6 +750,7 @@ func getAndSetMgmtInstPAttributes(ctx context.Context, diags *diag.Diagnostics, if childAttributeName == "value" { TagAnnotationMgmtInstP.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagAnnotationMgmtInstPList = append(TagAnnotationMgmtInstPList, TagAnnotationMgmtInstP) } @@ -590,6 +763,7 @@ func getAndSetMgmtInstPAttributes(ctx context.Context, diags *diag.Diagnostics, if childAttributeName == "value" { TagTagMgmtInstP.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagTagMgmtInstPList = append(TagTagMgmtInstPList, TagTagMgmtInstP) } @@ -623,30 +797,105 @@ func setMgmtInstPId(ctx context.Context, data *MgmtInstPResourceModel) { data.Id = types.StringValue(fmt.Sprintf("%s/%s", strings.Split([]string{"uni/tn-mgmt/extmgmt-default/instp-{name}"}[0], "/")[0], rn)) } -func getMgmtInstPMgmtRsOoBConsChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *MgmtInstPResourceModel, mgmtRsOoBConsPlan, mgmtRsOoBConsState []MgmtRsOoBConsMgmtInstPResourceModel) []map[string]interface{} { - +func getMgmtInstPMgmtRsOoBConsChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *MgmtInstPResourceModel, mgmtRsOoBConsMgmtInstPPlan, mgmtRsOoBConsMgmtInstPState []MgmtRsOoBConsMgmtInstPResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.MgmtRsOoBCons.IsUnknown() { + if !data.MgmtRsOoBCons.IsNull() && !data.MgmtRsOoBCons.IsUnknown() { mgmtRsOoBConsIdentifiers := []MgmtRsOoBConsIdentifier{} - for _, mgmtRsOoBCons := range mgmtRsOoBConsPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !mgmtRsOoBCons.Annotation.IsUnknown() && !mgmtRsOoBCons.Annotation.IsNull() { - childMap["attributes"]["annotation"] = mgmtRsOoBCons.Annotation.ValueString() + for _, mgmtRsOoBConsMgmtInstP := range mgmtRsOoBConsMgmtInstPPlan { + MgmtRsOoBConsMgmtInstPChildren := make([]map[string]interface{}, 0) + childMap := NewAciObject() + if !mgmtRsOoBConsMgmtInstP.Annotation.IsNull() && !mgmtRsOoBConsMgmtInstP.Annotation.IsUnknown() { + childMap.Attributes["annotation"] = mgmtRsOoBConsMgmtInstP.Annotation.ValueString() } else { - childMap["attributes"]["annotation"] = globalAnnotation + childMap.Attributes["annotation"] = globalAnnotation + } + if !mgmtRsOoBConsMgmtInstP.Prio.IsNull() && !mgmtRsOoBConsMgmtInstP.Prio.IsUnknown() { + childMap.Attributes["prio"] = mgmtRsOoBConsMgmtInstP.Prio.ValueString() + } + if !mgmtRsOoBConsMgmtInstP.TnVzOOBBrCPName.IsNull() && !mgmtRsOoBConsMgmtInstP.TnVzOOBBrCPName.IsUnknown() { + childMap.Attributes["tnVzOOBBrCPName"] = mgmtRsOoBConsMgmtInstP.TnVzOOBBrCPName.ValueString() } - if !mgmtRsOoBCons.Prio.IsUnknown() && !mgmtRsOoBCons.Prio.IsNull() { - childMap["attributes"]["prio"] = mgmtRsOoBCons.Prio.ValueString() + + var tagAnnotationMgmtRsOoBConsMgmtInstPPlan, tagAnnotationMgmtRsOoBConsMgmtInstPState []TagAnnotationMgmtRsOoBConsMgmtInstPResourceModel + mgmtRsOoBConsMgmtInstP.TagAnnotation.ElementsAs(ctx, &tagAnnotationMgmtRsOoBConsMgmtInstPPlan, false) + for _, tagAnnotationMgmtRsOoBConsMgmtInstPstate := range mgmtRsOoBConsMgmtInstPState { + tagAnnotationMgmtRsOoBConsMgmtInstPstate.TagAnnotation.ElementsAs(ctx, &tagAnnotationMgmtRsOoBConsMgmtInstPState, false) + } + if !mgmtRsOoBConsMgmtInstP.TagAnnotation.IsNull() && !mgmtRsOoBConsMgmtInstP.TagAnnotation.IsUnknown() { + tagAnnotationIdentifiers := []TagAnnotationIdentifier{} + for _, tagAnnotationMgmtRsOoBConsMgmtInstP := range tagAnnotationMgmtRsOoBConsMgmtInstPPlan { + tagAnnotationMgmtRsOoBConsMgmtInstPChildMap := NewAciObject() + if !tagAnnotationMgmtRsOoBConsMgmtInstP.Key.IsNull() && !tagAnnotationMgmtRsOoBConsMgmtInstP.Key.IsUnknown() { + tagAnnotationMgmtRsOoBConsMgmtInstPChildMap.Attributes["key"] = tagAnnotationMgmtRsOoBConsMgmtInstP.Key.ValueString() + } + if !tagAnnotationMgmtRsOoBConsMgmtInstP.Value.IsNull() && !tagAnnotationMgmtRsOoBConsMgmtInstP.Value.IsUnknown() { + tagAnnotationMgmtRsOoBConsMgmtInstPChildMap.Attributes["value"] = tagAnnotationMgmtRsOoBConsMgmtInstP.Value.ValueString() + } + MgmtRsOoBConsMgmtInstPChildren = append(MgmtRsOoBConsMgmtInstPChildren, map[string]interface{}{"tagAnnotation": tagAnnotationMgmtRsOoBConsMgmtInstPChildMap}) + tagAnnotationIdentifier := TagAnnotationIdentifier{} + tagAnnotationIdentifier.Key = tagAnnotationMgmtRsOoBConsMgmtInstP.Key + tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) + } + for _, tagAnnotationMgmtRsOoBConsMgmtInstP := range tagAnnotationMgmtRsOoBConsMgmtInstPState { + delete := true + for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { + if tagAnnotationIdentifier.Key == tagAnnotationMgmtRsOoBConsMgmtInstP.Key { + delete = false + break + } + } + if delete { + tagAnnotationMgmtRsOoBConsMgmtInstPChildMapForDelete := NewAciObject() + tagAnnotationMgmtRsOoBConsMgmtInstPChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationMgmtRsOoBConsMgmtInstPChildMapForDelete.Attributes["key"] = tagAnnotationMgmtRsOoBConsMgmtInstP.Key.ValueString() + MgmtRsOoBConsMgmtInstPChildren = append(MgmtRsOoBConsMgmtInstPChildren, map[string]interface{}{"tagAnnotation": tagAnnotationMgmtRsOoBConsMgmtInstPChildMapForDelete}) + } + } } - if !mgmtRsOoBCons.TnVzOOBBrCPName.IsUnknown() && !mgmtRsOoBCons.TnVzOOBBrCPName.IsNull() { - childMap["attributes"]["tnVzOOBBrCPName"] = mgmtRsOoBCons.TnVzOOBBrCPName.ValueString() + + var tagTagMgmtRsOoBConsMgmtInstPPlan, tagTagMgmtRsOoBConsMgmtInstPState []TagTagMgmtRsOoBConsMgmtInstPResourceModel + mgmtRsOoBConsMgmtInstP.TagTag.ElementsAs(ctx, &tagTagMgmtRsOoBConsMgmtInstPPlan, false) + for _, tagTagMgmtRsOoBConsMgmtInstPstate := range mgmtRsOoBConsMgmtInstPState { + tagTagMgmtRsOoBConsMgmtInstPstate.TagTag.ElementsAs(ctx, &tagTagMgmtRsOoBConsMgmtInstPState, false) + } + if !mgmtRsOoBConsMgmtInstP.TagTag.IsNull() && !mgmtRsOoBConsMgmtInstP.TagTag.IsUnknown() { + tagTagIdentifiers := []TagTagIdentifier{} + for _, tagTagMgmtRsOoBConsMgmtInstP := range tagTagMgmtRsOoBConsMgmtInstPPlan { + tagTagMgmtRsOoBConsMgmtInstPChildMap := NewAciObject() + if !tagTagMgmtRsOoBConsMgmtInstP.Key.IsNull() && !tagTagMgmtRsOoBConsMgmtInstP.Key.IsUnknown() { + tagTagMgmtRsOoBConsMgmtInstPChildMap.Attributes["key"] = tagTagMgmtRsOoBConsMgmtInstP.Key.ValueString() + } + if !tagTagMgmtRsOoBConsMgmtInstP.Value.IsNull() && !tagTagMgmtRsOoBConsMgmtInstP.Value.IsUnknown() { + tagTagMgmtRsOoBConsMgmtInstPChildMap.Attributes["value"] = tagTagMgmtRsOoBConsMgmtInstP.Value.ValueString() + } + MgmtRsOoBConsMgmtInstPChildren = append(MgmtRsOoBConsMgmtInstPChildren, map[string]interface{}{"tagTag": tagTagMgmtRsOoBConsMgmtInstPChildMap}) + tagTagIdentifier := TagTagIdentifier{} + tagTagIdentifier.Key = tagTagMgmtRsOoBConsMgmtInstP.Key + tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) + } + for _, tagTagMgmtRsOoBConsMgmtInstP := range tagTagMgmtRsOoBConsMgmtInstPState { + delete := true + for _, tagTagIdentifier := range tagTagIdentifiers { + if tagTagIdentifier.Key == tagTagMgmtRsOoBConsMgmtInstP.Key { + delete = false + break + } + } + if delete { + tagTagMgmtRsOoBConsMgmtInstPChildMapForDelete := NewAciObject() + tagTagMgmtRsOoBConsMgmtInstPChildMapForDelete.Attributes["status"] = "deleted" + tagTagMgmtRsOoBConsMgmtInstPChildMapForDelete.Attributes["key"] = tagTagMgmtRsOoBConsMgmtInstP.Key.ValueString() + MgmtRsOoBConsMgmtInstPChildren = append(MgmtRsOoBConsMgmtInstPChildren, map[string]interface{}{"tagTag": tagTagMgmtRsOoBConsMgmtInstPChildMapForDelete}) + } + } } + childMap.Children = MgmtRsOoBConsMgmtInstPChildren childPayloads = append(childPayloads, map[string]interface{}{"mgmtRsOoBCons": childMap}) mgmtRsOoBConsIdentifier := MgmtRsOoBConsIdentifier{} - mgmtRsOoBConsIdentifier.TnVzOOBBrCPName = mgmtRsOoBCons.TnVzOOBBrCPName + mgmtRsOoBConsIdentifier.TnVzOOBBrCPName = mgmtRsOoBConsMgmtInstP.TnVzOOBBrCPName mgmtRsOoBConsIdentifiers = append(mgmtRsOoBConsIdentifiers, mgmtRsOoBConsIdentifier) } - for _, mgmtRsOoBCons := range mgmtRsOoBConsState { + for _, mgmtRsOoBCons := range mgmtRsOoBConsMgmtInstPState { delete := true for _, mgmtRsOoBConsIdentifier := range mgmtRsOoBConsIdentifiers { if mgmtRsOoBConsIdentifier.TnVzOOBBrCPName == mgmtRsOoBCons.TnVzOOBBrCPName { @@ -655,10 +904,10 @@ func getMgmtInstPMgmtRsOoBConsChildPayloads(ctx context.Context, diags *diag.Dia } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["tnVzOOBBrCPName"] = mgmtRsOoBCons.TnVzOOBBrCPName.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"mgmtRsOoBCons": childMap}) + mgmtRsOoBConsChildMapForDelete := NewAciObject() + mgmtRsOoBConsChildMapForDelete.Attributes["status"] = "deleted" + mgmtRsOoBConsChildMapForDelete.Attributes["tnVzOOBBrCPName"] = mgmtRsOoBCons.TnVzOOBBrCPName.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"mgmtRsOoBCons": mgmtRsOoBConsChildMapForDelete}) } } } else { @@ -667,25 +916,25 @@ func getMgmtInstPMgmtRsOoBConsChildPayloads(ctx context.Context, diags *diag.Dia return childPayloads } -func getMgmtInstPTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *MgmtInstPResourceModel, tagAnnotationPlan, tagAnnotationState []TagAnnotationMgmtInstPResourceModel) []map[string]interface{} { +func getMgmtInstPTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *MgmtInstPResourceModel, tagAnnotationMgmtInstPPlan, tagAnnotationMgmtInstPState []TagAnnotationMgmtInstPResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagAnnotation.IsUnknown() { + if !data.TagAnnotation.IsNull() && !data.TagAnnotation.IsUnknown() { tagAnnotationIdentifiers := []TagAnnotationIdentifier{} - for _, tagAnnotation := range tagAnnotationPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagAnnotation.Key.IsUnknown() && !tagAnnotation.Key.IsNull() { - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() + for _, tagAnnotationMgmtInstP := range tagAnnotationMgmtInstPPlan { + childMap := NewAciObject() + if !tagAnnotationMgmtInstP.Key.IsNull() && !tagAnnotationMgmtInstP.Key.IsUnknown() { + childMap.Attributes["key"] = tagAnnotationMgmtInstP.Key.ValueString() } - if !tagAnnotation.Value.IsUnknown() && !tagAnnotation.Value.IsNull() { - childMap["attributes"]["value"] = tagAnnotation.Value.ValueString() + if !tagAnnotationMgmtInstP.Value.IsNull() && !tagAnnotationMgmtInstP.Value.IsUnknown() { + childMap.Attributes["value"] = tagAnnotationMgmtInstP.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) tagAnnotationIdentifier := TagAnnotationIdentifier{} - tagAnnotationIdentifier.Key = tagAnnotation.Key + tagAnnotationIdentifier.Key = tagAnnotationMgmtInstP.Key tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) } - for _, tagAnnotation := range tagAnnotationState { + for _, tagAnnotation := range tagAnnotationMgmtInstPState { delete := true for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { if tagAnnotationIdentifier.Key == tagAnnotation.Key { @@ -694,10 +943,10 @@ func getMgmtInstPTagAnnotationChildPayloads(ctx context.Context, diags *diag.Dia } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) + tagAnnotationChildMapForDelete := NewAciObject() + tagAnnotationChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationChildMapForDelete.Attributes["key"] = tagAnnotation.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": tagAnnotationChildMapForDelete}) } } } else { @@ -706,25 +955,25 @@ func getMgmtInstPTagAnnotationChildPayloads(ctx context.Context, diags *diag.Dia return childPayloads } -func getMgmtInstPTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *MgmtInstPResourceModel, tagTagPlan, tagTagState []TagTagMgmtInstPResourceModel) []map[string]interface{} { +func getMgmtInstPTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *MgmtInstPResourceModel, tagTagMgmtInstPPlan, tagTagMgmtInstPState []TagTagMgmtInstPResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagTag.IsUnknown() { + if !data.TagTag.IsNull() && !data.TagTag.IsUnknown() { tagTagIdentifiers := []TagTagIdentifier{} - for _, tagTag := range tagTagPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagTag.Key.IsUnknown() && !tagTag.Key.IsNull() { - childMap["attributes"]["key"] = tagTag.Key.ValueString() + for _, tagTagMgmtInstP := range tagTagMgmtInstPPlan { + childMap := NewAciObject() + if !tagTagMgmtInstP.Key.IsNull() && !tagTagMgmtInstP.Key.IsUnknown() { + childMap.Attributes["key"] = tagTagMgmtInstP.Key.ValueString() } - if !tagTag.Value.IsUnknown() && !tagTag.Value.IsNull() { - childMap["attributes"]["value"] = tagTag.Value.ValueString() + if !tagTagMgmtInstP.Value.IsNull() && !tagTagMgmtInstP.Value.IsUnknown() { + childMap.Attributes["value"] = tagTagMgmtInstP.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) tagTagIdentifier := TagTagIdentifier{} - tagTagIdentifier.Key = tagTag.Key + tagTagIdentifier.Key = tagTagMgmtInstP.Key tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) } - for _, tagTag := range tagTagState { + for _, tagTag := range tagTagMgmtInstPState { delete := true for _, tagTagIdentifier := range tagTagIdentifiers { if tagTagIdentifier.Key == tagTag.Key { @@ -733,10 +982,10 @@ func getMgmtInstPTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostic } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagTag.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) + tagTagChildMapForDelete := NewAciObject() + tagTagChildMapForDelete.Attributes["status"] = "deleted" + tagTagChildMapForDelete.Attributes["key"] = tagTag.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagTag": tagTagChildMapForDelete}) } } } else { diff --git a/internal/provider/resource_aci_external_management_network_instance_profile_test.go b/internal/provider/resource_aci_external_management_network_instance_profile_test.go index 98c4bfd8e..984f0da26 100644 --- a/internal/provider/resource_aci_external_management_network_instance_profile_test.go +++ b/internal/provider/resource_aci_external_management_network_instance_profile_test.go @@ -141,9 +141,29 @@ func TestAccResourceMgmtInstP(t *testing.T) { resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "annotations.1.value", "test_value"), resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "annotations.#", "2"), resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.0.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.0.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.0.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.0.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.0.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.0.annotations.#", "2"), + resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.0.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.0.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.0.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.0.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.0.tags.#", "2"), resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.0.out_of_band_contract_name", "out_of_band_contract_name_0"), resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.0.priority", "level1"), resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.1.annotation", "annotation_2"), + resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.1.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.1.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.1.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.1.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.1.annotations.#", "2"), + resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.1.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.1.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.1.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.1.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.1.tags.#", "2"), resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.1.out_of_band_contract_name", "out_of_band_contract_name_1"), resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.1.priority", "level2"), resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.#", "2"), @@ -168,9 +188,29 @@ func TestAccResourceMgmtInstP(t *testing.T) { resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "annotations.1.value", "test_value"), resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "annotations.#", "2"), resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.0.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.0.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.0.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.0.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.0.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.0.annotations.#", "2"), + resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.0.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.0.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.0.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.0.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.0.tags.#", "2"), resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.0.out_of_band_contract_name", "out_of_band_contract_name_0"), resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.0.priority", "level1"), resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.1.annotation", "annotation_2"), + resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.1.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.1.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.1.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.1.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.1.annotations.#", "2"), + resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.1.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.1.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.1.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.1.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.1.tags.#", "2"), resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.1.out_of_band_contract_name", "out_of_band_contract_name_1"), resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.1.priority", "level2"), resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.#", "2"), @@ -193,6 +233,12 @@ func TestAccResourceMgmtInstP(t *testing.T) { resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "annotations.0.value", "test_value"), resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "annotations.#", "1"), resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.0.annotation", "annotation_2"), + resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.0.annotations.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.0.annotations.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.0.annotations.#", "1"), + resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.0.tags.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.0.tags.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.0.tags.#", "1"), resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.0.out_of_band_contract_name", "out_of_band_contract_name_1"), resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.0.priority", "level2"), resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.#", "1"), @@ -278,11 +324,51 @@ resource "aci_external_management_network_instance_profile" "test" { relation_to_consumed_out_of_band_contracts = [ { annotation = "annotation_1" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] out_of_band_contract_name = "out_of_band_contract_name_0" priority = "level1" }, { annotation = "annotation_2" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] out_of_band_contract_name = "out_of_band_contract_name_1" priority = "level2" }, @@ -318,6 +404,18 @@ resource "aci_external_management_network_instance_profile" "test" { relation_to_consumed_out_of_band_contracts = [ { annotation = "annotation_2" + annotations = [ + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_1" + value = "test_value" + }, + ] out_of_band_contract_name = "out_of_band_contract_name_1" priority = "level2" }, diff --git a/internal/provider/resource_aci_external_management_network_subnet.go b/internal/provider/resource_aci_external_management_network_subnet.go index c5e840833..4ce69bbf2 100644 --- a/internal/provider/resource_aci_external_management_network_subnet.go +++ b/internal/provider/resource_aci_external_management_network_subnet.go @@ -88,6 +88,13 @@ func getEmptyTagAnnotationMgmtSubnetResourceModel() TagAnnotationMgmtSubnetResou } } +var TagAnnotationMgmtSubnetType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // TagTagMgmtSubnetResourceModel describes the resource data model for the children without relation ships. type TagTagMgmtSubnetResourceModel struct { Key types.String `tfsdk:"key"` @@ -101,6 +108,13 @@ func getEmptyTagTagMgmtSubnetResourceModel() TagTagMgmtSubnetResourceModel { } } +var TagTagMgmtSubnetType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + type MgmtSubnetIdentifier struct { Ip types.String } @@ -441,7 +455,7 @@ func (r *MgmtSubnetResource) ImportState(ctx context.Context, req resource.Impor } func getAndSetMgmtSubnetAttributes(ctx context.Context, diags *diag.Diagnostics, client *client.Client, data *MgmtSubnetResourceModel) { - requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=children&rsp-subtree-class=%s", data.Id.ValueString(), "mgmtSubnet,tagAnnotation,tagTag"), "GET", nil) + requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=full&rsp-subtree-class=%s", data.Id.ValueString(), "mgmtSubnet,tagAnnotation,tagTag"), "GET", nil) readData := getEmptyMgmtSubnetResourceModel() @@ -490,6 +504,7 @@ func getAndSetMgmtSubnetAttributes(ctx context.Context, diags *diag.Diagnostics, if childAttributeName == "value" { TagAnnotationMgmtSubnet.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagAnnotationMgmtSubnetList = append(TagAnnotationMgmtSubnetList, TagAnnotationMgmtSubnet) } @@ -502,6 +517,7 @@ func getAndSetMgmtSubnetAttributes(ctx context.Context, diags *diag.Diagnostics, if childAttributeName == "value" { TagTagMgmtSubnet.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagTagMgmtSubnetList = append(TagTagMgmtSubnetList, TagTagMgmtSubnet) } @@ -549,25 +565,24 @@ func setMgmtSubnetId(ctx context.Context, data *MgmtSubnetResourceModel) { data.Id = types.StringValue(fmt.Sprintf("%s/%s", data.ParentDn.ValueString(), rn)) } -func getMgmtSubnetTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *MgmtSubnetResourceModel, tagAnnotationPlan, tagAnnotationState []TagAnnotationMgmtSubnetResourceModel) []map[string]interface{} { - +func getMgmtSubnetTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *MgmtSubnetResourceModel, tagAnnotationMgmtSubnetPlan, tagAnnotationMgmtSubnetState []TagAnnotationMgmtSubnetResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagAnnotation.IsUnknown() { + if !data.TagAnnotation.IsNull() && !data.TagAnnotation.IsUnknown() { tagAnnotationIdentifiers := []TagAnnotationIdentifier{} - for _, tagAnnotation := range tagAnnotationPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagAnnotation.Key.IsUnknown() && !tagAnnotation.Key.IsNull() { - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() + for _, tagAnnotationMgmtSubnet := range tagAnnotationMgmtSubnetPlan { + childMap := NewAciObject() + if !tagAnnotationMgmtSubnet.Key.IsNull() && !tagAnnotationMgmtSubnet.Key.IsUnknown() { + childMap.Attributes["key"] = tagAnnotationMgmtSubnet.Key.ValueString() } - if !tagAnnotation.Value.IsUnknown() && !tagAnnotation.Value.IsNull() { - childMap["attributes"]["value"] = tagAnnotation.Value.ValueString() + if !tagAnnotationMgmtSubnet.Value.IsNull() && !tagAnnotationMgmtSubnet.Value.IsUnknown() { + childMap.Attributes["value"] = tagAnnotationMgmtSubnet.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) tagAnnotationIdentifier := TagAnnotationIdentifier{} - tagAnnotationIdentifier.Key = tagAnnotation.Key + tagAnnotationIdentifier.Key = tagAnnotationMgmtSubnet.Key tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) } - for _, tagAnnotation := range tagAnnotationState { + for _, tagAnnotation := range tagAnnotationMgmtSubnetState { delete := true for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { if tagAnnotationIdentifier.Key == tagAnnotation.Key { @@ -576,10 +591,10 @@ func getMgmtSubnetTagAnnotationChildPayloads(ctx context.Context, diags *diag.Di } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) + tagAnnotationChildMapForDelete := NewAciObject() + tagAnnotationChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationChildMapForDelete.Attributes["key"] = tagAnnotation.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": tagAnnotationChildMapForDelete}) } } } else { @@ -588,25 +603,25 @@ func getMgmtSubnetTagAnnotationChildPayloads(ctx context.Context, diags *diag.Di return childPayloads } -func getMgmtSubnetTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *MgmtSubnetResourceModel, tagTagPlan, tagTagState []TagTagMgmtSubnetResourceModel) []map[string]interface{} { +func getMgmtSubnetTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *MgmtSubnetResourceModel, tagTagMgmtSubnetPlan, tagTagMgmtSubnetState []TagTagMgmtSubnetResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagTag.IsUnknown() { + if !data.TagTag.IsNull() && !data.TagTag.IsUnknown() { tagTagIdentifiers := []TagTagIdentifier{} - for _, tagTag := range tagTagPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagTag.Key.IsUnknown() && !tagTag.Key.IsNull() { - childMap["attributes"]["key"] = tagTag.Key.ValueString() + for _, tagTagMgmtSubnet := range tagTagMgmtSubnetPlan { + childMap := NewAciObject() + if !tagTagMgmtSubnet.Key.IsNull() && !tagTagMgmtSubnet.Key.IsUnknown() { + childMap.Attributes["key"] = tagTagMgmtSubnet.Key.ValueString() } - if !tagTag.Value.IsUnknown() && !tagTag.Value.IsNull() { - childMap["attributes"]["value"] = tagTag.Value.ValueString() + if !tagTagMgmtSubnet.Value.IsNull() && !tagTagMgmtSubnet.Value.IsUnknown() { + childMap.Attributes["value"] = tagTagMgmtSubnet.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) tagTagIdentifier := TagTagIdentifier{} - tagTagIdentifier.Key = tagTag.Key + tagTagIdentifier.Key = tagTagMgmtSubnet.Key tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) } - for _, tagTag := range tagTagState { + for _, tagTag := range tagTagMgmtSubnetState { delete := true for _, tagTagIdentifier := range tagTagIdentifiers { if tagTagIdentifier.Key == tagTag.Key { @@ -615,10 +630,10 @@ func getMgmtSubnetTagTagChildPayloads(ctx context.Context, diags *diag.Diagnosti } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagTag.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) + tagTagChildMapForDelete := NewAciObject() + tagTagChildMapForDelete.Attributes["status"] = "deleted" + tagTagChildMapForDelete.Attributes["key"] = tagTag.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagTag": tagTagChildMapForDelete}) } } } else { diff --git a/internal/provider/resource_aci_external_management_network_subnet_test.go b/internal/provider/resource_aci_external_management_network_subnet_test.go index c8094c05a..4747f6313 100644 --- a/internal/provider/resource_aci_external_management_network_subnet_test.go +++ b/internal/provider/resource_aci_external_management_network_subnet_test.go @@ -249,24 +249,24 @@ resource "aci_external_management_network_subnet" "test" { parent_dn = aci_external_management_network_instance_profile.test.id ip = "1.1.1.0/24" annotations = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] tags = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] } ` diff --git a/internal/provider/resource_aci_first_hop_security_policy.go b/internal/provider/resource_aci_first_hop_security_policy.go index f009c3c4d..75a519c0d 100644 --- a/internal/provider/resource_aci_first_hop_security_policy.go +++ b/internal/provider/resource_aci_first_hop_security_policy.go @@ -86,6 +86,8 @@ func getEmptyFhsBDPolResourceModel() *FhsBDPolResourceModel { "other_config_flag": types.StringType, "owner_key": types.StringType, "owner_tag": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFhsRaGuardPolFhsBDPolType}, + "tags": types.SetType{ElemType: TagTagFhsRaGuardPolFhsBDPolType}, }), TagAnnotation: types.SetNull(types.ObjectType{ AttrTypes: map[string]attr.Type{ @@ -117,6 +119,8 @@ type FhsRaGuardPolFhsBDPolResourceModel struct { OtherConfigFlag types.String `tfsdk:"other_config_flag"` OwnerKey types.String `tfsdk:"owner_key"` OwnerTag types.String `tfsdk:"owner_tag"` + TagAnnotation types.Set `tfsdk:"annotations"` + TagTag types.Set `tfsdk:"tags"` } func getEmptyFhsRaGuardPolFhsBDPolResourceModel() FhsRaGuardPolFhsBDPolResourceModel { @@ -134,6 +138,18 @@ func getEmptyFhsRaGuardPolFhsBDPolResourceModel() FhsRaGuardPolFhsBDPolResourceM OtherConfigFlag: basetypes.NewStringNull(), OwnerKey: basetypes.NewStringNull(), OwnerTag: basetypes.NewStringNull(), + TagAnnotation: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), } } @@ -151,6 +167,48 @@ var FhsRaGuardPolFhsBDPolType = map[string]attr.Type{ "other_config_flag": types.StringType, "owner_key": types.StringType, "owner_tag": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFhsRaGuardPolFhsBDPolType}, + "tags": types.SetType{ElemType: TagTagFhsRaGuardPolFhsBDPolType}, +} + +// TagAnnotationFhsRaGuardPolFhsBDPolResourceModel describes the resource data model for the children without relation ships. +type TagAnnotationFhsRaGuardPolFhsBDPolResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagAnnotationFhsRaGuardPolFhsBDPolResourceModel() TagAnnotationFhsRaGuardPolFhsBDPolResourceModel { + return TagAnnotationFhsRaGuardPolFhsBDPolResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagAnnotationFhsRaGuardPolFhsBDPolType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + +// TagTagFhsRaGuardPolFhsBDPolResourceModel describes the resource data model for the children without relation ships. +type TagTagFhsRaGuardPolFhsBDPolResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagTagFhsRaGuardPolFhsBDPolResourceModel() TagTagFhsRaGuardPolFhsBDPolResourceModel { + return TagTagFhsRaGuardPolFhsBDPolResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagTagFhsRaGuardPolFhsBDPolType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, } // TagAnnotationFhsBDPolResourceModel describes the resource data model for the children without relation ships. @@ -166,6 +224,13 @@ func getEmptyTagAnnotationFhsBDPolResourceModel() TagAnnotationFhsBDPolResourceM } } +var TagAnnotationFhsBDPolType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // TagTagFhsBDPolResourceModel describes the resource data model for the children without relation ships. type TagTagFhsBDPolResourceModel struct { Key types.String `tfsdk:"key"` @@ -179,6 +244,13 @@ func getEmptyTagTagFhsBDPolResourceModel() TagTagFhsBDPolResourceModel { } } +var TagTagFhsBDPolType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + type FhsBDPolIdentifier struct { Name types.String } @@ -461,6 +533,58 @@ func (r *FhsBDPolResource) Schema(ctx context.Context, req resource.SchemaReques }, MarkdownDescription: `A tag for enabling clients to add their own data. For example, to indicate who created this object.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, "annotations": schema.SetNestedAttribute{ @@ -706,7 +830,7 @@ func (r *FhsBDPolResource) ImportState(ctx context.Context, req resource.ImportS } func getAndSetFhsBDPolAttributes(ctx context.Context, diags *diag.Diagnostics, client *client.Client, data *FhsBDPolResourceModel) { - requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=children&rsp-subtree-class=%s", data.Id.ValueString(), "fhsBDPol,fhsRaGuardPol,tagAnnotation,tagTag"), "GET", nil) + requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=full&rsp-subtree-class=%s", data.Id.ValueString(), "fhsBDPol,fhsRaGuardPol,tagAnnotation,tagTag,tagAnnotation,tagTag"), "GET", nil) readData := getEmptyFhsBDPolResourceModel() @@ -801,7 +925,47 @@ func getAndSetFhsBDPolAttributes(ctx context.Context, diags *diag.Diagnostics, c if childAttributeName == "ownerTag" { FhsRaGuardPolFhsBDPol.OwnerTag = basetypes.NewStringValue(childAttributeValue.(string)) } + } + TagAnnotationFhsRaGuardPolFhsBDPolList := make([]TagAnnotationFhsRaGuardPolFhsBDPolResourceModel, 0) + TagTagFhsRaGuardPolFhsBDPolList := make([]TagTagFhsRaGuardPolFhsBDPolResourceModel, 0) + childrenOfFhsRaGuardPolFhsBDPol, childrenOfFhsRaGuardPolFhsBDPolExist := childClassDetails.(map[string]interface{})["children"] + if childrenOfFhsRaGuardPolFhsBDPolExist { + for _, childFhsRaGuardPolFhsBDPol := range childrenOfFhsRaGuardPolFhsBDPol.([]interface{}) { + for childClassNameFhsRaGuardPolFhsBDPol, childClassDetailsFhsRaGuardPolFhsBDPol := range childFhsRaGuardPolFhsBDPol.(map[string]interface{}) { + if childClassNameFhsRaGuardPolFhsBDPol == "tagAnnotation" { + TagAnnotationFhsRaGuardPolFhsBDPol := getEmptyTagAnnotationFhsRaGuardPolFhsBDPolResourceModel() + tagAnnotationchildAttributeValue := childClassDetailsFhsRaGuardPolFhsBDPol.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagAnnotationchildAttributeValue { + if childAttributeName == "key" { + TagAnnotationFhsRaGuardPolFhsBDPol.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagAnnotationFhsRaGuardPolFhsBDPol.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagAnnotationFhsRaGuardPolFhsBDPolList = append(TagAnnotationFhsRaGuardPolFhsBDPolList, TagAnnotationFhsRaGuardPolFhsBDPol) + } + if childClassNameFhsRaGuardPolFhsBDPol == "tagTag" { + TagTagFhsRaGuardPolFhsBDPol := getEmptyTagTagFhsRaGuardPolFhsBDPolResourceModel() + tagTagchildAttributeValue := childClassDetailsFhsRaGuardPolFhsBDPol.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagTagchildAttributeValue { + if childAttributeName == "key" { + TagTagFhsRaGuardPolFhsBDPol.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagTagFhsRaGuardPolFhsBDPol.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagTagFhsRaGuardPolFhsBDPolList = append(TagTagFhsRaGuardPolFhsBDPolList, TagTagFhsRaGuardPolFhsBDPol) + } + } + } + } + TagAnnotationFhsRaGuardPolFhsBDPolSet, _ := types.SetValueFrom(ctx, TagAnnotationFhsRaGuardPolFhsBDPolType, TagAnnotationFhsRaGuardPolFhsBDPolList) + FhsRaGuardPolFhsBDPol.TagAnnotation = TagAnnotationFhsRaGuardPolFhsBDPolSet + TagTagFhsRaGuardPolFhsBDPolSet, _ := types.SetValueFrom(ctx, TagTagFhsRaGuardPolFhsBDPolType, TagTagFhsRaGuardPolFhsBDPolList) + FhsRaGuardPolFhsBDPol.TagTag = TagTagFhsRaGuardPolFhsBDPolSet FhsRaGuardPolFhsBDPolList = append(FhsRaGuardPolFhsBDPolList, FhsRaGuardPolFhsBDPol) } if childClassName == "tagAnnotation" { @@ -813,6 +977,7 @@ func getAndSetFhsBDPolAttributes(ctx context.Context, diags *diag.Diagnostics, c if childAttributeName == "value" { TagAnnotationFhsBDPol.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagAnnotationFhsBDPolList = append(TagAnnotationFhsBDPolList, TagAnnotationFhsBDPol) } @@ -825,6 +990,7 @@ func getAndSetFhsBDPolAttributes(ctx context.Context, diags *diag.Diagnostics, c if childAttributeName == "value" { TagTagFhsBDPol.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagTagFhsBDPolList = append(TagTagFhsBDPolList, TagTagFhsBDPol) } @@ -879,56 +1045,131 @@ func setFhsBDPolId(ctx context.Context, data *FhsBDPolResourceModel) { data.Id = types.StringValue(fmt.Sprintf("%s/%s", data.ParentDn.ValueString(), rn)) } -func getFhsBDPolFhsRaGuardPolChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FhsBDPolResourceModel, fhsRaGuardPolPlan, fhsRaGuardPolState FhsRaGuardPolFhsBDPolResourceModel) []map[string]interface{} { - +func getFhsBDPolFhsRaGuardPolChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FhsBDPolResourceModel, fhsRaGuardPolFhsBDPolPlan, fhsRaGuardPolFhsBDPolState FhsRaGuardPolFhsBDPolResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.FhsRaGuardPol.IsUnknown() { - childMap := map[string]map[string]interface{}{"attributes": {}} + if !data.FhsRaGuardPol.IsNull() && !data.FhsRaGuardPol.IsUnknown() { + FhsRaGuardPolFhsBDPolChildren := make([]map[string]interface{}, 0) + childMap := NewAciObject() if !IsEmptySingleNestedAttribute(data.FhsRaGuardPol.Attributes()) { - if !fhsRaGuardPolPlan.Annotation.IsUnknown() && !fhsRaGuardPolPlan.Annotation.IsNull() { - childMap["attributes"]["annotation"] = fhsRaGuardPolPlan.Annotation.ValueString() + if !fhsRaGuardPolFhsBDPolPlan.Annotation.IsUnknown() && !fhsRaGuardPolFhsBDPolPlan.Annotation.IsNull() { + childMap.Attributes["annotation"] = fhsRaGuardPolFhsBDPolPlan.Annotation.ValueString() } else { - childMap["attributes"]["annotation"] = globalAnnotation + childMap.Attributes["annotation"] = globalAnnotation } - if !fhsRaGuardPolPlan.Descr.IsUnknown() && !fhsRaGuardPolPlan.Descr.IsNull() { - childMap["attributes"]["descr"] = fhsRaGuardPolPlan.Descr.ValueString() + if !fhsRaGuardPolFhsBDPolPlan.Descr.IsUnknown() && !fhsRaGuardPolFhsBDPolPlan.Descr.IsNull() { + childMap.Attributes["descr"] = fhsRaGuardPolFhsBDPolPlan.Descr.ValueString() } - if !fhsRaGuardPolPlan.ManagedConfigCheck.IsUnknown() && !fhsRaGuardPolPlan.ManagedConfigCheck.IsNull() { - childMap["attributes"]["managedConfigCheck"] = fhsRaGuardPolPlan.ManagedConfigCheck.ValueString() + if !fhsRaGuardPolFhsBDPolPlan.ManagedConfigCheck.IsUnknown() && !fhsRaGuardPolFhsBDPolPlan.ManagedConfigCheck.IsNull() { + childMap.Attributes["managedConfigCheck"] = fhsRaGuardPolFhsBDPolPlan.ManagedConfigCheck.ValueString() } - if !fhsRaGuardPolPlan.ManagedConfigFlag.IsUnknown() && !fhsRaGuardPolPlan.ManagedConfigFlag.IsNull() { - childMap["attributes"]["managedConfigFlag"] = fhsRaGuardPolPlan.ManagedConfigFlag.ValueString() + if !fhsRaGuardPolFhsBDPolPlan.ManagedConfigFlag.IsUnknown() && !fhsRaGuardPolFhsBDPolPlan.ManagedConfigFlag.IsNull() { + childMap.Attributes["managedConfigFlag"] = fhsRaGuardPolFhsBDPolPlan.ManagedConfigFlag.ValueString() } - if !fhsRaGuardPolPlan.MaxHopLimit.IsUnknown() && !fhsRaGuardPolPlan.MaxHopLimit.IsNull() { - childMap["attributes"]["maxHopLimit"] = fhsRaGuardPolPlan.MaxHopLimit.ValueString() + if !fhsRaGuardPolFhsBDPolPlan.MaxHopLimit.IsUnknown() && !fhsRaGuardPolFhsBDPolPlan.MaxHopLimit.IsNull() { + childMap.Attributes["maxHopLimit"] = fhsRaGuardPolFhsBDPolPlan.MaxHopLimit.ValueString() } - if !fhsRaGuardPolPlan.MaxRouterPref.IsUnknown() && !fhsRaGuardPolPlan.MaxRouterPref.IsNull() { - childMap["attributes"]["maxRouterPref"] = fhsRaGuardPolPlan.MaxRouterPref.ValueString() + if !fhsRaGuardPolFhsBDPolPlan.MaxRouterPref.IsUnknown() && !fhsRaGuardPolFhsBDPolPlan.MaxRouterPref.IsNull() { + childMap.Attributes["maxRouterPref"] = fhsRaGuardPolFhsBDPolPlan.MaxRouterPref.ValueString() } - if !fhsRaGuardPolPlan.MinHopLimit.IsUnknown() && !fhsRaGuardPolPlan.MinHopLimit.IsNull() { - childMap["attributes"]["minHopLimit"] = fhsRaGuardPolPlan.MinHopLimit.ValueString() + if !fhsRaGuardPolFhsBDPolPlan.MinHopLimit.IsUnknown() && !fhsRaGuardPolFhsBDPolPlan.MinHopLimit.IsNull() { + childMap.Attributes["minHopLimit"] = fhsRaGuardPolFhsBDPolPlan.MinHopLimit.ValueString() } - if !fhsRaGuardPolPlan.Name.IsUnknown() && !fhsRaGuardPolPlan.Name.IsNull() { - childMap["attributes"]["name"] = fhsRaGuardPolPlan.Name.ValueString() + if !fhsRaGuardPolFhsBDPolPlan.Name.IsUnknown() && !fhsRaGuardPolFhsBDPolPlan.Name.IsNull() { + childMap.Attributes["name"] = fhsRaGuardPolFhsBDPolPlan.Name.ValueString() } - if !fhsRaGuardPolPlan.NameAlias.IsUnknown() && !fhsRaGuardPolPlan.NameAlias.IsNull() { - childMap["attributes"]["nameAlias"] = fhsRaGuardPolPlan.NameAlias.ValueString() + if !fhsRaGuardPolFhsBDPolPlan.NameAlias.IsUnknown() && !fhsRaGuardPolFhsBDPolPlan.NameAlias.IsNull() { + childMap.Attributes["nameAlias"] = fhsRaGuardPolFhsBDPolPlan.NameAlias.ValueString() } - if !fhsRaGuardPolPlan.OtherConfigCheck.IsUnknown() && !fhsRaGuardPolPlan.OtherConfigCheck.IsNull() { - childMap["attributes"]["otherConfigCheck"] = fhsRaGuardPolPlan.OtherConfigCheck.ValueString() + if !fhsRaGuardPolFhsBDPolPlan.OtherConfigCheck.IsUnknown() && !fhsRaGuardPolFhsBDPolPlan.OtherConfigCheck.IsNull() { + childMap.Attributes["otherConfigCheck"] = fhsRaGuardPolFhsBDPolPlan.OtherConfigCheck.ValueString() } - if !fhsRaGuardPolPlan.OtherConfigFlag.IsUnknown() && !fhsRaGuardPolPlan.OtherConfigFlag.IsNull() { - childMap["attributes"]["otherConfigFlag"] = fhsRaGuardPolPlan.OtherConfigFlag.ValueString() + if !fhsRaGuardPolFhsBDPolPlan.OtherConfigFlag.IsUnknown() && !fhsRaGuardPolFhsBDPolPlan.OtherConfigFlag.IsNull() { + childMap.Attributes["otherConfigFlag"] = fhsRaGuardPolFhsBDPolPlan.OtherConfigFlag.ValueString() } - if !fhsRaGuardPolPlan.OwnerKey.IsUnknown() && !fhsRaGuardPolPlan.OwnerKey.IsNull() { - childMap["attributes"]["ownerKey"] = fhsRaGuardPolPlan.OwnerKey.ValueString() + if !fhsRaGuardPolFhsBDPolPlan.OwnerKey.IsUnknown() && !fhsRaGuardPolFhsBDPolPlan.OwnerKey.IsNull() { + childMap.Attributes["ownerKey"] = fhsRaGuardPolFhsBDPolPlan.OwnerKey.ValueString() } - if !fhsRaGuardPolPlan.OwnerTag.IsUnknown() && !fhsRaGuardPolPlan.OwnerTag.IsNull() { - childMap["attributes"]["ownerTag"] = fhsRaGuardPolPlan.OwnerTag.ValueString() + if !fhsRaGuardPolFhsBDPolPlan.OwnerTag.IsUnknown() && !fhsRaGuardPolFhsBDPolPlan.OwnerTag.IsNull() { + childMap.Attributes["ownerTag"] = fhsRaGuardPolFhsBDPolPlan.OwnerTag.ValueString() } } else { - childMap["attributes"]["status"] = "deleted" + childMap.Attributes["status"] = "deleted" + } + + var tagAnnotationFhsRaGuardPolFhsBDPolPlan, tagAnnotationFhsRaGuardPolFhsBDPolState []TagAnnotationFhsRaGuardPolFhsBDPolResourceModel + fhsRaGuardPolFhsBDPolPlan.TagAnnotation.ElementsAs(ctx, &tagAnnotationFhsRaGuardPolFhsBDPolPlan, false) + if !fhsRaGuardPolFhsBDPolState.TagAnnotation.IsNull() { + fhsRaGuardPolFhsBDPolState.TagAnnotation.ElementsAs(ctx, &tagAnnotationFhsRaGuardPolFhsBDPolState, false) + } + if !fhsRaGuardPolFhsBDPolPlan.TagAnnotation.IsNull() && !fhsRaGuardPolFhsBDPolPlan.TagAnnotation.IsUnknown() { + tagAnnotationIdentifiers := []TagAnnotationIdentifier{} + for _, tagAnnotationFhsRaGuardPolFhsBDPol := range tagAnnotationFhsRaGuardPolFhsBDPolPlan { + tagAnnotationFhsRaGuardPolFhsBDPolChildMap := NewAciObject() + if !tagAnnotationFhsRaGuardPolFhsBDPol.Key.IsNull() && !tagAnnotationFhsRaGuardPolFhsBDPol.Key.IsUnknown() { + tagAnnotationFhsRaGuardPolFhsBDPolChildMap.Attributes["key"] = tagAnnotationFhsRaGuardPolFhsBDPol.Key.ValueString() + } + if !tagAnnotationFhsRaGuardPolFhsBDPol.Value.IsNull() && !tagAnnotationFhsRaGuardPolFhsBDPol.Value.IsUnknown() { + tagAnnotationFhsRaGuardPolFhsBDPolChildMap.Attributes["value"] = tagAnnotationFhsRaGuardPolFhsBDPol.Value.ValueString() + } + FhsRaGuardPolFhsBDPolChildren = append(FhsRaGuardPolFhsBDPolChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFhsRaGuardPolFhsBDPolChildMap}) + tagAnnotationIdentifier := TagAnnotationIdentifier{} + tagAnnotationIdentifier.Key = tagAnnotationFhsRaGuardPolFhsBDPol.Key + tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) + } + for _, tagAnnotationFhsRaGuardPolFhsBDPol := range tagAnnotationFhsRaGuardPolFhsBDPolState { + delete := true + for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { + if tagAnnotationIdentifier.Key == tagAnnotationFhsRaGuardPolFhsBDPol.Key { + delete = false + break + } + } + if delete { + tagAnnotationFhsRaGuardPolFhsBDPolChildMapForDelete := NewAciObject() + tagAnnotationFhsRaGuardPolFhsBDPolChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationFhsRaGuardPolFhsBDPolChildMapForDelete.Attributes["key"] = tagAnnotationFhsRaGuardPolFhsBDPol.Key.ValueString() + FhsRaGuardPolFhsBDPolChildren = append(FhsRaGuardPolFhsBDPolChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFhsRaGuardPolFhsBDPolChildMapForDelete}) + } + } + } + + var tagTagFhsRaGuardPolFhsBDPolPlan, tagTagFhsRaGuardPolFhsBDPolState []TagTagFhsRaGuardPolFhsBDPolResourceModel + fhsRaGuardPolFhsBDPolPlan.TagTag.ElementsAs(ctx, &tagTagFhsRaGuardPolFhsBDPolPlan, false) + if !fhsRaGuardPolFhsBDPolState.TagTag.IsNull() { + fhsRaGuardPolFhsBDPolState.TagTag.ElementsAs(ctx, &tagTagFhsRaGuardPolFhsBDPolState, false) + } + if !fhsRaGuardPolFhsBDPolPlan.TagTag.IsNull() && !fhsRaGuardPolFhsBDPolPlan.TagTag.IsUnknown() { + tagTagIdentifiers := []TagTagIdentifier{} + for _, tagTagFhsRaGuardPolFhsBDPol := range tagTagFhsRaGuardPolFhsBDPolPlan { + tagTagFhsRaGuardPolFhsBDPolChildMap := NewAciObject() + if !tagTagFhsRaGuardPolFhsBDPol.Key.IsNull() && !tagTagFhsRaGuardPolFhsBDPol.Key.IsUnknown() { + tagTagFhsRaGuardPolFhsBDPolChildMap.Attributes["key"] = tagTagFhsRaGuardPolFhsBDPol.Key.ValueString() + } + if !tagTagFhsRaGuardPolFhsBDPol.Value.IsNull() && !tagTagFhsRaGuardPolFhsBDPol.Value.IsUnknown() { + tagTagFhsRaGuardPolFhsBDPolChildMap.Attributes["value"] = tagTagFhsRaGuardPolFhsBDPol.Value.ValueString() + } + FhsRaGuardPolFhsBDPolChildren = append(FhsRaGuardPolFhsBDPolChildren, map[string]interface{}{"tagTag": tagTagFhsRaGuardPolFhsBDPolChildMap}) + tagTagIdentifier := TagTagIdentifier{} + tagTagIdentifier.Key = tagTagFhsRaGuardPolFhsBDPol.Key + tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) + } + for _, tagTagFhsRaGuardPolFhsBDPol := range tagTagFhsRaGuardPolFhsBDPolState { + delete := true + for _, tagTagIdentifier := range tagTagIdentifiers { + if tagTagIdentifier.Key == tagTagFhsRaGuardPolFhsBDPol.Key { + delete = false + break + } + } + if delete { + tagTagFhsRaGuardPolFhsBDPolChildMapForDelete := NewAciObject() + tagTagFhsRaGuardPolFhsBDPolChildMapForDelete.Attributes["status"] = "deleted" + tagTagFhsRaGuardPolFhsBDPolChildMapForDelete.Attributes["key"] = tagTagFhsRaGuardPolFhsBDPol.Key.ValueString() + FhsRaGuardPolFhsBDPolChildren = append(FhsRaGuardPolFhsBDPolChildren, map[string]interface{}{"tagTag": tagTagFhsRaGuardPolFhsBDPolChildMapForDelete}) + } + } } + childMap.Children = FhsRaGuardPolFhsBDPolChildren childPayloads = append(childPayloads, map[string]interface{}{"fhsRaGuardPol": childMap}) } else { FhsRaGuardPolObject, _ := types.ObjectValueFrom(ctx, FhsRaGuardPolFhsBDPolType, getEmptyFhsRaGuardPolFhsBDPolResourceModel()) @@ -937,25 +1178,25 @@ func getFhsBDPolFhsRaGuardPolChildPayloads(ctx context.Context, diags *diag.Diag return childPayloads } -func getFhsBDPolTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FhsBDPolResourceModel, tagAnnotationPlan, tagAnnotationState []TagAnnotationFhsBDPolResourceModel) []map[string]interface{} { +func getFhsBDPolTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FhsBDPolResourceModel, tagAnnotationFhsBDPolPlan, tagAnnotationFhsBDPolState []TagAnnotationFhsBDPolResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagAnnotation.IsUnknown() { + if !data.TagAnnotation.IsNull() && !data.TagAnnotation.IsUnknown() { tagAnnotationIdentifiers := []TagAnnotationIdentifier{} - for _, tagAnnotation := range tagAnnotationPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagAnnotation.Key.IsUnknown() && !tagAnnotation.Key.IsNull() { - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() + for _, tagAnnotationFhsBDPol := range tagAnnotationFhsBDPolPlan { + childMap := NewAciObject() + if !tagAnnotationFhsBDPol.Key.IsNull() && !tagAnnotationFhsBDPol.Key.IsUnknown() { + childMap.Attributes["key"] = tagAnnotationFhsBDPol.Key.ValueString() } - if !tagAnnotation.Value.IsUnknown() && !tagAnnotation.Value.IsNull() { - childMap["attributes"]["value"] = tagAnnotation.Value.ValueString() + if !tagAnnotationFhsBDPol.Value.IsNull() && !tagAnnotationFhsBDPol.Value.IsUnknown() { + childMap.Attributes["value"] = tagAnnotationFhsBDPol.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) tagAnnotationIdentifier := TagAnnotationIdentifier{} - tagAnnotationIdentifier.Key = tagAnnotation.Key + tagAnnotationIdentifier.Key = tagAnnotationFhsBDPol.Key tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) } - for _, tagAnnotation := range tagAnnotationState { + for _, tagAnnotation := range tagAnnotationFhsBDPolState { delete := true for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { if tagAnnotationIdentifier.Key == tagAnnotation.Key { @@ -964,10 +1205,10 @@ func getFhsBDPolTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diag } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) + tagAnnotationChildMapForDelete := NewAciObject() + tagAnnotationChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationChildMapForDelete.Attributes["key"] = tagAnnotation.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": tagAnnotationChildMapForDelete}) } } } else { @@ -976,25 +1217,25 @@ func getFhsBDPolTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diag return childPayloads } -func getFhsBDPolTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FhsBDPolResourceModel, tagTagPlan, tagTagState []TagTagFhsBDPolResourceModel) []map[string]interface{} { +func getFhsBDPolTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FhsBDPolResourceModel, tagTagFhsBDPolPlan, tagTagFhsBDPolState []TagTagFhsBDPolResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagTag.IsUnknown() { + if !data.TagTag.IsNull() && !data.TagTag.IsUnknown() { tagTagIdentifiers := []TagTagIdentifier{} - for _, tagTag := range tagTagPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagTag.Key.IsUnknown() && !tagTag.Key.IsNull() { - childMap["attributes"]["key"] = tagTag.Key.ValueString() + for _, tagTagFhsBDPol := range tagTagFhsBDPolPlan { + childMap := NewAciObject() + if !tagTagFhsBDPol.Key.IsNull() && !tagTagFhsBDPol.Key.IsUnknown() { + childMap.Attributes["key"] = tagTagFhsBDPol.Key.ValueString() } - if !tagTag.Value.IsUnknown() && !tagTag.Value.IsNull() { - childMap["attributes"]["value"] = tagTag.Value.ValueString() + if !tagTagFhsBDPol.Value.IsNull() && !tagTagFhsBDPol.Value.IsUnknown() { + childMap.Attributes["value"] = tagTagFhsBDPol.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) tagTagIdentifier := TagTagIdentifier{} - tagTagIdentifier.Key = tagTag.Key + tagTagIdentifier.Key = tagTagFhsBDPol.Key tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) } - for _, tagTag := range tagTagState { + for _, tagTag := range tagTagFhsBDPolState { delete := true for _, tagTagIdentifier := range tagTagIdentifiers { if tagTagIdentifier.Key == tagTag.Key { @@ -1003,10 +1244,10 @@ func getFhsBDPolTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagTag.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) + tagTagChildMapForDelete := NewAciObject() + tagTagChildMapForDelete.Attributes["status"] = "deleted" + tagTagChildMapForDelete.Attributes["key"] = tagTag.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagTag": tagTagChildMapForDelete}) } } } else { diff --git a/internal/provider/resource_aci_first_hop_security_policy_test.go b/internal/provider/resource_aci_first_hop_security_policy_test.go index 66d87102f..0c3f8bbfa 100644 --- a/internal/provider/resource_aci_first_hop_security_policy_test.go +++ b/internal/provider/resource_aci_first_hop_security_policy_test.go @@ -219,6 +219,16 @@ func TestAccResourceFhsBDPolWithFvTenant(t *testing.T) { resource.TestCheckResourceAttr("aci_first_hop_security_policy.test", "annotations.1.value", "test_value"), resource.TestCheckResourceAttr("aci_first_hop_security_policy.test", "annotations.#", "2"), resource.TestCheckResourceAttr("aci_first_hop_security_policy.test", "route_advertisement_guard_policy.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_first_hop_security_policy.test", "route_advertisement_guard_policy.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_first_hop_security_policy.test", "route_advertisement_guard_policy.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_first_hop_security_policy.test", "route_advertisement_guard_policy.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_first_hop_security_policy.test", "route_advertisement_guard_policy.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_first_hop_security_policy.test", "annotations.#", "2"), + resource.TestCheckResourceAttr("aci_first_hop_security_policy.test", "route_advertisement_guard_policy.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_first_hop_security_policy.test", "route_advertisement_guard_policy.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_first_hop_security_policy.test", "route_advertisement_guard_policy.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_first_hop_security_policy.test", "route_advertisement_guard_policy.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_first_hop_security_policy.test", "tags.#", "2"), resource.TestCheckResourceAttr("aci_first_hop_security_policy.test", "route_advertisement_guard_policy.description", "description_1"), resource.TestCheckResourceAttr("aci_first_hop_security_policy.test", "route_advertisement_guard_policy.managed_config_check", "no"), resource.TestCheckResourceAttr("aci_first_hop_security_policy.test", "route_advertisement_guard_policy.managed_config_flag", "no"), @@ -256,6 +266,8 @@ func TestAccResourceFhsBDPolWithFvTenant(t *testing.T) { knownvalue.MapExact( map[string]knownvalue.Check{ "annotation": knownvalue.Null(), + "annotations": knownvalue.Null(), + "tags": knownvalue.Null(), "description": knownvalue.Null(), "managed_config_check": knownvalue.Null(), "managed_config_flag": knownvalue.Null(), @@ -287,6 +299,8 @@ func TestAccResourceFhsBDPolWithFvTenant(t *testing.T) { knownvalue.MapExact( map[string]knownvalue.Check{ "annotation": knownvalue.Null(), + "annotations": knownvalue.Null(), + "tags": knownvalue.Null(), "description": knownvalue.Null(), "managed_config_check": knownvalue.Null(), "managed_config_flag": knownvalue.Null(), @@ -362,17 +376,37 @@ resource "aci_first_hop_security_policy" "test" { parent_dn = aci_tenant.test.id name = "test_name" annotations = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] route_advertisement_guard_policy = { annotation = "annotation_1" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] description = "description_1" managed_config_check = "no" managed_config_flag = "no" @@ -387,14 +421,14 @@ resource "aci_first_hop_security_policy" "test" { owner_tag = "owner_tag_1" } tags = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] } ` diff --git a/internal/provider/resource_aci_igmp_snooping_policy.go b/internal/provider/resource_aci_igmp_snooping_policy.go index 72ece44d7..8018726c1 100644 --- a/internal/provider/resource_aci_igmp_snooping_policy.go +++ b/internal/provider/resource_aci_igmp_snooping_policy.go @@ -110,6 +110,13 @@ func getEmptyTagAnnotationIgmpSnoopPolResourceModel() TagAnnotationIgmpSnoopPolR } } +var TagAnnotationIgmpSnoopPolType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // TagTagIgmpSnoopPolResourceModel describes the resource data model for the children without relation ships. type TagTagIgmpSnoopPolResourceModel struct { Key types.String `tfsdk:"key"` @@ -123,6 +130,13 @@ func getEmptyTagTagIgmpSnoopPolResourceModel() TagTagIgmpSnoopPolResourceModel { } } +var TagTagIgmpSnoopPolType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + type IgmpSnoopPolIdentifier struct { Name types.String } @@ -557,7 +571,7 @@ func (r *IgmpSnoopPolResource) ImportState(ctx context.Context, req resource.Imp } func getAndSetIgmpSnoopPolAttributes(ctx context.Context, diags *diag.Diagnostics, client *client.Client, data *IgmpSnoopPolResourceModel) { - requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=children&rsp-subtree-class=%s", data.Id.ValueString(), "igmpSnoopPol,tagAnnotation,tagTag"), "GET", nil) + requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=full&rsp-subtree-class=%s", data.Id.ValueString(), "igmpSnoopPol,tagAnnotation,tagTag"), "GET", nil) readData := getEmptyIgmpSnoopPolResourceModel() @@ -638,6 +652,7 @@ func getAndSetIgmpSnoopPolAttributes(ctx context.Context, diags *diag.Diagnostic if childAttributeName == "value" { TagAnnotationIgmpSnoopPol.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagAnnotationIgmpSnoopPolList = append(TagAnnotationIgmpSnoopPolList, TagAnnotationIgmpSnoopPol) } @@ -650,6 +665,7 @@ func getAndSetIgmpSnoopPolAttributes(ctx context.Context, diags *diag.Diagnostic if childAttributeName == "value" { TagTagIgmpSnoopPol.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagTagIgmpSnoopPolList = append(TagTagIgmpSnoopPolList, TagTagIgmpSnoopPol) } @@ -697,25 +713,24 @@ func setIgmpSnoopPolId(ctx context.Context, data *IgmpSnoopPolResourceModel) { data.Id = types.StringValue(fmt.Sprintf("%s/%s", data.ParentDn.ValueString(), rn)) } -func getIgmpSnoopPolTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *IgmpSnoopPolResourceModel, tagAnnotationPlan, tagAnnotationState []TagAnnotationIgmpSnoopPolResourceModel) []map[string]interface{} { - +func getIgmpSnoopPolTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *IgmpSnoopPolResourceModel, tagAnnotationIgmpSnoopPolPlan, tagAnnotationIgmpSnoopPolState []TagAnnotationIgmpSnoopPolResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagAnnotation.IsUnknown() { + if !data.TagAnnotation.IsNull() && !data.TagAnnotation.IsUnknown() { tagAnnotationIdentifiers := []TagAnnotationIdentifier{} - for _, tagAnnotation := range tagAnnotationPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagAnnotation.Key.IsUnknown() && !tagAnnotation.Key.IsNull() { - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() + for _, tagAnnotationIgmpSnoopPol := range tagAnnotationIgmpSnoopPolPlan { + childMap := NewAciObject() + if !tagAnnotationIgmpSnoopPol.Key.IsNull() && !tagAnnotationIgmpSnoopPol.Key.IsUnknown() { + childMap.Attributes["key"] = tagAnnotationIgmpSnoopPol.Key.ValueString() } - if !tagAnnotation.Value.IsUnknown() && !tagAnnotation.Value.IsNull() { - childMap["attributes"]["value"] = tagAnnotation.Value.ValueString() + if !tagAnnotationIgmpSnoopPol.Value.IsNull() && !tagAnnotationIgmpSnoopPol.Value.IsUnknown() { + childMap.Attributes["value"] = tagAnnotationIgmpSnoopPol.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) tagAnnotationIdentifier := TagAnnotationIdentifier{} - tagAnnotationIdentifier.Key = tagAnnotation.Key + tagAnnotationIdentifier.Key = tagAnnotationIgmpSnoopPol.Key tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) } - for _, tagAnnotation := range tagAnnotationState { + for _, tagAnnotation := range tagAnnotationIgmpSnoopPolState { delete := true for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { if tagAnnotationIdentifier.Key == tagAnnotation.Key { @@ -724,10 +739,10 @@ func getIgmpSnoopPolTagAnnotationChildPayloads(ctx context.Context, diags *diag. } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) + tagAnnotationChildMapForDelete := NewAciObject() + tagAnnotationChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationChildMapForDelete.Attributes["key"] = tagAnnotation.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": tagAnnotationChildMapForDelete}) } } } else { @@ -736,25 +751,25 @@ func getIgmpSnoopPolTagAnnotationChildPayloads(ctx context.Context, diags *diag. return childPayloads } -func getIgmpSnoopPolTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *IgmpSnoopPolResourceModel, tagTagPlan, tagTagState []TagTagIgmpSnoopPolResourceModel) []map[string]interface{} { +func getIgmpSnoopPolTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *IgmpSnoopPolResourceModel, tagTagIgmpSnoopPolPlan, tagTagIgmpSnoopPolState []TagTagIgmpSnoopPolResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagTag.IsUnknown() { + if !data.TagTag.IsNull() && !data.TagTag.IsUnknown() { tagTagIdentifiers := []TagTagIdentifier{} - for _, tagTag := range tagTagPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagTag.Key.IsUnknown() && !tagTag.Key.IsNull() { - childMap["attributes"]["key"] = tagTag.Key.ValueString() + for _, tagTagIgmpSnoopPol := range tagTagIgmpSnoopPolPlan { + childMap := NewAciObject() + if !tagTagIgmpSnoopPol.Key.IsNull() && !tagTagIgmpSnoopPol.Key.IsUnknown() { + childMap.Attributes["key"] = tagTagIgmpSnoopPol.Key.ValueString() } - if !tagTag.Value.IsUnknown() && !tagTag.Value.IsNull() { - childMap["attributes"]["value"] = tagTag.Value.ValueString() + if !tagTagIgmpSnoopPol.Value.IsNull() && !tagTagIgmpSnoopPol.Value.IsUnknown() { + childMap.Attributes["value"] = tagTagIgmpSnoopPol.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) tagTagIdentifier := TagTagIdentifier{} - tagTagIdentifier.Key = tagTag.Key + tagTagIdentifier.Key = tagTagIgmpSnoopPol.Key tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) } - for _, tagTag := range tagTagState { + for _, tagTag := range tagTagIgmpSnoopPolState { delete := true for _, tagTagIdentifier := range tagTagIdentifiers { if tagTagIdentifier.Key == tagTag.Key { @@ -763,10 +778,10 @@ func getIgmpSnoopPolTagTagChildPayloads(ctx context.Context, diags *diag.Diagnos } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagTag.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) + tagTagChildMapForDelete := NewAciObject() + tagTagChildMapForDelete.Attributes["status"] = "deleted" + tagTagChildMapForDelete.Attributes["key"] = tagTag.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagTag": tagTagChildMapForDelete}) } } } else { diff --git a/internal/provider/resource_aci_igmp_snooping_policy_test.go b/internal/provider/resource_aci_igmp_snooping_policy_test.go index 4b026cbfe..a699545bb 100644 --- a/internal/provider/resource_aci_igmp_snooping_policy_test.go +++ b/internal/provider/resource_aci_igmp_snooping_policy_test.go @@ -48,7 +48,7 @@ func TestAccResourceIgmpSnoopPolWithFvTenant(t *testing.T) { resource.TestCheckResourceAttr("aci_igmp_snooping_policy.allow_test_2", "start_query_count", "2"), resource.TestCheckResourceAttr("aci_igmp_snooping_policy.allow_test", "start_query_interval", "31"), resource.TestCheckResourceAttr("aci_igmp_snooping_policy.allow_test_2", "start_query_interval", "31"), - composeAggregateTestCheckFuncWithVersion(t, "5.1(1h)", ">", + composeAggregateTestCheckFuncWithVersion(t, "5.1(1h)", ">=", resource.TestCheckResourceAttr("aci_igmp_snooping_policy.allow_test", "querier_version", "v3"), resource.TestCheckResourceAttr("aci_igmp_snooping_policy.allow_test_2", "querier_version", "v3")), ), @@ -105,7 +105,7 @@ func TestAccResourceIgmpSnoopPolWithFvTenant(t *testing.T) { resource.TestCheckResourceAttr("aci_igmp_snooping_policy.allow_test_2", "start_query_count", "2"), resource.TestCheckResourceAttr("aci_igmp_snooping_policy.allow_test", "start_query_interval", "31"), resource.TestCheckResourceAttr("aci_igmp_snooping_policy.allow_test_2", "start_query_interval", "31"), - composeAggregateTestCheckFuncWithVersion(t, "5.1(1h)", ">", + composeAggregateTestCheckFuncWithVersion(t, "5.1(1h)", ">=", resource.TestCheckResourceAttr("aci_igmp_snooping_policy.allow_test", "querier_version", "v3"), resource.TestCheckResourceAttr("aci_igmp_snooping_policy.allow_test_2", "querier_version", "v3")), ), @@ -135,7 +135,7 @@ func TestAccResourceIgmpSnoopPolWithFvTenant(t *testing.T) { resource.TestCheckResourceAttr("aci_igmp_snooping_policy.test", "response_interval", "10"), resource.TestCheckResourceAttr("aci_igmp_snooping_policy.test", "start_query_count", "2"), resource.TestCheckResourceAttr("aci_igmp_snooping_policy.test", "start_query_interval", "31"), - composeAggregateTestCheckFuncWithVersion(t, "5.1(1h)", ">", + composeAggregateTestCheckFuncWithVersion(t, "5.1(1h)", ">=", resource.TestCheckResourceAttr("aci_igmp_snooping_policy.test", "querier_version", "v3")), ), }, @@ -159,7 +159,7 @@ func TestAccResourceIgmpSnoopPolWithFvTenant(t *testing.T) { resource.TestCheckResourceAttr("aci_igmp_snooping_policy.test", "response_interval", "11"), resource.TestCheckResourceAttr("aci_igmp_snooping_policy.test", "start_query_count", "9"), resource.TestCheckResourceAttr("aci_igmp_snooping_policy.test", "start_query_interval", "2"), - composeAggregateTestCheckFuncWithVersion(t, "5.1(1h)", ">", + composeAggregateTestCheckFuncWithVersion(t, "5.1(1h)", ">=", resource.TestCheckResourceAttr("aci_igmp_snooping_policy.test", "querier_version", "v2")), ), }, @@ -189,7 +189,7 @@ func TestAccResourceIgmpSnoopPolWithFvTenant(t *testing.T) { resource.TestCheckResourceAttr("aci_igmp_snooping_policy.test", "response_interval", "10"), resource.TestCheckResourceAttr("aci_igmp_snooping_policy.test", "start_query_count", "2"), resource.TestCheckResourceAttr("aci_igmp_snooping_policy.test", "start_query_interval", "31"), - composeAggregateTestCheckFuncWithVersion(t, "5.1(1h)", ">", + composeAggregateTestCheckFuncWithVersion(t, "5.1(1h)", ">=", resource.TestCheckResourceAttr("aci_igmp_snooping_policy.test", "querier_version", "v3")), ), }, @@ -217,7 +217,7 @@ func TestAccResourceIgmpSnoopPolWithFvTenant(t *testing.T) { resource.TestCheckResourceAttr("aci_igmp_snooping_policy.test", "response_interval", "10"), resource.TestCheckResourceAttr("aci_igmp_snooping_policy.test", "start_query_count", "2"), resource.TestCheckResourceAttr("aci_igmp_snooping_policy.test", "start_query_interval", "31"), - composeAggregateTestCheckFuncWithVersion(t, "5.1(1h)", ">", + composeAggregateTestCheckFuncWithVersion(t, "5.1(1h)", ">=", resource.TestCheckResourceAttr("aci_igmp_snooping_policy.test", "querier_version", "v3")), resource.TestCheckResourceAttr("aci_igmp_snooping_policy.test", "annotations.0.key", "key_0"), resource.TestCheckResourceAttr("aci_igmp_snooping_policy.test", "annotations.0.value", "value_1"), @@ -347,24 +347,24 @@ resource "aci_igmp_snooping_policy" "test" { parent_dn = aci_tenant.test.id name = "test_name" annotations = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] tags = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] } ` diff --git a/internal/provider/resource_aci_key_ring.go b/internal/provider/resource_aci_key_ring.go index e74fc7aa0..355020b09 100644 --- a/internal/provider/resource_aci_key_ring.go +++ b/internal/provider/resource_aci_key_ring.go @@ -109,6 +109,13 @@ func getEmptyTagAnnotationPkiKeyRingResourceModel() TagAnnotationPkiKeyRingResou } } +var TagAnnotationPkiKeyRingType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // TagTagPkiKeyRingResourceModel describes the resource data model for the children without relation ships. type TagTagPkiKeyRingResourceModel struct { Key types.String `tfsdk:"key"` @@ -122,6 +129,13 @@ func getEmptyTagTagPkiKeyRingResourceModel() TagTagPkiKeyRingResourceModel { } } +var TagTagPkiKeyRingType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + type PkiKeyRingIdentifier struct { Name types.String } @@ -581,7 +595,7 @@ func (r *PkiKeyRingResource) ImportState(ctx context.Context, req resource.Impor } func getAndSetPkiKeyRingAttributes(ctx context.Context, diags *diag.Diagnostics, client *client.Client, data *PkiKeyRingResourceModel) { - requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=children&rsp-subtree-class=%s", data.Id.ValueString(), "pkiKeyRing,tagAnnotation,tagTag"), "GET", nil) + requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=full&rsp-subtree-class=%s", data.Id.ValueString(), "pkiKeyRing,tagAnnotation,tagTag"), "GET", nil) readData := getEmptyPkiKeyRingResourceModel() @@ -660,6 +674,7 @@ func getAndSetPkiKeyRingAttributes(ctx context.Context, diags *diag.Diagnostics, if childAttributeName == "value" { TagAnnotationPkiKeyRing.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagAnnotationPkiKeyRingList = append(TagAnnotationPkiKeyRingList, TagAnnotationPkiKeyRing) } @@ -672,6 +687,7 @@ func getAndSetPkiKeyRingAttributes(ctx context.Context, diags *diag.Diagnostics, if childAttributeName == "value" { TagTagPkiKeyRing.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagTagPkiKeyRingList = append(TagTagPkiKeyRingList, TagTagPkiKeyRing) } @@ -740,25 +756,24 @@ func setPkiKeyRingId(ctx context.Context, data *PkiKeyRingResourceModel) { data.Id = types.StringValue(id) } -func getPkiKeyRingTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *PkiKeyRingResourceModel, tagAnnotationPlan, tagAnnotationState []TagAnnotationPkiKeyRingResourceModel) []map[string]interface{} { - +func getPkiKeyRingTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *PkiKeyRingResourceModel, tagAnnotationPkiKeyRingPlan, tagAnnotationPkiKeyRingState []TagAnnotationPkiKeyRingResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagAnnotation.IsUnknown() { + if !data.TagAnnotation.IsNull() && !data.TagAnnotation.IsUnknown() { tagAnnotationIdentifiers := []TagAnnotationIdentifier{} - for _, tagAnnotation := range tagAnnotationPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagAnnotation.Key.IsUnknown() && !tagAnnotation.Key.IsNull() { - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() + for _, tagAnnotationPkiKeyRing := range tagAnnotationPkiKeyRingPlan { + childMap := NewAciObject() + if !tagAnnotationPkiKeyRing.Key.IsNull() && !tagAnnotationPkiKeyRing.Key.IsUnknown() { + childMap.Attributes["key"] = tagAnnotationPkiKeyRing.Key.ValueString() } - if !tagAnnotation.Value.IsUnknown() && !tagAnnotation.Value.IsNull() { - childMap["attributes"]["value"] = tagAnnotation.Value.ValueString() + if !tagAnnotationPkiKeyRing.Value.IsNull() && !tagAnnotationPkiKeyRing.Value.IsUnknown() { + childMap.Attributes["value"] = tagAnnotationPkiKeyRing.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) tagAnnotationIdentifier := TagAnnotationIdentifier{} - tagAnnotationIdentifier.Key = tagAnnotation.Key + tagAnnotationIdentifier.Key = tagAnnotationPkiKeyRing.Key tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) } - for _, tagAnnotation := range tagAnnotationState { + for _, tagAnnotation := range tagAnnotationPkiKeyRingState { delete := true for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { if tagAnnotationIdentifier.Key == tagAnnotation.Key { @@ -767,10 +782,10 @@ func getPkiKeyRingTagAnnotationChildPayloads(ctx context.Context, diags *diag.Di } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) + tagAnnotationChildMapForDelete := NewAciObject() + tagAnnotationChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationChildMapForDelete.Attributes["key"] = tagAnnotation.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": tagAnnotationChildMapForDelete}) } } } else { @@ -779,25 +794,25 @@ func getPkiKeyRingTagAnnotationChildPayloads(ctx context.Context, diags *diag.Di return childPayloads } -func getPkiKeyRingTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *PkiKeyRingResourceModel, tagTagPlan, tagTagState []TagTagPkiKeyRingResourceModel) []map[string]interface{} { +func getPkiKeyRingTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *PkiKeyRingResourceModel, tagTagPkiKeyRingPlan, tagTagPkiKeyRingState []TagTagPkiKeyRingResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagTag.IsUnknown() { + if !data.TagTag.IsNull() && !data.TagTag.IsUnknown() { tagTagIdentifiers := []TagTagIdentifier{} - for _, tagTag := range tagTagPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagTag.Key.IsUnknown() && !tagTag.Key.IsNull() { - childMap["attributes"]["key"] = tagTag.Key.ValueString() + for _, tagTagPkiKeyRing := range tagTagPkiKeyRingPlan { + childMap := NewAciObject() + if !tagTagPkiKeyRing.Key.IsNull() && !tagTagPkiKeyRing.Key.IsUnknown() { + childMap.Attributes["key"] = tagTagPkiKeyRing.Key.ValueString() } - if !tagTag.Value.IsUnknown() && !tagTag.Value.IsNull() { - childMap["attributes"]["value"] = tagTag.Value.ValueString() + if !tagTagPkiKeyRing.Value.IsNull() && !tagTagPkiKeyRing.Value.IsUnknown() { + childMap.Attributes["value"] = tagTagPkiKeyRing.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) tagTagIdentifier := TagTagIdentifier{} - tagTagIdentifier.Key = tagTag.Key + tagTagIdentifier.Key = tagTagPkiKeyRing.Key tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) } - for _, tagTag := range tagTagState { + for _, tagTag := range tagTagPkiKeyRingState { delete := true for _, tagTagIdentifier := range tagTagIdentifiers { if tagTagIdentifier.Key == tagTag.Key { @@ -806,10 +821,10 @@ func getPkiKeyRingTagTagChildPayloads(ctx context.Context, diags *diag.Diagnosti } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagTag.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) + tagTagChildMapForDelete := NewAciObject() + tagTagChildMapForDelete.Attributes["status"] = "deleted" + tagTagChildMapForDelete.Attributes["key"] = tagTag.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagTag": tagTagChildMapForDelete}) } } } else { diff --git a/internal/provider/resource_aci_key_ring_test.go b/internal/provider/resource_aci_key_ring_test.go index 774f5d6f7..cc950ef93 100644 --- a/internal/provider/resource_aci_key_ring_test.go +++ b/internal/provider/resource_aci_key_ring_test.go @@ -44,7 +44,7 @@ func TestAccResourcePkiKeyRing(t *testing.T) { resource.TestCheckResourceAttr("aci_key_ring.allow_test_2", "owner_tag", ""), resource.TestCheckResourceAttr("aci_key_ring.allow_test", "regenerate", "no"), resource.TestCheckResourceAttr("aci_key_ring.allow_test_2", "regenerate", "no"), - composeAggregateTestCheckFuncWithVersion(t, "6.0(2h)", ">", + composeAggregateTestCheckFuncWithVersion(t, "6.0(2h)", ">=", resource.TestCheckResourceAttr("aci_key_ring.allow_test", "elliptic_curve", "none"), resource.TestCheckResourceAttr("aci_key_ring.allow_test_2", "elliptic_curve", "none"), resource.TestCheckResourceAttr("aci_key_ring.allow_test", "key_type", "RSA"), @@ -99,7 +99,7 @@ func TestAccResourcePkiKeyRing(t *testing.T) { resource.TestCheckResourceAttr("aci_key_ring.allow_test_2", "owner_tag", ""), resource.TestCheckResourceAttr("aci_key_ring.allow_test", "regenerate", "no"), resource.TestCheckResourceAttr("aci_key_ring.allow_test_2", "regenerate", "no"), - composeAggregateTestCheckFuncWithVersion(t, "6.0(2h)", ">", + composeAggregateTestCheckFuncWithVersion(t, "6.0(2h)", ">=", resource.TestCheckResourceAttr("aci_key_ring.allow_test", "elliptic_curve", "none"), resource.TestCheckResourceAttr("aci_key_ring.allow_test_2", "elliptic_curve", "none"), resource.TestCheckResourceAttr("aci_key_ring.allow_test", "key_type", "RSA"), @@ -129,7 +129,7 @@ func TestAccResourcePkiKeyRing(t *testing.T) { resource.TestCheckResourceAttr("aci_key_ring.test", "owner_key", ""), resource.TestCheckResourceAttr("aci_key_ring.test", "owner_tag", ""), resource.TestCheckResourceAttr("aci_key_ring.test", "regenerate", "no"), - composeAggregateTestCheckFuncWithVersion(t, "6.0(2h)", ">", + composeAggregateTestCheckFuncWithVersion(t, "6.0(2h)", ">=", resource.TestCheckResourceAttr("aci_key_ring.test", "elliptic_curve", "none"), resource.TestCheckResourceAttr("aci_key_ring.test", "key_type", "RSA")), ), @@ -150,7 +150,7 @@ func TestAccResourcePkiKeyRing(t *testing.T) { resource.TestCheckResourceAttr("aci_key_ring.test", "owner_key", "owner_key_1"), resource.TestCheckResourceAttr("aci_key_ring.test", "owner_tag", "owner_tag_1"), resource.TestCheckResourceAttr("aci_key_ring.test", "regenerate", "no"), - composeAggregateTestCheckFuncWithVersion(t, "6.0(2h)", ">", + composeAggregateTestCheckFuncWithVersion(t, "6.0(2h)", ">=", resource.TestCheckResourceAttr("aci_key_ring.test", "elliptic_curve", "none"), resource.TestCheckResourceAttr("aci_key_ring.test", "key_type", "RSA")), ), @@ -179,7 +179,7 @@ func TestAccResourcePkiKeyRing(t *testing.T) { resource.TestCheckResourceAttr("aci_key_ring.test", "owner_key", ""), resource.TestCheckResourceAttr("aci_key_ring.test", "owner_tag", ""), resource.TestCheckResourceAttr("aci_key_ring.test", "regenerate", "no"), - composeAggregateTestCheckFuncWithVersion(t, "6.0(2h)", ">", + composeAggregateTestCheckFuncWithVersion(t, "6.0(2h)", ">=", resource.TestCheckResourceAttr("aci_key_ring.test", "elliptic_curve", "none"), resource.TestCheckResourceAttr("aci_key_ring.test", "key_type", "RSA")), ), @@ -207,7 +207,7 @@ func TestAccResourcePkiKeyRing(t *testing.T) { resource.TestCheckResourceAttr("aci_key_ring.test", "owner_key", ""), resource.TestCheckResourceAttr("aci_key_ring.test", "owner_tag", ""), resource.TestCheckResourceAttr("aci_key_ring.test", "regenerate", "no"), - composeAggregateTestCheckFuncWithVersion(t, "6.0(2h)", ">", + composeAggregateTestCheckFuncWithVersion(t, "6.0(2h)", ">=", resource.TestCheckResourceAttr("aci_key_ring.test", "elliptic_curve", "none"), resource.TestCheckResourceAttr("aci_key_ring.test", "key_type", "RSA")), resource.TestCheckResourceAttr("aci_key_ring.test", "annotations.0.key", "key_0"), @@ -308,7 +308,7 @@ func TestAccResourcePkiKeyRingWithFvTenant(t *testing.T) { resource.TestCheckResourceAttr("aci_key_ring.allow_test_2", "owner_tag", ""), resource.TestCheckResourceAttr("aci_key_ring.allow_test", "regenerate", "no"), resource.TestCheckResourceAttr("aci_key_ring.allow_test_2", "regenerate", "no"), - composeAggregateTestCheckFuncWithVersion(t, "6.0(2h)", ">", + composeAggregateTestCheckFuncWithVersion(t, "6.0(2h)", ">=", resource.TestCheckResourceAttr("aci_key_ring.allow_test", "elliptic_curve", "none"), resource.TestCheckResourceAttr("aci_key_ring.allow_test_2", "elliptic_curve", "none"), resource.TestCheckResourceAttr("aci_key_ring.allow_test", "key_type", "RSA"), @@ -363,7 +363,7 @@ func TestAccResourcePkiKeyRingWithFvTenant(t *testing.T) { resource.TestCheckResourceAttr("aci_key_ring.allow_test_2", "owner_tag", ""), resource.TestCheckResourceAttr("aci_key_ring.allow_test", "regenerate", "no"), resource.TestCheckResourceAttr("aci_key_ring.allow_test_2", "regenerate", "no"), - composeAggregateTestCheckFuncWithVersion(t, "6.0(2h)", ">", + composeAggregateTestCheckFuncWithVersion(t, "6.0(2h)", ">=", resource.TestCheckResourceAttr("aci_key_ring.allow_test", "elliptic_curve", "none"), resource.TestCheckResourceAttr("aci_key_ring.allow_test_2", "elliptic_curve", "none"), resource.TestCheckResourceAttr("aci_key_ring.allow_test", "key_type", "RSA"), @@ -393,7 +393,7 @@ func TestAccResourcePkiKeyRingWithFvTenant(t *testing.T) { resource.TestCheckResourceAttr("aci_key_ring.test", "owner_key", ""), resource.TestCheckResourceAttr("aci_key_ring.test", "owner_tag", ""), resource.TestCheckResourceAttr("aci_key_ring.test", "regenerate", "no"), - composeAggregateTestCheckFuncWithVersion(t, "6.0(2h)", ">", + composeAggregateTestCheckFuncWithVersion(t, "6.0(2h)", ">=", resource.TestCheckResourceAttr("aci_key_ring.test", "elliptic_curve", "none"), resource.TestCheckResourceAttr("aci_key_ring.test", "key_type", "RSA")), ), @@ -414,7 +414,7 @@ func TestAccResourcePkiKeyRingWithFvTenant(t *testing.T) { resource.TestCheckResourceAttr("aci_key_ring.test", "owner_key", "owner_key_1"), resource.TestCheckResourceAttr("aci_key_ring.test", "owner_tag", "owner_tag_1"), resource.TestCheckResourceAttr("aci_key_ring.test", "regenerate", "no"), - composeAggregateTestCheckFuncWithVersion(t, "6.0(2h)", ">", + composeAggregateTestCheckFuncWithVersion(t, "6.0(2h)", ">=", resource.TestCheckResourceAttr("aci_key_ring.test", "elliptic_curve", "none"), resource.TestCheckResourceAttr("aci_key_ring.test", "key_type", "RSA")), ), @@ -443,7 +443,7 @@ func TestAccResourcePkiKeyRingWithFvTenant(t *testing.T) { resource.TestCheckResourceAttr("aci_key_ring.test", "owner_key", ""), resource.TestCheckResourceAttr("aci_key_ring.test", "owner_tag", ""), resource.TestCheckResourceAttr("aci_key_ring.test", "regenerate", "no"), - composeAggregateTestCheckFuncWithVersion(t, "6.0(2h)", ">", + composeAggregateTestCheckFuncWithVersion(t, "6.0(2h)", ">=", resource.TestCheckResourceAttr("aci_key_ring.test", "elliptic_curve", "none"), resource.TestCheckResourceAttr("aci_key_ring.test", "key_type", "RSA")), ), @@ -471,7 +471,7 @@ func TestAccResourcePkiKeyRingWithFvTenant(t *testing.T) { resource.TestCheckResourceAttr("aci_key_ring.test", "owner_key", ""), resource.TestCheckResourceAttr("aci_key_ring.test", "owner_tag", ""), resource.TestCheckResourceAttr("aci_key_ring.test", "regenerate", "no"), - composeAggregateTestCheckFuncWithVersion(t, "6.0(2h)", ">", + composeAggregateTestCheckFuncWithVersion(t, "6.0(2h)", ">=", resource.TestCheckResourceAttr("aci_key_ring.test", "elliptic_curve", "none"), resource.TestCheckResourceAttr("aci_key_ring.test", "key_type", "RSA")), resource.TestCheckResourceAttr("aci_key_ring.test", "annotations.0.key", "key_0"), @@ -604,24 +604,24 @@ const testConfigPkiKeyRingChildren = testDependencyConfigPkiKeyRing + ` resource "aci_key_ring" "test" { name = "test_name" annotations = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] tags = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] } ` @@ -721,24 +721,24 @@ resource "aci_key_ring" "test" { parent_dn = aci_tenant.test.id name = "test_name" annotations = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] tags = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] } ` diff --git a/internal/provider/resource_aci_l3out_consumer_label.go b/internal/provider/resource_aci_l3out_consumer_label.go index 7d102c121..1a27f1738 100644 --- a/internal/provider/resource_aci_l3out_consumer_label.go +++ b/internal/provider/resource_aci_l3out_consumer_label.go @@ -72,15 +72,19 @@ func getEmptyL3extConsLblResourceModel() *L3extConsLblResourceModel { Tag: basetypes.NewStringNull(), L3extRsLblToInstP: types.SetNull(types.ObjectType{ AttrTypes: map[string]attr.Type{ - "annotation": types.StringType, - "target_dn": types.StringType, + "annotation": types.StringType, + "target_dn": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationL3extRsLblToInstPL3extConsLblType}, + "tags": types.SetType{ElemType: TagTagL3extRsLblToInstPL3extConsLblType}, }, }), L3extRsLblToProfile: types.SetNull(types.ObjectType{ AttrTypes: map[string]attr.Type{ - "annotation": types.StringType, - "direction": types.StringType, - "target_dn": types.StringType, + "annotation": types.StringType, + "direction": types.StringType, + "target_dn": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationL3extRsLblToProfileL3extConsLblType}, + "tags": types.SetType{ElemType: TagTagL3extRsLblToProfileL3extConsLblType}, }, }), TagAnnotation: types.SetNull(types.ObjectType{ @@ -100,22 +104,87 @@ func getEmptyL3extConsLblResourceModel() *L3extConsLblResourceModel { // L3extRsLblToInstPL3extConsLblResourceModel describes the resource data model for the children without relation ships. type L3extRsLblToInstPL3extConsLblResourceModel struct { - Annotation types.String `tfsdk:"annotation"` - TDn types.String `tfsdk:"target_dn"` + Annotation types.String `tfsdk:"annotation"` + TDn types.String `tfsdk:"target_dn"` + TagAnnotation types.Set `tfsdk:"annotations"` + TagTag types.Set `tfsdk:"tags"` } func getEmptyL3extRsLblToInstPL3extConsLblResourceModel() L3extRsLblToInstPL3extConsLblResourceModel { return L3extRsLblToInstPL3extConsLblResourceModel{ Annotation: basetypes.NewStringNull(), TDn: basetypes.NewStringNull(), + TagAnnotation: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), } } +var L3extRsLblToInstPL3extConsLblType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "annotation": types.StringType, + "target_dn": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationL3extRsLblToInstPL3extConsLblType}, + "tags": types.SetType{ElemType: TagTagL3extRsLblToInstPL3extConsLblType}, + }, +} + +// TagAnnotationL3extRsLblToInstPL3extConsLblResourceModel describes the resource data model for the children without relation ships. +type TagAnnotationL3extRsLblToInstPL3extConsLblResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagAnnotationL3extRsLblToInstPL3extConsLblResourceModel() TagAnnotationL3extRsLblToInstPL3extConsLblResourceModel { + return TagAnnotationL3extRsLblToInstPL3extConsLblResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagAnnotationL3extRsLblToInstPL3extConsLblType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + +// TagTagL3extRsLblToInstPL3extConsLblResourceModel describes the resource data model for the children without relation ships. +type TagTagL3extRsLblToInstPL3extConsLblResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagTagL3extRsLblToInstPL3extConsLblResourceModel() TagTagL3extRsLblToInstPL3extConsLblResourceModel { + return TagTagL3extRsLblToInstPL3extConsLblResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagTagL3extRsLblToInstPL3extConsLblType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // L3extRsLblToProfileL3extConsLblResourceModel describes the resource data model for the children without relation ships. type L3extRsLblToProfileL3extConsLblResourceModel struct { - Annotation types.String `tfsdk:"annotation"` - Direction types.String `tfsdk:"direction"` - TDn types.String `tfsdk:"target_dn"` + Annotation types.String `tfsdk:"annotation"` + Direction types.String `tfsdk:"direction"` + TDn types.String `tfsdk:"target_dn"` + TagAnnotation types.Set `tfsdk:"annotations"` + TagTag types.Set `tfsdk:"tags"` } func getEmptyL3extRsLblToProfileL3extConsLblResourceModel() L3extRsLblToProfileL3extConsLblResourceModel { @@ -123,9 +192,71 @@ func getEmptyL3extRsLblToProfileL3extConsLblResourceModel() L3extRsLblToProfileL Annotation: basetypes.NewStringNull(), Direction: basetypes.NewStringNull(), TDn: basetypes.NewStringNull(), + TagAnnotation: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + } +} + +var L3extRsLblToProfileL3extConsLblType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "annotation": types.StringType, + "direction": types.StringType, + "target_dn": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationL3extRsLblToProfileL3extConsLblType}, + "tags": types.SetType{ElemType: TagTagL3extRsLblToProfileL3extConsLblType}, + }, +} + +// TagAnnotationL3extRsLblToProfileL3extConsLblResourceModel describes the resource data model for the children without relation ships. +type TagAnnotationL3extRsLblToProfileL3extConsLblResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagAnnotationL3extRsLblToProfileL3extConsLblResourceModel() TagAnnotationL3extRsLblToProfileL3extConsLblResourceModel { + return TagAnnotationL3extRsLblToProfileL3extConsLblResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), } } +var TagAnnotationL3extRsLblToProfileL3extConsLblType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + +// TagTagL3extRsLblToProfileL3extConsLblResourceModel describes the resource data model for the children without relation ships. +type TagTagL3extRsLblToProfileL3extConsLblResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagTagL3extRsLblToProfileL3extConsLblResourceModel() TagTagL3extRsLblToProfileL3extConsLblResourceModel { + return TagTagL3extRsLblToProfileL3extConsLblResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagTagL3extRsLblToProfileL3extConsLblType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // TagAnnotationL3extConsLblResourceModel describes the resource data model for the children without relation ships. type TagAnnotationL3extConsLblResourceModel struct { Key types.String `tfsdk:"key"` @@ -139,6 +270,13 @@ func getEmptyTagAnnotationL3extConsLblResourceModel() TagAnnotationL3extConsLblR } } +var TagAnnotationL3extConsLblType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // TagTagL3extConsLblResourceModel describes the resource data model for the children without relation ships. type TagTagL3extConsLblResourceModel struct { Key types.String `tfsdk:"key"` @@ -152,6 +290,13 @@ func getEmptyTagTagL3extConsLblResourceModel() TagTagL3extConsLblResourceModel { } } +var TagTagL3extConsLblType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + type L3extConsLblIdentifier struct { Name types.String } @@ -312,6 +457,58 @@ func (r *L3extConsLblResource) Schema(ctx context.Context, req resource.SchemaRe }, MarkdownDescription: `The distinguished name (DN) of the External EPG object.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, }, @@ -350,6 +547,58 @@ func (r *L3extConsLblResource) Schema(ctx context.Context, req resource.SchemaRe }, MarkdownDescription: `The distinguished name (DN) of the Route Control Profile object.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, }, @@ -602,7 +851,7 @@ func (r *L3extConsLblResource) ImportState(ctx context.Context, req resource.Imp } func getAndSetL3extConsLblAttributes(ctx context.Context, diags *diag.Diagnostics, client *client.Client, data *L3extConsLblResourceModel) { - requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=children&rsp-subtree-class=%s", data.Id.ValueString(), "l3extConsLbl,l3extRsLblToInstP,l3extRsLblToProfile,tagAnnotation,tagTag"), "GET", nil) + requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=full&rsp-subtree-class=%s", data.Id.ValueString(), "l3extConsLbl,l3extRsLblToInstP,l3extRsLblToProfile,tagAnnotation,tagTag,tagAnnotation,tagTag,tagAnnotation,tagTag"), "GET", nil) readData := getEmptyL3extConsLblResourceModel() @@ -662,7 +911,47 @@ func getAndSetL3extConsLblAttributes(ctx context.Context, diags *diag.Diagnostic if childAttributeName == "tDn" { L3extRsLblToInstPL3extConsLbl.TDn = basetypes.NewStringValue(childAttributeValue.(string)) } + + } + TagAnnotationL3extRsLblToInstPL3extConsLblList := make([]TagAnnotationL3extRsLblToInstPL3extConsLblResourceModel, 0) + TagTagL3extRsLblToInstPL3extConsLblList := make([]TagTagL3extRsLblToInstPL3extConsLblResourceModel, 0) + childrenOfL3extRsLblToInstPL3extConsLbl, childrenOfL3extRsLblToInstPL3extConsLblExist := childClassDetails.(map[string]interface{})["children"] + if childrenOfL3extRsLblToInstPL3extConsLblExist { + for _, childL3extRsLblToInstPL3extConsLbl := range childrenOfL3extRsLblToInstPL3extConsLbl.([]interface{}) { + for childClassNameL3extRsLblToInstPL3extConsLbl, childClassDetailsL3extRsLblToInstPL3extConsLbl := range childL3extRsLblToInstPL3extConsLbl.(map[string]interface{}) { + if childClassNameL3extRsLblToInstPL3extConsLbl == "tagAnnotation" { + TagAnnotationL3extRsLblToInstPL3extConsLbl := getEmptyTagAnnotationL3extRsLblToInstPL3extConsLblResourceModel() + tagAnnotationchildAttributeValue := childClassDetailsL3extRsLblToInstPL3extConsLbl.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagAnnotationchildAttributeValue { + if childAttributeName == "key" { + TagAnnotationL3extRsLblToInstPL3extConsLbl.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagAnnotationL3extRsLblToInstPL3extConsLbl.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagAnnotationL3extRsLblToInstPL3extConsLblList = append(TagAnnotationL3extRsLblToInstPL3extConsLblList, TagAnnotationL3extRsLblToInstPL3extConsLbl) + } + if childClassNameL3extRsLblToInstPL3extConsLbl == "tagTag" { + TagTagL3extRsLblToInstPL3extConsLbl := getEmptyTagTagL3extRsLblToInstPL3extConsLblResourceModel() + tagTagchildAttributeValue := childClassDetailsL3extRsLblToInstPL3extConsLbl.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagTagchildAttributeValue { + if childAttributeName == "key" { + TagTagL3extRsLblToInstPL3extConsLbl.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagTagL3extRsLblToInstPL3extConsLbl.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagTagL3extRsLblToInstPL3extConsLblList = append(TagTagL3extRsLblToInstPL3extConsLblList, TagTagL3extRsLblToInstPL3extConsLbl) + } + } + } } + TagAnnotationL3extRsLblToInstPL3extConsLblSet, _ := types.SetValueFrom(ctx, TagAnnotationL3extRsLblToInstPL3extConsLblType, TagAnnotationL3extRsLblToInstPL3extConsLblList) + L3extRsLblToInstPL3extConsLbl.TagAnnotation = TagAnnotationL3extRsLblToInstPL3extConsLblSet + TagTagL3extRsLblToInstPL3extConsLblSet, _ := types.SetValueFrom(ctx, TagTagL3extRsLblToInstPL3extConsLblType, TagTagL3extRsLblToInstPL3extConsLblList) + L3extRsLblToInstPL3extConsLbl.TagTag = TagTagL3extRsLblToInstPL3extConsLblSet L3extRsLblToInstPL3extConsLblList = append(L3extRsLblToInstPL3extConsLblList, L3extRsLblToInstPL3extConsLbl) } if childClassName == "l3extRsLblToProfile" { @@ -677,7 +966,47 @@ func getAndSetL3extConsLblAttributes(ctx context.Context, diags *diag.Diagnostic if childAttributeName == "tDn" { L3extRsLblToProfileL3extConsLbl.TDn = basetypes.NewStringValue(childAttributeValue.(string)) } + + } + TagAnnotationL3extRsLblToProfileL3extConsLblList := make([]TagAnnotationL3extRsLblToProfileL3extConsLblResourceModel, 0) + TagTagL3extRsLblToProfileL3extConsLblList := make([]TagTagL3extRsLblToProfileL3extConsLblResourceModel, 0) + childrenOfL3extRsLblToProfileL3extConsLbl, childrenOfL3extRsLblToProfileL3extConsLblExist := childClassDetails.(map[string]interface{})["children"] + if childrenOfL3extRsLblToProfileL3extConsLblExist { + for _, childL3extRsLblToProfileL3extConsLbl := range childrenOfL3extRsLblToProfileL3extConsLbl.([]interface{}) { + for childClassNameL3extRsLblToProfileL3extConsLbl, childClassDetailsL3extRsLblToProfileL3extConsLbl := range childL3extRsLblToProfileL3extConsLbl.(map[string]interface{}) { + if childClassNameL3extRsLblToProfileL3extConsLbl == "tagAnnotation" { + TagAnnotationL3extRsLblToProfileL3extConsLbl := getEmptyTagAnnotationL3extRsLblToProfileL3extConsLblResourceModel() + tagAnnotationchildAttributeValue := childClassDetailsL3extRsLblToProfileL3extConsLbl.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagAnnotationchildAttributeValue { + if childAttributeName == "key" { + TagAnnotationL3extRsLblToProfileL3extConsLbl.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagAnnotationL3extRsLblToProfileL3extConsLbl.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagAnnotationL3extRsLblToProfileL3extConsLblList = append(TagAnnotationL3extRsLblToProfileL3extConsLblList, TagAnnotationL3extRsLblToProfileL3extConsLbl) + } + if childClassNameL3extRsLblToProfileL3extConsLbl == "tagTag" { + TagTagL3extRsLblToProfileL3extConsLbl := getEmptyTagTagL3extRsLblToProfileL3extConsLblResourceModel() + tagTagchildAttributeValue := childClassDetailsL3extRsLblToProfileL3extConsLbl.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagTagchildAttributeValue { + if childAttributeName == "key" { + TagTagL3extRsLblToProfileL3extConsLbl.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagTagL3extRsLblToProfileL3extConsLbl.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagTagL3extRsLblToProfileL3extConsLblList = append(TagTagL3extRsLblToProfileL3extConsLblList, TagTagL3extRsLblToProfileL3extConsLbl) + } + } + } } + TagAnnotationL3extRsLblToProfileL3extConsLblSet, _ := types.SetValueFrom(ctx, TagAnnotationL3extRsLblToProfileL3extConsLblType, TagAnnotationL3extRsLblToProfileL3extConsLblList) + L3extRsLblToProfileL3extConsLbl.TagAnnotation = TagAnnotationL3extRsLblToProfileL3extConsLblSet + TagTagL3extRsLblToProfileL3extConsLblSet, _ := types.SetValueFrom(ctx, TagTagL3extRsLblToProfileL3extConsLblType, TagTagL3extRsLblToProfileL3extConsLblList) + L3extRsLblToProfileL3extConsLbl.TagTag = TagTagL3extRsLblToProfileL3extConsLblSet L3extRsLblToProfileL3extConsLblList = append(L3extRsLblToProfileL3extConsLblList, L3extRsLblToProfileL3extConsLbl) } if childClassName == "tagAnnotation" { @@ -689,6 +1018,7 @@ func getAndSetL3extConsLblAttributes(ctx context.Context, diags *diag.Diagnostic if childAttributeName == "value" { TagAnnotationL3extConsLbl.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagAnnotationL3extConsLblList = append(TagAnnotationL3extConsLblList, TagAnnotationL3extConsLbl) } @@ -701,6 +1031,7 @@ func getAndSetL3extConsLblAttributes(ctx context.Context, diags *diag.Diagnostic if childAttributeName == "value" { TagTagL3extConsLbl.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagTagL3extConsLblList = append(TagTagL3extConsLblList, TagTagL3extConsLbl) } @@ -752,27 +1083,102 @@ func setL3extConsLblId(ctx context.Context, data *L3extConsLblResourceModel) { data.Id = types.StringValue(fmt.Sprintf("%s/%s", data.ParentDn.ValueString(), rn)) } -func getL3extConsLblL3extRsLblToInstPChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *L3extConsLblResourceModel, l3extRsLblToInstPPlan, l3extRsLblToInstPState []L3extRsLblToInstPL3extConsLblResourceModel) []map[string]interface{} { - +func getL3extConsLblL3extRsLblToInstPChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *L3extConsLblResourceModel, l3extRsLblToInstPL3extConsLblPlan, l3extRsLblToInstPL3extConsLblState []L3extRsLblToInstPL3extConsLblResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.L3extRsLblToInstP.IsUnknown() { + if !data.L3extRsLblToInstP.IsNull() && !data.L3extRsLblToInstP.IsUnknown() { l3extRsLblToInstPIdentifiers := []L3extRsLblToInstPIdentifier{} - for _, l3extRsLblToInstP := range l3extRsLblToInstPPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !l3extRsLblToInstP.Annotation.IsUnknown() && !l3extRsLblToInstP.Annotation.IsNull() { - childMap["attributes"]["annotation"] = l3extRsLblToInstP.Annotation.ValueString() + for _, l3extRsLblToInstPL3extConsLbl := range l3extRsLblToInstPL3extConsLblPlan { + L3extRsLblToInstPL3extConsLblChildren := make([]map[string]interface{}, 0) + childMap := NewAciObject() + if !l3extRsLblToInstPL3extConsLbl.Annotation.IsNull() && !l3extRsLblToInstPL3extConsLbl.Annotation.IsUnknown() { + childMap.Attributes["annotation"] = l3extRsLblToInstPL3extConsLbl.Annotation.ValueString() } else { - childMap["attributes"]["annotation"] = globalAnnotation + childMap.Attributes["annotation"] = globalAnnotation + } + if !l3extRsLblToInstPL3extConsLbl.TDn.IsNull() && !l3extRsLblToInstPL3extConsLbl.TDn.IsUnknown() { + childMap.Attributes["tDn"] = l3extRsLblToInstPL3extConsLbl.TDn.ValueString() + } + + var tagAnnotationL3extRsLblToInstPL3extConsLblPlan, tagAnnotationL3extRsLblToInstPL3extConsLblState []TagAnnotationL3extRsLblToInstPL3extConsLblResourceModel + l3extRsLblToInstPL3extConsLbl.TagAnnotation.ElementsAs(ctx, &tagAnnotationL3extRsLblToInstPL3extConsLblPlan, false) + for _, tagAnnotationL3extRsLblToInstPL3extConsLblstate := range l3extRsLblToInstPL3extConsLblState { + tagAnnotationL3extRsLblToInstPL3extConsLblstate.TagAnnotation.ElementsAs(ctx, &tagAnnotationL3extRsLblToInstPL3extConsLblState, false) + } + if !l3extRsLblToInstPL3extConsLbl.TagAnnotation.IsNull() && !l3extRsLblToInstPL3extConsLbl.TagAnnotation.IsUnknown() { + tagAnnotationIdentifiers := []TagAnnotationIdentifier{} + for _, tagAnnotationL3extRsLblToInstPL3extConsLbl := range tagAnnotationL3extRsLblToInstPL3extConsLblPlan { + tagAnnotationL3extRsLblToInstPL3extConsLblChildMap := NewAciObject() + if !tagAnnotationL3extRsLblToInstPL3extConsLbl.Key.IsNull() && !tagAnnotationL3extRsLblToInstPL3extConsLbl.Key.IsUnknown() { + tagAnnotationL3extRsLblToInstPL3extConsLblChildMap.Attributes["key"] = tagAnnotationL3extRsLblToInstPL3extConsLbl.Key.ValueString() + } + if !tagAnnotationL3extRsLblToInstPL3extConsLbl.Value.IsNull() && !tagAnnotationL3extRsLblToInstPL3extConsLbl.Value.IsUnknown() { + tagAnnotationL3extRsLblToInstPL3extConsLblChildMap.Attributes["value"] = tagAnnotationL3extRsLblToInstPL3extConsLbl.Value.ValueString() + } + L3extRsLblToInstPL3extConsLblChildren = append(L3extRsLblToInstPL3extConsLblChildren, map[string]interface{}{"tagAnnotation": tagAnnotationL3extRsLblToInstPL3extConsLblChildMap}) + tagAnnotationIdentifier := TagAnnotationIdentifier{} + tagAnnotationIdentifier.Key = tagAnnotationL3extRsLblToInstPL3extConsLbl.Key + tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) + } + for _, tagAnnotationL3extRsLblToInstPL3extConsLbl := range tagAnnotationL3extRsLblToInstPL3extConsLblState { + delete := true + for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { + if tagAnnotationIdentifier.Key == tagAnnotationL3extRsLblToInstPL3extConsLbl.Key { + delete = false + break + } + } + if delete { + tagAnnotationL3extRsLblToInstPL3extConsLblChildMapForDelete := NewAciObject() + tagAnnotationL3extRsLblToInstPL3extConsLblChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationL3extRsLblToInstPL3extConsLblChildMapForDelete.Attributes["key"] = tagAnnotationL3extRsLblToInstPL3extConsLbl.Key.ValueString() + L3extRsLblToInstPL3extConsLblChildren = append(L3extRsLblToInstPL3extConsLblChildren, map[string]interface{}{"tagAnnotation": tagAnnotationL3extRsLblToInstPL3extConsLblChildMapForDelete}) + } + } } - if !l3extRsLblToInstP.TDn.IsUnknown() && !l3extRsLblToInstP.TDn.IsNull() { - childMap["attributes"]["tDn"] = l3extRsLblToInstP.TDn.ValueString() + + var tagTagL3extRsLblToInstPL3extConsLblPlan, tagTagL3extRsLblToInstPL3extConsLblState []TagTagL3extRsLblToInstPL3extConsLblResourceModel + l3extRsLblToInstPL3extConsLbl.TagTag.ElementsAs(ctx, &tagTagL3extRsLblToInstPL3extConsLblPlan, false) + for _, tagTagL3extRsLblToInstPL3extConsLblstate := range l3extRsLblToInstPL3extConsLblState { + tagTagL3extRsLblToInstPL3extConsLblstate.TagTag.ElementsAs(ctx, &tagTagL3extRsLblToInstPL3extConsLblState, false) } + if !l3extRsLblToInstPL3extConsLbl.TagTag.IsNull() && !l3extRsLblToInstPL3extConsLbl.TagTag.IsUnknown() { + tagTagIdentifiers := []TagTagIdentifier{} + for _, tagTagL3extRsLblToInstPL3extConsLbl := range tagTagL3extRsLblToInstPL3extConsLblPlan { + tagTagL3extRsLblToInstPL3extConsLblChildMap := NewAciObject() + if !tagTagL3extRsLblToInstPL3extConsLbl.Key.IsNull() && !tagTagL3extRsLblToInstPL3extConsLbl.Key.IsUnknown() { + tagTagL3extRsLblToInstPL3extConsLblChildMap.Attributes["key"] = tagTagL3extRsLblToInstPL3extConsLbl.Key.ValueString() + } + if !tagTagL3extRsLblToInstPL3extConsLbl.Value.IsNull() && !tagTagL3extRsLblToInstPL3extConsLbl.Value.IsUnknown() { + tagTagL3extRsLblToInstPL3extConsLblChildMap.Attributes["value"] = tagTagL3extRsLblToInstPL3extConsLbl.Value.ValueString() + } + L3extRsLblToInstPL3extConsLblChildren = append(L3extRsLblToInstPL3extConsLblChildren, map[string]interface{}{"tagTag": tagTagL3extRsLblToInstPL3extConsLblChildMap}) + tagTagIdentifier := TagTagIdentifier{} + tagTagIdentifier.Key = tagTagL3extRsLblToInstPL3extConsLbl.Key + tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) + } + for _, tagTagL3extRsLblToInstPL3extConsLbl := range tagTagL3extRsLblToInstPL3extConsLblState { + delete := true + for _, tagTagIdentifier := range tagTagIdentifiers { + if tagTagIdentifier.Key == tagTagL3extRsLblToInstPL3extConsLbl.Key { + delete = false + break + } + } + if delete { + tagTagL3extRsLblToInstPL3extConsLblChildMapForDelete := NewAciObject() + tagTagL3extRsLblToInstPL3extConsLblChildMapForDelete.Attributes["status"] = "deleted" + tagTagL3extRsLblToInstPL3extConsLblChildMapForDelete.Attributes["key"] = tagTagL3extRsLblToInstPL3extConsLbl.Key.ValueString() + L3extRsLblToInstPL3extConsLblChildren = append(L3extRsLblToInstPL3extConsLblChildren, map[string]interface{}{"tagTag": tagTagL3extRsLblToInstPL3extConsLblChildMapForDelete}) + } + } + } + childMap.Children = L3extRsLblToInstPL3extConsLblChildren childPayloads = append(childPayloads, map[string]interface{}{"l3extRsLblToInstP": childMap}) l3extRsLblToInstPIdentifier := L3extRsLblToInstPIdentifier{} - l3extRsLblToInstPIdentifier.TDn = l3extRsLblToInstP.TDn + l3extRsLblToInstPIdentifier.TDn = l3extRsLblToInstPL3extConsLbl.TDn l3extRsLblToInstPIdentifiers = append(l3extRsLblToInstPIdentifiers, l3extRsLblToInstPIdentifier) } - for _, l3extRsLblToInstP := range l3extRsLblToInstPState { + for _, l3extRsLblToInstP := range l3extRsLblToInstPL3extConsLblState { delete := true for _, l3extRsLblToInstPIdentifier := range l3extRsLblToInstPIdentifiers { if l3extRsLblToInstPIdentifier.TDn == l3extRsLblToInstP.TDn { @@ -781,10 +1187,10 @@ func getL3extConsLblL3extRsLblToInstPChildPayloads(ctx context.Context, diags *d } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["tDn"] = l3extRsLblToInstP.TDn.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"l3extRsLblToInstP": childMap}) + l3extRsLblToInstPChildMapForDelete := NewAciObject() + l3extRsLblToInstPChildMapForDelete.Attributes["status"] = "deleted" + l3extRsLblToInstPChildMapForDelete.Attributes["tDn"] = l3extRsLblToInstP.TDn.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"l3extRsLblToInstP": l3extRsLblToInstPChildMapForDelete}) } } } else { @@ -793,31 +1199,107 @@ func getL3extConsLblL3extRsLblToInstPChildPayloads(ctx context.Context, diags *d return childPayloads } -func getL3extConsLblL3extRsLblToProfileChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *L3extConsLblResourceModel, l3extRsLblToProfilePlan, l3extRsLblToProfileState []L3extRsLblToProfileL3extConsLblResourceModel) []map[string]interface{} { +func getL3extConsLblL3extRsLblToProfileChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *L3extConsLblResourceModel, l3extRsLblToProfileL3extConsLblPlan, l3extRsLblToProfileL3extConsLblState []L3extRsLblToProfileL3extConsLblResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.L3extRsLblToProfile.IsUnknown() { + if !data.L3extRsLblToProfile.IsNull() && !data.L3extRsLblToProfile.IsUnknown() { l3extRsLblToProfileIdentifiers := []L3extRsLblToProfileIdentifier{} - for _, l3extRsLblToProfile := range l3extRsLblToProfilePlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !l3extRsLblToProfile.Annotation.IsUnknown() && !l3extRsLblToProfile.Annotation.IsNull() { - childMap["attributes"]["annotation"] = l3extRsLblToProfile.Annotation.ValueString() + for _, l3extRsLblToProfileL3extConsLbl := range l3extRsLblToProfileL3extConsLblPlan { + L3extRsLblToProfileL3extConsLblChildren := make([]map[string]interface{}, 0) + childMap := NewAciObject() + if !l3extRsLblToProfileL3extConsLbl.Annotation.IsNull() && !l3extRsLblToProfileL3extConsLbl.Annotation.IsUnknown() { + childMap.Attributes["annotation"] = l3extRsLblToProfileL3extConsLbl.Annotation.ValueString() } else { - childMap["attributes"]["annotation"] = globalAnnotation + childMap.Attributes["annotation"] = globalAnnotation + } + if !l3extRsLblToProfileL3extConsLbl.Direction.IsNull() && !l3extRsLblToProfileL3extConsLbl.Direction.IsUnknown() { + childMap.Attributes["direction"] = l3extRsLblToProfileL3extConsLbl.Direction.ValueString() + } + if !l3extRsLblToProfileL3extConsLbl.TDn.IsNull() && !l3extRsLblToProfileL3extConsLbl.TDn.IsUnknown() { + childMap.Attributes["tDn"] = l3extRsLblToProfileL3extConsLbl.TDn.ValueString() + } + + var tagAnnotationL3extRsLblToProfileL3extConsLblPlan, tagAnnotationL3extRsLblToProfileL3extConsLblState []TagAnnotationL3extRsLblToProfileL3extConsLblResourceModel + l3extRsLblToProfileL3extConsLbl.TagAnnotation.ElementsAs(ctx, &tagAnnotationL3extRsLblToProfileL3extConsLblPlan, false) + for _, tagAnnotationL3extRsLblToProfileL3extConsLblstate := range l3extRsLblToProfileL3extConsLblState { + tagAnnotationL3extRsLblToProfileL3extConsLblstate.TagAnnotation.ElementsAs(ctx, &tagAnnotationL3extRsLblToProfileL3extConsLblState, false) } - if !l3extRsLblToProfile.Direction.IsUnknown() && !l3extRsLblToProfile.Direction.IsNull() { - childMap["attributes"]["direction"] = l3extRsLblToProfile.Direction.ValueString() + if !l3extRsLblToProfileL3extConsLbl.TagAnnotation.IsNull() && !l3extRsLblToProfileL3extConsLbl.TagAnnotation.IsUnknown() { + tagAnnotationIdentifiers := []TagAnnotationIdentifier{} + for _, tagAnnotationL3extRsLblToProfileL3extConsLbl := range tagAnnotationL3extRsLblToProfileL3extConsLblPlan { + tagAnnotationL3extRsLblToProfileL3extConsLblChildMap := NewAciObject() + if !tagAnnotationL3extRsLblToProfileL3extConsLbl.Key.IsNull() && !tagAnnotationL3extRsLblToProfileL3extConsLbl.Key.IsUnknown() { + tagAnnotationL3extRsLblToProfileL3extConsLblChildMap.Attributes["key"] = tagAnnotationL3extRsLblToProfileL3extConsLbl.Key.ValueString() + } + if !tagAnnotationL3extRsLblToProfileL3extConsLbl.Value.IsNull() && !tagAnnotationL3extRsLblToProfileL3extConsLbl.Value.IsUnknown() { + tagAnnotationL3extRsLblToProfileL3extConsLblChildMap.Attributes["value"] = tagAnnotationL3extRsLblToProfileL3extConsLbl.Value.ValueString() + } + L3extRsLblToProfileL3extConsLblChildren = append(L3extRsLblToProfileL3extConsLblChildren, map[string]interface{}{"tagAnnotation": tagAnnotationL3extRsLblToProfileL3extConsLblChildMap}) + tagAnnotationIdentifier := TagAnnotationIdentifier{} + tagAnnotationIdentifier.Key = tagAnnotationL3extRsLblToProfileL3extConsLbl.Key + tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) + } + for _, tagAnnotationL3extRsLblToProfileL3extConsLbl := range tagAnnotationL3extRsLblToProfileL3extConsLblState { + delete := true + for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { + if tagAnnotationIdentifier.Key == tagAnnotationL3extRsLblToProfileL3extConsLbl.Key { + delete = false + break + } + } + if delete { + tagAnnotationL3extRsLblToProfileL3extConsLblChildMapForDelete := NewAciObject() + tagAnnotationL3extRsLblToProfileL3extConsLblChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationL3extRsLblToProfileL3extConsLblChildMapForDelete.Attributes["key"] = tagAnnotationL3extRsLblToProfileL3extConsLbl.Key.ValueString() + L3extRsLblToProfileL3extConsLblChildren = append(L3extRsLblToProfileL3extConsLblChildren, map[string]interface{}{"tagAnnotation": tagAnnotationL3extRsLblToProfileL3extConsLblChildMapForDelete}) + } + } } - if !l3extRsLblToProfile.TDn.IsUnknown() && !l3extRsLblToProfile.TDn.IsNull() { - childMap["attributes"]["tDn"] = l3extRsLblToProfile.TDn.ValueString() + + var tagTagL3extRsLblToProfileL3extConsLblPlan, tagTagL3extRsLblToProfileL3extConsLblState []TagTagL3extRsLblToProfileL3extConsLblResourceModel + l3extRsLblToProfileL3extConsLbl.TagTag.ElementsAs(ctx, &tagTagL3extRsLblToProfileL3extConsLblPlan, false) + for _, tagTagL3extRsLblToProfileL3extConsLblstate := range l3extRsLblToProfileL3extConsLblState { + tagTagL3extRsLblToProfileL3extConsLblstate.TagTag.ElementsAs(ctx, &tagTagL3extRsLblToProfileL3extConsLblState, false) + } + if !l3extRsLblToProfileL3extConsLbl.TagTag.IsNull() && !l3extRsLblToProfileL3extConsLbl.TagTag.IsUnknown() { + tagTagIdentifiers := []TagTagIdentifier{} + for _, tagTagL3extRsLblToProfileL3extConsLbl := range tagTagL3extRsLblToProfileL3extConsLblPlan { + tagTagL3extRsLblToProfileL3extConsLblChildMap := NewAciObject() + if !tagTagL3extRsLblToProfileL3extConsLbl.Key.IsNull() && !tagTagL3extRsLblToProfileL3extConsLbl.Key.IsUnknown() { + tagTagL3extRsLblToProfileL3extConsLblChildMap.Attributes["key"] = tagTagL3extRsLblToProfileL3extConsLbl.Key.ValueString() + } + if !tagTagL3extRsLblToProfileL3extConsLbl.Value.IsNull() && !tagTagL3extRsLblToProfileL3extConsLbl.Value.IsUnknown() { + tagTagL3extRsLblToProfileL3extConsLblChildMap.Attributes["value"] = tagTagL3extRsLblToProfileL3extConsLbl.Value.ValueString() + } + L3extRsLblToProfileL3extConsLblChildren = append(L3extRsLblToProfileL3extConsLblChildren, map[string]interface{}{"tagTag": tagTagL3extRsLblToProfileL3extConsLblChildMap}) + tagTagIdentifier := TagTagIdentifier{} + tagTagIdentifier.Key = tagTagL3extRsLblToProfileL3extConsLbl.Key + tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) + } + for _, tagTagL3extRsLblToProfileL3extConsLbl := range tagTagL3extRsLblToProfileL3extConsLblState { + delete := true + for _, tagTagIdentifier := range tagTagIdentifiers { + if tagTagIdentifier.Key == tagTagL3extRsLblToProfileL3extConsLbl.Key { + delete = false + break + } + } + if delete { + tagTagL3extRsLblToProfileL3extConsLblChildMapForDelete := NewAciObject() + tagTagL3extRsLblToProfileL3extConsLblChildMapForDelete.Attributes["status"] = "deleted" + tagTagL3extRsLblToProfileL3extConsLblChildMapForDelete.Attributes["key"] = tagTagL3extRsLblToProfileL3extConsLbl.Key.ValueString() + L3extRsLblToProfileL3extConsLblChildren = append(L3extRsLblToProfileL3extConsLblChildren, map[string]interface{}{"tagTag": tagTagL3extRsLblToProfileL3extConsLblChildMapForDelete}) + } + } } + childMap.Children = L3extRsLblToProfileL3extConsLblChildren childPayloads = append(childPayloads, map[string]interface{}{"l3extRsLblToProfile": childMap}) l3extRsLblToProfileIdentifier := L3extRsLblToProfileIdentifier{} - l3extRsLblToProfileIdentifier.Direction = l3extRsLblToProfile.Direction - l3extRsLblToProfileIdentifier.TDn = l3extRsLblToProfile.TDn + l3extRsLblToProfileIdentifier.Direction = l3extRsLblToProfileL3extConsLbl.Direction + l3extRsLblToProfileIdentifier.TDn = l3extRsLblToProfileL3extConsLbl.TDn l3extRsLblToProfileIdentifiers = append(l3extRsLblToProfileIdentifiers, l3extRsLblToProfileIdentifier) } - for _, l3extRsLblToProfile := range l3extRsLblToProfileState { + for _, l3extRsLblToProfile := range l3extRsLblToProfileL3extConsLblState { delete := true for _, l3extRsLblToProfileIdentifier := range l3extRsLblToProfileIdentifiers { if l3extRsLblToProfileIdentifier.Direction == l3extRsLblToProfile.Direction && @@ -827,11 +1309,11 @@ func getL3extConsLblL3extRsLblToProfileChildPayloads(ctx context.Context, diags } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["direction"] = l3extRsLblToProfile.Direction.ValueString() - childMap["attributes"]["tDn"] = l3extRsLblToProfile.TDn.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"l3extRsLblToProfile": childMap}) + l3extRsLblToProfileChildMapForDelete := NewAciObject() + l3extRsLblToProfileChildMapForDelete.Attributes["status"] = "deleted" + l3extRsLblToProfileChildMapForDelete.Attributes["direction"] = l3extRsLblToProfile.Direction.ValueString() + l3extRsLblToProfileChildMapForDelete.Attributes["tDn"] = l3extRsLblToProfile.TDn.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"l3extRsLblToProfile": l3extRsLblToProfileChildMapForDelete}) } } } else { @@ -840,25 +1322,25 @@ func getL3extConsLblL3extRsLblToProfileChildPayloads(ctx context.Context, diags return childPayloads } -func getL3extConsLblTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *L3extConsLblResourceModel, tagAnnotationPlan, tagAnnotationState []TagAnnotationL3extConsLblResourceModel) []map[string]interface{} { +func getL3extConsLblTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *L3extConsLblResourceModel, tagAnnotationL3extConsLblPlan, tagAnnotationL3extConsLblState []TagAnnotationL3extConsLblResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagAnnotation.IsUnknown() { + if !data.TagAnnotation.IsNull() && !data.TagAnnotation.IsUnknown() { tagAnnotationIdentifiers := []TagAnnotationIdentifier{} - for _, tagAnnotation := range tagAnnotationPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagAnnotation.Key.IsUnknown() && !tagAnnotation.Key.IsNull() { - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() + for _, tagAnnotationL3extConsLbl := range tagAnnotationL3extConsLblPlan { + childMap := NewAciObject() + if !tagAnnotationL3extConsLbl.Key.IsNull() && !tagAnnotationL3extConsLbl.Key.IsUnknown() { + childMap.Attributes["key"] = tagAnnotationL3extConsLbl.Key.ValueString() } - if !tagAnnotation.Value.IsUnknown() && !tagAnnotation.Value.IsNull() { - childMap["attributes"]["value"] = tagAnnotation.Value.ValueString() + if !tagAnnotationL3extConsLbl.Value.IsNull() && !tagAnnotationL3extConsLbl.Value.IsUnknown() { + childMap.Attributes["value"] = tagAnnotationL3extConsLbl.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) tagAnnotationIdentifier := TagAnnotationIdentifier{} - tagAnnotationIdentifier.Key = tagAnnotation.Key + tagAnnotationIdentifier.Key = tagAnnotationL3extConsLbl.Key tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) } - for _, tagAnnotation := range tagAnnotationState { + for _, tagAnnotation := range tagAnnotationL3extConsLblState { delete := true for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { if tagAnnotationIdentifier.Key == tagAnnotation.Key { @@ -867,10 +1349,10 @@ func getL3extConsLblTagAnnotationChildPayloads(ctx context.Context, diags *diag. } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) + tagAnnotationChildMapForDelete := NewAciObject() + tagAnnotationChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationChildMapForDelete.Attributes["key"] = tagAnnotation.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": tagAnnotationChildMapForDelete}) } } } else { @@ -879,25 +1361,25 @@ func getL3extConsLblTagAnnotationChildPayloads(ctx context.Context, diags *diag. return childPayloads } -func getL3extConsLblTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *L3extConsLblResourceModel, tagTagPlan, tagTagState []TagTagL3extConsLblResourceModel) []map[string]interface{} { +func getL3extConsLblTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *L3extConsLblResourceModel, tagTagL3extConsLblPlan, tagTagL3extConsLblState []TagTagL3extConsLblResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagTag.IsUnknown() { + if !data.TagTag.IsNull() && !data.TagTag.IsUnknown() { tagTagIdentifiers := []TagTagIdentifier{} - for _, tagTag := range tagTagPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagTag.Key.IsUnknown() && !tagTag.Key.IsNull() { - childMap["attributes"]["key"] = tagTag.Key.ValueString() + for _, tagTagL3extConsLbl := range tagTagL3extConsLblPlan { + childMap := NewAciObject() + if !tagTagL3extConsLbl.Key.IsNull() && !tagTagL3extConsLbl.Key.IsUnknown() { + childMap.Attributes["key"] = tagTagL3extConsLbl.Key.ValueString() } - if !tagTag.Value.IsUnknown() && !tagTag.Value.IsNull() { - childMap["attributes"]["value"] = tagTag.Value.ValueString() + if !tagTagL3extConsLbl.Value.IsNull() && !tagTagL3extConsLbl.Value.IsUnknown() { + childMap.Attributes["value"] = tagTagL3extConsLbl.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) tagTagIdentifier := TagTagIdentifier{} - tagTagIdentifier.Key = tagTag.Key + tagTagIdentifier.Key = tagTagL3extConsLbl.Key tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) } - for _, tagTag := range tagTagState { + for _, tagTag := range tagTagL3extConsLblState { delete := true for _, tagTagIdentifier := range tagTagIdentifiers { if tagTagIdentifier.Key == tagTag.Key { @@ -906,10 +1388,10 @@ func getL3extConsLblTagTagChildPayloads(ctx context.Context, diags *diag.Diagnos } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagTag.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) + tagTagChildMapForDelete := NewAciObject() + tagTagChildMapForDelete.Attributes["status"] = "deleted" + tagTagChildMapForDelete.Attributes["key"] = tagTag.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagTag": tagTagChildMapForDelete}) } } } else { diff --git a/internal/provider/resource_aci_l3out_consumer_label_test.go b/internal/provider/resource_aci_l3out_consumer_label_test.go index 800d6c795..8607cf155 100644 --- a/internal/provider/resource_aci_l3out_consumer_label_test.go +++ b/internal/provider/resource_aci_l3out_consumer_label_test.go @@ -205,14 +205,54 @@ func TestAccResourceL3extConsLblWithL3extOut(t *testing.T) { resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "annotations.1.value", "test_value"), resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "annotations.#", "2"), resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "relation_to_external_epgs.0.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "relation_to_external_epgs.0.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "relation_to_external_epgs.0.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "relation_to_external_epgs.0.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "relation_to_external_epgs.0.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "annotations.#", "2"), + resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "relation_to_external_epgs.0.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "relation_to_external_epgs.0.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "relation_to_external_epgs.0.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "relation_to_external_epgs.0.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "tags.#", "2"), resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "relation_to_external_epgs.0.target_dn", "uni/tn-test_tenant/out-test_l3_outside/instP-inst_profile_1"), resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "relation_to_external_epgs.1.annotation", "annotation_2"), + resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "relation_to_external_epgs.1.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "relation_to_external_epgs.1.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "relation_to_external_epgs.1.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "relation_to_external_epgs.1.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "annotations.#", "2"), + resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "relation_to_external_epgs.1.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "relation_to_external_epgs.1.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "relation_to_external_epgs.1.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "relation_to_external_epgs.1.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "tags.#", "2"), resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "relation_to_external_epgs.1.target_dn", "uni/tn-test_tenant/out-test_l3_outside/instP-inst_profile_2"), resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "relation_to_external_epgs.#", "2"), resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "relation_to_route_control_profiles.0.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "relation_to_route_control_profiles.0.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "relation_to_route_control_profiles.0.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "relation_to_route_control_profiles.0.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "relation_to_route_control_profiles.0.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "annotations.#", "2"), + resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "relation_to_route_control_profiles.0.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "relation_to_route_control_profiles.0.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "relation_to_route_control_profiles.0.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "relation_to_route_control_profiles.0.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "tags.#", "2"), resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "relation_to_route_control_profiles.0.direction", "export"), resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "relation_to_route_control_profiles.0.target_dn", "uni/tn-test_tenant/prof-rt_ctrl_profile_1"), resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "relation_to_route_control_profiles.1.annotation", "annotation_2"), + resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "relation_to_route_control_profiles.1.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "relation_to_route_control_profiles.1.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "relation_to_route_control_profiles.1.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "relation_to_route_control_profiles.1.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "annotations.#", "2"), + resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "relation_to_route_control_profiles.1.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "relation_to_route_control_profiles.1.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "relation_to_route_control_profiles.1.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "relation_to_route_control_profiles.1.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "tags.#", "2"), resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "relation_to_route_control_profiles.1.direction", "import"), resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "relation_to_route_control_profiles.1.target_dn", "uni/tn-test_tenant/prof-rt_ctrl_profile_2"), resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "relation_to_route_control_profiles.#", "2"), @@ -232,9 +272,21 @@ func TestAccResourceL3extConsLblWithL3extOut(t *testing.T) { resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "annotations.0.value", "test_value"), resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "annotations.#", "1"), resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "relation_to_external_epgs.0.annotation", "annotation_2"), + resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "relation_to_external_epgs.0.annotations.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "relation_to_external_epgs.0.annotations.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "relation_to_external_epgs.0.annotations.#", "1"), + resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "relation_to_external_epgs.0.tags.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "relation_to_external_epgs.0.tags.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "relation_to_external_epgs.0.tags.#", "1"), resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "relation_to_external_epgs.0.target_dn", "uni/tn-test_tenant/out-test_l3_outside/instP-inst_profile_2"), resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "relation_to_external_epgs.#", "1"), resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "relation_to_route_control_profiles.0.annotation", "annotation_2"), + resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "relation_to_route_control_profiles.0.annotations.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "relation_to_route_control_profiles.0.annotations.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "relation_to_route_control_profiles.0.annotations.#", "1"), + resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "relation_to_route_control_profiles.0.tags.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "relation_to_route_control_profiles.0.tags.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "relation_to_route_control_profiles.0.tags.#", "1"), resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "relation_to_route_control_profiles.0.direction", "import"), resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "relation_to_route_control_profiles.0.target_dn", "uni/tn-test_tenant/prof-rt_ctrl_profile_2"), resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "relation_to_route_control_profiles.#", "1"), @@ -313,46 +365,126 @@ resource "aci_l3out_consumer_label" "test" { parent_dn = aci_l3_outside.test.id name = "test_name" annotations = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] relation_to_external_epgs = [ - { - annotation = "annotation_1" - target_dn = "uni/tn-test_tenant/out-test_l3_outside/instP-inst_profile_1" - }, - { - annotation = "annotation_2" - target_dn = "uni/tn-test_tenant/out-test_l3_outside/instP-inst_profile_2" - }, + { + annotation = "annotation_1" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + target_dn = "uni/tn-test_tenant/out-test_l3_outside/instP-inst_profile_1" + }, + { + annotation = "annotation_2" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + target_dn = "uni/tn-test_tenant/out-test_l3_outside/instP-inst_profile_2" + }, ] relation_to_route_control_profiles = [ - { - annotation = "annotation_1" - direction = "export" - target_dn = "uni/tn-test_tenant/prof-rt_ctrl_profile_1" - }, - { - annotation = "annotation_2" - direction = "import" - target_dn = "uni/tn-test_tenant/prof-rt_ctrl_profile_2" - }, + { + annotation = "annotation_1" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + direction = "export" + target_dn = "uni/tn-test_tenant/prof-rt_ctrl_profile_1" + }, + { + annotation = "annotation_2" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + direction = "import" + target_dn = "uni/tn-test_tenant/prof-rt_ctrl_profile_2" + }, ] tags = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] } ` @@ -377,12 +509,36 @@ resource "aci_l3out_consumer_label" "test" { relation_to_external_epgs = [ { annotation = "annotation_2" + annotations = [ + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_1" + value = "test_value" + }, + ] target_dn = "uni/tn-test_tenant/out-test_l3_outside/instP-inst_profile_2" }, ] relation_to_route_control_profiles = [ { annotation = "annotation_2" + annotations = [ + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_1" + value = "test_value" + }, + ] direction = "import" target_dn = "uni/tn-test_tenant/prof-rt_ctrl_profile_2" }, diff --git a/internal/provider/resource_aci_l3out_node_sid_profile.go b/internal/provider/resource_aci_l3out_node_sid_profile.go index b8feddaf7..4b18cc99b 100644 --- a/internal/provider/resource_aci_l3out_node_sid_profile.go +++ b/internal/provider/resource_aci_l3out_node_sid_profile.go @@ -90,6 +90,13 @@ func getEmptyTagAnnotationMplsNodeSidPResourceModel() TagAnnotationMplsNodeSidPR } } +var TagAnnotationMplsNodeSidPType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // TagTagMplsNodeSidPResourceModel describes the resource data model for the children without relation ships. type TagTagMplsNodeSidPResourceModel struct { Key types.String `tfsdk:"key"` @@ -103,6 +110,13 @@ func getEmptyTagTagMplsNodeSidPResourceModel() TagTagMplsNodeSidPResourceModel { } } +var TagTagMplsNodeSidPType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + type MplsNodeSidPIdentifier struct { Sidoffset types.String } @@ -452,7 +466,7 @@ func (r *MplsNodeSidPResource) ImportState(ctx context.Context, req resource.Imp } func getAndSetMplsNodeSidPAttributes(ctx context.Context, diags *diag.Diagnostics, client *client.Client, data *MplsNodeSidPResourceModel) { - requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=children&rsp-subtree-class=%s", data.Id.ValueString(), "mplsNodeSidP,tagAnnotation,tagTag"), "GET", nil) + requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=full&rsp-subtree-class=%s", data.Id.ValueString(), "mplsNodeSidP,tagAnnotation,tagTag"), "GET", nil) readData := getEmptyMplsNodeSidPResourceModel() @@ -504,6 +518,7 @@ func getAndSetMplsNodeSidPAttributes(ctx context.Context, diags *diag.Diagnostic if childAttributeName == "value" { TagAnnotationMplsNodeSidP.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagAnnotationMplsNodeSidPList = append(TagAnnotationMplsNodeSidPList, TagAnnotationMplsNodeSidP) } @@ -516,6 +531,7 @@ func getAndSetMplsNodeSidPAttributes(ctx context.Context, diags *diag.Diagnostic if childAttributeName == "value" { TagTagMplsNodeSidP.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagTagMplsNodeSidPList = append(TagTagMplsNodeSidPList, TagTagMplsNodeSidP) } @@ -563,25 +579,24 @@ func setMplsNodeSidPId(ctx context.Context, data *MplsNodeSidPResourceModel) { data.Id = types.StringValue(fmt.Sprintf("%s/%s", data.ParentDn.ValueString(), rn)) } -func getMplsNodeSidPTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *MplsNodeSidPResourceModel, tagAnnotationPlan, tagAnnotationState []TagAnnotationMplsNodeSidPResourceModel) []map[string]interface{} { - +func getMplsNodeSidPTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *MplsNodeSidPResourceModel, tagAnnotationMplsNodeSidPPlan, tagAnnotationMplsNodeSidPState []TagAnnotationMplsNodeSidPResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagAnnotation.IsUnknown() { + if !data.TagAnnotation.IsNull() && !data.TagAnnotation.IsUnknown() { tagAnnotationIdentifiers := []TagAnnotationIdentifier{} - for _, tagAnnotation := range tagAnnotationPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagAnnotation.Key.IsUnknown() && !tagAnnotation.Key.IsNull() { - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() + for _, tagAnnotationMplsNodeSidP := range tagAnnotationMplsNodeSidPPlan { + childMap := NewAciObject() + if !tagAnnotationMplsNodeSidP.Key.IsNull() && !tagAnnotationMplsNodeSidP.Key.IsUnknown() { + childMap.Attributes["key"] = tagAnnotationMplsNodeSidP.Key.ValueString() } - if !tagAnnotation.Value.IsUnknown() && !tagAnnotation.Value.IsNull() { - childMap["attributes"]["value"] = tagAnnotation.Value.ValueString() + if !tagAnnotationMplsNodeSidP.Value.IsNull() && !tagAnnotationMplsNodeSidP.Value.IsUnknown() { + childMap.Attributes["value"] = tagAnnotationMplsNodeSidP.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) tagAnnotationIdentifier := TagAnnotationIdentifier{} - tagAnnotationIdentifier.Key = tagAnnotation.Key + tagAnnotationIdentifier.Key = tagAnnotationMplsNodeSidP.Key tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) } - for _, tagAnnotation := range tagAnnotationState { + for _, tagAnnotation := range tagAnnotationMplsNodeSidPState { delete := true for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { if tagAnnotationIdentifier.Key == tagAnnotation.Key { @@ -590,10 +605,10 @@ func getMplsNodeSidPTagAnnotationChildPayloads(ctx context.Context, diags *diag. } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) + tagAnnotationChildMapForDelete := NewAciObject() + tagAnnotationChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationChildMapForDelete.Attributes["key"] = tagAnnotation.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": tagAnnotationChildMapForDelete}) } } } else { @@ -602,25 +617,25 @@ func getMplsNodeSidPTagAnnotationChildPayloads(ctx context.Context, diags *diag. return childPayloads } -func getMplsNodeSidPTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *MplsNodeSidPResourceModel, tagTagPlan, tagTagState []TagTagMplsNodeSidPResourceModel) []map[string]interface{} { +func getMplsNodeSidPTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *MplsNodeSidPResourceModel, tagTagMplsNodeSidPPlan, tagTagMplsNodeSidPState []TagTagMplsNodeSidPResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagTag.IsUnknown() { + if !data.TagTag.IsNull() && !data.TagTag.IsUnknown() { tagTagIdentifiers := []TagTagIdentifier{} - for _, tagTag := range tagTagPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagTag.Key.IsUnknown() && !tagTag.Key.IsNull() { - childMap["attributes"]["key"] = tagTag.Key.ValueString() + for _, tagTagMplsNodeSidP := range tagTagMplsNodeSidPPlan { + childMap := NewAciObject() + if !tagTagMplsNodeSidP.Key.IsNull() && !tagTagMplsNodeSidP.Key.IsUnknown() { + childMap.Attributes["key"] = tagTagMplsNodeSidP.Key.ValueString() } - if !tagTag.Value.IsUnknown() && !tagTag.Value.IsNull() { - childMap["attributes"]["value"] = tagTag.Value.ValueString() + if !tagTagMplsNodeSidP.Value.IsNull() && !tagTagMplsNodeSidP.Value.IsUnknown() { + childMap.Attributes["value"] = tagTagMplsNodeSidP.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) tagTagIdentifier := TagTagIdentifier{} - tagTagIdentifier.Key = tagTag.Key + tagTagIdentifier.Key = tagTagMplsNodeSidP.Key tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) } - for _, tagTag := range tagTagState { + for _, tagTag := range tagTagMplsNodeSidPState { delete := true for _, tagTagIdentifier := range tagTagIdentifiers { if tagTagIdentifier.Key == tagTag.Key { @@ -629,10 +644,10 @@ func getMplsNodeSidPTagTagChildPayloads(ctx context.Context, diags *diag.Diagnos } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagTag.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) + tagTagChildMapForDelete := NewAciObject() + tagTagChildMapForDelete.Attributes["status"] = "deleted" + tagTagChildMapForDelete.Attributes["key"] = tagTag.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagTag": tagTagChildMapForDelete}) } } } else { diff --git a/internal/provider/resource_aci_l3out_node_sid_profile_test.go b/internal/provider/resource_aci_l3out_node_sid_profile_test.go index 5c47289ad..be0135737 100644 --- a/internal/provider/resource_aci_l3out_node_sid_profile_test.go +++ b/internal/provider/resource_aci_l3out_node_sid_profile_test.go @@ -259,24 +259,24 @@ resource "aci_l3out_node_sid_profile" "test" { parent_dn = aci_l3out_loopback_interface_profile.test.id segment_id = "1" annotations = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] tags = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] } ` diff --git a/internal/provider/resource_aci_l3out_provider_label.go b/internal/provider/resource_aci_l3out_provider_label.go index 778800888..9f1ed80eb 100644 --- a/internal/provider/resource_aci_l3out_provider_label.go +++ b/internal/provider/resource_aci_l3out_provider_label.go @@ -94,6 +94,13 @@ func getEmptyTagAnnotationL3extProvLblResourceModel() TagAnnotationL3extProvLblR } } +var TagAnnotationL3extProvLblType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // TagTagL3extProvLblResourceModel describes the resource data model for the children without relation ships. type TagTagL3extProvLblResourceModel struct { Key types.String `tfsdk:"key"` @@ -107,6 +114,13 @@ func getEmptyTagTagL3extProvLblResourceModel() TagTagL3extProvLblResourceModel { } } +var TagTagL3extProvLblType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + type L3extProvLblIdentifier struct { Name types.String } @@ -468,7 +482,7 @@ func (r *L3extProvLblResource) ImportState(ctx context.Context, req resource.Imp } func getAndSetL3extProvLblAttributes(ctx context.Context, diags *diag.Diagnostics, client *client.Client, data *L3extProvLblResourceModel) { - requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=children&rsp-subtree-class=%s", data.Id.ValueString(), "l3extProvLbl,tagAnnotation,tagTag"), "GET", nil) + requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=full&rsp-subtree-class=%s", data.Id.ValueString(), "l3extProvLbl,tagAnnotation,tagTag"), "GET", nil) readData := getEmptyL3extProvLblResourceModel() @@ -523,6 +537,7 @@ func getAndSetL3extProvLblAttributes(ctx context.Context, diags *diag.Diagnostic if childAttributeName == "value" { TagAnnotationL3extProvLbl.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagAnnotationL3extProvLblList = append(TagAnnotationL3extProvLblList, TagAnnotationL3extProvLbl) } @@ -535,6 +550,7 @@ func getAndSetL3extProvLblAttributes(ctx context.Context, diags *diag.Diagnostic if childAttributeName == "value" { TagTagL3extProvLbl.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagTagL3extProvLblList = append(TagTagL3extProvLblList, TagTagL3extProvLbl) } @@ -582,25 +598,24 @@ func setL3extProvLblId(ctx context.Context, data *L3extProvLblResourceModel) { data.Id = types.StringValue(fmt.Sprintf("%s/%s", data.ParentDn.ValueString(), rn)) } -func getL3extProvLblTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *L3extProvLblResourceModel, tagAnnotationPlan, tagAnnotationState []TagAnnotationL3extProvLblResourceModel) []map[string]interface{} { - +func getL3extProvLblTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *L3extProvLblResourceModel, tagAnnotationL3extProvLblPlan, tagAnnotationL3extProvLblState []TagAnnotationL3extProvLblResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagAnnotation.IsUnknown() { + if !data.TagAnnotation.IsNull() && !data.TagAnnotation.IsUnknown() { tagAnnotationIdentifiers := []TagAnnotationIdentifier{} - for _, tagAnnotation := range tagAnnotationPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagAnnotation.Key.IsUnknown() && !tagAnnotation.Key.IsNull() { - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() + for _, tagAnnotationL3extProvLbl := range tagAnnotationL3extProvLblPlan { + childMap := NewAciObject() + if !tagAnnotationL3extProvLbl.Key.IsNull() && !tagAnnotationL3extProvLbl.Key.IsUnknown() { + childMap.Attributes["key"] = tagAnnotationL3extProvLbl.Key.ValueString() } - if !tagAnnotation.Value.IsUnknown() && !tagAnnotation.Value.IsNull() { - childMap["attributes"]["value"] = tagAnnotation.Value.ValueString() + if !tagAnnotationL3extProvLbl.Value.IsNull() && !tagAnnotationL3extProvLbl.Value.IsUnknown() { + childMap.Attributes["value"] = tagAnnotationL3extProvLbl.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) tagAnnotationIdentifier := TagAnnotationIdentifier{} - tagAnnotationIdentifier.Key = tagAnnotation.Key + tagAnnotationIdentifier.Key = tagAnnotationL3extProvLbl.Key tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) } - for _, tagAnnotation := range tagAnnotationState { + for _, tagAnnotation := range tagAnnotationL3extProvLblState { delete := true for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { if tagAnnotationIdentifier.Key == tagAnnotation.Key { @@ -609,10 +624,10 @@ func getL3extProvLblTagAnnotationChildPayloads(ctx context.Context, diags *diag. } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) + tagAnnotationChildMapForDelete := NewAciObject() + tagAnnotationChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationChildMapForDelete.Attributes["key"] = tagAnnotation.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": tagAnnotationChildMapForDelete}) } } } else { @@ -621,25 +636,25 @@ func getL3extProvLblTagAnnotationChildPayloads(ctx context.Context, diags *diag. return childPayloads } -func getL3extProvLblTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *L3extProvLblResourceModel, tagTagPlan, tagTagState []TagTagL3extProvLblResourceModel) []map[string]interface{} { +func getL3extProvLblTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *L3extProvLblResourceModel, tagTagL3extProvLblPlan, tagTagL3extProvLblState []TagTagL3extProvLblResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagTag.IsUnknown() { + if !data.TagTag.IsNull() && !data.TagTag.IsUnknown() { tagTagIdentifiers := []TagTagIdentifier{} - for _, tagTag := range tagTagPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagTag.Key.IsUnknown() && !tagTag.Key.IsNull() { - childMap["attributes"]["key"] = tagTag.Key.ValueString() + for _, tagTagL3extProvLbl := range tagTagL3extProvLblPlan { + childMap := NewAciObject() + if !tagTagL3extProvLbl.Key.IsNull() && !tagTagL3extProvLbl.Key.IsUnknown() { + childMap.Attributes["key"] = tagTagL3extProvLbl.Key.ValueString() } - if !tagTag.Value.IsUnknown() && !tagTag.Value.IsNull() { - childMap["attributes"]["value"] = tagTag.Value.ValueString() + if !tagTagL3extProvLbl.Value.IsNull() && !tagTagL3extProvLbl.Value.IsUnknown() { + childMap.Attributes["value"] = tagTagL3extProvLbl.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) tagTagIdentifier := TagTagIdentifier{} - tagTagIdentifier.Key = tagTag.Key + tagTagIdentifier.Key = tagTagL3extProvLbl.Key tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) } - for _, tagTag := range tagTagState { + for _, tagTag := range tagTagL3extProvLblState { delete := true for _, tagTagIdentifier := range tagTagIdentifiers { if tagTagIdentifier.Key == tagTag.Key { @@ -648,10 +663,10 @@ func getL3extProvLblTagTagChildPayloads(ctx context.Context, diags *diag.Diagnos } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagTag.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) + tagTagChildMapForDelete := NewAciObject() + tagTagChildMapForDelete.Attributes["status"] = "deleted" + tagTagChildMapForDelete.Attributes["key"] = tagTag.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagTag": tagTagChildMapForDelete}) } } } else { diff --git a/internal/provider/resource_aci_l3out_provider_label_test.go b/internal/provider/resource_aci_l3out_provider_label_test.go index 0c46a04c6..ec08556de 100644 --- a/internal/provider/resource_aci_l3out_provider_label_test.go +++ b/internal/provider/resource_aci_l3out_provider_label_test.go @@ -269,24 +269,24 @@ resource "aci_l3out_provider_label" "test" { parent_dn = aci_l3_outside.test.id name = "prov_label" annotations = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] tags = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] } ` diff --git a/internal/provider/resource_aci_l3out_redistribute_policy.go b/internal/provider/resource_aci_l3out_redistribute_policy.go index 3aecfa4ad..2297e9c4d 100644 --- a/internal/provider/resource_aci_l3out_redistribute_policy.go +++ b/internal/provider/resource_aci_l3out_redistribute_policy.go @@ -86,6 +86,13 @@ func getEmptyTagAnnotationL3extRsRedistributePolResourceModel() TagAnnotationL3e } } +var TagAnnotationL3extRsRedistributePolType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // TagTagL3extRsRedistributePolResourceModel describes the resource data model for the children without relation ships. type TagTagL3extRsRedistributePolResourceModel struct { Key types.String `tfsdk:"key"` @@ -99,6 +106,13 @@ func getEmptyTagTagL3extRsRedistributePolResourceModel() TagTagL3extRsRedistribu } } +var TagTagL3extRsRedistributePolType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + type L3extRsRedistributePolIdentifier struct { Src types.String TnRtctrlProfileName types.String @@ -425,7 +439,7 @@ func (r *L3extRsRedistributePolResource) ImportState(ctx context.Context, req re } func getAndSetL3extRsRedistributePolAttributes(ctx context.Context, diags *diag.Diagnostics, client *client.Client, data *L3extRsRedistributePolResourceModel) { - requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=children&rsp-subtree-class=%s", data.Id.ValueString(), "l3extRsRedistributePol,tagAnnotation,tagTag"), "GET", nil) + requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=full&rsp-subtree-class=%s", data.Id.ValueString(), "l3extRsRedistributePol,tagAnnotation,tagTag"), "GET", nil) readData := getEmptyL3extRsRedistributePolResourceModel() @@ -468,6 +482,7 @@ func getAndSetL3extRsRedistributePolAttributes(ctx context.Context, diags *diag. if childAttributeName == "value" { TagAnnotationL3extRsRedistributePol.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagAnnotationL3extRsRedistributePolList = append(TagAnnotationL3extRsRedistributePolList, TagAnnotationL3extRsRedistributePol) } @@ -480,6 +495,7 @@ func getAndSetL3extRsRedistributePolAttributes(ctx context.Context, diags *diag. if childAttributeName == "value" { TagTagL3extRsRedistributePol.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagTagL3extRsRedistributePolList = append(TagTagL3extRsRedistributePolList, TagTagL3extRsRedistributePol) } @@ -527,25 +543,24 @@ func setL3extRsRedistributePolId(ctx context.Context, data *L3extRsRedistributeP data.Id = types.StringValue(fmt.Sprintf("%s/%s", data.ParentDn.ValueString(), rn)) } -func getL3extRsRedistributePolTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *L3extRsRedistributePolResourceModel, tagAnnotationPlan, tagAnnotationState []TagAnnotationL3extRsRedistributePolResourceModel) []map[string]interface{} { - +func getL3extRsRedistributePolTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *L3extRsRedistributePolResourceModel, tagAnnotationL3extRsRedistributePolPlan, tagAnnotationL3extRsRedistributePolState []TagAnnotationL3extRsRedistributePolResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagAnnotation.IsUnknown() { + if !data.TagAnnotation.IsNull() && !data.TagAnnotation.IsUnknown() { tagAnnotationIdentifiers := []TagAnnotationIdentifier{} - for _, tagAnnotation := range tagAnnotationPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagAnnotation.Key.IsUnknown() && !tagAnnotation.Key.IsNull() { - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() + for _, tagAnnotationL3extRsRedistributePol := range tagAnnotationL3extRsRedistributePolPlan { + childMap := NewAciObject() + if !tagAnnotationL3extRsRedistributePol.Key.IsNull() && !tagAnnotationL3extRsRedistributePol.Key.IsUnknown() { + childMap.Attributes["key"] = tagAnnotationL3extRsRedistributePol.Key.ValueString() } - if !tagAnnotation.Value.IsUnknown() && !tagAnnotation.Value.IsNull() { - childMap["attributes"]["value"] = tagAnnotation.Value.ValueString() + if !tagAnnotationL3extRsRedistributePol.Value.IsNull() && !tagAnnotationL3extRsRedistributePol.Value.IsUnknown() { + childMap.Attributes["value"] = tagAnnotationL3extRsRedistributePol.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) tagAnnotationIdentifier := TagAnnotationIdentifier{} - tagAnnotationIdentifier.Key = tagAnnotation.Key + tagAnnotationIdentifier.Key = tagAnnotationL3extRsRedistributePol.Key tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) } - for _, tagAnnotation := range tagAnnotationState { + for _, tagAnnotation := range tagAnnotationL3extRsRedistributePolState { delete := true for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { if tagAnnotationIdentifier.Key == tagAnnotation.Key { @@ -554,10 +569,10 @@ func getL3extRsRedistributePolTagAnnotationChildPayloads(ctx context.Context, di } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) + tagAnnotationChildMapForDelete := NewAciObject() + tagAnnotationChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationChildMapForDelete.Attributes["key"] = tagAnnotation.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": tagAnnotationChildMapForDelete}) } } } else { @@ -566,25 +581,25 @@ func getL3extRsRedistributePolTagAnnotationChildPayloads(ctx context.Context, di return childPayloads } -func getL3extRsRedistributePolTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *L3extRsRedistributePolResourceModel, tagTagPlan, tagTagState []TagTagL3extRsRedistributePolResourceModel) []map[string]interface{} { +func getL3extRsRedistributePolTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *L3extRsRedistributePolResourceModel, tagTagL3extRsRedistributePolPlan, tagTagL3extRsRedistributePolState []TagTagL3extRsRedistributePolResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagTag.IsUnknown() { + if !data.TagTag.IsNull() && !data.TagTag.IsUnknown() { tagTagIdentifiers := []TagTagIdentifier{} - for _, tagTag := range tagTagPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagTag.Key.IsUnknown() && !tagTag.Key.IsNull() { - childMap["attributes"]["key"] = tagTag.Key.ValueString() + for _, tagTagL3extRsRedistributePol := range tagTagL3extRsRedistributePolPlan { + childMap := NewAciObject() + if !tagTagL3extRsRedistributePol.Key.IsNull() && !tagTagL3extRsRedistributePol.Key.IsUnknown() { + childMap.Attributes["key"] = tagTagL3extRsRedistributePol.Key.ValueString() } - if !tagTag.Value.IsUnknown() && !tagTag.Value.IsNull() { - childMap["attributes"]["value"] = tagTag.Value.ValueString() + if !tagTagL3extRsRedistributePol.Value.IsNull() && !tagTagL3extRsRedistributePol.Value.IsUnknown() { + childMap.Attributes["value"] = tagTagL3extRsRedistributePol.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) tagTagIdentifier := TagTagIdentifier{} - tagTagIdentifier.Key = tagTag.Key + tagTagIdentifier.Key = tagTagL3extRsRedistributePol.Key tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) } - for _, tagTag := range tagTagState { + for _, tagTag := range tagTagL3extRsRedistributePolState { delete := true for _, tagTagIdentifier := range tagTagIdentifiers { if tagTagIdentifier.Key == tagTag.Key { @@ -593,10 +608,10 @@ func getL3extRsRedistributePolTagTagChildPayloads(ctx context.Context, diags *di } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagTag.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) + tagTagChildMapForDelete := NewAciObject() + tagTagChildMapForDelete.Attributes["status"] = "deleted" + tagTagChildMapForDelete.Attributes["key"] = tagTag.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagTag": tagTagChildMapForDelete}) } } } else { diff --git a/internal/provider/resource_aci_l3out_redistribute_policy_test.go b/internal/provider/resource_aci_l3out_redistribute_policy_test.go index d6cf2d292..c9c7d2a40 100644 --- a/internal/provider/resource_aci_l3out_redistribute_policy_test.go +++ b/internal/provider/resource_aci_l3out_redistribute_policy_test.go @@ -234,24 +234,24 @@ resource "aci_l3out_redistribute_policy" "test" { route_control_profile_name = "test_tn_rtctrl_profile_name" source = "direct" annotations = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] tags = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] } ` diff --git a/internal/provider/resource_aci_management_access_policy.go b/internal/provider/resource_aci_management_access_policy.go new file mode 100644 index 000000000..ebb952d16 --- /dev/null +++ b/internal/provider/resource_aci_management_access_policy.go @@ -0,0 +1,4280 @@ +// Code generated by "gen/generator.go"; DO NOT EDIT. +// In order to regenerate this file execute `go generate` from the repository root. +// More details can be found in the [README](https://github.com/CiscoDevNet/terraform-provider-aci/blob/master/README.md). + +package provider + +import ( + "context" + "encoding/json" + "fmt" + "strings" + + "github.com/ciscoecosystem/aci-go-client/v2/client" + "github.com/ciscoecosystem/aci-go-client/v2/container" + "github.com/hashicorp/terraform-plugin-framework-validators/setvalidator" + "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" + "github.com/hashicorp/terraform-plugin-framework/attr" + "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/path" + "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-framework/resource/schema" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/objectplanmodifier" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/setplanmodifier" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringdefault" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" + "github.com/hashicorp/terraform-plugin-framework/schema/validator" + "github.com/hashicorp/terraform-plugin-framework/types" + "github.com/hashicorp/terraform-plugin-framework/types/basetypes" + "github.com/hashicorp/terraform-plugin-log/tflog" +) + +// Ensure provider defined types fully satisfy framework interfaces. +var _ resource.Resource = &CommPolResource{} +var _ resource.ResourceWithImportState = &CommPolResource{} + +func NewCommPolResource() resource.Resource { + return &CommPolResource{} +} + +// CommPolResource defines the resource implementation. +type CommPolResource struct { + client *client.Client +} + +// CommPolResourceModel describes the resource data model. +type CommPolResourceModel struct { + Id types.String `tfsdk:"id"` + Annotation types.String `tfsdk:"annotation"` + Descr types.String `tfsdk:"description"` + Name types.String `tfsdk:"name"` + NameAlias types.String `tfsdk:"name_alias"` + OwnerKey types.String `tfsdk:"owner_key"` + OwnerTag types.String `tfsdk:"owner_tag"` + StrictSecurityOnApicOOBSubnet types.String `tfsdk:"strict_security_on_apic_oob_subnet"` + CommHttp types.Object `tfsdk:"http_service"` + CommHttps types.Object `tfsdk:"http_ssl_configuration"` + CommShellinabox types.Object `tfsdk:"ssh_access_via_web"` + CommSsh types.Object `tfsdk:"ssh_service"` + CommTelnet types.Object `tfsdk:"telnet_service"` + TagAnnotation types.Set `tfsdk:"annotations"` + TagTag types.Set `tfsdk:"tags"` +} + +func getEmptyCommPolResourceModel() *CommPolResourceModel { + return &CommPolResourceModel{ + Id: basetypes.NewStringNull(), + Annotation: basetypes.NewStringNull(), + Descr: basetypes.NewStringNull(), + Name: basetypes.NewStringNull(), + NameAlias: basetypes.NewStringNull(), + OwnerKey: basetypes.NewStringNull(), + OwnerTag: basetypes.NewStringNull(), + StrictSecurityOnApicOOBSubnet: basetypes.NewStringNull(), + CommHttp: types.ObjectNull(map[string]attr.Type{ + "access_control_allow_credential": types.StringType, + "access_control_allow_origins": types.StringType, + "admin_state": types.StringType, + "annotation": types.StringType, + "cli_only_mode": types.StringType, + "description": types.StringType, + "global_throttle_rate": types.StringType, + "global_throttle_state": types.StringType, + "global_throttle_unit": types.StringType, + "max_request_status_count": types.StringType, + "name": types.StringType, + "name_alias": types.StringType, + "node_exporter": types.StringType, + "port": types.StringType, + "redirect_state": types.StringType, + "server_header": types.StringType, + "throttle_rate": types.StringType, + "throttle_state": types.StringType, + "visore_access": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationCommHttpCommPolType}, + "tags": types.SetType{ElemType: TagTagCommHttpCommPolType}, + }), + CommHttps: types.ObjectNull(map[string]attr.Type{ + "access_control_allow_credential": types.StringType, + "access_control_allow_origins": types.StringType, + "admin_state": types.StringType, + "annotation": types.StringType, + "cli_only_mode": types.StringType, + "client_cert_auth_state": types.StringType, + "description": types.StringType, + "dh_param": types.StringType, + "global_throttle_rate": types.StringType, + "global_throttle_state": types.StringType, + "global_throttle_unit": types.StringType, + "max_request_status_count": types.StringType, + "name": types.StringType, + "name_alias": types.StringType, + "node_exporter": types.StringType, + "port": types.StringType, + "referer": types.StringType, + "server_header": types.StringType, + "ssl_protocols": types.SetType{ElemType: types.StringType}, + "throttle_rate": types.StringType, + "throttle_state": types.StringType, + "visore_access": types.StringType, + "certificate_authority": types.ObjectType{AttrTypes: CommRsClientCertCACommHttpsCommPolType}, + "key_ring": types.ObjectType{AttrTypes: CommRsKeyRingCommHttpsCommPolType}, + "annotations": types.SetType{ElemType: TagAnnotationCommHttpsCommPolType}, + "tags": types.SetType{ElemType: TagTagCommHttpsCommPolType}, + }), + CommShellinabox: types.ObjectNull(map[string]attr.Type{ + "admin_state": types.StringType, + "annotation": types.StringType, + "description": types.StringType, + "name": types.StringType, + "name_alias": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationCommShellinaboxCommPolType}, + "tags": types.SetType{ElemType: TagTagCommShellinaboxCommPolType}, + }), + CommSsh: types.ObjectNull(map[string]attr.Type{ + "admin_state": types.StringType, + "annotation": types.StringType, + "description": types.StringType, + "host_key_algorithms": types.SetType{ElemType: types.StringType}, + "key_exchange_algorithms": types.SetType{ElemType: types.StringType}, + "name": types.StringType, + "name_alias": types.StringType, + "password_auth": types.StringType, + "port": types.StringType, + "ssh_ciphers": types.SetType{ElemType: types.StringType}, + "ssh_macs": types.SetType{ElemType: types.StringType}, + "annotations": types.SetType{ElemType: TagAnnotationCommSshCommPolType}, + "tags": types.SetType{ElemType: TagTagCommSshCommPolType}, + }), + CommTelnet: types.ObjectNull(map[string]attr.Type{ + "admin_state": types.StringType, + "annotation": types.StringType, + "description": types.StringType, + "name": types.StringType, + "name_alias": types.StringType, + "port": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationCommTelnetCommPolType}, + "tags": types.SetType{ElemType: TagTagCommTelnetCommPolType}, + }), + TagAnnotation: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + } +} + +// CommHttpCommPolResourceModel describes the resource data model for the children without relation ships. +type CommHttpCommPolResourceModel struct { + AccessControlAllowCredential types.String `tfsdk:"access_control_allow_credential"` + AccessControlAllowOrigins types.String `tfsdk:"access_control_allow_origins"` + AdminSt types.String `tfsdk:"admin_state"` + Annotation types.String `tfsdk:"annotation"` + CliOnlyMode types.String `tfsdk:"cli_only_mode"` + Descr types.String `tfsdk:"description"` + GlobalThrottleRate types.String `tfsdk:"global_throttle_rate"` + GlobalThrottleSt types.String `tfsdk:"global_throttle_state"` + GlobalThrottleUnit types.String `tfsdk:"global_throttle_unit"` + MaxRequestStatusCount types.String `tfsdk:"max_request_status_count"` + Name types.String `tfsdk:"name"` + NameAlias types.String `tfsdk:"name_alias"` + NodeExporter types.String `tfsdk:"node_exporter"` + Port types.String `tfsdk:"port"` + RedirectSt types.String `tfsdk:"redirect_state"` + ServerHeader types.String `tfsdk:"server_header"` + ThrottleRate types.String `tfsdk:"throttle_rate"` + ThrottleSt types.String `tfsdk:"throttle_state"` + VisoreAccess types.String `tfsdk:"visore_access"` + TagAnnotation types.Set `tfsdk:"annotations"` + TagTag types.Set `tfsdk:"tags"` +} + +func getEmptyCommHttpCommPolResourceModel() CommHttpCommPolResourceModel { + return CommHttpCommPolResourceModel{ + AccessControlAllowCredential: basetypes.NewStringNull(), + AccessControlAllowOrigins: basetypes.NewStringNull(), + AdminSt: basetypes.NewStringNull(), + Annotation: basetypes.NewStringNull(), + CliOnlyMode: basetypes.NewStringNull(), + Descr: basetypes.NewStringNull(), + GlobalThrottleRate: basetypes.NewStringNull(), + GlobalThrottleSt: basetypes.NewStringNull(), + GlobalThrottleUnit: basetypes.NewStringNull(), + MaxRequestStatusCount: basetypes.NewStringNull(), + Name: basetypes.NewStringNull(), + NameAlias: basetypes.NewStringNull(), + NodeExporter: basetypes.NewStringNull(), + Port: basetypes.NewStringNull(), + RedirectSt: basetypes.NewStringNull(), + ServerHeader: basetypes.NewStringNull(), + ThrottleRate: basetypes.NewStringNull(), + ThrottleSt: basetypes.NewStringNull(), + VisoreAccess: basetypes.NewStringNull(), + TagAnnotation: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + } +} + +var CommHttpCommPolType = map[string]attr.Type{ + "access_control_allow_credential": types.StringType, + "access_control_allow_origins": types.StringType, + "admin_state": types.StringType, + "annotation": types.StringType, + "cli_only_mode": types.StringType, + "description": types.StringType, + "global_throttle_rate": types.StringType, + "global_throttle_state": types.StringType, + "global_throttle_unit": types.StringType, + "max_request_status_count": types.StringType, + "name": types.StringType, + "name_alias": types.StringType, + "node_exporter": types.StringType, + "port": types.StringType, + "redirect_state": types.StringType, + "server_header": types.StringType, + "throttle_rate": types.StringType, + "throttle_state": types.StringType, + "visore_access": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationCommHttpCommPolType}, + "tags": types.SetType{ElemType: TagTagCommHttpCommPolType}, +} + +// TagAnnotationCommHttpCommPolResourceModel describes the resource data model for the children without relation ships. +type TagAnnotationCommHttpCommPolResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagAnnotationCommHttpCommPolResourceModel() TagAnnotationCommHttpCommPolResourceModel { + return TagAnnotationCommHttpCommPolResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagAnnotationCommHttpCommPolType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + +// TagTagCommHttpCommPolResourceModel describes the resource data model for the children without relation ships. +type TagTagCommHttpCommPolResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagTagCommHttpCommPolResourceModel() TagTagCommHttpCommPolResourceModel { + return TagTagCommHttpCommPolResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagTagCommHttpCommPolType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + +// CommHttpsCommPolResourceModel describes the resource data model for the children without relation ships. +type CommHttpsCommPolResourceModel struct { + AccessControlAllowCredential types.String `tfsdk:"access_control_allow_credential"` + AccessControlAllowOrigins types.String `tfsdk:"access_control_allow_origins"` + AdminSt types.String `tfsdk:"admin_state"` + Annotation types.String `tfsdk:"annotation"` + CliOnlyMode types.String `tfsdk:"cli_only_mode"` + ClientCertAuthState types.String `tfsdk:"client_cert_auth_state"` + Descr types.String `tfsdk:"description"` + DhParam types.String `tfsdk:"dh_param"` + GlobalThrottleRate types.String `tfsdk:"global_throttle_rate"` + GlobalThrottleSt types.String `tfsdk:"global_throttle_state"` + GlobalThrottleUnit types.String `tfsdk:"global_throttle_unit"` + MaxRequestStatusCount types.String `tfsdk:"max_request_status_count"` + Name types.String `tfsdk:"name"` + NameAlias types.String `tfsdk:"name_alias"` + NodeExporter types.String `tfsdk:"node_exporter"` + Port types.String `tfsdk:"port"` + Referer types.String `tfsdk:"referer"` + ServerHeader types.String `tfsdk:"server_header"` + SslProtocols types.Set `tfsdk:"ssl_protocols"` + ThrottleRate types.String `tfsdk:"throttle_rate"` + ThrottleSt types.String `tfsdk:"throttle_state"` + VisoreAccess types.String `tfsdk:"visore_access"` + CommRsClientCertCA types.Object `tfsdk:"certificate_authority"` + CommRsKeyRing types.Object `tfsdk:"key_ring"` + TagAnnotation types.Set `tfsdk:"annotations"` + TagTag types.Set `tfsdk:"tags"` +} + +func getEmptyCommHttpsCommPolResourceModel() CommHttpsCommPolResourceModel { + return CommHttpsCommPolResourceModel{ + AccessControlAllowCredential: basetypes.NewStringNull(), + AccessControlAllowOrigins: basetypes.NewStringNull(), + AdminSt: basetypes.NewStringNull(), + Annotation: basetypes.NewStringNull(), + CliOnlyMode: basetypes.NewStringNull(), + ClientCertAuthState: basetypes.NewStringNull(), + Descr: basetypes.NewStringNull(), + DhParam: basetypes.NewStringNull(), + GlobalThrottleRate: basetypes.NewStringNull(), + GlobalThrottleSt: basetypes.NewStringNull(), + GlobalThrottleUnit: basetypes.NewStringNull(), + MaxRequestStatusCount: basetypes.NewStringNull(), + Name: basetypes.NewStringNull(), + NameAlias: basetypes.NewStringNull(), + NodeExporter: basetypes.NewStringNull(), + Port: basetypes.NewStringNull(), + Referer: basetypes.NewStringNull(), + ServerHeader: basetypes.NewStringNull(), + SslProtocols: types.SetNull(types.StringType), + ThrottleRate: basetypes.NewStringNull(), + ThrottleSt: basetypes.NewStringNull(), + VisoreAccess: basetypes.NewStringNull(), + CommRsClientCertCA: types.ObjectNull(map[string]attr.Type{ + "annotation": types.StringType, + "target_dn": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationCommRsClientCertCACommHttpsCommPolType}, + "tags": types.SetType{ElemType: TagTagCommRsClientCertCACommHttpsCommPolType}, + }), + CommRsKeyRing: types.ObjectNull(map[string]attr.Type{ + "annotation": types.StringType, + "key_ring_name": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationCommRsKeyRingCommHttpsCommPolType}, + "tags": types.SetType{ElemType: TagTagCommRsKeyRingCommHttpsCommPolType}, + }), + TagAnnotation: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + } +} + +var CommHttpsCommPolType = map[string]attr.Type{ + "access_control_allow_credential": types.StringType, + "access_control_allow_origins": types.StringType, + "admin_state": types.StringType, + "annotation": types.StringType, + "cli_only_mode": types.StringType, + "client_cert_auth_state": types.StringType, + "description": types.StringType, + "dh_param": types.StringType, + "global_throttle_rate": types.StringType, + "global_throttle_state": types.StringType, + "global_throttle_unit": types.StringType, + "max_request_status_count": types.StringType, + "name": types.StringType, + "name_alias": types.StringType, + "node_exporter": types.StringType, + "port": types.StringType, + "referer": types.StringType, + "server_header": types.StringType, + "ssl_protocols": types.SetType{ElemType: types.StringType}, + "throttle_rate": types.StringType, + "throttle_state": types.StringType, + "visore_access": types.StringType, + "certificate_authority": types.ObjectType{AttrTypes: CommRsClientCertCACommHttpsCommPolType}, + "key_ring": types.ObjectType{AttrTypes: CommRsKeyRingCommHttpsCommPolType}, + "annotations": types.SetType{ElemType: TagAnnotationCommHttpsCommPolType}, + "tags": types.SetType{ElemType: TagTagCommHttpsCommPolType}, +} + +// CommRsClientCertCACommHttpsCommPolResourceModel describes the resource data model for the children without relation ships. +type CommRsClientCertCACommHttpsCommPolResourceModel struct { + Annotation types.String `tfsdk:"annotation"` + TDn types.String `tfsdk:"target_dn"` + TagAnnotation types.Set `tfsdk:"annotations"` + TagTag types.Set `tfsdk:"tags"` +} + +func getEmptyCommRsClientCertCACommHttpsCommPolResourceModel() CommRsClientCertCACommHttpsCommPolResourceModel { + return CommRsClientCertCACommHttpsCommPolResourceModel{ + Annotation: basetypes.NewStringNull(), + TDn: basetypes.NewStringNull(), + TagAnnotation: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + } +} + +var CommRsClientCertCACommHttpsCommPolType = map[string]attr.Type{ + "annotation": types.StringType, + "target_dn": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationCommRsClientCertCACommHttpsCommPolType}, + "tags": types.SetType{ElemType: TagTagCommRsClientCertCACommHttpsCommPolType}, +} + +// TagAnnotationCommRsClientCertCACommHttpsCommPolResourceModel describes the resource data model for the children without relation ships. +type TagAnnotationCommRsClientCertCACommHttpsCommPolResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagAnnotationCommRsClientCertCACommHttpsCommPolResourceModel() TagAnnotationCommRsClientCertCACommHttpsCommPolResourceModel { + return TagAnnotationCommRsClientCertCACommHttpsCommPolResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagAnnotationCommRsClientCertCACommHttpsCommPolType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + +// TagTagCommRsClientCertCACommHttpsCommPolResourceModel describes the resource data model for the children without relation ships. +type TagTagCommRsClientCertCACommHttpsCommPolResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagTagCommRsClientCertCACommHttpsCommPolResourceModel() TagTagCommRsClientCertCACommHttpsCommPolResourceModel { + return TagTagCommRsClientCertCACommHttpsCommPolResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagTagCommRsClientCertCACommHttpsCommPolType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + +// CommRsKeyRingCommHttpsCommPolResourceModel describes the resource data model for the children without relation ships. +type CommRsKeyRingCommHttpsCommPolResourceModel struct { + Annotation types.String `tfsdk:"annotation"` + TnPkiKeyRingName types.String `tfsdk:"key_ring_name"` + TagAnnotation types.Set `tfsdk:"annotations"` + TagTag types.Set `tfsdk:"tags"` +} + +func getEmptyCommRsKeyRingCommHttpsCommPolResourceModel() CommRsKeyRingCommHttpsCommPolResourceModel { + return CommRsKeyRingCommHttpsCommPolResourceModel{ + Annotation: basetypes.NewStringNull(), + TnPkiKeyRingName: basetypes.NewStringNull(), + TagAnnotation: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + } +} + +var CommRsKeyRingCommHttpsCommPolType = map[string]attr.Type{ + "annotation": types.StringType, + "key_ring_name": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationCommRsKeyRingCommHttpsCommPolType}, + "tags": types.SetType{ElemType: TagTagCommRsKeyRingCommHttpsCommPolType}, +} + +// TagAnnotationCommRsKeyRingCommHttpsCommPolResourceModel describes the resource data model for the children without relation ships. +type TagAnnotationCommRsKeyRingCommHttpsCommPolResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagAnnotationCommRsKeyRingCommHttpsCommPolResourceModel() TagAnnotationCommRsKeyRingCommHttpsCommPolResourceModel { + return TagAnnotationCommRsKeyRingCommHttpsCommPolResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagAnnotationCommRsKeyRingCommHttpsCommPolType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + +// TagTagCommRsKeyRingCommHttpsCommPolResourceModel describes the resource data model for the children without relation ships. +type TagTagCommRsKeyRingCommHttpsCommPolResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagTagCommRsKeyRingCommHttpsCommPolResourceModel() TagTagCommRsKeyRingCommHttpsCommPolResourceModel { + return TagTagCommRsKeyRingCommHttpsCommPolResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagTagCommRsKeyRingCommHttpsCommPolType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + +// TagAnnotationCommHttpsCommPolResourceModel describes the resource data model for the children without relation ships. +type TagAnnotationCommHttpsCommPolResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagAnnotationCommHttpsCommPolResourceModel() TagAnnotationCommHttpsCommPolResourceModel { + return TagAnnotationCommHttpsCommPolResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagAnnotationCommHttpsCommPolType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + +// TagTagCommHttpsCommPolResourceModel describes the resource data model for the children without relation ships. +type TagTagCommHttpsCommPolResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagTagCommHttpsCommPolResourceModel() TagTagCommHttpsCommPolResourceModel { + return TagTagCommHttpsCommPolResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagTagCommHttpsCommPolType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + +// CommShellinaboxCommPolResourceModel describes the resource data model for the children without relation ships. +type CommShellinaboxCommPolResourceModel struct { + AdminSt types.String `tfsdk:"admin_state"` + Annotation types.String `tfsdk:"annotation"` + Descr types.String `tfsdk:"description"` + Name types.String `tfsdk:"name"` + NameAlias types.String `tfsdk:"name_alias"` + TagAnnotation types.Set `tfsdk:"annotations"` + TagTag types.Set `tfsdk:"tags"` +} + +func getEmptyCommShellinaboxCommPolResourceModel() CommShellinaboxCommPolResourceModel { + return CommShellinaboxCommPolResourceModel{ + AdminSt: basetypes.NewStringNull(), + Annotation: basetypes.NewStringNull(), + Descr: basetypes.NewStringNull(), + Name: basetypes.NewStringNull(), + NameAlias: basetypes.NewStringNull(), + TagAnnotation: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + } +} + +var CommShellinaboxCommPolType = map[string]attr.Type{ + "admin_state": types.StringType, + "annotation": types.StringType, + "description": types.StringType, + "name": types.StringType, + "name_alias": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationCommShellinaboxCommPolType}, + "tags": types.SetType{ElemType: TagTagCommShellinaboxCommPolType}, +} + +// TagAnnotationCommShellinaboxCommPolResourceModel describes the resource data model for the children without relation ships. +type TagAnnotationCommShellinaboxCommPolResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagAnnotationCommShellinaboxCommPolResourceModel() TagAnnotationCommShellinaboxCommPolResourceModel { + return TagAnnotationCommShellinaboxCommPolResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagAnnotationCommShellinaboxCommPolType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + +// TagTagCommShellinaboxCommPolResourceModel describes the resource data model for the children without relation ships. +type TagTagCommShellinaboxCommPolResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagTagCommShellinaboxCommPolResourceModel() TagTagCommShellinaboxCommPolResourceModel { + return TagTagCommShellinaboxCommPolResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagTagCommShellinaboxCommPolType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + +// CommSshCommPolResourceModel describes the resource data model for the children without relation ships. +type CommSshCommPolResourceModel struct { + AdminSt types.String `tfsdk:"admin_state"` + Annotation types.String `tfsdk:"annotation"` + Descr types.String `tfsdk:"description"` + HostkeyAlgos types.Set `tfsdk:"host_key_algorithms"` + KexAlgos types.Set `tfsdk:"key_exchange_algorithms"` + Name types.String `tfsdk:"name"` + NameAlias types.String `tfsdk:"name_alias"` + PasswordAuth types.String `tfsdk:"password_auth"` + Port types.String `tfsdk:"port"` + SshCiphers types.Set `tfsdk:"ssh_ciphers"` + SshMacs types.Set `tfsdk:"ssh_macs"` + TagAnnotation types.Set `tfsdk:"annotations"` + TagTag types.Set `tfsdk:"tags"` +} + +func getEmptyCommSshCommPolResourceModel() CommSshCommPolResourceModel { + return CommSshCommPolResourceModel{ + AdminSt: basetypes.NewStringNull(), + Annotation: basetypes.NewStringNull(), + Descr: basetypes.NewStringNull(), + HostkeyAlgos: types.SetNull(types.StringType), + KexAlgos: types.SetNull(types.StringType), + Name: basetypes.NewStringNull(), + NameAlias: basetypes.NewStringNull(), + PasswordAuth: basetypes.NewStringNull(), + Port: basetypes.NewStringNull(), + SshCiphers: types.SetNull(types.StringType), + SshMacs: types.SetNull(types.StringType), + TagAnnotation: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + } +} + +var CommSshCommPolType = map[string]attr.Type{ + "admin_state": types.StringType, + "annotation": types.StringType, + "description": types.StringType, + "host_key_algorithms": types.SetType{ElemType: types.StringType}, + "key_exchange_algorithms": types.SetType{ElemType: types.StringType}, + "name": types.StringType, + "name_alias": types.StringType, + "password_auth": types.StringType, + "port": types.StringType, + "ssh_ciphers": types.SetType{ElemType: types.StringType}, + "ssh_macs": types.SetType{ElemType: types.StringType}, + "annotations": types.SetType{ElemType: TagAnnotationCommSshCommPolType}, + "tags": types.SetType{ElemType: TagTagCommSshCommPolType}, +} + +// TagAnnotationCommSshCommPolResourceModel describes the resource data model for the children without relation ships. +type TagAnnotationCommSshCommPolResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagAnnotationCommSshCommPolResourceModel() TagAnnotationCommSshCommPolResourceModel { + return TagAnnotationCommSshCommPolResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagAnnotationCommSshCommPolType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + +// TagTagCommSshCommPolResourceModel describes the resource data model for the children without relation ships. +type TagTagCommSshCommPolResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagTagCommSshCommPolResourceModel() TagTagCommSshCommPolResourceModel { + return TagTagCommSshCommPolResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagTagCommSshCommPolType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + +// CommTelnetCommPolResourceModel describes the resource data model for the children without relation ships. +type CommTelnetCommPolResourceModel struct { + AdminSt types.String `tfsdk:"admin_state"` + Annotation types.String `tfsdk:"annotation"` + Descr types.String `tfsdk:"description"` + Name types.String `tfsdk:"name"` + NameAlias types.String `tfsdk:"name_alias"` + Port types.String `tfsdk:"port"` + TagAnnotation types.Set `tfsdk:"annotations"` + TagTag types.Set `tfsdk:"tags"` +} + +func getEmptyCommTelnetCommPolResourceModel() CommTelnetCommPolResourceModel { + return CommTelnetCommPolResourceModel{ + AdminSt: basetypes.NewStringNull(), + Annotation: basetypes.NewStringNull(), + Descr: basetypes.NewStringNull(), + Name: basetypes.NewStringNull(), + NameAlias: basetypes.NewStringNull(), + Port: basetypes.NewStringNull(), + TagAnnotation: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + } +} + +var CommTelnetCommPolType = map[string]attr.Type{ + "admin_state": types.StringType, + "annotation": types.StringType, + "description": types.StringType, + "name": types.StringType, + "name_alias": types.StringType, + "port": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationCommTelnetCommPolType}, + "tags": types.SetType{ElemType: TagTagCommTelnetCommPolType}, +} + +// TagAnnotationCommTelnetCommPolResourceModel describes the resource data model for the children without relation ships. +type TagAnnotationCommTelnetCommPolResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagAnnotationCommTelnetCommPolResourceModel() TagAnnotationCommTelnetCommPolResourceModel { + return TagAnnotationCommTelnetCommPolResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagAnnotationCommTelnetCommPolType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + +// TagTagCommTelnetCommPolResourceModel describes the resource data model for the children without relation ships. +type TagTagCommTelnetCommPolResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagTagCommTelnetCommPolResourceModel() TagTagCommTelnetCommPolResourceModel { + return TagTagCommTelnetCommPolResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagTagCommTelnetCommPolType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + +// TagAnnotationCommPolResourceModel describes the resource data model for the children without relation ships. +type TagAnnotationCommPolResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagAnnotationCommPolResourceModel() TagAnnotationCommPolResourceModel { + return TagAnnotationCommPolResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagAnnotationCommPolType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + +// TagTagCommPolResourceModel describes the resource data model for the children without relation ships. +type TagTagCommPolResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagTagCommPolResourceModel() TagTagCommPolResourceModel { + return TagTagCommPolResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagTagCommPolType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + +type CommPolIdentifier struct { + Name types.String +} + +func (r *CommPolResource) ModifyPlan(ctx context.Context, req resource.ModifyPlanRequest, resp *resource.ModifyPlanResponse) { + if !req.Plan.Raw.IsNull() { + var planData, stateData, configData *CommPolResourceModel + resp.Diagnostics.Append(req.Plan.Get(ctx, &planData)...) + resp.Diagnostics.Append(req.State.Get(ctx, &stateData)...) + resp.Diagnostics.Append(req.Config.Get(ctx, &configData)...) + + if resp.Diagnostics.HasError() { + return + } + + if (planData.Id.IsUnknown() || planData.Id.IsNull()) && !planData.Name.IsUnknown() { + setCommPolId(ctx, planData) + } + + if stateData == nil && !globalAllowExistingOnCreate && !planData.Id.IsUnknown() && !planData.Id.IsNull() { + CheckDn(ctx, &resp.Diagnostics, r.client, "commPol", planData.Id.ValueString()) + if resp.Diagnostics.HasError() { + return + } + } + CommHttpsCommPol := getEmptyCommHttpsCommPolResourceModel() + CommHttpsCommPolList := make([]CommHttpsCommPolResourceModel, 0) + CommRsClientCertCACommHttpsCommPol := getEmptyCommRsClientCertCACommHttpsCommPolResourceModel() + CommRsClientCertCACommHttpsCommPolList := make([]CommRsClientCertCACommHttpsCommPolResourceModel, 0) + TagAnnotationCommRsClientCertCACommHttpsCommPol := getEmptyTagAnnotationCommRsClientCertCACommHttpsCommPolResourceModel() + TagAnnotationCommRsClientCertCACommHttpsCommPolList := make([]TagAnnotationCommRsClientCertCACommHttpsCommPolResourceModel, 0) + TagTagCommRsClientCertCACommHttpsCommPol := getEmptyTagTagCommRsClientCertCACommHttpsCommPolResourceModel() + TagTagCommRsClientCertCACommHttpsCommPolList := make([]TagTagCommRsClientCertCACommHttpsCommPolResourceModel, 0) + CommRsKeyRingCommHttpsCommPol := getEmptyCommRsKeyRingCommHttpsCommPolResourceModel() + CommRsKeyRingCommHttpsCommPolList := make([]CommRsKeyRingCommHttpsCommPolResourceModel, 0) + TagAnnotationCommRsKeyRingCommHttpsCommPol := getEmptyTagAnnotationCommRsKeyRingCommHttpsCommPolResourceModel() + TagAnnotationCommRsKeyRingCommHttpsCommPolList := make([]TagAnnotationCommRsKeyRingCommHttpsCommPolResourceModel, 0) + TagTagCommRsKeyRingCommHttpsCommPol := getEmptyTagTagCommRsKeyRingCommHttpsCommPolResourceModel() + TagTagCommRsKeyRingCommHttpsCommPolList := make([]TagTagCommRsKeyRingCommHttpsCommPolResourceModel, 0) + TagAnnotationCommHttpsCommPol := getEmptyTagAnnotationCommHttpsCommPolResourceModel() + TagAnnotationCommHttpsCommPolList := make([]TagAnnotationCommHttpsCommPolResourceModel, 0) + TagTagCommHttpsCommPol := getEmptyTagTagCommHttpsCommPolResourceModel() + TagTagCommHttpsCommPolList := make([]TagTagCommHttpsCommPolResourceModel, 0) + var CommHttpsConfigData CommHttpsCommPolResourceModel + configData.CommHttps.As(ctx, &CommHttpsConfigData, basetypes.ObjectAsOptions{}) + var commRsClientCertCACommHttpsCommPolConfigData CommRsClientCertCACommHttpsCommPolResourceModel + if !CommHttpsConfigData.CommRsClientCertCA.IsNull() && stateData != nil { + CommHttpsConfigData.CommRsClientCertCA.As(ctx, &commRsClientCertCACommHttpsCommPolConfigData, basetypes.ObjectAsOptions{}) + if IsEmptySingleNestedAttribute(CommHttpsConfigData.CommRsClientCertCA.Attributes()) { + CommRsClientCertCACommHttpsCommPolObject, _ := types.ObjectValueFrom(ctx, CommRsClientCertCACommHttpsCommPolType, getEmptyCommRsClientCertCACommHttpsCommPolResourceModel()) + CommHttpsCommPol.CommRsClientCertCA = CommRsClientCertCACommHttpsCommPolObject + } else { + CommRsClientCertCACommHttpsCommPolObject, _ := types.ObjectValueFrom(ctx, CommRsClientCertCACommHttpsCommPolType, commRsClientCertCACommHttpsCommPolConfigData) + CommHttpsCommPol.CommRsClientCertCA = CommRsClientCertCACommHttpsCommPolObject + } + } + var tagAnnotationCommRsClientCertCACommHttpsCommPolConfigData []TagAnnotationCommRsClientCertCACommHttpsCommPolResourceModel + if !commRsClientCertCACommHttpsCommPolConfigData.TagAnnotation.IsNull() && stateData != nil { + commRsClientCertCACommHttpsCommPolConfigData.TagAnnotation.ElementsAs(ctx, &tagAnnotationCommRsClientCertCACommHttpsCommPolConfigData, false) + TagAnnotationCommRsClientCertCACommHttpsCommPolSet, _ := types.SetValueFrom(ctx, TagAnnotationCommRsClientCertCACommHttpsCommPolType, tagAnnotationCommRsClientCertCACommHttpsCommPolConfigData) + CommRsClientCertCACommHttpsCommPol.TagAnnotation = TagAnnotationCommRsClientCertCACommHttpsCommPolSet + } + TagAnnotationCommRsClientCertCACommHttpsCommPolList = append(TagAnnotationCommRsClientCertCACommHttpsCommPolList, TagAnnotationCommRsClientCertCACommHttpsCommPol) + var tagTagCommRsClientCertCACommHttpsCommPolConfigData []TagTagCommRsClientCertCACommHttpsCommPolResourceModel + if !commRsClientCertCACommHttpsCommPolConfigData.TagTag.IsNull() && stateData != nil { + commRsClientCertCACommHttpsCommPolConfigData.TagTag.ElementsAs(ctx, &tagTagCommRsClientCertCACommHttpsCommPolConfigData, false) + TagTagCommRsClientCertCACommHttpsCommPolSet, _ := types.SetValueFrom(ctx, TagTagCommRsClientCertCACommHttpsCommPolType, tagTagCommRsClientCertCACommHttpsCommPolConfigData) + CommRsClientCertCACommHttpsCommPol.TagTag = TagTagCommRsClientCertCACommHttpsCommPolSet + } + TagTagCommRsClientCertCACommHttpsCommPolList = append(TagTagCommRsClientCertCACommHttpsCommPolList, TagTagCommRsClientCertCACommHttpsCommPol) + CommRsClientCertCACommHttpsCommPolList = append(CommRsClientCertCACommHttpsCommPolList, CommRsClientCertCACommHttpsCommPol) + var commRsKeyRingCommHttpsCommPolConfigData CommRsKeyRingCommHttpsCommPolResourceModel + if !CommHttpsConfigData.CommRsKeyRing.IsNull() && stateData != nil { + CommHttpsConfigData.CommRsKeyRing.As(ctx, &commRsKeyRingCommHttpsCommPolConfigData, basetypes.ObjectAsOptions{}) + if IsEmptySingleNestedAttribute(CommHttpsConfigData.CommRsKeyRing.Attributes()) { + CommRsKeyRingCommHttpsCommPolObject, _ := types.ObjectValueFrom(ctx, CommRsKeyRingCommHttpsCommPolType, getEmptyCommRsKeyRingCommHttpsCommPolResourceModel()) + CommHttpsCommPol.CommRsKeyRing = CommRsKeyRingCommHttpsCommPolObject + } else { + CommRsKeyRingCommHttpsCommPolObject, _ := types.ObjectValueFrom(ctx, CommRsKeyRingCommHttpsCommPolType, commRsKeyRingCommHttpsCommPolConfigData) + CommHttpsCommPol.CommRsKeyRing = CommRsKeyRingCommHttpsCommPolObject + } + } + var tagAnnotationCommRsKeyRingCommHttpsCommPolConfigData []TagAnnotationCommRsKeyRingCommHttpsCommPolResourceModel + if !commRsKeyRingCommHttpsCommPolConfigData.TagAnnotation.IsNull() && stateData != nil { + commRsKeyRingCommHttpsCommPolConfigData.TagAnnotation.ElementsAs(ctx, &tagAnnotationCommRsKeyRingCommHttpsCommPolConfigData, false) + TagAnnotationCommRsKeyRingCommHttpsCommPolSet, _ := types.SetValueFrom(ctx, TagAnnotationCommRsKeyRingCommHttpsCommPolType, tagAnnotationCommRsKeyRingCommHttpsCommPolConfigData) + CommRsKeyRingCommHttpsCommPol.TagAnnotation = TagAnnotationCommRsKeyRingCommHttpsCommPolSet + } + TagAnnotationCommRsKeyRingCommHttpsCommPolList = append(TagAnnotationCommRsKeyRingCommHttpsCommPolList, TagAnnotationCommRsKeyRingCommHttpsCommPol) + var tagTagCommRsKeyRingCommHttpsCommPolConfigData []TagTagCommRsKeyRingCommHttpsCommPolResourceModel + if !commRsKeyRingCommHttpsCommPolConfigData.TagTag.IsNull() && stateData != nil { + commRsKeyRingCommHttpsCommPolConfigData.TagTag.ElementsAs(ctx, &tagTagCommRsKeyRingCommHttpsCommPolConfigData, false) + TagTagCommRsKeyRingCommHttpsCommPolSet, _ := types.SetValueFrom(ctx, TagTagCommRsKeyRingCommHttpsCommPolType, tagTagCommRsKeyRingCommHttpsCommPolConfigData) + CommRsKeyRingCommHttpsCommPol.TagTag = TagTagCommRsKeyRingCommHttpsCommPolSet + } + TagTagCommRsKeyRingCommHttpsCommPolList = append(TagTagCommRsKeyRingCommHttpsCommPolList, TagTagCommRsKeyRingCommHttpsCommPol) + CommRsKeyRingCommHttpsCommPolList = append(CommRsKeyRingCommHttpsCommPolList, CommRsKeyRingCommHttpsCommPol) + var tagAnnotationCommHttpsCommPolConfigData []TagAnnotationCommHttpsCommPolResourceModel + if !CommHttpsConfigData.TagAnnotation.IsNull() && stateData != nil { + CommHttpsConfigData.TagAnnotation.ElementsAs(ctx, &tagAnnotationCommHttpsCommPolConfigData, false) + TagAnnotationCommHttpsCommPolSet, _ := types.SetValueFrom(ctx, TagAnnotationCommHttpsCommPolType, tagAnnotationCommHttpsCommPolConfigData) + CommHttpsCommPol.TagAnnotation = TagAnnotationCommHttpsCommPolSet + } + TagAnnotationCommHttpsCommPolList = append(TagAnnotationCommHttpsCommPolList, TagAnnotationCommHttpsCommPol) + var tagTagCommHttpsCommPolConfigData []TagTagCommHttpsCommPolResourceModel + if !CommHttpsConfigData.TagTag.IsNull() && stateData != nil { + CommHttpsConfigData.TagTag.ElementsAs(ctx, &tagTagCommHttpsCommPolConfigData, false) + TagTagCommHttpsCommPolSet, _ := types.SetValueFrom(ctx, TagTagCommHttpsCommPolType, tagTagCommHttpsCommPolConfigData) + CommHttpsCommPol.TagTag = TagTagCommHttpsCommPolSet + } + TagTagCommHttpsCommPolList = append(TagTagCommHttpsCommPolList, TagTagCommHttpsCommPol) + if !configData.CommHttp.IsNull() && stateData != nil { + if IsEmptySingleNestedAttribute(configData.CommHttp.Attributes()) { + CommHttpObject, _ := types.ObjectValueFrom(ctx, CommHttpCommPolType, getEmptyCommHttpCommPolResourceModel()) + planData.CommHttp = CommHttpObject + } + } + if !configData.CommHttps.IsNull() && stateData != nil { + if IsEmptySingleNestedAttribute(configData.CommHttps.Attributes()) { + CommHttpsObject, _ := types.ObjectValueFrom(ctx, CommHttpsCommPolType, getEmptyCommHttpsCommPolResourceModel()) + planData.CommHttps = CommHttpsObject + } else { + CommHttpsCommPol.AccessControlAllowCredential = CommHttpsConfigData.AccessControlAllowCredential + CommHttpsCommPol.AccessControlAllowOrigins = CommHttpsConfigData.AccessControlAllowOrigins + CommHttpsCommPol.AdminSt = CommHttpsConfigData.AdminSt + CommHttpsCommPol.Annotation = CommHttpsConfigData.Annotation + CommHttpsCommPol.CliOnlyMode = CommHttpsConfigData.CliOnlyMode + CommHttpsCommPol.ClientCertAuthState = CommHttpsConfigData.ClientCertAuthState + CommHttpsCommPol.Descr = CommHttpsConfigData.Descr + CommHttpsCommPol.DhParam = CommHttpsConfigData.DhParam + CommHttpsCommPol.GlobalThrottleRate = CommHttpsConfigData.GlobalThrottleRate + CommHttpsCommPol.GlobalThrottleSt = CommHttpsConfigData.GlobalThrottleSt + CommHttpsCommPol.GlobalThrottleUnit = CommHttpsConfigData.GlobalThrottleUnit + CommHttpsCommPol.MaxRequestStatusCount = CommHttpsConfigData.MaxRequestStatusCount + CommHttpsCommPol.Name = CommHttpsConfigData.Name + CommHttpsCommPol.NameAlias = CommHttpsConfigData.NameAlias + CommHttpsCommPol.NodeExporter = CommHttpsConfigData.NodeExporter + CommHttpsCommPol.Port = CommHttpsConfigData.Port + CommHttpsCommPol.Referer = CommHttpsConfigData.Referer + CommHttpsCommPol.ServerHeader = CommHttpsConfigData.ServerHeader + CommHttpsCommPol.SslProtocols = CommHttpsConfigData.SslProtocols + CommHttpsCommPol.ThrottleRate = CommHttpsConfigData.ThrottleRate + CommHttpsCommPol.ThrottleSt = CommHttpsConfigData.ThrottleSt + CommHttpsCommPol.VisoreAccess = CommHttpsConfigData.VisoreAccess + CommHttpsCommPolList = append(CommHttpsCommPolList, CommHttpsCommPol) + CommHttpsObject, _ := types.ObjectValueFrom(ctx, CommHttpsCommPolType, CommHttpsCommPolList[0]) + planData.CommHttps = CommHttpsObject + } + } + if !configData.CommShellinabox.IsNull() && stateData != nil { + if IsEmptySingleNestedAttribute(configData.CommShellinabox.Attributes()) { + CommShellinaboxObject, _ := types.ObjectValueFrom(ctx, CommShellinaboxCommPolType, getEmptyCommShellinaboxCommPolResourceModel()) + planData.CommShellinabox = CommShellinaboxObject + } + } + if !configData.CommSsh.IsNull() && stateData != nil { + if IsEmptySingleNestedAttribute(configData.CommSsh.Attributes()) { + CommSshObject, _ := types.ObjectValueFrom(ctx, CommSshCommPolType, getEmptyCommSshCommPolResourceModel()) + planData.CommSsh = CommSshObject + } + } + if !configData.CommTelnet.IsNull() && stateData != nil { + if IsEmptySingleNestedAttribute(configData.CommTelnet.Attributes()) { + CommTelnetObject, _ := types.ObjectValueFrom(ctx, CommTelnetCommPolType, getEmptyCommTelnetCommPolResourceModel()) + planData.CommTelnet = CommTelnetObject + } + } + + resp.Diagnostics.Append(resp.Plan.Set(ctx, &planData)...) + } +} + +func (r *CommPolResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { + tflog.Debug(ctx, "Start metadata of resource: aci_management_access_policy") + resp.TypeName = req.ProviderTypeName + "_management_access_policy" + tflog.Debug(ctx, "End metadata of resource: aci_management_access_policy") +} + +func (r *CommPolResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { + tflog.Debug(ctx, "Start schema of resource: aci_management_access_policy") + resp.Schema = schema.Schema{ + // This description is used by the documentation generator and the language server. + MarkdownDescription: "The management_access_policy resource for the 'commPol' class", + + Attributes: map[string]schema.Attribute{ + "id": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "The distinguished name (DN) of the Management Access Policy object.", + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + }, + "annotation": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + SetToStringNullWhenStateIsNullPlanIsUnknownDuringUpdate(), + }, + Default: stringdefault.StaticString(globalAnnotation), + MarkdownDescription: `The annotation of the Management Access Policy object.`, + }, + "description": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + SetToStringNullWhenStateIsNullPlanIsUnknownDuringUpdate(), + }, + MarkdownDescription: `The description of the Management Access Policy object.`, + }, + "name": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + SetToStringNullWhenStateIsNullPlanIsUnknownDuringUpdate(), + stringplanmodifier.RequiresReplace(), + }, + MarkdownDescription: `The name of the Management Access Policy object.`, + }, + "name_alias": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + SetToStringNullWhenStateIsNullPlanIsUnknownDuringUpdate(), + }, + MarkdownDescription: `The name alias of the Management Access Policy object.`, + }, + "owner_key": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + SetToStringNullWhenStateIsNullPlanIsUnknownDuringUpdate(), + }, + MarkdownDescription: `The key for enabling clients to own their data for entity correlation.`, + }, + "owner_tag": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + SetToStringNullWhenStateIsNullPlanIsUnknownDuringUpdate(), + }, + MarkdownDescription: `A tag for enabling clients to add their own data. For example, to indicate who created this object.`, + }, + "strict_security_on_apic_oob_subnet": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + SetToStringNullWhenStateIsNullPlanIsUnknownDuringUpdate(), + }, + Validators: []validator.String{ + stringvalidator.OneOf("no", "yes"), + }, + MarkdownDescription: `Removes implicit access permissions from any APIC out-of-band (OOB) subnet IP address.`, + }, + "http_service": schema.SingleNestedAttribute{ + MarkdownDescription: `HTTP`, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Object{ + objectplanmodifier.UseStateForUnknown(), + }, + Attributes: map[string]schema.Attribute{ + "access_control_allow_credential": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + stringvalidator.OneOf("disabled", "enabled"), + }, + MarkdownDescription: `Determines if credentials are allowed in HTTP (Hypertext Transfer Protocol) responses.`, + }, + "access_control_allow_origins": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `Determines which origins can access the resource. For example, inputting http://127.0.0.1:8000 would allow access from a source device with that IP address and port.`, + }, + "admin_state": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + stringvalidator.OneOf("disabled", "enabled"), + }, + MarkdownDescription: `The administrative state of the HTTP (Hypertext Transfer Protocol) Service.`, + }, + "annotation": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The annotation of the HTTP (Hypertext Transfer Protocol) Service object.`, + }, + "cli_only_mode": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + stringvalidator.OneOf("disabled", "enabled"), + }, + MarkdownDescription: `Determines if CLI-only mode is enabled.`, + }, + "description": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The description of the HTTP (Hypertext Transfer Protocol) Service object.`, + }, + "global_throttle_rate": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `Maximum API calls allowed per unit time.`, + }, + "global_throttle_state": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + stringvalidator.OneOf("disabled", "enabled"), + }, + MarkdownDescription: `The throttle state for all clients without specific identifier in their headers.`, + }, + "global_throttle_unit": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The unit of measurement for rate limiting.`, + }, + "max_request_status_count": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The maximum number of request status objects to keep.`, + }, + "name": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The name of the HTTP (Hypertext Transfer Protocol) Service object.`, + }, + "name_alias": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The name alias of the HTTP (Hypertext Transfer Protocol) Service object.`, + }, + "node_exporter": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + stringvalidator.OneOf("disabled", "enabled"), + }, + MarkdownDescription: `Node Exporter service status.`, + }, + "port": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The port used for HTTP communication service.`, + }, + "redirect_state": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + stringvalidator.OneOf("disabled", "enabled", "tested"), + }, + MarkdownDescription: `The state of HTTP (Hypertext Transfer Protocol) communication service.`, + }, + "server_header": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + stringvalidator.OneOf("disabled", "enabled"), + }, + MarkdownDescription: `Determines if the server header is included in responses.`, + }, + "throttle_rate": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The maximum login/refresh allowed per second.`, + }, + "throttle_state": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + stringvalidator.OneOf("disabled", "enabled"), + }, + MarkdownDescription: `The state of login and refresh throttling.`, + }, + "visore_access": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + stringvalidator.OneOf("disabled", "enabled"), + }, + MarkdownDescription: `Grants permissions for accessing the Visore tool in Cisco ACI.`, + }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + }, + }, + "http_ssl_configuration": schema.SingleNestedAttribute{ + MarkdownDescription: `HTTPS`, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Object{ + objectplanmodifier.UseStateForUnknown(), + }, + Attributes: map[string]schema.Attribute{ + "access_control_allow_credential": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + stringvalidator.OneOf("disabled", "enabled"), + }, + MarkdownDescription: `Determines if credentials are allowed in HTTP (Hypertext Transfer Protocol) SSL (Secure Sockets Layer) responses.`, + }, + "access_control_allow_origins": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `Determines which origins can access the resource. For example, inputting http://127.0.0.1:8000 would allow access from a source device with that IP address and port.`, + }, + "admin_state": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + stringvalidator.OneOf("enabled"), + }, + MarkdownDescription: `The administrative state of the HTTP (Hypertext Transfer Protocol) SSL (Secure Sockets Layer) Service.`, + }, + "annotation": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The annotation of the HTTP (Hypertext Transfer Protocol) SSL (Secure Sockets Layer) Configuration object.`, + }, + "cli_only_mode": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + stringvalidator.OneOf("disabled", "enabled"), + }, + MarkdownDescription: `Determines if CLI-only mode is enabled.`, + }, + "client_cert_auth_state": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + stringvalidator.OneOf("disabled", "enabled"), + }, + MarkdownDescription: `State of client certificate authentication.`, + }, + "description": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The description of the HTTP (Hypertext Transfer Protocol) SSL (Secure Sockets Layer) Configuration object.`, + }, + "dh_param": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + stringvalidator.OneOf("1024", "2048", "4096", "none"), + }, + MarkdownDescription: `Determines the settings for DH (Diffie-Hellman) parameters.`, + }, + "global_throttle_rate": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `Maximum API calls allowed per unit time.`, + }, + "global_throttle_state": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + stringvalidator.OneOf("disabled", "enabled"), + }, + MarkdownDescription: `The throttle state for all clients without specific identifier in their headers.`, + }, + "global_throttle_unit": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The unit of measurement for rate limiting.`, + }, + "max_request_status_count": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The maximum number of request status objects to keep.`, + }, + "name": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The name of the HTTP (Hypertext Transfer Protocol) SSL (Secure Sockets Layer) Configuration object.`, + }, + "name_alias": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The name alias of the HTTP (Hypertext Transfer Protocol) SSL (Secure Sockets Layer) Configuration object.`, + }, + "node_exporter": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + stringvalidator.OneOf("disabled", "enabled"), + }, + MarkdownDescription: `Node Exporter service status.`, + }, + "port": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The port used for HTTPS communication service.`, + }, + "referer": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `Allowed HTTP referers.`, + }, + "server_header": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + stringvalidator.OneOf("disabled", "enabled"), + }, + MarkdownDescription: `Determines if the server header is included in responses.`, + }, + "ssl_protocols": schema.SetAttribute{ + MarkdownDescription: `The Secure Socket Layer (SSL) protocol.`, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.Set{ + setvalidator.SizeAtMost(4), + setvalidator.ValueStringsAre( + stringvalidator.OneOf("TLSv1", "TLSv1.1", "TLSv1.2", "TLSv1.3"), + ), + }, + ElementType: types.StringType, + }, + "throttle_rate": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The maximum login/refresh allowed per second.`, + }, + "throttle_state": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + stringvalidator.OneOf("disabled", "enabled"), + }, + MarkdownDescription: `The state of login and refresh throttling.`, + }, + "visore_access": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + stringvalidator.OneOf("disabled", "enabled"), + }, + MarkdownDescription: `Grants permissions for accessing the Visore tool in Cisco ACI.`, + }, + "certificate_authority": schema.SingleNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Object{ + objectplanmodifier.UseStateForUnknown(), + }, + Attributes: map[string]schema.Attribute{ + "annotation": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The annotation of the Certificate Authority object.`, + }, + "target_dn": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The distinguished name of the target.`, + }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + }, + }, + "key_ring": schema.SingleNestedAttribute{ + MarkdownDescription: `A source relation to a key ring.`, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Object{ + objectplanmodifier.UseStateForUnknown(), + }, + Attributes: map[string]schema.Attribute{ + "annotation": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The annotation of the Key Ring object.`, + }, + "key_ring_name": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The HTTP connection key ring. Each PKI device holds a pair of asymmetric Rivest-Shamir-Adleman (RSA) or Elliptic Curve Cryptography (ECC) encryption keys, one kept private and one made public, stored in an internal key ring.`, + }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + }, + }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + }, + }, + "ssh_access_via_web": schema.SingleNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Object{ + objectplanmodifier.UseStateForUnknown(), + }, + Attributes: map[string]schema.Attribute{ + "admin_state": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + stringvalidator.OneOf("disabled", "enabled"), + }, + MarkdownDescription: `The administrative state of the SSH (Secure Shell) access via WEB object.`, + }, + "annotation": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The annotation of the SSH (Secure Shell) access via WEB object.`, + }, + "description": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The description of the SSH (Secure Shell) access via WEB object.`, + }, + "name": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The name of the SSH (Secure Shell) access via WEB object.`, + }, + "name_alias": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The name alias of the SSH (Secure Shell) access via WEB object.`, + }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + }, + }, + "ssh_service": schema.SingleNestedAttribute{ + MarkdownDescription: `Object that encompasses properties related to Secure Shell access to the APIC, namely admin-state (default=enabled) and port(default=22).`, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Object{ + objectplanmodifier.UseStateForUnknown(), + }, + Attributes: map[string]schema.Attribute{ + "admin_state": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + stringvalidator.OneOf("disabled", "enabled"), + }, + MarkdownDescription: `The administrative state of the SSH (Secure Shell) Service object.`, + }, + "annotation": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The annotation of the SSH (Secure Shell) Service object.`, + }, + "description": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The description of the SSH (Secure Shell) Service object.`, + }, + "host_key_algorithms": schema.SetAttribute{ + MarkdownDescription: `The supported algorithms for the host key.`, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.Set{ + setvalidator.SizeAtMost(3), + setvalidator.ValueStringsAre( + stringvalidator.OneOf("rsa-sha2-256", "rsa-sha2-512", "ssh-ed25519"), + ), + }, + ElementType: types.StringType, + }, + "key_exchange_algorithms": schema.SetAttribute{ + MarkdownDescription: `The supported algorithms for key exchange.`, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.Set{ + setvalidator.SizeAtMost(9), + setvalidator.ValueStringsAre( + stringvalidator.OneOf("curve25519-sha256", "curve25519-sha256@libssh.org", "diffie-hellman-group1-sha1", "diffie-hellman-group14-sha1", "diffie-hellman-group14-sha256", "diffie-hellman-group16-sha512", "ecdh-sha2-nistp256", "ecdh-sha2-nistp384", "ecdh-sha2-nistp521"), + ), + }, + ElementType: types.StringType, + }, + "name": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The name of the SSH (Secure Shell) Service object.`, + }, + "name_alias": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The name alias of the SSH (Secure Shell) Service object.`, + }, + "password_auth": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + stringvalidator.OneOf("disabled", "enabled"), + }, + MarkdownDescription: `State of password authentication.`, + }, + "port": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The SSH port.`, + }, + "ssh_ciphers": schema.SetAttribute{ + MarkdownDescription: `Ciphers supported for SSH.`, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.Set{ + setvalidator.SizeAtMost(6), + setvalidator.ValueStringsAre( + stringvalidator.OneOf("aes128-ctr", "aes128-gcm@openssh.com", "aes192-ctr", "aes256-ctr", "aes256-gcm@openssh.com", "chacha20-poly1305@openssh.com"), + ), + }, + ElementType: types.StringType, + }, + "ssh_macs": schema.SetAttribute{ + MarkdownDescription: `Message authentication codes (MACs) supported for SSH.`, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.Set{ + setvalidator.SizeAtMost(5), + setvalidator.ValueStringsAre( + stringvalidator.OneOf("hmac-sha1", "hmac-sha2-256", "hmac-sha2-256-etm@openssh.com", "hmac-sha2-512", "hmac-sha2-512-etm@openssh.com"), + ), + }, + ElementType: types.StringType, + }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + }, + }, + "telnet_service": schema.SingleNestedAttribute{ + MarkdownDescription: `Telnet`, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Object{ + objectplanmodifier.UseStateForUnknown(), + }, + Attributes: map[string]schema.Attribute{ + "admin_state": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.String{ + stringvalidator.OneOf("disabled", "enabled"), + }, + MarkdownDescription: `The administrative state of the Telnet Service object.`, + }, + "annotation": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The annotation of the Telnet Service object.`, + }, + "description": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The description of the Telnet Service object.`, + }, + "name": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The name of the Telnet Service object.`, + }, + "name_alias": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The name alias of the Telnet Service object.`, + }, + "port": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The port used for Telnet communication service.`, + }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + }, + }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + }, + } + tflog.Debug(ctx, "End schema of resource: aci_management_access_policy") +} + +func (r *CommPolResource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse) { + tflog.Debug(ctx, "Start configure of resource: aci_management_access_policy") + // Prevent panic if the provider has not been configured. + if req.ProviderData == nil { + return + } + + client, ok := req.ProviderData.(*client.Client) + + if !ok { + resp.Diagnostics.AddError( + "Unexpected Resource Configure Type", + fmt.Sprintf("Expected *client.Client, got: %T. Please report this issue to the provider developers.", req.ProviderData), + ) + + return + } + + r.client = client + tflog.Debug(ctx, "End configure of resource: aci_management_access_policy") +} + +func (r *CommPolResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { + tflog.Debug(ctx, "Start create of resource: aci_management_access_policy") + // On create retrieve information on current state prior to making any changes in order to determine child delete operations + var stateData *CommPolResourceModel + resp.Diagnostics.Append(req.Plan.Get(ctx, &stateData)...) + if stateData.Id.IsUnknown() || stateData.Id.IsNull() { + setCommPolId(ctx, stateData) + } + getAndSetCommPolAttributes(ctx, &resp.Diagnostics, r.client, stateData) + if !globalAllowExistingOnCreate && !stateData.Id.IsNull() { + resp.Diagnostics.AddError( + "Object Already Exists", + fmt.Sprintf("The commPol object with DN '%s' already exists.", stateData.Id.ValueString()), + ) + return + } + + var data *CommPolResourceModel + + // Read Terraform plan data into the model + resp.Diagnostics.Append(req.Plan.Get(ctx, &data)...) + + if resp.Diagnostics.HasError() { + return + } + + if data.Id.IsUnknown() || data.Id.IsNull() { + setCommPolId(ctx, data) + } + + tflog.Debug(ctx, fmt.Sprintf("Create of resource aci_management_access_policy with id '%s'", data.Id.ValueString())) + + var commHttpPlan, commHttpState CommHttpCommPolResourceModel + data.CommHttp.As(ctx, &commHttpPlan, basetypes.ObjectAsOptions{}) + stateData.CommHttp.As(ctx, &commHttpState, basetypes.ObjectAsOptions{}) + var commHttpsPlan, commHttpsState CommHttpsCommPolResourceModel + data.CommHttps.As(ctx, &commHttpsPlan, basetypes.ObjectAsOptions{}) + stateData.CommHttps.As(ctx, &commHttpsState, basetypes.ObjectAsOptions{}) + var commShellinaboxPlan, commShellinaboxState CommShellinaboxCommPolResourceModel + data.CommShellinabox.As(ctx, &commShellinaboxPlan, basetypes.ObjectAsOptions{}) + stateData.CommShellinabox.As(ctx, &commShellinaboxState, basetypes.ObjectAsOptions{}) + var commSshPlan, commSshState CommSshCommPolResourceModel + data.CommSsh.As(ctx, &commSshPlan, basetypes.ObjectAsOptions{}) + stateData.CommSsh.As(ctx, &commSshState, basetypes.ObjectAsOptions{}) + var commTelnetPlan, commTelnetState CommTelnetCommPolResourceModel + data.CommTelnet.As(ctx, &commTelnetPlan, basetypes.ObjectAsOptions{}) + stateData.CommTelnet.As(ctx, &commTelnetState, basetypes.ObjectAsOptions{}) + var tagAnnotationPlan, tagAnnotationState []TagAnnotationCommPolResourceModel + data.TagAnnotation.ElementsAs(ctx, &tagAnnotationPlan, false) + stateData.TagAnnotation.ElementsAs(ctx, &tagAnnotationState, false) + var tagTagPlan, tagTagState []TagTagCommPolResourceModel + data.TagTag.ElementsAs(ctx, &tagTagPlan, false) + stateData.TagTag.ElementsAs(ctx, &tagTagState, false) + jsonPayload := getCommPolCreateJsonPayload(ctx, &resp.Diagnostics, true, data, commHttpPlan, commHttpState, commHttpsPlan, commHttpsState, commShellinaboxPlan, commShellinaboxState, commSshPlan, commSshState, commTelnetPlan, commTelnetState, tagAnnotationPlan, tagAnnotationState, tagTagPlan, tagTagState) + + if resp.Diagnostics.HasError() { + return + } + + DoRestRequest(ctx, &resp.Diagnostics, r.client, fmt.Sprintf("api/mo/%s.json", data.Id.ValueString()), "POST", jsonPayload) + + if resp.Diagnostics.HasError() { + return + } + + getAndSetCommPolAttributes(ctx, &resp.Diagnostics, r.client, data) + + // Save data into Terraform state + resp.Diagnostics.Append(resp.State.Set(ctx, &data)...) + tflog.Debug(ctx, fmt.Sprintf("End create of resource aci_management_access_policy with id '%s'", data.Id.ValueString())) +} + +func (r *CommPolResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { + tflog.Debug(ctx, "Start read of resource: aci_management_access_policy") + var data *CommPolResourceModel + + // Read Terraform prior state data into the model + resp.Diagnostics.Append(req.State.Get(ctx, &data)...) + + if resp.Diagnostics.HasError() { + return + } + + tflog.Debug(ctx, fmt.Sprintf("Read of resource aci_management_access_policy with id '%s'", data.Id.ValueString())) + + getAndSetCommPolAttributes(ctx, &resp.Diagnostics, r.client, data) + + // Save updated data into Terraform state + if data.Id.IsNull() { + var emptyData *CommPolResourceModel + resp.Diagnostics.Append(resp.State.Set(ctx, &emptyData)...) + } else { + resp.Diagnostics.Append(resp.State.Set(ctx, &data)...) + } + + tflog.Debug(ctx, fmt.Sprintf("End read of resource aci_management_access_policy with id '%s'", data.Id.ValueString())) +} + +func (r *CommPolResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { + tflog.Debug(ctx, "Start update of resource: aci_management_access_policy") + var data *CommPolResourceModel + var stateData *CommPolResourceModel + + // Read Terraform plan data into the model + resp.Diagnostics.Append(req.Plan.Get(ctx, &data)...) + resp.Diagnostics.Append(req.State.Get(ctx, &stateData)...) + // Error out when child object commHttp is being deleted + if IsEmptySingleNestedAttribute(data.CommHttp.Attributes()) && !IsEmptySingleNestedAttribute(stateData.CommHttp.Attributes()) { + resp.Diagnostics.AddError( + "CommHttp object cannot be deleted", + "deletion of child is only possible upon deletion of the parent", + ) + } + // Error out when child object commHttps is being deleted + if IsEmptySingleNestedAttribute(data.CommHttps.Attributes()) && !IsEmptySingleNestedAttribute(stateData.CommHttps.Attributes()) { + resp.Diagnostics.AddError( + "CommHttps object cannot be deleted", + "deletion of child is only possible upon deletion of the parent", + ) + } + var CommHttpsData CommHttpsCommPolResourceModel + var CommHttpsStateData CommHttpsCommPolResourceModel + data.CommHttps.As(ctx, &CommHttpsData, basetypes.ObjectAsOptions{}) + stateData.CommHttps.As(ctx, &CommHttpsStateData, basetypes.ObjectAsOptions{}) + var commRsKeyRingCommHttpsCommPolData CommRsKeyRingCommHttpsCommPolResourceModel + var commRsKeyRingCommHttpsCommPolStateData CommRsKeyRingCommHttpsCommPolResourceModel + CommHttpsData.CommRsKeyRing.As(ctx, &commRsKeyRingCommHttpsCommPolData, basetypes.ObjectAsOptions{}) + CommHttpsStateData.CommRsKeyRing.As(ctx, &commRsKeyRingCommHttpsCommPolStateData, basetypes.ObjectAsOptions{}) + if IsEmptySingleNestedAttribute(CommHttpsData.CommRsKeyRing.Attributes()) && !IsEmptySingleNestedAttribute(CommHttpsStateData.CommRsKeyRing.Attributes()) { + resp.Diagnostics.AddError( + "CommRsKeyRing object cannot be deleted", + "deletion of child is only possible upon deletion of the parent", + ) + } + // Error out when child object commShellinabox is being deleted + if IsEmptySingleNestedAttribute(data.CommShellinabox.Attributes()) && !IsEmptySingleNestedAttribute(stateData.CommShellinabox.Attributes()) { + resp.Diagnostics.AddError( + "CommShellinabox object cannot be deleted", + "deletion of child is only possible upon deletion of the parent", + ) + } + // Error out when child object commSsh is being deleted + if IsEmptySingleNestedAttribute(data.CommSsh.Attributes()) && !IsEmptySingleNestedAttribute(stateData.CommSsh.Attributes()) { + resp.Diagnostics.AddError( + "CommSsh object cannot be deleted", + "deletion of child is only possible upon deletion of the parent", + ) + } + // Error out when child object commTelnet is being deleted + if IsEmptySingleNestedAttribute(data.CommTelnet.Attributes()) && !IsEmptySingleNestedAttribute(stateData.CommTelnet.Attributes()) { + resp.Diagnostics.AddError( + "CommTelnet object cannot be deleted", + "deletion of child is only possible upon deletion of the parent", + ) + } + + if resp.Diagnostics.HasError() { + return + } + + tflog.Debug(ctx, fmt.Sprintf("Update of resource aci_management_access_policy with id '%s'", data.Id.ValueString())) + + var commHttpPlan, commHttpState CommHttpCommPolResourceModel + data.CommHttp.As(ctx, &commHttpPlan, basetypes.ObjectAsOptions{}) + stateData.CommHttp.As(ctx, &commHttpState, basetypes.ObjectAsOptions{}) + var commHttpsPlan, commHttpsState CommHttpsCommPolResourceModel + data.CommHttps.As(ctx, &commHttpsPlan, basetypes.ObjectAsOptions{}) + stateData.CommHttps.As(ctx, &commHttpsState, basetypes.ObjectAsOptions{}) + var commShellinaboxPlan, commShellinaboxState CommShellinaboxCommPolResourceModel + data.CommShellinabox.As(ctx, &commShellinaboxPlan, basetypes.ObjectAsOptions{}) + stateData.CommShellinabox.As(ctx, &commShellinaboxState, basetypes.ObjectAsOptions{}) + var commSshPlan, commSshState CommSshCommPolResourceModel + data.CommSsh.As(ctx, &commSshPlan, basetypes.ObjectAsOptions{}) + stateData.CommSsh.As(ctx, &commSshState, basetypes.ObjectAsOptions{}) + var commTelnetPlan, commTelnetState CommTelnetCommPolResourceModel + data.CommTelnet.As(ctx, &commTelnetPlan, basetypes.ObjectAsOptions{}) + stateData.CommTelnet.As(ctx, &commTelnetState, basetypes.ObjectAsOptions{}) + var tagAnnotationPlan, tagAnnotationState []TagAnnotationCommPolResourceModel + data.TagAnnotation.ElementsAs(ctx, &tagAnnotationPlan, false) + stateData.TagAnnotation.ElementsAs(ctx, &tagAnnotationState, false) + var tagTagPlan, tagTagState []TagTagCommPolResourceModel + data.TagTag.ElementsAs(ctx, &tagTagPlan, false) + stateData.TagTag.ElementsAs(ctx, &tagTagState, false) + jsonPayload := getCommPolCreateJsonPayload(ctx, &resp.Diagnostics, false, data, commHttpPlan, commHttpState, commHttpsPlan, commHttpsState, commShellinaboxPlan, commShellinaboxState, commSshPlan, commSshState, commTelnetPlan, commTelnetState, tagAnnotationPlan, tagAnnotationState, tagTagPlan, tagTagState) + + if resp.Diagnostics.HasError() { + return + } + + DoRestRequest(ctx, &resp.Diagnostics, r.client, fmt.Sprintf("api/mo/%s.json", data.Id.ValueString()), "POST", jsonPayload) + + if resp.Diagnostics.HasError() { + return + } + + getAndSetCommPolAttributes(ctx, &resp.Diagnostics, r.client, data) + + // Save updated data into Terraform state + resp.Diagnostics.Append(resp.State.Set(ctx, &data)...) + tflog.Debug(ctx, fmt.Sprintf("End update of resource aci_management_access_policy with id '%s'", data.Id.ValueString())) +} + +func (r *CommPolResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { + tflog.Debug(ctx, "Start delete of resource: aci_management_access_policy") + var data *CommPolResourceModel + + // Read Terraform prior state data into the model + resp.Diagnostics.Append(req.State.Get(ctx, &data)...) + + if resp.Diagnostics.HasError() { + return + } + + tflog.Debug(ctx, fmt.Sprintf("Delete of resource aci_management_access_policy with id '%s'", data.Id.ValueString())) + jsonPayload := GetDeleteJsonPayload(ctx, &resp.Diagnostics, "commPol", data.Id.ValueString()) + if resp.Diagnostics.HasError() { + return + } + DoRestRequest(ctx, &resp.Diagnostics, r.client, fmt.Sprintf("api/mo/%s.json", data.Id.ValueString()), "POST", jsonPayload) + if resp.Diagnostics.HasError() { + return + } + tflog.Debug(ctx, fmt.Sprintf("End delete of resource aci_management_access_policy with id '%s'", data.Id.ValueString())) +} + +func (r *CommPolResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { + tflog.Debug(ctx, "Start import state of resource: aci_management_access_policy") + resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + var stateData *CommPolResourceModel + resp.Diagnostics.Append(resp.State.Get(ctx, &stateData)...) + tflog.Debug(ctx, fmt.Sprintf("Import state of resource aci_management_access_policy with id '%s'", stateData.Id.ValueString())) + + tflog.Debug(ctx, "End import of state resource: aci_management_access_policy") +} + +func getAndSetCommPolAttributes(ctx context.Context, diags *diag.Diagnostics, client *client.Client, data *CommPolResourceModel) { + requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=full&rsp-subtree-class=%s", data.Id.ValueString(), "commPol,commHttp,commHttps,commShellinabox,commSsh,commTelnet,tagAnnotation,tagTag,tagAnnotation,tagTag,commRsClientCertCA,commRsKeyRing,tagAnnotation,tagTag,tagAnnotation,tagTag,tagAnnotation,tagTag,tagAnnotation,tagTag,tagAnnotation,tagTag,tagAnnotation,tagTag"), "GET", nil) + + readData := getEmptyCommPolResourceModel() + + if diags.HasError() { + return + } + if requestData.Search("imdata").Search("commPol").Data() != nil { + classReadInfo := requestData.Search("imdata").Search("commPol").Data().([]interface{}) + if len(classReadInfo) == 1 { + attributes := classReadInfo[0].(map[string]interface{})["attributes"].(map[string]interface{}) + for attributeName, attributeValue := range attributes { + if attributeName == "dn" { + readData.Id = basetypes.NewStringValue(attributeValue.(string)) + } + if attributeName == "annotation" { + readData.Annotation = basetypes.NewStringValue(attributeValue.(string)) + } + if attributeName == "descr" { + readData.Descr = basetypes.NewStringValue(attributeValue.(string)) + } + if attributeName == "name" { + readData.Name = basetypes.NewStringValue(attributeValue.(string)) + } + if attributeName == "nameAlias" { + readData.NameAlias = basetypes.NewStringValue(attributeValue.(string)) + } + if attributeName == "ownerKey" { + readData.OwnerKey = basetypes.NewStringValue(attributeValue.(string)) + } + if attributeName == "ownerTag" { + readData.OwnerTag = basetypes.NewStringValue(attributeValue.(string)) + } + if attributeName == "strictSecurityOnApicOOBSubnet" { + readData.StrictSecurityOnApicOOBSubnet = basetypes.NewStringValue(attributeValue.(string)) + } + } + CommHttpCommPolList := make([]CommHttpCommPolResourceModel, 0) + CommHttpsCommPolList := make([]CommHttpsCommPolResourceModel, 0) + CommShellinaboxCommPolList := make([]CommShellinaboxCommPolResourceModel, 0) + CommSshCommPolList := make([]CommSshCommPolResourceModel, 0) + CommTelnetCommPolList := make([]CommTelnetCommPolResourceModel, 0) + TagAnnotationCommPolList := make([]TagAnnotationCommPolResourceModel, 0) + TagTagCommPolList := make([]TagTagCommPolResourceModel, 0) + _, ok := classReadInfo[0].(map[string]interface{})["children"] + if ok { + children := classReadInfo[0].(map[string]interface{})["children"].([]interface{}) + for _, child := range children { + for childClassName, childClassDetails := range child.(map[string]interface{}) { + childAttributes := childClassDetails.(map[string]interface{})["attributes"].(map[string]interface{}) + if childClassName == "commHttp" { + CommHttpCommPol := getEmptyCommHttpCommPolResourceModel() + for childAttributeName, childAttributeValue := range childAttributes { + if childAttributeName == "accessControlAllowCredential" { + CommHttpCommPol.AccessControlAllowCredential = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "accessControlAllowOrigins" { + CommHttpCommPol.AccessControlAllowOrigins = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "adminSt" { + CommHttpCommPol.AdminSt = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "annotation" { + CommHttpCommPol.Annotation = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "cliOnlyMode" { + CommHttpCommPol.CliOnlyMode = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "descr" { + CommHttpCommPol.Descr = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "globalThrottleRate" { + CommHttpCommPol.GlobalThrottleRate = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "globalThrottleSt" { + CommHttpCommPol.GlobalThrottleSt = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "globalThrottleUnit" { + CommHttpCommPol.GlobalThrottleUnit = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "maxRequestStatusCount" { + CommHttpCommPol.MaxRequestStatusCount = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "name" { + CommHttpCommPol.Name = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "nameAlias" { + CommHttpCommPol.NameAlias = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "nodeExporter" { + CommHttpCommPol.NodeExporter = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "port" { + CommHttpCommPol.Port = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "redirectSt" { + CommHttpCommPol.RedirectSt = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "serverHeader" { + CommHttpCommPol.ServerHeader = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "throttleRate" { + CommHttpCommPol.ThrottleRate = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "throttleSt" { + CommHttpCommPol.ThrottleSt = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "visoreAccess" { + CommHttpCommPol.VisoreAccess = basetypes.NewStringValue(childAttributeValue.(string)) + } + + } + TagAnnotationCommHttpCommPolList := make([]TagAnnotationCommHttpCommPolResourceModel, 0) + TagTagCommHttpCommPolList := make([]TagTagCommHttpCommPolResourceModel, 0) + childrenOfCommHttpCommPol, childrenOfCommHttpCommPolExist := childClassDetails.(map[string]interface{})["children"] + if childrenOfCommHttpCommPolExist { + for _, childCommHttpCommPol := range childrenOfCommHttpCommPol.([]interface{}) { + for childClassNameCommHttpCommPol, childClassDetailsCommHttpCommPol := range childCommHttpCommPol.(map[string]interface{}) { + if childClassNameCommHttpCommPol == "tagAnnotation" { + TagAnnotationCommHttpCommPol := getEmptyTagAnnotationCommHttpCommPolResourceModel() + tagAnnotationchildAttributeValue := childClassDetailsCommHttpCommPol.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagAnnotationchildAttributeValue { + if childAttributeName == "key" { + TagAnnotationCommHttpCommPol.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagAnnotationCommHttpCommPol.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagAnnotationCommHttpCommPolList = append(TagAnnotationCommHttpCommPolList, TagAnnotationCommHttpCommPol) + } + if childClassNameCommHttpCommPol == "tagTag" { + TagTagCommHttpCommPol := getEmptyTagTagCommHttpCommPolResourceModel() + tagTagchildAttributeValue := childClassDetailsCommHttpCommPol.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagTagchildAttributeValue { + if childAttributeName == "key" { + TagTagCommHttpCommPol.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagTagCommHttpCommPol.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagTagCommHttpCommPolList = append(TagTagCommHttpCommPolList, TagTagCommHttpCommPol) + } + } + } + } + TagAnnotationCommHttpCommPolSet, _ := types.SetValueFrom(ctx, TagAnnotationCommHttpCommPolType, TagAnnotationCommHttpCommPolList) + CommHttpCommPol.TagAnnotation = TagAnnotationCommHttpCommPolSet + TagTagCommHttpCommPolSet, _ := types.SetValueFrom(ctx, TagTagCommHttpCommPolType, TagTagCommHttpCommPolList) + CommHttpCommPol.TagTag = TagTagCommHttpCommPolSet + CommHttpCommPolList = append(CommHttpCommPolList, CommHttpCommPol) + } + if childClassName == "commHttps" { + CommHttpsCommPol := getEmptyCommHttpsCommPolResourceModel() + for childAttributeName, childAttributeValue := range childAttributes { + if childAttributeName == "accessControlAllowCredential" { + CommHttpsCommPol.AccessControlAllowCredential = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "accessControlAllowOrigins" { + CommHttpsCommPol.AccessControlAllowOrigins = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "adminSt" { + CommHttpsCommPol.AdminSt = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "annotation" { + CommHttpsCommPol.Annotation = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "cliOnlyMode" { + CommHttpsCommPol.CliOnlyMode = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "clientCertAuthState" { + CommHttpsCommPol.ClientCertAuthState = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "descr" { + CommHttpsCommPol.Descr = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "dhParam" && childAttributeValue.(string) == "" { + CommHttpsCommPol.DhParam = basetypes.NewStringValue("none") + } else if childAttributeName == "dhParam" { + CommHttpsCommPol.DhParam = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "globalThrottleRate" { + CommHttpsCommPol.GlobalThrottleRate = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "globalThrottleSt" { + CommHttpsCommPol.GlobalThrottleSt = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "globalThrottleUnit" { + CommHttpsCommPol.GlobalThrottleUnit = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "maxRequestStatusCount" { + CommHttpsCommPol.MaxRequestStatusCount = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "name" { + CommHttpsCommPol.Name = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "nameAlias" { + CommHttpsCommPol.NameAlias = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "nodeExporter" { + CommHttpsCommPol.NodeExporter = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "port" { + CommHttpsCommPol.Port = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "referer" { + CommHttpsCommPol.Referer = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "serverHeader" { + CommHttpsCommPol.ServerHeader = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "sslProtocols" { + sslProtocolsList := strings.Split(childAttributeValue.(string), ",") + sslProtocolsSet, _ := types.SetValueFrom(ctx, basetypes.StringType{}, sslProtocolsList) + CommHttpsCommPol.SslProtocols = sslProtocolsSet + + } + if childAttributeName == "throttleRate" { + CommHttpsCommPol.ThrottleRate = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "throttleSt" { + CommHttpsCommPol.ThrottleSt = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "visoreAccess" { + CommHttpsCommPol.VisoreAccess = basetypes.NewStringValue(childAttributeValue.(string)) + } + + } + CommRsClientCertCACommHttpsCommPolList := make([]CommRsClientCertCACommHttpsCommPolResourceModel, 0) + CommRsKeyRingCommHttpsCommPolList := make([]CommRsKeyRingCommHttpsCommPolResourceModel, 0) + TagAnnotationCommHttpsCommPolList := make([]TagAnnotationCommHttpsCommPolResourceModel, 0) + TagTagCommHttpsCommPolList := make([]TagTagCommHttpsCommPolResourceModel, 0) + childrenOfCommHttpsCommPol, childrenOfCommHttpsCommPolExist := childClassDetails.(map[string]interface{})["children"] + if childrenOfCommHttpsCommPolExist { + for _, childCommHttpsCommPol := range childrenOfCommHttpsCommPol.([]interface{}) { + for childClassNameCommHttpsCommPol, childClassDetailsCommHttpsCommPol := range childCommHttpsCommPol.(map[string]interface{}) { + if childClassNameCommHttpsCommPol == "commRsClientCertCA" { + CommRsClientCertCACommHttpsCommPol := getEmptyCommRsClientCertCACommHttpsCommPolResourceModel() + commRsClientCertCAchildAttributeValue := childClassDetailsCommHttpsCommPol.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range commRsClientCertCAchildAttributeValue { + if childAttributeName == "annotation" { + CommRsClientCertCACommHttpsCommPol.Annotation = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "tDn" { + CommRsClientCertCACommHttpsCommPol.TDn = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagAnnotationCommRsClientCertCACommHttpsCommPolList := make([]TagAnnotationCommRsClientCertCACommHttpsCommPolResourceModel, 0) + TagTagCommRsClientCertCACommHttpsCommPolList := make([]TagTagCommRsClientCertCACommHttpsCommPolResourceModel, 0) + childrenOfCommRsClientCertCACommHttpsCommPol, childrenOfCommRsClientCertCACommHttpsCommPolExist := childClassDetailsCommHttpsCommPol.(map[string]interface{})["children"] + if childrenOfCommRsClientCertCACommHttpsCommPolExist { + for _, childCommRsClientCertCACommHttpsCommPol := range childrenOfCommRsClientCertCACommHttpsCommPol.([]interface{}) { + for childClassNameCommRsClientCertCACommHttpsCommPol, childClassDetailsCommRsClientCertCACommHttpsCommPol := range childCommRsClientCertCACommHttpsCommPol.(map[string]interface{}) { + if childClassNameCommRsClientCertCACommHttpsCommPol == "tagAnnotation" { + TagAnnotationCommRsClientCertCACommHttpsCommPol := getEmptyTagAnnotationCommRsClientCertCACommHttpsCommPolResourceModel() + tagAnnotationchildAttributeValue := childClassDetailsCommRsClientCertCACommHttpsCommPol.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagAnnotationchildAttributeValue { + if childAttributeName == "key" { + TagAnnotationCommRsClientCertCACommHttpsCommPol.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagAnnotationCommRsClientCertCACommHttpsCommPol.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagAnnotationCommRsClientCertCACommHttpsCommPolList = append(TagAnnotationCommRsClientCertCACommHttpsCommPolList, TagAnnotationCommRsClientCertCACommHttpsCommPol) + } + if childClassNameCommRsClientCertCACommHttpsCommPol == "tagTag" { + TagTagCommRsClientCertCACommHttpsCommPol := getEmptyTagTagCommRsClientCertCACommHttpsCommPolResourceModel() + tagTagchildAttributeValue := childClassDetailsCommRsClientCertCACommHttpsCommPol.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagTagchildAttributeValue { + if childAttributeName == "key" { + TagTagCommRsClientCertCACommHttpsCommPol.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagTagCommRsClientCertCACommHttpsCommPol.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagTagCommRsClientCertCACommHttpsCommPolList = append(TagTagCommRsClientCertCACommHttpsCommPolList, TagTagCommRsClientCertCACommHttpsCommPol) + } + } + } + } + TagAnnotationCommRsClientCertCACommHttpsCommPolSet, _ := types.SetValueFrom(ctx, TagAnnotationCommRsClientCertCACommHttpsCommPolType, TagAnnotationCommRsClientCertCACommHttpsCommPolList) + CommRsClientCertCACommHttpsCommPol.TagAnnotation = TagAnnotationCommRsClientCertCACommHttpsCommPolSet + TagTagCommRsClientCertCACommHttpsCommPolSet, _ := types.SetValueFrom(ctx, TagTagCommRsClientCertCACommHttpsCommPolType, TagTagCommRsClientCertCACommHttpsCommPolList) + CommRsClientCertCACommHttpsCommPol.TagTag = TagTagCommRsClientCertCACommHttpsCommPolSet + CommRsClientCertCACommHttpsCommPolList = append(CommRsClientCertCACommHttpsCommPolList, CommRsClientCertCACommHttpsCommPol) + } + if childClassNameCommHttpsCommPol == "commRsKeyRing" { + CommRsKeyRingCommHttpsCommPol := getEmptyCommRsKeyRingCommHttpsCommPolResourceModel() + commRsKeyRingchildAttributeValue := childClassDetailsCommHttpsCommPol.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range commRsKeyRingchildAttributeValue { + if childAttributeName == "annotation" { + CommRsKeyRingCommHttpsCommPol.Annotation = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "tnPkiKeyRingName" { + CommRsKeyRingCommHttpsCommPol.TnPkiKeyRingName = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagAnnotationCommRsKeyRingCommHttpsCommPolList := make([]TagAnnotationCommRsKeyRingCommHttpsCommPolResourceModel, 0) + TagTagCommRsKeyRingCommHttpsCommPolList := make([]TagTagCommRsKeyRingCommHttpsCommPolResourceModel, 0) + childrenOfCommRsKeyRingCommHttpsCommPol, childrenOfCommRsKeyRingCommHttpsCommPolExist := childClassDetailsCommHttpsCommPol.(map[string]interface{})["children"] + if childrenOfCommRsKeyRingCommHttpsCommPolExist { + for _, childCommRsKeyRingCommHttpsCommPol := range childrenOfCommRsKeyRingCommHttpsCommPol.([]interface{}) { + for childClassNameCommRsKeyRingCommHttpsCommPol, childClassDetailsCommRsKeyRingCommHttpsCommPol := range childCommRsKeyRingCommHttpsCommPol.(map[string]interface{}) { + if childClassNameCommRsKeyRingCommHttpsCommPol == "tagAnnotation" { + TagAnnotationCommRsKeyRingCommHttpsCommPol := getEmptyTagAnnotationCommRsKeyRingCommHttpsCommPolResourceModel() + tagAnnotationchildAttributeValue := childClassDetailsCommRsKeyRingCommHttpsCommPol.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagAnnotationchildAttributeValue { + if childAttributeName == "key" { + TagAnnotationCommRsKeyRingCommHttpsCommPol.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagAnnotationCommRsKeyRingCommHttpsCommPol.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagAnnotationCommRsKeyRingCommHttpsCommPolList = append(TagAnnotationCommRsKeyRingCommHttpsCommPolList, TagAnnotationCommRsKeyRingCommHttpsCommPol) + } + if childClassNameCommRsKeyRingCommHttpsCommPol == "tagTag" { + TagTagCommRsKeyRingCommHttpsCommPol := getEmptyTagTagCommRsKeyRingCommHttpsCommPolResourceModel() + tagTagchildAttributeValue := childClassDetailsCommRsKeyRingCommHttpsCommPol.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagTagchildAttributeValue { + if childAttributeName == "key" { + TagTagCommRsKeyRingCommHttpsCommPol.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagTagCommRsKeyRingCommHttpsCommPol.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagTagCommRsKeyRingCommHttpsCommPolList = append(TagTagCommRsKeyRingCommHttpsCommPolList, TagTagCommRsKeyRingCommHttpsCommPol) + } + } + } + } + TagAnnotationCommRsKeyRingCommHttpsCommPolSet, _ := types.SetValueFrom(ctx, TagAnnotationCommRsKeyRingCommHttpsCommPolType, TagAnnotationCommRsKeyRingCommHttpsCommPolList) + CommRsKeyRingCommHttpsCommPol.TagAnnotation = TagAnnotationCommRsKeyRingCommHttpsCommPolSet + TagTagCommRsKeyRingCommHttpsCommPolSet, _ := types.SetValueFrom(ctx, TagTagCommRsKeyRingCommHttpsCommPolType, TagTagCommRsKeyRingCommHttpsCommPolList) + CommRsKeyRingCommHttpsCommPol.TagTag = TagTagCommRsKeyRingCommHttpsCommPolSet + CommRsKeyRingCommHttpsCommPolList = append(CommRsKeyRingCommHttpsCommPolList, CommRsKeyRingCommHttpsCommPol) + } + if childClassNameCommHttpsCommPol == "tagAnnotation" { + TagAnnotationCommHttpsCommPol := getEmptyTagAnnotationCommHttpsCommPolResourceModel() + tagAnnotationchildAttributeValue := childClassDetailsCommHttpsCommPol.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagAnnotationchildAttributeValue { + if childAttributeName == "key" { + TagAnnotationCommHttpsCommPol.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagAnnotationCommHttpsCommPol.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagAnnotationCommHttpsCommPolList = append(TagAnnotationCommHttpsCommPolList, TagAnnotationCommHttpsCommPol) + } + if childClassNameCommHttpsCommPol == "tagTag" { + TagTagCommHttpsCommPol := getEmptyTagTagCommHttpsCommPolResourceModel() + tagTagchildAttributeValue := childClassDetailsCommHttpsCommPol.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagTagchildAttributeValue { + if childAttributeName == "key" { + TagTagCommHttpsCommPol.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagTagCommHttpsCommPol.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagTagCommHttpsCommPolList = append(TagTagCommHttpsCommPolList, TagTagCommHttpsCommPol) + } + } + } + } + if len(CommRsClientCertCACommHttpsCommPolList) == 1 { + CommRsClientCertCACommHttpsCommPolObject, _ := types.ObjectValueFrom(ctx, CommRsClientCertCACommHttpsCommPolType, CommRsClientCertCACommHttpsCommPolList[0]) + CommHttpsCommPol.CommRsClientCertCA = CommRsClientCertCACommHttpsCommPolObject + } else { + CommRsClientCertCACommHttpsCommPolObject, _ := types.ObjectValueFrom(ctx, CommRsClientCertCACommHttpsCommPolType, getEmptyCommRsClientCertCACommHttpsCommPolResourceModel()) + CommHttpsCommPol.CommRsClientCertCA = CommRsClientCertCACommHttpsCommPolObject + } + if len(CommRsKeyRingCommHttpsCommPolList) == 1 { + CommRsKeyRingCommHttpsCommPolObject, _ := types.ObjectValueFrom(ctx, CommRsKeyRingCommHttpsCommPolType, CommRsKeyRingCommHttpsCommPolList[0]) + CommHttpsCommPol.CommRsKeyRing = CommRsKeyRingCommHttpsCommPolObject + } else { + CommRsKeyRingCommHttpsCommPolObject, _ := types.ObjectValueFrom(ctx, CommRsKeyRingCommHttpsCommPolType, getEmptyCommRsKeyRingCommHttpsCommPolResourceModel()) + CommHttpsCommPol.CommRsKeyRing = CommRsKeyRingCommHttpsCommPolObject + } + TagAnnotationCommHttpsCommPolSet, _ := types.SetValueFrom(ctx, TagAnnotationCommHttpsCommPolType, TagAnnotationCommHttpsCommPolList) + CommHttpsCommPol.TagAnnotation = TagAnnotationCommHttpsCommPolSet + TagTagCommHttpsCommPolSet, _ := types.SetValueFrom(ctx, TagTagCommHttpsCommPolType, TagTagCommHttpsCommPolList) + CommHttpsCommPol.TagTag = TagTagCommHttpsCommPolSet + CommHttpsCommPolList = append(CommHttpsCommPolList, CommHttpsCommPol) + } + if childClassName == "commShellinabox" { + CommShellinaboxCommPol := getEmptyCommShellinaboxCommPolResourceModel() + for childAttributeName, childAttributeValue := range childAttributes { + if childAttributeName == "adminSt" { + CommShellinaboxCommPol.AdminSt = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "annotation" { + CommShellinaboxCommPol.Annotation = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "descr" { + CommShellinaboxCommPol.Descr = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "name" { + CommShellinaboxCommPol.Name = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "nameAlias" { + CommShellinaboxCommPol.NameAlias = basetypes.NewStringValue(childAttributeValue.(string)) + } + + } + TagAnnotationCommShellinaboxCommPolList := make([]TagAnnotationCommShellinaboxCommPolResourceModel, 0) + TagTagCommShellinaboxCommPolList := make([]TagTagCommShellinaboxCommPolResourceModel, 0) + childrenOfCommShellinaboxCommPol, childrenOfCommShellinaboxCommPolExist := childClassDetails.(map[string]interface{})["children"] + if childrenOfCommShellinaboxCommPolExist { + for _, childCommShellinaboxCommPol := range childrenOfCommShellinaboxCommPol.([]interface{}) { + for childClassNameCommShellinaboxCommPol, childClassDetailsCommShellinaboxCommPol := range childCommShellinaboxCommPol.(map[string]interface{}) { + if childClassNameCommShellinaboxCommPol == "tagAnnotation" { + TagAnnotationCommShellinaboxCommPol := getEmptyTagAnnotationCommShellinaboxCommPolResourceModel() + tagAnnotationchildAttributeValue := childClassDetailsCommShellinaboxCommPol.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagAnnotationchildAttributeValue { + if childAttributeName == "key" { + TagAnnotationCommShellinaboxCommPol.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagAnnotationCommShellinaboxCommPol.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagAnnotationCommShellinaboxCommPolList = append(TagAnnotationCommShellinaboxCommPolList, TagAnnotationCommShellinaboxCommPol) + } + if childClassNameCommShellinaboxCommPol == "tagTag" { + TagTagCommShellinaboxCommPol := getEmptyTagTagCommShellinaboxCommPolResourceModel() + tagTagchildAttributeValue := childClassDetailsCommShellinaboxCommPol.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagTagchildAttributeValue { + if childAttributeName == "key" { + TagTagCommShellinaboxCommPol.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagTagCommShellinaboxCommPol.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagTagCommShellinaboxCommPolList = append(TagTagCommShellinaboxCommPolList, TagTagCommShellinaboxCommPol) + } + } + } + } + TagAnnotationCommShellinaboxCommPolSet, _ := types.SetValueFrom(ctx, TagAnnotationCommShellinaboxCommPolType, TagAnnotationCommShellinaboxCommPolList) + CommShellinaboxCommPol.TagAnnotation = TagAnnotationCommShellinaboxCommPolSet + TagTagCommShellinaboxCommPolSet, _ := types.SetValueFrom(ctx, TagTagCommShellinaboxCommPolType, TagTagCommShellinaboxCommPolList) + CommShellinaboxCommPol.TagTag = TagTagCommShellinaboxCommPolSet + CommShellinaboxCommPolList = append(CommShellinaboxCommPolList, CommShellinaboxCommPol) + } + if childClassName == "commSsh" { + CommSshCommPol := getEmptyCommSshCommPolResourceModel() + for childAttributeName, childAttributeValue := range childAttributes { + if childAttributeName == "adminSt" { + CommSshCommPol.AdminSt = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "annotation" { + CommSshCommPol.Annotation = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "descr" { + CommSshCommPol.Descr = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "hostkeyAlgos" { + hostkeyAlgosList := strings.Split(childAttributeValue.(string), ",") + hostkeyAlgosSet, _ := types.SetValueFrom(ctx, basetypes.StringType{}, hostkeyAlgosList) + CommSshCommPol.HostkeyAlgos = hostkeyAlgosSet + + } + if childAttributeName == "kexAlgos" { + kexAlgosList := strings.Split(childAttributeValue.(string), ",") + kexAlgosSet, _ := types.SetValueFrom(ctx, basetypes.StringType{}, kexAlgosList) + CommSshCommPol.KexAlgos = kexAlgosSet + + } + if childAttributeName == "name" { + CommSshCommPol.Name = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "nameAlias" { + CommSshCommPol.NameAlias = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "passwordAuth" { + CommSshCommPol.PasswordAuth = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "port" { + CommSshCommPol.Port = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "sshCiphers" { + sshCiphersList := strings.Split(childAttributeValue.(string), ",") + sshCiphersSet, _ := types.SetValueFrom(ctx, basetypes.StringType{}, sshCiphersList) + CommSshCommPol.SshCiphers = sshCiphersSet + + } + if childAttributeName == "sshMacs" { + sshMacsList := strings.Split(childAttributeValue.(string), ",") + sshMacsSet, _ := types.SetValueFrom(ctx, basetypes.StringType{}, sshMacsList) + CommSshCommPol.SshMacs = sshMacsSet + + } + + } + TagAnnotationCommSshCommPolList := make([]TagAnnotationCommSshCommPolResourceModel, 0) + TagTagCommSshCommPolList := make([]TagTagCommSshCommPolResourceModel, 0) + childrenOfCommSshCommPol, childrenOfCommSshCommPolExist := childClassDetails.(map[string]interface{})["children"] + if childrenOfCommSshCommPolExist { + for _, childCommSshCommPol := range childrenOfCommSshCommPol.([]interface{}) { + for childClassNameCommSshCommPol, childClassDetailsCommSshCommPol := range childCommSshCommPol.(map[string]interface{}) { + if childClassNameCommSshCommPol == "tagAnnotation" { + TagAnnotationCommSshCommPol := getEmptyTagAnnotationCommSshCommPolResourceModel() + tagAnnotationchildAttributeValue := childClassDetailsCommSshCommPol.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagAnnotationchildAttributeValue { + if childAttributeName == "key" { + TagAnnotationCommSshCommPol.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagAnnotationCommSshCommPol.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagAnnotationCommSshCommPolList = append(TagAnnotationCommSshCommPolList, TagAnnotationCommSshCommPol) + } + if childClassNameCommSshCommPol == "tagTag" { + TagTagCommSshCommPol := getEmptyTagTagCommSshCommPolResourceModel() + tagTagchildAttributeValue := childClassDetailsCommSshCommPol.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagTagchildAttributeValue { + if childAttributeName == "key" { + TagTagCommSshCommPol.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagTagCommSshCommPol.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagTagCommSshCommPolList = append(TagTagCommSshCommPolList, TagTagCommSshCommPol) + } + } + } + } + TagAnnotationCommSshCommPolSet, _ := types.SetValueFrom(ctx, TagAnnotationCommSshCommPolType, TagAnnotationCommSshCommPolList) + CommSshCommPol.TagAnnotation = TagAnnotationCommSshCommPolSet + TagTagCommSshCommPolSet, _ := types.SetValueFrom(ctx, TagTagCommSshCommPolType, TagTagCommSshCommPolList) + CommSshCommPol.TagTag = TagTagCommSshCommPolSet + CommSshCommPolList = append(CommSshCommPolList, CommSshCommPol) + } + if childClassName == "commTelnet" { + CommTelnetCommPol := getEmptyCommTelnetCommPolResourceModel() + for childAttributeName, childAttributeValue := range childAttributes { + if childAttributeName == "adminSt" { + CommTelnetCommPol.AdminSt = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "annotation" { + CommTelnetCommPol.Annotation = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "descr" { + CommTelnetCommPol.Descr = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "name" { + CommTelnetCommPol.Name = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "nameAlias" { + CommTelnetCommPol.NameAlias = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "port" { + CommTelnetCommPol.Port = basetypes.NewStringValue(childAttributeValue.(string)) + } + + } + TagAnnotationCommTelnetCommPolList := make([]TagAnnotationCommTelnetCommPolResourceModel, 0) + TagTagCommTelnetCommPolList := make([]TagTagCommTelnetCommPolResourceModel, 0) + childrenOfCommTelnetCommPol, childrenOfCommTelnetCommPolExist := childClassDetails.(map[string]interface{})["children"] + if childrenOfCommTelnetCommPolExist { + for _, childCommTelnetCommPol := range childrenOfCommTelnetCommPol.([]interface{}) { + for childClassNameCommTelnetCommPol, childClassDetailsCommTelnetCommPol := range childCommTelnetCommPol.(map[string]interface{}) { + if childClassNameCommTelnetCommPol == "tagAnnotation" { + TagAnnotationCommTelnetCommPol := getEmptyTagAnnotationCommTelnetCommPolResourceModel() + tagAnnotationchildAttributeValue := childClassDetailsCommTelnetCommPol.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagAnnotationchildAttributeValue { + if childAttributeName == "key" { + TagAnnotationCommTelnetCommPol.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagAnnotationCommTelnetCommPol.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagAnnotationCommTelnetCommPolList = append(TagAnnotationCommTelnetCommPolList, TagAnnotationCommTelnetCommPol) + } + if childClassNameCommTelnetCommPol == "tagTag" { + TagTagCommTelnetCommPol := getEmptyTagTagCommTelnetCommPolResourceModel() + tagTagchildAttributeValue := childClassDetailsCommTelnetCommPol.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagTagchildAttributeValue { + if childAttributeName == "key" { + TagTagCommTelnetCommPol.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagTagCommTelnetCommPol.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagTagCommTelnetCommPolList = append(TagTagCommTelnetCommPolList, TagTagCommTelnetCommPol) + } + } + } + } + TagAnnotationCommTelnetCommPolSet, _ := types.SetValueFrom(ctx, TagAnnotationCommTelnetCommPolType, TagAnnotationCommTelnetCommPolList) + CommTelnetCommPol.TagAnnotation = TagAnnotationCommTelnetCommPolSet + TagTagCommTelnetCommPolSet, _ := types.SetValueFrom(ctx, TagTagCommTelnetCommPolType, TagTagCommTelnetCommPolList) + CommTelnetCommPol.TagTag = TagTagCommTelnetCommPolSet + CommTelnetCommPolList = append(CommTelnetCommPolList, CommTelnetCommPol) + } + if childClassName == "tagAnnotation" { + TagAnnotationCommPol := getEmptyTagAnnotationCommPolResourceModel() + for childAttributeName, childAttributeValue := range childAttributes { + if childAttributeName == "key" { + TagAnnotationCommPol.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagAnnotationCommPol.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + + } + TagAnnotationCommPolList = append(TagAnnotationCommPolList, TagAnnotationCommPol) + } + if childClassName == "tagTag" { + TagTagCommPol := getEmptyTagTagCommPolResourceModel() + for childAttributeName, childAttributeValue := range childAttributes { + if childAttributeName == "key" { + TagTagCommPol.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagTagCommPol.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + + } + TagTagCommPolList = append(TagTagCommPolList, TagTagCommPol) + } + } + } + } + if len(CommHttpCommPolList) == 1 { + commHttpObject, _ := types.ObjectValueFrom(ctx, CommHttpCommPolType, CommHttpCommPolList[0]) + readData.CommHttp = commHttpObject + } else { + commHttpObject, _ := types.ObjectValueFrom(ctx, CommHttpCommPolType, getEmptyCommHttpCommPolResourceModel()) + readData.CommHttp = commHttpObject + } + if len(CommHttpsCommPolList) == 1 { + commHttpsObject, _ := types.ObjectValueFrom(ctx, CommHttpsCommPolType, CommHttpsCommPolList[0]) + readData.CommHttps = commHttpsObject + } else { + commHttpsObject, _ := types.ObjectValueFrom(ctx, CommHttpsCommPolType, getEmptyCommHttpsCommPolResourceModel()) + readData.CommHttps = commHttpsObject + } + if len(CommShellinaboxCommPolList) == 1 { + commShellinaboxObject, _ := types.ObjectValueFrom(ctx, CommShellinaboxCommPolType, CommShellinaboxCommPolList[0]) + readData.CommShellinabox = commShellinaboxObject + } else { + commShellinaboxObject, _ := types.ObjectValueFrom(ctx, CommShellinaboxCommPolType, getEmptyCommShellinaboxCommPolResourceModel()) + readData.CommShellinabox = commShellinaboxObject + } + if len(CommSshCommPolList) == 1 { + commSshObject, _ := types.ObjectValueFrom(ctx, CommSshCommPolType, CommSshCommPolList[0]) + readData.CommSsh = commSshObject + } else { + commSshObject, _ := types.ObjectValueFrom(ctx, CommSshCommPolType, getEmptyCommSshCommPolResourceModel()) + readData.CommSsh = commSshObject + } + if len(CommTelnetCommPolList) == 1 { + commTelnetObject, _ := types.ObjectValueFrom(ctx, CommTelnetCommPolType, CommTelnetCommPolList[0]) + readData.CommTelnet = commTelnetObject + } else { + commTelnetObject, _ := types.ObjectValueFrom(ctx, CommTelnetCommPolType, getEmptyCommTelnetCommPolResourceModel()) + readData.CommTelnet = commTelnetObject + } + tagAnnotationSet, _ := types.SetValueFrom(ctx, readData.TagAnnotation.ElementType(ctx), TagAnnotationCommPolList) + readData.TagAnnotation = tagAnnotationSet + tagTagSet, _ := types.SetValueFrom(ctx, readData.TagTag.ElementType(ctx), TagTagCommPolList) + readData.TagTag = tagTagSet + } else { + diags.AddError( + "too many results in response", + fmt.Sprintf("%v matches returned for class 'commPol'. Please report this issue to the provider developers.", len(classReadInfo)), + ) + } + } else { + readData.Id = basetypes.NewStringNull() + } + *data = *readData +} + +func getCommPolRn(ctx context.Context, data *CommPolResourceModel) string { + return fmt.Sprintf("fabric/comm-%s", data.Name.ValueString()) +} + +func setCommPolId(ctx context.Context, data *CommPolResourceModel) { + rn := getCommPolRn(ctx, data) + data.Id = types.StringValue(fmt.Sprintf("%s/%s", strings.Split([]string{"uni/fabric/comm-{name}"}[0], "/")[0], rn)) +} + +func getCommPolCommHttpChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *CommPolResourceModel, commHttpCommPolPlan, commHttpCommPolState CommHttpCommPolResourceModel) []map[string]interface{} { + childPayloads := []map[string]interface{}{} + if !data.CommHttp.IsNull() && !data.CommHttp.IsUnknown() { + CommHttpCommPolChildren := make([]map[string]interface{}, 0) + childMap := NewAciObject() + if !IsEmptySingleNestedAttribute(data.CommHttp.Attributes()) { + if !commHttpCommPolPlan.AccessControlAllowCredential.IsUnknown() && !commHttpCommPolPlan.AccessControlAllowCredential.IsNull() { + childMap.Attributes["accessControlAllowCredential"] = commHttpCommPolPlan.AccessControlAllowCredential.ValueString() + } + if !commHttpCommPolPlan.AccessControlAllowOrigins.IsUnknown() && !commHttpCommPolPlan.AccessControlAllowOrigins.IsNull() { + childMap.Attributes["accessControlAllowOrigins"] = commHttpCommPolPlan.AccessControlAllowOrigins.ValueString() + } + if !commHttpCommPolPlan.AdminSt.IsUnknown() && !commHttpCommPolPlan.AdminSt.IsNull() { + childMap.Attributes["adminSt"] = commHttpCommPolPlan.AdminSt.ValueString() + } + if !commHttpCommPolPlan.Annotation.IsUnknown() && !commHttpCommPolPlan.Annotation.IsNull() { + childMap.Attributes["annotation"] = commHttpCommPolPlan.Annotation.ValueString() + } else { + childMap.Attributes["annotation"] = globalAnnotation + } + if !commHttpCommPolPlan.CliOnlyMode.IsUnknown() && !commHttpCommPolPlan.CliOnlyMode.IsNull() { + childMap.Attributes["cliOnlyMode"] = commHttpCommPolPlan.CliOnlyMode.ValueString() + } + if !commHttpCommPolPlan.Descr.IsUnknown() && !commHttpCommPolPlan.Descr.IsNull() { + childMap.Attributes["descr"] = commHttpCommPolPlan.Descr.ValueString() + } + if !commHttpCommPolPlan.GlobalThrottleRate.IsUnknown() && !commHttpCommPolPlan.GlobalThrottleRate.IsNull() { + childMap.Attributes["globalThrottleRate"] = commHttpCommPolPlan.GlobalThrottleRate.ValueString() + } + if !commHttpCommPolPlan.GlobalThrottleSt.IsUnknown() && !commHttpCommPolPlan.GlobalThrottleSt.IsNull() { + childMap.Attributes["globalThrottleSt"] = commHttpCommPolPlan.GlobalThrottleSt.ValueString() + } + if !commHttpCommPolPlan.GlobalThrottleUnit.IsUnknown() && !commHttpCommPolPlan.GlobalThrottleUnit.IsNull() { + childMap.Attributes["globalThrottleUnit"] = commHttpCommPolPlan.GlobalThrottleUnit.ValueString() + } + if !commHttpCommPolPlan.MaxRequestStatusCount.IsUnknown() && !commHttpCommPolPlan.MaxRequestStatusCount.IsNull() { + childMap.Attributes["maxRequestStatusCount"] = commHttpCommPolPlan.MaxRequestStatusCount.ValueString() + } + if !commHttpCommPolPlan.Name.IsUnknown() && !commHttpCommPolPlan.Name.IsNull() { + childMap.Attributes["name"] = commHttpCommPolPlan.Name.ValueString() + } + if !commHttpCommPolPlan.NameAlias.IsUnknown() && !commHttpCommPolPlan.NameAlias.IsNull() { + childMap.Attributes["nameAlias"] = commHttpCommPolPlan.NameAlias.ValueString() + } + if !commHttpCommPolPlan.NodeExporter.IsUnknown() && !commHttpCommPolPlan.NodeExporter.IsNull() { + childMap.Attributes["nodeExporter"] = commHttpCommPolPlan.NodeExporter.ValueString() + } + if !commHttpCommPolPlan.Port.IsUnknown() && !commHttpCommPolPlan.Port.IsNull() { + childMap.Attributes["port"] = commHttpCommPolPlan.Port.ValueString() + } + if !commHttpCommPolPlan.RedirectSt.IsUnknown() && !commHttpCommPolPlan.RedirectSt.IsNull() { + childMap.Attributes["redirectSt"] = commHttpCommPolPlan.RedirectSt.ValueString() + } + if !commHttpCommPolPlan.ServerHeader.IsUnknown() && !commHttpCommPolPlan.ServerHeader.IsNull() { + childMap.Attributes["serverHeader"] = commHttpCommPolPlan.ServerHeader.ValueString() + } + if !commHttpCommPolPlan.ThrottleRate.IsUnknown() && !commHttpCommPolPlan.ThrottleRate.IsNull() { + childMap.Attributes["throttleRate"] = commHttpCommPolPlan.ThrottleRate.ValueString() + } + if !commHttpCommPolPlan.ThrottleSt.IsUnknown() && !commHttpCommPolPlan.ThrottleSt.IsNull() { + childMap.Attributes["throttleSt"] = commHttpCommPolPlan.ThrottleSt.ValueString() + } + if !commHttpCommPolPlan.VisoreAccess.IsUnknown() && !commHttpCommPolPlan.VisoreAccess.IsNull() { + childMap.Attributes["visoreAccess"] = commHttpCommPolPlan.VisoreAccess.ValueString() + } + } + + var tagAnnotationCommHttpCommPolPlan, tagAnnotationCommHttpCommPolState []TagAnnotationCommHttpCommPolResourceModel + commHttpCommPolPlan.TagAnnotation.ElementsAs(ctx, &tagAnnotationCommHttpCommPolPlan, false) + if !commHttpCommPolState.TagAnnotation.IsNull() { + commHttpCommPolState.TagAnnotation.ElementsAs(ctx, &tagAnnotationCommHttpCommPolState, false) + } + if !commHttpCommPolPlan.TagAnnotation.IsNull() && !commHttpCommPolPlan.TagAnnotation.IsUnknown() { + tagAnnotationIdentifiers := []TagAnnotationIdentifier{} + for _, tagAnnotationCommHttpCommPol := range tagAnnotationCommHttpCommPolPlan { + tagAnnotationCommHttpCommPolChildMap := NewAciObject() + if !tagAnnotationCommHttpCommPol.Key.IsNull() && !tagAnnotationCommHttpCommPol.Key.IsUnknown() { + tagAnnotationCommHttpCommPolChildMap.Attributes["key"] = tagAnnotationCommHttpCommPol.Key.ValueString() + } + if !tagAnnotationCommHttpCommPol.Value.IsNull() && !tagAnnotationCommHttpCommPol.Value.IsUnknown() { + tagAnnotationCommHttpCommPolChildMap.Attributes["value"] = tagAnnotationCommHttpCommPol.Value.ValueString() + } + CommHttpCommPolChildren = append(CommHttpCommPolChildren, map[string]interface{}{"tagAnnotation": tagAnnotationCommHttpCommPolChildMap}) + tagAnnotationIdentifier := TagAnnotationIdentifier{} + tagAnnotationIdentifier.Key = tagAnnotationCommHttpCommPol.Key + tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) + } + for _, tagAnnotationCommHttpCommPol := range tagAnnotationCommHttpCommPolState { + delete := true + for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { + if tagAnnotationIdentifier.Key == tagAnnotationCommHttpCommPol.Key { + delete = false + break + } + } + if delete { + tagAnnotationCommHttpCommPolChildMapForDelete := NewAciObject() + tagAnnotationCommHttpCommPolChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationCommHttpCommPolChildMapForDelete.Attributes["key"] = tagAnnotationCommHttpCommPol.Key.ValueString() + CommHttpCommPolChildren = append(CommHttpCommPolChildren, map[string]interface{}{"tagAnnotation": tagAnnotationCommHttpCommPolChildMapForDelete}) + } + } + } + + var tagTagCommHttpCommPolPlan, tagTagCommHttpCommPolState []TagTagCommHttpCommPolResourceModel + commHttpCommPolPlan.TagTag.ElementsAs(ctx, &tagTagCommHttpCommPolPlan, false) + if !commHttpCommPolState.TagTag.IsNull() { + commHttpCommPolState.TagTag.ElementsAs(ctx, &tagTagCommHttpCommPolState, false) + } + if !commHttpCommPolPlan.TagTag.IsNull() && !commHttpCommPolPlan.TagTag.IsUnknown() { + tagTagIdentifiers := []TagTagIdentifier{} + for _, tagTagCommHttpCommPol := range tagTagCommHttpCommPolPlan { + tagTagCommHttpCommPolChildMap := NewAciObject() + if !tagTagCommHttpCommPol.Key.IsNull() && !tagTagCommHttpCommPol.Key.IsUnknown() { + tagTagCommHttpCommPolChildMap.Attributes["key"] = tagTagCommHttpCommPol.Key.ValueString() + } + if !tagTagCommHttpCommPol.Value.IsNull() && !tagTagCommHttpCommPol.Value.IsUnknown() { + tagTagCommHttpCommPolChildMap.Attributes["value"] = tagTagCommHttpCommPol.Value.ValueString() + } + CommHttpCommPolChildren = append(CommHttpCommPolChildren, map[string]interface{}{"tagTag": tagTagCommHttpCommPolChildMap}) + tagTagIdentifier := TagTagIdentifier{} + tagTagIdentifier.Key = tagTagCommHttpCommPol.Key + tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) + } + for _, tagTagCommHttpCommPol := range tagTagCommHttpCommPolState { + delete := true + for _, tagTagIdentifier := range tagTagIdentifiers { + if tagTagIdentifier.Key == tagTagCommHttpCommPol.Key { + delete = false + break + } + } + if delete { + tagTagCommHttpCommPolChildMapForDelete := NewAciObject() + tagTagCommHttpCommPolChildMapForDelete.Attributes["status"] = "deleted" + tagTagCommHttpCommPolChildMapForDelete.Attributes["key"] = tagTagCommHttpCommPol.Key.ValueString() + CommHttpCommPolChildren = append(CommHttpCommPolChildren, map[string]interface{}{"tagTag": tagTagCommHttpCommPolChildMapForDelete}) + } + } + } + childMap.Children = CommHttpCommPolChildren + childPayloads = append(childPayloads, map[string]interface{}{"commHttp": childMap}) + } else { + CommHttpObject, _ := types.ObjectValueFrom(ctx, CommHttpCommPolType, getEmptyCommHttpCommPolResourceModel()) + data.CommHttp = CommHttpObject + } + + return childPayloads +} + +func getCommPolCommHttpsChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *CommPolResourceModel, commHttpsCommPolPlan, commHttpsCommPolState CommHttpsCommPolResourceModel) []map[string]interface{} { + childPayloads := []map[string]interface{}{} + CommRsClientCertCACommHttpsCommPolChildren := make([]map[string]interface{}, 0) + CommRsKeyRingCommHttpsCommPolChildren := make([]map[string]interface{}, 0) + if !data.CommHttps.IsNull() && !data.CommHttps.IsUnknown() { + CommHttpsCommPolChildren := make([]map[string]interface{}, 0) + childMap := NewAciObject() + if !IsEmptySingleNestedAttribute(data.CommHttps.Attributes()) { + if !commHttpsCommPolPlan.AccessControlAllowCredential.IsUnknown() && !commHttpsCommPolPlan.AccessControlAllowCredential.IsNull() { + childMap.Attributes["accessControlAllowCredential"] = commHttpsCommPolPlan.AccessControlAllowCredential.ValueString() + } + if !commHttpsCommPolPlan.AccessControlAllowOrigins.IsUnknown() && !commHttpsCommPolPlan.AccessControlAllowOrigins.IsNull() { + childMap.Attributes["accessControlAllowOrigins"] = commHttpsCommPolPlan.AccessControlAllowOrigins.ValueString() + } + if !commHttpsCommPolPlan.AdminSt.IsUnknown() && !commHttpsCommPolPlan.AdminSt.IsNull() { + childMap.Attributes["adminSt"] = commHttpsCommPolPlan.AdminSt.ValueString() + } + if !commHttpsCommPolPlan.Annotation.IsUnknown() && !commHttpsCommPolPlan.Annotation.IsNull() { + childMap.Attributes["annotation"] = commHttpsCommPolPlan.Annotation.ValueString() + } else { + childMap.Attributes["annotation"] = globalAnnotation + } + if !commHttpsCommPolPlan.CliOnlyMode.IsUnknown() && !commHttpsCommPolPlan.CliOnlyMode.IsNull() { + childMap.Attributes["cliOnlyMode"] = commHttpsCommPolPlan.CliOnlyMode.ValueString() + } + if !commHttpsCommPolPlan.ClientCertAuthState.IsUnknown() && !commHttpsCommPolPlan.ClientCertAuthState.IsNull() { + childMap.Attributes["clientCertAuthState"] = commHttpsCommPolPlan.ClientCertAuthState.ValueString() + } + if !commHttpsCommPolPlan.Descr.IsUnknown() && !commHttpsCommPolPlan.Descr.IsNull() { + childMap.Attributes["descr"] = commHttpsCommPolPlan.Descr.ValueString() + } + if !commHttpsCommPolPlan.DhParam.IsUnknown() && !commHttpsCommPolPlan.DhParam.IsNull() { + childMap.Attributes["dhParam"] = commHttpsCommPolPlan.DhParam.ValueString() + } + if !commHttpsCommPolPlan.GlobalThrottleRate.IsUnknown() && !commHttpsCommPolPlan.GlobalThrottleRate.IsNull() { + childMap.Attributes["globalThrottleRate"] = commHttpsCommPolPlan.GlobalThrottleRate.ValueString() + } + if !commHttpsCommPolPlan.GlobalThrottleSt.IsUnknown() && !commHttpsCommPolPlan.GlobalThrottleSt.IsNull() { + childMap.Attributes["globalThrottleSt"] = commHttpsCommPolPlan.GlobalThrottleSt.ValueString() + } + if !commHttpsCommPolPlan.GlobalThrottleUnit.IsUnknown() && !commHttpsCommPolPlan.GlobalThrottleUnit.IsNull() { + childMap.Attributes["globalThrottleUnit"] = commHttpsCommPolPlan.GlobalThrottleUnit.ValueString() + } + if !commHttpsCommPolPlan.MaxRequestStatusCount.IsUnknown() && !commHttpsCommPolPlan.MaxRequestStatusCount.IsNull() { + childMap.Attributes["maxRequestStatusCount"] = commHttpsCommPolPlan.MaxRequestStatusCount.ValueString() + } + if !commHttpsCommPolPlan.Name.IsUnknown() && !commHttpsCommPolPlan.Name.IsNull() { + childMap.Attributes["name"] = commHttpsCommPolPlan.Name.ValueString() + } + if !commHttpsCommPolPlan.NameAlias.IsUnknown() && !commHttpsCommPolPlan.NameAlias.IsNull() { + childMap.Attributes["nameAlias"] = commHttpsCommPolPlan.NameAlias.ValueString() + } + if !commHttpsCommPolPlan.NodeExporter.IsUnknown() && !commHttpsCommPolPlan.NodeExporter.IsNull() { + childMap.Attributes["nodeExporter"] = commHttpsCommPolPlan.NodeExporter.ValueString() + } + if !commHttpsCommPolPlan.Port.IsUnknown() && !commHttpsCommPolPlan.Port.IsNull() { + childMap.Attributes["port"] = commHttpsCommPolPlan.Port.ValueString() + } + if !commHttpsCommPolPlan.Referer.IsUnknown() && !commHttpsCommPolPlan.Referer.IsNull() { + childMap.Attributes["referer"] = commHttpsCommPolPlan.Referer.ValueString() + } + if !commHttpsCommPolPlan.ServerHeader.IsUnknown() && !commHttpsCommPolPlan.ServerHeader.IsNull() { + childMap.Attributes["serverHeader"] = commHttpsCommPolPlan.ServerHeader.ValueString() + } + if !commHttpsCommPolPlan.SslProtocols.IsUnknown() && !commHttpsCommPolPlan.SslProtocols.IsNull() { + var tmpSslProtocols []string + commHttpsCommPolPlan.SslProtocols.ElementsAs(ctx, &tmpSslProtocols, false) + childMap.Attributes["sslProtocols"] = strings.Join(tmpSslProtocols, ",") + } + if !commHttpsCommPolPlan.ThrottleRate.IsUnknown() && !commHttpsCommPolPlan.ThrottleRate.IsNull() { + childMap.Attributes["throttleRate"] = commHttpsCommPolPlan.ThrottleRate.ValueString() + } + if !commHttpsCommPolPlan.ThrottleSt.IsUnknown() && !commHttpsCommPolPlan.ThrottleSt.IsNull() { + childMap.Attributes["throttleSt"] = commHttpsCommPolPlan.ThrottleSt.ValueString() + } + if !commHttpsCommPolPlan.VisoreAccess.IsUnknown() && !commHttpsCommPolPlan.VisoreAccess.IsNull() { + childMap.Attributes["visoreAccess"] = commHttpsCommPolPlan.VisoreAccess.ValueString() + } + } + + var commRsClientCertCACommHttpsCommPolPlan, commRsClientCertCACommHttpsCommPolState CommRsClientCertCACommHttpsCommPolResourceModel + commHttpsCommPolPlan.CommRsClientCertCA.As(ctx, &commRsClientCertCACommHttpsCommPolPlan, basetypes.ObjectAsOptions{}) + if !commHttpsCommPolState.CommRsClientCertCA.IsNull() { + commHttpsCommPolState.CommRsClientCertCA.As(ctx, &commRsClientCertCACommHttpsCommPolState, basetypes.ObjectAsOptions{}) + } + if !commHttpsCommPolPlan.CommRsClientCertCA.IsNull() && !commHttpsCommPolPlan.CommRsClientCertCA.IsUnknown() { + commRsClientCertCACommHttpsCommPolChildMap := NewAciObject() + if !IsEmptySingleNestedAttribute(commHttpsCommPolPlan.CommRsClientCertCA.Attributes()) { + if !commRsClientCertCACommHttpsCommPolPlan.Annotation.IsUnknown() && !commRsClientCertCACommHttpsCommPolPlan.Annotation.IsNull() { + commRsClientCertCACommHttpsCommPolChildMap.Attributes["annotation"] = commRsClientCertCACommHttpsCommPolPlan.Annotation.ValueString() + } else { + commRsClientCertCACommHttpsCommPolChildMap.Attributes["annotation"] = globalAnnotation + } + if !commRsClientCertCACommHttpsCommPolPlan.TDn.IsUnknown() && !commRsClientCertCACommHttpsCommPolPlan.TDn.IsNull() { + commRsClientCertCACommHttpsCommPolChildMap.Attributes["tDn"] = commRsClientCertCACommHttpsCommPolPlan.TDn.ValueString() + } + } else { + commRsClientCertCACommHttpsCommPolChildMap.Attributes["status"] = "deleted" + } + + var tagAnnotationCommRsClientCertCACommHttpsCommPolPlan, tagAnnotationCommRsClientCertCACommHttpsCommPolState []TagAnnotationCommRsClientCertCACommHttpsCommPolResourceModel + commRsClientCertCACommHttpsCommPolPlan.TagAnnotation.ElementsAs(ctx, &tagAnnotationCommRsClientCertCACommHttpsCommPolPlan, false) + if !commRsClientCertCACommHttpsCommPolState.TagAnnotation.IsNull() { + commRsClientCertCACommHttpsCommPolState.TagAnnotation.ElementsAs(ctx, &tagAnnotationCommRsClientCertCACommHttpsCommPolState, false) + } + if !commRsClientCertCACommHttpsCommPolPlan.TagAnnotation.IsNull() && !commRsClientCertCACommHttpsCommPolPlan.TagAnnotation.IsUnknown() { + tagAnnotationIdentifiers := []TagAnnotationIdentifier{} + for _, tagAnnotationCommRsClientCertCACommHttpsCommPol := range tagAnnotationCommRsClientCertCACommHttpsCommPolPlan { + tagAnnotationCommRsClientCertCACommHttpsCommPolChildMap := NewAciObject() + if !tagAnnotationCommRsClientCertCACommHttpsCommPol.Key.IsNull() && !tagAnnotationCommRsClientCertCACommHttpsCommPol.Key.IsUnknown() { + tagAnnotationCommRsClientCertCACommHttpsCommPolChildMap.Attributes["key"] = tagAnnotationCommRsClientCertCACommHttpsCommPol.Key.ValueString() + } + if !tagAnnotationCommRsClientCertCACommHttpsCommPol.Value.IsNull() && !tagAnnotationCommRsClientCertCACommHttpsCommPol.Value.IsUnknown() { + tagAnnotationCommRsClientCertCACommHttpsCommPolChildMap.Attributes["value"] = tagAnnotationCommRsClientCertCACommHttpsCommPol.Value.ValueString() + } + CommRsClientCertCACommHttpsCommPolChildren = append(CommRsClientCertCACommHttpsCommPolChildren, map[string]interface{}{"tagAnnotation": tagAnnotationCommRsClientCertCACommHttpsCommPolChildMap}) + tagAnnotationIdentifier := TagAnnotationIdentifier{} + tagAnnotationIdentifier.Key = tagAnnotationCommRsClientCertCACommHttpsCommPol.Key + tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) + } + for _, tagAnnotationCommRsClientCertCACommHttpsCommPol := range tagAnnotationCommRsClientCertCACommHttpsCommPolState { + delete := true + for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { + if tagAnnotationIdentifier.Key == tagAnnotationCommRsClientCertCACommHttpsCommPol.Key { + delete = false + break + } + } + if delete { + tagAnnotationCommRsClientCertCACommHttpsCommPolChildMapForDelete := NewAciObject() + tagAnnotationCommRsClientCertCACommHttpsCommPolChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationCommRsClientCertCACommHttpsCommPolChildMapForDelete.Attributes["key"] = tagAnnotationCommRsClientCertCACommHttpsCommPol.Key.ValueString() + CommRsClientCertCACommHttpsCommPolChildren = append(CommRsClientCertCACommHttpsCommPolChildren, map[string]interface{}{"tagAnnotation": tagAnnotationCommRsClientCertCACommHttpsCommPolChildMapForDelete}) + } + } + } + + var tagTagCommRsClientCertCACommHttpsCommPolPlan, tagTagCommRsClientCertCACommHttpsCommPolState []TagTagCommRsClientCertCACommHttpsCommPolResourceModel + commRsClientCertCACommHttpsCommPolPlan.TagTag.ElementsAs(ctx, &tagTagCommRsClientCertCACommHttpsCommPolPlan, false) + if !commRsClientCertCACommHttpsCommPolState.TagTag.IsNull() { + commRsClientCertCACommHttpsCommPolState.TagTag.ElementsAs(ctx, &tagTagCommRsClientCertCACommHttpsCommPolState, false) + } + if !commRsClientCertCACommHttpsCommPolPlan.TagTag.IsNull() && !commRsClientCertCACommHttpsCommPolPlan.TagTag.IsUnknown() { + tagTagIdentifiers := []TagTagIdentifier{} + for _, tagTagCommRsClientCertCACommHttpsCommPol := range tagTagCommRsClientCertCACommHttpsCommPolPlan { + tagTagCommRsClientCertCACommHttpsCommPolChildMap := NewAciObject() + if !tagTagCommRsClientCertCACommHttpsCommPol.Key.IsNull() && !tagTagCommRsClientCertCACommHttpsCommPol.Key.IsUnknown() { + tagTagCommRsClientCertCACommHttpsCommPolChildMap.Attributes["key"] = tagTagCommRsClientCertCACommHttpsCommPol.Key.ValueString() + } + if !tagTagCommRsClientCertCACommHttpsCommPol.Value.IsNull() && !tagTagCommRsClientCertCACommHttpsCommPol.Value.IsUnknown() { + tagTagCommRsClientCertCACommHttpsCommPolChildMap.Attributes["value"] = tagTagCommRsClientCertCACommHttpsCommPol.Value.ValueString() + } + CommRsClientCertCACommHttpsCommPolChildren = append(CommRsClientCertCACommHttpsCommPolChildren, map[string]interface{}{"tagTag": tagTagCommRsClientCertCACommHttpsCommPolChildMap}) + tagTagIdentifier := TagTagIdentifier{} + tagTagIdentifier.Key = tagTagCommRsClientCertCACommHttpsCommPol.Key + tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) + } + for _, tagTagCommRsClientCertCACommHttpsCommPol := range tagTagCommRsClientCertCACommHttpsCommPolState { + delete := true + for _, tagTagIdentifier := range tagTagIdentifiers { + if tagTagIdentifier.Key == tagTagCommRsClientCertCACommHttpsCommPol.Key { + delete = false + break + } + } + if delete { + tagTagCommRsClientCertCACommHttpsCommPolChildMapForDelete := NewAciObject() + tagTagCommRsClientCertCACommHttpsCommPolChildMapForDelete.Attributes["status"] = "deleted" + tagTagCommRsClientCertCACommHttpsCommPolChildMapForDelete.Attributes["key"] = tagTagCommRsClientCertCACommHttpsCommPol.Key.ValueString() + CommRsClientCertCACommHttpsCommPolChildren = append(CommRsClientCertCACommHttpsCommPolChildren, map[string]interface{}{"tagTag": tagTagCommRsClientCertCACommHttpsCommPolChildMapForDelete}) + } + } + } + commRsClientCertCACommHttpsCommPolChildMap.Children = CommRsClientCertCACommHttpsCommPolChildren + CommHttpsCommPolChildren = append(CommHttpsCommPolChildren, map[string]interface{}{"commRsClientCertCA": commRsClientCertCACommHttpsCommPolChildMap}) + } + + var commRsKeyRingCommHttpsCommPolPlan, commRsKeyRingCommHttpsCommPolState CommRsKeyRingCommHttpsCommPolResourceModel + commHttpsCommPolPlan.CommRsKeyRing.As(ctx, &commRsKeyRingCommHttpsCommPolPlan, basetypes.ObjectAsOptions{}) + if !commHttpsCommPolState.CommRsKeyRing.IsNull() { + commHttpsCommPolState.CommRsKeyRing.As(ctx, &commRsKeyRingCommHttpsCommPolState, basetypes.ObjectAsOptions{}) + } + if !commHttpsCommPolPlan.CommRsKeyRing.IsNull() && !commHttpsCommPolPlan.CommRsKeyRing.IsUnknown() { + commRsKeyRingCommHttpsCommPolChildMap := NewAciObject() + if !IsEmptySingleNestedAttribute(commHttpsCommPolPlan.CommRsKeyRing.Attributes()) { + if !commRsKeyRingCommHttpsCommPolPlan.Annotation.IsUnknown() && !commRsKeyRingCommHttpsCommPolPlan.Annotation.IsNull() { + commRsKeyRingCommHttpsCommPolChildMap.Attributes["annotation"] = commRsKeyRingCommHttpsCommPolPlan.Annotation.ValueString() + } else { + commRsKeyRingCommHttpsCommPolChildMap.Attributes["annotation"] = globalAnnotation + } + if !commRsKeyRingCommHttpsCommPolPlan.TnPkiKeyRingName.IsUnknown() && !commRsKeyRingCommHttpsCommPolPlan.TnPkiKeyRingName.IsNull() { + commRsKeyRingCommHttpsCommPolChildMap.Attributes["tnPkiKeyRingName"] = commRsKeyRingCommHttpsCommPolPlan.TnPkiKeyRingName.ValueString() + } + } + + var tagAnnotationCommRsKeyRingCommHttpsCommPolPlan, tagAnnotationCommRsKeyRingCommHttpsCommPolState []TagAnnotationCommRsKeyRingCommHttpsCommPolResourceModel + commRsKeyRingCommHttpsCommPolPlan.TagAnnotation.ElementsAs(ctx, &tagAnnotationCommRsKeyRingCommHttpsCommPolPlan, false) + if !commRsKeyRingCommHttpsCommPolState.TagAnnotation.IsNull() { + commRsKeyRingCommHttpsCommPolState.TagAnnotation.ElementsAs(ctx, &tagAnnotationCommRsKeyRingCommHttpsCommPolState, false) + } + if !commRsKeyRingCommHttpsCommPolPlan.TagAnnotation.IsNull() && !commRsKeyRingCommHttpsCommPolPlan.TagAnnotation.IsUnknown() { + tagAnnotationIdentifiers := []TagAnnotationIdentifier{} + for _, tagAnnotationCommRsKeyRingCommHttpsCommPol := range tagAnnotationCommRsKeyRingCommHttpsCommPolPlan { + tagAnnotationCommRsKeyRingCommHttpsCommPolChildMap := NewAciObject() + if !tagAnnotationCommRsKeyRingCommHttpsCommPol.Key.IsNull() && !tagAnnotationCommRsKeyRingCommHttpsCommPol.Key.IsUnknown() { + tagAnnotationCommRsKeyRingCommHttpsCommPolChildMap.Attributes["key"] = tagAnnotationCommRsKeyRingCommHttpsCommPol.Key.ValueString() + } + if !tagAnnotationCommRsKeyRingCommHttpsCommPol.Value.IsNull() && !tagAnnotationCommRsKeyRingCommHttpsCommPol.Value.IsUnknown() { + tagAnnotationCommRsKeyRingCommHttpsCommPolChildMap.Attributes["value"] = tagAnnotationCommRsKeyRingCommHttpsCommPol.Value.ValueString() + } + CommRsKeyRingCommHttpsCommPolChildren = append(CommRsKeyRingCommHttpsCommPolChildren, map[string]interface{}{"tagAnnotation": tagAnnotationCommRsKeyRingCommHttpsCommPolChildMap}) + tagAnnotationIdentifier := TagAnnotationIdentifier{} + tagAnnotationIdentifier.Key = tagAnnotationCommRsKeyRingCommHttpsCommPol.Key + tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) + } + for _, tagAnnotationCommRsKeyRingCommHttpsCommPol := range tagAnnotationCommRsKeyRingCommHttpsCommPolState { + delete := true + for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { + if tagAnnotationIdentifier.Key == tagAnnotationCommRsKeyRingCommHttpsCommPol.Key { + delete = false + break + } + } + if delete { + tagAnnotationCommRsKeyRingCommHttpsCommPolChildMapForDelete := NewAciObject() + tagAnnotationCommRsKeyRingCommHttpsCommPolChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationCommRsKeyRingCommHttpsCommPolChildMapForDelete.Attributes["key"] = tagAnnotationCommRsKeyRingCommHttpsCommPol.Key.ValueString() + CommRsKeyRingCommHttpsCommPolChildren = append(CommRsKeyRingCommHttpsCommPolChildren, map[string]interface{}{"tagAnnotation": tagAnnotationCommRsKeyRingCommHttpsCommPolChildMapForDelete}) + } + } + } + + var tagTagCommRsKeyRingCommHttpsCommPolPlan, tagTagCommRsKeyRingCommHttpsCommPolState []TagTagCommRsKeyRingCommHttpsCommPolResourceModel + commRsKeyRingCommHttpsCommPolPlan.TagTag.ElementsAs(ctx, &tagTagCommRsKeyRingCommHttpsCommPolPlan, false) + if !commRsKeyRingCommHttpsCommPolState.TagTag.IsNull() { + commRsKeyRingCommHttpsCommPolState.TagTag.ElementsAs(ctx, &tagTagCommRsKeyRingCommHttpsCommPolState, false) + } + if !commRsKeyRingCommHttpsCommPolPlan.TagTag.IsNull() && !commRsKeyRingCommHttpsCommPolPlan.TagTag.IsUnknown() { + tagTagIdentifiers := []TagTagIdentifier{} + for _, tagTagCommRsKeyRingCommHttpsCommPol := range tagTagCommRsKeyRingCommHttpsCommPolPlan { + tagTagCommRsKeyRingCommHttpsCommPolChildMap := NewAciObject() + if !tagTagCommRsKeyRingCommHttpsCommPol.Key.IsNull() && !tagTagCommRsKeyRingCommHttpsCommPol.Key.IsUnknown() { + tagTagCommRsKeyRingCommHttpsCommPolChildMap.Attributes["key"] = tagTagCommRsKeyRingCommHttpsCommPol.Key.ValueString() + } + if !tagTagCommRsKeyRingCommHttpsCommPol.Value.IsNull() && !tagTagCommRsKeyRingCommHttpsCommPol.Value.IsUnknown() { + tagTagCommRsKeyRingCommHttpsCommPolChildMap.Attributes["value"] = tagTagCommRsKeyRingCommHttpsCommPol.Value.ValueString() + } + CommRsKeyRingCommHttpsCommPolChildren = append(CommRsKeyRingCommHttpsCommPolChildren, map[string]interface{}{"tagTag": tagTagCommRsKeyRingCommHttpsCommPolChildMap}) + tagTagIdentifier := TagTagIdentifier{} + tagTagIdentifier.Key = tagTagCommRsKeyRingCommHttpsCommPol.Key + tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) + } + for _, tagTagCommRsKeyRingCommHttpsCommPol := range tagTagCommRsKeyRingCommHttpsCommPolState { + delete := true + for _, tagTagIdentifier := range tagTagIdentifiers { + if tagTagIdentifier.Key == tagTagCommRsKeyRingCommHttpsCommPol.Key { + delete = false + break + } + } + if delete { + tagTagCommRsKeyRingCommHttpsCommPolChildMapForDelete := NewAciObject() + tagTagCommRsKeyRingCommHttpsCommPolChildMapForDelete.Attributes["status"] = "deleted" + tagTagCommRsKeyRingCommHttpsCommPolChildMapForDelete.Attributes["key"] = tagTagCommRsKeyRingCommHttpsCommPol.Key.ValueString() + CommRsKeyRingCommHttpsCommPolChildren = append(CommRsKeyRingCommHttpsCommPolChildren, map[string]interface{}{"tagTag": tagTagCommRsKeyRingCommHttpsCommPolChildMapForDelete}) + } + } + } + commRsKeyRingCommHttpsCommPolChildMap.Children = CommRsKeyRingCommHttpsCommPolChildren + CommHttpsCommPolChildren = append(CommHttpsCommPolChildren, map[string]interface{}{"commRsKeyRing": commRsKeyRingCommHttpsCommPolChildMap}) + } + + var tagAnnotationCommHttpsCommPolPlan, tagAnnotationCommHttpsCommPolState []TagAnnotationCommHttpsCommPolResourceModel + commHttpsCommPolPlan.TagAnnotation.ElementsAs(ctx, &tagAnnotationCommHttpsCommPolPlan, false) + if !commHttpsCommPolState.TagAnnotation.IsNull() { + commHttpsCommPolState.TagAnnotation.ElementsAs(ctx, &tagAnnotationCommHttpsCommPolState, false) + } + if !commHttpsCommPolPlan.TagAnnotation.IsNull() && !commHttpsCommPolPlan.TagAnnotation.IsUnknown() { + tagAnnotationIdentifiers := []TagAnnotationIdentifier{} + for _, tagAnnotationCommHttpsCommPol := range tagAnnotationCommHttpsCommPolPlan { + tagAnnotationCommHttpsCommPolChildMap := NewAciObject() + if !tagAnnotationCommHttpsCommPol.Key.IsNull() && !tagAnnotationCommHttpsCommPol.Key.IsUnknown() { + tagAnnotationCommHttpsCommPolChildMap.Attributes["key"] = tagAnnotationCommHttpsCommPol.Key.ValueString() + } + if !tagAnnotationCommHttpsCommPol.Value.IsNull() && !tagAnnotationCommHttpsCommPol.Value.IsUnknown() { + tagAnnotationCommHttpsCommPolChildMap.Attributes["value"] = tagAnnotationCommHttpsCommPol.Value.ValueString() + } + CommHttpsCommPolChildren = append(CommHttpsCommPolChildren, map[string]interface{}{"tagAnnotation": tagAnnotationCommHttpsCommPolChildMap}) + tagAnnotationIdentifier := TagAnnotationIdentifier{} + tagAnnotationIdentifier.Key = tagAnnotationCommHttpsCommPol.Key + tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) + } + for _, tagAnnotationCommHttpsCommPol := range tagAnnotationCommHttpsCommPolState { + delete := true + for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { + if tagAnnotationIdentifier.Key == tagAnnotationCommHttpsCommPol.Key { + delete = false + break + } + } + if delete { + tagAnnotationCommHttpsCommPolChildMapForDelete := NewAciObject() + tagAnnotationCommHttpsCommPolChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationCommHttpsCommPolChildMapForDelete.Attributes["key"] = tagAnnotationCommHttpsCommPol.Key.ValueString() + CommHttpsCommPolChildren = append(CommHttpsCommPolChildren, map[string]interface{}{"tagAnnotation": tagAnnotationCommHttpsCommPolChildMapForDelete}) + } + } + } + + var tagTagCommHttpsCommPolPlan, tagTagCommHttpsCommPolState []TagTagCommHttpsCommPolResourceModel + commHttpsCommPolPlan.TagTag.ElementsAs(ctx, &tagTagCommHttpsCommPolPlan, false) + if !commHttpsCommPolState.TagTag.IsNull() { + commHttpsCommPolState.TagTag.ElementsAs(ctx, &tagTagCommHttpsCommPolState, false) + } + if !commHttpsCommPolPlan.TagTag.IsNull() && !commHttpsCommPolPlan.TagTag.IsUnknown() { + tagTagIdentifiers := []TagTagIdentifier{} + for _, tagTagCommHttpsCommPol := range tagTagCommHttpsCommPolPlan { + tagTagCommHttpsCommPolChildMap := NewAciObject() + if !tagTagCommHttpsCommPol.Key.IsNull() && !tagTagCommHttpsCommPol.Key.IsUnknown() { + tagTagCommHttpsCommPolChildMap.Attributes["key"] = tagTagCommHttpsCommPol.Key.ValueString() + } + if !tagTagCommHttpsCommPol.Value.IsNull() && !tagTagCommHttpsCommPol.Value.IsUnknown() { + tagTagCommHttpsCommPolChildMap.Attributes["value"] = tagTagCommHttpsCommPol.Value.ValueString() + } + CommHttpsCommPolChildren = append(CommHttpsCommPolChildren, map[string]interface{}{"tagTag": tagTagCommHttpsCommPolChildMap}) + tagTagIdentifier := TagTagIdentifier{} + tagTagIdentifier.Key = tagTagCommHttpsCommPol.Key + tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) + } + for _, tagTagCommHttpsCommPol := range tagTagCommHttpsCommPolState { + delete := true + for _, tagTagIdentifier := range tagTagIdentifiers { + if tagTagIdentifier.Key == tagTagCommHttpsCommPol.Key { + delete = false + break + } + } + if delete { + tagTagCommHttpsCommPolChildMapForDelete := NewAciObject() + tagTagCommHttpsCommPolChildMapForDelete.Attributes["status"] = "deleted" + tagTagCommHttpsCommPolChildMapForDelete.Attributes["key"] = tagTagCommHttpsCommPol.Key.ValueString() + CommHttpsCommPolChildren = append(CommHttpsCommPolChildren, map[string]interface{}{"tagTag": tagTagCommHttpsCommPolChildMapForDelete}) + } + } + } + childMap.Children = CommHttpsCommPolChildren + childPayloads = append(childPayloads, map[string]interface{}{"commHttps": childMap}) + } else { + CommHttpsObject, _ := types.ObjectValueFrom(ctx, CommHttpsCommPolType, getEmptyCommHttpsCommPolResourceModel()) + data.CommHttps = CommHttpsObject + } + + return childPayloads +} + +func getCommPolCommShellinaboxChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *CommPolResourceModel, commShellinaboxCommPolPlan, commShellinaboxCommPolState CommShellinaboxCommPolResourceModel) []map[string]interface{} { + childPayloads := []map[string]interface{}{} + if !data.CommShellinabox.IsNull() && !data.CommShellinabox.IsUnknown() { + CommShellinaboxCommPolChildren := make([]map[string]interface{}, 0) + childMap := NewAciObject() + if !IsEmptySingleNestedAttribute(data.CommShellinabox.Attributes()) { + if !commShellinaboxCommPolPlan.AdminSt.IsUnknown() && !commShellinaboxCommPolPlan.AdminSt.IsNull() { + childMap.Attributes["adminSt"] = commShellinaboxCommPolPlan.AdminSt.ValueString() + } + if !commShellinaboxCommPolPlan.Annotation.IsUnknown() && !commShellinaboxCommPolPlan.Annotation.IsNull() { + childMap.Attributes["annotation"] = commShellinaboxCommPolPlan.Annotation.ValueString() + } else { + childMap.Attributes["annotation"] = globalAnnotation + } + if !commShellinaboxCommPolPlan.Descr.IsUnknown() && !commShellinaboxCommPolPlan.Descr.IsNull() { + childMap.Attributes["descr"] = commShellinaboxCommPolPlan.Descr.ValueString() + } + if !commShellinaboxCommPolPlan.Name.IsUnknown() && !commShellinaboxCommPolPlan.Name.IsNull() { + childMap.Attributes["name"] = commShellinaboxCommPolPlan.Name.ValueString() + } + if !commShellinaboxCommPolPlan.NameAlias.IsUnknown() && !commShellinaboxCommPolPlan.NameAlias.IsNull() { + childMap.Attributes["nameAlias"] = commShellinaboxCommPolPlan.NameAlias.ValueString() + } + } + + var tagAnnotationCommShellinaboxCommPolPlan, tagAnnotationCommShellinaboxCommPolState []TagAnnotationCommShellinaboxCommPolResourceModel + commShellinaboxCommPolPlan.TagAnnotation.ElementsAs(ctx, &tagAnnotationCommShellinaboxCommPolPlan, false) + if !commShellinaboxCommPolState.TagAnnotation.IsNull() { + commShellinaboxCommPolState.TagAnnotation.ElementsAs(ctx, &tagAnnotationCommShellinaboxCommPolState, false) + } + if !commShellinaboxCommPolPlan.TagAnnotation.IsNull() && !commShellinaboxCommPolPlan.TagAnnotation.IsUnknown() { + tagAnnotationIdentifiers := []TagAnnotationIdentifier{} + for _, tagAnnotationCommShellinaboxCommPol := range tagAnnotationCommShellinaboxCommPolPlan { + tagAnnotationCommShellinaboxCommPolChildMap := NewAciObject() + if !tagAnnotationCommShellinaboxCommPol.Key.IsNull() && !tagAnnotationCommShellinaboxCommPol.Key.IsUnknown() { + tagAnnotationCommShellinaboxCommPolChildMap.Attributes["key"] = tagAnnotationCommShellinaboxCommPol.Key.ValueString() + } + if !tagAnnotationCommShellinaboxCommPol.Value.IsNull() && !tagAnnotationCommShellinaboxCommPol.Value.IsUnknown() { + tagAnnotationCommShellinaboxCommPolChildMap.Attributes["value"] = tagAnnotationCommShellinaboxCommPol.Value.ValueString() + } + CommShellinaboxCommPolChildren = append(CommShellinaboxCommPolChildren, map[string]interface{}{"tagAnnotation": tagAnnotationCommShellinaboxCommPolChildMap}) + tagAnnotationIdentifier := TagAnnotationIdentifier{} + tagAnnotationIdentifier.Key = tagAnnotationCommShellinaboxCommPol.Key + tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) + } + for _, tagAnnotationCommShellinaboxCommPol := range tagAnnotationCommShellinaboxCommPolState { + delete := true + for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { + if tagAnnotationIdentifier.Key == tagAnnotationCommShellinaboxCommPol.Key { + delete = false + break + } + } + if delete { + tagAnnotationCommShellinaboxCommPolChildMapForDelete := NewAciObject() + tagAnnotationCommShellinaboxCommPolChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationCommShellinaboxCommPolChildMapForDelete.Attributes["key"] = tagAnnotationCommShellinaboxCommPol.Key.ValueString() + CommShellinaboxCommPolChildren = append(CommShellinaboxCommPolChildren, map[string]interface{}{"tagAnnotation": tagAnnotationCommShellinaboxCommPolChildMapForDelete}) + } + } + } + + var tagTagCommShellinaboxCommPolPlan, tagTagCommShellinaboxCommPolState []TagTagCommShellinaboxCommPolResourceModel + commShellinaboxCommPolPlan.TagTag.ElementsAs(ctx, &tagTagCommShellinaboxCommPolPlan, false) + if !commShellinaboxCommPolState.TagTag.IsNull() { + commShellinaboxCommPolState.TagTag.ElementsAs(ctx, &tagTagCommShellinaboxCommPolState, false) + } + if !commShellinaboxCommPolPlan.TagTag.IsNull() && !commShellinaboxCommPolPlan.TagTag.IsUnknown() { + tagTagIdentifiers := []TagTagIdentifier{} + for _, tagTagCommShellinaboxCommPol := range tagTagCommShellinaboxCommPolPlan { + tagTagCommShellinaboxCommPolChildMap := NewAciObject() + if !tagTagCommShellinaboxCommPol.Key.IsNull() && !tagTagCommShellinaboxCommPol.Key.IsUnknown() { + tagTagCommShellinaboxCommPolChildMap.Attributes["key"] = tagTagCommShellinaboxCommPol.Key.ValueString() + } + if !tagTagCommShellinaboxCommPol.Value.IsNull() && !tagTagCommShellinaboxCommPol.Value.IsUnknown() { + tagTagCommShellinaboxCommPolChildMap.Attributes["value"] = tagTagCommShellinaboxCommPol.Value.ValueString() + } + CommShellinaboxCommPolChildren = append(CommShellinaboxCommPolChildren, map[string]interface{}{"tagTag": tagTagCommShellinaboxCommPolChildMap}) + tagTagIdentifier := TagTagIdentifier{} + tagTagIdentifier.Key = tagTagCommShellinaboxCommPol.Key + tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) + } + for _, tagTagCommShellinaboxCommPol := range tagTagCommShellinaboxCommPolState { + delete := true + for _, tagTagIdentifier := range tagTagIdentifiers { + if tagTagIdentifier.Key == tagTagCommShellinaboxCommPol.Key { + delete = false + break + } + } + if delete { + tagTagCommShellinaboxCommPolChildMapForDelete := NewAciObject() + tagTagCommShellinaboxCommPolChildMapForDelete.Attributes["status"] = "deleted" + tagTagCommShellinaboxCommPolChildMapForDelete.Attributes["key"] = tagTagCommShellinaboxCommPol.Key.ValueString() + CommShellinaboxCommPolChildren = append(CommShellinaboxCommPolChildren, map[string]interface{}{"tagTag": tagTagCommShellinaboxCommPolChildMapForDelete}) + } + } + } + childMap.Children = CommShellinaboxCommPolChildren + childPayloads = append(childPayloads, map[string]interface{}{"commShellinabox": childMap}) + } else { + CommShellinaboxObject, _ := types.ObjectValueFrom(ctx, CommShellinaboxCommPolType, getEmptyCommShellinaboxCommPolResourceModel()) + data.CommShellinabox = CommShellinaboxObject + } + + return childPayloads +} + +func getCommPolCommSshChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *CommPolResourceModel, commSshCommPolPlan, commSshCommPolState CommSshCommPolResourceModel) []map[string]interface{} { + childPayloads := []map[string]interface{}{} + if !data.CommSsh.IsNull() && !data.CommSsh.IsUnknown() { + CommSshCommPolChildren := make([]map[string]interface{}, 0) + childMap := NewAciObject() + if !IsEmptySingleNestedAttribute(data.CommSsh.Attributes()) { + if !commSshCommPolPlan.AdminSt.IsUnknown() && !commSshCommPolPlan.AdminSt.IsNull() { + childMap.Attributes["adminSt"] = commSshCommPolPlan.AdminSt.ValueString() + } + if !commSshCommPolPlan.Annotation.IsUnknown() && !commSshCommPolPlan.Annotation.IsNull() { + childMap.Attributes["annotation"] = commSshCommPolPlan.Annotation.ValueString() + } else { + childMap.Attributes["annotation"] = globalAnnotation + } + if !commSshCommPolPlan.Descr.IsUnknown() && !commSshCommPolPlan.Descr.IsNull() { + childMap.Attributes["descr"] = commSshCommPolPlan.Descr.ValueString() + } + if !commSshCommPolPlan.HostkeyAlgos.IsUnknown() && !commSshCommPolPlan.HostkeyAlgos.IsNull() { + var tmpHostkeyAlgos []string + commSshCommPolPlan.HostkeyAlgos.ElementsAs(ctx, &tmpHostkeyAlgos, false) + childMap.Attributes["hostkeyAlgos"] = strings.Join(tmpHostkeyAlgos, ",") + } + if !commSshCommPolPlan.KexAlgos.IsUnknown() && !commSshCommPolPlan.KexAlgos.IsNull() { + var tmpKexAlgos []string + commSshCommPolPlan.KexAlgos.ElementsAs(ctx, &tmpKexAlgos, false) + childMap.Attributes["kexAlgos"] = strings.Join(tmpKexAlgos, ",") + } + if !commSshCommPolPlan.Name.IsUnknown() && !commSshCommPolPlan.Name.IsNull() { + childMap.Attributes["name"] = commSshCommPolPlan.Name.ValueString() + } + if !commSshCommPolPlan.NameAlias.IsUnknown() && !commSshCommPolPlan.NameAlias.IsNull() { + childMap.Attributes["nameAlias"] = commSshCommPolPlan.NameAlias.ValueString() + } + if !commSshCommPolPlan.PasswordAuth.IsUnknown() && !commSshCommPolPlan.PasswordAuth.IsNull() { + childMap.Attributes["passwordAuth"] = commSshCommPolPlan.PasswordAuth.ValueString() + } + if !commSshCommPolPlan.Port.IsUnknown() && !commSshCommPolPlan.Port.IsNull() { + childMap.Attributes["port"] = commSshCommPolPlan.Port.ValueString() + } + if !commSshCommPolPlan.SshCiphers.IsUnknown() && !commSshCommPolPlan.SshCiphers.IsNull() { + var tmpSshCiphers []string + commSshCommPolPlan.SshCiphers.ElementsAs(ctx, &tmpSshCiphers, false) + childMap.Attributes["sshCiphers"] = strings.Join(tmpSshCiphers, ",") + } + if !commSshCommPolPlan.SshMacs.IsUnknown() && !commSshCommPolPlan.SshMacs.IsNull() { + var tmpSshMacs []string + commSshCommPolPlan.SshMacs.ElementsAs(ctx, &tmpSshMacs, false) + childMap.Attributes["sshMacs"] = strings.Join(tmpSshMacs, ",") + } + } + + var tagAnnotationCommSshCommPolPlan, tagAnnotationCommSshCommPolState []TagAnnotationCommSshCommPolResourceModel + commSshCommPolPlan.TagAnnotation.ElementsAs(ctx, &tagAnnotationCommSshCommPolPlan, false) + if !commSshCommPolState.TagAnnotation.IsNull() { + commSshCommPolState.TagAnnotation.ElementsAs(ctx, &tagAnnotationCommSshCommPolState, false) + } + if !commSshCommPolPlan.TagAnnotation.IsNull() && !commSshCommPolPlan.TagAnnotation.IsUnknown() { + tagAnnotationIdentifiers := []TagAnnotationIdentifier{} + for _, tagAnnotationCommSshCommPol := range tagAnnotationCommSshCommPolPlan { + tagAnnotationCommSshCommPolChildMap := NewAciObject() + if !tagAnnotationCommSshCommPol.Key.IsNull() && !tagAnnotationCommSshCommPol.Key.IsUnknown() { + tagAnnotationCommSshCommPolChildMap.Attributes["key"] = tagAnnotationCommSshCommPol.Key.ValueString() + } + if !tagAnnotationCommSshCommPol.Value.IsNull() && !tagAnnotationCommSshCommPol.Value.IsUnknown() { + tagAnnotationCommSshCommPolChildMap.Attributes["value"] = tagAnnotationCommSshCommPol.Value.ValueString() + } + CommSshCommPolChildren = append(CommSshCommPolChildren, map[string]interface{}{"tagAnnotation": tagAnnotationCommSshCommPolChildMap}) + tagAnnotationIdentifier := TagAnnotationIdentifier{} + tagAnnotationIdentifier.Key = tagAnnotationCommSshCommPol.Key + tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) + } + for _, tagAnnotationCommSshCommPol := range tagAnnotationCommSshCommPolState { + delete := true + for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { + if tagAnnotationIdentifier.Key == tagAnnotationCommSshCommPol.Key { + delete = false + break + } + } + if delete { + tagAnnotationCommSshCommPolChildMapForDelete := NewAciObject() + tagAnnotationCommSshCommPolChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationCommSshCommPolChildMapForDelete.Attributes["key"] = tagAnnotationCommSshCommPol.Key.ValueString() + CommSshCommPolChildren = append(CommSshCommPolChildren, map[string]interface{}{"tagAnnotation": tagAnnotationCommSshCommPolChildMapForDelete}) + } + } + } + + var tagTagCommSshCommPolPlan, tagTagCommSshCommPolState []TagTagCommSshCommPolResourceModel + commSshCommPolPlan.TagTag.ElementsAs(ctx, &tagTagCommSshCommPolPlan, false) + if !commSshCommPolState.TagTag.IsNull() { + commSshCommPolState.TagTag.ElementsAs(ctx, &tagTagCommSshCommPolState, false) + } + if !commSshCommPolPlan.TagTag.IsNull() && !commSshCommPolPlan.TagTag.IsUnknown() { + tagTagIdentifiers := []TagTagIdentifier{} + for _, tagTagCommSshCommPol := range tagTagCommSshCommPolPlan { + tagTagCommSshCommPolChildMap := NewAciObject() + if !tagTagCommSshCommPol.Key.IsNull() && !tagTagCommSshCommPol.Key.IsUnknown() { + tagTagCommSshCommPolChildMap.Attributes["key"] = tagTagCommSshCommPol.Key.ValueString() + } + if !tagTagCommSshCommPol.Value.IsNull() && !tagTagCommSshCommPol.Value.IsUnknown() { + tagTagCommSshCommPolChildMap.Attributes["value"] = tagTagCommSshCommPol.Value.ValueString() + } + CommSshCommPolChildren = append(CommSshCommPolChildren, map[string]interface{}{"tagTag": tagTagCommSshCommPolChildMap}) + tagTagIdentifier := TagTagIdentifier{} + tagTagIdentifier.Key = tagTagCommSshCommPol.Key + tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) + } + for _, tagTagCommSshCommPol := range tagTagCommSshCommPolState { + delete := true + for _, tagTagIdentifier := range tagTagIdentifiers { + if tagTagIdentifier.Key == tagTagCommSshCommPol.Key { + delete = false + break + } + } + if delete { + tagTagCommSshCommPolChildMapForDelete := NewAciObject() + tagTagCommSshCommPolChildMapForDelete.Attributes["status"] = "deleted" + tagTagCommSshCommPolChildMapForDelete.Attributes["key"] = tagTagCommSshCommPol.Key.ValueString() + CommSshCommPolChildren = append(CommSshCommPolChildren, map[string]interface{}{"tagTag": tagTagCommSshCommPolChildMapForDelete}) + } + } + } + childMap.Children = CommSshCommPolChildren + childPayloads = append(childPayloads, map[string]interface{}{"commSsh": childMap}) + } else { + CommSshObject, _ := types.ObjectValueFrom(ctx, CommSshCommPolType, getEmptyCommSshCommPolResourceModel()) + data.CommSsh = CommSshObject + } + + return childPayloads +} + +func getCommPolCommTelnetChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *CommPolResourceModel, commTelnetCommPolPlan, commTelnetCommPolState CommTelnetCommPolResourceModel) []map[string]interface{} { + childPayloads := []map[string]interface{}{} + if !data.CommTelnet.IsNull() && !data.CommTelnet.IsUnknown() { + CommTelnetCommPolChildren := make([]map[string]interface{}, 0) + childMap := NewAciObject() + if !IsEmptySingleNestedAttribute(data.CommTelnet.Attributes()) { + if !commTelnetCommPolPlan.AdminSt.IsUnknown() && !commTelnetCommPolPlan.AdminSt.IsNull() { + childMap.Attributes["adminSt"] = commTelnetCommPolPlan.AdminSt.ValueString() + } + if !commTelnetCommPolPlan.Annotation.IsUnknown() && !commTelnetCommPolPlan.Annotation.IsNull() { + childMap.Attributes["annotation"] = commTelnetCommPolPlan.Annotation.ValueString() + } else { + childMap.Attributes["annotation"] = globalAnnotation + } + if !commTelnetCommPolPlan.Descr.IsUnknown() && !commTelnetCommPolPlan.Descr.IsNull() { + childMap.Attributes["descr"] = commTelnetCommPolPlan.Descr.ValueString() + } + if !commTelnetCommPolPlan.Name.IsUnknown() && !commTelnetCommPolPlan.Name.IsNull() { + childMap.Attributes["name"] = commTelnetCommPolPlan.Name.ValueString() + } + if !commTelnetCommPolPlan.NameAlias.IsUnknown() && !commTelnetCommPolPlan.NameAlias.IsNull() { + childMap.Attributes["nameAlias"] = commTelnetCommPolPlan.NameAlias.ValueString() + } + if !commTelnetCommPolPlan.Port.IsUnknown() && !commTelnetCommPolPlan.Port.IsNull() { + childMap.Attributes["port"] = commTelnetCommPolPlan.Port.ValueString() + } + } + + var tagAnnotationCommTelnetCommPolPlan, tagAnnotationCommTelnetCommPolState []TagAnnotationCommTelnetCommPolResourceModel + commTelnetCommPolPlan.TagAnnotation.ElementsAs(ctx, &tagAnnotationCommTelnetCommPolPlan, false) + if !commTelnetCommPolState.TagAnnotation.IsNull() { + commTelnetCommPolState.TagAnnotation.ElementsAs(ctx, &tagAnnotationCommTelnetCommPolState, false) + } + if !commTelnetCommPolPlan.TagAnnotation.IsNull() && !commTelnetCommPolPlan.TagAnnotation.IsUnknown() { + tagAnnotationIdentifiers := []TagAnnotationIdentifier{} + for _, tagAnnotationCommTelnetCommPol := range tagAnnotationCommTelnetCommPolPlan { + tagAnnotationCommTelnetCommPolChildMap := NewAciObject() + if !tagAnnotationCommTelnetCommPol.Key.IsNull() && !tagAnnotationCommTelnetCommPol.Key.IsUnknown() { + tagAnnotationCommTelnetCommPolChildMap.Attributes["key"] = tagAnnotationCommTelnetCommPol.Key.ValueString() + } + if !tagAnnotationCommTelnetCommPol.Value.IsNull() && !tagAnnotationCommTelnetCommPol.Value.IsUnknown() { + tagAnnotationCommTelnetCommPolChildMap.Attributes["value"] = tagAnnotationCommTelnetCommPol.Value.ValueString() + } + CommTelnetCommPolChildren = append(CommTelnetCommPolChildren, map[string]interface{}{"tagAnnotation": tagAnnotationCommTelnetCommPolChildMap}) + tagAnnotationIdentifier := TagAnnotationIdentifier{} + tagAnnotationIdentifier.Key = tagAnnotationCommTelnetCommPol.Key + tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) + } + for _, tagAnnotationCommTelnetCommPol := range tagAnnotationCommTelnetCommPolState { + delete := true + for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { + if tagAnnotationIdentifier.Key == tagAnnotationCommTelnetCommPol.Key { + delete = false + break + } + } + if delete { + tagAnnotationCommTelnetCommPolChildMapForDelete := NewAciObject() + tagAnnotationCommTelnetCommPolChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationCommTelnetCommPolChildMapForDelete.Attributes["key"] = tagAnnotationCommTelnetCommPol.Key.ValueString() + CommTelnetCommPolChildren = append(CommTelnetCommPolChildren, map[string]interface{}{"tagAnnotation": tagAnnotationCommTelnetCommPolChildMapForDelete}) + } + } + } + + var tagTagCommTelnetCommPolPlan, tagTagCommTelnetCommPolState []TagTagCommTelnetCommPolResourceModel + commTelnetCommPolPlan.TagTag.ElementsAs(ctx, &tagTagCommTelnetCommPolPlan, false) + if !commTelnetCommPolState.TagTag.IsNull() { + commTelnetCommPolState.TagTag.ElementsAs(ctx, &tagTagCommTelnetCommPolState, false) + } + if !commTelnetCommPolPlan.TagTag.IsNull() && !commTelnetCommPolPlan.TagTag.IsUnknown() { + tagTagIdentifiers := []TagTagIdentifier{} + for _, tagTagCommTelnetCommPol := range tagTagCommTelnetCommPolPlan { + tagTagCommTelnetCommPolChildMap := NewAciObject() + if !tagTagCommTelnetCommPol.Key.IsNull() && !tagTagCommTelnetCommPol.Key.IsUnknown() { + tagTagCommTelnetCommPolChildMap.Attributes["key"] = tagTagCommTelnetCommPol.Key.ValueString() + } + if !tagTagCommTelnetCommPol.Value.IsNull() && !tagTagCommTelnetCommPol.Value.IsUnknown() { + tagTagCommTelnetCommPolChildMap.Attributes["value"] = tagTagCommTelnetCommPol.Value.ValueString() + } + CommTelnetCommPolChildren = append(CommTelnetCommPolChildren, map[string]interface{}{"tagTag": tagTagCommTelnetCommPolChildMap}) + tagTagIdentifier := TagTagIdentifier{} + tagTagIdentifier.Key = tagTagCommTelnetCommPol.Key + tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) + } + for _, tagTagCommTelnetCommPol := range tagTagCommTelnetCommPolState { + delete := true + for _, tagTagIdentifier := range tagTagIdentifiers { + if tagTagIdentifier.Key == tagTagCommTelnetCommPol.Key { + delete = false + break + } + } + if delete { + tagTagCommTelnetCommPolChildMapForDelete := NewAciObject() + tagTagCommTelnetCommPolChildMapForDelete.Attributes["status"] = "deleted" + tagTagCommTelnetCommPolChildMapForDelete.Attributes["key"] = tagTagCommTelnetCommPol.Key.ValueString() + CommTelnetCommPolChildren = append(CommTelnetCommPolChildren, map[string]interface{}{"tagTag": tagTagCommTelnetCommPolChildMapForDelete}) + } + } + } + childMap.Children = CommTelnetCommPolChildren + childPayloads = append(childPayloads, map[string]interface{}{"commTelnet": childMap}) + } else { + CommTelnetObject, _ := types.ObjectValueFrom(ctx, CommTelnetCommPolType, getEmptyCommTelnetCommPolResourceModel()) + data.CommTelnet = CommTelnetObject + } + + return childPayloads +} + +func getCommPolTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *CommPolResourceModel, tagAnnotationCommPolPlan, tagAnnotationCommPolState []TagAnnotationCommPolResourceModel) []map[string]interface{} { + childPayloads := []map[string]interface{}{} + if !data.TagAnnotation.IsNull() && !data.TagAnnotation.IsUnknown() { + tagAnnotationIdentifiers := []TagAnnotationIdentifier{} + for _, tagAnnotationCommPol := range tagAnnotationCommPolPlan { + childMap := NewAciObject() + if !tagAnnotationCommPol.Key.IsNull() && !tagAnnotationCommPol.Key.IsUnknown() { + childMap.Attributes["key"] = tagAnnotationCommPol.Key.ValueString() + } + if !tagAnnotationCommPol.Value.IsNull() && !tagAnnotationCommPol.Value.IsUnknown() { + childMap.Attributes["value"] = tagAnnotationCommPol.Value.ValueString() + } + childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) + tagAnnotationIdentifier := TagAnnotationIdentifier{} + tagAnnotationIdentifier.Key = tagAnnotationCommPol.Key + tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) + } + for _, tagAnnotation := range tagAnnotationCommPolState { + delete := true + for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { + if tagAnnotationIdentifier.Key == tagAnnotation.Key { + delete = false + break + } + } + if delete { + tagAnnotationChildMapForDelete := NewAciObject() + tagAnnotationChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationChildMapForDelete.Attributes["key"] = tagAnnotation.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": tagAnnotationChildMapForDelete}) + } + } + } else { + data.TagAnnotation = types.SetNull(data.TagAnnotation.ElementType(ctx)) + } + + return childPayloads +} + +func getCommPolTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *CommPolResourceModel, tagTagCommPolPlan, tagTagCommPolState []TagTagCommPolResourceModel) []map[string]interface{} { + childPayloads := []map[string]interface{}{} + if !data.TagTag.IsNull() && !data.TagTag.IsUnknown() { + tagTagIdentifiers := []TagTagIdentifier{} + for _, tagTagCommPol := range tagTagCommPolPlan { + childMap := NewAciObject() + if !tagTagCommPol.Key.IsNull() && !tagTagCommPol.Key.IsUnknown() { + childMap.Attributes["key"] = tagTagCommPol.Key.ValueString() + } + if !tagTagCommPol.Value.IsNull() && !tagTagCommPol.Value.IsUnknown() { + childMap.Attributes["value"] = tagTagCommPol.Value.ValueString() + } + childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) + tagTagIdentifier := TagTagIdentifier{} + tagTagIdentifier.Key = tagTagCommPol.Key + tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) + } + for _, tagTag := range tagTagCommPolState { + delete := true + for _, tagTagIdentifier := range tagTagIdentifiers { + if tagTagIdentifier.Key == tagTag.Key { + delete = false + break + } + } + if delete { + tagTagChildMapForDelete := NewAciObject() + tagTagChildMapForDelete.Attributes["status"] = "deleted" + tagTagChildMapForDelete.Attributes["key"] = tagTag.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagTag": tagTagChildMapForDelete}) + } + } + } else { + data.TagTag = types.SetNull(data.TagTag.ElementType(ctx)) + } + + return childPayloads +} + +func getCommPolCreateJsonPayload(ctx context.Context, diags *diag.Diagnostics, createType bool, data *CommPolResourceModel, commHttpPlan, commHttpState CommHttpCommPolResourceModel, commHttpsPlan, commHttpsState CommHttpsCommPolResourceModel, commShellinaboxPlan, commShellinaboxState CommShellinaboxCommPolResourceModel, commSshPlan, commSshState CommSshCommPolResourceModel, commTelnetPlan, commTelnetState CommTelnetCommPolResourceModel, tagAnnotationPlan, tagAnnotationState []TagAnnotationCommPolResourceModel, tagTagPlan, tagTagState []TagTagCommPolResourceModel) *container.Container { + payloadMap := map[string]interface{}{} + payloadMap["attributes"] = map[string]string{} + + if createType && !globalAllowExistingOnCreate { + payloadMap["attributes"].(map[string]string)["status"] = "created" + } + childPayloads := []map[string]interface{}{} + + CommHttpchildPayloads := getCommPolCommHttpChildPayloads(ctx, diags, data, commHttpPlan, commHttpState) + if CommHttpchildPayloads == nil { + return nil + } + childPayloads = append(childPayloads, CommHttpchildPayloads...) + + CommHttpschildPayloads := getCommPolCommHttpsChildPayloads(ctx, diags, data, commHttpsPlan, commHttpsState) + if CommHttpschildPayloads == nil { + return nil + } + childPayloads = append(childPayloads, CommHttpschildPayloads...) + + CommShellinaboxchildPayloads := getCommPolCommShellinaboxChildPayloads(ctx, diags, data, commShellinaboxPlan, commShellinaboxState) + if CommShellinaboxchildPayloads == nil { + return nil + } + childPayloads = append(childPayloads, CommShellinaboxchildPayloads...) + + CommSshchildPayloads := getCommPolCommSshChildPayloads(ctx, diags, data, commSshPlan, commSshState) + if CommSshchildPayloads == nil { + return nil + } + childPayloads = append(childPayloads, CommSshchildPayloads...) + + CommTelnetchildPayloads := getCommPolCommTelnetChildPayloads(ctx, diags, data, commTelnetPlan, commTelnetState) + if CommTelnetchildPayloads == nil { + return nil + } + childPayloads = append(childPayloads, CommTelnetchildPayloads...) + + TagAnnotationchildPayloads := getCommPolTagAnnotationChildPayloads(ctx, diags, data, tagAnnotationPlan, tagAnnotationState) + if TagAnnotationchildPayloads == nil { + return nil + } + childPayloads = append(childPayloads, TagAnnotationchildPayloads...) + + TagTagchildPayloads := getCommPolTagTagChildPayloads(ctx, diags, data, tagTagPlan, tagTagState) + if TagTagchildPayloads == nil { + return nil + } + childPayloads = append(childPayloads, TagTagchildPayloads...) + + payloadMap["children"] = childPayloads + if !data.Annotation.IsNull() && !data.Annotation.IsUnknown() { + payloadMap["attributes"].(map[string]string)["annotation"] = data.Annotation.ValueString() + } + if !data.Descr.IsNull() && !data.Descr.IsUnknown() { + payloadMap["attributes"].(map[string]string)["descr"] = data.Descr.ValueString() + } + if !data.Name.IsNull() && !data.Name.IsUnknown() { + payloadMap["attributes"].(map[string]string)["name"] = data.Name.ValueString() + } + if !data.NameAlias.IsNull() && !data.NameAlias.IsUnknown() { + payloadMap["attributes"].(map[string]string)["nameAlias"] = data.NameAlias.ValueString() + } + if !data.OwnerKey.IsNull() && !data.OwnerKey.IsUnknown() { + payloadMap["attributes"].(map[string]string)["ownerKey"] = data.OwnerKey.ValueString() + } + if !data.OwnerTag.IsNull() && !data.OwnerTag.IsUnknown() { + payloadMap["attributes"].(map[string]string)["ownerTag"] = data.OwnerTag.ValueString() + } + if !data.StrictSecurityOnApicOOBSubnet.IsNull() && !data.StrictSecurityOnApicOOBSubnet.IsUnknown() { + payloadMap["attributes"].(map[string]string)["strictSecurityOnApicOOBSubnet"] = data.StrictSecurityOnApicOOBSubnet.ValueString() + } + payload, err := json.Marshal(map[string]interface{}{"commPol": payloadMap}) + if err != nil { + diags.AddError( + "Marshalling of json payload failed", + fmt.Sprintf("Err: %s. Please report this issue to the provider developers.", err), + ) + return nil + } + + jsonPayload, err := container.ParseJSON(payload) + + if err != nil { + diags.AddError( + "Construction of json payload failed", + fmt.Sprintf("Err: %s. Please report this issue to the provider developers.", err), + ) + return nil + } + return jsonPayload +} diff --git a/internal/provider/resource_aci_management_access_policy_test.go b/internal/provider/resource_aci_management_access_policy_test.go new file mode 100644 index 000000000..970127da2 --- /dev/null +++ b/internal/provider/resource_aci_management_access_policy_test.go @@ -0,0 +1,1301 @@ +// Code generated by "gen/generator.go"; DO NOT EDIT. +// In order to regenerate this file execute `go generate` from the repository root. +// More details can be found in the [README](https://github.com/CiscoDevNet/terraform-provider-aci/blob/master/README.md). + +package provider + +import ( + "regexp" + "testing" + + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/knownvalue" + "github.com/hashicorp/terraform-plugin-testing/statecheck" + "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" +) + +func TestAccResourceCommPol(t *testing.T) { + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t, "both", "6.0(2h)") }, + ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, + Steps: []resource.TestStep{ + // Create with minimum config and verify default APIC values + { + Config: testConfigCommPolMinAllowExisting + testConfigDataSourceSystem, + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr("aci_management_access_policy.allow_test", "name", "test_name"), + resource.TestCheckResourceAttr("aci_management_access_policy.allow_test_2", "name", "test_name"), + resource.TestCheckResourceAttr("aci_management_access_policy.allow_test", "annotation", "orchestrator:terraform"), + resource.TestCheckResourceAttr("aci_management_access_policy.allow_test_2", "annotation", "orchestrator:terraform"), + resource.TestCheckResourceAttr("aci_management_access_policy.allow_test", "description", ""), + resource.TestCheckResourceAttr("aci_management_access_policy.allow_test_2", "description", ""), + resource.TestCheckResourceAttr("aci_management_access_policy.allow_test", "name_alias", ""), + resource.TestCheckResourceAttr("aci_management_access_policy.allow_test_2", "name_alias", ""), + resource.TestCheckResourceAttr("aci_management_access_policy.allow_test", "owner_key", ""), + resource.TestCheckResourceAttr("aci_management_access_policy.allow_test_2", "owner_key", ""), + resource.TestCheckResourceAttr("aci_management_access_policy.allow_test", "owner_tag", ""), + resource.TestCheckResourceAttr("aci_management_access_policy.allow_test_2", "owner_tag", ""), + ), + }, + }, + }) + + setEnvVariable(t, "ACI_ALLOW_EXISTING_ON_CREATE", "false") + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t, "both", "6.0(2h)") }, + ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, + Steps: []resource.TestStep{ + // Create with minimum config and verify default APIC values + { + Config: testConfigCommPolMinAllowExisting, + ExpectError: regexp.MustCompile("Object Already Exists"), + }, + }, + }) + + setEnvVariable(t, "ACI_ALLOW_EXISTING_ON_CREATE", "true") + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t, "both", "6.0(2h)") }, + ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, + Steps: []resource.TestStep{ + // Create with minimum config and verify default APIC values + { + Config: testConfigCommPolMinAllowExisting + testConfigDataSourceSystem, + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr("aci_management_access_policy.allow_test", "name", "test_name"), + resource.TestCheckResourceAttr("aci_management_access_policy.allow_test_2", "name", "test_name"), + resource.TestCheckResourceAttr("aci_management_access_policy.allow_test", "annotation", "orchestrator:terraform"), + resource.TestCheckResourceAttr("aci_management_access_policy.allow_test_2", "annotation", "orchestrator:terraform"), + resource.TestCheckResourceAttr("aci_management_access_policy.allow_test", "description", ""), + resource.TestCheckResourceAttr("aci_management_access_policy.allow_test_2", "description", ""), + resource.TestCheckResourceAttr("aci_management_access_policy.allow_test", "name_alias", ""), + resource.TestCheckResourceAttr("aci_management_access_policy.allow_test_2", "name_alias", ""), + resource.TestCheckResourceAttr("aci_management_access_policy.allow_test", "owner_key", ""), + resource.TestCheckResourceAttr("aci_management_access_policy.allow_test_2", "owner_key", ""), + resource.TestCheckResourceAttr("aci_management_access_policy.allow_test", "owner_tag", ""), + resource.TestCheckResourceAttr("aci_management_access_policy.allow_test_2", "owner_tag", ""), + ), + }, + }, + }) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t, "both", "6.0(2h)") }, + ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, + Steps: []resource.TestStep{ + // Create with minimum config and verify default APIC values + { + Config: testConfigCommPolMin + testConfigDataSourceSystem, + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr("aci_management_access_policy.test", "name", "test_name"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "annotation", "orchestrator:terraform"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "description", ""), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "name_alias", ""), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "owner_key", ""), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "owner_tag", ""), + ), + }, + // Update with all config and verify default APIC values + { + Config: testConfigCommPolAll + testConfigDataSourceSystem, + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr("aci_management_access_policy.test", "name", "test_name"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "annotation", "annotation"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "description", "description_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "name_alias", "name_alias_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "owner_key", "owner_key_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "owner_tag", "owner_tag_1"), + ), + }, + // Update with minimum config and verify config is unchanged + { + Config: testConfigCommPolMin + testConfigDataSourceSystem, + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr("aci_management_access_policy.test", "name", "test_name"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "annotation", "orchestrator:terraform"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "description", "description_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "name_alias", "name_alias_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "owner_key", "owner_key_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "owner_tag", "owner_tag_1"), + ), + }, + // Update with empty strings config or default value + { + Config: testConfigCommPolReset + testConfigDataSourceSystem, + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr("aci_management_access_policy.test", "name", "test_name"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "annotation", "orchestrator:terraform"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "description", ""), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "name_alias", ""), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "owner_key", ""), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "owner_tag", ""), + ), + }, + // Import testing + { + ResourceName: "aci_management_access_policy.test", + ImportState: true, + ImportStateVerify: true, + }, + // Update with children + { + Config: testConfigCommPolChildren + testConfigDataSourceSystem, + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr("aci_management_access_policy.test", "annotation", "orchestrator:terraform"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "description", ""), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "name_alias", ""), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "owner_key", ""), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "owner_tag", ""), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "annotations.#", "2"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.access_control_allow_credential", "disabled"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.access_control_allow_origins", "access_control_allow_origins_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.admin_state", "disabled"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.annotations.#", "2"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.tags.#", "2"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.description", "description_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.max_request_status_count", "0"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.name", "name_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.name_alias", "name_alias_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.port", "80"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.redirect_state", "disabled"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.throttle_rate", "2"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.throttle_state", "disabled"), + composeAggregateTestCheckFuncWithVersion(t, "4.1(1i)", ">=", + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.cli_only_mode", "disabled")), + composeAggregateTestCheckFuncWithVersion(t, "4.2(1i)", ">=", + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.global_throttle_rate", "10000"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.global_throttle_state", "disabled"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.global_throttle_unit", "r/s")), + composeAggregateTestCheckFuncWithVersion(t, "5.2(1g)", ">=", + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.server_header", "disabled")), + composeAggregateTestCheckFuncWithVersion(t, "5.2(3e)", ">=", + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.node_exporter", "disabled")), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.visore_access", "disabled"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.access_control_allow_credential", "disabled"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.access_control_allow_origins", "access_control_allow_origins_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.admin_state", "enabled"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.annotations.#", "2"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.certificate_authority.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.certificate_authority.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.certificate_authority.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.certificate_authority.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.certificate_authority.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.certificate_authority.annotations.#", "2"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.certificate_authority.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.certificate_authority.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.certificate_authority.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.certificate_authority.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.certificate_authority.tags.#", "2"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.certificate_authority.target_dn", "uni/userext/pkiext/tp-test_name"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.annotations.#", "2"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.tags.#", "2"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.key_ring_name", "default"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.tags.#", "2"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.description", "description_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.dh_param", "1024"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.max_request_status_count", "0"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.name", "name_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.name_alias", "name_alias_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.port", "443"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.ssl_protocols.#", "1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.ssl_protocols.0", "TLSv1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.throttle_rate", "2"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.throttle_state", "disabled"), + composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)", ">=", + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.client_cert_auth_state", "disabled")), + composeAggregateTestCheckFuncWithVersion(t, "4.1(1i)", ">=", + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.cli_only_mode", "disabled")), + composeAggregateTestCheckFuncWithVersion(t, "4.2(1i)", ">=", + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.global_throttle_rate", "10000"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.global_throttle_state", "disabled"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.global_throttle_unit", "r/s")), + composeAggregateTestCheckFuncWithVersion(t, "5.2(1g)", ">=", + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.server_header", "disabled")), + composeAggregateTestCheckFuncWithVersion(t, "5.2(3e)", ">=", + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.node_exporter", "disabled")), + composeAggregateTestCheckFuncWithVersion(t, "6.0(2h)", ">=", + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.referer", "referer_1")), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.visore_access", "disabled"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.admin_state", "disabled"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.annotations.#", "2"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.tags.#", "2"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.description", "description_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.name", "name_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.name_alias", "name_alias_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.admin_state", "disabled"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.annotations.#", "2"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.tags.#", "2"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.description", "description_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.name", "name_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.name_alias", "name_alias_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.port", "22"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.ssh_ciphers.#", "1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.ssh_ciphers.0", "aes192-ctr"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.ssh_macs.#", "1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.ssh_macs.0", "hmac-sha1"), + composeAggregateTestCheckFuncWithVersion(t, "4.1(1i)", ">=", + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.password_auth", "disabled")), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "tags.#", "2"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.admin_state", "disabled"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.annotations.#", "2"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.tags.#", "2"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.description", "description_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.name", "name_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.name_alias", "name_alias_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.port", "23"), + ), + }, + // Update with children removed from config + { + Config: testConfigCommPolChildrenRemoveFromConfig + testConfigDataSourceSystem, + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr("aci_management_access_policy.test", "annotation", "orchestrator:terraform"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "description", ""), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "name_alias", ""), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "owner_key", ""), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "owner_tag", ""), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "annotations.#", "2"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.access_control_allow_credential", "disabled"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.access_control_allow_origins", "access_control_allow_origins_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.admin_state", "disabled"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.annotations.#", "2"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.tags.#", "2"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.description", "description_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.max_request_status_count", "0"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.name", "name_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.name_alias", "name_alias_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.port", "80"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.redirect_state", "disabled"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.throttle_rate", "2"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.throttle_state", "disabled"), + composeAggregateTestCheckFuncWithVersion(t, "4.1(1i)", ">=", + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.cli_only_mode", "disabled")), + composeAggregateTestCheckFuncWithVersion(t, "4.2(1i)", ">=", + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.global_throttle_rate", "10000"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.global_throttle_state", "disabled"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.global_throttle_unit", "r/s")), + composeAggregateTestCheckFuncWithVersion(t, "5.2(1g)", ">=", + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.server_header", "disabled")), + composeAggregateTestCheckFuncWithVersion(t, "5.2(3e)", ">=", + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.node_exporter", "disabled")), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.visore_access", "disabled"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.access_control_allow_credential", "disabled"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.access_control_allow_origins", "access_control_allow_origins_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.admin_state", "enabled"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.annotations.#", "2"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.certificate_authority.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.certificate_authority.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.certificate_authority.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.certificate_authority.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.certificate_authority.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.certificate_authority.annotations.#", "2"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.certificate_authority.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.certificate_authority.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.certificate_authority.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.certificate_authority.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.certificate_authority.tags.#", "2"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.certificate_authority.target_dn", "uni/userext/pkiext/tp-test_name"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.annotations.#", "2"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.tags.#", "2"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.key_ring_name", "default"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.tags.#", "2"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.description", "description_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.dh_param", "1024"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.max_request_status_count", "0"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.name", "name_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.name_alias", "name_alias_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.port", "443"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.ssl_protocols.#", "1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.ssl_protocols.0", "TLSv1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.throttle_rate", "2"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.throttle_state", "disabled"), + composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)", ">=", + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.client_cert_auth_state", "disabled")), + composeAggregateTestCheckFuncWithVersion(t, "4.1(1i)", ">=", + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.cli_only_mode", "disabled")), + composeAggregateTestCheckFuncWithVersion(t, "4.2(1i)", ">=", + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.global_throttle_rate", "10000"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.global_throttle_state", "disabled"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.global_throttle_unit", "r/s")), + composeAggregateTestCheckFuncWithVersion(t, "5.2(1g)", ">=", + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.server_header", "disabled")), + composeAggregateTestCheckFuncWithVersion(t, "5.2(3e)", ">=", + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.node_exporter", "disabled")), + composeAggregateTestCheckFuncWithVersion(t, "6.0(2h)", ">=", + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.referer", "referer_1")), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.visore_access", "disabled"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.admin_state", "disabled"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.annotations.#", "2"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.tags.#", "2"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.description", "description_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.name", "name_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.name_alias", "name_alias_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.admin_state", "disabled"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.annotations.#", "2"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.tags.#", "2"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.description", "description_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.name", "name_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.name_alias", "name_alias_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.port", "22"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.ssh_ciphers.#", "1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.ssh_ciphers.0", "aes192-ctr"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.ssh_macs.#", "1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.ssh_macs.0", "hmac-sha1"), + composeAggregateTestCheckFuncWithVersion(t, "4.1(1i)", ">=", + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.password_auth", "disabled")), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "tags.#", "2"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.admin_state", "disabled"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.annotations.#", "2"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.tags.#", "2"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.description", "description_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.name", "name_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.name_alias", "name_alias_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.port", "23"), + ), + }, + // Update with children first child removed + { + Config: testConfigCommPolChildrenRemoveOne + testConfigDataSourceSystem, + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr("aci_management_access_policy.test", "annotation", "orchestrator:terraform"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "description", ""), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "name_alias", ""), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "owner_key", ""), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "owner_tag", ""), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "annotations.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "annotations.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "annotations.#", "1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.access_control_allow_credential", "disabled"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.access_control_allow_origins", "access_control_allow_origins_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.admin_state", "disabled"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.annotations.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.annotations.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.annotations.#", "1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.tags.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.tags.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.tags.#", "1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.description", "description_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.max_request_status_count", "0"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.name", "name_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.name_alias", "name_alias_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.port", "80"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.redirect_state", "disabled"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.throttle_rate", "2"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.throttle_state", "disabled"), + composeAggregateTestCheckFuncWithVersion(t, "4.1(1i)", ">=", + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.cli_only_mode", "disabled")), + composeAggregateTestCheckFuncWithVersion(t, "4.2(1i)", ">=", + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.global_throttle_rate", "10000"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.global_throttle_state", "disabled"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.global_throttle_unit", "r/s")), + composeAggregateTestCheckFuncWithVersion(t, "5.2(1g)", ">=", + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.server_header", "disabled")), + composeAggregateTestCheckFuncWithVersion(t, "5.2(3e)", ">=", + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.node_exporter", "disabled")), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.visore_access", "disabled"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.access_control_allow_credential", "disabled"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.access_control_allow_origins", "access_control_allow_origins_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.admin_state", "enabled"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.annotations.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.annotations.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.annotations.#", "1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.annotations.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.annotations.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.annotations.#", "1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.tags.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.tags.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.tags.#", "1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.key_ring_name", "default"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.tags.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.tags.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.tags.#", "1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.description", "description_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.dh_param", "1024"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.max_request_status_count", "0"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.name", "name_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.name_alias", "name_alias_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.port", "443"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.ssl_protocols.#", "1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.ssl_protocols.0", "TLSv1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.throttle_rate", "2"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.throttle_state", "disabled"), + composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)", ">=", + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.client_cert_auth_state", "disabled")), + composeAggregateTestCheckFuncWithVersion(t, "4.1(1i)", ">=", + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.cli_only_mode", "disabled")), + composeAggregateTestCheckFuncWithVersion(t, "4.2(1i)", ">=", + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.global_throttle_rate", "10000"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.global_throttle_state", "disabled"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.global_throttle_unit", "r/s")), + composeAggregateTestCheckFuncWithVersion(t, "5.2(1g)", ">=", + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.server_header", "disabled")), + composeAggregateTestCheckFuncWithVersion(t, "5.2(3e)", ">=", + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.node_exporter", "disabled")), + composeAggregateTestCheckFuncWithVersion(t, "6.0(2h)", ">=", + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.referer", "referer_1")), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.visore_access", "disabled"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.admin_state", "disabled"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.annotations.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.annotations.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.annotations.#", "1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.tags.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.tags.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.tags.#", "1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.description", "description_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.name", "name_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.name_alias", "name_alias_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.admin_state", "disabled"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.annotations.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.annotations.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.annotations.#", "1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.tags.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.tags.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.tags.#", "1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.description", "description_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.name", "name_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.name_alias", "name_alias_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.port", "22"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.ssh_ciphers.#", "1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.ssh_ciphers.0", "aes192-ctr"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.ssh_macs.#", "1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.ssh_macs.0", "hmac-sha1"), + composeAggregateTestCheckFuncWithVersion(t, "4.1(1i)", ">=", + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.password_auth", "disabled")), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "tags.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "tags.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "tags.#", "1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.admin_state", "disabled"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.annotations.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.annotations.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.annotations.#", "1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.tags.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.tags.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.tags.#", "1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.description", "description_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.name", "name_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.name_alias", "name_alias_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.port", "23"), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue("aci_management_access_policy.test", + tfjsonpath.New("http_ssl_configuration").AtMapKey("certificate_authority"), + knownvalue.MapExact( + map[string]knownvalue.Check{ + "annotation": knownvalue.Null(), + "annotations": knownvalue.Null(), + "tags": knownvalue.Null(), + "target_dn": knownvalue.Null(), + }, + ), + ), + }, + }, + // Update with all children removed + { + Config: testConfigCommPolChildrenRemoveAll + testConfigDataSourceSystem, + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr("aci_management_access_policy.test", "annotation", "orchestrator:terraform"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "description", ""), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "name_alias", ""), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "owner_key", ""), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "owner_tag", ""), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "annotations.#", "0"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.access_control_allow_credential", "disabled"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.access_control_allow_origins", "access_control_allow_origins_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.admin_state", "disabled"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.annotations.#", "0"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.tags.#", "0"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.description", "description_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.max_request_status_count", "0"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.name", "name_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.name_alias", "name_alias_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.port", "80"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.redirect_state", "disabled"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.throttle_rate", "2"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.throttle_state", "disabled"), + composeAggregateTestCheckFuncWithVersion(t, "4.1(1i)", ">=", + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.cli_only_mode", "disabled")), + composeAggregateTestCheckFuncWithVersion(t, "4.2(1i)", ">=", + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.global_throttle_rate", "10000"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.global_throttle_state", "disabled"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.global_throttle_unit", "r/s")), + composeAggregateTestCheckFuncWithVersion(t, "5.2(1g)", ">=", + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.server_header", "disabled")), + composeAggregateTestCheckFuncWithVersion(t, "5.2(3e)", ">=", + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.node_exporter", "disabled")), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.visore_access", "disabled"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.access_control_allow_credential", "disabled"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.access_control_allow_origins", "access_control_allow_origins_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.admin_state", "enabled"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.annotations.#", "0"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.annotations.#", "0"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.tags.#", "0"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.key_ring_name", "default"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.tags.#", "0"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.description", "description_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.dh_param", "1024"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.max_request_status_count", "0"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.name", "name_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.name_alias", "name_alias_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.port", "443"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.ssl_protocols.#", "1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.ssl_protocols.0", "TLSv1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.throttle_rate", "2"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.throttle_state", "disabled"), + composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)", ">=", + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.client_cert_auth_state", "disabled")), + composeAggregateTestCheckFuncWithVersion(t, "4.1(1i)", ">=", + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.cli_only_mode", "disabled")), + composeAggregateTestCheckFuncWithVersion(t, "4.2(1i)", ">=", + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.global_throttle_rate", "10000"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.global_throttle_state", "disabled"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.global_throttle_unit", "r/s")), + composeAggregateTestCheckFuncWithVersion(t, "5.2(1g)", ">=", + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.server_header", "disabled")), + composeAggregateTestCheckFuncWithVersion(t, "5.2(3e)", ">=", + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.node_exporter", "disabled")), + composeAggregateTestCheckFuncWithVersion(t, "6.0(2h)", ">=", + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.referer", "referer_1")), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.visore_access", "disabled"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.admin_state", "disabled"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.annotations.#", "0"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.tags.#", "0"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.description", "description_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.name", "name_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.name_alias", "name_alias_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.admin_state", "disabled"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.annotations.#", "0"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.tags.#", "0"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.description", "description_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.name", "name_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.name_alias", "name_alias_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.port", "22"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.ssh_ciphers.#", "1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.ssh_ciphers.0", "aes192-ctr"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.ssh_macs.#", "1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.ssh_macs.0", "hmac-sha1"), + composeAggregateTestCheckFuncWithVersion(t, "4.1(1i)", ">=", + resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.password_auth", "disabled")), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "tags.#", "0"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.admin_state", "disabled"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.annotations.#", "0"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.tags.#", "0"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.description", "description_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.name", "name_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.name_alias", "name_alias_1"), + resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.port", "23"), + ), + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue("aci_management_access_policy.test", + tfjsonpath.New("http_ssl_configuration").AtMapKey("certificate_authority"), + knownvalue.MapExact( + map[string]knownvalue.Check{ + "annotation": knownvalue.Null(), + "annotations": knownvalue.Null(), + "tags": knownvalue.Null(), + "target_dn": knownvalue.Null(), + }, + ), + ), + }, + }, + }, + CheckDestroy: testCheckResourceDestroy, + }) +} + +const testChildDependencyConfigCommPol = ` +resource "aci_certificate_authority" "test_certificate_authority_0"{ + certificate_chain = "-----BEGIN CERTIFICATE-----\nMIICODCCAaGgAwIBAgIJAIt8XMntue0VMA0GCSqGSIb3DQEBCwUAMDQxDjAMBgNV\nBAMMBUFkbWluMRUwEwYDVQQKDAxZb3VyIENvbXBhbnkxCzAJBgNVBAYTAlVTMCAX\nDTE4MDEwOTAwNTk0NFoYDzIxMTcxMjE2MDA1OTQ0WjA0MQ4wDAYDVQQDDAVBZG1p\nbjEVMBMGA1UECgwMWW91ciBDb21wYW55MQswCQYDVQQGEwJVUzCBnzANBgkqhkiG\n9w0BAQEFAAOBjQAwgYkCgYEAohG/7axtt7CbSaMP7r+2mhTKbNgh0Ww36C7Ta14i\nv+VmLyKkQHnXinKGhp6uy3Nug+15a+eIu7CrgpBVMQeCiWfsnwRocKcQJWIYDrWl\nXHxGQn31yYKR6mylE7Dcj3rMFybnyhezr5D8GcP85YRPmwG9H2hO/0Y1FUnWu9Iw\nAQkCAwEAAaNQME4wHQYDVR0OBBYEFD0jLXfpkrU/ChzRvfruRs/fy1VXMB8GA1Ud\nIwQYMBaAFD0jLXfpkrU/ChzRvfruRs/fy1VXMAwGA1UdEwQFMAMBAf8wDQYJKoZI\nhvcNAQELBQADgYEAOmvre+5tgZ0+F3DgsfxNQqLTrGiBgGCIymPkP/cBXXkNuJyl\n3ac7tArHQc7WEA4U2R2rZbEq8FC3UJJm4nUVtCPvEh3G9OhN2xwYev79yt6pIn/l\nKU0Td2OpVyo0eLqjoX5u2G90IBWzhyjFbo+CcKMrSVKj1YOdG0E3OuiJf00=\n-----END CERTIFICATE-----" + name = "test_name" +} +` + +const testConfigCommPolMinAllowExisting = ` +resource "aci_management_access_policy" "allow_test" { + name = "test_name" +} +resource "aci_management_access_policy" "allow_test_2" { + name = "test_name" + depends_on = [aci_management_access_policy.allow_test] +} +` + +const testConfigCommPolMin = ` +resource "aci_management_access_policy" "test" { + name = "test_name" +} +` + +const testConfigCommPolAll = ` +resource "aci_management_access_policy" "test" { + name = "test_name" + annotation = "annotation" + description = "description_1" + name_alias = "name_alias_1" + owner_key = "owner_key_1" + owner_tag = "owner_tag_1" +} +` + +const testConfigCommPolReset = ` +resource "aci_management_access_policy" "test" { + name = "test_name" + annotation = "orchestrator:terraform" + description = "" + name_alias = "" + owner_key = "" + owner_tag = "" +} +` +const testConfigCommPolChildren = testChildDependencyConfigCommPol + ` +resource "aci_management_access_policy" "test" { + name = "test_name" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + http_service = { + access_control_allow_credential = "disabled" + access_control_allow_origins = "access_control_allow_origins_1" + admin_state = "disabled" + annotation = "annotation_1" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + description = "description_1" + max_request_status_count = "0" + name = "name_1" + name_alias = "name_alias_1" + port = "80" + redirect_state = "disabled" + throttle_rate = "2" + throttle_state = "disabled" + cli_only_mode = provider::aci::compare_versions(data.aci_system.version.version,">=","4.1(1i)") ? "disabled" : null + global_throttle_rate = provider::aci::compare_versions(data.aci_system.version.version,">=","4.2(1i)") ? "10000" : null + global_throttle_state = provider::aci::compare_versions(data.aci_system.version.version,">=","4.2(1i)") ? "disabled" : null + global_throttle_unit = provider::aci::compare_versions(data.aci_system.version.version,">=","4.2(1i)") ? "r/s" : null + server_header = provider::aci::compare_versions(data.aci_system.version.version,">=","5.2(1g)") ? "disabled" : null + node_exporter = provider::aci::compare_versions(data.aci_system.version.version,">=","5.2(3e)") ? "disabled" : null + visore_access = "disabled" + } + http_ssl_configuration = { + access_control_allow_credential = "disabled" + access_control_allow_origins = "access_control_allow_origins_1" + admin_state = "enabled" + annotation = "annotation_1" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + certificate_authority = { + annotation = "annotation_1" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + target_dn = "uni/userext/pkiext/tp-test_name" + } + key_ring = { + annotation = "annotation_1" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + key_ring_name = "default" + } + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + description = "description_1" + dh_param = "1024" + max_request_status_count = "0" + name = "name_1" + name_alias = "name_alias_1" + port = "443" + ssl_protocols = ["TLSv1"] + throttle_rate = "2" + throttle_state = "disabled" + client_cert_auth_state = provider::aci::compare_versions(data.aci_system.version.version,">=","4.0(1h)") ? "disabled" : null + cli_only_mode = provider::aci::compare_versions(data.aci_system.version.version,">=","4.1(1i)") ? "disabled" : null + global_throttle_rate = provider::aci::compare_versions(data.aci_system.version.version,">=","4.2(1i)") ? "10000" : null + global_throttle_state = provider::aci::compare_versions(data.aci_system.version.version,">=","4.2(1i)") ? "disabled" : null + global_throttle_unit = provider::aci::compare_versions(data.aci_system.version.version,">=","4.2(1i)") ? "r/s" : null + server_header = provider::aci::compare_versions(data.aci_system.version.version,">=","5.2(1g)") ? "disabled" : null + node_exporter = provider::aci::compare_versions(data.aci_system.version.version,">=","5.2(3e)") ? "disabled" : null + referer = provider::aci::compare_versions(data.aci_system.version.version,">=","6.0(2h)") ? "referer_1" : null + visore_access = "disabled" + } + ssh_access_via_web = { + admin_state = "disabled" + annotation = "annotation_1" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + description = "description_1" + name = "name_1" + name_alias = "name_alias_1" + } + ssh_service = { + admin_state = "disabled" + annotation = "annotation_1" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + description = "description_1" + name = "name_1" + name_alias = "name_alias_1" + port = "22" + ssh_ciphers = ["aes192-ctr"] + ssh_macs = ["hmac-sha1"] + password_auth = provider::aci::compare_versions(data.aci_system.version.version,">=","4.1(1i)") ? "disabled" : null + } + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + telnet_service = { + admin_state = "disabled" + annotation = "annotation_1" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + description = "description_1" + name = "name_1" + name_alias = "name_alias_1" + port = "23" + } + + depends_on = [aci_certificate_authority.test_certificate_authority_0] +} +` + +const testConfigCommPolChildrenRemoveFromConfig = testChildDependencyConfigCommPol + ` +resource "aci_management_access_policy" "test" { + name = "test_name" +} +` + +const testConfigCommPolChildrenRemoveOne = testChildDependencyConfigCommPol + ` +resource "aci_management_access_policy" "test" { + name = "test_name" + annotations = [ + { + key = "key_1" + value = "test_value" + }, + ] + http_service = { + access_control_allow_credential = "disabled" + access_control_allow_origins = "access_control_allow_origins_1" + admin_state = "disabled" + annotation = "annotation_1" + annotations = [ + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_1" + value = "test_value" + }, + ] + description = "description_1" + max_request_status_count = "0" + name = "name_1" + name_alias = "name_alias_1" + port = "80" + redirect_state = "disabled" + throttle_rate = "2" + throttle_state = "disabled" + cli_only_mode = provider::aci::compare_versions(data.aci_system.version.version,">=","4.1(1i)") ? "disabled" : null + global_throttle_rate = provider::aci::compare_versions(data.aci_system.version.version,">=","4.2(1i)") ? "10000" : null + global_throttle_state = provider::aci::compare_versions(data.aci_system.version.version,">=","4.2(1i)") ? "disabled" : null + global_throttle_unit = provider::aci::compare_versions(data.aci_system.version.version,">=","4.2(1i)") ? "r/s" : null + server_header = provider::aci::compare_versions(data.aci_system.version.version,">=","5.2(1g)") ? "disabled" : null + node_exporter = provider::aci::compare_versions(data.aci_system.version.version,">=","5.2(3e)") ? "disabled" : null + visore_access = "disabled" + } + http_ssl_configuration = { + access_control_allow_credential = "disabled" + access_control_allow_origins = "access_control_allow_origins_1" + admin_state = "enabled" + annotation = "annotation_1" + annotations = [ + { + key = "key_1" + value = "test_value" + }, + ] + certificate_authority = {} + key_ring = { + annotation = "annotation_1" + annotations = [ + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_1" + value = "test_value" + }, + ] + key_ring_name = "default" + } + tags = [ + { + key = "key_1" + value = "test_value" + }, + ] + description = "description_1" + dh_param = "1024" + max_request_status_count = "0" + name = "name_1" + name_alias = "name_alias_1" + port = "443" + ssl_protocols = ["TLSv1"] + throttle_rate = "2" + throttle_state = "disabled" + client_cert_auth_state = provider::aci::compare_versions(data.aci_system.version.version,">=","4.0(1h)") ? "disabled" : null + cli_only_mode = provider::aci::compare_versions(data.aci_system.version.version,">=","4.1(1i)") ? "disabled" : null + global_throttle_rate = provider::aci::compare_versions(data.aci_system.version.version,">=","4.2(1i)") ? "10000" : null + global_throttle_state = provider::aci::compare_versions(data.aci_system.version.version,">=","4.2(1i)") ? "disabled" : null + global_throttle_unit = provider::aci::compare_versions(data.aci_system.version.version,">=","4.2(1i)") ? "r/s" : null + server_header = provider::aci::compare_versions(data.aci_system.version.version,">=","5.2(1g)") ? "disabled" : null + node_exporter = provider::aci::compare_versions(data.aci_system.version.version,">=","5.2(3e)") ? "disabled" : null + referer = provider::aci::compare_versions(data.aci_system.version.version,">=","6.0(2h)") ? "referer_1" : null + visore_access = "disabled" + } + ssh_access_via_web = { + admin_state = "disabled" + annotation = "annotation_1" + annotations = [ + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_1" + value = "test_value" + }, + ] + description = "description_1" + name = "name_1" + name_alias = "name_alias_1" + } + ssh_service = { + admin_state = "disabled" + annotation = "annotation_1" + annotations = [ + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_1" + value = "test_value" + }, + ] + description = "description_1" + name = "name_1" + name_alias = "name_alias_1" + port = "22" + ssh_ciphers = ["aes192-ctr"] + ssh_macs = ["hmac-sha1"] + password_auth = provider::aci::compare_versions(data.aci_system.version.version,">=","4.1(1i)") ? "disabled" : null + } + tags = [ + { + key = "key_1" + value = "test_value" + }, + ] + telnet_service = { + admin_state = "disabled" + annotation = "annotation_1" + annotations = [ + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_1" + value = "test_value" + }, + ] + description = "description_1" + name = "name_1" + name_alias = "name_alias_1" + port = "23" + } +} +` + +const testConfigCommPolChildrenRemoveAll = testChildDependencyConfigCommPol + ` +resource "aci_management_access_policy" "test" { + name = "test_name" + annotations = [] + http_service = { + access_control_allow_credential = "disabled" + access_control_allow_origins = "access_control_allow_origins_1" + admin_state = "disabled" + annotation = "annotation_1" + annotations = [] + tags = [] + description = "description_1" + max_request_status_count = "0" + name = "name_1" + name_alias = "name_alias_1" + port = "80" + redirect_state = "disabled" + throttle_rate = "2" + throttle_state = "disabled" + cli_only_mode = provider::aci::compare_versions(data.aci_system.version.version,">=","4.1(1i)") ? "disabled" : null + global_throttle_rate = provider::aci::compare_versions(data.aci_system.version.version,">=","4.2(1i)") ? "10000" : null + global_throttle_state = provider::aci::compare_versions(data.aci_system.version.version,">=","4.2(1i)") ? "disabled" : null + global_throttle_unit = provider::aci::compare_versions(data.aci_system.version.version,">=","4.2(1i)") ? "r/s" : null + server_header = provider::aci::compare_versions(data.aci_system.version.version,">=","5.2(1g)") ? "disabled" : null + node_exporter = provider::aci::compare_versions(data.aci_system.version.version,">=","5.2(3e)") ? "disabled" : null + visore_access = "disabled" + } + http_ssl_configuration = { + access_control_allow_credential = "disabled" + access_control_allow_origins = "access_control_allow_origins_1" + admin_state = "enabled" + annotation = "annotation_1" + annotations = [] + certificate_authority = {} + key_ring = { + annotation = "annotation_1" + annotations = [] + tags = [] + key_ring_name = "default" + } + tags = [] + description = "description_1" + dh_param = "1024" + max_request_status_count = "0" + name = "name_1" + name_alias = "name_alias_1" + port = "443" + ssl_protocols = ["TLSv1"] + throttle_rate = "2" + throttle_state = "disabled" + client_cert_auth_state = provider::aci::compare_versions(data.aci_system.version.version,">=","4.0(1h)") ? "disabled" : null + cli_only_mode = provider::aci::compare_versions(data.aci_system.version.version,">=","4.1(1i)") ? "disabled" : null + global_throttle_rate = provider::aci::compare_versions(data.aci_system.version.version,">=","4.2(1i)") ? "10000" : null + global_throttle_state = provider::aci::compare_versions(data.aci_system.version.version,">=","4.2(1i)") ? "disabled" : null + global_throttle_unit = provider::aci::compare_versions(data.aci_system.version.version,">=","4.2(1i)") ? "r/s" : null + server_header = provider::aci::compare_versions(data.aci_system.version.version,">=","5.2(1g)") ? "disabled" : null + node_exporter = provider::aci::compare_versions(data.aci_system.version.version,">=","5.2(3e)") ? "disabled" : null + referer = provider::aci::compare_versions(data.aci_system.version.version,">=","6.0(2h)") ? "referer_1" : null + visore_access = "disabled" + } + ssh_access_via_web = { + admin_state = "disabled" + annotation = "annotation_1" + annotations = [] + tags = [] + description = "description_1" + name = "name_1" + name_alias = "name_alias_1" + } + ssh_service = { + admin_state = "disabled" + annotation = "annotation_1" + annotations = [] + tags = [] + description = "description_1" + name = "name_1" + name_alias = "name_alias_1" + port = "22" + ssh_ciphers = ["aes192-ctr"] + ssh_macs = ["hmac-sha1"] + password_auth = provider::aci::compare_versions(data.aci_system.version.version,">=","4.1(1i)") ? "disabled" : null + } + tags = [] + telnet_service = { + admin_state = "disabled" + annotation = "annotation_1" + annotations = [] + tags = [] + description = "description_1" + name = "name_1" + name_alias = "name_alias_1" + port = "23" + } +} +` diff --git a/internal/provider/resource_aci_mld_snooping_policy.go b/internal/provider/resource_aci_mld_snooping_policy.go index eaacc7b32..4f78f55af 100644 --- a/internal/provider/resource_aci_mld_snooping_policy.go +++ b/internal/provider/resource_aci_mld_snooping_policy.go @@ -110,6 +110,13 @@ func getEmptyTagAnnotationMldSnoopPolResourceModel() TagAnnotationMldSnoopPolRes } } +var TagAnnotationMldSnoopPolType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // TagTagMldSnoopPolResourceModel describes the resource data model for the children without relation ships. type TagTagMldSnoopPolResourceModel struct { Key types.String `tfsdk:"key"` @@ -123,6 +130,13 @@ func getEmptyTagTagMldSnoopPolResourceModel() TagTagMldSnoopPolResourceModel { } } +var TagTagMldSnoopPolType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + type MldSnoopPolIdentifier struct { Name types.String } @@ -557,7 +571,7 @@ func (r *MldSnoopPolResource) ImportState(ctx context.Context, req resource.Impo } func getAndSetMldSnoopPolAttributes(ctx context.Context, diags *diag.Diagnostics, client *client.Client, data *MldSnoopPolResourceModel) { - requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=children&rsp-subtree-class=%s", data.Id.ValueString(), "mldSnoopPol,tagAnnotation,tagTag"), "GET", nil) + requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=full&rsp-subtree-class=%s", data.Id.ValueString(), "mldSnoopPol,tagAnnotation,tagTag"), "GET", nil) readData := getEmptyMldSnoopPolResourceModel() @@ -638,6 +652,7 @@ func getAndSetMldSnoopPolAttributes(ctx context.Context, diags *diag.Diagnostics if childAttributeName == "value" { TagAnnotationMldSnoopPol.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagAnnotationMldSnoopPolList = append(TagAnnotationMldSnoopPolList, TagAnnotationMldSnoopPol) } @@ -650,6 +665,7 @@ func getAndSetMldSnoopPolAttributes(ctx context.Context, diags *diag.Diagnostics if childAttributeName == "value" { TagTagMldSnoopPol.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagTagMldSnoopPolList = append(TagTagMldSnoopPolList, TagTagMldSnoopPol) } @@ -697,25 +713,24 @@ func setMldSnoopPolId(ctx context.Context, data *MldSnoopPolResourceModel) { data.Id = types.StringValue(fmt.Sprintf("%s/%s", data.ParentDn.ValueString(), rn)) } -func getMldSnoopPolTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *MldSnoopPolResourceModel, tagAnnotationPlan, tagAnnotationState []TagAnnotationMldSnoopPolResourceModel) []map[string]interface{} { - +func getMldSnoopPolTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *MldSnoopPolResourceModel, tagAnnotationMldSnoopPolPlan, tagAnnotationMldSnoopPolState []TagAnnotationMldSnoopPolResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagAnnotation.IsUnknown() { + if !data.TagAnnotation.IsNull() && !data.TagAnnotation.IsUnknown() { tagAnnotationIdentifiers := []TagAnnotationIdentifier{} - for _, tagAnnotation := range tagAnnotationPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagAnnotation.Key.IsUnknown() && !tagAnnotation.Key.IsNull() { - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() + for _, tagAnnotationMldSnoopPol := range tagAnnotationMldSnoopPolPlan { + childMap := NewAciObject() + if !tagAnnotationMldSnoopPol.Key.IsNull() && !tagAnnotationMldSnoopPol.Key.IsUnknown() { + childMap.Attributes["key"] = tagAnnotationMldSnoopPol.Key.ValueString() } - if !tagAnnotation.Value.IsUnknown() && !tagAnnotation.Value.IsNull() { - childMap["attributes"]["value"] = tagAnnotation.Value.ValueString() + if !tagAnnotationMldSnoopPol.Value.IsNull() && !tagAnnotationMldSnoopPol.Value.IsUnknown() { + childMap.Attributes["value"] = tagAnnotationMldSnoopPol.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) tagAnnotationIdentifier := TagAnnotationIdentifier{} - tagAnnotationIdentifier.Key = tagAnnotation.Key + tagAnnotationIdentifier.Key = tagAnnotationMldSnoopPol.Key tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) } - for _, tagAnnotation := range tagAnnotationState { + for _, tagAnnotation := range tagAnnotationMldSnoopPolState { delete := true for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { if tagAnnotationIdentifier.Key == tagAnnotation.Key { @@ -724,10 +739,10 @@ func getMldSnoopPolTagAnnotationChildPayloads(ctx context.Context, diags *diag.D } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) + tagAnnotationChildMapForDelete := NewAciObject() + tagAnnotationChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationChildMapForDelete.Attributes["key"] = tagAnnotation.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": tagAnnotationChildMapForDelete}) } } } else { @@ -736,25 +751,25 @@ func getMldSnoopPolTagAnnotationChildPayloads(ctx context.Context, diags *diag.D return childPayloads } -func getMldSnoopPolTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *MldSnoopPolResourceModel, tagTagPlan, tagTagState []TagTagMldSnoopPolResourceModel) []map[string]interface{} { +func getMldSnoopPolTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *MldSnoopPolResourceModel, tagTagMldSnoopPolPlan, tagTagMldSnoopPolState []TagTagMldSnoopPolResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagTag.IsUnknown() { + if !data.TagTag.IsNull() && !data.TagTag.IsUnknown() { tagTagIdentifiers := []TagTagIdentifier{} - for _, tagTag := range tagTagPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagTag.Key.IsUnknown() && !tagTag.Key.IsNull() { - childMap["attributes"]["key"] = tagTag.Key.ValueString() + for _, tagTagMldSnoopPol := range tagTagMldSnoopPolPlan { + childMap := NewAciObject() + if !tagTagMldSnoopPol.Key.IsNull() && !tagTagMldSnoopPol.Key.IsUnknown() { + childMap.Attributes["key"] = tagTagMldSnoopPol.Key.ValueString() } - if !tagTag.Value.IsUnknown() && !tagTag.Value.IsNull() { - childMap["attributes"]["value"] = tagTag.Value.ValueString() + if !tagTagMldSnoopPol.Value.IsNull() && !tagTagMldSnoopPol.Value.IsUnknown() { + childMap.Attributes["value"] = tagTagMldSnoopPol.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) tagTagIdentifier := TagTagIdentifier{} - tagTagIdentifier.Key = tagTag.Key + tagTagIdentifier.Key = tagTagMldSnoopPol.Key tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) } - for _, tagTag := range tagTagState { + for _, tagTag := range tagTagMldSnoopPolState { delete := true for _, tagTagIdentifier := range tagTagIdentifiers { if tagTagIdentifier.Key == tagTag.Key { @@ -763,10 +778,10 @@ func getMldSnoopPolTagTagChildPayloads(ctx context.Context, diags *diag.Diagnost } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagTag.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) + tagTagChildMapForDelete := NewAciObject() + tagTagChildMapForDelete.Attributes["status"] = "deleted" + tagTagChildMapForDelete.Attributes["key"] = tagTag.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagTag": tagTagChildMapForDelete}) } } } else { diff --git a/internal/provider/resource_aci_mld_snooping_policy_test.go b/internal/provider/resource_aci_mld_snooping_policy_test.go index 34b865dba..1fed7bdab 100644 --- a/internal/provider/resource_aci_mld_snooping_policy_test.go +++ b/internal/provider/resource_aci_mld_snooping_policy_test.go @@ -48,7 +48,7 @@ func TestAccResourceMldSnoopPolWithFvTenant(t *testing.T) { resource.TestCheckResourceAttr("aci_mld_snooping_policy.allow_test_2", "start_query_count", "2"), resource.TestCheckResourceAttr("aci_mld_snooping_policy.allow_test", "start_query_interval", "31"), resource.TestCheckResourceAttr("aci_mld_snooping_policy.allow_test_2", "start_query_interval", "31"), - composeAggregateTestCheckFuncWithVersion(t, "5.1(1h)", ">", + composeAggregateTestCheckFuncWithVersion(t, "5.1(1h)", ">=", resource.TestCheckResourceAttr("aci_mld_snooping_policy.allow_test", "version", "v2"), resource.TestCheckResourceAttr("aci_mld_snooping_policy.allow_test_2", "version", "v2")), ), @@ -105,7 +105,7 @@ func TestAccResourceMldSnoopPolWithFvTenant(t *testing.T) { resource.TestCheckResourceAttr("aci_mld_snooping_policy.allow_test_2", "start_query_count", "2"), resource.TestCheckResourceAttr("aci_mld_snooping_policy.allow_test", "start_query_interval", "31"), resource.TestCheckResourceAttr("aci_mld_snooping_policy.allow_test_2", "start_query_interval", "31"), - composeAggregateTestCheckFuncWithVersion(t, "5.1(1h)", ">", + composeAggregateTestCheckFuncWithVersion(t, "5.1(1h)", ">=", resource.TestCheckResourceAttr("aci_mld_snooping_policy.allow_test", "version", "v2"), resource.TestCheckResourceAttr("aci_mld_snooping_policy.allow_test_2", "version", "v2")), ), @@ -135,7 +135,7 @@ func TestAccResourceMldSnoopPolWithFvTenant(t *testing.T) { resource.TestCheckResourceAttr("aci_mld_snooping_policy.test", "response_interval", "10"), resource.TestCheckResourceAttr("aci_mld_snooping_policy.test", "start_query_count", "2"), resource.TestCheckResourceAttr("aci_mld_snooping_policy.test", "start_query_interval", "31"), - composeAggregateTestCheckFuncWithVersion(t, "5.1(1h)", ">", + composeAggregateTestCheckFuncWithVersion(t, "5.1(1h)", ">=", resource.TestCheckResourceAttr("aci_mld_snooping_policy.test", "version", "v2")), ), }, @@ -159,7 +159,7 @@ func TestAccResourceMldSnoopPolWithFvTenant(t *testing.T) { resource.TestCheckResourceAttr("aci_mld_snooping_policy.test", "response_interval", "11"), resource.TestCheckResourceAttr("aci_mld_snooping_policy.test", "start_query_count", "9"), resource.TestCheckResourceAttr("aci_mld_snooping_policy.test", "start_query_interval", "2"), - composeAggregateTestCheckFuncWithVersion(t, "5.1(1h)", ">", + composeAggregateTestCheckFuncWithVersion(t, "5.1(1h)", ">=", resource.TestCheckResourceAttr("aci_mld_snooping_policy.test", "version", "unspecified")), ), }, @@ -189,7 +189,7 @@ func TestAccResourceMldSnoopPolWithFvTenant(t *testing.T) { resource.TestCheckResourceAttr("aci_mld_snooping_policy.test", "response_interval", "10"), resource.TestCheckResourceAttr("aci_mld_snooping_policy.test", "start_query_count", "2"), resource.TestCheckResourceAttr("aci_mld_snooping_policy.test", "start_query_interval", "31"), - composeAggregateTestCheckFuncWithVersion(t, "5.1(1h)", ">", + composeAggregateTestCheckFuncWithVersion(t, "5.1(1h)", ">=", resource.TestCheckResourceAttr("aci_mld_snooping_policy.test", "version", "v2")), ), }, @@ -217,7 +217,7 @@ func TestAccResourceMldSnoopPolWithFvTenant(t *testing.T) { resource.TestCheckResourceAttr("aci_mld_snooping_policy.test", "response_interval", "10"), resource.TestCheckResourceAttr("aci_mld_snooping_policy.test", "start_query_count", "2"), resource.TestCheckResourceAttr("aci_mld_snooping_policy.test", "start_query_interval", "31"), - composeAggregateTestCheckFuncWithVersion(t, "5.1(1h)", ">", + composeAggregateTestCheckFuncWithVersion(t, "5.1(1h)", ">=", resource.TestCheckResourceAttr("aci_mld_snooping_policy.test", "version", "v2")), resource.TestCheckResourceAttr("aci_mld_snooping_policy.test", "annotations.0.key", "key_0"), resource.TestCheckResourceAttr("aci_mld_snooping_policy.test", "annotations.0.value", "value_1"), @@ -347,24 +347,24 @@ resource "aci_mld_snooping_policy" "test" { parent_dn = aci_tenant.test.id name = "test_name" annotations = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] tags = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] } ` diff --git a/internal/provider/resource_aci_neighbor_discovery_interface_policy.go b/internal/provider/resource_aci_neighbor_discovery_interface_policy.go index 05da6a2dc..acc585d11 100644 --- a/internal/provider/resource_aci_neighbor_discovery_interface_policy.go +++ b/internal/provider/resource_aci_neighbor_discovery_interface_policy.go @@ -118,6 +118,13 @@ func getEmptyTagAnnotationNdIfPolResourceModel() TagAnnotationNdIfPolResourceMod } } +var TagAnnotationNdIfPolType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // TagTagNdIfPolResourceModel describes the resource data model for the children without relation ships. type TagTagNdIfPolResourceModel struct { Key types.String `tfsdk:"key"` @@ -131,6 +138,13 @@ func getEmptyTagTagNdIfPolResourceModel() TagTagNdIfPolResourceModel { } } +var TagTagNdIfPolType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + type NdIfPolIdentifier struct { Name types.String } @@ -595,7 +609,7 @@ func (r *NdIfPolResource) ImportState(ctx context.Context, req resource.ImportSt } func getAndSetNdIfPolAttributes(ctx context.Context, diags *diag.Diagnostics, client *client.Client, data *NdIfPolResourceModel) { - requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=children&rsp-subtree-class=%s", data.Id.ValueString(), "ndIfPol,tagAnnotation,tagTag"), "GET", nil) + requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=full&rsp-subtree-class=%s", data.Id.ValueString(), "ndIfPol,tagAnnotation,tagTag"), "GET", nil) readData := getEmptyNdIfPolResourceModel() @@ -688,6 +702,7 @@ func getAndSetNdIfPolAttributes(ctx context.Context, diags *diag.Diagnostics, cl if childAttributeName == "value" { TagAnnotationNdIfPol.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagAnnotationNdIfPolList = append(TagAnnotationNdIfPolList, TagAnnotationNdIfPol) } @@ -700,6 +715,7 @@ func getAndSetNdIfPolAttributes(ctx context.Context, diags *diag.Diagnostics, cl if childAttributeName == "value" { TagTagNdIfPol.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagTagNdIfPolList = append(TagTagNdIfPolList, TagTagNdIfPol) } @@ -747,25 +763,24 @@ func setNdIfPolId(ctx context.Context, data *NdIfPolResourceModel) { data.Id = types.StringValue(fmt.Sprintf("%s/%s", data.ParentDn.ValueString(), rn)) } -func getNdIfPolTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *NdIfPolResourceModel, tagAnnotationPlan, tagAnnotationState []TagAnnotationNdIfPolResourceModel) []map[string]interface{} { - +func getNdIfPolTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *NdIfPolResourceModel, tagAnnotationNdIfPolPlan, tagAnnotationNdIfPolState []TagAnnotationNdIfPolResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagAnnotation.IsUnknown() { + if !data.TagAnnotation.IsNull() && !data.TagAnnotation.IsUnknown() { tagAnnotationIdentifiers := []TagAnnotationIdentifier{} - for _, tagAnnotation := range tagAnnotationPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagAnnotation.Key.IsUnknown() && !tagAnnotation.Key.IsNull() { - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() + for _, tagAnnotationNdIfPol := range tagAnnotationNdIfPolPlan { + childMap := NewAciObject() + if !tagAnnotationNdIfPol.Key.IsNull() && !tagAnnotationNdIfPol.Key.IsUnknown() { + childMap.Attributes["key"] = tagAnnotationNdIfPol.Key.ValueString() } - if !tagAnnotation.Value.IsUnknown() && !tagAnnotation.Value.IsNull() { - childMap["attributes"]["value"] = tagAnnotation.Value.ValueString() + if !tagAnnotationNdIfPol.Value.IsNull() && !tagAnnotationNdIfPol.Value.IsUnknown() { + childMap.Attributes["value"] = tagAnnotationNdIfPol.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) tagAnnotationIdentifier := TagAnnotationIdentifier{} - tagAnnotationIdentifier.Key = tagAnnotation.Key + tagAnnotationIdentifier.Key = tagAnnotationNdIfPol.Key tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) } - for _, tagAnnotation := range tagAnnotationState { + for _, tagAnnotation := range tagAnnotationNdIfPolState { delete := true for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { if tagAnnotationIdentifier.Key == tagAnnotation.Key { @@ -774,10 +789,10 @@ func getNdIfPolTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagn } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) + tagAnnotationChildMapForDelete := NewAciObject() + tagAnnotationChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationChildMapForDelete.Attributes["key"] = tagAnnotation.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": tagAnnotationChildMapForDelete}) } } } else { @@ -786,25 +801,25 @@ func getNdIfPolTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagn return childPayloads } -func getNdIfPolTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *NdIfPolResourceModel, tagTagPlan, tagTagState []TagTagNdIfPolResourceModel) []map[string]interface{} { +func getNdIfPolTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *NdIfPolResourceModel, tagTagNdIfPolPlan, tagTagNdIfPolState []TagTagNdIfPolResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagTag.IsUnknown() { + if !data.TagTag.IsNull() && !data.TagTag.IsUnknown() { tagTagIdentifiers := []TagTagIdentifier{} - for _, tagTag := range tagTagPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagTag.Key.IsUnknown() && !tagTag.Key.IsNull() { - childMap["attributes"]["key"] = tagTag.Key.ValueString() + for _, tagTagNdIfPol := range tagTagNdIfPolPlan { + childMap := NewAciObject() + if !tagTagNdIfPol.Key.IsNull() && !tagTagNdIfPol.Key.IsUnknown() { + childMap.Attributes["key"] = tagTagNdIfPol.Key.ValueString() } - if !tagTag.Value.IsUnknown() && !tagTag.Value.IsNull() { - childMap["attributes"]["value"] = tagTag.Value.ValueString() + if !tagTagNdIfPol.Value.IsNull() && !tagTagNdIfPol.Value.IsUnknown() { + childMap.Attributes["value"] = tagTagNdIfPol.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) tagTagIdentifier := TagTagIdentifier{} - tagTagIdentifier.Key = tagTag.Key + tagTagIdentifier.Key = tagTagNdIfPol.Key tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) } - for _, tagTag := range tagTagState { + for _, tagTag := range tagTagNdIfPolState { delete := true for _, tagTagIdentifier := range tagTagIdentifiers { if tagTagIdentifier.Key == tagTag.Key { @@ -813,10 +828,10 @@ func getNdIfPolTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagTag.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) + tagTagChildMapForDelete := NewAciObject() + tagTagChildMapForDelete.Attributes["status"] = "deleted" + tagTagChildMapForDelete.Attributes["key"] = tagTag.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagTag": tagTagChildMapForDelete}) } } } else { diff --git a/internal/provider/resource_aci_neighbor_discovery_interface_policy_test.go b/internal/provider/resource_aci_neighbor_discovery_interface_policy_test.go index 615834eea..4994f2255 100644 --- a/internal/provider/resource_aci_neighbor_discovery_interface_policy_test.go +++ b/internal/provider/resource_aci_neighbor_discovery_interface_policy_test.go @@ -52,7 +52,7 @@ func TestAccResourceNdIfPolWithFvTenant(t *testing.T) { resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test_2", "router_advertisement_interval", "600"), resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test", "router_advertisement_lifetime", "1800"), resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test_2", "router_advertisement_lifetime", "1800"), - composeAggregateTestCheckFuncWithVersion(t, "5.1(1h)", ">", + composeAggregateTestCheckFuncWithVersion(t, "5.1(1h)", ">=", resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test", "nud_retry_base", "1"), resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test_2", "nud_retry_base", "1"), resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test", "nud_retry_interval", "1000"), @@ -117,7 +117,7 @@ func TestAccResourceNdIfPolWithFvTenant(t *testing.T) { resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test_2", "router_advertisement_interval", "600"), resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test", "router_advertisement_lifetime", "1800"), resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test_2", "router_advertisement_lifetime", "1800"), - composeAggregateTestCheckFuncWithVersion(t, "5.1(1h)", ">", + composeAggregateTestCheckFuncWithVersion(t, "5.1(1h)", ">=", resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test", "nud_retry_base", "1"), resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test_2", "nud_retry_base", "1"), resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test", "nud_retry_interval", "1000"), @@ -153,7 +153,7 @@ func TestAccResourceNdIfPolWithFvTenant(t *testing.T) { resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "retransmit_timer", "0"), resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "router_advertisement_interval", "600"), resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "router_advertisement_lifetime", "1800"), - composeAggregateTestCheckFuncWithVersion(t, "5.1(1h)", ">", + composeAggregateTestCheckFuncWithVersion(t, "5.1(1h)", ">=", resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "nud_retry_base", "1"), resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "nud_retry_interval", "1000"), resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "nud_retry_max_attempts", "3")), @@ -180,7 +180,7 @@ func TestAccResourceNdIfPolWithFvTenant(t *testing.T) { resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "retransmit_timer", "2"), resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "router_advertisement_interval", "500"), resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "router_advertisement_lifetime", "1500"), - composeAggregateTestCheckFuncWithVersion(t, "5.1(1h)", ">", + composeAggregateTestCheckFuncWithVersion(t, "5.1(1h)", ">=", resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "nud_retry_base", "2"), resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "nud_retry_interval", "1300"), resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "nud_retry_max_attempts", "5")), @@ -214,7 +214,7 @@ func TestAccResourceNdIfPolWithFvTenant(t *testing.T) { resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "retransmit_timer", "0"), resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "router_advertisement_interval", "600"), resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "router_advertisement_lifetime", "1800"), - composeAggregateTestCheckFuncWithVersion(t, "5.1(1h)", ">", + composeAggregateTestCheckFuncWithVersion(t, "5.1(1h)", ">=", resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "nud_retry_base", "1"), resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "nud_retry_interval", "1000"), resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "nud_retry_max_attempts", "3")), @@ -246,7 +246,7 @@ func TestAccResourceNdIfPolWithFvTenant(t *testing.T) { resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "retransmit_timer", "0"), resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "router_advertisement_interval", "600"), resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "router_advertisement_lifetime", "1800"), - composeAggregateTestCheckFuncWithVersion(t, "5.1(1h)", ">", + composeAggregateTestCheckFuncWithVersion(t, "5.1(1h)", ">=", resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "nud_retry_base", "1"), resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "nud_retry_interval", "1000"), resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "nud_retry_max_attempts", "3")), @@ -386,24 +386,24 @@ resource "aci_neighbor_discovery_interface_policy" "test" { parent_dn = aci_tenant.test.id name = "test_name" annotations = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] tags = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] } ` diff --git a/internal/provider/resource_aci_netflow_exporter_policy.go b/internal/provider/resource_aci_netflow_exporter_policy.go index 638baa94a..918c7e050 100644 --- a/internal/provider/resource_aci_netflow_exporter_policy.go +++ b/internal/provider/resource_aci_netflow_exporter_policy.go @@ -82,12 +82,16 @@ func getEmptyNetflowExporterPolResourceModel() *NetflowExporterPolResourceModel SrcAddr: basetypes.NewStringNull(), Ver: basetypes.NewStringNull(), NetflowRsExporterToCtx: types.ObjectNull(map[string]attr.Type{ - "annotation": types.StringType, - "target_dn": types.StringType, + "annotation": types.StringType, + "target_dn": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationNetflowRsExporterToCtxNetflowExporterPolType}, + "tags": types.SetType{ElemType: TagTagNetflowRsExporterToCtxNetflowExporterPolType}, }), NetflowRsExporterToEPg: types.ObjectNull(map[string]attr.Type{ - "annotation": types.StringType, - "target_dn": types.StringType, + "annotation": types.StringType, + "target_dn": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationNetflowRsExporterToEPgNetflowExporterPolType}, + "tags": types.SetType{ElemType: TagTagNetflowRsExporterToEPgNetflowExporterPolType}, }), TagAnnotation: types.SetNull(types.ObjectType{ AttrTypes: map[string]attr.Type{ @@ -106,38 +110,150 @@ func getEmptyNetflowExporterPolResourceModel() *NetflowExporterPolResourceModel // NetflowRsExporterToCtxNetflowExporterPolResourceModel describes the resource data model for the children without relation ships. type NetflowRsExporterToCtxNetflowExporterPolResourceModel struct { - Annotation types.String `tfsdk:"annotation"` - TDn types.String `tfsdk:"target_dn"` + Annotation types.String `tfsdk:"annotation"` + TDn types.String `tfsdk:"target_dn"` + TagAnnotation types.Set `tfsdk:"annotations"` + TagTag types.Set `tfsdk:"tags"` } func getEmptyNetflowRsExporterToCtxNetflowExporterPolResourceModel() NetflowRsExporterToCtxNetflowExporterPolResourceModel { return NetflowRsExporterToCtxNetflowExporterPolResourceModel{ Annotation: basetypes.NewStringNull(), TDn: basetypes.NewStringNull(), + TagAnnotation: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), } } var NetflowRsExporterToCtxNetflowExporterPolType = map[string]attr.Type{ - "annotation": types.StringType, - "target_dn": types.StringType, + "annotation": types.StringType, + "target_dn": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationNetflowRsExporterToCtxNetflowExporterPolType}, + "tags": types.SetType{ElemType: TagTagNetflowRsExporterToCtxNetflowExporterPolType}, +} + +// TagAnnotationNetflowRsExporterToCtxNetflowExporterPolResourceModel describes the resource data model for the children without relation ships. +type TagAnnotationNetflowRsExporterToCtxNetflowExporterPolResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagAnnotationNetflowRsExporterToCtxNetflowExporterPolResourceModel() TagAnnotationNetflowRsExporterToCtxNetflowExporterPolResourceModel { + return TagAnnotationNetflowRsExporterToCtxNetflowExporterPolResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagAnnotationNetflowRsExporterToCtxNetflowExporterPolType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + +// TagTagNetflowRsExporterToCtxNetflowExporterPolResourceModel describes the resource data model for the children without relation ships. +type TagTagNetflowRsExporterToCtxNetflowExporterPolResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagTagNetflowRsExporterToCtxNetflowExporterPolResourceModel() TagTagNetflowRsExporterToCtxNetflowExporterPolResourceModel { + return TagTagNetflowRsExporterToCtxNetflowExporterPolResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagTagNetflowRsExporterToCtxNetflowExporterPolType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, } // NetflowRsExporterToEPgNetflowExporterPolResourceModel describes the resource data model for the children without relation ships. type NetflowRsExporterToEPgNetflowExporterPolResourceModel struct { - Annotation types.String `tfsdk:"annotation"` - TDn types.String `tfsdk:"target_dn"` + Annotation types.String `tfsdk:"annotation"` + TDn types.String `tfsdk:"target_dn"` + TagAnnotation types.Set `tfsdk:"annotations"` + TagTag types.Set `tfsdk:"tags"` } func getEmptyNetflowRsExporterToEPgNetflowExporterPolResourceModel() NetflowRsExporterToEPgNetflowExporterPolResourceModel { return NetflowRsExporterToEPgNetflowExporterPolResourceModel{ Annotation: basetypes.NewStringNull(), TDn: basetypes.NewStringNull(), + TagAnnotation: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), } } var NetflowRsExporterToEPgNetflowExporterPolType = map[string]attr.Type{ - "annotation": types.StringType, - "target_dn": types.StringType, + "annotation": types.StringType, + "target_dn": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationNetflowRsExporterToEPgNetflowExporterPolType}, + "tags": types.SetType{ElemType: TagTagNetflowRsExporterToEPgNetflowExporterPolType}, +} + +// TagAnnotationNetflowRsExporterToEPgNetflowExporterPolResourceModel describes the resource data model for the children without relation ships. +type TagAnnotationNetflowRsExporterToEPgNetflowExporterPolResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagAnnotationNetflowRsExporterToEPgNetflowExporterPolResourceModel() TagAnnotationNetflowRsExporterToEPgNetflowExporterPolResourceModel { + return TagAnnotationNetflowRsExporterToEPgNetflowExporterPolResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagAnnotationNetflowRsExporterToEPgNetflowExporterPolType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + +// TagTagNetflowRsExporterToEPgNetflowExporterPolResourceModel describes the resource data model for the children without relation ships. +type TagTagNetflowRsExporterToEPgNetflowExporterPolResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagTagNetflowRsExporterToEPgNetflowExporterPolResourceModel() TagTagNetflowRsExporterToEPgNetflowExporterPolResourceModel { + return TagTagNetflowRsExporterToEPgNetflowExporterPolResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagTagNetflowRsExporterToEPgNetflowExporterPolType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, } // TagAnnotationNetflowExporterPolResourceModel describes the resource data model for the children without relation ships. @@ -153,6 +269,13 @@ func getEmptyTagAnnotationNetflowExporterPolResourceModel() TagAnnotationNetflow } } +var TagAnnotationNetflowExporterPolType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // TagTagNetflowExporterPolResourceModel describes the resource data model for the children without relation ships. type TagTagNetflowExporterPolResourceModel struct { Key types.String `tfsdk:"key"` @@ -166,6 +289,13 @@ func getEmptyTagTagNetflowExporterPolResourceModel() TagTagNetflowExporterPolRes } } +var TagTagNetflowExporterPolType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + type NetflowExporterPolIdentifier struct { Name types.String } @@ -389,6 +519,58 @@ func (r *NetflowExporterPolResource) Schema(ctx context.Context, req resource.Sc }, MarkdownDescription: `The distinguished name of the target.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, "relation_to_epg": schema.SingleNestedAttribute{ @@ -415,6 +597,58 @@ func (r *NetflowExporterPolResource) Schema(ctx context.Context, req resource.Sc }, MarkdownDescription: `The distinguished name of the target.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, "annotations": schema.SetNestedAttribute{ @@ -666,7 +900,7 @@ func (r *NetflowExporterPolResource) ImportState(ctx context.Context, req resour } func getAndSetNetflowExporterPolAttributes(ctx context.Context, diags *diag.Diagnostics, client *client.Client, data *NetflowExporterPolResourceModel) { - requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=children&rsp-subtree-class=%s", data.Id.ValueString(), "netflowExporterPol,netflowRsExporterToCtx,netflowRsExporterToEPg,tagAnnotation,tagTag"), "GET", nil) + requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=full&rsp-subtree-class=%s", data.Id.ValueString(), "netflowExporterPol,netflowRsExporterToCtx,netflowRsExporterToEPg,tagAnnotation,tagTag,tagAnnotation,tagTag,tagAnnotation,tagTag"), "GET", nil) readData := getEmptyNetflowExporterPolResourceModel() @@ -738,7 +972,47 @@ func getAndSetNetflowExporterPolAttributes(ctx context.Context, diags *diag.Diag if childAttributeName == "tDn" { NetflowRsExporterToCtxNetflowExporterPol.TDn = basetypes.NewStringValue(childAttributeValue.(string)) } + + } + TagAnnotationNetflowRsExporterToCtxNetflowExporterPolList := make([]TagAnnotationNetflowRsExporterToCtxNetflowExporterPolResourceModel, 0) + TagTagNetflowRsExporterToCtxNetflowExporterPolList := make([]TagTagNetflowRsExporterToCtxNetflowExporterPolResourceModel, 0) + childrenOfNetflowRsExporterToCtxNetflowExporterPol, childrenOfNetflowRsExporterToCtxNetflowExporterPolExist := childClassDetails.(map[string]interface{})["children"] + if childrenOfNetflowRsExporterToCtxNetflowExporterPolExist { + for _, childNetflowRsExporterToCtxNetflowExporterPol := range childrenOfNetflowRsExporterToCtxNetflowExporterPol.([]interface{}) { + for childClassNameNetflowRsExporterToCtxNetflowExporterPol, childClassDetailsNetflowRsExporterToCtxNetflowExporterPol := range childNetflowRsExporterToCtxNetflowExporterPol.(map[string]interface{}) { + if childClassNameNetflowRsExporterToCtxNetflowExporterPol == "tagAnnotation" { + TagAnnotationNetflowRsExporterToCtxNetflowExporterPol := getEmptyTagAnnotationNetflowRsExporterToCtxNetflowExporterPolResourceModel() + tagAnnotationchildAttributeValue := childClassDetailsNetflowRsExporterToCtxNetflowExporterPol.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagAnnotationchildAttributeValue { + if childAttributeName == "key" { + TagAnnotationNetflowRsExporterToCtxNetflowExporterPol.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagAnnotationNetflowRsExporterToCtxNetflowExporterPol.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagAnnotationNetflowRsExporterToCtxNetflowExporterPolList = append(TagAnnotationNetflowRsExporterToCtxNetflowExporterPolList, TagAnnotationNetflowRsExporterToCtxNetflowExporterPol) + } + if childClassNameNetflowRsExporterToCtxNetflowExporterPol == "tagTag" { + TagTagNetflowRsExporterToCtxNetflowExporterPol := getEmptyTagTagNetflowRsExporterToCtxNetflowExporterPolResourceModel() + tagTagchildAttributeValue := childClassDetailsNetflowRsExporterToCtxNetflowExporterPol.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagTagchildAttributeValue { + if childAttributeName == "key" { + TagTagNetflowRsExporterToCtxNetflowExporterPol.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagTagNetflowRsExporterToCtxNetflowExporterPol.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagTagNetflowRsExporterToCtxNetflowExporterPolList = append(TagTagNetflowRsExporterToCtxNetflowExporterPolList, TagTagNetflowRsExporterToCtxNetflowExporterPol) + } + } + } } + TagAnnotationNetflowRsExporterToCtxNetflowExporterPolSet, _ := types.SetValueFrom(ctx, TagAnnotationNetflowRsExporterToCtxNetflowExporterPolType, TagAnnotationNetflowRsExporterToCtxNetflowExporterPolList) + NetflowRsExporterToCtxNetflowExporterPol.TagAnnotation = TagAnnotationNetflowRsExporterToCtxNetflowExporterPolSet + TagTagNetflowRsExporterToCtxNetflowExporterPolSet, _ := types.SetValueFrom(ctx, TagTagNetflowRsExporterToCtxNetflowExporterPolType, TagTagNetflowRsExporterToCtxNetflowExporterPolList) + NetflowRsExporterToCtxNetflowExporterPol.TagTag = TagTagNetflowRsExporterToCtxNetflowExporterPolSet NetflowRsExporterToCtxNetflowExporterPolList = append(NetflowRsExporterToCtxNetflowExporterPolList, NetflowRsExporterToCtxNetflowExporterPol) } if childClassName == "netflowRsExporterToEPg" { @@ -750,7 +1024,47 @@ func getAndSetNetflowExporterPolAttributes(ctx context.Context, diags *diag.Diag if childAttributeName == "tDn" { NetflowRsExporterToEPgNetflowExporterPol.TDn = basetypes.NewStringValue(childAttributeValue.(string)) } + + } + TagAnnotationNetflowRsExporterToEPgNetflowExporterPolList := make([]TagAnnotationNetflowRsExporterToEPgNetflowExporterPolResourceModel, 0) + TagTagNetflowRsExporterToEPgNetflowExporterPolList := make([]TagTagNetflowRsExporterToEPgNetflowExporterPolResourceModel, 0) + childrenOfNetflowRsExporterToEPgNetflowExporterPol, childrenOfNetflowRsExporterToEPgNetflowExporterPolExist := childClassDetails.(map[string]interface{})["children"] + if childrenOfNetflowRsExporterToEPgNetflowExporterPolExist { + for _, childNetflowRsExporterToEPgNetflowExporterPol := range childrenOfNetflowRsExporterToEPgNetflowExporterPol.([]interface{}) { + for childClassNameNetflowRsExporterToEPgNetflowExporterPol, childClassDetailsNetflowRsExporterToEPgNetflowExporterPol := range childNetflowRsExporterToEPgNetflowExporterPol.(map[string]interface{}) { + if childClassNameNetflowRsExporterToEPgNetflowExporterPol == "tagAnnotation" { + TagAnnotationNetflowRsExporterToEPgNetflowExporterPol := getEmptyTagAnnotationNetflowRsExporterToEPgNetflowExporterPolResourceModel() + tagAnnotationchildAttributeValue := childClassDetailsNetflowRsExporterToEPgNetflowExporterPol.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagAnnotationchildAttributeValue { + if childAttributeName == "key" { + TagAnnotationNetflowRsExporterToEPgNetflowExporterPol.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagAnnotationNetflowRsExporterToEPgNetflowExporterPol.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagAnnotationNetflowRsExporterToEPgNetflowExporterPolList = append(TagAnnotationNetflowRsExporterToEPgNetflowExporterPolList, TagAnnotationNetflowRsExporterToEPgNetflowExporterPol) + } + if childClassNameNetflowRsExporterToEPgNetflowExporterPol == "tagTag" { + TagTagNetflowRsExporterToEPgNetflowExporterPol := getEmptyTagTagNetflowRsExporterToEPgNetflowExporterPolResourceModel() + tagTagchildAttributeValue := childClassDetailsNetflowRsExporterToEPgNetflowExporterPol.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagTagchildAttributeValue { + if childAttributeName == "key" { + TagTagNetflowRsExporterToEPgNetflowExporterPol.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagTagNetflowRsExporterToEPgNetflowExporterPol.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagTagNetflowRsExporterToEPgNetflowExporterPolList = append(TagTagNetflowRsExporterToEPgNetflowExporterPolList, TagTagNetflowRsExporterToEPgNetflowExporterPol) + } + } + } } + TagAnnotationNetflowRsExporterToEPgNetflowExporterPolSet, _ := types.SetValueFrom(ctx, TagAnnotationNetflowRsExporterToEPgNetflowExporterPolType, TagAnnotationNetflowRsExporterToEPgNetflowExporterPolList) + NetflowRsExporterToEPgNetflowExporterPol.TagAnnotation = TagAnnotationNetflowRsExporterToEPgNetflowExporterPolSet + TagTagNetflowRsExporterToEPgNetflowExporterPolSet, _ := types.SetValueFrom(ctx, TagTagNetflowRsExporterToEPgNetflowExporterPolType, TagTagNetflowRsExporterToEPgNetflowExporterPolList) + NetflowRsExporterToEPgNetflowExporterPol.TagTag = TagTagNetflowRsExporterToEPgNetflowExporterPolSet NetflowRsExporterToEPgNetflowExporterPolList = append(NetflowRsExporterToEPgNetflowExporterPolList, NetflowRsExporterToEPgNetflowExporterPol) } if childClassName == "tagAnnotation" { @@ -762,6 +1076,7 @@ func getAndSetNetflowExporterPolAttributes(ctx context.Context, diags *diag.Diag if childAttributeName == "value" { TagAnnotationNetflowExporterPol.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagAnnotationNetflowExporterPolList = append(TagAnnotationNetflowExporterPolList, TagAnnotationNetflowExporterPol) } @@ -774,6 +1089,7 @@ func getAndSetNetflowExporterPolAttributes(ctx context.Context, diags *diag.Diag if childAttributeName == "value" { TagTagNetflowExporterPol.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagTagNetflowExporterPolList = append(TagTagNetflowExporterPolList, TagTagNetflowExporterPol) } @@ -835,23 +1151,98 @@ func setNetflowExporterPolId(ctx context.Context, data *NetflowExporterPolResour data.Id = types.StringValue(fmt.Sprintf("%s/%s", data.ParentDn.ValueString(), rn)) } -func getNetflowExporterPolNetflowRsExporterToCtxChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *NetflowExporterPolResourceModel, netflowRsExporterToCtxPlan, netflowRsExporterToCtxState NetflowRsExporterToCtxNetflowExporterPolResourceModel) []map[string]interface{} { - +func getNetflowExporterPolNetflowRsExporterToCtxChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *NetflowExporterPolResourceModel, netflowRsExporterToCtxNetflowExporterPolPlan, netflowRsExporterToCtxNetflowExporterPolState NetflowRsExporterToCtxNetflowExporterPolResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.NetflowRsExporterToCtx.IsUnknown() { - childMap := map[string]map[string]interface{}{"attributes": {}} + if !data.NetflowRsExporterToCtx.IsNull() && !data.NetflowRsExporterToCtx.IsUnknown() { + NetflowRsExporterToCtxNetflowExporterPolChildren := make([]map[string]interface{}, 0) + childMap := NewAciObject() if !IsEmptySingleNestedAttribute(data.NetflowRsExporterToCtx.Attributes()) { - if !netflowRsExporterToCtxPlan.Annotation.IsUnknown() && !netflowRsExporterToCtxPlan.Annotation.IsNull() { - childMap["attributes"]["annotation"] = netflowRsExporterToCtxPlan.Annotation.ValueString() + if !netflowRsExporterToCtxNetflowExporterPolPlan.Annotation.IsUnknown() && !netflowRsExporterToCtxNetflowExporterPolPlan.Annotation.IsNull() { + childMap.Attributes["annotation"] = netflowRsExporterToCtxNetflowExporterPolPlan.Annotation.ValueString() } else { - childMap["attributes"]["annotation"] = globalAnnotation + childMap.Attributes["annotation"] = globalAnnotation } - if !netflowRsExporterToCtxPlan.TDn.IsUnknown() && !netflowRsExporterToCtxPlan.TDn.IsNull() { - childMap["attributes"]["tDn"] = netflowRsExporterToCtxPlan.TDn.ValueString() + if !netflowRsExporterToCtxNetflowExporterPolPlan.TDn.IsUnknown() && !netflowRsExporterToCtxNetflowExporterPolPlan.TDn.IsNull() { + childMap.Attributes["tDn"] = netflowRsExporterToCtxNetflowExporterPolPlan.TDn.ValueString() } } else { - childMap["attributes"]["status"] = "deleted" + childMap.Attributes["status"] = "deleted" + } + + var tagAnnotationNetflowRsExporterToCtxNetflowExporterPolPlan, tagAnnotationNetflowRsExporterToCtxNetflowExporterPolState []TagAnnotationNetflowRsExporterToCtxNetflowExporterPolResourceModel + netflowRsExporterToCtxNetflowExporterPolPlan.TagAnnotation.ElementsAs(ctx, &tagAnnotationNetflowRsExporterToCtxNetflowExporterPolPlan, false) + if !netflowRsExporterToCtxNetflowExporterPolState.TagAnnotation.IsNull() { + netflowRsExporterToCtxNetflowExporterPolState.TagAnnotation.ElementsAs(ctx, &tagAnnotationNetflowRsExporterToCtxNetflowExporterPolState, false) + } + if !netflowRsExporterToCtxNetflowExporterPolPlan.TagAnnotation.IsNull() && !netflowRsExporterToCtxNetflowExporterPolPlan.TagAnnotation.IsUnknown() { + tagAnnotationIdentifiers := []TagAnnotationIdentifier{} + for _, tagAnnotationNetflowRsExporterToCtxNetflowExporterPol := range tagAnnotationNetflowRsExporterToCtxNetflowExporterPolPlan { + tagAnnotationNetflowRsExporterToCtxNetflowExporterPolChildMap := NewAciObject() + if !tagAnnotationNetflowRsExporterToCtxNetflowExporterPol.Key.IsNull() && !tagAnnotationNetflowRsExporterToCtxNetflowExporterPol.Key.IsUnknown() { + tagAnnotationNetflowRsExporterToCtxNetflowExporterPolChildMap.Attributes["key"] = tagAnnotationNetflowRsExporterToCtxNetflowExporterPol.Key.ValueString() + } + if !tagAnnotationNetflowRsExporterToCtxNetflowExporterPol.Value.IsNull() && !tagAnnotationNetflowRsExporterToCtxNetflowExporterPol.Value.IsUnknown() { + tagAnnotationNetflowRsExporterToCtxNetflowExporterPolChildMap.Attributes["value"] = tagAnnotationNetflowRsExporterToCtxNetflowExporterPol.Value.ValueString() + } + NetflowRsExporterToCtxNetflowExporterPolChildren = append(NetflowRsExporterToCtxNetflowExporterPolChildren, map[string]interface{}{"tagAnnotation": tagAnnotationNetflowRsExporterToCtxNetflowExporterPolChildMap}) + tagAnnotationIdentifier := TagAnnotationIdentifier{} + tagAnnotationIdentifier.Key = tagAnnotationNetflowRsExporterToCtxNetflowExporterPol.Key + tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) + } + for _, tagAnnotationNetflowRsExporterToCtxNetflowExporterPol := range tagAnnotationNetflowRsExporterToCtxNetflowExporterPolState { + delete := true + for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { + if tagAnnotationIdentifier.Key == tagAnnotationNetflowRsExporterToCtxNetflowExporterPol.Key { + delete = false + break + } + } + if delete { + tagAnnotationNetflowRsExporterToCtxNetflowExporterPolChildMapForDelete := NewAciObject() + tagAnnotationNetflowRsExporterToCtxNetflowExporterPolChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationNetflowRsExporterToCtxNetflowExporterPolChildMapForDelete.Attributes["key"] = tagAnnotationNetflowRsExporterToCtxNetflowExporterPol.Key.ValueString() + NetflowRsExporterToCtxNetflowExporterPolChildren = append(NetflowRsExporterToCtxNetflowExporterPolChildren, map[string]interface{}{"tagAnnotation": tagAnnotationNetflowRsExporterToCtxNetflowExporterPolChildMapForDelete}) + } + } } + + var tagTagNetflowRsExporterToCtxNetflowExporterPolPlan, tagTagNetflowRsExporterToCtxNetflowExporterPolState []TagTagNetflowRsExporterToCtxNetflowExporterPolResourceModel + netflowRsExporterToCtxNetflowExporterPolPlan.TagTag.ElementsAs(ctx, &tagTagNetflowRsExporterToCtxNetflowExporterPolPlan, false) + if !netflowRsExporterToCtxNetflowExporterPolState.TagTag.IsNull() { + netflowRsExporterToCtxNetflowExporterPolState.TagTag.ElementsAs(ctx, &tagTagNetflowRsExporterToCtxNetflowExporterPolState, false) + } + if !netflowRsExporterToCtxNetflowExporterPolPlan.TagTag.IsNull() && !netflowRsExporterToCtxNetflowExporterPolPlan.TagTag.IsUnknown() { + tagTagIdentifiers := []TagTagIdentifier{} + for _, tagTagNetflowRsExporterToCtxNetflowExporterPol := range tagTagNetflowRsExporterToCtxNetflowExporterPolPlan { + tagTagNetflowRsExporterToCtxNetflowExporterPolChildMap := NewAciObject() + if !tagTagNetflowRsExporterToCtxNetflowExporterPol.Key.IsNull() && !tagTagNetflowRsExporterToCtxNetflowExporterPol.Key.IsUnknown() { + tagTagNetflowRsExporterToCtxNetflowExporterPolChildMap.Attributes["key"] = tagTagNetflowRsExporterToCtxNetflowExporterPol.Key.ValueString() + } + if !tagTagNetflowRsExporterToCtxNetflowExporterPol.Value.IsNull() && !tagTagNetflowRsExporterToCtxNetflowExporterPol.Value.IsUnknown() { + tagTagNetflowRsExporterToCtxNetflowExporterPolChildMap.Attributes["value"] = tagTagNetflowRsExporterToCtxNetflowExporterPol.Value.ValueString() + } + NetflowRsExporterToCtxNetflowExporterPolChildren = append(NetflowRsExporterToCtxNetflowExporterPolChildren, map[string]interface{}{"tagTag": tagTagNetflowRsExporterToCtxNetflowExporterPolChildMap}) + tagTagIdentifier := TagTagIdentifier{} + tagTagIdentifier.Key = tagTagNetflowRsExporterToCtxNetflowExporterPol.Key + tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) + } + for _, tagTagNetflowRsExporterToCtxNetflowExporterPol := range tagTagNetflowRsExporterToCtxNetflowExporterPolState { + delete := true + for _, tagTagIdentifier := range tagTagIdentifiers { + if tagTagIdentifier.Key == tagTagNetflowRsExporterToCtxNetflowExporterPol.Key { + delete = false + break + } + } + if delete { + tagTagNetflowRsExporterToCtxNetflowExporterPolChildMapForDelete := NewAciObject() + tagTagNetflowRsExporterToCtxNetflowExporterPolChildMapForDelete.Attributes["status"] = "deleted" + tagTagNetflowRsExporterToCtxNetflowExporterPolChildMapForDelete.Attributes["key"] = tagTagNetflowRsExporterToCtxNetflowExporterPol.Key.ValueString() + NetflowRsExporterToCtxNetflowExporterPolChildren = append(NetflowRsExporterToCtxNetflowExporterPolChildren, map[string]interface{}{"tagTag": tagTagNetflowRsExporterToCtxNetflowExporterPolChildMapForDelete}) + } + } + } + childMap.Children = NetflowRsExporterToCtxNetflowExporterPolChildren childPayloads = append(childPayloads, map[string]interface{}{"netflowRsExporterToCtx": childMap}) } else { NetflowRsExporterToCtxObject, _ := types.ObjectValueFrom(ctx, NetflowRsExporterToCtxNetflowExporterPolType, getEmptyNetflowRsExporterToCtxNetflowExporterPolResourceModel()) @@ -860,23 +1251,99 @@ func getNetflowExporterPolNetflowRsExporterToCtxChildPayloads(ctx context.Contex return childPayloads } -func getNetflowExporterPolNetflowRsExporterToEPgChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *NetflowExporterPolResourceModel, netflowRsExporterToEPgPlan, netflowRsExporterToEPgState NetflowRsExporterToEPgNetflowExporterPolResourceModel) []map[string]interface{} { +func getNetflowExporterPolNetflowRsExporterToEPgChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *NetflowExporterPolResourceModel, netflowRsExporterToEPgNetflowExporterPolPlan, netflowRsExporterToEPgNetflowExporterPolState NetflowRsExporterToEPgNetflowExporterPolResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.NetflowRsExporterToEPg.IsUnknown() { - childMap := map[string]map[string]interface{}{"attributes": {}} + if !data.NetflowRsExporterToEPg.IsNull() && !data.NetflowRsExporterToEPg.IsUnknown() { + NetflowRsExporterToEPgNetflowExporterPolChildren := make([]map[string]interface{}, 0) + childMap := NewAciObject() if !IsEmptySingleNestedAttribute(data.NetflowRsExporterToEPg.Attributes()) { - if !netflowRsExporterToEPgPlan.Annotation.IsUnknown() && !netflowRsExporterToEPgPlan.Annotation.IsNull() { - childMap["attributes"]["annotation"] = netflowRsExporterToEPgPlan.Annotation.ValueString() + if !netflowRsExporterToEPgNetflowExporterPolPlan.Annotation.IsUnknown() && !netflowRsExporterToEPgNetflowExporterPolPlan.Annotation.IsNull() { + childMap.Attributes["annotation"] = netflowRsExporterToEPgNetflowExporterPolPlan.Annotation.ValueString() } else { - childMap["attributes"]["annotation"] = globalAnnotation + childMap.Attributes["annotation"] = globalAnnotation } - if !netflowRsExporterToEPgPlan.TDn.IsUnknown() && !netflowRsExporterToEPgPlan.TDn.IsNull() { - childMap["attributes"]["tDn"] = netflowRsExporterToEPgPlan.TDn.ValueString() + if !netflowRsExporterToEPgNetflowExporterPolPlan.TDn.IsUnknown() && !netflowRsExporterToEPgNetflowExporterPolPlan.TDn.IsNull() { + childMap.Attributes["tDn"] = netflowRsExporterToEPgNetflowExporterPolPlan.TDn.ValueString() } } else { - childMap["attributes"]["status"] = "deleted" + childMap.Attributes["status"] = "deleted" + } + + var tagAnnotationNetflowRsExporterToEPgNetflowExporterPolPlan, tagAnnotationNetflowRsExporterToEPgNetflowExporterPolState []TagAnnotationNetflowRsExporterToEPgNetflowExporterPolResourceModel + netflowRsExporterToEPgNetflowExporterPolPlan.TagAnnotation.ElementsAs(ctx, &tagAnnotationNetflowRsExporterToEPgNetflowExporterPolPlan, false) + if !netflowRsExporterToEPgNetflowExporterPolState.TagAnnotation.IsNull() { + netflowRsExporterToEPgNetflowExporterPolState.TagAnnotation.ElementsAs(ctx, &tagAnnotationNetflowRsExporterToEPgNetflowExporterPolState, false) + } + if !netflowRsExporterToEPgNetflowExporterPolPlan.TagAnnotation.IsNull() && !netflowRsExporterToEPgNetflowExporterPolPlan.TagAnnotation.IsUnknown() { + tagAnnotationIdentifiers := []TagAnnotationIdentifier{} + for _, tagAnnotationNetflowRsExporterToEPgNetflowExporterPol := range tagAnnotationNetflowRsExporterToEPgNetflowExporterPolPlan { + tagAnnotationNetflowRsExporterToEPgNetflowExporterPolChildMap := NewAciObject() + if !tagAnnotationNetflowRsExporterToEPgNetflowExporterPol.Key.IsNull() && !tagAnnotationNetflowRsExporterToEPgNetflowExporterPol.Key.IsUnknown() { + tagAnnotationNetflowRsExporterToEPgNetflowExporterPolChildMap.Attributes["key"] = tagAnnotationNetflowRsExporterToEPgNetflowExporterPol.Key.ValueString() + } + if !tagAnnotationNetflowRsExporterToEPgNetflowExporterPol.Value.IsNull() && !tagAnnotationNetflowRsExporterToEPgNetflowExporterPol.Value.IsUnknown() { + tagAnnotationNetflowRsExporterToEPgNetflowExporterPolChildMap.Attributes["value"] = tagAnnotationNetflowRsExporterToEPgNetflowExporterPol.Value.ValueString() + } + NetflowRsExporterToEPgNetflowExporterPolChildren = append(NetflowRsExporterToEPgNetflowExporterPolChildren, map[string]interface{}{"tagAnnotation": tagAnnotationNetflowRsExporterToEPgNetflowExporterPolChildMap}) + tagAnnotationIdentifier := TagAnnotationIdentifier{} + tagAnnotationIdentifier.Key = tagAnnotationNetflowRsExporterToEPgNetflowExporterPol.Key + tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) + } + for _, tagAnnotationNetflowRsExporterToEPgNetflowExporterPol := range tagAnnotationNetflowRsExporterToEPgNetflowExporterPolState { + delete := true + for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { + if tagAnnotationIdentifier.Key == tagAnnotationNetflowRsExporterToEPgNetflowExporterPol.Key { + delete = false + break + } + } + if delete { + tagAnnotationNetflowRsExporterToEPgNetflowExporterPolChildMapForDelete := NewAciObject() + tagAnnotationNetflowRsExporterToEPgNetflowExporterPolChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationNetflowRsExporterToEPgNetflowExporterPolChildMapForDelete.Attributes["key"] = tagAnnotationNetflowRsExporterToEPgNetflowExporterPol.Key.ValueString() + NetflowRsExporterToEPgNetflowExporterPolChildren = append(NetflowRsExporterToEPgNetflowExporterPolChildren, map[string]interface{}{"tagAnnotation": tagAnnotationNetflowRsExporterToEPgNetflowExporterPolChildMapForDelete}) + } + } + } + + var tagTagNetflowRsExporterToEPgNetflowExporterPolPlan, tagTagNetflowRsExporterToEPgNetflowExporterPolState []TagTagNetflowRsExporterToEPgNetflowExporterPolResourceModel + netflowRsExporterToEPgNetflowExporterPolPlan.TagTag.ElementsAs(ctx, &tagTagNetflowRsExporterToEPgNetflowExporterPolPlan, false) + if !netflowRsExporterToEPgNetflowExporterPolState.TagTag.IsNull() { + netflowRsExporterToEPgNetflowExporterPolState.TagTag.ElementsAs(ctx, &tagTagNetflowRsExporterToEPgNetflowExporterPolState, false) + } + if !netflowRsExporterToEPgNetflowExporterPolPlan.TagTag.IsNull() && !netflowRsExporterToEPgNetflowExporterPolPlan.TagTag.IsUnknown() { + tagTagIdentifiers := []TagTagIdentifier{} + for _, tagTagNetflowRsExporterToEPgNetflowExporterPol := range tagTagNetflowRsExporterToEPgNetflowExporterPolPlan { + tagTagNetflowRsExporterToEPgNetflowExporterPolChildMap := NewAciObject() + if !tagTagNetflowRsExporterToEPgNetflowExporterPol.Key.IsNull() && !tagTagNetflowRsExporterToEPgNetflowExporterPol.Key.IsUnknown() { + tagTagNetflowRsExporterToEPgNetflowExporterPolChildMap.Attributes["key"] = tagTagNetflowRsExporterToEPgNetflowExporterPol.Key.ValueString() + } + if !tagTagNetflowRsExporterToEPgNetflowExporterPol.Value.IsNull() && !tagTagNetflowRsExporterToEPgNetflowExporterPol.Value.IsUnknown() { + tagTagNetflowRsExporterToEPgNetflowExporterPolChildMap.Attributes["value"] = tagTagNetflowRsExporterToEPgNetflowExporterPol.Value.ValueString() + } + NetflowRsExporterToEPgNetflowExporterPolChildren = append(NetflowRsExporterToEPgNetflowExporterPolChildren, map[string]interface{}{"tagTag": tagTagNetflowRsExporterToEPgNetflowExporterPolChildMap}) + tagTagIdentifier := TagTagIdentifier{} + tagTagIdentifier.Key = tagTagNetflowRsExporterToEPgNetflowExporterPol.Key + tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) + } + for _, tagTagNetflowRsExporterToEPgNetflowExporterPol := range tagTagNetflowRsExporterToEPgNetflowExporterPolState { + delete := true + for _, tagTagIdentifier := range tagTagIdentifiers { + if tagTagIdentifier.Key == tagTagNetflowRsExporterToEPgNetflowExporterPol.Key { + delete = false + break + } + } + if delete { + tagTagNetflowRsExporterToEPgNetflowExporterPolChildMapForDelete := NewAciObject() + tagTagNetflowRsExporterToEPgNetflowExporterPolChildMapForDelete.Attributes["status"] = "deleted" + tagTagNetflowRsExporterToEPgNetflowExporterPolChildMapForDelete.Attributes["key"] = tagTagNetflowRsExporterToEPgNetflowExporterPol.Key.ValueString() + NetflowRsExporterToEPgNetflowExporterPolChildren = append(NetflowRsExporterToEPgNetflowExporterPolChildren, map[string]interface{}{"tagTag": tagTagNetflowRsExporterToEPgNetflowExporterPolChildMapForDelete}) + } + } } + childMap.Children = NetflowRsExporterToEPgNetflowExporterPolChildren childPayloads = append(childPayloads, map[string]interface{}{"netflowRsExporterToEPg": childMap}) } else { NetflowRsExporterToEPgObject, _ := types.ObjectValueFrom(ctx, NetflowRsExporterToEPgNetflowExporterPolType, getEmptyNetflowRsExporterToEPgNetflowExporterPolResourceModel()) @@ -885,25 +1352,25 @@ func getNetflowExporterPolNetflowRsExporterToEPgChildPayloads(ctx context.Contex return childPayloads } -func getNetflowExporterPolTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *NetflowExporterPolResourceModel, tagAnnotationPlan, tagAnnotationState []TagAnnotationNetflowExporterPolResourceModel) []map[string]interface{} { +func getNetflowExporterPolTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *NetflowExporterPolResourceModel, tagAnnotationNetflowExporterPolPlan, tagAnnotationNetflowExporterPolState []TagAnnotationNetflowExporterPolResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagAnnotation.IsUnknown() { + if !data.TagAnnotation.IsNull() && !data.TagAnnotation.IsUnknown() { tagAnnotationIdentifiers := []TagAnnotationIdentifier{} - for _, tagAnnotation := range tagAnnotationPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagAnnotation.Key.IsUnknown() && !tagAnnotation.Key.IsNull() { - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() + for _, tagAnnotationNetflowExporterPol := range tagAnnotationNetflowExporterPolPlan { + childMap := NewAciObject() + if !tagAnnotationNetflowExporterPol.Key.IsNull() && !tagAnnotationNetflowExporterPol.Key.IsUnknown() { + childMap.Attributes["key"] = tagAnnotationNetflowExporterPol.Key.ValueString() } - if !tagAnnotation.Value.IsUnknown() && !tagAnnotation.Value.IsNull() { - childMap["attributes"]["value"] = tagAnnotation.Value.ValueString() + if !tagAnnotationNetflowExporterPol.Value.IsNull() && !tagAnnotationNetflowExporterPol.Value.IsUnknown() { + childMap.Attributes["value"] = tagAnnotationNetflowExporterPol.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) tagAnnotationIdentifier := TagAnnotationIdentifier{} - tagAnnotationIdentifier.Key = tagAnnotation.Key + tagAnnotationIdentifier.Key = tagAnnotationNetflowExporterPol.Key tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) } - for _, tagAnnotation := range tagAnnotationState { + for _, tagAnnotation := range tagAnnotationNetflowExporterPolState { delete := true for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { if tagAnnotationIdentifier.Key == tagAnnotation.Key { @@ -912,10 +1379,10 @@ func getNetflowExporterPolTagAnnotationChildPayloads(ctx context.Context, diags } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) + tagAnnotationChildMapForDelete := NewAciObject() + tagAnnotationChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationChildMapForDelete.Attributes["key"] = tagAnnotation.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": tagAnnotationChildMapForDelete}) } } } else { @@ -924,25 +1391,25 @@ func getNetflowExporterPolTagAnnotationChildPayloads(ctx context.Context, diags return childPayloads } -func getNetflowExporterPolTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *NetflowExporterPolResourceModel, tagTagPlan, tagTagState []TagTagNetflowExporterPolResourceModel) []map[string]interface{} { +func getNetflowExporterPolTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *NetflowExporterPolResourceModel, tagTagNetflowExporterPolPlan, tagTagNetflowExporterPolState []TagTagNetflowExporterPolResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagTag.IsUnknown() { + if !data.TagTag.IsNull() && !data.TagTag.IsUnknown() { tagTagIdentifiers := []TagTagIdentifier{} - for _, tagTag := range tagTagPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagTag.Key.IsUnknown() && !tagTag.Key.IsNull() { - childMap["attributes"]["key"] = tagTag.Key.ValueString() + for _, tagTagNetflowExporterPol := range tagTagNetflowExporterPolPlan { + childMap := NewAciObject() + if !tagTagNetflowExporterPol.Key.IsNull() && !tagTagNetflowExporterPol.Key.IsUnknown() { + childMap.Attributes["key"] = tagTagNetflowExporterPol.Key.ValueString() } - if !tagTag.Value.IsUnknown() && !tagTag.Value.IsNull() { - childMap["attributes"]["value"] = tagTag.Value.ValueString() + if !tagTagNetflowExporterPol.Value.IsNull() && !tagTagNetflowExporterPol.Value.IsUnknown() { + childMap.Attributes["value"] = tagTagNetflowExporterPol.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) tagTagIdentifier := TagTagIdentifier{} - tagTagIdentifier.Key = tagTag.Key + tagTagIdentifier.Key = tagTagNetflowExporterPol.Key tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) } - for _, tagTag := range tagTagState { + for _, tagTag := range tagTagNetflowExporterPolState { delete := true for _, tagTagIdentifier := range tagTagIdentifiers { if tagTagIdentifier.Key == tagTag.Key { @@ -951,10 +1418,10 @@ func getNetflowExporterPolTagTagChildPayloads(ctx context.Context, diags *diag.D } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagTag.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) + tagTagChildMapForDelete := NewAciObject() + tagTagChildMapForDelete.Attributes["status"] = "deleted" + tagTagChildMapForDelete.Attributes["key"] = tagTag.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagTag": tagTagChildMapForDelete}) } } } else { diff --git a/internal/provider/resource_aci_netflow_exporter_policy_test.go b/internal/provider/resource_aci_netflow_exporter_policy_test.go index c401afc56..76b273ad8 100644 --- a/internal/provider/resource_aci_netflow_exporter_policy_test.go +++ b/internal/provider/resource_aci_netflow_exporter_policy_test.go @@ -237,8 +237,28 @@ func TestAccResourceNetflowExporterPolWithFvTenant(t *testing.T) { resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "annotations.1.value", "test_value"), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "annotations.#", "2"), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "relation_to_epg.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "relation_to_epg.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "relation_to_epg.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "relation_to_epg.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "relation_to_epg.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "annotations.#", "2"), + resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "relation_to_epg.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "relation_to_epg.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "relation_to_epg.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "relation_to_epg.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "tags.#", "2"), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "relation_to_epg.target_dn", "uni/tn-test_tenant/ap-test_ap/epg-test_epg"), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "relation_to_vrf.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "relation_to_vrf.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "relation_to_vrf.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "relation_to_vrf.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "relation_to_vrf.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "annotations.#", "2"), + resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "relation_to_vrf.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "relation_to_vrf.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "relation_to_vrf.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "relation_to_vrf.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "tags.#", "2"), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "relation_to_vrf.target_dn", "uni/tn-test_tenant/ctx-test_vrf"), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "tags.0.key", "key_0"), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "tags.0.value", "value_1"), @@ -264,8 +284,10 @@ func TestAccResourceNetflowExporterPolWithFvTenant(t *testing.T) { tfjsonpath.New("relation_to_epg"), knownvalue.MapExact( map[string]knownvalue.Check{ - "annotation": knownvalue.Null(), - "target_dn": knownvalue.Null(), + "annotation": knownvalue.Null(), + "annotations": knownvalue.Null(), + "tags": knownvalue.Null(), + "target_dn": knownvalue.Null(), }, ), ), @@ -273,8 +295,10 @@ func TestAccResourceNetflowExporterPolWithFvTenant(t *testing.T) { tfjsonpath.New("relation_to_vrf"), knownvalue.MapExact( map[string]knownvalue.Check{ - "annotation": knownvalue.Null(), - "target_dn": knownvalue.Null(), + "annotation": knownvalue.Null(), + "annotations": knownvalue.Null(), + "tags": knownvalue.Null(), + "target_dn": knownvalue.Null(), }, ), ), @@ -293,8 +317,10 @@ func TestAccResourceNetflowExporterPolWithFvTenant(t *testing.T) { tfjsonpath.New("relation_to_epg"), knownvalue.MapExact( map[string]knownvalue.Check{ - "annotation": knownvalue.Null(), - "target_dn": knownvalue.Null(), + "annotation": knownvalue.Null(), + "annotations": knownvalue.Null(), + "tags": knownvalue.Null(), + "target_dn": knownvalue.Null(), }, ), ), @@ -302,8 +328,10 @@ func TestAccResourceNetflowExporterPolWithFvTenant(t *testing.T) { tfjsonpath.New("relation_to_vrf"), knownvalue.MapExact( map[string]knownvalue.Check{ - "annotation": knownvalue.Null(), - "target_dn": knownvalue.Null(), + "annotation": knownvalue.Null(), + "annotations": knownvalue.Null(), + "tags": knownvalue.Null(), + "target_dn": knownvalue.Null(), }, ), ), @@ -400,32 +428,72 @@ resource "aci_netflow_exporter_policy" "test" { name = "netfow_exporter" source_ip_address = "1.1.1.1/10" annotations = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] relation_to_epg = { annotation = "annotation_1" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] target_dn = "uni/tn-test_tenant/ap-test_ap/epg-test_epg" } relation_to_vrf = { annotation = "annotation_1" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] target_dn = "uni/tn-test_tenant/ctx-test_vrf" } tags = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] } ` diff --git a/internal/provider/resource_aci_netflow_monitor_policy.go b/internal/provider/resource_aci_netflow_monitor_policy.go index 662dafedc..46b3375ad 100644 --- a/internal/provider/resource_aci_netflow_monitor_policy.go +++ b/internal/provider/resource_aci_netflow_monitor_policy.go @@ -69,11 +69,15 @@ func getEmptyNetflowMonitorPolResourceModel() *NetflowMonitorPolResourceModel { AttrTypes: map[string]attr.Type{ "annotation": types.StringType, "netflow_exporter_policy_name": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationNetflowRsMonitorToExporterNetflowMonitorPolType}, + "tags": types.SetType{ElemType: TagTagNetflowRsMonitorToExporterNetflowMonitorPolType}, }, }), NetflowRsMonitorToRecord: types.ObjectNull(map[string]attr.Type{ "annotation": types.StringType, "netflow_record_policy_name": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationNetflowRsMonitorToRecordNetflowMonitorPolType}, + "tags": types.SetType{ElemType: TagTagNetflowRsMonitorToRecordNetflowMonitorPolType}, }), TagAnnotation: types.SetNull(types.ObjectType{ AttrTypes: map[string]attr.Type{ @@ -94,31 +98,150 @@ func getEmptyNetflowMonitorPolResourceModel() *NetflowMonitorPolResourceModel { type NetflowRsMonitorToExporterNetflowMonitorPolResourceModel struct { Annotation types.String `tfsdk:"annotation"` TnNetflowExporterPolName types.String `tfsdk:"netflow_exporter_policy_name"` + TagAnnotation types.Set `tfsdk:"annotations"` + TagTag types.Set `tfsdk:"tags"` } func getEmptyNetflowRsMonitorToExporterNetflowMonitorPolResourceModel() NetflowRsMonitorToExporterNetflowMonitorPolResourceModel { return NetflowRsMonitorToExporterNetflowMonitorPolResourceModel{ Annotation: basetypes.NewStringNull(), TnNetflowExporterPolName: basetypes.NewStringNull(), + TagAnnotation: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + } +} + +var NetflowRsMonitorToExporterNetflowMonitorPolType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "annotation": types.StringType, + "netflow_exporter_policy_name": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationNetflowRsMonitorToExporterNetflowMonitorPolType}, + "tags": types.SetType{ElemType: TagTagNetflowRsMonitorToExporterNetflowMonitorPolType}, + }, +} + +// TagAnnotationNetflowRsMonitorToExporterNetflowMonitorPolResourceModel describes the resource data model for the children without relation ships. +type TagAnnotationNetflowRsMonitorToExporterNetflowMonitorPolResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagAnnotationNetflowRsMonitorToExporterNetflowMonitorPolResourceModel() TagAnnotationNetflowRsMonitorToExporterNetflowMonitorPolResourceModel { + return TagAnnotationNetflowRsMonitorToExporterNetflowMonitorPolResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagAnnotationNetflowRsMonitorToExporterNetflowMonitorPolType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + +// TagTagNetflowRsMonitorToExporterNetflowMonitorPolResourceModel describes the resource data model for the children without relation ships. +type TagTagNetflowRsMonitorToExporterNetflowMonitorPolResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagTagNetflowRsMonitorToExporterNetflowMonitorPolResourceModel() TagTagNetflowRsMonitorToExporterNetflowMonitorPolResourceModel { + return TagTagNetflowRsMonitorToExporterNetflowMonitorPolResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), } } +var TagTagNetflowRsMonitorToExporterNetflowMonitorPolType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // NetflowRsMonitorToRecordNetflowMonitorPolResourceModel describes the resource data model for the children without relation ships. type NetflowRsMonitorToRecordNetflowMonitorPolResourceModel struct { Annotation types.String `tfsdk:"annotation"` TnNetflowRecordPolName types.String `tfsdk:"netflow_record_policy_name"` + TagAnnotation types.Set `tfsdk:"annotations"` + TagTag types.Set `tfsdk:"tags"` } func getEmptyNetflowRsMonitorToRecordNetflowMonitorPolResourceModel() NetflowRsMonitorToRecordNetflowMonitorPolResourceModel { return NetflowRsMonitorToRecordNetflowMonitorPolResourceModel{ Annotation: basetypes.NewStringNull(), TnNetflowRecordPolName: basetypes.NewStringNull(), + TagAnnotation: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), } } var NetflowRsMonitorToRecordNetflowMonitorPolType = map[string]attr.Type{ "annotation": types.StringType, "netflow_record_policy_name": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationNetflowRsMonitorToRecordNetflowMonitorPolType}, + "tags": types.SetType{ElemType: TagTagNetflowRsMonitorToRecordNetflowMonitorPolType}, +} + +// TagAnnotationNetflowRsMonitorToRecordNetflowMonitorPolResourceModel describes the resource data model for the children without relation ships. +type TagAnnotationNetflowRsMonitorToRecordNetflowMonitorPolResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagAnnotationNetflowRsMonitorToRecordNetflowMonitorPolResourceModel() TagAnnotationNetflowRsMonitorToRecordNetflowMonitorPolResourceModel { + return TagAnnotationNetflowRsMonitorToRecordNetflowMonitorPolResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagAnnotationNetflowRsMonitorToRecordNetflowMonitorPolType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + +// TagTagNetflowRsMonitorToRecordNetflowMonitorPolResourceModel describes the resource data model for the children without relation ships. +type TagTagNetflowRsMonitorToRecordNetflowMonitorPolResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagTagNetflowRsMonitorToRecordNetflowMonitorPolResourceModel() TagTagNetflowRsMonitorToRecordNetflowMonitorPolResourceModel { + return TagTagNetflowRsMonitorToRecordNetflowMonitorPolResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagTagNetflowRsMonitorToRecordNetflowMonitorPolType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, } // TagAnnotationNetflowMonitorPolResourceModel describes the resource data model for the children without relation ships. @@ -134,6 +257,13 @@ func getEmptyTagAnnotationNetflowMonitorPolResourceModel() TagAnnotationNetflowM } } +var TagAnnotationNetflowMonitorPolType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // TagTagNetflowMonitorPolResourceModel describes the resource data model for the children without relation ships. type TagTagNetflowMonitorPolResourceModel struct { Key types.String `tfsdk:"key"` @@ -147,6 +277,13 @@ func getEmptyTagTagNetflowMonitorPolResourceModel() TagTagNetflowMonitorPolResou } } +var TagTagNetflowMonitorPolType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + type NetflowMonitorPolIdentifier struct { Name types.String } @@ -469,6 +606,58 @@ func (r *NetflowMonitorPolResource) Schema(ctx context.Context, req resource.Sch }, MarkdownDescription: `Name.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, }, @@ -496,6 +685,58 @@ func (r *NetflowMonitorPolResource) Schema(ctx context.Context, req resource.Sch }, MarkdownDescription: `Name.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, "annotations": schema.SetNestedAttribute{ @@ -754,7 +995,7 @@ func (r *NetflowMonitorPolResource) ImportState(ctx context.Context, req resourc } func getAndSetNetflowMonitorPolAttributes(ctx context.Context, diags *diag.Diagnostics, client *client.Client, data *NetflowMonitorPolResourceModel) { - requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=children&rsp-subtree-class=%s", data.Id.ValueString(), "netflowMonitorPol,netflowRsMonitorToExporter,netflowRsMonitorToRecord,tagAnnotation,tagTag"), "GET", nil) + requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=full&rsp-subtree-class=%s", data.Id.ValueString(), "netflowMonitorPol,netflowRsMonitorToExporter,netflowRsMonitorToRecord,tagAnnotation,tagTag,tagAnnotation,tagTag,tagAnnotation,tagTag"), "GET", nil) readData := getEmptyNetflowMonitorPolResourceModel() @@ -808,7 +1049,47 @@ func getAndSetNetflowMonitorPolAttributes(ctx context.Context, diags *diag.Diagn if childAttributeName == "tnNetflowExporterPolName" { NetflowRsMonitorToExporterNetflowMonitorPol.TnNetflowExporterPolName = basetypes.NewStringValue(childAttributeValue.(string)) } + } + TagAnnotationNetflowRsMonitorToExporterNetflowMonitorPolList := make([]TagAnnotationNetflowRsMonitorToExporterNetflowMonitorPolResourceModel, 0) + TagTagNetflowRsMonitorToExporterNetflowMonitorPolList := make([]TagTagNetflowRsMonitorToExporterNetflowMonitorPolResourceModel, 0) + childrenOfNetflowRsMonitorToExporterNetflowMonitorPol, childrenOfNetflowRsMonitorToExporterNetflowMonitorPolExist := childClassDetails.(map[string]interface{})["children"] + if childrenOfNetflowRsMonitorToExporterNetflowMonitorPolExist { + for _, childNetflowRsMonitorToExporterNetflowMonitorPol := range childrenOfNetflowRsMonitorToExporterNetflowMonitorPol.([]interface{}) { + for childClassNameNetflowRsMonitorToExporterNetflowMonitorPol, childClassDetailsNetflowRsMonitorToExporterNetflowMonitorPol := range childNetflowRsMonitorToExporterNetflowMonitorPol.(map[string]interface{}) { + if childClassNameNetflowRsMonitorToExporterNetflowMonitorPol == "tagAnnotation" { + TagAnnotationNetflowRsMonitorToExporterNetflowMonitorPol := getEmptyTagAnnotationNetflowRsMonitorToExporterNetflowMonitorPolResourceModel() + tagAnnotationchildAttributeValue := childClassDetailsNetflowRsMonitorToExporterNetflowMonitorPol.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagAnnotationchildAttributeValue { + if childAttributeName == "key" { + TagAnnotationNetflowRsMonitorToExporterNetflowMonitorPol.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagAnnotationNetflowRsMonitorToExporterNetflowMonitorPol.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagAnnotationNetflowRsMonitorToExporterNetflowMonitorPolList = append(TagAnnotationNetflowRsMonitorToExporterNetflowMonitorPolList, TagAnnotationNetflowRsMonitorToExporterNetflowMonitorPol) + } + if childClassNameNetflowRsMonitorToExporterNetflowMonitorPol == "tagTag" { + TagTagNetflowRsMonitorToExporterNetflowMonitorPol := getEmptyTagTagNetflowRsMonitorToExporterNetflowMonitorPolResourceModel() + tagTagchildAttributeValue := childClassDetailsNetflowRsMonitorToExporterNetflowMonitorPol.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagTagchildAttributeValue { + if childAttributeName == "key" { + TagTagNetflowRsMonitorToExporterNetflowMonitorPol.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagTagNetflowRsMonitorToExporterNetflowMonitorPol.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagTagNetflowRsMonitorToExporterNetflowMonitorPolList = append(TagTagNetflowRsMonitorToExporterNetflowMonitorPolList, TagTagNetflowRsMonitorToExporterNetflowMonitorPol) + } + } + } + } + TagAnnotationNetflowRsMonitorToExporterNetflowMonitorPolSet, _ := types.SetValueFrom(ctx, TagAnnotationNetflowRsMonitorToExporterNetflowMonitorPolType, TagAnnotationNetflowRsMonitorToExporterNetflowMonitorPolList) + NetflowRsMonitorToExporterNetflowMonitorPol.TagAnnotation = TagAnnotationNetflowRsMonitorToExporterNetflowMonitorPolSet + TagTagNetflowRsMonitorToExporterNetflowMonitorPolSet, _ := types.SetValueFrom(ctx, TagTagNetflowRsMonitorToExporterNetflowMonitorPolType, TagTagNetflowRsMonitorToExporterNetflowMonitorPolList) + NetflowRsMonitorToExporterNetflowMonitorPol.TagTag = TagTagNetflowRsMonitorToExporterNetflowMonitorPolSet NetflowRsMonitorToExporterNetflowMonitorPolList = append(NetflowRsMonitorToExporterNetflowMonitorPolList, NetflowRsMonitorToExporterNetflowMonitorPol) } if childClassName == "netflowRsMonitorToRecord" { @@ -820,7 +1101,47 @@ func getAndSetNetflowMonitorPolAttributes(ctx context.Context, diags *diag.Diagn if childAttributeName == "tnNetflowRecordPolName" { NetflowRsMonitorToRecordNetflowMonitorPol.TnNetflowRecordPolName = basetypes.NewStringValue(childAttributeValue.(string)) } + + } + TagAnnotationNetflowRsMonitorToRecordNetflowMonitorPolList := make([]TagAnnotationNetflowRsMonitorToRecordNetflowMonitorPolResourceModel, 0) + TagTagNetflowRsMonitorToRecordNetflowMonitorPolList := make([]TagTagNetflowRsMonitorToRecordNetflowMonitorPolResourceModel, 0) + childrenOfNetflowRsMonitorToRecordNetflowMonitorPol, childrenOfNetflowRsMonitorToRecordNetflowMonitorPolExist := childClassDetails.(map[string]interface{})["children"] + if childrenOfNetflowRsMonitorToRecordNetflowMonitorPolExist { + for _, childNetflowRsMonitorToRecordNetflowMonitorPol := range childrenOfNetflowRsMonitorToRecordNetflowMonitorPol.([]interface{}) { + for childClassNameNetflowRsMonitorToRecordNetflowMonitorPol, childClassDetailsNetflowRsMonitorToRecordNetflowMonitorPol := range childNetflowRsMonitorToRecordNetflowMonitorPol.(map[string]interface{}) { + if childClassNameNetflowRsMonitorToRecordNetflowMonitorPol == "tagAnnotation" { + TagAnnotationNetflowRsMonitorToRecordNetflowMonitorPol := getEmptyTagAnnotationNetflowRsMonitorToRecordNetflowMonitorPolResourceModel() + tagAnnotationchildAttributeValue := childClassDetailsNetflowRsMonitorToRecordNetflowMonitorPol.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagAnnotationchildAttributeValue { + if childAttributeName == "key" { + TagAnnotationNetflowRsMonitorToRecordNetflowMonitorPol.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagAnnotationNetflowRsMonitorToRecordNetflowMonitorPol.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagAnnotationNetflowRsMonitorToRecordNetflowMonitorPolList = append(TagAnnotationNetflowRsMonitorToRecordNetflowMonitorPolList, TagAnnotationNetflowRsMonitorToRecordNetflowMonitorPol) + } + if childClassNameNetflowRsMonitorToRecordNetflowMonitorPol == "tagTag" { + TagTagNetflowRsMonitorToRecordNetflowMonitorPol := getEmptyTagTagNetflowRsMonitorToRecordNetflowMonitorPolResourceModel() + tagTagchildAttributeValue := childClassDetailsNetflowRsMonitorToRecordNetflowMonitorPol.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagTagchildAttributeValue { + if childAttributeName == "key" { + TagTagNetflowRsMonitorToRecordNetflowMonitorPol.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagTagNetflowRsMonitorToRecordNetflowMonitorPol.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagTagNetflowRsMonitorToRecordNetflowMonitorPolList = append(TagTagNetflowRsMonitorToRecordNetflowMonitorPolList, TagTagNetflowRsMonitorToRecordNetflowMonitorPol) + } + } + } } + TagAnnotationNetflowRsMonitorToRecordNetflowMonitorPolSet, _ := types.SetValueFrom(ctx, TagAnnotationNetflowRsMonitorToRecordNetflowMonitorPolType, TagAnnotationNetflowRsMonitorToRecordNetflowMonitorPolList) + NetflowRsMonitorToRecordNetflowMonitorPol.TagAnnotation = TagAnnotationNetflowRsMonitorToRecordNetflowMonitorPolSet + TagTagNetflowRsMonitorToRecordNetflowMonitorPolSet, _ := types.SetValueFrom(ctx, TagTagNetflowRsMonitorToRecordNetflowMonitorPolType, TagTagNetflowRsMonitorToRecordNetflowMonitorPolList) + NetflowRsMonitorToRecordNetflowMonitorPol.TagTag = TagTagNetflowRsMonitorToRecordNetflowMonitorPolSet NetflowRsMonitorToRecordNetflowMonitorPolList = append(NetflowRsMonitorToRecordNetflowMonitorPolList, NetflowRsMonitorToRecordNetflowMonitorPol) } if childClassName == "tagAnnotation" { @@ -832,6 +1153,7 @@ func getAndSetNetflowMonitorPolAttributes(ctx context.Context, diags *diag.Diagn if childAttributeName == "value" { TagAnnotationNetflowMonitorPol.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagAnnotationNetflowMonitorPolList = append(TagAnnotationNetflowMonitorPolList, TagAnnotationNetflowMonitorPol) } @@ -844,6 +1166,7 @@ func getAndSetNetflowMonitorPolAttributes(ctx context.Context, diags *diag.Diagn if childAttributeName == "value" { TagTagNetflowMonitorPol.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagTagNetflowMonitorPolList = append(TagTagNetflowMonitorPolList, TagTagNetflowMonitorPol) } @@ -900,27 +1223,102 @@ func setNetflowMonitorPolId(ctx context.Context, data *NetflowMonitorPolResource data.Id = types.StringValue(fmt.Sprintf("%s/%s", data.ParentDn.ValueString(), rn)) } -func getNetflowMonitorPolNetflowRsMonitorToExporterChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *NetflowMonitorPolResourceModel, netflowRsMonitorToExporterPlan, netflowRsMonitorToExporterState []NetflowRsMonitorToExporterNetflowMonitorPolResourceModel) []map[string]interface{} { - +func getNetflowMonitorPolNetflowRsMonitorToExporterChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *NetflowMonitorPolResourceModel, netflowRsMonitorToExporterNetflowMonitorPolPlan, netflowRsMonitorToExporterNetflowMonitorPolState []NetflowRsMonitorToExporterNetflowMonitorPolResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.NetflowRsMonitorToExporter.IsUnknown() { + if !data.NetflowRsMonitorToExporter.IsNull() && !data.NetflowRsMonitorToExporter.IsUnknown() { netflowRsMonitorToExporterIdentifiers := []NetflowRsMonitorToExporterIdentifier{} - for _, netflowRsMonitorToExporter := range netflowRsMonitorToExporterPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !netflowRsMonitorToExporter.Annotation.IsUnknown() && !netflowRsMonitorToExporter.Annotation.IsNull() { - childMap["attributes"]["annotation"] = netflowRsMonitorToExporter.Annotation.ValueString() + for _, netflowRsMonitorToExporterNetflowMonitorPol := range netflowRsMonitorToExporterNetflowMonitorPolPlan { + NetflowRsMonitorToExporterNetflowMonitorPolChildren := make([]map[string]interface{}, 0) + childMap := NewAciObject() + if !netflowRsMonitorToExporterNetflowMonitorPol.Annotation.IsNull() && !netflowRsMonitorToExporterNetflowMonitorPol.Annotation.IsUnknown() { + childMap.Attributes["annotation"] = netflowRsMonitorToExporterNetflowMonitorPol.Annotation.ValueString() } else { - childMap["attributes"]["annotation"] = globalAnnotation + childMap.Attributes["annotation"] = globalAnnotation + } + if !netflowRsMonitorToExporterNetflowMonitorPol.TnNetflowExporterPolName.IsNull() && !netflowRsMonitorToExporterNetflowMonitorPol.TnNetflowExporterPolName.IsUnknown() { + childMap.Attributes["tnNetflowExporterPolName"] = netflowRsMonitorToExporterNetflowMonitorPol.TnNetflowExporterPolName.ValueString() } - if !netflowRsMonitorToExporter.TnNetflowExporterPolName.IsUnknown() && !netflowRsMonitorToExporter.TnNetflowExporterPolName.IsNull() { - childMap["attributes"]["tnNetflowExporterPolName"] = netflowRsMonitorToExporter.TnNetflowExporterPolName.ValueString() + + var tagAnnotationNetflowRsMonitorToExporterNetflowMonitorPolPlan, tagAnnotationNetflowRsMonitorToExporterNetflowMonitorPolState []TagAnnotationNetflowRsMonitorToExporterNetflowMonitorPolResourceModel + netflowRsMonitorToExporterNetflowMonitorPol.TagAnnotation.ElementsAs(ctx, &tagAnnotationNetflowRsMonitorToExporterNetflowMonitorPolPlan, false) + for _, tagAnnotationNetflowRsMonitorToExporterNetflowMonitorPolstate := range netflowRsMonitorToExporterNetflowMonitorPolState { + tagAnnotationNetflowRsMonitorToExporterNetflowMonitorPolstate.TagAnnotation.ElementsAs(ctx, &tagAnnotationNetflowRsMonitorToExporterNetflowMonitorPolState, false) + } + if !netflowRsMonitorToExporterNetflowMonitorPol.TagAnnotation.IsNull() && !netflowRsMonitorToExporterNetflowMonitorPol.TagAnnotation.IsUnknown() { + tagAnnotationIdentifiers := []TagAnnotationIdentifier{} + for _, tagAnnotationNetflowRsMonitorToExporterNetflowMonitorPol := range tagAnnotationNetflowRsMonitorToExporterNetflowMonitorPolPlan { + tagAnnotationNetflowRsMonitorToExporterNetflowMonitorPolChildMap := NewAciObject() + if !tagAnnotationNetflowRsMonitorToExporterNetflowMonitorPol.Key.IsNull() && !tagAnnotationNetflowRsMonitorToExporterNetflowMonitorPol.Key.IsUnknown() { + tagAnnotationNetflowRsMonitorToExporterNetflowMonitorPolChildMap.Attributes["key"] = tagAnnotationNetflowRsMonitorToExporterNetflowMonitorPol.Key.ValueString() + } + if !tagAnnotationNetflowRsMonitorToExporterNetflowMonitorPol.Value.IsNull() && !tagAnnotationNetflowRsMonitorToExporterNetflowMonitorPol.Value.IsUnknown() { + tagAnnotationNetflowRsMonitorToExporterNetflowMonitorPolChildMap.Attributes["value"] = tagAnnotationNetflowRsMonitorToExporterNetflowMonitorPol.Value.ValueString() + } + NetflowRsMonitorToExporterNetflowMonitorPolChildren = append(NetflowRsMonitorToExporterNetflowMonitorPolChildren, map[string]interface{}{"tagAnnotation": tagAnnotationNetflowRsMonitorToExporterNetflowMonitorPolChildMap}) + tagAnnotationIdentifier := TagAnnotationIdentifier{} + tagAnnotationIdentifier.Key = tagAnnotationNetflowRsMonitorToExporterNetflowMonitorPol.Key + tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) + } + for _, tagAnnotationNetflowRsMonitorToExporterNetflowMonitorPol := range tagAnnotationNetflowRsMonitorToExporterNetflowMonitorPolState { + delete := true + for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { + if tagAnnotationIdentifier.Key == tagAnnotationNetflowRsMonitorToExporterNetflowMonitorPol.Key { + delete = false + break + } + } + if delete { + tagAnnotationNetflowRsMonitorToExporterNetflowMonitorPolChildMapForDelete := NewAciObject() + tagAnnotationNetflowRsMonitorToExporterNetflowMonitorPolChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationNetflowRsMonitorToExporterNetflowMonitorPolChildMapForDelete.Attributes["key"] = tagAnnotationNetflowRsMonitorToExporterNetflowMonitorPol.Key.ValueString() + NetflowRsMonitorToExporterNetflowMonitorPolChildren = append(NetflowRsMonitorToExporterNetflowMonitorPolChildren, map[string]interface{}{"tagAnnotation": tagAnnotationNetflowRsMonitorToExporterNetflowMonitorPolChildMapForDelete}) + } + } + } + + var tagTagNetflowRsMonitorToExporterNetflowMonitorPolPlan, tagTagNetflowRsMonitorToExporterNetflowMonitorPolState []TagTagNetflowRsMonitorToExporterNetflowMonitorPolResourceModel + netflowRsMonitorToExporterNetflowMonitorPol.TagTag.ElementsAs(ctx, &tagTagNetflowRsMonitorToExporterNetflowMonitorPolPlan, false) + for _, tagTagNetflowRsMonitorToExporterNetflowMonitorPolstate := range netflowRsMonitorToExporterNetflowMonitorPolState { + tagTagNetflowRsMonitorToExporterNetflowMonitorPolstate.TagTag.ElementsAs(ctx, &tagTagNetflowRsMonitorToExporterNetflowMonitorPolState, false) + } + if !netflowRsMonitorToExporterNetflowMonitorPol.TagTag.IsNull() && !netflowRsMonitorToExporterNetflowMonitorPol.TagTag.IsUnknown() { + tagTagIdentifiers := []TagTagIdentifier{} + for _, tagTagNetflowRsMonitorToExporterNetflowMonitorPol := range tagTagNetflowRsMonitorToExporterNetflowMonitorPolPlan { + tagTagNetflowRsMonitorToExporterNetflowMonitorPolChildMap := NewAciObject() + if !tagTagNetflowRsMonitorToExporterNetflowMonitorPol.Key.IsNull() && !tagTagNetflowRsMonitorToExporterNetflowMonitorPol.Key.IsUnknown() { + tagTagNetflowRsMonitorToExporterNetflowMonitorPolChildMap.Attributes["key"] = tagTagNetflowRsMonitorToExporterNetflowMonitorPol.Key.ValueString() + } + if !tagTagNetflowRsMonitorToExporterNetflowMonitorPol.Value.IsNull() && !tagTagNetflowRsMonitorToExporterNetflowMonitorPol.Value.IsUnknown() { + tagTagNetflowRsMonitorToExporterNetflowMonitorPolChildMap.Attributes["value"] = tagTagNetflowRsMonitorToExporterNetflowMonitorPol.Value.ValueString() + } + NetflowRsMonitorToExporterNetflowMonitorPolChildren = append(NetflowRsMonitorToExporterNetflowMonitorPolChildren, map[string]interface{}{"tagTag": tagTagNetflowRsMonitorToExporterNetflowMonitorPolChildMap}) + tagTagIdentifier := TagTagIdentifier{} + tagTagIdentifier.Key = tagTagNetflowRsMonitorToExporterNetflowMonitorPol.Key + tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) + } + for _, tagTagNetflowRsMonitorToExporterNetflowMonitorPol := range tagTagNetflowRsMonitorToExporterNetflowMonitorPolState { + delete := true + for _, tagTagIdentifier := range tagTagIdentifiers { + if tagTagIdentifier.Key == tagTagNetflowRsMonitorToExporterNetflowMonitorPol.Key { + delete = false + break + } + } + if delete { + tagTagNetflowRsMonitorToExporterNetflowMonitorPolChildMapForDelete := NewAciObject() + tagTagNetflowRsMonitorToExporterNetflowMonitorPolChildMapForDelete.Attributes["status"] = "deleted" + tagTagNetflowRsMonitorToExporterNetflowMonitorPolChildMapForDelete.Attributes["key"] = tagTagNetflowRsMonitorToExporterNetflowMonitorPol.Key.ValueString() + NetflowRsMonitorToExporterNetflowMonitorPolChildren = append(NetflowRsMonitorToExporterNetflowMonitorPolChildren, map[string]interface{}{"tagTag": tagTagNetflowRsMonitorToExporterNetflowMonitorPolChildMapForDelete}) + } + } } + childMap.Children = NetflowRsMonitorToExporterNetflowMonitorPolChildren childPayloads = append(childPayloads, map[string]interface{}{"netflowRsMonitorToExporter": childMap}) netflowRsMonitorToExporterIdentifier := NetflowRsMonitorToExporterIdentifier{} - netflowRsMonitorToExporterIdentifier.TnNetflowExporterPolName = netflowRsMonitorToExporter.TnNetflowExporterPolName + netflowRsMonitorToExporterIdentifier.TnNetflowExporterPolName = netflowRsMonitorToExporterNetflowMonitorPol.TnNetflowExporterPolName netflowRsMonitorToExporterIdentifiers = append(netflowRsMonitorToExporterIdentifiers, netflowRsMonitorToExporterIdentifier) } - for _, netflowRsMonitorToExporter := range netflowRsMonitorToExporterState { + for _, netflowRsMonitorToExporter := range netflowRsMonitorToExporterNetflowMonitorPolState { delete := true for _, netflowRsMonitorToExporterIdentifier := range netflowRsMonitorToExporterIdentifiers { if netflowRsMonitorToExporterIdentifier.TnNetflowExporterPolName == netflowRsMonitorToExporter.TnNetflowExporterPolName { @@ -929,10 +1327,10 @@ func getNetflowMonitorPolNetflowRsMonitorToExporterChildPayloads(ctx context.Con } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["tnNetflowExporterPolName"] = netflowRsMonitorToExporter.TnNetflowExporterPolName.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"netflowRsMonitorToExporter": childMap}) + netflowRsMonitorToExporterChildMapForDelete := NewAciObject() + netflowRsMonitorToExporterChildMapForDelete.Attributes["status"] = "deleted" + netflowRsMonitorToExporterChildMapForDelete.Attributes["tnNetflowExporterPolName"] = netflowRsMonitorToExporter.TnNetflowExporterPolName.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"netflowRsMonitorToExporter": netflowRsMonitorToExporterChildMapForDelete}) } } } else { @@ -941,21 +1339,97 @@ func getNetflowMonitorPolNetflowRsMonitorToExporterChildPayloads(ctx context.Con return childPayloads } -func getNetflowMonitorPolNetflowRsMonitorToRecordChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *NetflowMonitorPolResourceModel, netflowRsMonitorToRecordPlan, netflowRsMonitorToRecordState NetflowRsMonitorToRecordNetflowMonitorPolResourceModel) []map[string]interface{} { +func getNetflowMonitorPolNetflowRsMonitorToRecordChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *NetflowMonitorPolResourceModel, netflowRsMonitorToRecordNetflowMonitorPolPlan, netflowRsMonitorToRecordNetflowMonitorPolState NetflowRsMonitorToRecordNetflowMonitorPolResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.NetflowRsMonitorToRecord.IsUnknown() { - childMap := map[string]map[string]interface{}{"attributes": {}} + if !data.NetflowRsMonitorToRecord.IsNull() && !data.NetflowRsMonitorToRecord.IsUnknown() { + NetflowRsMonitorToRecordNetflowMonitorPolChildren := make([]map[string]interface{}, 0) + childMap := NewAciObject() if !IsEmptySingleNestedAttribute(data.NetflowRsMonitorToRecord.Attributes()) { - if !netflowRsMonitorToRecordPlan.Annotation.IsUnknown() && !netflowRsMonitorToRecordPlan.Annotation.IsNull() { - childMap["attributes"]["annotation"] = netflowRsMonitorToRecordPlan.Annotation.ValueString() + if !netflowRsMonitorToRecordNetflowMonitorPolPlan.Annotation.IsUnknown() && !netflowRsMonitorToRecordNetflowMonitorPolPlan.Annotation.IsNull() { + childMap.Attributes["annotation"] = netflowRsMonitorToRecordNetflowMonitorPolPlan.Annotation.ValueString() } else { - childMap["attributes"]["annotation"] = globalAnnotation + childMap.Attributes["annotation"] = globalAnnotation + } + if !netflowRsMonitorToRecordNetflowMonitorPolPlan.TnNetflowRecordPolName.IsUnknown() && !netflowRsMonitorToRecordNetflowMonitorPolPlan.TnNetflowRecordPolName.IsNull() { + childMap.Attributes["tnNetflowRecordPolName"] = netflowRsMonitorToRecordNetflowMonitorPolPlan.TnNetflowRecordPolName.ValueString() } - if !netflowRsMonitorToRecordPlan.TnNetflowRecordPolName.IsUnknown() && !netflowRsMonitorToRecordPlan.TnNetflowRecordPolName.IsNull() { - childMap["attributes"]["tnNetflowRecordPolName"] = netflowRsMonitorToRecordPlan.TnNetflowRecordPolName.ValueString() + } + + var tagAnnotationNetflowRsMonitorToRecordNetflowMonitorPolPlan, tagAnnotationNetflowRsMonitorToRecordNetflowMonitorPolState []TagAnnotationNetflowRsMonitorToRecordNetflowMonitorPolResourceModel + netflowRsMonitorToRecordNetflowMonitorPolPlan.TagAnnotation.ElementsAs(ctx, &tagAnnotationNetflowRsMonitorToRecordNetflowMonitorPolPlan, false) + if !netflowRsMonitorToRecordNetflowMonitorPolState.TagAnnotation.IsNull() { + netflowRsMonitorToRecordNetflowMonitorPolState.TagAnnotation.ElementsAs(ctx, &tagAnnotationNetflowRsMonitorToRecordNetflowMonitorPolState, false) + } + if !netflowRsMonitorToRecordNetflowMonitorPolPlan.TagAnnotation.IsNull() && !netflowRsMonitorToRecordNetflowMonitorPolPlan.TagAnnotation.IsUnknown() { + tagAnnotationIdentifiers := []TagAnnotationIdentifier{} + for _, tagAnnotationNetflowRsMonitorToRecordNetflowMonitorPol := range tagAnnotationNetflowRsMonitorToRecordNetflowMonitorPolPlan { + tagAnnotationNetflowRsMonitorToRecordNetflowMonitorPolChildMap := NewAciObject() + if !tagAnnotationNetflowRsMonitorToRecordNetflowMonitorPol.Key.IsNull() && !tagAnnotationNetflowRsMonitorToRecordNetflowMonitorPol.Key.IsUnknown() { + tagAnnotationNetflowRsMonitorToRecordNetflowMonitorPolChildMap.Attributes["key"] = tagAnnotationNetflowRsMonitorToRecordNetflowMonitorPol.Key.ValueString() + } + if !tagAnnotationNetflowRsMonitorToRecordNetflowMonitorPol.Value.IsNull() && !tagAnnotationNetflowRsMonitorToRecordNetflowMonitorPol.Value.IsUnknown() { + tagAnnotationNetflowRsMonitorToRecordNetflowMonitorPolChildMap.Attributes["value"] = tagAnnotationNetflowRsMonitorToRecordNetflowMonitorPol.Value.ValueString() + } + NetflowRsMonitorToRecordNetflowMonitorPolChildren = append(NetflowRsMonitorToRecordNetflowMonitorPolChildren, map[string]interface{}{"tagAnnotation": tagAnnotationNetflowRsMonitorToRecordNetflowMonitorPolChildMap}) + tagAnnotationIdentifier := TagAnnotationIdentifier{} + tagAnnotationIdentifier.Key = tagAnnotationNetflowRsMonitorToRecordNetflowMonitorPol.Key + tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) + } + for _, tagAnnotationNetflowRsMonitorToRecordNetflowMonitorPol := range tagAnnotationNetflowRsMonitorToRecordNetflowMonitorPolState { + delete := true + for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { + if tagAnnotationIdentifier.Key == tagAnnotationNetflowRsMonitorToRecordNetflowMonitorPol.Key { + delete = false + break + } + } + if delete { + tagAnnotationNetflowRsMonitorToRecordNetflowMonitorPolChildMapForDelete := NewAciObject() + tagAnnotationNetflowRsMonitorToRecordNetflowMonitorPolChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationNetflowRsMonitorToRecordNetflowMonitorPolChildMapForDelete.Attributes["key"] = tagAnnotationNetflowRsMonitorToRecordNetflowMonitorPol.Key.ValueString() + NetflowRsMonitorToRecordNetflowMonitorPolChildren = append(NetflowRsMonitorToRecordNetflowMonitorPolChildren, map[string]interface{}{"tagAnnotation": tagAnnotationNetflowRsMonitorToRecordNetflowMonitorPolChildMapForDelete}) + } + } + } + + var tagTagNetflowRsMonitorToRecordNetflowMonitorPolPlan, tagTagNetflowRsMonitorToRecordNetflowMonitorPolState []TagTagNetflowRsMonitorToRecordNetflowMonitorPolResourceModel + netflowRsMonitorToRecordNetflowMonitorPolPlan.TagTag.ElementsAs(ctx, &tagTagNetflowRsMonitorToRecordNetflowMonitorPolPlan, false) + if !netflowRsMonitorToRecordNetflowMonitorPolState.TagTag.IsNull() { + netflowRsMonitorToRecordNetflowMonitorPolState.TagTag.ElementsAs(ctx, &tagTagNetflowRsMonitorToRecordNetflowMonitorPolState, false) + } + if !netflowRsMonitorToRecordNetflowMonitorPolPlan.TagTag.IsNull() && !netflowRsMonitorToRecordNetflowMonitorPolPlan.TagTag.IsUnknown() { + tagTagIdentifiers := []TagTagIdentifier{} + for _, tagTagNetflowRsMonitorToRecordNetflowMonitorPol := range tagTagNetflowRsMonitorToRecordNetflowMonitorPolPlan { + tagTagNetflowRsMonitorToRecordNetflowMonitorPolChildMap := NewAciObject() + if !tagTagNetflowRsMonitorToRecordNetflowMonitorPol.Key.IsNull() && !tagTagNetflowRsMonitorToRecordNetflowMonitorPol.Key.IsUnknown() { + tagTagNetflowRsMonitorToRecordNetflowMonitorPolChildMap.Attributes["key"] = tagTagNetflowRsMonitorToRecordNetflowMonitorPol.Key.ValueString() + } + if !tagTagNetflowRsMonitorToRecordNetflowMonitorPol.Value.IsNull() && !tagTagNetflowRsMonitorToRecordNetflowMonitorPol.Value.IsUnknown() { + tagTagNetflowRsMonitorToRecordNetflowMonitorPolChildMap.Attributes["value"] = tagTagNetflowRsMonitorToRecordNetflowMonitorPol.Value.ValueString() + } + NetflowRsMonitorToRecordNetflowMonitorPolChildren = append(NetflowRsMonitorToRecordNetflowMonitorPolChildren, map[string]interface{}{"tagTag": tagTagNetflowRsMonitorToRecordNetflowMonitorPolChildMap}) + tagTagIdentifier := TagTagIdentifier{} + tagTagIdentifier.Key = tagTagNetflowRsMonitorToRecordNetflowMonitorPol.Key + tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) + } + for _, tagTagNetflowRsMonitorToRecordNetflowMonitorPol := range tagTagNetflowRsMonitorToRecordNetflowMonitorPolState { + delete := true + for _, tagTagIdentifier := range tagTagIdentifiers { + if tagTagIdentifier.Key == tagTagNetflowRsMonitorToRecordNetflowMonitorPol.Key { + delete = false + break + } + } + if delete { + tagTagNetflowRsMonitorToRecordNetflowMonitorPolChildMapForDelete := NewAciObject() + tagTagNetflowRsMonitorToRecordNetflowMonitorPolChildMapForDelete.Attributes["status"] = "deleted" + tagTagNetflowRsMonitorToRecordNetflowMonitorPolChildMapForDelete.Attributes["key"] = tagTagNetflowRsMonitorToRecordNetflowMonitorPol.Key.ValueString() + NetflowRsMonitorToRecordNetflowMonitorPolChildren = append(NetflowRsMonitorToRecordNetflowMonitorPolChildren, map[string]interface{}{"tagTag": tagTagNetflowRsMonitorToRecordNetflowMonitorPolChildMapForDelete}) + } } } + childMap.Children = NetflowRsMonitorToRecordNetflowMonitorPolChildren childPayloads = append(childPayloads, map[string]interface{}{"netflowRsMonitorToRecord": childMap}) } else { NetflowRsMonitorToRecordObject, _ := types.ObjectValueFrom(ctx, NetflowRsMonitorToRecordNetflowMonitorPolType, getEmptyNetflowRsMonitorToRecordNetflowMonitorPolResourceModel()) @@ -964,25 +1438,25 @@ func getNetflowMonitorPolNetflowRsMonitorToRecordChildPayloads(ctx context.Conte return childPayloads } -func getNetflowMonitorPolTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *NetflowMonitorPolResourceModel, tagAnnotationPlan, tagAnnotationState []TagAnnotationNetflowMonitorPolResourceModel) []map[string]interface{} { +func getNetflowMonitorPolTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *NetflowMonitorPolResourceModel, tagAnnotationNetflowMonitorPolPlan, tagAnnotationNetflowMonitorPolState []TagAnnotationNetflowMonitorPolResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagAnnotation.IsUnknown() { + if !data.TagAnnotation.IsNull() && !data.TagAnnotation.IsUnknown() { tagAnnotationIdentifiers := []TagAnnotationIdentifier{} - for _, tagAnnotation := range tagAnnotationPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagAnnotation.Key.IsUnknown() && !tagAnnotation.Key.IsNull() { - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() + for _, tagAnnotationNetflowMonitorPol := range tagAnnotationNetflowMonitorPolPlan { + childMap := NewAciObject() + if !tagAnnotationNetflowMonitorPol.Key.IsNull() && !tagAnnotationNetflowMonitorPol.Key.IsUnknown() { + childMap.Attributes["key"] = tagAnnotationNetflowMonitorPol.Key.ValueString() } - if !tagAnnotation.Value.IsUnknown() && !tagAnnotation.Value.IsNull() { - childMap["attributes"]["value"] = tagAnnotation.Value.ValueString() + if !tagAnnotationNetflowMonitorPol.Value.IsNull() && !tagAnnotationNetflowMonitorPol.Value.IsUnknown() { + childMap.Attributes["value"] = tagAnnotationNetflowMonitorPol.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) tagAnnotationIdentifier := TagAnnotationIdentifier{} - tagAnnotationIdentifier.Key = tagAnnotation.Key + tagAnnotationIdentifier.Key = tagAnnotationNetflowMonitorPol.Key tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) } - for _, tagAnnotation := range tagAnnotationState { + for _, tagAnnotation := range tagAnnotationNetflowMonitorPolState { delete := true for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { if tagAnnotationIdentifier.Key == tagAnnotation.Key { @@ -991,10 +1465,10 @@ func getNetflowMonitorPolTagAnnotationChildPayloads(ctx context.Context, diags * } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) + tagAnnotationChildMapForDelete := NewAciObject() + tagAnnotationChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationChildMapForDelete.Attributes["key"] = tagAnnotation.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": tagAnnotationChildMapForDelete}) } } } else { @@ -1003,25 +1477,25 @@ func getNetflowMonitorPolTagAnnotationChildPayloads(ctx context.Context, diags * return childPayloads } -func getNetflowMonitorPolTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *NetflowMonitorPolResourceModel, tagTagPlan, tagTagState []TagTagNetflowMonitorPolResourceModel) []map[string]interface{} { +func getNetflowMonitorPolTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *NetflowMonitorPolResourceModel, tagTagNetflowMonitorPolPlan, tagTagNetflowMonitorPolState []TagTagNetflowMonitorPolResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagTag.IsUnknown() { + if !data.TagTag.IsNull() && !data.TagTag.IsUnknown() { tagTagIdentifiers := []TagTagIdentifier{} - for _, tagTag := range tagTagPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagTag.Key.IsUnknown() && !tagTag.Key.IsNull() { - childMap["attributes"]["key"] = tagTag.Key.ValueString() + for _, tagTagNetflowMonitorPol := range tagTagNetflowMonitorPolPlan { + childMap := NewAciObject() + if !tagTagNetflowMonitorPol.Key.IsNull() && !tagTagNetflowMonitorPol.Key.IsUnknown() { + childMap.Attributes["key"] = tagTagNetflowMonitorPol.Key.ValueString() } - if !tagTag.Value.IsUnknown() && !tagTag.Value.IsNull() { - childMap["attributes"]["value"] = tagTag.Value.ValueString() + if !tagTagNetflowMonitorPol.Value.IsNull() && !tagTagNetflowMonitorPol.Value.IsUnknown() { + childMap.Attributes["value"] = tagTagNetflowMonitorPol.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) tagTagIdentifier := TagTagIdentifier{} - tagTagIdentifier.Key = tagTag.Key + tagTagIdentifier.Key = tagTagNetflowMonitorPol.Key tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) } - for _, tagTag := range tagTagState { + for _, tagTag := range tagTagNetflowMonitorPolState { delete := true for _, tagTagIdentifier := range tagTagIdentifiers { if tagTagIdentifier.Key == tagTag.Key { @@ -1030,10 +1504,10 @@ func getNetflowMonitorPolTagTagChildPayloads(ctx context.Context, diags *diag.Di } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagTag.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) + tagTagChildMapForDelete := NewAciObject() + tagTagChildMapForDelete.Attributes["status"] = "deleted" + tagTagChildMapForDelete.Attributes["key"] = tagTag.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagTag": tagTagChildMapForDelete}) } } } else { diff --git a/internal/provider/resource_aci_netflow_monitor_policy_test.go b/internal/provider/resource_aci_netflow_monitor_policy_test.go index 829df93f8..c64aae61f 100644 --- a/internal/provider/resource_aci_netflow_monitor_policy_test.go +++ b/internal/provider/resource_aci_netflow_monitor_policy_test.go @@ -185,11 +185,41 @@ func TestAccResourceNetflowMonitorPolWithFvTenant(t *testing.T) { resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "annotations.1.value", "test_value"), resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "annotations.#", "2"), resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_exporters.0.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_exporters.0.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_exporters.0.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_exporters.0.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_exporters.0.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "annotations.#", "2"), + resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_exporters.0.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_exporters.0.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_exporters.0.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_exporters.0.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "tags.#", "2"), resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_exporters.0.netflow_exporter_policy_name", "netflow_exporter_policy_name_0"), resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_exporters.1.annotation", "annotation_2"), + resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_exporters.1.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_exporters.1.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_exporters.1.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_exporters.1.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "annotations.#", "2"), + resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_exporters.1.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_exporters.1.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_exporters.1.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_exporters.1.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "tags.#", "2"), resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_exporters.1.netflow_exporter_policy_name", "netflow_exporter_policy_name_1"), resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_exporters.#", "2"), resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_record.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_record.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_record.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_record.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_record.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "annotations.#", "2"), + resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_record.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_record.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_record.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_record.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "tags.#", "2"), resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_record.netflow_record_policy_name", "netflow_record_policy_name_1"), resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "tags.0.key", "key_0"), resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "tags.0.value", "value_1"), @@ -207,9 +237,21 @@ func TestAccResourceNetflowMonitorPolWithFvTenant(t *testing.T) { resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "annotations.0.value", "test_value"), resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "annotations.#", "1"), resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_exporters.0.annotation", "annotation_2"), + resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_exporters.0.annotations.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_exporters.0.annotations.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_exporters.0.annotations.#", "1"), + resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_exporters.0.tags.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_exporters.0.tags.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_exporters.0.tags.#", "1"), resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_exporters.0.netflow_exporter_policy_name", "netflow_exporter_policy_name_1"), resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_exporters.#", "1"), resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_record.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_record.annotations.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_record.annotations.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_record.annotations.#", "1"), + resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_record.tags.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_record.tags.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_record.tags.#", "1"), resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_record.netflow_record_policy_name", "netflow_record_policy_name_1"), resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "tags.0.key", "key_1"), resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "tags.0.value", "test_value"), @@ -224,6 +266,8 @@ func TestAccResourceNetflowMonitorPolWithFvTenant(t *testing.T) { resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "annotations.#", "0"), resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_exporters.#", "0"), resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_record.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_record.annotations.#", "0"), + resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_record.tags.#", "0"), resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_record.netflow_record_policy_name", "netflow_record_policy_name_1"), resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "tags.#", "0"), ), @@ -280,38 +324,98 @@ resource "aci_netflow_monitor_policy" "test" { parent_dn = aci_tenant.test.id name = "netfow_monitor" annotations = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] relation_to_netflow_exporters = [ - { - annotation = "annotation_1" - netflow_exporter_policy_name = "netflow_exporter_policy_name_0" - }, - { - annotation = "annotation_2" - netflow_exporter_policy_name = "netflow_exporter_policy_name_1" - }, + { + annotation = "annotation_1" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + netflow_exporter_policy_name = "netflow_exporter_policy_name_0" + }, + { + annotation = "annotation_2" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + netflow_exporter_policy_name = "netflow_exporter_policy_name_1" + }, ] relation_to_netflow_record = { annotation = "annotation_1" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] netflow_record_policy_name = "netflow_record_policy_name_1" } tags = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] } ` @@ -336,9 +440,37 @@ resource "aci_netflow_monitor_policy" "test" { relation_to_netflow_exporters = [ { annotation = "annotation_2" + annotations = [ + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_1" + value = "test_value" + }, + ] netflow_exporter_policy_name = "netflow_exporter_policy_name_1" }, ] + relation_to_netflow_record = { + annotation = "annotation_1" + annotations = [ + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_1" + value = "test_value" + }, + ] + netflow_record_policy_name = "netflow_record_policy_name_1" + } tags = [ { key = "key_1" @@ -354,6 +486,12 @@ resource "aci_netflow_monitor_policy" "test" { name = "netfow_monitor" annotations = [] relation_to_netflow_exporters = [] + relation_to_netflow_record = { + annotation = "annotation_1" + annotations = [] + tags = [] + netflow_record_policy_name = "netflow_record_policy_name_1" + } tags = [] } ` diff --git a/internal/provider/resource_aci_netflow_record_policy.go b/internal/provider/resource_aci_netflow_record_policy.go index f143181e9..dee1fe244 100644 --- a/internal/provider/resource_aci_netflow_record_policy.go +++ b/internal/provider/resource_aci_netflow_record_policy.go @@ -98,6 +98,13 @@ func getEmptyTagAnnotationNetflowRecordPolResourceModel() TagAnnotationNetflowRe } } +var TagAnnotationNetflowRecordPolType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // TagTagNetflowRecordPolResourceModel describes the resource data model for the children without relation ships. type TagTagNetflowRecordPolResourceModel struct { Key types.String `tfsdk:"key"` @@ -111,6 +118,13 @@ func getEmptyTagTagNetflowRecordPolResourceModel() TagTagNetflowRecordPolResourc } } +var TagTagNetflowRecordPolType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + type NetflowRecordPolIdentifier struct { Name types.String } @@ -494,7 +508,7 @@ func (r *NetflowRecordPolResource) ImportState(ctx context.Context, req resource } func getAndSetNetflowRecordPolAttributes(ctx context.Context, diags *diag.Diagnostics, client *client.Client, data *NetflowRecordPolResourceModel) { - requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=children&rsp-subtree-class=%s", data.Id.ValueString(), "netflowRecordPol,tagAnnotation,tagTag"), "GET", nil) + requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=full&rsp-subtree-class=%s", data.Id.ValueString(), "netflowRecordPol,tagAnnotation,tagTag"), "GET", nil) readData := getEmptyNetflowRecordPolResourceModel() @@ -562,6 +576,7 @@ func getAndSetNetflowRecordPolAttributes(ctx context.Context, diags *diag.Diagno if childAttributeName == "value" { TagAnnotationNetflowRecordPol.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagAnnotationNetflowRecordPolList = append(TagAnnotationNetflowRecordPolList, TagAnnotationNetflowRecordPol) } @@ -574,6 +589,7 @@ func getAndSetNetflowRecordPolAttributes(ctx context.Context, diags *diag.Diagno if childAttributeName == "value" { TagTagNetflowRecordPol.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagTagNetflowRecordPolList = append(TagTagNetflowRecordPolList, TagTagNetflowRecordPol) } @@ -621,25 +637,24 @@ func setNetflowRecordPolId(ctx context.Context, data *NetflowRecordPolResourceMo data.Id = types.StringValue(fmt.Sprintf("%s/%s", data.ParentDn.ValueString(), rn)) } -func getNetflowRecordPolTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *NetflowRecordPolResourceModel, tagAnnotationPlan, tagAnnotationState []TagAnnotationNetflowRecordPolResourceModel) []map[string]interface{} { - +func getNetflowRecordPolTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *NetflowRecordPolResourceModel, tagAnnotationNetflowRecordPolPlan, tagAnnotationNetflowRecordPolState []TagAnnotationNetflowRecordPolResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagAnnotation.IsUnknown() { + if !data.TagAnnotation.IsNull() && !data.TagAnnotation.IsUnknown() { tagAnnotationIdentifiers := []TagAnnotationIdentifier{} - for _, tagAnnotation := range tagAnnotationPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagAnnotation.Key.IsUnknown() && !tagAnnotation.Key.IsNull() { - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() + for _, tagAnnotationNetflowRecordPol := range tagAnnotationNetflowRecordPolPlan { + childMap := NewAciObject() + if !tagAnnotationNetflowRecordPol.Key.IsNull() && !tagAnnotationNetflowRecordPol.Key.IsUnknown() { + childMap.Attributes["key"] = tagAnnotationNetflowRecordPol.Key.ValueString() } - if !tagAnnotation.Value.IsUnknown() && !tagAnnotation.Value.IsNull() { - childMap["attributes"]["value"] = tagAnnotation.Value.ValueString() + if !tagAnnotationNetflowRecordPol.Value.IsNull() && !tagAnnotationNetflowRecordPol.Value.IsUnknown() { + childMap.Attributes["value"] = tagAnnotationNetflowRecordPol.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) tagAnnotationIdentifier := TagAnnotationIdentifier{} - tagAnnotationIdentifier.Key = tagAnnotation.Key + tagAnnotationIdentifier.Key = tagAnnotationNetflowRecordPol.Key tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) } - for _, tagAnnotation := range tagAnnotationState { + for _, tagAnnotation := range tagAnnotationNetflowRecordPolState { delete := true for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { if tagAnnotationIdentifier.Key == tagAnnotation.Key { @@ -648,10 +663,10 @@ func getNetflowRecordPolTagAnnotationChildPayloads(ctx context.Context, diags *d } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) + tagAnnotationChildMapForDelete := NewAciObject() + tagAnnotationChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationChildMapForDelete.Attributes["key"] = tagAnnotation.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": tagAnnotationChildMapForDelete}) } } } else { @@ -660,25 +675,25 @@ func getNetflowRecordPolTagAnnotationChildPayloads(ctx context.Context, diags *d return childPayloads } -func getNetflowRecordPolTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *NetflowRecordPolResourceModel, tagTagPlan, tagTagState []TagTagNetflowRecordPolResourceModel) []map[string]interface{} { +func getNetflowRecordPolTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *NetflowRecordPolResourceModel, tagTagNetflowRecordPolPlan, tagTagNetflowRecordPolState []TagTagNetflowRecordPolResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagTag.IsUnknown() { + if !data.TagTag.IsNull() && !data.TagTag.IsUnknown() { tagTagIdentifiers := []TagTagIdentifier{} - for _, tagTag := range tagTagPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagTag.Key.IsUnknown() && !tagTag.Key.IsNull() { - childMap["attributes"]["key"] = tagTag.Key.ValueString() + for _, tagTagNetflowRecordPol := range tagTagNetflowRecordPolPlan { + childMap := NewAciObject() + if !tagTagNetflowRecordPol.Key.IsNull() && !tagTagNetflowRecordPol.Key.IsUnknown() { + childMap.Attributes["key"] = tagTagNetflowRecordPol.Key.ValueString() } - if !tagTag.Value.IsUnknown() && !tagTag.Value.IsNull() { - childMap["attributes"]["value"] = tagTag.Value.ValueString() + if !tagTagNetflowRecordPol.Value.IsNull() && !tagTagNetflowRecordPol.Value.IsUnknown() { + childMap.Attributes["value"] = tagTagNetflowRecordPol.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) tagTagIdentifier := TagTagIdentifier{} - tagTagIdentifier.Key = tagTag.Key + tagTagIdentifier.Key = tagTagNetflowRecordPol.Key tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) } - for _, tagTag := range tagTagState { + for _, tagTag := range tagTagNetflowRecordPolState { delete := true for _, tagTagIdentifier := range tagTagIdentifiers { if tagTagIdentifier.Key == tagTag.Key { @@ -687,10 +702,10 @@ func getNetflowRecordPolTagTagChildPayloads(ctx context.Context, diags *diag.Dia } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagTag.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) + tagTagChildMapForDelete := NewAciObject() + tagTagChildMapForDelete.Attributes["status"] = "deleted" + tagTagChildMapForDelete.Attributes["key"] = tagTag.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagTag": tagTagChildMapForDelete}) } } } else { diff --git a/internal/provider/resource_aci_netflow_record_policy_test.go b/internal/provider/resource_aci_netflow_record_policy_test.go index 51227f00a..4e49c2a4d 100644 --- a/internal/provider/resource_aci_netflow_record_policy_test.go +++ b/internal/provider/resource_aci_netflow_record_policy_test.go @@ -290,24 +290,24 @@ resource "aci_netflow_record_policy" "test" { parent_dn = aci_tenant.test.id name = "netfow_record" annotations = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] tags = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] } ` diff --git a/internal/provider/resource_aci_out_of_band_contract.go b/internal/provider/resource_aci_out_of_band_contract.go index 2a1f16908..4d7bc5543 100644 --- a/internal/provider/resource_aci_out_of_band_contract.go +++ b/internal/provider/resource_aci_out_of_band_contract.go @@ -101,6 +101,13 @@ func getEmptyTagAnnotationVzOOBBrCPResourceModel() TagAnnotationVzOOBBrCPResourc } } +var TagAnnotationVzOOBBrCPType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // TagTagVzOOBBrCPResourceModel describes the resource data model for the children without relation ships. type TagTagVzOOBBrCPResourceModel struct { Key types.String `tfsdk:"key"` @@ -114,6 +121,13 @@ func getEmptyTagTagVzOOBBrCPResourceModel() TagTagVzOOBBrCPResourceModel { } } +var TagTagVzOOBBrCPType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + type VzOOBBrCPIdentifier struct { Name types.String } @@ -511,7 +525,7 @@ func (r *VzOOBBrCPResource) ImportState(ctx context.Context, req resource.Import } func getAndSetVzOOBBrCPAttributes(ctx context.Context, diags *diag.Diagnostics, client *client.Client, data *VzOOBBrCPResourceModel) { - requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=children&rsp-subtree-class=%s", data.Id.ValueString(), "vzOOBBrCP,tagAnnotation,tagTag"), "GET", nil) + requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=full&rsp-subtree-class=%s", data.Id.ValueString(), "vzOOBBrCP,tagAnnotation,tagTag"), "GET", nil) readData := getEmptyVzOOBBrCPResourceModel() @@ -574,6 +588,7 @@ func getAndSetVzOOBBrCPAttributes(ctx context.Context, diags *diag.Diagnostics, if childAttributeName == "value" { TagAnnotationVzOOBBrCP.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagAnnotationVzOOBBrCPList = append(TagAnnotationVzOOBBrCPList, TagAnnotationVzOOBBrCP) } @@ -586,6 +601,7 @@ func getAndSetVzOOBBrCPAttributes(ctx context.Context, diags *diag.Diagnostics, if childAttributeName == "value" { TagTagVzOOBBrCP.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagTagVzOOBBrCPList = append(TagTagVzOOBBrCPList, TagTagVzOOBBrCP) } @@ -617,25 +633,24 @@ func setVzOOBBrCPId(ctx context.Context, data *VzOOBBrCPResourceModel) { data.Id = types.StringValue(fmt.Sprintf("%s/%s", strings.Split([]string{"uni/tn-mgmt/oobbrc-{name}"}[0], "/")[0], rn)) } -func getVzOOBBrCPTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *VzOOBBrCPResourceModel, tagAnnotationPlan, tagAnnotationState []TagAnnotationVzOOBBrCPResourceModel) []map[string]interface{} { - +func getVzOOBBrCPTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *VzOOBBrCPResourceModel, tagAnnotationVzOOBBrCPPlan, tagAnnotationVzOOBBrCPState []TagAnnotationVzOOBBrCPResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagAnnotation.IsUnknown() { + if !data.TagAnnotation.IsNull() && !data.TagAnnotation.IsUnknown() { tagAnnotationIdentifiers := []TagAnnotationIdentifier{} - for _, tagAnnotation := range tagAnnotationPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagAnnotation.Key.IsUnknown() && !tagAnnotation.Key.IsNull() { - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() + for _, tagAnnotationVzOOBBrCP := range tagAnnotationVzOOBBrCPPlan { + childMap := NewAciObject() + if !tagAnnotationVzOOBBrCP.Key.IsNull() && !tagAnnotationVzOOBBrCP.Key.IsUnknown() { + childMap.Attributes["key"] = tagAnnotationVzOOBBrCP.Key.ValueString() } - if !tagAnnotation.Value.IsUnknown() && !tagAnnotation.Value.IsNull() { - childMap["attributes"]["value"] = tagAnnotation.Value.ValueString() + if !tagAnnotationVzOOBBrCP.Value.IsNull() && !tagAnnotationVzOOBBrCP.Value.IsUnknown() { + childMap.Attributes["value"] = tagAnnotationVzOOBBrCP.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) tagAnnotationIdentifier := TagAnnotationIdentifier{} - tagAnnotationIdentifier.Key = tagAnnotation.Key + tagAnnotationIdentifier.Key = tagAnnotationVzOOBBrCP.Key tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) } - for _, tagAnnotation := range tagAnnotationState { + for _, tagAnnotation := range tagAnnotationVzOOBBrCPState { delete := true for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { if tagAnnotationIdentifier.Key == tagAnnotation.Key { @@ -644,10 +659,10 @@ func getVzOOBBrCPTagAnnotationChildPayloads(ctx context.Context, diags *diag.Dia } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) + tagAnnotationChildMapForDelete := NewAciObject() + tagAnnotationChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationChildMapForDelete.Attributes["key"] = tagAnnotation.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": tagAnnotationChildMapForDelete}) } } } else { @@ -656,25 +671,25 @@ func getVzOOBBrCPTagAnnotationChildPayloads(ctx context.Context, diags *diag.Dia return childPayloads } -func getVzOOBBrCPTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *VzOOBBrCPResourceModel, tagTagPlan, tagTagState []TagTagVzOOBBrCPResourceModel) []map[string]interface{} { +func getVzOOBBrCPTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *VzOOBBrCPResourceModel, tagTagVzOOBBrCPPlan, tagTagVzOOBBrCPState []TagTagVzOOBBrCPResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagTag.IsUnknown() { + if !data.TagTag.IsNull() && !data.TagTag.IsUnknown() { tagTagIdentifiers := []TagTagIdentifier{} - for _, tagTag := range tagTagPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagTag.Key.IsUnknown() && !tagTag.Key.IsNull() { - childMap["attributes"]["key"] = tagTag.Key.ValueString() + for _, tagTagVzOOBBrCP := range tagTagVzOOBBrCPPlan { + childMap := NewAciObject() + if !tagTagVzOOBBrCP.Key.IsNull() && !tagTagVzOOBBrCP.Key.IsUnknown() { + childMap.Attributes["key"] = tagTagVzOOBBrCP.Key.ValueString() } - if !tagTag.Value.IsUnknown() && !tagTag.Value.IsNull() { - childMap["attributes"]["value"] = tagTag.Value.ValueString() + if !tagTagVzOOBBrCP.Value.IsNull() && !tagTagVzOOBBrCP.Value.IsUnknown() { + childMap.Attributes["value"] = tagTagVzOOBBrCP.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) tagTagIdentifier := TagTagIdentifier{} - tagTagIdentifier.Key = tagTag.Key + tagTagIdentifier.Key = tagTagVzOOBBrCP.Key tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) } - for _, tagTag := range tagTagState { + for _, tagTag := range tagTagVzOOBBrCPState { delete := true for _, tagTagIdentifier := range tagTagIdentifiers { if tagTagIdentifier.Key == tagTag.Key { @@ -683,10 +698,10 @@ func getVzOOBBrCPTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostic } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagTag.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) + tagTagChildMapForDelete := NewAciObject() + tagTagChildMapForDelete.Attributes["status"] = "deleted" + tagTagChildMapForDelete.Attributes["key"] = tagTag.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagTag": tagTagChildMapForDelete}) } } } else { diff --git a/internal/provider/resource_aci_out_of_band_contract_test.go b/internal/provider/resource_aci_out_of_band_contract_test.go index 3a0b6b191..c325ba870 100644 --- a/internal/provider/resource_aci_out_of_band_contract_test.go +++ b/internal/provider/resource_aci_out_of_band_contract_test.go @@ -39,7 +39,7 @@ func TestAccResourceVzOOBBrCP(t *testing.T) { resource.TestCheckResourceAttr("aci_out_of_band_contract.allow_test_2", "scope", "context"), resource.TestCheckResourceAttr("aci_out_of_band_contract.allow_test", "target_dscp", "unspecified"), resource.TestCheckResourceAttr("aci_out_of_band_contract.allow_test_2", "target_dscp", "unspecified"), - composeAggregateTestCheckFuncWithVersion(t, "4.2(1i)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.2(1i)", ">=", resource.TestCheckResourceAttr("aci_out_of_band_contract.allow_test", "intent", "install"), resource.TestCheckResourceAttr("aci_out_of_band_contract.allow_test_2", "intent", "install")), ), @@ -87,7 +87,7 @@ func TestAccResourceVzOOBBrCP(t *testing.T) { resource.TestCheckResourceAttr("aci_out_of_band_contract.allow_test_2", "scope", "context"), resource.TestCheckResourceAttr("aci_out_of_band_contract.allow_test", "target_dscp", "unspecified"), resource.TestCheckResourceAttr("aci_out_of_band_contract.allow_test_2", "target_dscp", "unspecified"), - composeAggregateTestCheckFuncWithVersion(t, "4.2(1i)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.2(1i)", ">=", resource.TestCheckResourceAttr("aci_out_of_band_contract.allow_test", "intent", "install"), resource.TestCheckResourceAttr("aci_out_of_band_contract.allow_test_2", "intent", "install")), ), @@ -112,7 +112,7 @@ func TestAccResourceVzOOBBrCP(t *testing.T) { resource.TestCheckResourceAttr("aci_out_of_band_contract.test", "priority", "unspecified"), resource.TestCheckResourceAttr("aci_out_of_band_contract.test", "scope", "context"), resource.TestCheckResourceAttr("aci_out_of_band_contract.test", "target_dscp", "unspecified"), - composeAggregateTestCheckFuncWithVersion(t, "4.2(1i)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.2(1i)", ">=", resource.TestCheckResourceAttr("aci_out_of_band_contract.test", "intent", "install")), ), }, @@ -129,7 +129,7 @@ func TestAccResourceVzOOBBrCP(t *testing.T) { resource.TestCheckResourceAttr("aci_out_of_band_contract.test", "priority", "level1"), resource.TestCheckResourceAttr("aci_out_of_band_contract.test", "scope", "application-profile"), resource.TestCheckResourceAttr("aci_out_of_band_contract.test", "target_dscp", "AF11"), - composeAggregateTestCheckFuncWithVersion(t, "4.2(1i)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.2(1i)", ">=", resource.TestCheckResourceAttr("aci_out_of_band_contract.test", "intent", "estimate_add")), ), }, @@ -146,7 +146,7 @@ func TestAccResourceVzOOBBrCP(t *testing.T) { resource.TestCheckResourceAttr("aci_out_of_band_contract.test", "priority", "level1"), resource.TestCheckResourceAttr("aci_out_of_band_contract.test", "scope", "application-profile"), resource.TestCheckResourceAttr("aci_out_of_band_contract.test", "target_dscp", "AF11"), - composeAggregateTestCheckFuncWithVersion(t, "4.2(1i)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.2(1i)", ">=", resource.TestCheckResourceAttr("aci_out_of_band_contract.test", "intent", "estimate_add")), ), }, @@ -163,7 +163,7 @@ func TestAccResourceVzOOBBrCP(t *testing.T) { resource.TestCheckResourceAttr("aci_out_of_band_contract.test", "priority", "unspecified"), resource.TestCheckResourceAttr("aci_out_of_band_contract.test", "scope", "context"), resource.TestCheckResourceAttr("aci_out_of_band_contract.test", "target_dscp", "unspecified"), - composeAggregateTestCheckFuncWithVersion(t, "4.2(1i)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.2(1i)", ">=", resource.TestCheckResourceAttr("aci_out_of_band_contract.test", "intent", "install")), ), }, @@ -185,7 +185,7 @@ func TestAccResourceVzOOBBrCP(t *testing.T) { resource.TestCheckResourceAttr("aci_out_of_band_contract.test", "priority", "unspecified"), resource.TestCheckResourceAttr("aci_out_of_band_contract.test", "scope", "context"), resource.TestCheckResourceAttr("aci_out_of_band_contract.test", "target_dscp", "unspecified"), - composeAggregateTestCheckFuncWithVersion(t, "4.2(1i)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.2(1i)", ">=", resource.TestCheckResourceAttr("aci_out_of_band_contract.test", "intent", "install")), resource.TestCheckResourceAttr("aci_out_of_band_contract.test", "annotations.0.key", "key_0"), resource.TestCheckResourceAttr("aci_out_of_band_contract.test", "annotations.0.value", "value_1"), @@ -211,7 +211,7 @@ func TestAccResourceVzOOBBrCP(t *testing.T) { resource.TestCheckResourceAttr("aci_out_of_band_contract.test", "priority", "unspecified"), resource.TestCheckResourceAttr("aci_out_of_band_contract.test", "scope", "context"), resource.TestCheckResourceAttr("aci_out_of_band_contract.test", "target_dscp", "unspecified"), - composeAggregateTestCheckFuncWithVersion(t, "4.2(1i)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.2(1i)", ">=", resource.TestCheckResourceAttr("aci_out_of_band_contract.test", "intent", "install")), resource.TestCheckResourceAttr("aci_out_of_band_contract.test", "annotations.0.key", "key_0"), resource.TestCheckResourceAttr("aci_out_of_band_contract.test", "annotations.0.value", "value_1"), @@ -237,7 +237,7 @@ func TestAccResourceVzOOBBrCP(t *testing.T) { resource.TestCheckResourceAttr("aci_out_of_band_contract.test", "priority", "unspecified"), resource.TestCheckResourceAttr("aci_out_of_band_contract.test", "scope", "context"), resource.TestCheckResourceAttr("aci_out_of_band_contract.test", "target_dscp", "unspecified"), - composeAggregateTestCheckFuncWithVersion(t, "4.2(1i)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.2(1i)", ">=", resource.TestCheckResourceAttr("aci_out_of_band_contract.test", "intent", "install")), resource.TestCheckResourceAttr("aci_out_of_band_contract.test", "annotations.0.key", "key_1"), resource.TestCheckResourceAttr("aci_out_of_band_contract.test", "annotations.0.value", "test_value"), @@ -259,7 +259,7 @@ func TestAccResourceVzOOBBrCP(t *testing.T) { resource.TestCheckResourceAttr("aci_out_of_band_contract.test", "priority", "unspecified"), resource.TestCheckResourceAttr("aci_out_of_band_contract.test", "scope", "context"), resource.TestCheckResourceAttr("aci_out_of_band_contract.test", "target_dscp", "unspecified"), - composeAggregateTestCheckFuncWithVersion(t, "4.2(1i)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.2(1i)", ">=", resource.TestCheckResourceAttr("aci_out_of_band_contract.test", "intent", "install")), resource.TestCheckResourceAttr("aci_out_of_band_contract.test", "annotations.#", "0"), resource.TestCheckResourceAttr("aci_out_of_band_contract.test", "tags.#", "0"), diff --git a/internal/provider/resource_aci_pim_route_map_entry.go b/internal/provider/resource_aci_pim_route_map_entry.go index 48ea41393..39ec7d6c7 100644 --- a/internal/provider/resource_aci_pim_route_map_entry.go +++ b/internal/provider/resource_aci_pim_route_map_entry.go @@ -98,6 +98,13 @@ func getEmptyTagAnnotationPimRouteMapEntryResourceModel() TagAnnotationPimRouteM } } +var TagAnnotationPimRouteMapEntryType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // TagTagPimRouteMapEntryResourceModel describes the resource data model for the children without relation ships. type TagTagPimRouteMapEntryResourceModel struct { Key types.String `tfsdk:"key"` @@ -111,6 +118,13 @@ func getEmptyTagTagPimRouteMapEntryResourceModel() TagTagPimRouteMapEntryResourc } } +var TagTagPimRouteMapEntryType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + type PimRouteMapEntryIdentifier struct { Order types.String } @@ -490,7 +504,7 @@ func (r *PimRouteMapEntryResource) ImportState(ctx context.Context, req resource } func getAndSetPimRouteMapEntryAttributes(ctx context.Context, diags *diag.Diagnostics, client *client.Client, data *PimRouteMapEntryResourceModel) { - requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=children&rsp-subtree-class=%s", data.Id.ValueString(), "pimRouteMapEntry,tagAnnotation,tagTag"), "GET", nil) + requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=full&rsp-subtree-class=%s", data.Id.ValueString(), "pimRouteMapEntry,tagAnnotation,tagTag"), "GET", nil) readData := getEmptyPimRouteMapEntryResourceModel() @@ -551,6 +565,7 @@ func getAndSetPimRouteMapEntryAttributes(ctx context.Context, diags *diag.Diagno if childAttributeName == "value" { TagAnnotationPimRouteMapEntry.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagAnnotationPimRouteMapEntryList = append(TagAnnotationPimRouteMapEntryList, TagAnnotationPimRouteMapEntry) } @@ -563,6 +578,7 @@ func getAndSetPimRouteMapEntryAttributes(ctx context.Context, diags *diag.Diagno if childAttributeName == "value" { TagTagPimRouteMapEntry.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagTagPimRouteMapEntryList = append(TagTagPimRouteMapEntryList, TagTagPimRouteMapEntry) } @@ -610,25 +626,24 @@ func setPimRouteMapEntryId(ctx context.Context, data *PimRouteMapEntryResourceMo data.Id = types.StringValue(fmt.Sprintf("%s/%s", data.ParentDn.ValueString(), rn)) } -func getPimRouteMapEntryTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *PimRouteMapEntryResourceModel, tagAnnotationPlan, tagAnnotationState []TagAnnotationPimRouteMapEntryResourceModel) []map[string]interface{} { - +func getPimRouteMapEntryTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *PimRouteMapEntryResourceModel, tagAnnotationPimRouteMapEntryPlan, tagAnnotationPimRouteMapEntryState []TagAnnotationPimRouteMapEntryResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagAnnotation.IsUnknown() { + if !data.TagAnnotation.IsNull() && !data.TagAnnotation.IsUnknown() { tagAnnotationIdentifiers := []TagAnnotationIdentifier{} - for _, tagAnnotation := range tagAnnotationPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagAnnotation.Key.IsUnknown() && !tagAnnotation.Key.IsNull() { - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() + for _, tagAnnotationPimRouteMapEntry := range tagAnnotationPimRouteMapEntryPlan { + childMap := NewAciObject() + if !tagAnnotationPimRouteMapEntry.Key.IsNull() && !tagAnnotationPimRouteMapEntry.Key.IsUnknown() { + childMap.Attributes["key"] = tagAnnotationPimRouteMapEntry.Key.ValueString() } - if !tagAnnotation.Value.IsUnknown() && !tagAnnotation.Value.IsNull() { - childMap["attributes"]["value"] = tagAnnotation.Value.ValueString() + if !tagAnnotationPimRouteMapEntry.Value.IsNull() && !tagAnnotationPimRouteMapEntry.Value.IsUnknown() { + childMap.Attributes["value"] = tagAnnotationPimRouteMapEntry.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) tagAnnotationIdentifier := TagAnnotationIdentifier{} - tagAnnotationIdentifier.Key = tagAnnotation.Key + tagAnnotationIdentifier.Key = tagAnnotationPimRouteMapEntry.Key tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) } - for _, tagAnnotation := range tagAnnotationState { + for _, tagAnnotation := range tagAnnotationPimRouteMapEntryState { delete := true for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { if tagAnnotationIdentifier.Key == tagAnnotation.Key { @@ -637,10 +652,10 @@ func getPimRouteMapEntryTagAnnotationChildPayloads(ctx context.Context, diags *d } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) + tagAnnotationChildMapForDelete := NewAciObject() + tagAnnotationChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationChildMapForDelete.Attributes["key"] = tagAnnotation.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": tagAnnotationChildMapForDelete}) } } } else { @@ -649,25 +664,25 @@ func getPimRouteMapEntryTagAnnotationChildPayloads(ctx context.Context, diags *d return childPayloads } -func getPimRouteMapEntryTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *PimRouteMapEntryResourceModel, tagTagPlan, tagTagState []TagTagPimRouteMapEntryResourceModel) []map[string]interface{} { +func getPimRouteMapEntryTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *PimRouteMapEntryResourceModel, tagTagPimRouteMapEntryPlan, tagTagPimRouteMapEntryState []TagTagPimRouteMapEntryResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagTag.IsUnknown() { + if !data.TagTag.IsNull() && !data.TagTag.IsUnknown() { tagTagIdentifiers := []TagTagIdentifier{} - for _, tagTag := range tagTagPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagTag.Key.IsUnknown() && !tagTag.Key.IsNull() { - childMap["attributes"]["key"] = tagTag.Key.ValueString() + for _, tagTagPimRouteMapEntry := range tagTagPimRouteMapEntryPlan { + childMap := NewAciObject() + if !tagTagPimRouteMapEntry.Key.IsNull() && !tagTagPimRouteMapEntry.Key.IsUnknown() { + childMap.Attributes["key"] = tagTagPimRouteMapEntry.Key.ValueString() } - if !tagTag.Value.IsUnknown() && !tagTag.Value.IsNull() { - childMap["attributes"]["value"] = tagTag.Value.ValueString() + if !tagTagPimRouteMapEntry.Value.IsNull() && !tagTagPimRouteMapEntry.Value.IsUnknown() { + childMap.Attributes["value"] = tagTagPimRouteMapEntry.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) tagTagIdentifier := TagTagIdentifier{} - tagTagIdentifier.Key = tagTag.Key + tagTagIdentifier.Key = tagTagPimRouteMapEntry.Key tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) } - for _, tagTag := range tagTagState { + for _, tagTag := range tagTagPimRouteMapEntryState { delete := true for _, tagTagIdentifier := range tagTagIdentifiers { if tagTagIdentifier.Key == tagTag.Key { @@ -676,10 +691,10 @@ func getPimRouteMapEntryTagTagChildPayloads(ctx context.Context, diags *diag.Dia } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagTag.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) + tagTagChildMapForDelete := NewAciObject() + tagTagChildMapForDelete.Attributes["status"] = "deleted" + tagTagChildMapForDelete.Attributes["key"] = tagTag.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagTag": tagTagChildMapForDelete}) } } } else { diff --git a/internal/provider/resource_aci_pim_route_map_entry_test.go b/internal/provider/resource_aci_pim_route_map_entry_test.go index 867a6bc15..1e6b38c5c 100644 --- a/internal/provider/resource_aci_pim_route_map_entry_test.go +++ b/internal/provider/resource_aci_pim_route_map_entry_test.go @@ -289,24 +289,24 @@ resource "aci_pim_route_map_entry" "test" { parent_dn = aci_pim_route_map_policy.test.id order = "1" annotations = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] tags = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] } ` diff --git a/internal/provider/resource_aci_pim_route_map_policy.go b/internal/provider/resource_aci_pim_route_map_policy.go index db6a54797..63077ce6a 100644 --- a/internal/provider/resource_aci_pim_route_map_policy.go +++ b/internal/provider/resource_aci_pim_route_map_policy.go @@ -90,6 +90,13 @@ func getEmptyTagAnnotationPimRouteMapPolResourceModel() TagAnnotationPimRouteMap } } +var TagAnnotationPimRouteMapPolType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // TagTagPimRouteMapPolResourceModel describes the resource data model for the children without relation ships. type TagTagPimRouteMapPolResourceModel struct { Key types.String `tfsdk:"key"` @@ -103,6 +110,13 @@ func getEmptyTagTagPimRouteMapPolResourceModel() TagTagPimRouteMapPolResourceMod } } +var TagTagPimRouteMapPolType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + type PimRouteMapPolIdentifier struct { Name types.String } @@ -452,7 +466,7 @@ func (r *PimRouteMapPolResource) ImportState(ctx context.Context, req resource.I } func getAndSetPimRouteMapPolAttributes(ctx context.Context, diags *diag.Diagnostics, client *client.Client, data *PimRouteMapPolResourceModel) { - requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=children&rsp-subtree-class=%s", data.Id.ValueString(), "pimRouteMapPol,tagAnnotation,tagTag"), "GET", nil) + requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=full&rsp-subtree-class=%s", data.Id.ValueString(), "pimRouteMapPol,tagAnnotation,tagTag"), "GET", nil) readData := getEmptyPimRouteMapPolResourceModel() @@ -504,6 +518,7 @@ func getAndSetPimRouteMapPolAttributes(ctx context.Context, diags *diag.Diagnost if childAttributeName == "value" { TagAnnotationPimRouteMapPol.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagAnnotationPimRouteMapPolList = append(TagAnnotationPimRouteMapPolList, TagAnnotationPimRouteMapPol) } @@ -516,6 +531,7 @@ func getAndSetPimRouteMapPolAttributes(ctx context.Context, diags *diag.Diagnost if childAttributeName == "value" { TagTagPimRouteMapPol.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagTagPimRouteMapPolList = append(TagTagPimRouteMapPolList, TagTagPimRouteMapPol) } @@ -563,25 +579,24 @@ func setPimRouteMapPolId(ctx context.Context, data *PimRouteMapPolResourceModel) data.Id = types.StringValue(fmt.Sprintf("%s/%s", data.ParentDn.ValueString(), rn)) } -func getPimRouteMapPolTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *PimRouteMapPolResourceModel, tagAnnotationPlan, tagAnnotationState []TagAnnotationPimRouteMapPolResourceModel) []map[string]interface{} { - +func getPimRouteMapPolTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *PimRouteMapPolResourceModel, tagAnnotationPimRouteMapPolPlan, tagAnnotationPimRouteMapPolState []TagAnnotationPimRouteMapPolResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagAnnotation.IsUnknown() { + if !data.TagAnnotation.IsNull() && !data.TagAnnotation.IsUnknown() { tagAnnotationIdentifiers := []TagAnnotationIdentifier{} - for _, tagAnnotation := range tagAnnotationPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagAnnotation.Key.IsUnknown() && !tagAnnotation.Key.IsNull() { - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() + for _, tagAnnotationPimRouteMapPol := range tagAnnotationPimRouteMapPolPlan { + childMap := NewAciObject() + if !tagAnnotationPimRouteMapPol.Key.IsNull() && !tagAnnotationPimRouteMapPol.Key.IsUnknown() { + childMap.Attributes["key"] = tagAnnotationPimRouteMapPol.Key.ValueString() } - if !tagAnnotation.Value.IsUnknown() && !tagAnnotation.Value.IsNull() { - childMap["attributes"]["value"] = tagAnnotation.Value.ValueString() + if !tagAnnotationPimRouteMapPol.Value.IsNull() && !tagAnnotationPimRouteMapPol.Value.IsUnknown() { + childMap.Attributes["value"] = tagAnnotationPimRouteMapPol.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) tagAnnotationIdentifier := TagAnnotationIdentifier{} - tagAnnotationIdentifier.Key = tagAnnotation.Key + tagAnnotationIdentifier.Key = tagAnnotationPimRouteMapPol.Key tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) } - for _, tagAnnotation := range tagAnnotationState { + for _, tagAnnotation := range tagAnnotationPimRouteMapPolState { delete := true for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { if tagAnnotationIdentifier.Key == tagAnnotation.Key { @@ -590,10 +605,10 @@ func getPimRouteMapPolTagAnnotationChildPayloads(ctx context.Context, diags *dia } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) + tagAnnotationChildMapForDelete := NewAciObject() + tagAnnotationChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationChildMapForDelete.Attributes["key"] = tagAnnotation.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": tagAnnotationChildMapForDelete}) } } } else { @@ -602,25 +617,25 @@ func getPimRouteMapPolTagAnnotationChildPayloads(ctx context.Context, diags *dia return childPayloads } -func getPimRouteMapPolTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *PimRouteMapPolResourceModel, tagTagPlan, tagTagState []TagTagPimRouteMapPolResourceModel) []map[string]interface{} { +func getPimRouteMapPolTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *PimRouteMapPolResourceModel, tagTagPimRouteMapPolPlan, tagTagPimRouteMapPolState []TagTagPimRouteMapPolResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagTag.IsUnknown() { + if !data.TagTag.IsNull() && !data.TagTag.IsUnknown() { tagTagIdentifiers := []TagTagIdentifier{} - for _, tagTag := range tagTagPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagTag.Key.IsUnknown() && !tagTag.Key.IsNull() { - childMap["attributes"]["key"] = tagTag.Key.ValueString() + for _, tagTagPimRouteMapPol := range tagTagPimRouteMapPolPlan { + childMap := NewAciObject() + if !tagTagPimRouteMapPol.Key.IsNull() && !tagTagPimRouteMapPol.Key.IsUnknown() { + childMap.Attributes["key"] = tagTagPimRouteMapPol.Key.ValueString() } - if !tagTag.Value.IsUnknown() && !tagTag.Value.IsNull() { - childMap["attributes"]["value"] = tagTag.Value.ValueString() + if !tagTagPimRouteMapPol.Value.IsNull() && !tagTagPimRouteMapPol.Value.IsUnknown() { + childMap.Attributes["value"] = tagTagPimRouteMapPol.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) tagTagIdentifier := TagTagIdentifier{} - tagTagIdentifier.Key = tagTag.Key + tagTagIdentifier.Key = tagTagPimRouteMapPol.Key tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) } - for _, tagTag := range tagTagState { + for _, tagTag := range tagTagPimRouteMapPolState { delete := true for _, tagTagIdentifier := range tagTagIdentifiers { if tagTagIdentifier.Key == tagTag.Key { @@ -629,10 +644,10 @@ func getPimRouteMapPolTagTagChildPayloads(ctx context.Context, diags *diag.Diagn } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagTag.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) + tagTagChildMapForDelete := NewAciObject() + tagTagChildMapForDelete.Attributes["status"] = "deleted" + tagTagChildMapForDelete.Attributes["key"] = tagTag.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagTag": tagTagChildMapForDelete}) } } } else { diff --git a/internal/provider/resource_aci_pim_route_map_policy_test.go b/internal/provider/resource_aci_pim_route_map_policy_test.go index 335c67556..dd2877c7c 100644 --- a/internal/provider/resource_aci_pim_route_map_policy_test.go +++ b/internal/provider/resource_aci_pim_route_map_policy_test.go @@ -259,24 +259,24 @@ resource "aci_pim_route_map_policy" "test" { parent_dn = aci_tenant.test.id name = "test_name" annotations = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] tags = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] } ` diff --git a/internal/provider/resource_aci_relation_from_bridge_domain_to_l3_outside.go b/internal/provider/resource_aci_relation_from_bridge_domain_to_l3_outside.go index 9f667fea3..b095d702f 100644 --- a/internal/provider/resource_aci_relation_from_bridge_domain_to_l3_outside.go +++ b/internal/provider/resource_aci_relation_from_bridge_domain_to_l3_outside.go @@ -82,6 +82,13 @@ func getEmptyTagAnnotationFvRsBDToOutResourceModel() TagAnnotationFvRsBDToOutRes } } +var TagAnnotationFvRsBDToOutType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // TagTagFvRsBDToOutResourceModel describes the resource data model for the children without relation ships. type TagTagFvRsBDToOutResourceModel struct { Key types.String `tfsdk:"key"` @@ -95,6 +102,13 @@ func getEmptyTagTagFvRsBDToOutResourceModel() TagTagFvRsBDToOutResourceModel { } } +var TagTagFvRsBDToOutType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + type FvRsBDToOutIdentifier struct { TnL3extOutName types.String } @@ -408,7 +422,7 @@ func (r *FvRsBDToOutResource) ImportState(ctx context.Context, req resource.Impo } func getAndSetFvRsBDToOutAttributes(ctx context.Context, diags *diag.Diagnostics, client *client.Client, data *FvRsBDToOutResourceModel) { - requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=children&rsp-subtree-class=%s", data.Id.ValueString(), "fvRsBDToOut,tagAnnotation,tagTag"), "GET", nil) + requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=full&rsp-subtree-class=%s", data.Id.ValueString(), "fvRsBDToOut,tagAnnotation,tagTag"), "GET", nil) readData := getEmptyFvRsBDToOutResourceModel() @@ -448,6 +462,7 @@ func getAndSetFvRsBDToOutAttributes(ctx context.Context, diags *diag.Diagnostics if childAttributeName == "value" { TagAnnotationFvRsBDToOut.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagAnnotationFvRsBDToOutList = append(TagAnnotationFvRsBDToOutList, TagAnnotationFvRsBDToOut) } @@ -460,6 +475,7 @@ func getAndSetFvRsBDToOutAttributes(ctx context.Context, diags *diag.Diagnostics if childAttributeName == "value" { TagTagFvRsBDToOut.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagTagFvRsBDToOutList = append(TagTagFvRsBDToOutList, TagTagFvRsBDToOut) } @@ -507,25 +523,24 @@ func setFvRsBDToOutId(ctx context.Context, data *FvRsBDToOutResourceModel) { data.Id = types.StringValue(fmt.Sprintf("%s/%s", data.ParentDn.ValueString(), rn)) } -func getFvRsBDToOutTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvRsBDToOutResourceModel, tagAnnotationPlan, tagAnnotationState []TagAnnotationFvRsBDToOutResourceModel) []map[string]interface{} { - +func getFvRsBDToOutTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvRsBDToOutResourceModel, tagAnnotationFvRsBDToOutPlan, tagAnnotationFvRsBDToOutState []TagAnnotationFvRsBDToOutResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagAnnotation.IsUnknown() { + if !data.TagAnnotation.IsNull() && !data.TagAnnotation.IsUnknown() { tagAnnotationIdentifiers := []TagAnnotationIdentifier{} - for _, tagAnnotation := range tagAnnotationPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagAnnotation.Key.IsUnknown() && !tagAnnotation.Key.IsNull() { - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() + for _, tagAnnotationFvRsBDToOut := range tagAnnotationFvRsBDToOutPlan { + childMap := NewAciObject() + if !tagAnnotationFvRsBDToOut.Key.IsNull() && !tagAnnotationFvRsBDToOut.Key.IsUnknown() { + childMap.Attributes["key"] = tagAnnotationFvRsBDToOut.Key.ValueString() } - if !tagAnnotation.Value.IsUnknown() && !tagAnnotation.Value.IsNull() { - childMap["attributes"]["value"] = tagAnnotation.Value.ValueString() + if !tagAnnotationFvRsBDToOut.Value.IsNull() && !tagAnnotationFvRsBDToOut.Value.IsUnknown() { + childMap.Attributes["value"] = tagAnnotationFvRsBDToOut.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) tagAnnotationIdentifier := TagAnnotationIdentifier{} - tagAnnotationIdentifier.Key = tagAnnotation.Key + tagAnnotationIdentifier.Key = tagAnnotationFvRsBDToOut.Key tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) } - for _, tagAnnotation := range tagAnnotationState { + for _, tagAnnotation := range tagAnnotationFvRsBDToOutState { delete := true for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { if tagAnnotationIdentifier.Key == tagAnnotation.Key { @@ -534,10 +549,10 @@ func getFvRsBDToOutTagAnnotationChildPayloads(ctx context.Context, diags *diag.D } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) + tagAnnotationChildMapForDelete := NewAciObject() + tagAnnotationChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationChildMapForDelete.Attributes["key"] = tagAnnotation.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": tagAnnotationChildMapForDelete}) } } } else { @@ -546,25 +561,25 @@ func getFvRsBDToOutTagAnnotationChildPayloads(ctx context.Context, diags *diag.D return childPayloads } -func getFvRsBDToOutTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvRsBDToOutResourceModel, tagTagPlan, tagTagState []TagTagFvRsBDToOutResourceModel) []map[string]interface{} { +func getFvRsBDToOutTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvRsBDToOutResourceModel, tagTagFvRsBDToOutPlan, tagTagFvRsBDToOutState []TagTagFvRsBDToOutResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagTag.IsUnknown() { + if !data.TagTag.IsNull() && !data.TagTag.IsUnknown() { tagTagIdentifiers := []TagTagIdentifier{} - for _, tagTag := range tagTagPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagTag.Key.IsUnknown() && !tagTag.Key.IsNull() { - childMap["attributes"]["key"] = tagTag.Key.ValueString() + for _, tagTagFvRsBDToOut := range tagTagFvRsBDToOutPlan { + childMap := NewAciObject() + if !tagTagFvRsBDToOut.Key.IsNull() && !tagTagFvRsBDToOut.Key.IsUnknown() { + childMap.Attributes["key"] = tagTagFvRsBDToOut.Key.ValueString() } - if !tagTag.Value.IsUnknown() && !tagTag.Value.IsNull() { - childMap["attributes"]["value"] = tagTag.Value.ValueString() + if !tagTagFvRsBDToOut.Value.IsNull() && !tagTagFvRsBDToOut.Value.IsUnknown() { + childMap.Attributes["value"] = tagTagFvRsBDToOut.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) tagTagIdentifier := TagTagIdentifier{} - tagTagIdentifier.Key = tagTag.Key + tagTagIdentifier.Key = tagTagFvRsBDToOut.Key tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) } - for _, tagTag := range tagTagState { + for _, tagTag := range tagTagFvRsBDToOutState { delete := true for _, tagTagIdentifier := range tagTagIdentifiers { if tagTagIdentifier.Key == tagTag.Key { @@ -573,10 +588,10 @@ func getFvRsBDToOutTagTagChildPayloads(ctx context.Context, diags *diag.Diagnost } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagTag.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) + tagTagChildMapForDelete := NewAciObject() + tagTagChildMapForDelete.Attributes["status"] = "deleted" + tagTagChildMapForDelete.Attributes["key"] = tagTag.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagTag": tagTagChildMapForDelete}) } } } else { diff --git a/internal/provider/resource_aci_relation_from_bridge_domain_to_l3_outside_test.go b/internal/provider/resource_aci_relation_from_bridge_domain_to_l3_outside_test.go index 791cdb2ce..9b3073a47 100644 --- a/internal/provider/resource_aci_relation_from_bridge_domain_to_l3_outside_test.go +++ b/internal/provider/resource_aci_relation_from_bridge_domain_to_l3_outside_test.go @@ -219,24 +219,24 @@ resource "aci_relation_from_bridge_domain_to_l3_outside" "test" { parent_dn = aci_bridge_domain.test.id l3_outside_name = "test_tn_l3ext_out_name" annotations = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] tags = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] } ` diff --git a/internal/provider/resource_aci_relation_from_bridge_domain_to_netflow_monitor_policy.go b/internal/provider/resource_aci_relation_from_bridge_domain_to_netflow_monitor_policy.go index 156d67840..054842f2d 100644 --- a/internal/provider/resource_aci_relation_from_bridge_domain_to_netflow_monitor_policy.go +++ b/internal/provider/resource_aci_relation_from_bridge_domain_to_netflow_monitor_policy.go @@ -86,6 +86,13 @@ func getEmptyTagAnnotationFvRsBDToNetflowMonitorPolResourceModel() TagAnnotation } } +var TagAnnotationFvRsBDToNetflowMonitorPolType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // TagTagFvRsBDToNetflowMonitorPolResourceModel describes the resource data model for the children without relation ships. type TagTagFvRsBDToNetflowMonitorPolResourceModel struct { Key types.String `tfsdk:"key"` @@ -99,6 +106,13 @@ func getEmptyTagTagFvRsBDToNetflowMonitorPolResourceModel() TagTagFvRsBDToNetflo } } +var TagTagFvRsBDToNetflowMonitorPolType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + type FvRsBDToNetflowMonitorPolIdentifier struct { FltType types.String TnNetflowMonitorPolName types.String @@ -425,7 +439,7 @@ func (r *FvRsBDToNetflowMonitorPolResource) ImportState(ctx context.Context, req } func getAndSetFvRsBDToNetflowMonitorPolAttributes(ctx context.Context, diags *diag.Diagnostics, client *client.Client, data *FvRsBDToNetflowMonitorPolResourceModel) { - requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=children&rsp-subtree-class=%s", data.Id.ValueString(), "fvRsBDToNetflowMonitorPol,tagAnnotation,tagTag"), "GET", nil) + requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=full&rsp-subtree-class=%s", data.Id.ValueString(), "fvRsBDToNetflowMonitorPol,tagAnnotation,tagTag"), "GET", nil) readData := getEmptyFvRsBDToNetflowMonitorPolResourceModel() @@ -468,6 +482,7 @@ func getAndSetFvRsBDToNetflowMonitorPolAttributes(ctx context.Context, diags *di if childAttributeName == "value" { TagAnnotationFvRsBDToNetflowMonitorPol.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagAnnotationFvRsBDToNetflowMonitorPolList = append(TagAnnotationFvRsBDToNetflowMonitorPolList, TagAnnotationFvRsBDToNetflowMonitorPol) } @@ -480,6 +495,7 @@ func getAndSetFvRsBDToNetflowMonitorPolAttributes(ctx context.Context, diags *di if childAttributeName == "value" { TagTagFvRsBDToNetflowMonitorPol.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagTagFvRsBDToNetflowMonitorPolList = append(TagTagFvRsBDToNetflowMonitorPolList, TagTagFvRsBDToNetflowMonitorPol) } @@ -527,25 +543,24 @@ func setFvRsBDToNetflowMonitorPolId(ctx context.Context, data *FvRsBDToNetflowMo data.Id = types.StringValue(fmt.Sprintf("%s/%s", data.ParentDn.ValueString(), rn)) } -func getFvRsBDToNetflowMonitorPolTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvRsBDToNetflowMonitorPolResourceModel, tagAnnotationPlan, tagAnnotationState []TagAnnotationFvRsBDToNetflowMonitorPolResourceModel) []map[string]interface{} { - +func getFvRsBDToNetflowMonitorPolTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvRsBDToNetflowMonitorPolResourceModel, tagAnnotationFvRsBDToNetflowMonitorPolPlan, tagAnnotationFvRsBDToNetflowMonitorPolState []TagAnnotationFvRsBDToNetflowMonitorPolResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagAnnotation.IsUnknown() { + if !data.TagAnnotation.IsNull() && !data.TagAnnotation.IsUnknown() { tagAnnotationIdentifiers := []TagAnnotationIdentifier{} - for _, tagAnnotation := range tagAnnotationPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagAnnotation.Key.IsUnknown() && !tagAnnotation.Key.IsNull() { - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() + for _, tagAnnotationFvRsBDToNetflowMonitorPol := range tagAnnotationFvRsBDToNetflowMonitorPolPlan { + childMap := NewAciObject() + if !tagAnnotationFvRsBDToNetflowMonitorPol.Key.IsNull() && !tagAnnotationFvRsBDToNetflowMonitorPol.Key.IsUnknown() { + childMap.Attributes["key"] = tagAnnotationFvRsBDToNetflowMonitorPol.Key.ValueString() } - if !tagAnnotation.Value.IsUnknown() && !tagAnnotation.Value.IsNull() { - childMap["attributes"]["value"] = tagAnnotation.Value.ValueString() + if !tagAnnotationFvRsBDToNetflowMonitorPol.Value.IsNull() && !tagAnnotationFvRsBDToNetflowMonitorPol.Value.IsUnknown() { + childMap.Attributes["value"] = tagAnnotationFvRsBDToNetflowMonitorPol.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) tagAnnotationIdentifier := TagAnnotationIdentifier{} - tagAnnotationIdentifier.Key = tagAnnotation.Key + tagAnnotationIdentifier.Key = tagAnnotationFvRsBDToNetflowMonitorPol.Key tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) } - for _, tagAnnotation := range tagAnnotationState { + for _, tagAnnotation := range tagAnnotationFvRsBDToNetflowMonitorPolState { delete := true for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { if tagAnnotationIdentifier.Key == tagAnnotation.Key { @@ -554,10 +569,10 @@ func getFvRsBDToNetflowMonitorPolTagAnnotationChildPayloads(ctx context.Context, } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) + tagAnnotationChildMapForDelete := NewAciObject() + tagAnnotationChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationChildMapForDelete.Attributes["key"] = tagAnnotation.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": tagAnnotationChildMapForDelete}) } } } else { @@ -566,25 +581,25 @@ func getFvRsBDToNetflowMonitorPolTagAnnotationChildPayloads(ctx context.Context, return childPayloads } -func getFvRsBDToNetflowMonitorPolTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvRsBDToNetflowMonitorPolResourceModel, tagTagPlan, tagTagState []TagTagFvRsBDToNetflowMonitorPolResourceModel) []map[string]interface{} { +func getFvRsBDToNetflowMonitorPolTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvRsBDToNetflowMonitorPolResourceModel, tagTagFvRsBDToNetflowMonitorPolPlan, tagTagFvRsBDToNetflowMonitorPolState []TagTagFvRsBDToNetflowMonitorPolResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagTag.IsUnknown() { + if !data.TagTag.IsNull() && !data.TagTag.IsUnknown() { tagTagIdentifiers := []TagTagIdentifier{} - for _, tagTag := range tagTagPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagTag.Key.IsUnknown() && !tagTag.Key.IsNull() { - childMap["attributes"]["key"] = tagTag.Key.ValueString() + for _, tagTagFvRsBDToNetflowMonitorPol := range tagTagFvRsBDToNetflowMonitorPolPlan { + childMap := NewAciObject() + if !tagTagFvRsBDToNetflowMonitorPol.Key.IsNull() && !tagTagFvRsBDToNetflowMonitorPol.Key.IsUnknown() { + childMap.Attributes["key"] = tagTagFvRsBDToNetflowMonitorPol.Key.ValueString() } - if !tagTag.Value.IsUnknown() && !tagTag.Value.IsNull() { - childMap["attributes"]["value"] = tagTag.Value.ValueString() + if !tagTagFvRsBDToNetflowMonitorPol.Value.IsNull() && !tagTagFvRsBDToNetflowMonitorPol.Value.IsUnknown() { + childMap.Attributes["value"] = tagTagFvRsBDToNetflowMonitorPol.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) tagTagIdentifier := TagTagIdentifier{} - tagTagIdentifier.Key = tagTag.Key + tagTagIdentifier.Key = tagTagFvRsBDToNetflowMonitorPol.Key tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) } - for _, tagTag := range tagTagState { + for _, tagTag := range tagTagFvRsBDToNetflowMonitorPolState { delete := true for _, tagTagIdentifier := range tagTagIdentifiers { if tagTagIdentifier.Key == tagTag.Key { @@ -593,10 +608,10 @@ func getFvRsBDToNetflowMonitorPolTagTagChildPayloads(ctx context.Context, diags } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagTag.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) + tagTagChildMapForDelete := NewAciObject() + tagTagChildMapForDelete.Attributes["status"] = "deleted" + tagTagChildMapForDelete.Attributes["key"] = tagTag.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagTag": tagTagChildMapForDelete}) } } } else { diff --git a/internal/provider/resource_aci_relation_from_bridge_domain_to_netflow_monitor_policy_test.go b/internal/provider/resource_aci_relation_from_bridge_domain_to_netflow_monitor_policy_test.go index 8186d3555..eaae97a19 100644 --- a/internal/provider/resource_aci_relation_from_bridge_domain_to_netflow_monitor_policy_test.go +++ b/internal/provider/resource_aci_relation_from_bridge_domain_to_netflow_monitor_policy_test.go @@ -234,24 +234,24 @@ resource "aci_relation_from_bridge_domain_to_netflow_monitor_policy" "test" { filter_type = "ipv4" netflow_monitor_policy_name = "test_tn_netflow_monitor_pol_name" annotations = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] tags = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] } ` diff --git a/internal/provider/resource_aci_relation_from_l3out_consumer_label_to_external_epg.go b/internal/provider/resource_aci_relation_from_l3out_consumer_label_to_external_epg.go index 3b4597785..8e9e51210 100644 --- a/internal/provider/resource_aci_relation_from_l3out_consumer_label_to_external_epg.go +++ b/internal/provider/resource_aci_relation_from_l3out_consumer_label_to_external_epg.go @@ -82,6 +82,13 @@ func getEmptyTagAnnotationL3extRsLblToInstPResourceModel() TagAnnotationL3extRsL } } +var TagAnnotationL3extRsLblToInstPType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // TagTagL3extRsLblToInstPResourceModel describes the resource data model for the children without relation ships. type TagTagL3extRsLblToInstPResourceModel struct { Key types.String `tfsdk:"key"` @@ -95,6 +102,13 @@ func getEmptyTagTagL3extRsLblToInstPResourceModel() TagTagL3extRsLblToInstPResou } } +var TagTagL3extRsLblToInstPType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + type L3extRsLblToInstPIdentifier struct { TDn types.String } @@ -408,7 +422,7 @@ func (r *L3extRsLblToInstPResource) ImportState(ctx context.Context, req resourc } func getAndSetL3extRsLblToInstPAttributes(ctx context.Context, diags *diag.Diagnostics, client *client.Client, data *L3extRsLblToInstPResourceModel) { - requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=children&rsp-subtree-class=%s", data.Id.ValueString(), "l3extRsLblToInstP,tagAnnotation,tagTag"), "GET", nil) + requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=full&rsp-subtree-class=%s", data.Id.ValueString(), "l3extRsLblToInstP,tagAnnotation,tagTag"), "GET", nil) readData := getEmptyL3extRsLblToInstPResourceModel() @@ -448,6 +462,7 @@ func getAndSetL3extRsLblToInstPAttributes(ctx context.Context, diags *diag.Diagn if childAttributeName == "value" { TagAnnotationL3extRsLblToInstP.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagAnnotationL3extRsLblToInstPList = append(TagAnnotationL3extRsLblToInstPList, TagAnnotationL3extRsLblToInstP) } @@ -460,6 +475,7 @@ func getAndSetL3extRsLblToInstPAttributes(ctx context.Context, diags *diag.Diagn if childAttributeName == "value" { TagTagL3extRsLblToInstP.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagTagL3extRsLblToInstPList = append(TagTagL3extRsLblToInstPList, TagTagL3extRsLblToInstP) } @@ -507,25 +523,24 @@ func setL3extRsLblToInstPId(ctx context.Context, data *L3extRsLblToInstPResource data.Id = types.StringValue(fmt.Sprintf("%s/%s", data.ParentDn.ValueString(), rn)) } -func getL3extRsLblToInstPTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *L3extRsLblToInstPResourceModel, tagAnnotationPlan, tagAnnotationState []TagAnnotationL3extRsLblToInstPResourceModel) []map[string]interface{} { - +func getL3extRsLblToInstPTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *L3extRsLblToInstPResourceModel, tagAnnotationL3extRsLblToInstPPlan, tagAnnotationL3extRsLblToInstPState []TagAnnotationL3extRsLblToInstPResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagAnnotation.IsUnknown() { + if !data.TagAnnotation.IsNull() && !data.TagAnnotation.IsUnknown() { tagAnnotationIdentifiers := []TagAnnotationIdentifier{} - for _, tagAnnotation := range tagAnnotationPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagAnnotation.Key.IsUnknown() && !tagAnnotation.Key.IsNull() { - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() + for _, tagAnnotationL3extRsLblToInstP := range tagAnnotationL3extRsLblToInstPPlan { + childMap := NewAciObject() + if !tagAnnotationL3extRsLblToInstP.Key.IsNull() && !tagAnnotationL3extRsLblToInstP.Key.IsUnknown() { + childMap.Attributes["key"] = tagAnnotationL3extRsLblToInstP.Key.ValueString() } - if !tagAnnotation.Value.IsUnknown() && !tagAnnotation.Value.IsNull() { - childMap["attributes"]["value"] = tagAnnotation.Value.ValueString() + if !tagAnnotationL3extRsLblToInstP.Value.IsNull() && !tagAnnotationL3extRsLblToInstP.Value.IsUnknown() { + childMap.Attributes["value"] = tagAnnotationL3extRsLblToInstP.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) tagAnnotationIdentifier := TagAnnotationIdentifier{} - tagAnnotationIdentifier.Key = tagAnnotation.Key + tagAnnotationIdentifier.Key = tagAnnotationL3extRsLblToInstP.Key tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) } - for _, tagAnnotation := range tagAnnotationState { + for _, tagAnnotation := range tagAnnotationL3extRsLblToInstPState { delete := true for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { if tagAnnotationIdentifier.Key == tagAnnotation.Key { @@ -534,10 +549,10 @@ func getL3extRsLblToInstPTagAnnotationChildPayloads(ctx context.Context, diags * } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) + tagAnnotationChildMapForDelete := NewAciObject() + tagAnnotationChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationChildMapForDelete.Attributes["key"] = tagAnnotation.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": tagAnnotationChildMapForDelete}) } } } else { @@ -546,25 +561,25 @@ func getL3extRsLblToInstPTagAnnotationChildPayloads(ctx context.Context, diags * return childPayloads } -func getL3extRsLblToInstPTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *L3extRsLblToInstPResourceModel, tagTagPlan, tagTagState []TagTagL3extRsLblToInstPResourceModel) []map[string]interface{} { +func getL3extRsLblToInstPTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *L3extRsLblToInstPResourceModel, tagTagL3extRsLblToInstPPlan, tagTagL3extRsLblToInstPState []TagTagL3extRsLblToInstPResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagTag.IsUnknown() { + if !data.TagTag.IsNull() && !data.TagTag.IsUnknown() { tagTagIdentifiers := []TagTagIdentifier{} - for _, tagTag := range tagTagPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagTag.Key.IsUnknown() && !tagTag.Key.IsNull() { - childMap["attributes"]["key"] = tagTag.Key.ValueString() + for _, tagTagL3extRsLblToInstP := range tagTagL3extRsLblToInstPPlan { + childMap := NewAciObject() + if !tagTagL3extRsLblToInstP.Key.IsNull() && !tagTagL3extRsLblToInstP.Key.IsUnknown() { + childMap.Attributes["key"] = tagTagL3extRsLblToInstP.Key.ValueString() } - if !tagTag.Value.IsUnknown() && !tagTag.Value.IsNull() { - childMap["attributes"]["value"] = tagTag.Value.ValueString() + if !tagTagL3extRsLblToInstP.Value.IsNull() && !tagTagL3extRsLblToInstP.Value.IsUnknown() { + childMap.Attributes["value"] = tagTagL3extRsLblToInstP.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) tagTagIdentifier := TagTagIdentifier{} - tagTagIdentifier.Key = tagTag.Key + tagTagIdentifier.Key = tagTagL3extRsLblToInstP.Key tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) } - for _, tagTag := range tagTagState { + for _, tagTag := range tagTagL3extRsLblToInstPState { delete := true for _, tagTagIdentifier := range tagTagIdentifiers { if tagTagIdentifier.Key == tagTag.Key { @@ -573,10 +588,10 @@ func getL3extRsLblToInstPTagTagChildPayloads(ctx context.Context, diags *diag.Di } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagTag.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) + tagTagChildMapForDelete := NewAciObject() + tagTagChildMapForDelete.Attributes["status"] = "deleted" + tagTagChildMapForDelete.Attributes["key"] = tagTag.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagTag": tagTagChildMapForDelete}) } } } else { diff --git a/internal/provider/resource_aci_relation_from_l3out_consumer_label_to_external_epg_test.go b/internal/provider/resource_aci_relation_from_l3out_consumer_label_to_external_epg_test.go index 1483ceeae..8ad18fb7c 100644 --- a/internal/provider/resource_aci_relation_from_l3out_consumer_label_to_external_epg_test.go +++ b/internal/provider/resource_aci_relation_from_l3out_consumer_label_to_external_epg_test.go @@ -222,24 +222,24 @@ resource "aci_relation_from_l3out_consumer_label_to_external_epg" "test" { parent_dn = aci_l3out_consumer_label.test.id target_dn = "uni/tn-test_tenant/out-test_l3_outside/instP-inst_profile_1" annotations = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] tags = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] } ` diff --git a/internal/provider/resource_aci_relation_from_l3out_consumer_label_to_route_control_profile.go b/internal/provider/resource_aci_relation_from_l3out_consumer_label_to_route_control_profile.go index d4b3c6d5e..2f3a6f640 100644 --- a/internal/provider/resource_aci_relation_from_l3out_consumer_label_to_route_control_profile.go +++ b/internal/provider/resource_aci_relation_from_l3out_consumer_label_to_route_control_profile.go @@ -86,6 +86,13 @@ func getEmptyTagAnnotationL3extRsLblToProfileResourceModel() TagAnnotationL3extR } } +var TagAnnotationL3extRsLblToProfileType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // TagTagL3extRsLblToProfileResourceModel describes the resource data model for the children without relation ships. type TagTagL3extRsLblToProfileResourceModel struct { Key types.String `tfsdk:"key"` @@ -99,6 +106,13 @@ func getEmptyTagTagL3extRsLblToProfileResourceModel() TagTagL3extRsLblToProfileR } } +var TagTagL3extRsLblToProfileType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + type L3extRsLblToProfileIdentifier struct { Direction types.String TDn types.String @@ -425,7 +439,7 @@ func (r *L3extRsLblToProfileResource) ImportState(ctx context.Context, req resou } func getAndSetL3extRsLblToProfileAttributes(ctx context.Context, diags *diag.Diagnostics, client *client.Client, data *L3extRsLblToProfileResourceModel) { - requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=children&rsp-subtree-class=%s", data.Id.ValueString(), "l3extRsLblToProfile,tagAnnotation,tagTag"), "GET", nil) + requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=full&rsp-subtree-class=%s", data.Id.ValueString(), "l3extRsLblToProfile,tagAnnotation,tagTag"), "GET", nil) readData := getEmptyL3extRsLblToProfileResourceModel() @@ -468,6 +482,7 @@ func getAndSetL3extRsLblToProfileAttributes(ctx context.Context, diags *diag.Dia if childAttributeName == "value" { TagAnnotationL3extRsLblToProfile.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagAnnotationL3extRsLblToProfileList = append(TagAnnotationL3extRsLblToProfileList, TagAnnotationL3extRsLblToProfile) } @@ -480,6 +495,7 @@ func getAndSetL3extRsLblToProfileAttributes(ctx context.Context, diags *diag.Dia if childAttributeName == "value" { TagTagL3extRsLblToProfile.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagTagL3extRsLblToProfileList = append(TagTagL3extRsLblToProfileList, TagTagL3extRsLblToProfile) } @@ -527,25 +543,24 @@ func setL3extRsLblToProfileId(ctx context.Context, data *L3extRsLblToProfileReso data.Id = types.StringValue(fmt.Sprintf("%s/%s", data.ParentDn.ValueString(), rn)) } -func getL3extRsLblToProfileTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *L3extRsLblToProfileResourceModel, tagAnnotationPlan, tagAnnotationState []TagAnnotationL3extRsLblToProfileResourceModel) []map[string]interface{} { - +func getL3extRsLblToProfileTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *L3extRsLblToProfileResourceModel, tagAnnotationL3extRsLblToProfilePlan, tagAnnotationL3extRsLblToProfileState []TagAnnotationL3extRsLblToProfileResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagAnnotation.IsUnknown() { + if !data.TagAnnotation.IsNull() && !data.TagAnnotation.IsUnknown() { tagAnnotationIdentifiers := []TagAnnotationIdentifier{} - for _, tagAnnotation := range tagAnnotationPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagAnnotation.Key.IsUnknown() && !tagAnnotation.Key.IsNull() { - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() + for _, tagAnnotationL3extRsLblToProfile := range tagAnnotationL3extRsLblToProfilePlan { + childMap := NewAciObject() + if !tagAnnotationL3extRsLblToProfile.Key.IsNull() && !tagAnnotationL3extRsLblToProfile.Key.IsUnknown() { + childMap.Attributes["key"] = tagAnnotationL3extRsLblToProfile.Key.ValueString() } - if !tagAnnotation.Value.IsUnknown() && !tagAnnotation.Value.IsNull() { - childMap["attributes"]["value"] = tagAnnotation.Value.ValueString() + if !tagAnnotationL3extRsLblToProfile.Value.IsNull() && !tagAnnotationL3extRsLblToProfile.Value.IsUnknown() { + childMap.Attributes["value"] = tagAnnotationL3extRsLblToProfile.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) tagAnnotationIdentifier := TagAnnotationIdentifier{} - tagAnnotationIdentifier.Key = tagAnnotation.Key + tagAnnotationIdentifier.Key = tagAnnotationL3extRsLblToProfile.Key tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) } - for _, tagAnnotation := range tagAnnotationState { + for _, tagAnnotation := range tagAnnotationL3extRsLblToProfileState { delete := true for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { if tagAnnotationIdentifier.Key == tagAnnotation.Key { @@ -554,10 +569,10 @@ func getL3extRsLblToProfileTagAnnotationChildPayloads(ctx context.Context, diags } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) + tagAnnotationChildMapForDelete := NewAciObject() + tagAnnotationChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationChildMapForDelete.Attributes["key"] = tagAnnotation.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": tagAnnotationChildMapForDelete}) } } } else { @@ -566,25 +581,25 @@ func getL3extRsLblToProfileTagAnnotationChildPayloads(ctx context.Context, diags return childPayloads } -func getL3extRsLblToProfileTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *L3extRsLblToProfileResourceModel, tagTagPlan, tagTagState []TagTagL3extRsLblToProfileResourceModel) []map[string]interface{} { +func getL3extRsLblToProfileTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *L3extRsLblToProfileResourceModel, tagTagL3extRsLblToProfilePlan, tagTagL3extRsLblToProfileState []TagTagL3extRsLblToProfileResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagTag.IsUnknown() { + if !data.TagTag.IsNull() && !data.TagTag.IsUnknown() { tagTagIdentifiers := []TagTagIdentifier{} - for _, tagTag := range tagTagPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagTag.Key.IsUnknown() && !tagTag.Key.IsNull() { - childMap["attributes"]["key"] = tagTag.Key.ValueString() + for _, tagTagL3extRsLblToProfile := range tagTagL3extRsLblToProfilePlan { + childMap := NewAciObject() + if !tagTagL3extRsLblToProfile.Key.IsNull() && !tagTagL3extRsLblToProfile.Key.IsUnknown() { + childMap.Attributes["key"] = tagTagL3extRsLblToProfile.Key.ValueString() } - if !tagTag.Value.IsUnknown() && !tagTag.Value.IsNull() { - childMap["attributes"]["value"] = tagTag.Value.ValueString() + if !tagTagL3extRsLblToProfile.Value.IsNull() && !tagTagL3extRsLblToProfile.Value.IsUnknown() { + childMap.Attributes["value"] = tagTagL3extRsLblToProfile.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) tagTagIdentifier := TagTagIdentifier{} - tagTagIdentifier.Key = tagTag.Key + tagTagIdentifier.Key = tagTagL3extRsLblToProfile.Key tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) } - for _, tagTag := range tagTagState { + for _, tagTag := range tagTagL3extRsLblToProfileState { delete := true for _, tagTagIdentifier := range tagTagIdentifiers { if tagTagIdentifier.Key == tagTag.Key { @@ -593,10 +608,10 @@ func getL3extRsLblToProfileTagTagChildPayloads(ctx context.Context, diags *diag. } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagTag.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) + tagTagChildMapForDelete := NewAciObject() + tagTagChildMapForDelete.Attributes["status"] = "deleted" + tagTagChildMapForDelete.Attributes["key"] = tagTag.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagTag": tagTagChildMapForDelete}) } } } else { diff --git a/internal/provider/resource_aci_relation_from_l3out_consumer_label_to_route_control_profile_test.go b/internal/provider/resource_aci_relation_from_l3out_consumer_label_to_route_control_profile_test.go index 6748df5f6..0e7dc2db8 100644 --- a/internal/provider/resource_aci_relation_from_l3out_consumer_label_to_route_control_profile_test.go +++ b/internal/provider/resource_aci_relation_from_l3out_consumer_label_to_route_control_profile_test.go @@ -237,24 +237,24 @@ resource "aci_relation_from_l3out_consumer_label_to_route_control_profile" "test direction = "import" target_dn = "uni/tn-test_tenant/prof-rt_ctrl_profile_1" annotations = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] tags = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] } ` diff --git a/internal/provider/resource_aci_relation_to_consumed_contract.go b/internal/provider/resource_aci_relation_to_consumed_contract.go index 2ccd23070..5f4163f9d 100644 --- a/internal/provider/resource_aci_relation_to_consumed_contract.go +++ b/internal/provider/resource_aci_relation_to_consumed_contract.go @@ -88,6 +88,13 @@ func getEmptyTagAnnotationFvRsConsResourceModel() TagAnnotationFvRsConsResourceM } } +var TagAnnotationFvRsConsType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // TagTagFvRsConsResourceModel describes the resource data model for the children without relation ships. type TagTagFvRsConsResourceModel struct { Key types.String `tfsdk:"key"` @@ -101,6 +108,13 @@ func getEmptyTagTagFvRsConsResourceModel() TagTagFvRsConsResourceModel { } } +var TagTagFvRsConsType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + type FvRsConsIdentifier struct { TnVzBrCPName types.String } @@ -430,7 +444,7 @@ func (r *FvRsConsResource) ImportState(ctx context.Context, req resource.ImportS } func getAndSetFvRsConsAttributes(ctx context.Context, diags *diag.Diagnostics, client *client.Client, data *FvRsConsResourceModel) { - requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=children&rsp-subtree-class=%s", data.Id.ValueString(), "fvRsCons,tagAnnotation,tagTag"), "GET", nil) + requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=full&rsp-subtree-class=%s", data.Id.ValueString(), "fvRsCons,tagAnnotation,tagTag"), "GET", nil) readData := getEmptyFvRsConsResourceModel() @@ -473,6 +487,7 @@ func getAndSetFvRsConsAttributes(ctx context.Context, diags *diag.Diagnostics, c if childAttributeName == "value" { TagAnnotationFvRsCons.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagAnnotationFvRsConsList = append(TagAnnotationFvRsConsList, TagAnnotationFvRsCons) } @@ -485,6 +500,7 @@ func getAndSetFvRsConsAttributes(ctx context.Context, diags *diag.Diagnostics, c if childAttributeName == "value" { TagTagFvRsCons.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagTagFvRsConsList = append(TagTagFvRsConsList, TagTagFvRsCons) } @@ -532,25 +548,24 @@ func setFvRsConsId(ctx context.Context, data *FvRsConsResourceModel) { data.Id = types.StringValue(fmt.Sprintf("%s/%s", data.ParentDn.ValueString(), rn)) } -func getFvRsConsTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvRsConsResourceModel, tagAnnotationPlan, tagAnnotationState []TagAnnotationFvRsConsResourceModel) []map[string]interface{} { - +func getFvRsConsTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvRsConsResourceModel, tagAnnotationFvRsConsPlan, tagAnnotationFvRsConsState []TagAnnotationFvRsConsResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagAnnotation.IsUnknown() { + if !data.TagAnnotation.IsNull() && !data.TagAnnotation.IsUnknown() { tagAnnotationIdentifiers := []TagAnnotationIdentifier{} - for _, tagAnnotation := range tagAnnotationPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagAnnotation.Key.IsUnknown() && !tagAnnotation.Key.IsNull() { - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() + for _, tagAnnotationFvRsCons := range tagAnnotationFvRsConsPlan { + childMap := NewAciObject() + if !tagAnnotationFvRsCons.Key.IsNull() && !tagAnnotationFvRsCons.Key.IsUnknown() { + childMap.Attributes["key"] = tagAnnotationFvRsCons.Key.ValueString() } - if !tagAnnotation.Value.IsUnknown() && !tagAnnotation.Value.IsNull() { - childMap["attributes"]["value"] = tagAnnotation.Value.ValueString() + if !tagAnnotationFvRsCons.Value.IsNull() && !tagAnnotationFvRsCons.Value.IsUnknown() { + childMap.Attributes["value"] = tagAnnotationFvRsCons.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) tagAnnotationIdentifier := TagAnnotationIdentifier{} - tagAnnotationIdentifier.Key = tagAnnotation.Key + tagAnnotationIdentifier.Key = tagAnnotationFvRsCons.Key tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) } - for _, tagAnnotation := range tagAnnotationState { + for _, tagAnnotation := range tagAnnotationFvRsConsState { delete := true for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { if tagAnnotationIdentifier.Key == tagAnnotation.Key { @@ -559,10 +574,10 @@ func getFvRsConsTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diag } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) + tagAnnotationChildMapForDelete := NewAciObject() + tagAnnotationChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationChildMapForDelete.Attributes["key"] = tagAnnotation.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": tagAnnotationChildMapForDelete}) } } } else { @@ -571,25 +586,25 @@ func getFvRsConsTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diag return childPayloads } -func getFvRsConsTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvRsConsResourceModel, tagTagPlan, tagTagState []TagTagFvRsConsResourceModel) []map[string]interface{} { +func getFvRsConsTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvRsConsResourceModel, tagTagFvRsConsPlan, tagTagFvRsConsState []TagTagFvRsConsResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagTag.IsUnknown() { + if !data.TagTag.IsNull() && !data.TagTag.IsUnknown() { tagTagIdentifiers := []TagTagIdentifier{} - for _, tagTag := range tagTagPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagTag.Key.IsUnknown() && !tagTag.Key.IsNull() { - childMap["attributes"]["key"] = tagTag.Key.ValueString() + for _, tagTagFvRsCons := range tagTagFvRsConsPlan { + childMap := NewAciObject() + if !tagTagFvRsCons.Key.IsNull() && !tagTagFvRsCons.Key.IsUnknown() { + childMap.Attributes["key"] = tagTagFvRsCons.Key.ValueString() } - if !tagTag.Value.IsUnknown() && !tagTag.Value.IsNull() { - childMap["attributes"]["value"] = tagTag.Value.ValueString() + if !tagTagFvRsCons.Value.IsNull() && !tagTagFvRsCons.Value.IsUnknown() { + childMap.Attributes["value"] = tagTagFvRsCons.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) tagTagIdentifier := TagTagIdentifier{} - tagTagIdentifier.Key = tagTag.Key + tagTagIdentifier.Key = tagTagFvRsCons.Key tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) } - for _, tagTag := range tagTagState { + for _, tagTag := range tagTagFvRsConsState { delete := true for _, tagTagIdentifier := range tagTagIdentifiers { if tagTagIdentifier.Key == tagTag.Key { @@ -598,10 +613,10 @@ func getFvRsConsTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagTag.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) + tagTagChildMapForDelete := NewAciObject() + tagTagChildMapForDelete.Attributes["status"] = "deleted" + tagTagChildMapForDelete.Attributes["key"] = tagTag.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagTag": tagTagChildMapForDelete}) } } } else { diff --git a/internal/provider/resource_aci_relation_to_consumed_contract_test.go b/internal/provider/resource_aci_relation_to_consumed_contract_test.go index f592ba80c..8bd9dc8dc 100644 --- a/internal/provider/resource_aci_relation_to_consumed_contract_test.go +++ b/internal/provider/resource_aci_relation_to_consumed_contract_test.go @@ -423,24 +423,24 @@ resource "aci_relation_to_consumed_contract" "test" { parent_dn = aci_application_epg.test.id contract_name = "test_tn_vz_br_cp_name" annotations = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] tags = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] } ` @@ -529,24 +529,24 @@ resource "aci_relation_to_consumed_contract" "test" { parent_dn = aci_endpoint_security_group.test.id contract_name = "test_tn_vz_br_cp_name" annotations = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] tags = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] } ` diff --git a/internal/provider/resource_aci_relation_to_consumed_out_of_band_contract.go b/internal/provider/resource_aci_relation_to_consumed_out_of_band_contract.go index 56524d264..04b9f7a64 100644 --- a/internal/provider/resource_aci_relation_to_consumed_out_of_band_contract.go +++ b/internal/provider/resource_aci_relation_to_consumed_out_of_band_contract.go @@ -88,6 +88,13 @@ func getEmptyTagAnnotationMgmtRsOoBConsResourceModel() TagAnnotationMgmtRsOoBCon } } +var TagAnnotationMgmtRsOoBConsType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // TagTagMgmtRsOoBConsResourceModel describes the resource data model for the children without relation ships. type TagTagMgmtRsOoBConsResourceModel struct { Key types.String `tfsdk:"key"` @@ -101,6 +108,13 @@ func getEmptyTagTagMgmtRsOoBConsResourceModel() TagTagMgmtRsOoBConsResourceModel } } +var TagTagMgmtRsOoBConsType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + type MgmtRsOoBConsIdentifier struct { TnVzOOBBrCPName types.String } @@ -430,7 +444,7 @@ func (r *MgmtRsOoBConsResource) ImportState(ctx context.Context, req resource.Im } func getAndSetMgmtRsOoBConsAttributes(ctx context.Context, diags *diag.Diagnostics, client *client.Client, data *MgmtRsOoBConsResourceModel) { - requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=children&rsp-subtree-class=%s", data.Id.ValueString(), "mgmtRsOoBCons,tagAnnotation,tagTag"), "GET", nil) + requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=full&rsp-subtree-class=%s", data.Id.ValueString(), "mgmtRsOoBCons,tagAnnotation,tagTag"), "GET", nil) readData := getEmptyMgmtRsOoBConsResourceModel() @@ -473,6 +487,7 @@ func getAndSetMgmtRsOoBConsAttributes(ctx context.Context, diags *diag.Diagnosti if childAttributeName == "value" { TagAnnotationMgmtRsOoBCons.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagAnnotationMgmtRsOoBConsList = append(TagAnnotationMgmtRsOoBConsList, TagAnnotationMgmtRsOoBCons) } @@ -485,6 +500,7 @@ func getAndSetMgmtRsOoBConsAttributes(ctx context.Context, diags *diag.Diagnosti if childAttributeName == "value" { TagTagMgmtRsOoBCons.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagTagMgmtRsOoBConsList = append(TagTagMgmtRsOoBConsList, TagTagMgmtRsOoBCons) } @@ -532,25 +548,24 @@ func setMgmtRsOoBConsId(ctx context.Context, data *MgmtRsOoBConsResourceModel) { data.Id = types.StringValue(fmt.Sprintf("%s/%s", data.ParentDn.ValueString(), rn)) } -func getMgmtRsOoBConsTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *MgmtRsOoBConsResourceModel, tagAnnotationPlan, tagAnnotationState []TagAnnotationMgmtRsOoBConsResourceModel) []map[string]interface{} { - +func getMgmtRsOoBConsTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *MgmtRsOoBConsResourceModel, tagAnnotationMgmtRsOoBConsPlan, tagAnnotationMgmtRsOoBConsState []TagAnnotationMgmtRsOoBConsResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagAnnotation.IsUnknown() { + if !data.TagAnnotation.IsNull() && !data.TagAnnotation.IsUnknown() { tagAnnotationIdentifiers := []TagAnnotationIdentifier{} - for _, tagAnnotation := range tagAnnotationPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagAnnotation.Key.IsUnknown() && !tagAnnotation.Key.IsNull() { - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() + for _, tagAnnotationMgmtRsOoBCons := range tagAnnotationMgmtRsOoBConsPlan { + childMap := NewAciObject() + if !tagAnnotationMgmtRsOoBCons.Key.IsNull() && !tagAnnotationMgmtRsOoBCons.Key.IsUnknown() { + childMap.Attributes["key"] = tagAnnotationMgmtRsOoBCons.Key.ValueString() } - if !tagAnnotation.Value.IsUnknown() && !tagAnnotation.Value.IsNull() { - childMap["attributes"]["value"] = tagAnnotation.Value.ValueString() + if !tagAnnotationMgmtRsOoBCons.Value.IsNull() && !tagAnnotationMgmtRsOoBCons.Value.IsUnknown() { + childMap.Attributes["value"] = tagAnnotationMgmtRsOoBCons.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) tagAnnotationIdentifier := TagAnnotationIdentifier{} - tagAnnotationIdentifier.Key = tagAnnotation.Key + tagAnnotationIdentifier.Key = tagAnnotationMgmtRsOoBCons.Key tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) } - for _, tagAnnotation := range tagAnnotationState { + for _, tagAnnotation := range tagAnnotationMgmtRsOoBConsState { delete := true for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { if tagAnnotationIdentifier.Key == tagAnnotation.Key { @@ -559,10 +574,10 @@ func getMgmtRsOoBConsTagAnnotationChildPayloads(ctx context.Context, diags *diag } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) + tagAnnotationChildMapForDelete := NewAciObject() + tagAnnotationChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationChildMapForDelete.Attributes["key"] = tagAnnotation.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": tagAnnotationChildMapForDelete}) } } } else { @@ -571,25 +586,25 @@ func getMgmtRsOoBConsTagAnnotationChildPayloads(ctx context.Context, diags *diag return childPayloads } -func getMgmtRsOoBConsTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *MgmtRsOoBConsResourceModel, tagTagPlan, tagTagState []TagTagMgmtRsOoBConsResourceModel) []map[string]interface{} { +func getMgmtRsOoBConsTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *MgmtRsOoBConsResourceModel, tagTagMgmtRsOoBConsPlan, tagTagMgmtRsOoBConsState []TagTagMgmtRsOoBConsResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagTag.IsUnknown() { + if !data.TagTag.IsNull() && !data.TagTag.IsUnknown() { tagTagIdentifiers := []TagTagIdentifier{} - for _, tagTag := range tagTagPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagTag.Key.IsUnknown() && !tagTag.Key.IsNull() { - childMap["attributes"]["key"] = tagTag.Key.ValueString() + for _, tagTagMgmtRsOoBCons := range tagTagMgmtRsOoBConsPlan { + childMap := NewAciObject() + if !tagTagMgmtRsOoBCons.Key.IsNull() && !tagTagMgmtRsOoBCons.Key.IsUnknown() { + childMap.Attributes["key"] = tagTagMgmtRsOoBCons.Key.ValueString() } - if !tagTag.Value.IsUnknown() && !tagTag.Value.IsNull() { - childMap["attributes"]["value"] = tagTag.Value.ValueString() + if !tagTagMgmtRsOoBCons.Value.IsNull() && !tagTagMgmtRsOoBCons.Value.IsUnknown() { + childMap.Attributes["value"] = tagTagMgmtRsOoBCons.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) tagTagIdentifier := TagTagIdentifier{} - tagTagIdentifier.Key = tagTag.Key + tagTagIdentifier.Key = tagTagMgmtRsOoBCons.Key tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) } - for _, tagTag := range tagTagState { + for _, tagTag := range tagTagMgmtRsOoBConsState { delete := true for _, tagTagIdentifier := range tagTagIdentifiers { if tagTagIdentifier.Key == tagTag.Key { @@ -598,10 +613,10 @@ func getMgmtRsOoBConsTagTagChildPayloads(ctx context.Context, diags *diag.Diagno } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagTag.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) + tagTagChildMapForDelete := NewAciObject() + tagTagChildMapForDelete.Attributes["status"] = "deleted" + tagTagChildMapForDelete.Attributes["key"] = tagTag.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagTag": tagTagChildMapForDelete}) } } } else { diff --git a/internal/provider/resource_aci_relation_to_consumed_out_of_band_contract_test.go b/internal/provider/resource_aci_relation_to_consumed_out_of_band_contract_test.go index 73b92f4d3..6e58deba5 100644 --- a/internal/provider/resource_aci_relation_to_consumed_out_of_band_contract_test.go +++ b/internal/provider/resource_aci_relation_to_consumed_out_of_band_contract_test.go @@ -238,24 +238,24 @@ resource "aci_relation_to_consumed_out_of_band_contract" "test" { parent_dn = aci_external_management_network_instance_profile.test.id out_of_band_contract_name = "test_tn_vz_oob_br_cp_name" annotations = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] tags = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] } ` diff --git a/internal/provider/resource_aci_relation_to_contract_master.go b/internal/provider/resource_aci_relation_to_contract_master.go index 3365e3c29..a3727439f 100644 --- a/internal/provider/resource_aci_relation_to_contract_master.go +++ b/internal/provider/resource_aci_relation_to_contract_master.go @@ -82,6 +82,13 @@ func getEmptyTagAnnotationFvRsSecInheritedResourceModel() TagAnnotationFvRsSecIn } } +var TagAnnotationFvRsSecInheritedType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // TagTagFvRsSecInheritedResourceModel describes the resource data model for the children without relation ships. type TagTagFvRsSecInheritedResourceModel struct { Key types.String `tfsdk:"key"` @@ -95,6 +102,13 @@ func getEmptyTagTagFvRsSecInheritedResourceModel() TagTagFvRsSecInheritedResourc } } +var TagTagFvRsSecInheritedType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + type FvRsSecInheritedIdentifier struct { TDn types.String } @@ -408,7 +422,7 @@ func (r *FvRsSecInheritedResource) ImportState(ctx context.Context, req resource } func getAndSetFvRsSecInheritedAttributes(ctx context.Context, diags *diag.Diagnostics, client *client.Client, data *FvRsSecInheritedResourceModel) { - requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=children&rsp-subtree-class=%s", data.Id.ValueString(), "fvRsSecInherited,tagAnnotation,tagTag"), "GET", nil) + requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=full&rsp-subtree-class=%s", data.Id.ValueString(), "fvRsSecInherited,tagAnnotation,tagTag"), "GET", nil) readData := getEmptyFvRsSecInheritedResourceModel() @@ -448,6 +462,7 @@ func getAndSetFvRsSecInheritedAttributes(ctx context.Context, diags *diag.Diagno if childAttributeName == "value" { TagAnnotationFvRsSecInherited.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagAnnotationFvRsSecInheritedList = append(TagAnnotationFvRsSecInheritedList, TagAnnotationFvRsSecInherited) } @@ -460,6 +475,7 @@ func getAndSetFvRsSecInheritedAttributes(ctx context.Context, diags *diag.Diagno if childAttributeName == "value" { TagTagFvRsSecInherited.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagTagFvRsSecInheritedList = append(TagTagFvRsSecInheritedList, TagTagFvRsSecInherited) } @@ -507,25 +523,24 @@ func setFvRsSecInheritedId(ctx context.Context, data *FvRsSecInheritedResourceMo data.Id = types.StringValue(fmt.Sprintf("%s/%s", data.ParentDn.ValueString(), rn)) } -func getFvRsSecInheritedTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvRsSecInheritedResourceModel, tagAnnotationPlan, tagAnnotationState []TagAnnotationFvRsSecInheritedResourceModel) []map[string]interface{} { - +func getFvRsSecInheritedTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvRsSecInheritedResourceModel, tagAnnotationFvRsSecInheritedPlan, tagAnnotationFvRsSecInheritedState []TagAnnotationFvRsSecInheritedResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagAnnotation.IsUnknown() { + if !data.TagAnnotation.IsNull() && !data.TagAnnotation.IsUnknown() { tagAnnotationIdentifiers := []TagAnnotationIdentifier{} - for _, tagAnnotation := range tagAnnotationPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagAnnotation.Key.IsUnknown() && !tagAnnotation.Key.IsNull() { - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() + for _, tagAnnotationFvRsSecInherited := range tagAnnotationFvRsSecInheritedPlan { + childMap := NewAciObject() + if !tagAnnotationFvRsSecInherited.Key.IsNull() && !tagAnnotationFvRsSecInherited.Key.IsUnknown() { + childMap.Attributes["key"] = tagAnnotationFvRsSecInherited.Key.ValueString() } - if !tagAnnotation.Value.IsUnknown() && !tagAnnotation.Value.IsNull() { - childMap["attributes"]["value"] = tagAnnotation.Value.ValueString() + if !tagAnnotationFvRsSecInherited.Value.IsNull() && !tagAnnotationFvRsSecInherited.Value.IsUnknown() { + childMap.Attributes["value"] = tagAnnotationFvRsSecInherited.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) tagAnnotationIdentifier := TagAnnotationIdentifier{} - tagAnnotationIdentifier.Key = tagAnnotation.Key + tagAnnotationIdentifier.Key = tagAnnotationFvRsSecInherited.Key tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) } - for _, tagAnnotation := range tagAnnotationState { + for _, tagAnnotation := range tagAnnotationFvRsSecInheritedState { delete := true for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { if tagAnnotationIdentifier.Key == tagAnnotation.Key { @@ -534,10 +549,10 @@ func getFvRsSecInheritedTagAnnotationChildPayloads(ctx context.Context, diags *d } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) + tagAnnotationChildMapForDelete := NewAciObject() + tagAnnotationChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationChildMapForDelete.Attributes["key"] = tagAnnotation.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": tagAnnotationChildMapForDelete}) } } } else { @@ -546,25 +561,25 @@ func getFvRsSecInheritedTagAnnotationChildPayloads(ctx context.Context, diags *d return childPayloads } -func getFvRsSecInheritedTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvRsSecInheritedResourceModel, tagTagPlan, tagTagState []TagTagFvRsSecInheritedResourceModel) []map[string]interface{} { +func getFvRsSecInheritedTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvRsSecInheritedResourceModel, tagTagFvRsSecInheritedPlan, tagTagFvRsSecInheritedState []TagTagFvRsSecInheritedResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagTag.IsUnknown() { + if !data.TagTag.IsNull() && !data.TagTag.IsUnknown() { tagTagIdentifiers := []TagTagIdentifier{} - for _, tagTag := range tagTagPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagTag.Key.IsUnknown() && !tagTag.Key.IsNull() { - childMap["attributes"]["key"] = tagTag.Key.ValueString() + for _, tagTagFvRsSecInherited := range tagTagFvRsSecInheritedPlan { + childMap := NewAciObject() + if !tagTagFvRsSecInherited.Key.IsNull() && !tagTagFvRsSecInherited.Key.IsUnknown() { + childMap.Attributes["key"] = tagTagFvRsSecInherited.Key.ValueString() } - if !tagTag.Value.IsUnknown() && !tagTag.Value.IsNull() { - childMap["attributes"]["value"] = tagTag.Value.ValueString() + if !tagTagFvRsSecInherited.Value.IsNull() && !tagTagFvRsSecInherited.Value.IsUnknown() { + childMap.Attributes["value"] = tagTagFvRsSecInherited.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) tagTagIdentifier := TagTagIdentifier{} - tagTagIdentifier.Key = tagTag.Key + tagTagIdentifier.Key = tagTagFvRsSecInherited.Key tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) } - for _, tagTag := range tagTagState { + for _, tagTag := range tagTagFvRsSecInheritedState { delete := true for _, tagTagIdentifier := range tagTagIdentifiers { if tagTagIdentifier.Key == tagTag.Key { @@ -573,10 +588,10 @@ func getFvRsSecInheritedTagTagChildPayloads(ctx context.Context, diags *diag.Dia } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagTag.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) + tagTagChildMapForDelete := NewAciObject() + tagTagChildMapForDelete.Attributes["status"] = "deleted" + tagTagChildMapForDelete.Attributes["key"] = tagTag.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagTag": tagTagChildMapForDelete}) } } } else { diff --git a/internal/provider/resource_aci_relation_to_contract_master_test.go b/internal/provider/resource_aci_relation_to_contract_master_test.go index ea69cec0c..e84cac7e0 100644 --- a/internal/provider/resource_aci_relation_to_contract_master_test.go +++ b/internal/provider/resource_aci_relation_to_contract_master_test.go @@ -406,24 +406,24 @@ resource "aci_relation_to_contract_master" "test" { parent_dn = aci_application_epg.test.id target_dn = aci_application_epg.test_application_epg_0.id annotations = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] tags = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] } ` @@ -502,24 +502,24 @@ resource "aci_relation_to_contract_master" "test" { parent_dn = aci_endpoint_security_group.test.id target_dn = aci_endpoint_security_group.test_endpoint_security_group_0.id annotations = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] tags = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] } ` diff --git a/internal/provider/resource_aci_relation_to_domain.go b/internal/provider/resource_aci_relation_to_domain.go index 0109a259b..22adf68aa 100644 --- a/internal/provider/resource_aci_relation_to_domain.go +++ b/internal/provider/resource_aci_relation_to_domain.go @@ -130,6 +130,13 @@ func getEmptyTagAnnotationFvRsDomAttResourceModel() TagAnnotationFvRsDomAttResou } } +var TagAnnotationFvRsDomAttType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // TagTagFvRsDomAttResourceModel describes the resource data model for the children without relation ships. type TagTagFvRsDomAttResourceModel struct { Key types.String `tfsdk:"key"` @@ -143,6 +150,13 @@ func getEmptyTagTagFvRsDomAttResourceModel() TagTagFvRsDomAttResourceModel { } } +var TagTagFvRsDomAttType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + type FvRsDomAttIdentifier struct { TDn types.String } @@ -703,7 +717,7 @@ func (r *FvRsDomAttResource) ImportState(ctx context.Context, req resource.Impor } func getAndSetFvRsDomAttAttributes(ctx context.Context, diags *diag.Diagnostics, client *client.Client, data *FvRsDomAttResourceModel) { - requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=children&rsp-subtree-class=%s", data.Id.ValueString(), "fvRsDomAtt,tagAnnotation,tagTag"), "GET", nil) + requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=full&rsp-subtree-class=%s", data.Id.ValueString(), "fvRsDomAtt,tagAnnotation,tagTag"), "GET", nil) readData := getEmptyFvRsDomAttResourceModel() @@ -816,6 +830,7 @@ func getAndSetFvRsDomAttAttributes(ctx context.Context, diags *diag.Diagnostics, if childAttributeName == "value" { TagAnnotationFvRsDomAtt.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagAnnotationFvRsDomAttList = append(TagAnnotationFvRsDomAttList, TagAnnotationFvRsDomAtt) } @@ -828,6 +843,7 @@ func getAndSetFvRsDomAttAttributes(ctx context.Context, diags *diag.Diagnostics, if childAttributeName == "value" { TagTagFvRsDomAtt.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagTagFvRsDomAttList = append(TagTagFvRsDomAttList, TagTagFvRsDomAtt) } @@ -875,25 +891,24 @@ func setFvRsDomAttId(ctx context.Context, data *FvRsDomAttResourceModel) { data.Id = types.StringValue(fmt.Sprintf("%s/%s", data.ParentDn.ValueString(), rn)) } -func getFvRsDomAttTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvRsDomAttResourceModel, tagAnnotationPlan, tagAnnotationState []TagAnnotationFvRsDomAttResourceModel) []map[string]interface{} { - +func getFvRsDomAttTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvRsDomAttResourceModel, tagAnnotationFvRsDomAttPlan, tagAnnotationFvRsDomAttState []TagAnnotationFvRsDomAttResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagAnnotation.IsUnknown() { + if !data.TagAnnotation.IsNull() && !data.TagAnnotation.IsUnknown() { tagAnnotationIdentifiers := []TagAnnotationIdentifier{} - for _, tagAnnotation := range tagAnnotationPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagAnnotation.Key.IsUnknown() && !tagAnnotation.Key.IsNull() { - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() + for _, tagAnnotationFvRsDomAtt := range tagAnnotationFvRsDomAttPlan { + childMap := NewAciObject() + if !tagAnnotationFvRsDomAtt.Key.IsNull() && !tagAnnotationFvRsDomAtt.Key.IsUnknown() { + childMap.Attributes["key"] = tagAnnotationFvRsDomAtt.Key.ValueString() } - if !tagAnnotation.Value.IsUnknown() && !tagAnnotation.Value.IsNull() { - childMap["attributes"]["value"] = tagAnnotation.Value.ValueString() + if !tagAnnotationFvRsDomAtt.Value.IsNull() && !tagAnnotationFvRsDomAtt.Value.IsUnknown() { + childMap.Attributes["value"] = tagAnnotationFvRsDomAtt.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) tagAnnotationIdentifier := TagAnnotationIdentifier{} - tagAnnotationIdentifier.Key = tagAnnotation.Key + tagAnnotationIdentifier.Key = tagAnnotationFvRsDomAtt.Key tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) } - for _, tagAnnotation := range tagAnnotationState { + for _, tagAnnotation := range tagAnnotationFvRsDomAttState { delete := true for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { if tagAnnotationIdentifier.Key == tagAnnotation.Key { @@ -902,10 +917,10 @@ func getFvRsDomAttTagAnnotationChildPayloads(ctx context.Context, diags *diag.Di } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) + tagAnnotationChildMapForDelete := NewAciObject() + tagAnnotationChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationChildMapForDelete.Attributes["key"] = tagAnnotation.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": tagAnnotationChildMapForDelete}) } } } else { @@ -914,25 +929,25 @@ func getFvRsDomAttTagAnnotationChildPayloads(ctx context.Context, diags *diag.Di return childPayloads } -func getFvRsDomAttTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvRsDomAttResourceModel, tagTagPlan, tagTagState []TagTagFvRsDomAttResourceModel) []map[string]interface{} { +func getFvRsDomAttTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvRsDomAttResourceModel, tagTagFvRsDomAttPlan, tagTagFvRsDomAttState []TagTagFvRsDomAttResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagTag.IsUnknown() { + if !data.TagTag.IsNull() && !data.TagTag.IsUnknown() { tagTagIdentifiers := []TagTagIdentifier{} - for _, tagTag := range tagTagPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagTag.Key.IsUnknown() && !tagTag.Key.IsNull() { - childMap["attributes"]["key"] = tagTag.Key.ValueString() + for _, tagTagFvRsDomAtt := range tagTagFvRsDomAttPlan { + childMap := NewAciObject() + if !tagTagFvRsDomAtt.Key.IsNull() && !tagTagFvRsDomAtt.Key.IsUnknown() { + childMap.Attributes["key"] = tagTagFvRsDomAtt.Key.ValueString() } - if !tagTag.Value.IsUnknown() && !tagTag.Value.IsNull() { - childMap["attributes"]["value"] = tagTag.Value.ValueString() + if !tagTagFvRsDomAtt.Value.IsNull() && !tagTagFvRsDomAtt.Value.IsUnknown() { + childMap.Attributes["value"] = tagTagFvRsDomAtt.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) tagTagIdentifier := TagTagIdentifier{} - tagTagIdentifier.Key = tagTag.Key + tagTagIdentifier.Key = tagTagFvRsDomAtt.Key tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) } - for _, tagTag := range tagTagState { + for _, tagTag := range tagTagFvRsDomAttState { delete := true for _, tagTagIdentifier := range tagTagIdentifiers { if tagTagIdentifier.Key == tagTag.Key { @@ -941,10 +956,10 @@ func getFvRsDomAttTagTagChildPayloads(ctx context.Context, diags *diag.Diagnosti } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagTag.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) + tagTagChildMapForDelete := NewAciObject() + tagTagChildMapForDelete.Attributes["status"] = "deleted" + tagTagChildMapForDelete.Attributes["key"] = tagTag.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagTag": tagTagChildMapForDelete}) } } } else { diff --git a/internal/provider/resource_aci_relation_to_domain_test.go b/internal/provider/resource_aci_relation_to_domain_test.go index cac098334..89512bf50 100644 --- a/internal/provider/resource_aci_relation_to_domain_test.go +++ b/internal/provider/resource_aci_relation_to_domain_test.go @@ -58,14 +58,14 @@ func TestAccResourceFvRsDomAttWithFvAEPg(t *testing.T) { resource.TestCheckResourceAttr("aci_relation_to_domain.allow_test_2", "switching_mode", "native"), resource.TestCheckResourceAttr("aci_relation_to_domain.allow_test", "untagged", "no"), resource.TestCheckResourceAttr("aci_relation_to_domain.allow_test_2", "untagged", "no"), - composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)", ">=", resource.TestCheckResourceAttr("aci_relation_to_domain.allow_test", "binding_type", "none"), resource.TestCheckResourceAttr("aci_relation_to_domain.allow_test_2", "binding_type", "none"), resource.TestCheckResourceAttr("aci_relation_to_domain.allow_test", "number_of_ports", "0"), resource.TestCheckResourceAttr("aci_relation_to_domain.allow_test_2", "number_of_ports", "0"), resource.TestCheckResourceAttr("aci_relation_to_domain.allow_test", "port_allocation", "none"), resource.TestCheckResourceAttr("aci_relation_to_domain.allow_test_2", "port_allocation", "none")), - composeAggregateTestCheckFuncWithVersion(t, "4.2(3j)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.2(3j)", ">=", resource.TestCheckResourceAttr("aci_relation_to_domain.allow_test", "custom_epg_name", ""), resource.TestCheckResourceAttr("aci_relation_to_domain.allow_test_2", "custom_epg_name", "")), ), @@ -132,14 +132,14 @@ func TestAccResourceFvRsDomAttWithFvAEPg(t *testing.T) { resource.TestCheckResourceAttr("aci_relation_to_domain.allow_test_2", "switching_mode", "native"), resource.TestCheckResourceAttr("aci_relation_to_domain.allow_test", "untagged", "no"), resource.TestCheckResourceAttr("aci_relation_to_domain.allow_test_2", "untagged", "no"), - composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)", ">=", resource.TestCheckResourceAttr("aci_relation_to_domain.allow_test", "binding_type", "none"), resource.TestCheckResourceAttr("aci_relation_to_domain.allow_test_2", "binding_type", "none"), resource.TestCheckResourceAttr("aci_relation_to_domain.allow_test", "number_of_ports", "0"), resource.TestCheckResourceAttr("aci_relation_to_domain.allow_test_2", "number_of_ports", "0"), resource.TestCheckResourceAttr("aci_relation_to_domain.allow_test", "port_allocation", "none"), resource.TestCheckResourceAttr("aci_relation_to_domain.allow_test_2", "port_allocation", "none")), - composeAggregateTestCheckFuncWithVersion(t, "4.2(3j)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.2(3j)", ">=", resource.TestCheckResourceAttr("aci_relation_to_domain.allow_test", "custom_epg_name", ""), resource.TestCheckResourceAttr("aci_relation_to_domain.allow_test_2", "custom_epg_name", "")), ), @@ -174,11 +174,11 @@ func TestAccResourceFvRsDomAttWithFvAEPg(t *testing.T) { resource.TestCheckResourceAttr("aci_relation_to_domain.test", "secondary_encapsulation_inner", "unknown"), resource.TestCheckResourceAttr("aci_relation_to_domain.test", "switching_mode", "native"), resource.TestCheckResourceAttr("aci_relation_to_domain.test", "untagged", "no"), - composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)", ">=", resource.TestCheckResourceAttr("aci_relation_to_domain.test", "binding_type", "none"), resource.TestCheckResourceAttr("aci_relation_to_domain.test", "number_of_ports", "0"), resource.TestCheckResourceAttr("aci_relation_to_domain.test", "port_allocation", "none")), - composeAggregateTestCheckFuncWithVersion(t, "4.2(3j)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.2(3j)", ">=", resource.TestCheckResourceAttr("aci_relation_to_domain.test", "custom_epg_name", "")), ), }, @@ -205,11 +205,11 @@ func TestAccResourceFvRsDomAttWithFvAEPg(t *testing.T) { resource.TestCheckResourceAttr("aci_relation_to_domain.test", "secondary_encapsulation_inner", "vlan-400"), resource.TestCheckResourceAttr("aci_relation_to_domain.test", "switching_mode", "AVE"), resource.TestCheckResourceAttr("aci_relation_to_domain.test", "untagged", "no"), - composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)", ">=", resource.TestCheckResourceAttr("aci_relation_to_domain.test", "binding_type", "dynamicBinding"), resource.TestCheckResourceAttr("aci_relation_to_domain.test", "number_of_ports", "1"), resource.TestCheckResourceAttr("aci_relation_to_domain.test", "port_allocation", "elastic")), - composeAggregateTestCheckFuncWithVersion(t, "4.2(3j)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.2(3j)", ">=", resource.TestCheckResourceAttr("aci_relation_to_domain.test", "custom_epg_name", "custom_epg_name_1")), ), }, @@ -244,11 +244,11 @@ func TestAccResourceFvRsDomAttWithFvAEPg(t *testing.T) { resource.TestCheckResourceAttr("aci_relation_to_domain.test", "secondary_encapsulation_inner", "unknown"), resource.TestCheckResourceAttr("aci_relation_to_domain.test", "switching_mode", "native"), resource.TestCheckResourceAttr("aci_relation_to_domain.test", "untagged", "no"), - composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)", ">=", resource.TestCheckResourceAttr("aci_relation_to_domain.test", "binding_type", "none"), resource.TestCheckResourceAttr("aci_relation_to_domain.test", "number_of_ports", "0"), resource.TestCheckResourceAttr("aci_relation_to_domain.test", "port_allocation", "none")), - composeAggregateTestCheckFuncWithVersion(t, "4.2(3j)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.2(3j)", ">=", resource.TestCheckResourceAttr("aci_relation_to_domain.test", "custom_epg_name", "")), ), }, @@ -281,11 +281,11 @@ func TestAccResourceFvRsDomAttWithFvAEPg(t *testing.T) { resource.TestCheckResourceAttr("aci_relation_to_domain.test", "secondary_encapsulation_inner", "unknown"), resource.TestCheckResourceAttr("aci_relation_to_domain.test", "switching_mode", "native"), resource.TestCheckResourceAttr("aci_relation_to_domain.test", "untagged", "no"), - composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)", ">=", resource.TestCheckResourceAttr("aci_relation_to_domain.test", "binding_type", "none"), resource.TestCheckResourceAttr("aci_relation_to_domain.test", "number_of_ports", "0"), resource.TestCheckResourceAttr("aci_relation_to_domain.test", "port_allocation", "none")), - composeAggregateTestCheckFuncWithVersion(t, "4.2(3j)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.2(3j)", ">=", resource.TestCheckResourceAttr("aci_relation_to_domain.test", "custom_epg_name", "")), resource.TestCheckResourceAttr("aci_relation_to_domain.test", "annotations.0.key", "key_0"), resource.TestCheckResourceAttr("aci_relation_to_domain.test", "annotations.0.value", "value_1"), @@ -434,24 +434,24 @@ resource "aci_relation_to_domain" "test" { parent_dn = aci_application_epg.test.id target_dn = "uni/vmmp-VMware/dom-domain_1" annotations = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] tags = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] } ` diff --git a/internal/provider/resource_aci_relation_to_fibre_channel_path.go b/internal/provider/resource_aci_relation_to_fibre_channel_path.go index fc9e98fd7..48c6ea3c7 100644 --- a/internal/provider/resource_aci_relation_to_fibre_channel_path.go +++ b/internal/provider/resource_aci_relation_to_fibre_channel_path.go @@ -90,6 +90,13 @@ func getEmptyTagAnnotationFvRsFcPathAttResourceModel() TagAnnotationFvRsFcPathAt } } +var TagAnnotationFvRsFcPathAttType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // TagTagFvRsFcPathAttResourceModel describes the resource data model for the children without relation ships. type TagTagFvRsFcPathAttResourceModel struct { Key types.String `tfsdk:"key"` @@ -103,6 +110,13 @@ func getEmptyTagTagFvRsFcPathAttResourceModel() TagTagFvRsFcPathAttResourceModel } } +var TagTagFvRsFcPathAttType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + type FvRsFcPathAttIdentifier struct { TDn types.String } @@ -446,7 +460,7 @@ func (r *FvRsFcPathAttResource) ImportState(ctx context.Context, req resource.Im } func getAndSetFvRsFcPathAttAttributes(ctx context.Context, diags *diag.Diagnostics, client *client.Client, data *FvRsFcPathAttResourceModel) { - requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=children&rsp-subtree-class=%s", data.Id.ValueString(), "fvRsFcPathAtt,tagAnnotation,tagTag"), "GET", nil) + requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=full&rsp-subtree-class=%s", data.Id.ValueString(), "fvRsFcPathAtt,tagAnnotation,tagTag"), "GET", nil) readData := getEmptyFvRsFcPathAttResourceModel() @@ -495,6 +509,7 @@ func getAndSetFvRsFcPathAttAttributes(ctx context.Context, diags *diag.Diagnosti if childAttributeName == "value" { TagAnnotationFvRsFcPathAtt.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagAnnotationFvRsFcPathAttList = append(TagAnnotationFvRsFcPathAttList, TagAnnotationFvRsFcPathAtt) } @@ -507,6 +522,7 @@ func getAndSetFvRsFcPathAttAttributes(ctx context.Context, diags *diag.Diagnosti if childAttributeName == "value" { TagTagFvRsFcPathAtt.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagTagFvRsFcPathAttList = append(TagTagFvRsFcPathAttList, TagTagFvRsFcPathAtt) } @@ -554,25 +570,24 @@ func setFvRsFcPathAttId(ctx context.Context, data *FvRsFcPathAttResourceModel) { data.Id = types.StringValue(fmt.Sprintf("%s/%s", data.ParentDn.ValueString(), rn)) } -func getFvRsFcPathAttTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvRsFcPathAttResourceModel, tagAnnotationPlan, tagAnnotationState []TagAnnotationFvRsFcPathAttResourceModel) []map[string]interface{} { - +func getFvRsFcPathAttTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvRsFcPathAttResourceModel, tagAnnotationFvRsFcPathAttPlan, tagAnnotationFvRsFcPathAttState []TagAnnotationFvRsFcPathAttResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagAnnotation.IsUnknown() { + if !data.TagAnnotation.IsNull() && !data.TagAnnotation.IsUnknown() { tagAnnotationIdentifiers := []TagAnnotationIdentifier{} - for _, tagAnnotation := range tagAnnotationPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagAnnotation.Key.IsUnknown() && !tagAnnotation.Key.IsNull() { - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() + for _, tagAnnotationFvRsFcPathAtt := range tagAnnotationFvRsFcPathAttPlan { + childMap := NewAciObject() + if !tagAnnotationFvRsFcPathAtt.Key.IsNull() && !tagAnnotationFvRsFcPathAtt.Key.IsUnknown() { + childMap.Attributes["key"] = tagAnnotationFvRsFcPathAtt.Key.ValueString() } - if !tagAnnotation.Value.IsUnknown() && !tagAnnotation.Value.IsNull() { - childMap["attributes"]["value"] = tagAnnotation.Value.ValueString() + if !tagAnnotationFvRsFcPathAtt.Value.IsNull() && !tagAnnotationFvRsFcPathAtt.Value.IsUnknown() { + childMap.Attributes["value"] = tagAnnotationFvRsFcPathAtt.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) tagAnnotationIdentifier := TagAnnotationIdentifier{} - tagAnnotationIdentifier.Key = tagAnnotation.Key + tagAnnotationIdentifier.Key = tagAnnotationFvRsFcPathAtt.Key tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) } - for _, tagAnnotation := range tagAnnotationState { + for _, tagAnnotation := range tagAnnotationFvRsFcPathAttState { delete := true for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { if tagAnnotationIdentifier.Key == tagAnnotation.Key { @@ -581,10 +596,10 @@ func getFvRsFcPathAttTagAnnotationChildPayloads(ctx context.Context, diags *diag } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) + tagAnnotationChildMapForDelete := NewAciObject() + tagAnnotationChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationChildMapForDelete.Attributes["key"] = tagAnnotation.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": tagAnnotationChildMapForDelete}) } } } else { @@ -593,25 +608,25 @@ func getFvRsFcPathAttTagAnnotationChildPayloads(ctx context.Context, diags *diag return childPayloads } -func getFvRsFcPathAttTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvRsFcPathAttResourceModel, tagTagPlan, tagTagState []TagTagFvRsFcPathAttResourceModel) []map[string]interface{} { +func getFvRsFcPathAttTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvRsFcPathAttResourceModel, tagTagFvRsFcPathAttPlan, tagTagFvRsFcPathAttState []TagTagFvRsFcPathAttResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagTag.IsUnknown() { + if !data.TagTag.IsNull() && !data.TagTag.IsUnknown() { tagTagIdentifiers := []TagTagIdentifier{} - for _, tagTag := range tagTagPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagTag.Key.IsUnknown() && !tagTag.Key.IsNull() { - childMap["attributes"]["key"] = tagTag.Key.ValueString() + for _, tagTagFvRsFcPathAtt := range tagTagFvRsFcPathAttPlan { + childMap := NewAciObject() + if !tagTagFvRsFcPathAtt.Key.IsNull() && !tagTagFvRsFcPathAtt.Key.IsUnknown() { + childMap.Attributes["key"] = tagTagFvRsFcPathAtt.Key.ValueString() } - if !tagTag.Value.IsUnknown() && !tagTag.Value.IsNull() { - childMap["attributes"]["value"] = tagTag.Value.ValueString() + if !tagTagFvRsFcPathAtt.Value.IsNull() && !tagTagFvRsFcPathAtt.Value.IsUnknown() { + childMap.Attributes["value"] = tagTagFvRsFcPathAtt.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) tagTagIdentifier := TagTagIdentifier{} - tagTagIdentifier.Key = tagTag.Key + tagTagIdentifier.Key = tagTagFvRsFcPathAtt.Key tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) } - for _, tagTag := range tagTagState { + for _, tagTag := range tagTagFvRsFcPathAttState { delete := true for _, tagTagIdentifier := range tagTagIdentifiers { if tagTagIdentifier.Key == tagTag.Key { @@ -620,10 +635,10 @@ func getFvRsFcPathAttTagTagChildPayloads(ctx context.Context, diags *diag.Diagno } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagTag.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) + tagTagChildMapForDelete := NewAciObject() + tagTagChildMapForDelete.Attributes["status"] = "deleted" + tagTagChildMapForDelete.Attributes["key"] = tagTag.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagTag": tagTagChildMapForDelete}) } } } else { diff --git a/internal/provider/resource_aci_relation_to_fibre_channel_path_test.go b/internal/provider/resource_aci_relation_to_fibre_channel_path_test.go index ac672d70f..730d7e07b 100644 --- a/internal/provider/resource_aci_relation_to_fibre_channel_path_test.go +++ b/internal/provider/resource_aci_relation_to_fibre_channel_path_test.go @@ -252,24 +252,24 @@ resource "aci_relation_to_fibre_channel_path" "test" { parent_dn = aci_application_epg.test.id target_dn = "topology/pod-1/paths-101/pathep-[eth1/1]" annotations = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] tags = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] } ` diff --git a/internal/provider/resource_aci_relation_to_imported_contract.go b/internal/provider/resource_aci_relation_to_imported_contract.go index a4850f2d1..4eac1a5c8 100644 --- a/internal/provider/resource_aci_relation_to_imported_contract.go +++ b/internal/provider/resource_aci_relation_to_imported_contract.go @@ -88,6 +88,13 @@ func getEmptyTagAnnotationFvRsConsIfResourceModel() TagAnnotationFvRsConsIfResou } } +var TagAnnotationFvRsConsIfType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // TagTagFvRsConsIfResourceModel describes the resource data model for the children without relation ships. type TagTagFvRsConsIfResourceModel struct { Key types.String `tfsdk:"key"` @@ -101,6 +108,13 @@ func getEmptyTagTagFvRsConsIfResourceModel() TagTagFvRsConsIfResourceModel { } } +var TagTagFvRsConsIfType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + type FvRsConsIfIdentifier struct { TnVzCPIfName types.String } @@ -430,7 +444,7 @@ func (r *FvRsConsIfResource) ImportState(ctx context.Context, req resource.Impor } func getAndSetFvRsConsIfAttributes(ctx context.Context, diags *diag.Diagnostics, client *client.Client, data *FvRsConsIfResourceModel) { - requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=children&rsp-subtree-class=%s", data.Id.ValueString(), "fvRsConsIf,tagAnnotation,tagTag"), "GET", nil) + requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=full&rsp-subtree-class=%s", data.Id.ValueString(), "fvRsConsIf,tagAnnotation,tagTag"), "GET", nil) readData := getEmptyFvRsConsIfResourceModel() @@ -473,6 +487,7 @@ func getAndSetFvRsConsIfAttributes(ctx context.Context, diags *diag.Diagnostics, if childAttributeName == "value" { TagAnnotationFvRsConsIf.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagAnnotationFvRsConsIfList = append(TagAnnotationFvRsConsIfList, TagAnnotationFvRsConsIf) } @@ -485,6 +500,7 @@ func getAndSetFvRsConsIfAttributes(ctx context.Context, diags *diag.Diagnostics, if childAttributeName == "value" { TagTagFvRsConsIf.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagTagFvRsConsIfList = append(TagTagFvRsConsIfList, TagTagFvRsConsIf) } @@ -532,25 +548,24 @@ func setFvRsConsIfId(ctx context.Context, data *FvRsConsIfResourceModel) { data.Id = types.StringValue(fmt.Sprintf("%s/%s", data.ParentDn.ValueString(), rn)) } -func getFvRsConsIfTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvRsConsIfResourceModel, tagAnnotationPlan, tagAnnotationState []TagAnnotationFvRsConsIfResourceModel) []map[string]interface{} { - +func getFvRsConsIfTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvRsConsIfResourceModel, tagAnnotationFvRsConsIfPlan, tagAnnotationFvRsConsIfState []TagAnnotationFvRsConsIfResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagAnnotation.IsUnknown() { + if !data.TagAnnotation.IsNull() && !data.TagAnnotation.IsUnknown() { tagAnnotationIdentifiers := []TagAnnotationIdentifier{} - for _, tagAnnotation := range tagAnnotationPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagAnnotation.Key.IsUnknown() && !tagAnnotation.Key.IsNull() { - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() + for _, tagAnnotationFvRsConsIf := range tagAnnotationFvRsConsIfPlan { + childMap := NewAciObject() + if !tagAnnotationFvRsConsIf.Key.IsNull() && !tagAnnotationFvRsConsIf.Key.IsUnknown() { + childMap.Attributes["key"] = tagAnnotationFvRsConsIf.Key.ValueString() } - if !tagAnnotation.Value.IsUnknown() && !tagAnnotation.Value.IsNull() { - childMap["attributes"]["value"] = tagAnnotation.Value.ValueString() + if !tagAnnotationFvRsConsIf.Value.IsNull() && !tagAnnotationFvRsConsIf.Value.IsUnknown() { + childMap.Attributes["value"] = tagAnnotationFvRsConsIf.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) tagAnnotationIdentifier := TagAnnotationIdentifier{} - tagAnnotationIdentifier.Key = tagAnnotation.Key + tagAnnotationIdentifier.Key = tagAnnotationFvRsConsIf.Key tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) } - for _, tagAnnotation := range tagAnnotationState { + for _, tagAnnotation := range tagAnnotationFvRsConsIfState { delete := true for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { if tagAnnotationIdentifier.Key == tagAnnotation.Key { @@ -559,10 +574,10 @@ func getFvRsConsIfTagAnnotationChildPayloads(ctx context.Context, diags *diag.Di } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) + tagAnnotationChildMapForDelete := NewAciObject() + tagAnnotationChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationChildMapForDelete.Attributes["key"] = tagAnnotation.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": tagAnnotationChildMapForDelete}) } } } else { @@ -571,25 +586,25 @@ func getFvRsConsIfTagAnnotationChildPayloads(ctx context.Context, diags *diag.Di return childPayloads } -func getFvRsConsIfTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvRsConsIfResourceModel, tagTagPlan, tagTagState []TagTagFvRsConsIfResourceModel) []map[string]interface{} { +func getFvRsConsIfTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvRsConsIfResourceModel, tagTagFvRsConsIfPlan, tagTagFvRsConsIfState []TagTagFvRsConsIfResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagTag.IsUnknown() { + if !data.TagTag.IsNull() && !data.TagTag.IsUnknown() { tagTagIdentifiers := []TagTagIdentifier{} - for _, tagTag := range tagTagPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagTag.Key.IsUnknown() && !tagTag.Key.IsNull() { - childMap["attributes"]["key"] = tagTag.Key.ValueString() + for _, tagTagFvRsConsIf := range tagTagFvRsConsIfPlan { + childMap := NewAciObject() + if !tagTagFvRsConsIf.Key.IsNull() && !tagTagFvRsConsIf.Key.IsUnknown() { + childMap.Attributes["key"] = tagTagFvRsConsIf.Key.ValueString() } - if !tagTag.Value.IsUnknown() && !tagTag.Value.IsNull() { - childMap["attributes"]["value"] = tagTag.Value.ValueString() + if !tagTagFvRsConsIf.Value.IsNull() && !tagTagFvRsConsIf.Value.IsUnknown() { + childMap.Attributes["value"] = tagTagFvRsConsIf.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) tagTagIdentifier := TagTagIdentifier{} - tagTagIdentifier.Key = tagTag.Key + tagTagIdentifier.Key = tagTagFvRsConsIf.Key tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) } - for _, tagTag := range tagTagState { + for _, tagTag := range tagTagFvRsConsIfState { delete := true for _, tagTagIdentifier := range tagTagIdentifiers { if tagTagIdentifier.Key == tagTag.Key { @@ -598,10 +613,10 @@ func getFvRsConsIfTagTagChildPayloads(ctx context.Context, diags *diag.Diagnosti } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagTag.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) + tagTagChildMapForDelete := NewAciObject() + tagTagChildMapForDelete.Attributes["status"] = "deleted" + tagTagChildMapForDelete.Attributes["key"] = tagTag.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagTag": tagTagChildMapForDelete}) } } } else { diff --git a/internal/provider/resource_aci_relation_to_imported_contract_test.go b/internal/provider/resource_aci_relation_to_imported_contract_test.go index 820dc6034..c3d6cf21d 100644 --- a/internal/provider/resource_aci_relation_to_imported_contract_test.go +++ b/internal/provider/resource_aci_relation_to_imported_contract_test.go @@ -423,24 +423,24 @@ resource "aci_relation_to_imported_contract" "test" { parent_dn = aci_application_epg.test.id imported_contract_name = "test_tn_vz_cp_if_name" annotations = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] tags = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] } ` @@ -529,24 +529,24 @@ resource "aci_relation_to_imported_contract" "test" { parent_dn = aci_endpoint_security_group.test.id imported_contract_name = "test_tn_vz_cp_if_name" annotations = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] tags = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] } ` diff --git a/internal/provider/resource_aci_relation_to_intra_epg_contract.go b/internal/provider/resource_aci_relation_to_intra_epg_contract.go index 5981deacb..486c3fbf6 100644 --- a/internal/provider/resource_aci_relation_to_intra_epg_contract.go +++ b/internal/provider/resource_aci_relation_to_intra_epg_contract.go @@ -82,6 +82,13 @@ func getEmptyTagAnnotationFvRsIntraEpgResourceModel() TagAnnotationFvRsIntraEpgR } } +var TagAnnotationFvRsIntraEpgType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // TagTagFvRsIntraEpgResourceModel describes the resource data model for the children without relation ships. type TagTagFvRsIntraEpgResourceModel struct { Key types.String `tfsdk:"key"` @@ -95,6 +102,13 @@ func getEmptyTagTagFvRsIntraEpgResourceModel() TagTagFvRsIntraEpgResourceModel { } } +var TagTagFvRsIntraEpgType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + type FvRsIntraEpgIdentifier struct { TnVzBrCPName types.String } @@ -408,7 +422,7 @@ func (r *FvRsIntraEpgResource) ImportState(ctx context.Context, req resource.Imp } func getAndSetFvRsIntraEpgAttributes(ctx context.Context, diags *diag.Diagnostics, client *client.Client, data *FvRsIntraEpgResourceModel) { - requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=children&rsp-subtree-class=%s", data.Id.ValueString(), "fvRsIntraEpg,tagAnnotation,tagTag"), "GET", nil) + requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=full&rsp-subtree-class=%s", data.Id.ValueString(), "fvRsIntraEpg,tagAnnotation,tagTag"), "GET", nil) readData := getEmptyFvRsIntraEpgResourceModel() @@ -448,6 +462,7 @@ func getAndSetFvRsIntraEpgAttributes(ctx context.Context, diags *diag.Diagnostic if childAttributeName == "value" { TagAnnotationFvRsIntraEpg.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagAnnotationFvRsIntraEpgList = append(TagAnnotationFvRsIntraEpgList, TagAnnotationFvRsIntraEpg) } @@ -460,6 +475,7 @@ func getAndSetFvRsIntraEpgAttributes(ctx context.Context, diags *diag.Diagnostic if childAttributeName == "value" { TagTagFvRsIntraEpg.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagTagFvRsIntraEpgList = append(TagTagFvRsIntraEpgList, TagTagFvRsIntraEpg) } @@ -507,25 +523,24 @@ func setFvRsIntraEpgId(ctx context.Context, data *FvRsIntraEpgResourceModel) { data.Id = types.StringValue(fmt.Sprintf("%s/%s", data.ParentDn.ValueString(), rn)) } -func getFvRsIntraEpgTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvRsIntraEpgResourceModel, tagAnnotationPlan, tagAnnotationState []TagAnnotationFvRsIntraEpgResourceModel) []map[string]interface{} { - +func getFvRsIntraEpgTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvRsIntraEpgResourceModel, tagAnnotationFvRsIntraEpgPlan, tagAnnotationFvRsIntraEpgState []TagAnnotationFvRsIntraEpgResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagAnnotation.IsUnknown() { + if !data.TagAnnotation.IsNull() && !data.TagAnnotation.IsUnknown() { tagAnnotationIdentifiers := []TagAnnotationIdentifier{} - for _, tagAnnotation := range tagAnnotationPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagAnnotation.Key.IsUnknown() && !tagAnnotation.Key.IsNull() { - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() + for _, tagAnnotationFvRsIntraEpg := range tagAnnotationFvRsIntraEpgPlan { + childMap := NewAciObject() + if !tagAnnotationFvRsIntraEpg.Key.IsNull() && !tagAnnotationFvRsIntraEpg.Key.IsUnknown() { + childMap.Attributes["key"] = tagAnnotationFvRsIntraEpg.Key.ValueString() } - if !tagAnnotation.Value.IsUnknown() && !tagAnnotation.Value.IsNull() { - childMap["attributes"]["value"] = tagAnnotation.Value.ValueString() + if !tagAnnotationFvRsIntraEpg.Value.IsNull() && !tagAnnotationFvRsIntraEpg.Value.IsUnknown() { + childMap.Attributes["value"] = tagAnnotationFvRsIntraEpg.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) tagAnnotationIdentifier := TagAnnotationIdentifier{} - tagAnnotationIdentifier.Key = tagAnnotation.Key + tagAnnotationIdentifier.Key = tagAnnotationFvRsIntraEpg.Key tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) } - for _, tagAnnotation := range tagAnnotationState { + for _, tagAnnotation := range tagAnnotationFvRsIntraEpgState { delete := true for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { if tagAnnotationIdentifier.Key == tagAnnotation.Key { @@ -534,10 +549,10 @@ func getFvRsIntraEpgTagAnnotationChildPayloads(ctx context.Context, diags *diag. } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) + tagAnnotationChildMapForDelete := NewAciObject() + tagAnnotationChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationChildMapForDelete.Attributes["key"] = tagAnnotation.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": tagAnnotationChildMapForDelete}) } } } else { @@ -546,25 +561,25 @@ func getFvRsIntraEpgTagAnnotationChildPayloads(ctx context.Context, diags *diag. return childPayloads } -func getFvRsIntraEpgTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvRsIntraEpgResourceModel, tagTagPlan, tagTagState []TagTagFvRsIntraEpgResourceModel) []map[string]interface{} { +func getFvRsIntraEpgTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvRsIntraEpgResourceModel, tagTagFvRsIntraEpgPlan, tagTagFvRsIntraEpgState []TagTagFvRsIntraEpgResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagTag.IsUnknown() { + if !data.TagTag.IsNull() && !data.TagTag.IsUnknown() { tagTagIdentifiers := []TagTagIdentifier{} - for _, tagTag := range tagTagPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagTag.Key.IsUnknown() && !tagTag.Key.IsNull() { - childMap["attributes"]["key"] = tagTag.Key.ValueString() + for _, tagTagFvRsIntraEpg := range tagTagFvRsIntraEpgPlan { + childMap := NewAciObject() + if !tagTagFvRsIntraEpg.Key.IsNull() && !tagTagFvRsIntraEpg.Key.IsUnknown() { + childMap.Attributes["key"] = tagTagFvRsIntraEpg.Key.ValueString() } - if !tagTag.Value.IsUnknown() && !tagTag.Value.IsNull() { - childMap["attributes"]["value"] = tagTag.Value.ValueString() + if !tagTagFvRsIntraEpg.Value.IsNull() && !tagTagFvRsIntraEpg.Value.IsUnknown() { + childMap.Attributes["value"] = tagTagFvRsIntraEpg.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) tagTagIdentifier := TagTagIdentifier{} - tagTagIdentifier.Key = tagTag.Key + tagTagIdentifier.Key = tagTagFvRsIntraEpg.Key tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) } - for _, tagTag := range tagTagState { + for _, tagTag := range tagTagFvRsIntraEpgState { delete := true for _, tagTagIdentifier := range tagTagIdentifiers { if tagTagIdentifier.Key == tagTag.Key { @@ -573,10 +588,10 @@ func getFvRsIntraEpgTagTagChildPayloads(ctx context.Context, diags *diag.Diagnos } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagTag.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) + tagTagChildMapForDelete := NewAciObject() + tagTagChildMapForDelete.Attributes["status"] = "deleted" + tagTagChildMapForDelete.Attributes["key"] = tagTag.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagTag": tagTagChildMapForDelete}) } } } else { diff --git a/internal/provider/resource_aci_relation_to_intra_epg_contract_test.go b/internal/provider/resource_aci_relation_to_intra_epg_contract_test.go index 8a6101215..2937f2966 100644 --- a/internal/provider/resource_aci_relation_to_intra_epg_contract_test.go +++ b/internal/provider/resource_aci_relation_to_intra_epg_contract_test.go @@ -387,24 +387,24 @@ resource "aci_relation_to_intra_epg_contract" "test" { parent_dn = aci_application_epg.test.id contract_name = "test_tn_vz_br_cp_name" annotations = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] tags = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] } ` @@ -483,24 +483,24 @@ resource "aci_relation_to_intra_epg_contract" "test" { parent_dn = aci_endpoint_security_group.test.id contract_name = "test_tn_vz_br_cp_name" annotations = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] tags = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] } ` diff --git a/internal/provider/resource_aci_relation_to_netflow_exporter.go b/internal/provider/resource_aci_relation_to_netflow_exporter.go index 6637d4b53..01f4c984c 100644 --- a/internal/provider/resource_aci_relation_to_netflow_exporter.go +++ b/internal/provider/resource_aci_relation_to_netflow_exporter.go @@ -82,6 +82,13 @@ func getEmptyTagAnnotationNetflowRsMonitorToExporterResourceModel() TagAnnotatio } } +var TagAnnotationNetflowRsMonitorToExporterType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // TagTagNetflowRsMonitorToExporterResourceModel describes the resource data model for the children without relation ships. type TagTagNetflowRsMonitorToExporterResourceModel struct { Key types.String `tfsdk:"key"` @@ -95,6 +102,13 @@ func getEmptyTagTagNetflowRsMonitorToExporterResourceModel() TagTagNetflowRsMoni } } +var TagTagNetflowRsMonitorToExporterType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + type NetflowRsMonitorToExporterIdentifier struct { TnNetflowExporterPolName types.String } @@ -408,7 +422,7 @@ func (r *NetflowRsMonitorToExporterResource) ImportState(ctx context.Context, re } func getAndSetNetflowRsMonitorToExporterAttributes(ctx context.Context, diags *diag.Diagnostics, client *client.Client, data *NetflowRsMonitorToExporterResourceModel) { - requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=children&rsp-subtree-class=%s", data.Id.ValueString(), "netflowRsMonitorToExporter,tagAnnotation,tagTag"), "GET", nil) + requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=full&rsp-subtree-class=%s", data.Id.ValueString(), "netflowRsMonitorToExporter,tagAnnotation,tagTag"), "GET", nil) readData := getEmptyNetflowRsMonitorToExporterResourceModel() @@ -448,6 +462,7 @@ func getAndSetNetflowRsMonitorToExporterAttributes(ctx context.Context, diags *d if childAttributeName == "value" { TagAnnotationNetflowRsMonitorToExporter.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagAnnotationNetflowRsMonitorToExporterList = append(TagAnnotationNetflowRsMonitorToExporterList, TagAnnotationNetflowRsMonitorToExporter) } @@ -460,6 +475,7 @@ func getAndSetNetflowRsMonitorToExporterAttributes(ctx context.Context, diags *d if childAttributeName == "value" { TagTagNetflowRsMonitorToExporter.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagTagNetflowRsMonitorToExporterList = append(TagTagNetflowRsMonitorToExporterList, TagTagNetflowRsMonitorToExporter) } @@ -507,25 +523,24 @@ func setNetflowRsMonitorToExporterId(ctx context.Context, data *NetflowRsMonitor data.Id = types.StringValue(fmt.Sprintf("%s/%s", data.ParentDn.ValueString(), rn)) } -func getNetflowRsMonitorToExporterTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *NetflowRsMonitorToExporterResourceModel, tagAnnotationPlan, tagAnnotationState []TagAnnotationNetflowRsMonitorToExporterResourceModel) []map[string]interface{} { - +func getNetflowRsMonitorToExporterTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *NetflowRsMonitorToExporterResourceModel, tagAnnotationNetflowRsMonitorToExporterPlan, tagAnnotationNetflowRsMonitorToExporterState []TagAnnotationNetflowRsMonitorToExporterResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagAnnotation.IsUnknown() { + if !data.TagAnnotation.IsNull() && !data.TagAnnotation.IsUnknown() { tagAnnotationIdentifiers := []TagAnnotationIdentifier{} - for _, tagAnnotation := range tagAnnotationPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagAnnotation.Key.IsUnknown() && !tagAnnotation.Key.IsNull() { - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() + for _, tagAnnotationNetflowRsMonitorToExporter := range tagAnnotationNetflowRsMonitorToExporterPlan { + childMap := NewAciObject() + if !tagAnnotationNetflowRsMonitorToExporter.Key.IsNull() && !tagAnnotationNetflowRsMonitorToExporter.Key.IsUnknown() { + childMap.Attributes["key"] = tagAnnotationNetflowRsMonitorToExporter.Key.ValueString() } - if !tagAnnotation.Value.IsUnknown() && !tagAnnotation.Value.IsNull() { - childMap["attributes"]["value"] = tagAnnotation.Value.ValueString() + if !tagAnnotationNetflowRsMonitorToExporter.Value.IsNull() && !tagAnnotationNetflowRsMonitorToExporter.Value.IsUnknown() { + childMap.Attributes["value"] = tagAnnotationNetflowRsMonitorToExporter.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) tagAnnotationIdentifier := TagAnnotationIdentifier{} - tagAnnotationIdentifier.Key = tagAnnotation.Key + tagAnnotationIdentifier.Key = tagAnnotationNetflowRsMonitorToExporter.Key tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) } - for _, tagAnnotation := range tagAnnotationState { + for _, tagAnnotation := range tagAnnotationNetflowRsMonitorToExporterState { delete := true for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { if tagAnnotationIdentifier.Key == tagAnnotation.Key { @@ -534,10 +549,10 @@ func getNetflowRsMonitorToExporterTagAnnotationChildPayloads(ctx context.Context } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) + tagAnnotationChildMapForDelete := NewAciObject() + tagAnnotationChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationChildMapForDelete.Attributes["key"] = tagAnnotation.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": tagAnnotationChildMapForDelete}) } } } else { @@ -546,25 +561,25 @@ func getNetflowRsMonitorToExporterTagAnnotationChildPayloads(ctx context.Context return childPayloads } -func getNetflowRsMonitorToExporterTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *NetflowRsMonitorToExporterResourceModel, tagTagPlan, tagTagState []TagTagNetflowRsMonitorToExporterResourceModel) []map[string]interface{} { +func getNetflowRsMonitorToExporterTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *NetflowRsMonitorToExporterResourceModel, tagTagNetflowRsMonitorToExporterPlan, tagTagNetflowRsMonitorToExporterState []TagTagNetflowRsMonitorToExporterResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagTag.IsUnknown() { + if !data.TagTag.IsNull() && !data.TagTag.IsUnknown() { tagTagIdentifiers := []TagTagIdentifier{} - for _, tagTag := range tagTagPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagTag.Key.IsUnknown() && !tagTag.Key.IsNull() { - childMap["attributes"]["key"] = tagTag.Key.ValueString() + for _, tagTagNetflowRsMonitorToExporter := range tagTagNetflowRsMonitorToExporterPlan { + childMap := NewAciObject() + if !tagTagNetflowRsMonitorToExporter.Key.IsNull() && !tagTagNetflowRsMonitorToExporter.Key.IsUnknown() { + childMap.Attributes["key"] = tagTagNetflowRsMonitorToExporter.Key.ValueString() } - if !tagTag.Value.IsUnknown() && !tagTag.Value.IsNull() { - childMap["attributes"]["value"] = tagTag.Value.ValueString() + if !tagTagNetflowRsMonitorToExporter.Value.IsNull() && !tagTagNetflowRsMonitorToExporter.Value.IsUnknown() { + childMap.Attributes["value"] = tagTagNetflowRsMonitorToExporter.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) tagTagIdentifier := TagTagIdentifier{} - tagTagIdentifier.Key = tagTag.Key + tagTagIdentifier.Key = tagTagNetflowRsMonitorToExporter.Key tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) } - for _, tagTag := range tagTagState { + for _, tagTag := range tagTagNetflowRsMonitorToExporterState { delete := true for _, tagTagIdentifier := range tagTagIdentifiers { if tagTagIdentifier.Key == tagTag.Key { @@ -573,10 +588,10 @@ func getNetflowRsMonitorToExporterTagTagChildPayloads(ctx context.Context, diags } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagTag.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) + tagTagChildMapForDelete := NewAciObject() + tagTagChildMapForDelete.Attributes["status"] = "deleted" + tagTagChildMapForDelete.Attributes["key"] = tagTag.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagTag": tagTagChildMapForDelete}) } } } else { diff --git a/internal/provider/resource_aci_relation_to_netflow_exporter_test.go b/internal/provider/resource_aci_relation_to_netflow_exporter_test.go index 1f8ddd698..df084e254 100644 --- a/internal/provider/resource_aci_relation_to_netflow_exporter_test.go +++ b/internal/provider/resource_aci_relation_to_netflow_exporter_test.go @@ -219,24 +219,24 @@ resource "aci_relation_to_netflow_exporter" "test" { parent_dn = aci_netflow_monitor_policy.test.id netflow_exporter_policy_name = "test_tn_netflow_exporter_pol_name" annotations = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] tags = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] } ` diff --git a/internal/provider/resource_aci_relation_to_provided_contract.go b/internal/provider/resource_aci_relation_to_provided_contract.go index 6d78a606a..e8e44ec37 100644 --- a/internal/provider/resource_aci_relation_to_provided_contract.go +++ b/internal/provider/resource_aci_relation_to_provided_contract.go @@ -90,6 +90,13 @@ func getEmptyTagAnnotationFvRsProvResourceModel() TagAnnotationFvRsProvResourceM } } +var TagAnnotationFvRsProvType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // TagTagFvRsProvResourceModel describes the resource data model for the children without relation ships. type TagTagFvRsProvResourceModel struct { Key types.String `tfsdk:"key"` @@ -103,6 +110,13 @@ func getEmptyTagTagFvRsProvResourceModel() TagTagFvRsProvResourceModel { } } +var TagTagFvRsProvType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + type FvRsProvIdentifier struct { TnVzBrCPName types.String } @@ -444,7 +458,7 @@ func (r *FvRsProvResource) ImportState(ctx context.Context, req resource.ImportS } func getAndSetFvRsProvAttributes(ctx context.Context, diags *diag.Diagnostics, client *client.Client, data *FvRsProvResourceModel) { - requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=children&rsp-subtree-class=%s", data.Id.ValueString(), "fvRsProv,tagAnnotation,tagTag"), "GET", nil) + requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=full&rsp-subtree-class=%s", data.Id.ValueString(), "fvRsProv,tagAnnotation,tagTag"), "GET", nil) readData := getEmptyFvRsProvResourceModel() @@ -490,6 +504,7 @@ func getAndSetFvRsProvAttributes(ctx context.Context, diags *diag.Diagnostics, c if childAttributeName == "value" { TagAnnotationFvRsProv.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagAnnotationFvRsProvList = append(TagAnnotationFvRsProvList, TagAnnotationFvRsProv) } @@ -502,6 +517,7 @@ func getAndSetFvRsProvAttributes(ctx context.Context, diags *diag.Diagnostics, c if childAttributeName == "value" { TagTagFvRsProv.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagTagFvRsProvList = append(TagTagFvRsProvList, TagTagFvRsProv) } @@ -549,25 +565,24 @@ func setFvRsProvId(ctx context.Context, data *FvRsProvResourceModel) { data.Id = types.StringValue(fmt.Sprintf("%s/%s", data.ParentDn.ValueString(), rn)) } -func getFvRsProvTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvRsProvResourceModel, tagAnnotationPlan, tagAnnotationState []TagAnnotationFvRsProvResourceModel) []map[string]interface{} { - +func getFvRsProvTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvRsProvResourceModel, tagAnnotationFvRsProvPlan, tagAnnotationFvRsProvState []TagAnnotationFvRsProvResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagAnnotation.IsUnknown() { + if !data.TagAnnotation.IsNull() && !data.TagAnnotation.IsUnknown() { tagAnnotationIdentifiers := []TagAnnotationIdentifier{} - for _, tagAnnotation := range tagAnnotationPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagAnnotation.Key.IsUnknown() && !tagAnnotation.Key.IsNull() { - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() + for _, tagAnnotationFvRsProv := range tagAnnotationFvRsProvPlan { + childMap := NewAciObject() + if !tagAnnotationFvRsProv.Key.IsNull() && !tagAnnotationFvRsProv.Key.IsUnknown() { + childMap.Attributes["key"] = tagAnnotationFvRsProv.Key.ValueString() } - if !tagAnnotation.Value.IsUnknown() && !tagAnnotation.Value.IsNull() { - childMap["attributes"]["value"] = tagAnnotation.Value.ValueString() + if !tagAnnotationFvRsProv.Value.IsNull() && !tagAnnotationFvRsProv.Value.IsUnknown() { + childMap.Attributes["value"] = tagAnnotationFvRsProv.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) tagAnnotationIdentifier := TagAnnotationIdentifier{} - tagAnnotationIdentifier.Key = tagAnnotation.Key + tagAnnotationIdentifier.Key = tagAnnotationFvRsProv.Key tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) } - for _, tagAnnotation := range tagAnnotationState { + for _, tagAnnotation := range tagAnnotationFvRsProvState { delete := true for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { if tagAnnotationIdentifier.Key == tagAnnotation.Key { @@ -576,10 +591,10 @@ func getFvRsProvTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diag } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) + tagAnnotationChildMapForDelete := NewAciObject() + tagAnnotationChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationChildMapForDelete.Attributes["key"] = tagAnnotation.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": tagAnnotationChildMapForDelete}) } } } else { @@ -588,25 +603,25 @@ func getFvRsProvTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diag return childPayloads } -func getFvRsProvTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvRsProvResourceModel, tagTagPlan, tagTagState []TagTagFvRsProvResourceModel) []map[string]interface{} { +func getFvRsProvTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvRsProvResourceModel, tagTagFvRsProvPlan, tagTagFvRsProvState []TagTagFvRsProvResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagTag.IsUnknown() { + if !data.TagTag.IsNull() && !data.TagTag.IsUnknown() { tagTagIdentifiers := []TagTagIdentifier{} - for _, tagTag := range tagTagPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagTag.Key.IsUnknown() && !tagTag.Key.IsNull() { - childMap["attributes"]["key"] = tagTag.Key.ValueString() + for _, tagTagFvRsProv := range tagTagFvRsProvPlan { + childMap := NewAciObject() + if !tagTagFvRsProv.Key.IsNull() && !tagTagFvRsProv.Key.IsUnknown() { + childMap.Attributes["key"] = tagTagFvRsProv.Key.ValueString() } - if !tagTag.Value.IsUnknown() && !tagTag.Value.IsNull() { - childMap["attributes"]["value"] = tagTag.Value.ValueString() + if !tagTagFvRsProv.Value.IsNull() && !tagTagFvRsProv.Value.IsUnknown() { + childMap.Attributes["value"] = tagTagFvRsProv.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) tagTagIdentifier := TagTagIdentifier{} - tagTagIdentifier.Key = tagTag.Key + tagTagIdentifier.Key = tagTagFvRsProv.Key tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) } - for _, tagTag := range tagTagState { + for _, tagTag := range tagTagFvRsProvState { delete := true for _, tagTagIdentifier := range tagTagIdentifiers { if tagTagIdentifier.Key == tagTag.Key { @@ -615,10 +630,10 @@ func getFvRsProvTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagTag.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) + tagTagChildMapForDelete := NewAciObject() + tagTagChildMapForDelete.Attributes["status"] = "deleted" + tagTagChildMapForDelete.Attributes["key"] = tagTag.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagTag": tagTagChildMapForDelete}) } } } else { diff --git a/internal/provider/resource_aci_relation_to_provided_contract_test.go b/internal/provider/resource_aci_relation_to_provided_contract_test.go index a03973db5..8d38c3a72 100644 --- a/internal/provider/resource_aci_relation_to_provided_contract_test.go +++ b/internal/provider/resource_aci_relation_to_provided_contract_test.go @@ -441,24 +441,24 @@ resource "aci_relation_to_provided_contract" "test" { parent_dn = aci_application_epg.test.id contract_name = "test_tn_vz_br_cp_name" annotations = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] tags = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] } ` @@ -549,24 +549,24 @@ resource "aci_relation_to_provided_contract" "test" { parent_dn = aci_endpoint_security_group.test.id contract_name = "test_tn_vz_br_cp_name" annotations = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] tags = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] } ` diff --git a/internal/provider/resource_aci_relation_to_static_leaf.go b/internal/provider/resource_aci_relation_to_static_leaf.go index e2b0fde5b..7cb074d01 100644 --- a/internal/provider/resource_aci_relation_to_static_leaf.go +++ b/internal/provider/resource_aci_relation_to_static_leaf.go @@ -92,6 +92,13 @@ func getEmptyTagAnnotationFvRsNodeAttResourceModel() TagAnnotationFvRsNodeAttRes } } +var TagAnnotationFvRsNodeAttType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // TagTagFvRsNodeAttResourceModel describes the resource data model for the children without relation ships. type TagTagFvRsNodeAttResourceModel struct { Key types.String `tfsdk:"key"` @@ -105,6 +112,13 @@ func getEmptyTagTagFvRsNodeAttResourceModel() TagTagFvRsNodeAttResourceModel { } } +var TagTagFvRsNodeAttType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + type FvRsNodeAttIdentifier struct { TDn types.String } @@ -459,7 +473,7 @@ func (r *FvRsNodeAttResource) ImportState(ctx context.Context, req resource.Impo } func getAndSetFvRsNodeAttAttributes(ctx context.Context, diags *diag.Diagnostics, client *client.Client, data *FvRsNodeAttResourceModel) { - requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=children&rsp-subtree-class=%s", data.Id.ValueString(), "fvRsNodeAtt,tagAnnotation,tagTag"), "GET", nil) + requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=full&rsp-subtree-class=%s", data.Id.ValueString(), "fvRsNodeAtt,tagAnnotation,tagTag"), "GET", nil) readData := getEmptyFvRsNodeAttResourceModel() @@ -511,6 +525,7 @@ func getAndSetFvRsNodeAttAttributes(ctx context.Context, diags *diag.Diagnostics if childAttributeName == "value" { TagAnnotationFvRsNodeAtt.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagAnnotationFvRsNodeAttList = append(TagAnnotationFvRsNodeAttList, TagAnnotationFvRsNodeAtt) } @@ -523,6 +538,7 @@ func getAndSetFvRsNodeAttAttributes(ctx context.Context, diags *diag.Diagnostics if childAttributeName == "value" { TagTagFvRsNodeAtt.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagTagFvRsNodeAttList = append(TagTagFvRsNodeAttList, TagTagFvRsNodeAtt) } @@ -570,25 +586,24 @@ func setFvRsNodeAttId(ctx context.Context, data *FvRsNodeAttResourceModel) { data.Id = types.StringValue(fmt.Sprintf("%s/%s", data.ParentDn.ValueString(), rn)) } -func getFvRsNodeAttTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvRsNodeAttResourceModel, tagAnnotationPlan, tagAnnotationState []TagAnnotationFvRsNodeAttResourceModel) []map[string]interface{} { - +func getFvRsNodeAttTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvRsNodeAttResourceModel, tagAnnotationFvRsNodeAttPlan, tagAnnotationFvRsNodeAttState []TagAnnotationFvRsNodeAttResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagAnnotation.IsUnknown() { + if !data.TagAnnotation.IsNull() && !data.TagAnnotation.IsUnknown() { tagAnnotationIdentifiers := []TagAnnotationIdentifier{} - for _, tagAnnotation := range tagAnnotationPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagAnnotation.Key.IsUnknown() && !tagAnnotation.Key.IsNull() { - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() + for _, tagAnnotationFvRsNodeAtt := range tagAnnotationFvRsNodeAttPlan { + childMap := NewAciObject() + if !tagAnnotationFvRsNodeAtt.Key.IsNull() && !tagAnnotationFvRsNodeAtt.Key.IsUnknown() { + childMap.Attributes["key"] = tagAnnotationFvRsNodeAtt.Key.ValueString() } - if !tagAnnotation.Value.IsUnknown() && !tagAnnotation.Value.IsNull() { - childMap["attributes"]["value"] = tagAnnotation.Value.ValueString() + if !tagAnnotationFvRsNodeAtt.Value.IsNull() && !tagAnnotationFvRsNodeAtt.Value.IsUnknown() { + childMap.Attributes["value"] = tagAnnotationFvRsNodeAtt.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) tagAnnotationIdentifier := TagAnnotationIdentifier{} - tagAnnotationIdentifier.Key = tagAnnotation.Key + tagAnnotationIdentifier.Key = tagAnnotationFvRsNodeAtt.Key tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) } - for _, tagAnnotation := range tagAnnotationState { + for _, tagAnnotation := range tagAnnotationFvRsNodeAttState { delete := true for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { if tagAnnotationIdentifier.Key == tagAnnotation.Key { @@ -597,10 +612,10 @@ func getFvRsNodeAttTagAnnotationChildPayloads(ctx context.Context, diags *diag.D } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) + tagAnnotationChildMapForDelete := NewAciObject() + tagAnnotationChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationChildMapForDelete.Attributes["key"] = tagAnnotation.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": tagAnnotationChildMapForDelete}) } } } else { @@ -609,25 +624,25 @@ func getFvRsNodeAttTagAnnotationChildPayloads(ctx context.Context, diags *diag.D return childPayloads } -func getFvRsNodeAttTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvRsNodeAttResourceModel, tagTagPlan, tagTagState []TagTagFvRsNodeAttResourceModel) []map[string]interface{} { +func getFvRsNodeAttTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvRsNodeAttResourceModel, tagTagFvRsNodeAttPlan, tagTagFvRsNodeAttState []TagTagFvRsNodeAttResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagTag.IsUnknown() { + if !data.TagTag.IsNull() && !data.TagTag.IsUnknown() { tagTagIdentifiers := []TagTagIdentifier{} - for _, tagTag := range tagTagPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagTag.Key.IsUnknown() && !tagTag.Key.IsNull() { - childMap["attributes"]["key"] = tagTag.Key.ValueString() + for _, tagTagFvRsNodeAtt := range tagTagFvRsNodeAttPlan { + childMap := NewAciObject() + if !tagTagFvRsNodeAtt.Key.IsNull() && !tagTagFvRsNodeAtt.Key.IsUnknown() { + childMap.Attributes["key"] = tagTagFvRsNodeAtt.Key.ValueString() } - if !tagTag.Value.IsUnknown() && !tagTag.Value.IsNull() { - childMap["attributes"]["value"] = tagTag.Value.ValueString() + if !tagTagFvRsNodeAtt.Value.IsNull() && !tagTagFvRsNodeAtt.Value.IsUnknown() { + childMap.Attributes["value"] = tagTagFvRsNodeAtt.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) tagTagIdentifier := TagTagIdentifier{} - tagTagIdentifier.Key = tagTag.Key + tagTagIdentifier.Key = tagTagFvRsNodeAtt.Key tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) } - for _, tagTag := range tagTagState { + for _, tagTag := range tagTagFvRsNodeAttState { delete := true for _, tagTagIdentifier := range tagTagIdentifiers { if tagTagIdentifier.Key == tagTag.Key { @@ -636,10 +651,10 @@ func getFvRsNodeAttTagTagChildPayloads(ctx context.Context, diags *diag.Diagnost } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagTag.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) + tagTagChildMapForDelete := NewAciObject() + tagTagChildMapForDelete.Attributes["status"] = "deleted" + tagTagChildMapForDelete.Attributes["key"] = tagTag.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagTag": tagTagChildMapForDelete}) } } } else { diff --git a/internal/provider/resource_aci_relation_to_static_leaf_test.go b/internal/provider/resource_aci_relation_to_static_leaf_test.go index 2da93f4eb..e08fc6a1d 100644 --- a/internal/provider/resource_aci_relation_to_static_leaf_test.go +++ b/internal/provider/resource_aci_relation_to_static_leaf_test.go @@ -267,24 +267,24 @@ resource "aci_relation_to_static_leaf" "test" { encapsulation = "vlan-101" target_dn = "topology/pod-1/node-101" annotations = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] tags = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] } ` diff --git a/internal/provider/resource_aci_relation_to_static_path.go b/internal/provider/resource_aci_relation_to_static_path.go index 70a1d3b60..61b6215ea 100644 --- a/internal/provider/resource_aci_relation_to_static_path.go +++ b/internal/provider/resource_aci_relation_to_static_path.go @@ -94,6 +94,13 @@ func getEmptyTagAnnotationFvRsPathAttResourceModel() TagAnnotationFvRsPathAttRes } } +var TagAnnotationFvRsPathAttType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // TagTagFvRsPathAttResourceModel describes the resource data model for the children without relation ships. type TagTagFvRsPathAttResourceModel struct { Key types.String `tfsdk:"key"` @@ -107,6 +114,13 @@ func getEmptyTagTagFvRsPathAttResourceModel() TagTagFvRsPathAttResourceModel { } } +var TagTagFvRsPathAttType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + type FvRsPathAttIdentifier struct { TDn types.String } @@ -470,7 +484,7 @@ func (r *FvRsPathAttResource) ImportState(ctx context.Context, req resource.Impo } func getAndSetFvRsPathAttAttributes(ctx context.Context, diags *diag.Diagnostics, client *client.Client, data *FvRsPathAttResourceModel) { - requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=children&rsp-subtree-class=%s", data.Id.ValueString(), "fvRsPathAtt,tagAnnotation,tagTag"), "GET", nil) + requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=full&rsp-subtree-class=%s", data.Id.ValueString(), "fvRsPathAtt,tagAnnotation,tagTag"), "GET", nil) readData := getEmptyFvRsPathAttResourceModel() @@ -525,6 +539,7 @@ func getAndSetFvRsPathAttAttributes(ctx context.Context, diags *diag.Diagnostics if childAttributeName == "value" { TagAnnotationFvRsPathAtt.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagAnnotationFvRsPathAttList = append(TagAnnotationFvRsPathAttList, TagAnnotationFvRsPathAtt) } @@ -537,6 +552,7 @@ func getAndSetFvRsPathAttAttributes(ctx context.Context, diags *diag.Diagnostics if childAttributeName == "value" { TagTagFvRsPathAtt.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagTagFvRsPathAttList = append(TagTagFvRsPathAttList, TagTagFvRsPathAtt) } @@ -584,25 +600,24 @@ func setFvRsPathAttId(ctx context.Context, data *FvRsPathAttResourceModel) { data.Id = types.StringValue(fmt.Sprintf("%s/%s", data.ParentDn.ValueString(), rn)) } -func getFvRsPathAttTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvRsPathAttResourceModel, tagAnnotationPlan, tagAnnotationState []TagAnnotationFvRsPathAttResourceModel) []map[string]interface{} { - +func getFvRsPathAttTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvRsPathAttResourceModel, tagAnnotationFvRsPathAttPlan, tagAnnotationFvRsPathAttState []TagAnnotationFvRsPathAttResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagAnnotation.IsUnknown() { + if !data.TagAnnotation.IsNull() && !data.TagAnnotation.IsUnknown() { tagAnnotationIdentifiers := []TagAnnotationIdentifier{} - for _, tagAnnotation := range tagAnnotationPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagAnnotation.Key.IsUnknown() && !tagAnnotation.Key.IsNull() { - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() + for _, tagAnnotationFvRsPathAtt := range tagAnnotationFvRsPathAttPlan { + childMap := NewAciObject() + if !tagAnnotationFvRsPathAtt.Key.IsNull() && !tagAnnotationFvRsPathAtt.Key.IsUnknown() { + childMap.Attributes["key"] = tagAnnotationFvRsPathAtt.Key.ValueString() } - if !tagAnnotation.Value.IsUnknown() && !tagAnnotation.Value.IsNull() { - childMap["attributes"]["value"] = tagAnnotation.Value.ValueString() + if !tagAnnotationFvRsPathAtt.Value.IsNull() && !tagAnnotationFvRsPathAtt.Value.IsUnknown() { + childMap.Attributes["value"] = tagAnnotationFvRsPathAtt.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) tagAnnotationIdentifier := TagAnnotationIdentifier{} - tagAnnotationIdentifier.Key = tagAnnotation.Key + tagAnnotationIdentifier.Key = tagAnnotationFvRsPathAtt.Key tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) } - for _, tagAnnotation := range tagAnnotationState { + for _, tagAnnotation := range tagAnnotationFvRsPathAttState { delete := true for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { if tagAnnotationIdentifier.Key == tagAnnotation.Key { @@ -611,10 +626,10 @@ func getFvRsPathAttTagAnnotationChildPayloads(ctx context.Context, diags *diag.D } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) + tagAnnotationChildMapForDelete := NewAciObject() + tagAnnotationChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationChildMapForDelete.Attributes["key"] = tagAnnotation.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": tagAnnotationChildMapForDelete}) } } } else { @@ -623,25 +638,25 @@ func getFvRsPathAttTagAnnotationChildPayloads(ctx context.Context, diags *diag.D return childPayloads } -func getFvRsPathAttTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvRsPathAttResourceModel, tagTagPlan, tagTagState []TagTagFvRsPathAttResourceModel) []map[string]interface{} { +func getFvRsPathAttTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvRsPathAttResourceModel, tagTagFvRsPathAttPlan, tagTagFvRsPathAttState []TagTagFvRsPathAttResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagTag.IsUnknown() { + if !data.TagTag.IsNull() && !data.TagTag.IsUnknown() { tagTagIdentifiers := []TagTagIdentifier{} - for _, tagTag := range tagTagPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagTag.Key.IsUnknown() && !tagTag.Key.IsNull() { - childMap["attributes"]["key"] = tagTag.Key.ValueString() + for _, tagTagFvRsPathAtt := range tagTagFvRsPathAttPlan { + childMap := NewAciObject() + if !tagTagFvRsPathAtt.Key.IsNull() && !tagTagFvRsPathAtt.Key.IsUnknown() { + childMap.Attributes["key"] = tagTagFvRsPathAtt.Key.ValueString() } - if !tagTag.Value.IsUnknown() && !tagTag.Value.IsNull() { - childMap["attributes"]["value"] = tagTag.Value.ValueString() + if !tagTagFvRsPathAtt.Value.IsNull() && !tagTagFvRsPathAtt.Value.IsUnknown() { + childMap.Attributes["value"] = tagTagFvRsPathAtt.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) tagTagIdentifier := TagTagIdentifier{} - tagTagIdentifier.Key = tagTag.Key + tagTagIdentifier.Key = tagTagFvRsPathAtt.Key tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) } - for _, tagTag := range tagTagState { + for _, tagTag := range tagTagFvRsPathAttState { delete := true for _, tagTagIdentifier := range tagTagIdentifiers { if tagTagIdentifier.Key == tagTag.Key { @@ -650,10 +665,10 @@ func getFvRsPathAttTagTagChildPayloads(ctx context.Context, diags *diag.Diagnost } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagTag.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) + tagTagChildMapForDelete := NewAciObject() + tagTagChildMapForDelete.Attributes["status"] = "deleted" + tagTagChildMapForDelete.Attributes["key"] = tagTag.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagTag": tagTagChildMapForDelete}) } } } else { diff --git a/internal/provider/resource_aci_relation_to_static_path_test.go b/internal/provider/resource_aci_relation_to_static_path_test.go index 459ce89ee..089c2df9b 100644 --- a/internal/provider/resource_aci_relation_to_static_path_test.go +++ b/internal/provider/resource_aci_relation_to_static_path_test.go @@ -277,24 +277,24 @@ resource "aci_relation_to_static_path" "test" { encapsulation = "vlan-201" target_dn = "topology/pod-1/paths-101/pathep-[eth1/1]" annotations = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] tags = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] } ` diff --git a/internal/provider/resource_aci_relation_to_taboo_contract.go b/internal/provider/resource_aci_relation_to_taboo_contract.go index 75d763d80..6a86ae6df 100644 --- a/internal/provider/resource_aci_relation_to_taboo_contract.go +++ b/internal/provider/resource_aci_relation_to_taboo_contract.go @@ -82,6 +82,13 @@ func getEmptyTagAnnotationFvRsProtByResourceModel() TagAnnotationFvRsProtByResou } } +var TagAnnotationFvRsProtByType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // TagTagFvRsProtByResourceModel describes the resource data model for the children without relation ships. type TagTagFvRsProtByResourceModel struct { Key types.String `tfsdk:"key"` @@ -95,6 +102,13 @@ func getEmptyTagTagFvRsProtByResourceModel() TagTagFvRsProtByResourceModel { } } +var TagTagFvRsProtByType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + type FvRsProtByIdentifier struct { TnVzTabooName types.String } @@ -408,7 +422,7 @@ func (r *FvRsProtByResource) ImportState(ctx context.Context, req resource.Impor } func getAndSetFvRsProtByAttributes(ctx context.Context, diags *diag.Diagnostics, client *client.Client, data *FvRsProtByResourceModel) { - requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=children&rsp-subtree-class=%s", data.Id.ValueString(), "fvRsProtBy,tagAnnotation,tagTag"), "GET", nil) + requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=full&rsp-subtree-class=%s", data.Id.ValueString(), "fvRsProtBy,tagAnnotation,tagTag"), "GET", nil) readData := getEmptyFvRsProtByResourceModel() @@ -448,6 +462,7 @@ func getAndSetFvRsProtByAttributes(ctx context.Context, diags *diag.Diagnostics, if childAttributeName == "value" { TagAnnotationFvRsProtBy.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagAnnotationFvRsProtByList = append(TagAnnotationFvRsProtByList, TagAnnotationFvRsProtBy) } @@ -460,6 +475,7 @@ func getAndSetFvRsProtByAttributes(ctx context.Context, diags *diag.Diagnostics, if childAttributeName == "value" { TagTagFvRsProtBy.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagTagFvRsProtByList = append(TagTagFvRsProtByList, TagTagFvRsProtBy) } @@ -507,25 +523,24 @@ func setFvRsProtById(ctx context.Context, data *FvRsProtByResourceModel) { data.Id = types.StringValue(fmt.Sprintf("%s/%s", data.ParentDn.ValueString(), rn)) } -func getFvRsProtByTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvRsProtByResourceModel, tagAnnotationPlan, tagAnnotationState []TagAnnotationFvRsProtByResourceModel) []map[string]interface{} { - +func getFvRsProtByTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvRsProtByResourceModel, tagAnnotationFvRsProtByPlan, tagAnnotationFvRsProtByState []TagAnnotationFvRsProtByResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagAnnotation.IsUnknown() { + if !data.TagAnnotation.IsNull() && !data.TagAnnotation.IsUnknown() { tagAnnotationIdentifiers := []TagAnnotationIdentifier{} - for _, tagAnnotation := range tagAnnotationPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagAnnotation.Key.IsUnknown() && !tagAnnotation.Key.IsNull() { - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() + for _, tagAnnotationFvRsProtBy := range tagAnnotationFvRsProtByPlan { + childMap := NewAciObject() + if !tagAnnotationFvRsProtBy.Key.IsNull() && !tagAnnotationFvRsProtBy.Key.IsUnknown() { + childMap.Attributes["key"] = tagAnnotationFvRsProtBy.Key.ValueString() } - if !tagAnnotation.Value.IsUnknown() && !tagAnnotation.Value.IsNull() { - childMap["attributes"]["value"] = tagAnnotation.Value.ValueString() + if !tagAnnotationFvRsProtBy.Value.IsNull() && !tagAnnotationFvRsProtBy.Value.IsUnknown() { + childMap.Attributes["value"] = tagAnnotationFvRsProtBy.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) tagAnnotationIdentifier := TagAnnotationIdentifier{} - tagAnnotationIdentifier.Key = tagAnnotation.Key + tagAnnotationIdentifier.Key = tagAnnotationFvRsProtBy.Key tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) } - for _, tagAnnotation := range tagAnnotationState { + for _, tagAnnotation := range tagAnnotationFvRsProtByState { delete := true for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { if tagAnnotationIdentifier.Key == tagAnnotation.Key { @@ -534,10 +549,10 @@ func getFvRsProtByTagAnnotationChildPayloads(ctx context.Context, diags *diag.Di } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) + tagAnnotationChildMapForDelete := NewAciObject() + tagAnnotationChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationChildMapForDelete.Attributes["key"] = tagAnnotation.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": tagAnnotationChildMapForDelete}) } } } else { @@ -546,25 +561,25 @@ func getFvRsProtByTagAnnotationChildPayloads(ctx context.Context, diags *diag.Di return childPayloads } -func getFvRsProtByTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvRsProtByResourceModel, tagTagPlan, tagTagState []TagTagFvRsProtByResourceModel) []map[string]interface{} { +func getFvRsProtByTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvRsProtByResourceModel, tagTagFvRsProtByPlan, tagTagFvRsProtByState []TagTagFvRsProtByResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagTag.IsUnknown() { + if !data.TagTag.IsNull() && !data.TagTag.IsUnknown() { tagTagIdentifiers := []TagTagIdentifier{} - for _, tagTag := range tagTagPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagTag.Key.IsUnknown() && !tagTag.Key.IsNull() { - childMap["attributes"]["key"] = tagTag.Key.ValueString() + for _, tagTagFvRsProtBy := range tagTagFvRsProtByPlan { + childMap := NewAciObject() + if !tagTagFvRsProtBy.Key.IsNull() && !tagTagFvRsProtBy.Key.IsUnknown() { + childMap.Attributes["key"] = tagTagFvRsProtBy.Key.ValueString() } - if !tagTag.Value.IsUnknown() && !tagTag.Value.IsNull() { - childMap["attributes"]["value"] = tagTag.Value.ValueString() + if !tagTagFvRsProtBy.Value.IsNull() && !tagTagFvRsProtBy.Value.IsUnknown() { + childMap.Attributes["value"] = tagTagFvRsProtBy.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) tagTagIdentifier := TagTagIdentifier{} - tagTagIdentifier.Key = tagTag.Key + tagTagIdentifier.Key = tagTagFvRsProtBy.Key tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) } - for _, tagTag := range tagTagState { + for _, tagTag := range tagTagFvRsProtByState { delete := true for _, tagTagIdentifier := range tagTagIdentifiers { if tagTagIdentifier.Key == tagTag.Key { @@ -573,10 +588,10 @@ func getFvRsProtByTagTagChildPayloads(ctx context.Context, diags *diag.Diagnosti } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagTag.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) + tagTagChildMapForDelete := NewAciObject() + tagTagChildMapForDelete.Attributes["status"] = "deleted" + tagTagChildMapForDelete.Attributes["key"] = tagTag.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagTag": tagTagChildMapForDelete}) } } } else { diff --git a/internal/provider/resource_aci_relation_to_taboo_contract_test.go b/internal/provider/resource_aci_relation_to_taboo_contract_test.go index 93b3b24a7..af29e6f97 100644 --- a/internal/provider/resource_aci_relation_to_taboo_contract_test.go +++ b/internal/provider/resource_aci_relation_to_taboo_contract_test.go @@ -219,24 +219,24 @@ resource "aci_relation_to_taboo_contract" "test" { parent_dn = aci_application_epg.test.id taboo_contract_name = "test_tn_vz_taboo_name" annotations = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] tags = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] } ` diff --git a/internal/provider/resource_aci_relation_to_vrf_fallback_route_group.go b/internal/provider/resource_aci_relation_to_vrf_fallback_route_group.go index 25f109d01..42ec80bb1 100644 --- a/internal/provider/resource_aci_relation_to_vrf_fallback_route_group.go +++ b/internal/provider/resource_aci_relation_to_vrf_fallback_route_group.go @@ -82,6 +82,13 @@ func getEmptyTagAnnotationL3extRsOutToFBRGroupResourceModel() TagAnnotationL3ext } } +var TagAnnotationL3extRsOutToFBRGroupType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // TagTagL3extRsOutToFBRGroupResourceModel describes the resource data model for the children without relation ships. type TagTagL3extRsOutToFBRGroupResourceModel struct { Key types.String `tfsdk:"key"` @@ -95,6 +102,13 @@ func getEmptyTagTagL3extRsOutToFBRGroupResourceModel() TagTagL3extRsOutToFBRGrou } } +var TagTagL3extRsOutToFBRGroupType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + type L3extRsOutToFBRGroupIdentifier struct { TDn types.String } @@ -408,7 +422,7 @@ func (r *L3extRsOutToFBRGroupResource) ImportState(ctx context.Context, req reso } func getAndSetL3extRsOutToFBRGroupAttributes(ctx context.Context, diags *diag.Diagnostics, client *client.Client, data *L3extRsOutToFBRGroupResourceModel) { - requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=children&rsp-subtree-class=%s", data.Id.ValueString(), "l3extRsOutToFBRGroup,tagAnnotation,tagTag"), "GET", nil) + requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=full&rsp-subtree-class=%s", data.Id.ValueString(), "l3extRsOutToFBRGroup,tagAnnotation,tagTag"), "GET", nil) readData := getEmptyL3extRsOutToFBRGroupResourceModel() @@ -448,6 +462,7 @@ func getAndSetL3extRsOutToFBRGroupAttributes(ctx context.Context, diags *diag.Di if childAttributeName == "value" { TagAnnotationL3extRsOutToFBRGroup.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagAnnotationL3extRsOutToFBRGroupList = append(TagAnnotationL3extRsOutToFBRGroupList, TagAnnotationL3extRsOutToFBRGroup) } @@ -460,6 +475,7 @@ func getAndSetL3extRsOutToFBRGroupAttributes(ctx context.Context, diags *diag.Di if childAttributeName == "value" { TagTagL3extRsOutToFBRGroup.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagTagL3extRsOutToFBRGroupList = append(TagTagL3extRsOutToFBRGroupList, TagTagL3extRsOutToFBRGroup) } @@ -507,25 +523,24 @@ func setL3extRsOutToFBRGroupId(ctx context.Context, data *L3extRsOutToFBRGroupRe data.Id = types.StringValue(fmt.Sprintf("%s/%s", data.ParentDn.ValueString(), rn)) } -func getL3extRsOutToFBRGroupTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *L3extRsOutToFBRGroupResourceModel, tagAnnotationPlan, tagAnnotationState []TagAnnotationL3extRsOutToFBRGroupResourceModel) []map[string]interface{} { - +func getL3extRsOutToFBRGroupTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *L3extRsOutToFBRGroupResourceModel, tagAnnotationL3extRsOutToFBRGroupPlan, tagAnnotationL3extRsOutToFBRGroupState []TagAnnotationL3extRsOutToFBRGroupResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagAnnotation.IsUnknown() { + if !data.TagAnnotation.IsNull() && !data.TagAnnotation.IsUnknown() { tagAnnotationIdentifiers := []TagAnnotationIdentifier{} - for _, tagAnnotation := range tagAnnotationPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagAnnotation.Key.IsUnknown() && !tagAnnotation.Key.IsNull() { - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() + for _, tagAnnotationL3extRsOutToFBRGroup := range tagAnnotationL3extRsOutToFBRGroupPlan { + childMap := NewAciObject() + if !tagAnnotationL3extRsOutToFBRGroup.Key.IsNull() && !tagAnnotationL3extRsOutToFBRGroup.Key.IsUnknown() { + childMap.Attributes["key"] = tagAnnotationL3extRsOutToFBRGroup.Key.ValueString() } - if !tagAnnotation.Value.IsUnknown() && !tagAnnotation.Value.IsNull() { - childMap["attributes"]["value"] = tagAnnotation.Value.ValueString() + if !tagAnnotationL3extRsOutToFBRGroup.Value.IsNull() && !tagAnnotationL3extRsOutToFBRGroup.Value.IsUnknown() { + childMap.Attributes["value"] = tagAnnotationL3extRsOutToFBRGroup.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) tagAnnotationIdentifier := TagAnnotationIdentifier{} - tagAnnotationIdentifier.Key = tagAnnotation.Key + tagAnnotationIdentifier.Key = tagAnnotationL3extRsOutToFBRGroup.Key tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) } - for _, tagAnnotation := range tagAnnotationState { + for _, tagAnnotation := range tagAnnotationL3extRsOutToFBRGroupState { delete := true for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { if tagAnnotationIdentifier.Key == tagAnnotation.Key { @@ -534,10 +549,10 @@ func getL3extRsOutToFBRGroupTagAnnotationChildPayloads(ctx context.Context, diag } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) + tagAnnotationChildMapForDelete := NewAciObject() + tagAnnotationChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationChildMapForDelete.Attributes["key"] = tagAnnotation.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": tagAnnotationChildMapForDelete}) } } } else { @@ -546,25 +561,25 @@ func getL3extRsOutToFBRGroupTagAnnotationChildPayloads(ctx context.Context, diag return childPayloads } -func getL3extRsOutToFBRGroupTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *L3extRsOutToFBRGroupResourceModel, tagTagPlan, tagTagState []TagTagL3extRsOutToFBRGroupResourceModel) []map[string]interface{} { +func getL3extRsOutToFBRGroupTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *L3extRsOutToFBRGroupResourceModel, tagTagL3extRsOutToFBRGroupPlan, tagTagL3extRsOutToFBRGroupState []TagTagL3extRsOutToFBRGroupResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagTag.IsUnknown() { + if !data.TagTag.IsNull() && !data.TagTag.IsUnknown() { tagTagIdentifiers := []TagTagIdentifier{} - for _, tagTag := range tagTagPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagTag.Key.IsUnknown() && !tagTag.Key.IsNull() { - childMap["attributes"]["key"] = tagTag.Key.ValueString() + for _, tagTagL3extRsOutToFBRGroup := range tagTagL3extRsOutToFBRGroupPlan { + childMap := NewAciObject() + if !tagTagL3extRsOutToFBRGroup.Key.IsNull() && !tagTagL3extRsOutToFBRGroup.Key.IsUnknown() { + childMap.Attributes["key"] = tagTagL3extRsOutToFBRGroup.Key.ValueString() } - if !tagTag.Value.IsUnknown() && !tagTag.Value.IsNull() { - childMap["attributes"]["value"] = tagTag.Value.ValueString() + if !tagTagL3extRsOutToFBRGroup.Value.IsNull() && !tagTagL3extRsOutToFBRGroup.Value.IsUnknown() { + childMap.Attributes["value"] = tagTagL3extRsOutToFBRGroup.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) tagTagIdentifier := TagTagIdentifier{} - tagTagIdentifier.Key = tagTag.Key + tagTagIdentifier.Key = tagTagL3extRsOutToFBRGroup.Key tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) } - for _, tagTag := range tagTagState { + for _, tagTag := range tagTagL3extRsOutToFBRGroupState { delete := true for _, tagTagIdentifier := range tagTagIdentifiers { if tagTagIdentifier.Key == tagTag.Key { @@ -573,10 +588,10 @@ func getL3extRsOutToFBRGroupTagTagChildPayloads(ctx context.Context, diags *diag } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagTag.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) + tagTagChildMapForDelete := NewAciObject() + tagTagChildMapForDelete.Attributes["status"] = "deleted" + tagTagChildMapForDelete.Attributes["key"] = tagTag.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagTag": tagTagChildMapForDelete}) } } } else { diff --git a/internal/provider/resource_aci_relation_to_vrf_fallback_route_group_test.go b/internal/provider/resource_aci_relation_to_vrf_fallback_route_group_test.go index c00f3c123..07bc1c219 100644 --- a/internal/provider/resource_aci_relation_to_vrf_fallback_route_group_test.go +++ b/internal/provider/resource_aci_relation_to_vrf_fallback_route_group_test.go @@ -226,24 +226,24 @@ resource "aci_relation_to_vrf_fallback_route_group" "test" { parent_dn = aci_l3_outside.test.id target_dn = aci_vrf_fallback_route_group.test_vrf_fallback_route_group_0.id annotations = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] tags = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] } ` diff --git a/internal/provider/resource_aci_rogue_coop_exception.go b/internal/provider/resource_aci_rogue_coop_exception.go index 246c2af59..94408c0a7 100644 --- a/internal/provider/resource_aci_rogue_coop_exception.go +++ b/internal/provider/resource_aci_rogue_coop_exception.go @@ -88,6 +88,13 @@ func getEmptyTagAnnotationFvRogueExceptionMacResourceModel() TagAnnotationFvRogu } } +var TagAnnotationFvRogueExceptionMacType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // TagTagFvRogueExceptionMacResourceModel describes the resource data model for the children without relation ships. type TagTagFvRogueExceptionMacResourceModel struct { Key types.String `tfsdk:"key"` @@ -101,6 +108,13 @@ func getEmptyTagTagFvRogueExceptionMacResourceModel() TagTagFvRogueExceptionMacR } } +var TagTagFvRogueExceptionMacType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + type FvRogueExceptionMacIdentifier struct { Mac types.String } @@ -441,7 +455,7 @@ func (r *FvRogueExceptionMacResource) ImportState(ctx context.Context, req resou } func getAndSetFvRogueExceptionMacAttributes(ctx context.Context, diags *diag.Diagnostics, client *client.Client, data *FvRogueExceptionMacResourceModel) { - requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=children&rsp-subtree-class=%s", data.Id.ValueString(), "fvRogueExceptionMac,tagAnnotation,tagTag"), "GET", nil) + requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=full&rsp-subtree-class=%s", data.Id.ValueString(), "fvRogueExceptionMac,tagAnnotation,tagTag"), "GET", nil) readData := getEmptyFvRogueExceptionMacResourceModel() @@ -490,6 +504,7 @@ func getAndSetFvRogueExceptionMacAttributes(ctx context.Context, diags *diag.Dia if childAttributeName == "value" { TagAnnotationFvRogueExceptionMac.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagAnnotationFvRogueExceptionMacList = append(TagAnnotationFvRogueExceptionMacList, TagAnnotationFvRogueExceptionMac) } @@ -502,6 +517,7 @@ func getAndSetFvRogueExceptionMacAttributes(ctx context.Context, diags *diag.Dia if childAttributeName == "value" { TagTagFvRogueExceptionMac.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagTagFvRogueExceptionMacList = append(TagTagFvRogueExceptionMacList, TagTagFvRogueExceptionMac) } @@ -549,25 +565,24 @@ func setFvRogueExceptionMacId(ctx context.Context, data *FvRogueExceptionMacReso data.Id = types.StringValue(fmt.Sprintf("%s/%s", data.ParentDn.ValueString(), rn)) } -func getFvRogueExceptionMacTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvRogueExceptionMacResourceModel, tagAnnotationPlan, tagAnnotationState []TagAnnotationFvRogueExceptionMacResourceModel) []map[string]interface{} { - +func getFvRogueExceptionMacTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvRogueExceptionMacResourceModel, tagAnnotationFvRogueExceptionMacPlan, tagAnnotationFvRogueExceptionMacState []TagAnnotationFvRogueExceptionMacResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagAnnotation.IsUnknown() { + if !data.TagAnnotation.IsNull() && !data.TagAnnotation.IsUnknown() { tagAnnotationIdentifiers := []TagAnnotationIdentifier{} - for _, tagAnnotation := range tagAnnotationPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagAnnotation.Key.IsUnknown() && !tagAnnotation.Key.IsNull() { - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() + for _, tagAnnotationFvRogueExceptionMac := range tagAnnotationFvRogueExceptionMacPlan { + childMap := NewAciObject() + if !tagAnnotationFvRogueExceptionMac.Key.IsNull() && !tagAnnotationFvRogueExceptionMac.Key.IsUnknown() { + childMap.Attributes["key"] = tagAnnotationFvRogueExceptionMac.Key.ValueString() } - if !tagAnnotation.Value.IsUnknown() && !tagAnnotation.Value.IsNull() { - childMap["attributes"]["value"] = tagAnnotation.Value.ValueString() + if !tagAnnotationFvRogueExceptionMac.Value.IsNull() && !tagAnnotationFvRogueExceptionMac.Value.IsUnknown() { + childMap.Attributes["value"] = tagAnnotationFvRogueExceptionMac.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) tagAnnotationIdentifier := TagAnnotationIdentifier{} - tagAnnotationIdentifier.Key = tagAnnotation.Key + tagAnnotationIdentifier.Key = tagAnnotationFvRogueExceptionMac.Key tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) } - for _, tagAnnotation := range tagAnnotationState { + for _, tagAnnotation := range tagAnnotationFvRogueExceptionMacState { delete := true for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { if tagAnnotationIdentifier.Key == tagAnnotation.Key { @@ -576,10 +591,10 @@ func getFvRogueExceptionMacTagAnnotationChildPayloads(ctx context.Context, diags } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) + tagAnnotationChildMapForDelete := NewAciObject() + tagAnnotationChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationChildMapForDelete.Attributes["key"] = tagAnnotation.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": tagAnnotationChildMapForDelete}) } } } else { @@ -588,25 +603,25 @@ func getFvRogueExceptionMacTagAnnotationChildPayloads(ctx context.Context, diags return childPayloads } -func getFvRogueExceptionMacTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvRogueExceptionMacResourceModel, tagTagPlan, tagTagState []TagTagFvRogueExceptionMacResourceModel) []map[string]interface{} { +func getFvRogueExceptionMacTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvRogueExceptionMacResourceModel, tagTagFvRogueExceptionMacPlan, tagTagFvRogueExceptionMacState []TagTagFvRogueExceptionMacResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagTag.IsUnknown() { + if !data.TagTag.IsNull() && !data.TagTag.IsUnknown() { tagTagIdentifiers := []TagTagIdentifier{} - for _, tagTag := range tagTagPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagTag.Key.IsUnknown() && !tagTag.Key.IsNull() { - childMap["attributes"]["key"] = tagTag.Key.ValueString() + for _, tagTagFvRogueExceptionMac := range tagTagFvRogueExceptionMacPlan { + childMap := NewAciObject() + if !tagTagFvRogueExceptionMac.Key.IsNull() && !tagTagFvRogueExceptionMac.Key.IsUnknown() { + childMap.Attributes["key"] = tagTagFvRogueExceptionMac.Key.ValueString() } - if !tagTag.Value.IsUnknown() && !tagTag.Value.IsNull() { - childMap["attributes"]["value"] = tagTag.Value.ValueString() + if !tagTagFvRogueExceptionMac.Value.IsNull() && !tagTagFvRogueExceptionMac.Value.IsUnknown() { + childMap.Attributes["value"] = tagTagFvRogueExceptionMac.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) tagTagIdentifier := TagTagIdentifier{} - tagTagIdentifier.Key = tagTag.Key + tagTagIdentifier.Key = tagTagFvRogueExceptionMac.Key tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) } - for _, tagTag := range tagTagState { + for _, tagTag := range tagTagFvRogueExceptionMacState { delete := true for _, tagTagIdentifier := range tagTagIdentifiers { if tagTagIdentifier.Key == tagTag.Key { @@ -615,10 +630,10 @@ func getFvRogueExceptionMacTagTagChildPayloads(ctx context.Context, diags *diag. } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagTag.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) + tagTagChildMapForDelete := NewAciObject() + tagTagChildMapForDelete.Attributes["status"] = "deleted" + tagTagChildMapForDelete.Attributes["key"] = tagTag.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagTag": tagTagChildMapForDelete}) } } } else { diff --git a/internal/provider/resource_aci_rogue_coop_exception_test.go b/internal/provider/resource_aci_rogue_coop_exception_test.go index 50f3f986b..c177d54d8 100644 --- a/internal/provider/resource_aci_rogue_coop_exception_test.go +++ b/internal/provider/resource_aci_rogue_coop_exception_test.go @@ -249,24 +249,24 @@ resource "aci_rogue_coop_exception" "test" { parent_dn = aci_bridge_domain.test.id mac = "00:00:00:00:00:01" annotations = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] tags = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] } ` diff --git a/internal/provider/resource_aci_route_control_profile.go b/internal/provider/resource_aci_route_control_profile.go index 3210ef650..9f4f91d63 100644 --- a/internal/provider/resource_aci_route_control_profile.go +++ b/internal/provider/resource_aci_route_control_profile.go @@ -96,6 +96,13 @@ func getEmptyTagAnnotationRtctrlProfileResourceModel() TagAnnotationRtctrlProfil } } +var TagAnnotationRtctrlProfileType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // TagTagRtctrlProfileResourceModel describes the resource data model for the children without relation ships. type TagTagRtctrlProfileResourceModel struct { Key types.String `tfsdk:"key"` @@ -109,6 +116,13 @@ func getEmptyTagTagRtctrlProfileResourceModel() TagTagRtctrlProfileResourceModel } } +var TagTagRtctrlProfileType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + type RtctrlProfileIdentifier struct { Name types.String } @@ -483,7 +497,7 @@ func (r *RtctrlProfileResource) ImportState(ctx context.Context, req resource.Im } func getAndSetRtctrlProfileAttributes(ctx context.Context, diags *diag.Diagnostics, client *client.Client, data *RtctrlProfileResourceModel) { - requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=children&rsp-subtree-class=%s", data.Id.ValueString(), "rtctrlProfile,tagAnnotation,tagTag"), "GET", nil) + requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=full&rsp-subtree-class=%s", data.Id.ValueString(), "rtctrlProfile,tagAnnotation,tagTag"), "GET", nil) readData := getEmptyRtctrlProfileResourceModel() @@ -541,6 +555,7 @@ func getAndSetRtctrlProfileAttributes(ctx context.Context, diags *diag.Diagnosti if childAttributeName == "value" { TagAnnotationRtctrlProfile.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagAnnotationRtctrlProfileList = append(TagAnnotationRtctrlProfileList, TagAnnotationRtctrlProfile) } @@ -553,6 +568,7 @@ func getAndSetRtctrlProfileAttributes(ctx context.Context, diags *diag.Diagnosti if childAttributeName == "value" { TagTagRtctrlProfile.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagTagRtctrlProfileList = append(TagTagRtctrlProfileList, TagTagRtctrlProfile) } @@ -600,25 +616,24 @@ func setRtctrlProfileId(ctx context.Context, data *RtctrlProfileResourceModel) { data.Id = types.StringValue(fmt.Sprintf("%s/%s", data.ParentDn.ValueString(), rn)) } -func getRtctrlProfileTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *RtctrlProfileResourceModel, tagAnnotationPlan, tagAnnotationState []TagAnnotationRtctrlProfileResourceModel) []map[string]interface{} { - +func getRtctrlProfileTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *RtctrlProfileResourceModel, tagAnnotationRtctrlProfilePlan, tagAnnotationRtctrlProfileState []TagAnnotationRtctrlProfileResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagAnnotation.IsUnknown() { + if !data.TagAnnotation.IsNull() && !data.TagAnnotation.IsUnknown() { tagAnnotationIdentifiers := []TagAnnotationIdentifier{} - for _, tagAnnotation := range tagAnnotationPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagAnnotation.Key.IsUnknown() && !tagAnnotation.Key.IsNull() { - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() + for _, tagAnnotationRtctrlProfile := range tagAnnotationRtctrlProfilePlan { + childMap := NewAciObject() + if !tagAnnotationRtctrlProfile.Key.IsNull() && !tagAnnotationRtctrlProfile.Key.IsUnknown() { + childMap.Attributes["key"] = tagAnnotationRtctrlProfile.Key.ValueString() } - if !tagAnnotation.Value.IsUnknown() && !tagAnnotation.Value.IsNull() { - childMap["attributes"]["value"] = tagAnnotation.Value.ValueString() + if !tagAnnotationRtctrlProfile.Value.IsNull() && !tagAnnotationRtctrlProfile.Value.IsUnknown() { + childMap.Attributes["value"] = tagAnnotationRtctrlProfile.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) tagAnnotationIdentifier := TagAnnotationIdentifier{} - tagAnnotationIdentifier.Key = tagAnnotation.Key + tagAnnotationIdentifier.Key = tagAnnotationRtctrlProfile.Key tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) } - for _, tagAnnotation := range tagAnnotationState { + for _, tagAnnotation := range tagAnnotationRtctrlProfileState { delete := true for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { if tagAnnotationIdentifier.Key == tagAnnotation.Key { @@ -627,10 +642,10 @@ func getRtctrlProfileTagAnnotationChildPayloads(ctx context.Context, diags *diag } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) + tagAnnotationChildMapForDelete := NewAciObject() + tagAnnotationChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationChildMapForDelete.Attributes["key"] = tagAnnotation.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": tagAnnotationChildMapForDelete}) } } } else { @@ -639,25 +654,25 @@ func getRtctrlProfileTagAnnotationChildPayloads(ctx context.Context, diags *diag return childPayloads } -func getRtctrlProfileTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *RtctrlProfileResourceModel, tagTagPlan, tagTagState []TagTagRtctrlProfileResourceModel) []map[string]interface{} { +func getRtctrlProfileTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *RtctrlProfileResourceModel, tagTagRtctrlProfilePlan, tagTagRtctrlProfileState []TagTagRtctrlProfileResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagTag.IsUnknown() { + if !data.TagTag.IsNull() && !data.TagTag.IsUnknown() { tagTagIdentifiers := []TagTagIdentifier{} - for _, tagTag := range tagTagPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagTag.Key.IsUnknown() && !tagTag.Key.IsNull() { - childMap["attributes"]["key"] = tagTag.Key.ValueString() + for _, tagTagRtctrlProfile := range tagTagRtctrlProfilePlan { + childMap := NewAciObject() + if !tagTagRtctrlProfile.Key.IsNull() && !tagTagRtctrlProfile.Key.IsUnknown() { + childMap.Attributes["key"] = tagTagRtctrlProfile.Key.ValueString() } - if !tagTag.Value.IsUnknown() && !tagTag.Value.IsNull() { - childMap["attributes"]["value"] = tagTag.Value.ValueString() + if !tagTagRtctrlProfile.Value.IsNull() && !tagTagRtctrlProfile.Value.IsUnknown() { + childMap.Attributes["value"] = tagTagRtctrlProfile.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) tagTagIdentifier := TagTagIdentifier{} - tagTagIdentifier.Key = tagTag.Key + tagTagIdentifier.Key = tagTagRtctrlProfile.Key tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) } - for _, tagTag := range tagTagState { + for _, tagTag := range tagTagRtctrlProfileState { delete := true for _, tagTagIdentifier := range tagTagIdentifiers { if tagTagIdentifier.Key == tagTag.Key { @@ -666,10 +681,10 @@ func getRtctrlProfileTagTagChildPayloads(ctx context.Context, diags *diag.Diagno } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagTag.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) + tagTagChildMapForDelete := NewAciObject() + tagTagChildMapForDelete.Attributes["status"] = "deleted" + tagTagChildMapForDelete.Attributes["key"] = tagTag.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagTag": tagTagChildMapForDelete}) } } } else { diff --git a/internal/provider/resource_aci_route_control_profile_test.go b/internal/provider/resource_aci_route_control_profile_test.go index 00f1ec6ce..0bc76aac8 100644 --- a/internal/provider/resource_aci_route_control_profile_test.go +++ b/internal/provider/resource_aci_route_control_profile_test.go @@ -36,7 +36,7 @@ func TestAccResourceRtctrlProfileWithFvTenant(t *testing.T) { resource.TestCheckResourceAttr("aci_route_control_profile.allow_test_2", "owner_tag", ""), resource.TestCheckResourceAttr("aci_route_control_profile.allow_test", "route_control_profile_type", "combinable"), resource.TestCheckResourceAttr("aci_route_control_profile.allow_test_2", "route_control_profile_type", "combinable"), - composeAggregateTestCheckFuncWithVersion(t, "4.2(6d)-4.2(7w),5.1(3e)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.2(6d)-4.2(7w),5.1(3e)", ">=", resource.TestCheckResourceAttr("aci_route_control_profile.allow_test", "route_map_continue", "no"), resource.TestCheckResourceAttr("aci_route_control_profile.allow_test_2", "route_map_continue", "no")), ), @@ -81,7 +81,7 @@ func TestAccResourceRtctrlProfileWithFvTenant(t *testing.T) { resource.TestCheckResourceAttr("aci_route_control_profile.allow_test_2", "owner_tag", ""), resource.TestCheckResourceAttr("aci_route_control_profile.allow_test", "route_control_profile_type", "combinable"), resource.TestCheckResourceAttr("aci_route_control_profile.allow_test_2", "route_control_profile_type", "combinable"), - composeAggregateTestCheckFuncWithVersion(t, "4.2(6d)-4.2(7w),5.1(3e)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.2(6d)-4.2(7w),5.1(3e)", ">=", resource.TestCheckResourceAttr("aci_route_control_profile.allow_test", "route_map_continue", "no"), resource.TestCheckResourceAttr("aci_route_control_profile.allow_test_2", "route_map_continue", "no")), ), @@ -105,7 +105,7 @@ func TestAccResourceRtctrlProfileWithFvTenant(t *testing.T) { resource.TestCheckResourceAttr("aci_route_control_profile.test", "owner_key", ""), resource.TestCheckResourceAttr("aci_route_control_profile.test", "owner_tag", ""), resource.TestCheckResourceAttr("aci_route_control_profile.test", "route_control_profile_type", "combinable"), - composeAggregateTestCheckFuncWithVersion(t, "4.2(6d)-4.2(7w),5.1(3e)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.2(6d)-4.2(7w),5.1(3e)", ">=", resource.TestCheckResourceAttr("aci_route_control_profile.test", "route_map_continue", "no")), ), }, @@ -121,7 +121,7 @@ func TestAccResourceRtctrlProfileWithFvTenant(t *testing.T) { resource.TestCheckResourceAttr("aci_route_control_profile.test", "owner_key", "owner_key_1"), resource.TestCheckResourceAttr("aci_route_control_profile.test", "owner_tag", "owner_tag_1"), resource.TestCheckResourceAttr("aci_route_control_profile.test", "route_control_profile_type", "combinable"), - composeAggregateTestCheckFuncWithVersion(t, "4.2(6d)-4.2(7w),5.1(3e)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.2(6d)-4.2(7w),5.1(3e)", ">=", resource.TestCheckResourceAttr("aci_route_control_profile.test", "route_map_continue", "no")), ), }, @@ -145,7 +145,7 @@ func TestAccResourceRtctrlProfileWithFvTenant(t *testing.T) { resource.TestCheckResourceAttr("aci_route_control_profile.test", "owner_key", ""), resource.TestCheckResourceAttr("aci_route_control_profile.test", "owner_tag", ""), resource.TestCheckResourceAttr("aci_route_control_profile.test", "route_control_profile_type", "combinable"), - composeAggregateTestCheckFuncWithVersion(t, "4.2(6d)-4.2(7w),5.1(3e)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.2(6d)-4.2(7w),5.1(3e)", ">=", resource.TestCheckResourceAttr("aci_route_control_profile.test", "route_map_continue", "no")), ), }, @@ -167,7 +167,7 @@ func TestAccResourceRtctrlProfileWithFvTenant(t *testing.T) { resource.TestCheckResourceAttr("aci_route_control_profile.test", "owner_key", ""), resource.TestCheckResourceAttr("aci_route_control_profile.test", "owner_tag", ""), resource.TestCheckResourceAttr("aci_route_control_profile.test", "route_control_profile_type", "combinable"), - composeAggregateTestCheckFuncWithVersion(t, "4.2(6d)-4.2(7w),5.1(3e)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.2(6d)-4.2(7w),5.1(3e)", ">=", resource.TestCheckResourceAttr("aci_route_control_profile.test", "route_map_continue", "no")), resource.TestCheckResourceAttr("aci_route_control_profile.test", "annotations.0.key", "key_0"), resource.TestCheckResourceAttr("aci_route_control_profile.test", "annotations.0.value", "value_1"), @@ -258,7 +258,7 @@ func TestAccResourceRtctrlProfileWithL3extOut(t *testing.T) { resource.TestCheckResourceAttr("aci_route_control_profile.allow_test_2", "owner_tag", ""), resource.TestCheckResourceAttr("aci_route_control_profile.allow_test", "route_control_profile_type", "combinable"), resource.TestCheckResourceAttr("aci_route_control_profile.allow_test_2", "route_control_profile_type", "combinable"), - composeAggregateTestCheckFuncWithVersion(t, "4.2(6d)-4.2(7w),5.1(3e)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.2(6d)-4.2(7w),5.1(3e)", ">=", resource.TestCheckResourceAttr("aci_route_control_profile.allow_test", "route_map_continue", "no"), resource.TestCheckResourceAttr("aci_route_control_profile.allow_test_2", "route_map_continue", "no")), ), @@ -303,7 +303,7 @@ func TestAccResourceRtctrlProfileWithL3extOut(t *testing.T) { resource.TestCheckResourceAttr("aci_route_control_profile.allow_test_2", "owner_tag", ""), resource.TestCheckResourceAttr("aci_route_control_profile.allow_test", "route_control_profile_type", "combinable"), resource.TestCheckResourceAttr("aci_route_control_profile.allow_test_2", "route_control_profile_type", "combinable"), - composeAggregateTestCheckFuncWithVersion(t, "4.2(6d)-4.2(7w),5.1(3e)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.2(6d)-4.2(7w),5.1(3e)", ">=", resource.TestCheckResourceAttr("aci_route_control_profile.allow_test", "route_map_continue", "no"), resource.TestCheckResourceAttr("aci_route_control_profile.allow_test_2", "route_map_continue", "no")), ), @@ -327,7 +327,7 @@ func TestAccResourceRtctrlProfileWithL3extOut(t *testing.T) { resource.TestCheckResourceAttr("aci_route_control_profile.test", "owner_key", ""), resource.TestCheckResourceAttr("aci_route_control_profile.test", "owner_tag", ""), resource.TestCheckResourceAttr("aci_route_control_profile.test", "route_control_profile_type", "combinable"), - composeAggregateTestCheckFuncWithVersion(t, "4.2(6d)-4.2(7w),5.1(3e)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.2(6d)-4.2(7w),5.1(3e)", ">=", resource.TestCheckResourceAttr("aci_route_control_profile.test", "route_map_continue", "no")), ), }, @@ -343,7 +343,7 @@ func TestAccResourceRtctrlProfileWithL3extOut(t *testing.T) { resource.TestCheckResourceAttr("aci_route_control_profile.test", "owner_key", "owner_key_1"), resource.TestCheckResourceAttr("aci_route_control_profile.test", "owner_tag", "owner_tag_1"), resource.TestCheckResourceAttr("aci_route_control_profile.test", "route_control_profile_type", "combinable"), - composeAggregateTestCheckFuncWithVersion(t, "4.2(6d)-4.2(7w),5.1(3e)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.2(6d)-4.2(7w),5.1(3e)", ">=", resource.TestCheckResourceAttr("aci_route_control_profile.test", "route_map_continue", "no")), ), }, @@ -367,7 +367,7 @@ func TestAccResourceRtctrlProfileWithL3extOut(t *testing.T) { resource.TestCheckResourceAttr("aci_route_control_profile.test", "owner_key", ""), resource.TestCheckResourceAttr("aci_route_control_profile.test", "owner_tag", ""), resource.TestCheckResourceAttr("aci_route_control_profile.test", "route_control_profile_type", "combinable"), - composeAggregateTestCheckFuncWithVersion(t, "4.2(6d)-4.2(7w),5.1(3e)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.2(6d)-4.2(7w),5.1(3e)", ">=", resource.TestCheckResourceAttr("aci_route_control_profile.test", "route_map_continue", "no")), ), }, @@ -389,7 +389,7 @@ func TestAccResourceRtctrlProfileWithL3extOut(t *testing.T) { resource.TestCheckResourceAttr("aci_route_control_profile.test", "owner_key", ""), resource.TestCheckResourceAttr("aci_route_control_profile.test", "owner_tag", ""), resource.TestCheckResourceAttr("aci_route_control_profile.test", "route_control_profile_type", "combinable"), - composeAggregateTestCheckFuncWithVersion(t, "4.2(6d)-4.2(7w),5.1(3e)", ">", + composeAggregateTestCheckFuncWithVersion(t, "4.2(6d)-4.2(7w),5.1(3e)", ">=", resource.TestCheckResourceAttr("aci_route_control_profile.test", "route_map_continue", "no")), resource.TestCheckResourceAttr("aci_route_control_profile.test", "annotations.0.key", "key_0"), resource.TestCheckResourceAttr("aci_route_control_profile.test", "annotations.0.value", "value_1"), @@ -507,24 +507,24 @@ resource "aci_route_control_profile" "test" { parent_dn = aci_tenant.test.id name = "test_name" annotations = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] tags = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] } ` @@ -615,24 +615,24 @@ resource "aci_route_control_profile" "test" { parent_dn = aci_l3_outside.test.id name = "test_name" annotations = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] tags = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] } ` diff --git a/internal/provider/resource_aci_trust_control_policy.go b/internal/provider/resource_aci_trust_control_policy.go index adf294d06..ef816f025 100644 --- a/internal/provider/resource_aci_trust_control_policy.go +++ b/internal/provider/resource_aci_trust_control_policy.go @@ -104,6 +104,13 @@ func getEmptyTagAnnotationFhsTrustCtrlPolResourceModel() TagAnnotationFhsTrustCt } } +var TagAnnotationFhsTrustCtrlPolType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // TagTagFhsTrustCtrlPolResourceModel describes the resource data model for the children without relation ships. type TagTagFhsTrustCtrlPolResourceModel struct { Key types.String `tfsdk:"key"` @@ -117,6 +124,13 @@ func getEmptyTagTagFhsTrustCtrlPolResourceModel() TagTagFhsTrustCtrlPolResourceM } } +var TagTagFhsTrustCtrlPolType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + type FhsTrustCtrlPolIdentifier struct { Name types.String } @@ -538,7 +552,7 @@ func (r *FhsTrustCtrlPolResource) ImportState(ctx context.Context, req resource. } func getAndSetFhsTrustCtrlPolAttributes(ctx context.Context, diags *diag.Diagnostics, client *client.Client, data *FhsTrustCtrlPolResourceModel) { - requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=children&rsp-subtree-class=%s", data.Id.ValueString(), "fhsTrustCtrlPol,tagAnnotation,tagTag"), "GET", nil) + requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=full&rsp-subtree-class=%s", data.Id.ValueString(), "fhsTrustCtrlPol,tagAnnotation,tagTag"), "GET", nil) readData := getEmptyFhsTrustCtrlPolResourceModel() @@ -608,6 +622,7 @@ func getAndSetFhsTrustCtrlPolAttributes(ctx context.Context, diags *diag.Diagnos if childAttributeName == "value" { TagAnnotationFhsTrustCtrlPol.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagAnnotationFhsTrustCtrlPolList = append(TagAnnotationFhsTrustCtrlPolList, TagAnnotationFhsTrustCtrlPol) } @@ -620,6 +635,7 @@ func getAndSetFhsTrustCtrlPolAttributes(ctx context.Context, diags *diag.Diagnos if childAttributeName == "value" { TagTagFhsTrustCtrlPol.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagTagFhsTrustCtrlPolList = append(TagTagFhsTrustCtrlPolList, TagTagFhsTrustCtrlPol) } @@ -667,25 +683,24 @@ func setFhsTrustCtrlPolId(ctx context.Context, data *FhsTrustCtrlPolResourceMode data.Id = types.StringValue(fmt.Sprintf("%s/%s", data.ParentDn.ValueString(), rn)) } -func getFhsTrustCtrlPolTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FhsTrustCtrlPolResourceModel, tagAnnotationPlan, tagAnnotationState []TagAnnotationFhsTrustCtrlPolResourceModel) []map[string]interface{} { - +func getFhsTrustCtrlPolTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FhsTrustCtrlPolResourceModel, tagAnnotationFhsTrustCtrlPolPlan, tagAnnotationFhsTrustCtrlPolState []TagAnnotationFhsTrustCtrlPolResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagAnnotation.IsUnknown() { + if !data.TagAnnotation.IsNull() && !data.TagAnnotation.IsUnknown() { tagAnnotationIdentifiers := []TagAnnotationIdentifier{} - for _, tagAnnotation := range tagAnnotationPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagAnnotation.Key.IsUnknown() && !tagAnnotation.Key.IsNull() { - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() + for _, tagAnnotationFhsTrustCtrlPol := range tagAnnotationFhsTrustCtrlPolPlan { + childMap := NewAciObject() + if !tagAnnotationFhsTrustCtrlPol.Key.IsNull() && !tagAnnotationFhsTrustCtrlPol.Key.IsUnknown() { + childMap.Attributes["key"] = tagAnnotationFhsTrustCtrlPol.Key.ValueString() } - if !tagAnnotation.Value.IsUnknown() && !tagAnnotation.Value.IsNull() { - childMap["attributes"]["value"] = tagAnnotation.Value.ValueString() + if !tagAnnotationFhsTrustCtrlPol.Value.IsNull() && !tagAnnotationFhsTrustCtrlPol.Value.IsUnknown() { + childMap.Attributes["value"] = tagAnnotationFhsTrustCtrlPol.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) tagAnnotationIdentifier := TagAnnotationIdentifier{} - tagAnnotationIdentifier.Key = tagAnnotation.Key + tagAnnotationIdentifier.Key = tagAnnotationFhsTrustCtrlPol.Key tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) } - for _, tagAnnotation := range tagAnnotationState { + for _, tagAnnotation := range tagAnnotationFhsTrustCtrlPolState { delete := true for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { if tagAnnotationIdentifier.Key == tagAnnotation.Key { @@ -694,10 +709,10 @@ func getFhsTrustCtrlPolTagAnnotationChildPayloads(ctx context.Context, diags *di } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) + tagAnnotationChildMapForDelete := NewAciObject() + tagAnnotationChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationChildMapForDelete.Attributes["key"] = tagAnnotation.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": tagAnnotationChildMapForDelete}) } } } else { @@ -706,25 +721,25 @@ func getFhsTrustCtrlPolTagAnnotationChildPayloads(ctx context.Context, diags *di return childPayloads } -func getFhsTrustCtrlPolTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FhsTrustCtrlPolResourceModel, tagTagPlan, tagTagState []TagTagFhsTrustCtrlPolResourceModel) []map[string]interface{} { +func getFhsTrustCtrlPolTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FhsTrustCtrlPolResourceModel, tagTagFhsTrustCtrlPolPlan, tagTagFhsTrustCtrlPolState []TagTagFhsTrustCtrlPolResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagTag.IsUnknown() { + if !data.TagTag.IsNull() && !data.TagTag.IsUnknown() { tagTagIdentifiers := []TagTagIdentifier{} - for _, tagTag := range tagTagPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagTag.Key.IsUnknown() && !tagTag.Key.IsNull() { - childMap["attributes"]["key"] = tagTag.Key.ValueString() + for _, tagTagFhsTrustCtrlPol := range tagTagFhsTrustCtrlPolPlan { + childMap := NewAciObject() + if !tagTagFhsTrustCtrlPol.Key.IsNull() && !tagTagFhsTrustCtrlPol.Key.IsUnknown() { + childMap.Attributes["key"] = tagTagFhsTrustCtrlPol.Key.ValueString() } - if !tagTag.Value.IsUnknown() && !tagTag.Value.IsNull() { - childMap["attributes"]["value"] = tagTag.Value.ValueString() + if !tagTagFhsTrustCtrlPol.Value.IsNull() && !tagTagFhsTrustCtrlPol.Value.IsUnknown() { + childMap.Attributes["value"] = tagTagFhsTrustCtrlPol.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) tagTagIdentifier := TagTagIdentifier{} - tagTagIdentifier.Key = tagTag.Key + tagTagIdentifier.Key = tagTagFhsTrustCtrlPol.Key tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) } - for _, tagTag := range tagTagState { + for _, tagTag := range tagTagFhsTrustCtrlPolState { delete := true for _, tagTagIdentifier := range tagTagIdentifiers { if tagTagIdentifier.Key == tagTag.Key { @@ -733,10 +748,10 @@ func getFhsTrustCtrlPolTagTagChildPayloads(ctx context.Context, diags *diag.Diag } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagTag.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) + tagTagChildMapForDelete := NewAciObject() + tagTagChildMapForDelete.Attributes["status"] = "deleted" + tagTagChildMapForDelete.Attributes["key"] = tagTag.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagTag": tagTagChildMapForDelete}) } } } else { diff --git a/internal/provider/resource_aci_trust_control_policy_test.go b/internal/provider/resource_aci_trust_control_policy_test.go index 82a14fe11..ff536f3a6 100644 --- a/internal/provider/resource_aci_trust_control_policy_test.go +++ b/internal/provider/resource_aci_trust_control_policy_test.go @@ -319,24 +319,24 @@ resource "aci_trust_control_policy" "test" { parent_dn = aci_tenant.test.id name = "test_name" annotations = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] tags = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] } ` diff --git a/internal/provider/resource_aci_vrf_fallback_route.go b/internal/provider/resource_aci_vrf_fallback_route.go index 3e70aeee3..868ef59de 100644 --- a/internal/provider/resource_aci_vrf_fallback_route.go +++ b/internal/provider/resource_aci_vrf_fallback_route.go @@ -88,6 +88,13 @@ func getEmptyTagAnnotationFvFBRouteResourceModel() TagAnnotationFvFBRouteResourc } } +var TagAnnotationFvFBRouteType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // TagTagFvFBRouteResourceModel describes the resource data model for the children without relation ships. type TagTagFvFBRouteResourceModel struct { Key types.String `tfsdk:"key"` @@ -101,6 +108,13 @@ func getEmptyTagTagFvFBRouteResourceModel() TagTagFvFBRouteResourceModel { } } +var TagTagFvFBRouteType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + type FvFBRouteIdentifier struct { FbrPrefix types.String } @@ -441,7 +455,7 @@ func (r *FvFBRouteResource) ImportState(ctx context.Context, req resource.Import } func getAndSetFvFBRouteAttributes(ctx context.Context, diags *diag.Diagnostics, client *client.Client, data *FvFBRouteResourceModel) { - requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=children&rsp-subtree-class=%s", data.Id.ValueString(), "fvFBRoute,tagAnnotation,tagTag"), "GET", nil) + requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=full&rsp-subtree-class=%s", data.Id.ValueString(), "fvFBRoute,tagAnnotation,tagTag"), "GET", nil) readData := getEmptyFvFBRouteResourceModel() @@ -490,6 +504,7 @@ func getAndSetFvFBRouteAttributes(ctx context.Context, diags *diag.Diagnostics, if childAttributeName == "value" { TagAnnotationFvFBRoute.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagAnnotationFvFBRouteList = append(TagAnnotationFvFBRouteList, TagAnnotationFvFBRoute) } @@ -502,6 +517,7 @@ func getAndSetFvFBRouteAttributes(ctx context.Context, diags *diag.Diagnostics, if childAttributeName == "value" { TagTagFvFBRoute.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagTagFvFBRouteList = append(TagTagFvFBRouteList, TagTagFvFBRoute) } @@ -549,25 +565,24 @@ func setFvFBRouteId(ctx context.Context, data *FvFBRouteResourceModel) { data.Id = types.StringValue(fmt.Sprintf("%s/%s", data.ParentDn.ValueString(), rn)) } -func getFvFBRouteTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvFBRouteResourceModel, tagAnnotationPlan, tagAnnotationState []TagAnnotationFvFBRouteResourceModel) []map[string]interface{} { - +func getFvFBRouteTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvFBRouteResourceModel, tagAnnotationFvFBRoutePlan, tagAnnotationFvFBRouteState []TagAnnotationFvFBRouteResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagAnnotation.IsUnknown() { + if !data.TagAnnotation.IsNull() && !data.TagAnnotation.IsUnknown() { tagAnnotationIdentifiers := []TagAnnotationIdentifier{} - for _, tagAnnotation := range tagAnnotationPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagAnnotation.Key.IsUnknown() && !tagAnnotation.Key.IsNull() { - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() + for _, tagAnnotationFvFBRoute := range tagAnnotationFvFBRoutePlan { + childMap := NewAciObject() + if !tagAnnotationFvFBRoute.Key.IsNull() && !tagAnnotationFvFBRoute.Key.IsUnknown() { + childMap.Attributes["key"] = tagAnnotationFvFBRoute.Key.ValueString() } - if !tagAnnotation.Value.IsUnknown() && !tagAnnotation.Value.IsNull() { - childMap["attributes"]["value"] = tagAnnotation.Value.ValueString() + if !tagAnnotationFvFBRoute.Value.IsNull() && !tagAnnotationFvFBRoute.Value.IsUnknown() { + childMap.Attributes["value"] = tagAnnotationFvFBRoute.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) tagAnnotationIdentifier := TagAnnotationIdentifier{} - tagAnnotationIdentifier.Key = tagAnnotation.Key + tagAnnotationIdentifier.Key = tagAnnotationFvFBRoute.Key tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) } - for _, tagAnnotation := range tagAnnotationState { + for _, tagAnnotation := range tagAnnotationFvFBRouteState { delete := true for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { if tagAnnotationIdentifier.Key == tagAnnotation.Key { @@ -576,10 +591,10 @@ func getFvFBRouteTagAnnotationChildPayloads(ctx context.Context, diags *diag.Dia } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) + tagAnnotationChildMapForDelete := NewAciObject() + tagAnnotationChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationChildMapForDelete.Attributes["key"] = tagAnnotation.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": tagAnnotationChildMapForDelete}) } } } else { @@ -588,25 +603,25 @@ func getFvFBRouteTagAnnotationChildPayloads(ctx context.Context, diags *diag.Dia return childPayloads } -func getFvFBRouteTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvFBRouteResourceModel, tagTagPlan, tagTagState []TagTagFvFBRouteResourceModel) []map[string]interface{} { +func getFvFBRouteTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvFBRouteResourceModel, tagTagFvFBRoutePlan, tagTagFvFBRouteState []TagTagFvFBRouteResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagTag.IsUnknown() { + if !data.TagTag.IsNull() && !data.TagTag.IsUnknown() { tagTagIdentifiers := []TagTagIdentifier{} - for _, tagTag := range tagTagPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagTag.Key.IsUnknown() && !tagTag.Key.IsNull() { - childMap["attributes"]["key"] = tagTag.Key.ValueString() + for _, tagTagFvFBRoute := range tagTagFvFBRoutePlan { + childMap := NewAciObject() + if !tagTagFvFBRoute.Key.IsNull() && !tagTagFvFBRoute.Key.IsUnknown() { + childMap.Attributes["key"] = tagTagFvFBRoute.Key.ValueString() } - if !tagTag.Value.IsUnknown() && !tagTag.Value.IsNull() { - childMap["attributes"]["value"] = tagTag.Value.ValueString() + if !tagTagFvFBRoute.Value.IsNull() && !tagTagFvFBRoute.Value.IsUnknown() { + childMap.Attributes["value"] = tagTagFvFBRoute.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) tagTagIdentifier := TagTagIdentifier{} - tagTagIdentifier.Key = tagTag.Key + tagTagIdentifier.Key = tagTagFvFBRoute.Key tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) } - for _, tagTag := range tagTagState { + for _, tagTag := range tagTagFvFBRouteState { delete := true for _, tagTagIdentifier := range tagTagIdentifiers { if tagTagIdentifier.Key == tagTag.Key { @@ -615,10 +630,10 @@ func getFvFBRouteTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostic } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagTag.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) + tagTagChildMapForDelete := NewAciObject() + tagTagChildMapForDelete.Attributes["status"] = "deleted" + tagTagChildMapForDelete.Attributes["key"] = tagTag.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagTag": tagTagChildMapForDelete}) } } } else { diff --git a/internal/provider/resource_aci_vrf_fallback_route_group.go b/internal/provider/resource_aci_vrf_fallback_route_group.go index a5934dbb4..720c0843d 100644 --- a/internal/provider/resource_aci_vrf_fallback_route_group.go +++ b/internal/provider/resource_aci_vrf_fallback_route_group.go @@ -69,6 +69,8 @@ func getEmptyFvFBRGroupResourceModel() *FvFBRGroupResourceModel { "name": types.StringType, "name_alias": types.StringType, "fallback_member": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvFBRMemberFvFBRGroupType}, + "tags": types.SetType{ElemType: TagTagFvFBRMemberFvFBRGroupType}, }, }), FvFBRoute: types.ObjectNull(map[string]attr.Type{ @@ -77,6 +79,8 @@ func getEmptyFvFBRGroupResourceModel() *FvFBRGroupResourceModel { "prefix_address": types.StringType, "name": types.StringType, "name_alias": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvFBRouteFvFBRGroupType}, + "tags": types.SetType{ElemType: TagTagFvFBRouteFvFBRGroupType}, }), TagAnnotation: types.SetNull(types.ObjectType{ AttrTypes: map[string]attr.Type{ @@ -95,11 +99,13 @@ func getEmptyFvFBRGroupResourceModel() *FvFBRGroupResourceModel { // FvFBRMemberFvFBRGroupResourceModel describes the resource data model for the children without relation ships. type FvFBRMemberFvFBRGroupResourceModel struct { - Annotation types.String `tfsdk:"annotation"` - Descr types.String `tfsdk:"description"` - Name types.String `tfsdk:"name"` - NameAlias types.String `tfsdk:"name_alias"` - RnhAddr types.String `tfsdk:"fallback_member"` + Annotation types.String `tfsdk:"annotation"` + Descr types.String `tfsdk:"description"` + Name types.String `tfsdk:"name"` + NameAlias types.String `tfsdk:"name_alias"` + RnhAddr types.String `tfsdk:"fallback_member"` + TagAnnotation types.Set `tfsdk:"annotations"` + TagTag types.Set `tfsdk:"tags"` } func getEmptyFvFBRMemberFvFBRGroupResourceModel() FvFBRMemberFvFBRGroupResourceModel { @@ -109,16 +115,82 @@ func getEmptyFvFBRMemberFvFBRGroupResourceModel() FvFBRMemberFvFBRGroupResourceM Name: basetypes.NewStringNull(), NameAlias: basetypes.NewStringNull(), RnhAddr: basetypes.NewStringNull(), + TagAnnotation: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + } +} + +var FvFBRMemberFvFBRGroupType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "annotation": types.StringType, + "description": types.StringType, + "name": types.StringType, + "name_alias": types.StringType, + "fallback_member": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvFBRMemberFvFBRGroupType}, + "tags": types.SetType{ElemType: TagTagFvFBRMemberFvFBRGroupType}, + }, +} + +// TagAnnotationFvFBRMemberFvFBRGroupResourceModel describes the resource data model for the children without relation ships. +type TagAnnotationFvFBRMemberFvFBRGroupResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagAnnotationFvFBRMemberFvFBRGroupResourceModel() TagAnnotationFvFBRMemberFvFBRGroupResourceModel { + return TagAnnotationFvFBRMemberFvFBRGroupResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), } } +var TagAnnotationFvFBRMemberFvFBRGroupType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + +// TagTagFvFBRMemberFvFBRGroupResourceModel describes the resource data model for the children without relation ships. +type TagTagFvFBRMemberFvFBRGroupResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagTagFvFBRMemberFvFBRGroupResourceModel() TagTagFvFBRMemberFvFBRGroupResourceModel { + return TagTagFvFBRMemberFvFBRGroupResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagTagFvFBRMemberFvFBRGroupType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // FvFBRouteFvFBRGroupResourceModel describes the resource data model for the children without relation ships. type FvFBRouteFvFBRGroupResourceModel struct { - Annotation types.String `tfsdk:"annotation"` - Descr types.String `tfsdk:"description"` - FbrPrefix types.String `tfsdk:"prefix_address"` - Name types.String `tfsdk:"name"` - NameAlias types.String `tfsdk:"name_alias"` + Annotation types.String `tfsdk:"annotation"` + Descr types.String `tfsdk:"description"` + FbrPrefix types.String `tfsdk:"prefix_address"` + Name types.String `tfsdk:"name"` + NameAlias types.String `tfsdk:"name_alias"` + TagAnnotation types.Set `tfsdk:"annotations"` + TagTag types.Set `tfsdk:"tags"` } func getEmptyFvFBRouteFvFBRGroupResourceModel() FvFBRouteFvFBRGroupResourceModel { @@ -128,6 +200,18 @@ func getEmptyFvFBRouteFvFBRGroupResourceModel() FvFBRouteFvFBRGroupResourceModel FbrPrefix: basetypes.NewStringNull(), Name: basetypes.NewStringNull(), NameAlias: basetypes.NewStringNull(), + TagAnnotation: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), + TagTag: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, + }), } } @@ -137,6 +221,48 @@ var FvFBRouteFvFBRGroupType = map[string]attr.Type{ "prefix_address": types.StringType, "name": types.StringType, "name_alias": types.StringType, + "annotations": types.SetType{ElemType: TagAnnotationFvFBRouteFvFBRGroupType}, + "tags": types.SetType{ElemType: TagTagFvFBRouteFvFBRGroupType}, +} + +// TagAnnotationFvFBRouteFvFBRGroupResourceModel describes the resource data model for the children without relation ships. +type TagAnnotationFvFBRouteFvFBRGroupResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagAnnotationFvFBRouteFvFBRGroupResourceModel() TagAnnotationFvFBRouteFvFBRGroupResourceModel { + return TagAnnotationFvFBRouteFvFBRGroupResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagAnnotationFvFBRouteFvFBRGroupType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + +// TagTagFvFBRouteFvFBRGroupResourceModel describes the resource data model for the children without relation ships. +type TagTagFvFBRouteFvFBRGroupResourceModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +func getEmptyTagTagFvFBRouteFvFBRGroupResourceModel() TagTagFvFBRouteFvFBRGroupResourceModel { + return TagTagFvFBRouteFvFBRGroupResourceModel{ + Key: basetypes.NewStringNull(), + Value: basetypes.NewStringNull(), + } +} + +var TagTagFvFBRouteFvFBRGroupType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, } // TagAnnotationFvFBRGroupResourceModel describes the resource data model for the children without relation ships. @@ -152,6 +278,13 @@ func getEmptyTagAnnotationFvFBRGroupResourceModel() TagAnnotationFvFBRGroupResou } } +var TagAnnotationFvFBRGroupType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // TagTagFvFBRGroupResourceModel describes the resource data model for the children without relation ships. type TagTagFvFBRGroupResourceModel struct { Key types.String `tfsdk:"key"` @@ -165,6 +298,13 @@ func getEmptyTagTagFvFBRGroupResourceModel() TagTagFvFBRGroupResourceModel { } } +var TagTagFvFBRGroupType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + type FvFBRGroupIdentifier struct { Name types.String } @@ -314,6 +454,58 @@ func (r *FvFBRGroupResource) Schema(ctx context.Context, req resource.SchemaRequ }, MarkdownDescription: `The address of the VRF Fallback Route Group Member object.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, }, @@ -368,6 +560,58 @@ func (r *FvFBRGroupResource) Schema(ctx context.Context, req resource.SchemaRequ }, MarkdownDescription: `The name alias of the VRF Fallback Route object.`, }, + "annotations": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, + "tags": schema.SetNestedAttribute{ + MarkdownDescription: ``, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The key used to uniquely identify this configuration object.`, + }, + "value": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The value of the property.`, + }, + }, + }, + }, }, }, "annotations": schema.SetNestedAttribute{ @@ -619,7 +863,7 @@ func (r *FvFBRGroupResource) ImportState(ctx context.Context, req resource.Impor } func getAndSetFvFBRGroupAttributes(ctx context.Context, diags *diag.Diagnostics, client *client.Client, data *FvFBRGroupResourceModel) { - requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=children&rsp-subtree-class=%s", data.Id.ValueString(), "fvFBRGroup,fvFBRMember,fvFBRoute,tagAnnotation,tagTag"), "GET", nil) + requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=full&rsp-subtree-class=%s", data.Id.ValueString(), "fvFBRGroup,fvFBRMember,fvFBRoute,tagAnnotation,tagTag,tagAnnotation,tagTag,tagAnnotation,tagTag"), "GET", nil) readData := getEmptyFvFBRGroupResourceModel() @@ -676,7 +920,47 @@ func getAndSetFvFBRGroupAttributes(ctx context.Context, diags *diag.Diagnostics, if childAttributeName == "rnhAddr" { FvFBRMemberFvFBRGroup.RnhAddr = basetypes.NewStringValue(childAttributeValue.(string)) } + + } + TagAnnotationFvFBRMemberFvFBRGroupList := make([]TagAnnotationFvFBRMemberFvFBRGroupResourceModel, 0) + TagTagFvFBRMemberFvFBRGroupList := make([]TagTagFvFBRMemberFvFBRGroupResourceModel, 0) + childrenOfFvFBRMemberFvFBRGroup, childrenOfFvFBRMemberFvFBRGroupExist := childClassDetails.(map[string]interface{})["children"] + if childrenOfFvFBRMemberFvFBRGroupExist { + for _, childFvFBRMemberFvFBRGroup := range childrenOfFvFBRMemberFvFBRGroup.([]interface{}) { + for childClassNameFvFBRMemberFvFBRGroup, childClassDetailsFvFBRMemberFvFBRGroup := range childFvFBRMemberFvFBRGroup.(map[string]interface{}) { + if childClassNameFvFBRMemberFvFBRGroup == "tagAnnotation" { + TagAnnotationFvFBRMemberFvFBRGroup := getEmptyTagAnnotationFvFBRMemberFvFBRGroupResourceModel() + tagAnnotationchildAttributeValue := childClassDetailsFvFBRMemberFvFBRGroup.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagAnnotationchildAttributeValue { + if childAttributeName == "key" { + TagAnnotationFvFBRMemberFvFBRGroup.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagAnnotationFvFBRMemberFvFBRGroup.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagAnnotationFvFBRMemberFvFBRGroupList = append(TagAnnotationFvFBRMemberFvFBRGroupList, TagAnnotationFvFBRMemberFvFBRGroup) + } + if childClassNameFvFBRMemberFvFBRGroup == "tagTag" { + TagTagFvFBRMemberFvFBRGroup := getEmptyTagTagFvFBRMemberFvFBRGroupResourceModel() + tagTagchildAttributeValue := childClassDetailsFvFBRMemberFvFBRGroup.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagTagchildAttributeValue { + if childAttributeName == "key" { + TagTagFvFBRMemberFvFBRGroup.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagTagFvFBRMemberFvFBRGroup.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagTagFvFBRMemberFvFBRGroupList = append(TagTagFvFBRMemberFvFBRGroupList, TagTagFvFBRMemberFvFBRGroup) + } + } + } } + TagAnnotationFvFBRMemberFvFBRGroupSet, _ := types.SetValueFrom(ctx, TagAnnotationFvFBRMemberFvFBRGroupType, TagAnnotationFvFBRMemberFvFBRGroupList) + FvFBRMemberFvFBRGroup.TagAnnotation = TagAnnotationFvFBRMemberFvFBRGroupSet + TagTagFvFBRMemberFvFBRGroupSet, _ := types.SetValueFrom(ctx, TagTagFvFBRMemberFvFBRGroupType, TagTagFvFBRMemberFvFBRGroupList) + FvFBRMemberFvFBRGroup.TagTag = TagTagFvFBRMemberFvFBRGroupSet FvFBRMemberFvFBRGroupList = append(FvFBRMemberFvFBRGroupList, FvFBRMemberFvFBRGroup) } if childClassName == "fvFBRoute" { @@ -697,7 +981,47 @@ func getAndSetFvFBRGroupAttributes(ctx context.Context, diags *diag.Diagnostics, if childAttributeName == "nameAlias" { FvFBRouteFvFBRGroup.NameAlias = basetypes.NewStringValue(childAttributeValue.(string)) } + + } + TagAnnotationFvFBRouteFvFBRGroupList := make([]TagAnnotationFvFBRouteFvFBRGroupResourceModel, 0) + TagTagFvFBRouteFvFBRGroupList := make([]TagTagFvFBRouteFvFBRGroupResourceModel, 0) + childrenOfFvFBRouteFvFBRGroup, childrenOfFvFBRouteFvFBRGroupExist := childClassDetails.(map[string]interface{})["children"] + if childrenOfFvFBRouteFvFBRGroupExist { + for _, childFvFBRouteFvFBRGroup := range childrenOfFvFBRouteFvFBRGroup.([]interface{}) { + for childClassNameFvFBRouteFvFBRGroup, childClassDetailsFvFBRouteFvFBRGroup := range childFvFBRouteFvFBRGroup.(map[string]interface{}) { + if childClassNameFvFBRouteFvFBRGroup == "tagAnnotation" { + TagAnnotationFvFBRouteFvFBRGroup := getEmptyTagAnnotationFvFBRouteFvFBRGroupResourceModel() + tagAnnotationchildAttributeValue := childClassDetailsFvFBRouteFvFBRGroup.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagAnnotationchildAttributeValue { + if childAttributeName == "key" { + TagAnnotationFvFBRouteFvFBRGroup.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagAnnotationFvFBRouteFvFBRGroup.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagAnnotationFvFBRouteFvFBRGroupList = append(TagAnnotationFvFBRouteFvFBRGroupList, TagAnnotationFvFBRouteFvFBRGroup) + } + if childClassNameFvFBRouteFvFBRGroup == "tagTag" { + TagTagFvFBRouteFvFBRGroup := getEmptyTagTagFvFBRouteFvFBRGroupResourceModel() + tagTagchildAttributeValue := childClassDetailsFvFBRouteFvFBRGroup.(map[string]interface{})["attributes"].(map[string]interface{}) + for childAttributeName, childAttributeValue := range tagTagchildAttributeValue { + if childAttributeName == "key" { + TagTagFvFBRouteFvFBRGroup.Key = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "value" { + TagTagFvFBRouteFvFBRGroup.Value = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + TagTagFvFBRouteFvFBRGroupList = append(TagTagFvFBRouteFvFBRGroupList, TagTagFvFBRouteFvFBRGroup) + } + } + } } + TagAnnotationFvFBRouteFvFBRGroupSet, _ := types.SetValueFrom(ctx, TagAnnotationFvFBRouteFvFBRGroupType, TagAnnotationFvFBRouteFvFBRGroupList) + FvFBRouteFvFBRGroup.TagAnnotation = TagAnnotationFvFBRouteFvFBRGroupSet + TagTagFvFBRouteFvFBRGroupSet, _ := types.SetValueFrom(ctx, TagTagFvFBRouteFvFBRGroupType, TagTagFvFBRouteFvFBRGroupList) + FvFBRouteFvFBRGroup.TagTag = TagTagFvFBRouteFvFBRGroupSet FvFBRouteFvFBRGroupList = append(FvFBRouteFvFBRGroupList, FvFBRouteFvFBRGroup) } if childClassName == "tagAnnotation" { @@ -709,6 +1033,7 @@ func getAndSetFvFBRGroupAttributes(ctx context.Context, diags *diag.Diagnostics, if childAttributeName == "value" { TagAnnotationFvFBRGroup.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagAnnotationFvFBRGroupList = append(TagAnnotationFvFBRGroupList, TagAnnotationFvFBRGroup) } @@ -721,6 +1046,7 @@ func getAndSetFvFBRGroupAttributes(ctx context.Context, diags *diag.Diagnostics, if childAttributeName == "value" { TagTagFvFBRGroup.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagTagFvFBRGroupList = append(TagTagFvFBRGroupList, TagTagFvFBRGroup) } @@ -777,36 +1103,111 @@ func setFvFBRGroupId(ctx context.Context, data *FvFBRGroupResourceModel) { data.Id = types.StringValue(fmt.Sprintf("%s/%s", data.ParentDn.ValueString(), rn)) } -func getFvFBRGroupFvFBRMemberChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvFBRGroupResourceModel, fvFBRMemberPlan, fvFBRMemberState []FvFBRMemberFvFBRGroupResourceModel) []map[string]interface{} { - +func getFvFBRGroupFvFBRMemberChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvFBRGroupResourceModel, fvFBRMemberFvFBRGroupPlan, fvFBRMemberFvFBRGroupState []FvFBRMemberFvFBRGroupResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.FvFBRMember.IsUnknown() { + if !data.FvFBRMember.IsNull() && !data.FvFBRMember.IsUnknown() { fvFBRMemberIdentifiers := []FvFBRMemberIdentifier{} - for _, fvFBRMember := range fvFBRMemberPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !fvFBRMember.Annotation.IsUnknown() && !fvFBRMember.Annotation.IsNull() { - childMap["attributes"]["annotation"] = fvFBRMember.Annotation.ValueString() + for _, fvFBRMemberFvFBRGroup := range fvFBRMemberFvFBRGroupPlan { + FvFBRMemberFvFBRGroupChildren := make([]map[string]interface{}, 0) + childMap := NewAciObject() + if !fvFBRMemberFvFBRGroup.Annotation.IsNull() && !fvFBRMemberFvFBRGroup.Annotation.IsUnknown() { + childMap.Attributes["annotation"] = fvFBRMemberFvFBRGroup.Annotation.ValueString() } else { - childMap["attributes"]["annotation"] = globalAnnotation + childMap.Attributes["annotation"] = globalAnnotation + } + if !fvFBRMemberFvFBRGroup.Descr.IsNull() && !fvFBRMemberFvFBRGroup.Descr.IsUnknown() { + childMap.Attributes["descr"] = fvFBRMemberFvFBRGroup.Descr.ValueString() + } + if !fvFBRMemberFvFBRGroup.Name.IsNull() && !fvFBRMemberFvFBRGroup.Name.IsUnknown() { + childMap.Attributes["name"] = fvFBRMemberFvFBRGroup.Name.ValueString() + } + if !fvFBRMemberFvFBRGroup.NameAlias.IsNull() && !fvFBRMemberFvFBRGroup.NameAlias.IsUnknown() { + childMap.Attributes["nameAlias"] = fvFBRMemberFvFBRGroup.NameAlias.ValueString() } - if !fvFBRMember.Descr.IsUnknown() && !fvFBRMember.Descr.IsNull() { - childMap["attributes"]["descr"] = fvFBRMember.Descr.ValueString() + if !fvFBRMemberFvFBRGroup.RnhAddr.IsNull() && !fvFBRMemberFvFBRGroup.RnhAddr.IsUnknown() { + childMap.Attributes["rnhAddr"] = fvFBRMemberFvFBRGroup.RnhAddr.ValueString() } - if !fvFBRMember.Name.IsUnknown() && !fvFBRMember.Name.IsNull() { - childMap["attributes"]["name"] = fvFBRMember.Name.ValueString() + + var tagAnnotationFvFBRMemberFvFBRGroupPlan, tagAnnotationFvFBRMemberFvFBRGroupState []TagAnnotationFvFBRMemberFvFBRGroupResourceModel + fvFBRMemberFvFBRGroup.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvFBRMemberFvFBRGroupPlan, false) + for _, tagAnnotationFvFBRMemberFvFBRGroupstate := range fvFBRMemberFvFBRGroupState { + tagAnnotationFvFBRMemberFvFBRGroupstate.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvFBRMemberFvFBRGroupState, false) } - if !fvFBRMember.NameAlias.IsUnknown() && !fvFBRMember.NameAlias.IsNull() { - childMap["attributes"]["nameAlias"] = fvFBRMember.NameAlias.ValueString() + if !fvFBRMemberFvFBRGroup.TagAnnotation.IsNull() && !fvFBRMemberFvFBRGroup.TagAnnotation.IsUnknown() { + tagAnnotationIdentifiers := []TagAnnotationIdentifier{} + for _, tagAnnotationFvFBRMemberFvFBRGroup := range tagAnnotationFvFBRMemberFvFBRGroupPlan { + tagAnnotationFvFBRMemberFvFBRGroupChildMap := NewAciObject() + if !tagAnnotationFvFBRMemberFvFBRGroup.Key.IsNull() && !tagAnnotationFvFBRMemberFvFBRGroup.Key.IsUnknown() { + tagAnnotationFvFBRMemberFvFBRGroupChildMap.Attributes["key"] = tagAnnotationFvFBRMemberFvFBRGroup.Key.ValueString() + } + if !tagAnnotationFvFBRMemberFvFBRGroup.Value.IsNull() && !tagAnnotationFvFBRMemberFvFBRGroup.Value.IsUnknown() { + tagAnnotationFvFBRMemberFvFBRGroupChildMap.Attributes["value"] = tagAnnotationFvFBRMemberFvFBRGroup.Value.ValueString() + } + FvFBRMemberFvFBRGroupChildren = append(FvFBRMemberFvFBRGroupChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvFBRMemberFvFBRGroupChildMap}) + tagAnnotationIdentifier := TagAnnotationIdentifier{} + tagAnnotationIdentifier.Key = tagAnnotationFvFBRMemberFvFBRGroup.Key + tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) + } + for _, tagAnnotationFvFBRMemberFvFBRGroup := range tagAnnotationFvFBRMemberFvFBRGroupState { + delete := true + for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { + if tagAnnotationIdentifier.Key == tagAnnotationFvFBRMemberFvFBRGroup.Key { + delete = false + break + } + } + if delete { + tagAnnotationFvFBRMemberFvFBRGroupChildMapForDelete := NewAciObject() + tagAnnotationFvFBRMemberFvFBRGroupChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationFvFBRMemberFvFBRGroupChildMapForDelete.Attributes["key"] = tagAnnotationFvFBRMemberFvFBRGroup.Key.ValueString() + FvFBRMemberFvFBRGroupChildren = append(FvFBRMemberFvFBRGroupChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvFBRMemberFvFBRGroupChildMapForDelete}) + } + } } - if !fvFBRMember.RnhAddr.IsUnknown() && !fvFBRMember.RnhAddr.IsNull() { - childMap["attributes"]["rnhAddr"] = fvFBRMember.RnhAddr.ValueString() + + var tagTagFvFBRMemberFvFBRGroupPlan, tagTagFvFBRMemberFvFBRGroupState []TagTagFvFBRMemberFvFBRGroupResourceModel + fvFBRMemberFvFBRGroup.TagTag.ElementsAs(ctx, &tagTagFvFBRMemberFvFBRGroupPlan, false) + for _, tagTagFvFBRMemberFvFBRGroupstate := range fvFBRMemberFvFBRGroupState { + tagTagFvFBRMemberFvFBRGroupstate.TagTag.ElementsAs(ctx, &tagTagFvFBRMemberFvFBRGroupState, false) } + if !fvFBRMemberFvFBRGroup.TagTag.IsNull() && !fvFBRMemberFvFBRGroup.TagTag.IsUnknown() { + tagTagIdentifiers := []TagTagIdentifier{} + for _, tagTagFvFBRMemberFvFBRGroup := range tagTagFvFBRMemberFvFBRGroupPlan { + tagTagFvFBRMemberFvFBRGroupChildMap := NewAciObject() + if !tagTagFvFBRMemberFvFBRGroup.Key.IsNull() && !tagTagFvFBRMemberFvFBRGroup.Key.IsUnknown() { + tagTagFvFBRMemberFvFBRGroupChildMap.Attributes["key"] = tagTagFvFBRMemberFvFBRGroup.Key.ValueString() + } + if !tagTagFvFBRMemberFvFBRGroup.Value.IsNull() && !tagTagFvFBRMemberFvFBRGroup.Value.IsUnknown() { + tagTagFvFBRMemberFvFBRGroupChildMap.Attributes["value"] = tagTagFvFBRMemberFvFBRGroup.Value.ValueString() + } + FvFBRMemberFvFBRGroupChildren = append(FvFBRMemberFvFBRGroupChildren, map[string]interface{}{"tagTag": tagTagFvFBRMemberFvFBRGroupChildMap}) + tagTagIdentifier := TagTagIdentifier{} + tagTagIdentifier.Key = tagTagFvFBRMemberFvFBRGroup.Key + tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) + } + for _, tagTagFvFBRMemberFvFBRGroup := range tagTagFvFBRMemberFvFBRGroupState { + delete := true + for _, tagTagIdentifier := range tagTagIdentifiers { + if tagTagIdentifier.Key == tagTagFvFBRMemberFvFBRGroup.Key { + delete = false + break + } + } + if delete { + tagTagFvFBRMemberFvFBRGroupChildMapForDelete := NewAciObject() + tagTagFvFBRMemberFvFBRGroupChildMapForDelete.Attributes["status"] = "deleted" + tagTagFvFBRMemberFvFBRGroupChildMapForDelete.Attributes["key"] = tagTagFvFBRMemberFvFBRGroup.Key.ValueString() + FvFBRMemberFvFBRGroupChildren = append(FvFBRMemberFvFBRGroupChildren, map[string]interface{}{"tagTag": tagTagFvFBRMemberFvFBRGroupChildMapForDelete}) + } + } + } + childMap.Children = FvFBRMemberFvFBRGroupChildren childPayloads = append(childPayloads, map[string]interface{}{"fvFBRMember": childMap}) fvFBRMemberIdentifier := FvFBRMemberIdentifier{} - fvFBRMemberIdentifier.RnhAddr = fvFBRMember.RnhAddr + fvFBRMemberIdentifier.RnhAddr = fvFBRMemberFvFBRGroup.RnhAddr fvFBRMemberIdentifiers = append(fvFBRMemberIdentifiers, fvFBRMemberIdentifier) } - for _, fvFBRMember := range fvFBRMemberState { + for _, fvFBRMember := range fvFBRMemberFvFBRGroupState { delete := true for _, fvFBRMemberIdentifier := range fvFBRMemberIdentifiers { if fvFBRMemberIdentifier.RnhAddr == fvFBRMember.RnhAddr { @@ -815,10 +1216,10 @@ func getFvFBRGroupFvFBRMemberChildPayloads(ctx context.Context, diags *diag.Diag } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["rnhAddr"] = fvFBRMember.RnhAddr.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"fvFBRMember": childMap}) + fvFBRMemberChildMapForDelete := NewAciObject() + fvFBRMemberChildMapForDelete.Attributes["status"] = "deleted" + fvFBRMemberChildMapForDelete.Attributes["rnhAddr"] = fvFBRMember.RnhAddr.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"fvFBRMember": fvFBRMemberChildMapForDelete}) } } } else { @@ -827,33 +1228,109 @@ func getFvFBRGroupFvFBRMemberChildPayloads(ctx context.Context, diags *diag.Diag return childPayloads } -func getFvFBRGroupFvFBRouteChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvFBRGroupResourceModel, fvFBRoutePlan, fvFBRouteState FvFBRouteFvFBRGroupResourceModel) []map[string]interface{} { +func getFvFBRGroupFvFBRouteChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvFBRGroupResourceModel, fvFBRouteFvFBRGroupPlan, fvFBRouteFvFBRGroupState FvFBRouteFvFBRGroupResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.FvFBRoute.IsUnknown() { - childMap := map[string]map[string]interface{}{"attributes": {}} + if !data.FvFBRoute.IsNull() && !data.FvFBRoute.IsUnknown() { + FvFBRouteFvFBRGroupChildren := make([]map[string]interface{}, 0) + childMap := NewAciObject() if !IsEmptySingleNestedAttribute(data.FvFBRoute.Attributes()) { - if !fvFBRoutePlan.Annotation.IsUnknown() && !fvFBRoutePlan.Annotation.IsNull() { - childMap["attributes"]["annotation"] = fvFBRoutePlan.Annotation.ValueString() + if !fvFBRouteFvFBRGroupPlan.Annotation.IsUnknown() && !fvFBRouteFvFBRGroupPlan.Annotation.IsNull() { + childMap.Attributes["annotation"] = fvFBRouteFvFBRGroupPlan.Annotation.ValueString() } else { - childMap["attributes"]["annotation"] = globalAnnotation + childMap.Attributes["annotation"] = globalAnnotation } - if !fvFBRoutePlan.Descr.IsUnknown() && !fvFBRoutePlan.Descr.IsNull() { - childMap["attributes"]["descr"] = fvFBRoutePlan.Descr.ValueString() + if !fvFBRouteFvFBRGroupPlan.Descr.IsUnknown() && !fvFBRouteFvFBRGroupPlan.Descr.IsNull() { + childMap.Attributes["descr"] = fvFBRouteFvFBRGroupPlan.Descr.ValueString() } - if !fvFBRoutePlan.FbrPrefix.IsUnknown() && !fvFBRoutePlan.FbrPrefix.IsNull() { - childMap["attributes"]["fbrPrefix"] = fvFBRoutePlan.FbrPrefix.ValueString() + if !fvFBRouteFvFBRGroupPlan.FbrPrefix.IsUnknown() && !fvFBRouteFvFBRGroupPlan.FbrPrefix.IsNull() { + childMap.Attributes["fbrPrefix"] = fvFBRouteFvFBRGroupPlan.FbrPrefix.ValueString() } - if !fvFBRoutePlan.Name.IsUnknown() && !fvFBRoutePlan.Name.IsNull() { - childMap["attributes"]["name"] = fvFBRoutePlan.Name.ValueString() + if !fvFBRouteFvFBRGroupPlan.Name.IsUnknown() && !fvFBRouteFvFBRGroupPlan.Name.IsNull() { + childMap.Attributes["name"] = fvFBRouteFvFBRGroupPlan.Name.ValueString() } - if !fvFBRoutePlan.NameAlias.IsUnknown() && !fvFBRoutePlan.NameAlias.IsNull() { - childMap["attributes"]["nameAlias"] = fvFBRoutePlan.NameAlias.ValueString() + if !fvFBRouteFvFBRGroupPlan.NameAlias.IsUnknown() && !fvFBRouteFvFBRGroupPlan.NameAlias.IsNull() { + childMap.Attributes["nameAlias"] = fvFBRouteFvFBRGroupPlan.NameAlias.ValueString() } } else { - childMap["attributes"]["fbrPrefix"] = fvFBRouteState.FbrPrefix.ValueString() - childMap["attributes"]["status"] = "deleted" + childMap.Attributes["fbrPrefix"] = fvFBRouteFvFBRGroupState.FbrPrefix.ValueString() + childMap.Attributes["status"] = "deleted" + } + + var tagAnnotationFvFBRouteFvFBRGroupPlan, tagAnnotationFvFBRouteFvFBRGroupState []TagAnnotationFvFBRouteFvFBRGroupResourceModel + fvFBRouteFvFBRGroupPlan.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvFBRouteFvFBRGroupPlan, false) + if !fvFBRouteFvFBRGroupState.TagAnnotation.IsNull() { + fvFBRouteFvFBRGroupState.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvFBRouteFvFBRGroupState, false) + } + if !fvFBRouteFvFBRGroupPlan.TagAnnotation.IsNull() && !fvFBRouteFvFBRGroupPlan.TagAnnotation.IsUnknown() { + tagAnnotationIdentifiers := []TagAnnotationIdentifier{} + for _, tagAnnotationFvFBRouteFvFBRGroup := range tagAnnotationFvFBRouteFvFBRGroupPlan { + tagAnnotationFvFBRouteFvFBRGroupChildMap := NewAciObject() + if !tagAnnotationFvFBRouteFvFBRGroup.Key.IsNull() && !tagAnnotationFvFBRouteFvFBRGroup.Key.IsUnknown() { + tagAnnotationFvFBRouteFvFBRGroupChildMap.Attributes["key"] = tagAnnotationFvFBRouteFvFBRGroup.Key.ValueString() + } + if !tagAnnotationFvFBRouteFvFBRGroup.Value.IsNull() && !tagAnnotationFvFBRouteFvFBRGroup.Value.IsUnknown() { + tagAnnotationFvFBRouteFvFBRGroupChildMap.Attributes["value"] = tagAnnotationFvFBRouteFvFBRGroup.Value.ValueString() + } + FvFBRouteFvFBRGroupChildren = append(FvFBRouteFvFBRGroupChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvFBRouteFvFBRGroupChildMap}) + tagAnnotationIdentifier := TagAnnotationIdentifier{} + tagAnnotationIdentifier.Key = tagAnnotationFvFBRouteFvFBRGroup.Key + tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) + } + for _, tagAnnotationFvFBRouteFvFBRGroup := range tagAnnotationFvFBRouteFvFBRGroupState { + delete := true + for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { + if tagAnnotationIdentifier.Key == tagAnnotationFvFBRouteFvFBRGroup.Key { + delete = false + break + } + } + if delete { + tagAnnotationFvFBRouteFvFBRGroupChildMapForDelete := NewAciObject() + tagAnnotationFvFBRouteFvFBRGroupChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationFvFBRouteFvFBRGroupChildMapForDelete.Attributes["key"] = tagAnnotationFvFBRouteFvFBRGroup.Key.ValueString() + FvFBRouteFvFBRGroupChildren = append(FvFBRouteFvFBRGroupChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvFBRouteFvFBRGroupChildMapForDelete}) + } + } + } + + var tagTagFvFBRouteFvFBRGroupPlan, tagTagFvFBRouteFvFBRGroupState []TagTagFvFBRouteFvFBRGroupResourceModel + fvFBRouteFvFBRGroupPlan.TagTag.ElementsAs(ctx, &tagTagFvFBRouteFvFBRGroupPlan, false) + if !fvFBRouteFvFBRGroupState.TagTag.IsNull() { + fvFBRouteFvFBRGroupState.TagTag.ElementsAs(ctx, &tagTagFvFBRouteFvFBRGroupState, false) + } + if !fvFBRouteFvFBRGroupPlan.TagTag.IsNull() && !fvFBRouteFvFBRGroupPlan.TagTag.IsUnknown() { + tagTagIdentifiers := []TagTagIdentifier{} + for _, tagTagFvFBRouteFvFBRGroup := range tagTagFvFBRouteFvFBRGroupPlan { + tagTagFvFBRouteFvFBRGroupChildMap := NewAciObject() + if !tagTagFvFBRouteFvFBRGroup.Key.IsNull() && !tagTagFvFBRouteFvFBRGroup.Key.IsUnknown() { + tagTagFvFBRouteFvFBRGroupChildMap.Attributes["key"] = tagTagFvFBRouteFvFBRGroup.Key.ValueString() + } + if !tagTagFvFBRouteFvFBRGroup.Value.IsNull() && !tagTagFvFBRouteFvFBRGroup.Value.IsUnknown() { + tagTagFvFBRouteFvFBRGroupChildMap.Attributes["value"] = tagTagFvFBRouteFvFBRGroup.Value.ValueString() + } + FvFBRouteFvFBRGroupChildren = append(FvFBRouteFvFBRGroupChildren, map[string]interface{}{"tagTag": tagTagFvFBRouteFvFBRGroupChildMap}) + tagTagIdentifier := TagTagIdentifier{} + tagTagIdentifier.Key = tagTagFvFBRouteFvFBRGroup.Key + tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) + } + for _, tagTagFvFBRouteFvFBRGroup := range tagTagFvFBRouteFvFBRGroupState { + delete := true + for _, tagTagIdentifier := range tagTagIdentifiers { + if tagTagIdentifier.Key == tagTagFvFBRouteFvFBRGroup.Key { + delete = false + break + } + } + if delete { + tagTagFvFBRouteFvFBRGroupChildMapForDelete := NewAciObject() + tagTagFvFBRouteFvFBRGroupChildMapForDelete.Attributes["status"] = "deleted" + tagTagFvFBRouteFvFBRGroupChildMapForDelete.Attributes["key"] = tagTagFvFBRouteFvFBRGroup.Key.ValueString() + FvFBRouteFvFBRGroupChildren = append(FvFBRouteFvFBRGroupChildren, map[string]interface{}{"tagTag": tagTagFvFBRouteFvFBRGroupChildMapForDelete}) + } + } } + childMap.Children = FvFBRouteFvFBRGroupChildren childPayloads = append(childPayloads, map[string]interface{}{"fvFBRoute": childMap}) } else { FvFBRouteObject, _ := types.ObjectValueFrom(ctx, FvFBRouteFvFBRGroupType, getEmptyFvFBRouteFvFBRGroupResourceModel()) @@ -862,25 +1339,25 @@ func getFvFBRGroupFvFBRouteChildPayloads(ctx context.Context, diags *diag.Diagno return childPayloads } -func getFvFBRGroupTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvFBRGroupResourceModel, tagAnnotationPlan, tagAnnotationState []TagAnnotationFvFBRGroupResourceModel) []map[string]interface{} { +func getFvFBRGroupTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvFBRGroupResourceModel, tagAnnotationFvFBRGroupPlan, tagAnnotationFvFBRGroupState []TagAnnotationFvFBRGroupResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagAnnotation.IsUnknown() { + if !data.TagAnnotation.IsNull() && !data.TagAnnotation.IsUnknown() { tagAnnotationIdentifiers := []TagAnnotationIdentifier{} - for _, tagAnnotation := range tagAnnotationPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagAnnotation.Key.IsUnknown() && !tagAnnotation.Key.IsNull() { - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() + for _, tagAnnotationFvFBRGroup := range tagAnnotationFvFBRGroupPlan { + childMap := NewAciObject() + if !tagAnnotationFvFBRGroup.Key.IsNull() && !tagAnnotationFvFBRGroup.Key.IsUnknown() { + childMap.Attributes["key"] = tagAnnotationFvFBRGroup.Key.ValueString() } - if !tagAnnotation.Value.IsUnknown() && !tagAnnotation.Value.IsNull() { - childMap["attributes"]["value"] = tagAnnotation.Value.ValueString() + if !tagAnnotationFvFBRGroup.Value.IsNull() && !tagAnnotationFvFBRGroup.Value.IsUnknown() { + childMap.Attributes["value"] = tagAnnotationFvFBRGroup.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) tagAnnotationIdentifier := TagAnnotationIdentifier{} - tagAnnotationIdentifier.Key = tagAnnotation.Key + tagAnnotationIdentifier.Key = tagAnnotationFvFBRGroup.Key tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) } - for _, tagAnnotation := range tagAnnotationState { + for _, tagAnnotation := range tagAnnotationFvFBRGroupState { delete := true for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { if tagAnnotationIdentifier.Key == tagAnnotation.Key { @@ -889,10 +1366,10 @@ func getFvFBRGroupTagAnnotationChildPayloads(ctx context.Context, diags *diag.Di } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) + tagAnnotationChildMapForDelete := NewAciObject() + tagAnnotationChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationChildMapForDelete.Attributes["key"] = tagAnnotation.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": tagAnnotationChildMapForDelete}) } } } else { @@ -901,25 +1378,25 @@ func getFvFBRGroupTagAnnotationChildPayloads(ctx context.Context, diags *diag.Di return childPayloads } -func getFvFBRGroupTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvFBRGroupResourceModel, tagTagPlan, tagTagState []TagTagFvFBRGroupResourceModel) []map[string]interface{} { +func getFvFBRGroupTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvFBRGroupResourceModel, tagTagFvFBRGroupPlan, tagTagFvFBRGroupState []TagTagFvFBRGroupResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagTag.IsUnknown() { + if !data.TagTag.IsNull() && !data.TagTag.IsUnknown() { tagTagIdentifiers := []TagTagIdentifier{} - for _, tagTag := range tagTagPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagTag.Key.IsUnknown() && !tagTag.Key.IsNull() { - childMap["attributes"]["key"] = tagTag.Key.ValueString() + for _, tagTagFvFBRGroup := range tagTagFvFBRGroupPlan { + childMap := NewAciObject() + if !tagTagFvFBRGroup.Key.IsNull() && !tagTagFvFBRGroup.Key.IsUnknown() { + childMap.Attributes["key"] = tagTagFvFBRGroup.Key.ValueString() } - if !tagTag.Value.IsUnknown() && !tagTag.Value.IsNull() { - childMap["attributes"]["value"] = tagTag.Value.ValueString() + if !tagTagFvFBRGroup.Value.IsNull() && !tagTagFvFBRGroup.Value.IsUnknown() { + childMap.Attributes["value"] = tagTagFvFBRGroup.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) tagTagIdentifier := TagTagIdentifier{} - tagTagIdentifier.Key = tagTag.Key + tagTagIdentifier.Key = tagTagFvFBRGroup.Key tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) } - for _, tagTag := range tagTagState { + for _, tagTag := range tagTagFvFBRGroupState { delete := true for _, tagTagIdentifier := range tagTagIdentifiers { if tagTagIdentifier.Key == tagTag.Key { @@ -928,10 +1405,10 @@ func getFvFBRGroupTagTagChildPayloads(ctx context.Context, diags *diag.Diagnosti } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagTag.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) + tagTagChildMapForDelete := NewAciObject() + tagTagChildMapForDelete.Attributes["status"] = "deleted" + tagTagChildMapForDelete.Attributes["key"] = tagTag.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagTag": tagTagChildMapForDelete}) } } } else { diff --git a/internal/provider/resource_aci_vrf_fallback_route_group_member.go b/internal/provider/resource_aci_vrf_fallback_route_group_member.go index 6d9c6e026..2650d07fb 100644 --- a/internal/provider/resource_aci_vrf_fallback_route_group_member.go +++ b/internal/provider/resource_aci_vrf_fallback_route_group_member.go @@ -88,6 +88,13 @@ func getEmptyTagAnnotationFvFBRMemberResourceModel() TagAnnotationFvFBRMemberRes } } +var TagAnnotationFvFBRMemberType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + // TagTagFvFBRMemberResourceModel describes the resource data model for the children without relation ships. type TagTagFvFBRMemberResourceModel struct { Key types.String `tfsdk:"key"` @@ -101,6 +108,13 @@ func getEmptyTagTagFvFBRMemberResourceModel() TagTagFvFBRMemberResourceModel { } } +var TagTagFvFBRMemberType = types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, + }, +} + type FvFBRMemberIdentifier struct { RnhAddr types.String } @@ -441,7 +455,7 @@ func (r *FvFBRMemberResource) ImportState(ctx context.Context, req resource.Impo } func getAndSetFvFBRMemberAttributes(ctx context.Context, diags *diag.Diagnostics, client *client.Client, data *FvFBRMemberResourceModel) { - requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=children&rsp-subtree-class=%s", data.Id.ValueString(), "fvFBRMember,tagAnnotation,tagTag"), "GET", nil) + requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=full&rsp-subtree-class=%s", data.Id.ValueString(), "fvFBRMember,tagAnnotation,tagTag"), "GET", nil) readData := getEmptyFvFBRMemberResourceModel() @@ -490,6 +504,7 @@ func getAndSetFvFBRMemberAttributes(ctx context.Context, diags *diag.Diagnostics if childAttributeName == "value" { TagAnnotationFvFBRMember.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagAnnotationFvFBRMemberList = append(TagAnnotationFvFBRMemberList, TagAnnotationFvFBRMember) } @@ -502,6 +517,7 @@ func getAndSetFvFBRMemberAttributes(ctx context.Context, diags *diag.Diagnostics if childAttributeName == "value" { TagTagFvFBRMember.Value = basetypes.NewStringValue(childAttributeValue.(string)) } + } TagTagFvFBRMemberList = append(TagTagFvFBRMemberList, TagTagFvFBRMember) } @@ -549,25 +565,24 @@ func setFvFBRMemberId(ctx context.Context, data *FvFBRMemberResourceModel) { data.Id = types.StringValue(fmt.Sprintf("%s/%s", data.ParentDn.ValueString(), rn)) } -func getFvFBRMemberTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvFBRMemberResourceModel, tagAnnotationPlan, tagAnnotationState []TagAnnotationFvFBRMemberResourceModel) []map[string]interface{} { - +func getFvFBRMemberTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvFBRMemberResourceModel, tagAnnotationFvFBRMemberPlan, tagAnnotationFvFBRMemberState []TagAnnotationFvFBRMemberResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagAnnotation.IsUnknown() { + if !data.TagAnnotation.IsNull() && !data.TagAnnotation.IsUnknown() { tagAnnotationIdentifiers := []TagAnnotationIdentifier{} - for _, tagAnnotation := range tagAnnotationPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagAnnotation.Key.IsUnknown() && !tagAnnotation.Key.IsNull() { - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() + for _, tagAnnotationFvFBRMember := range tagAnnotationFvFBRMemberPlan { + childMap := NewAciObject() + if !tagAnnotationFvFBRMember.Key.IsNull() && !tagAnnotationFvFBRMember.Key.IsUnknown() { + childMap.Attributes["key"] = tagAnnotationFvFBRMember.Key.ValueString() } - if !tagAnnotation.Value.IsUnknown() && !tagAnnotation.Value.IsNull() { - childMap["attributes"]["value"] = tagAnnotation.Value.ValueString() + if !tagAnnotationFvFBRMember.Value.IsNull() && !tagAnnotationFvFBRMember.Value.IsUnknown() { + childMap.Attributes["value"] = tagAnnotationFvFBRMember.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) tagAnnotationIdentifier := TagAnnotationIdentifier{} - tagAnnotationIdentifier.Key = tagAnnotation.Key + tagAnnotationIdentifier.Key = tagAnnotationFvFBRMember.Key tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) } - for _, tagAnnotation := range tagAnnotationState { + for _, tagAnnotation := range tagAnnotationFvFBRMemberState { delete := true for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { if tagAnnotationIdentifier.Key == tagAnnotation.Key { @@ -576,10 +591,10 @@ func getFvFBRMemberTagAnnotationChildPayloads(ctx context.Context, diags *diag.D } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagAnnotation.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) + tagAnnotationChildMapForDelete := NewAciObject() + tagAnnotationChildMapForDelete.Attributes["status"] = "deleted" + tagAnnotationChildMapForDelete.Attributes["key"] = tagAnnotation.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": tagAnnotationChildMapForDelete}) } } } else { @@ -588,25 +603,25 @@ func getFvFBRMemberTagAnnotationChildPayloads(ctx context.Context, diags *diag.D return childPayloads } -func getFvFBRMemberTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvFBRMemberResourceModel, tagTagPlan, tagTagState []TagTagFvFBRMemberResourceModel) []map[string]interface{} { +func getFvFBRMemberTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvFBRMemberResourceModel, tagTagFvFBRMemberPlan, tagTagFvFBRMemberState []TagTagFvFBRMemberResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} - if !data.TagTag.IsUnknown() { + if !data.TagTag.IsNull() && !data.TagTag.IsUnknown() { tagTagIdentifiers := []TagTagIdentifier{} - for _, tagTag := range tagTagPlan { - childMap := map[string]map[string]interface{}{"attributes": {}} - if !tagTag.Key.IsUnknown() && !tagTag.Key.IsNull() { - childMap["attributes"]["key"] = tagTag.Key.ValueString() + for _, tagTagFvFBRMember := range tagTagFvFBRMemberPlan { + childMap := NewAciObject() + if !tagTagFvFBRMember.Key.IsNull() && !tagTagFvFBRMember.Key.IsUnknown() { + childMap.Attributes["key"] = tagTagFvFBRMember.Key.ValueString() } - if !tagTag.Value.IsUnknown() && !tagTag.Value.IsNull() { - childMap["attributes"]["value"] = tagTag.Value.ValueString() + if !tagTagFvFBRMember.Value.IsNull() && !tagTagFvFBRMember.Value.IsUnknown() { + childMap.Attributes["value"] = tagTagFvFBRMember.Value.ValueString() } childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) tagTagIdentifier := TagTagIdentifier{} - tagTagIdentifier.Key = tagTag.Key + tagTagIdentifier.Key = tagTagFvFBRMember.Key tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) } - for _, tagTag := range tagTagState { + for _, tagTag := range tagTagFvFBRMemberState { delete := true for _, tagTagIdentifier := range tagTagIdentifiers { if tagTagIdentifier.Key == tagTag.Key { @@ -615,10 +630,10 @@ func getFvFBRMemberTagTagChildPayloads(ctx context.Context, diags *diag.Diagnost } } if delete { - childMap := map[string]map[string]interface{}{"attributes": {}} - childMap["attributes"]["status"] = "deleted" - childMap["attributes"]["key"] = tagTag.Key.ValueString() - childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) + tagTagChildMapForDelete := NewAciObject() + tagTagChildMapForDelete.Attributes["status"] = "deleted" + tagTagChildMapForDelete.Attributes["key"] = tagTag.Key.ValueString() + childPayloads = append(childPayloads, map[string]interface{}{"tagTag": tagTagChildMapForDelete}) } } } else { diff --git a/internal/provider/resource_aci_vrf_fallback_route_group_member_test.go b/internal/provider/resource_aci_vrf_fallback_route_group_member_test.go index c7b0ea3dd..c719fe728 100644 --- a/internal/provider/resource_aci_vrf_fallback_route_group_member_test.go +++ b/internal/provider/resource_aci_vrf_fallback_route_group_member_test.go @@ -249,24 +249,24 @@ resource "aci_vrf_fallback_route_group_member" "test" { parent_dn = aci_vrf_fallback_route_group.test.id fallback_member = "2.2.2.3" annotations = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] tags = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] } ` diff --git a/internal/provider/resource_aci_vrf_fallback_route_group_test.go b/internal/provider/resource_aci_vrf_fallback_route_group_test.go index 7d5a2333d..23310c2ab 100644 --- a/internal/provider/resource_aci_vrf_fallback_route_group_test.go +++ b/internal/provider/resource_aci_vrf_fallback_route_group_test.go @@ -186,16 +186,46 @@ func TestAccResourceFvFBRGroupWithFvCtx(t *testing.T) { resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "tags.1.value", "test_value"), resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "tags.#", "2"), resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "annotations.#", "2"), + resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "tags.#", "2"), resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route.description", "description_1"), resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route.name", "name_1"), resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route.name_alias", "name_alias_1"), resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route.prefix_address", "2.2.2.2/24"), resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route_group_members.0.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route_group_members.0.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route_group_members.0.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route_group_members.0.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route_group_members.0.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "annotations.#", "2"), + resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route_group_members.0.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route_group_members.0.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route_group_members.0.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route_group_members.0.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "tags.#", "2"), resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route_group_members.0.description", "description_1"), resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route_group_members.0.fallback_member", "2.2.2.2"), resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route_group_members.0.name", "name_1"), resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route_group_members.0.name_alias", "name_alias_1"), resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route_group_members.1.annotation", "annotation_2"), + resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route_group_members.1.annotations.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route_group_members.1.annotations.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route_group_members.1.annotations.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route_group_members.1.annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "annotations.#", "2"), + resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route_group_members.1.tags.0.key", "key_0"), + resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route_group_members.1.tags.0.value", "value_1"), + resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route_group_members.1.tags.1.key", "key_1"), + resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route_group_members.1.tags.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "tags.#", "2"), resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route_group_members.1.description", "description_2"), resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route_group_members.1.fallback_member", "2.2.2.3"), resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route_group_members.1.name", "name_2"), @@ -215,6 +245,12 @@ func TestAccResourceFvFBRGroupWithFvCtx(t *testing.T) { resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "tags.0.value", "test_value"), resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "tags.#", "1"), resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route_group_members.0.annotation", "annotation_2"), + resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route_group_members.0.annotations.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route_group_members.0.annotations.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route_group_members.0.annotations.#", "1"), + resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route_group_members.0.tags.0.key", "key_1"), + resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route_group_members.0.tags.0.value", "test_value"), + resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route_group_members.0.tags.#", "1"), resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route_group_members.0.description", "description_2"), resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route_group_members.0.fallback_member", "2.2.2.3"), resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route_group_members.0.name", "name_2"), @@ -227,6 +263,8 @@ func TestAccResourceFvFBRGroupWithFvCtx(t *testing.T) { knownvalue.MapExact( map[string]knownvalue.Check{ "annotation": knownvalue.Null(), + "annotations": knownvalue.Null(), + "tags": knownvalue.Null(), "description": knownvalue.Null(), "name": knownvalue.Null(), "name_alias": knownvalue.Null(), @@ -251,6 +289,8 @@ func TestAccResourceFvFBRGroupWithFvCtx(t *testing.T) { knownvalue.MapExact( map[string]knownvalue.Check{ "annotation": knownvalue.Null(), + "annotations": knownvalue.Null(), + "tags": knownvalue.Null(), "description": knownvalue.Null(), "name": knownvalue.Null(), "name_alias": knownvalue.Null(), @@ -308,47 +348,107 @@ resource "aci_vrf_fallback_route_group" "test" { parent_dn = aci_vrf.test.id name = "fallback_route_group" annotations = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] tags = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] vrf_fallback_route = { annotation = "annotation_1" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] description = "description_1" name = "name_1" name_alias = "name_alias_1" prefix_address = "2.2.2.2/24" } vrf_fallback_route_group_members = [ - { - annotation = "annotation_1" - description = "description_1" - fallback_member = "2.2.2.2" - name = "name_1" - name_alias = "name_alias_1" - }, - { - annotation = "annotation_2" - description = "description_2" - fallback_member = "2.2.2.3" - name = "name_2" - name_alias = "name_alias_2" - }, + { + annotation = "annotation_1" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + description = "description_1" + fallback_member = "2.2.2.2" + name = "name_1" + name_alias = "name_alias_1" + }, + { + annotation = "annotation_2" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, + ] + description = "description_2" + fallback_member = "2.2.2.3" + name = "name_2" + name_alias = "name_alias_2" + }, ] } ` @@ -380,6 +480,18 @@ resource "aci_vrf_fallback_route_group" "test" { vrf_fallback_route_group_members = [ { annotation = "annotation_2" + annotations = [ + { + key = "key_1" + value = "test_value" + }, + ] + tags = [ + { + key = "key_1" + value = "test_value" + }, + ] description = "description_2" fallback_member = "2.2.2.3" name = "name_2" diff --git a/internal/provider/resource_aci_vrf_fallback_route_test.go b/internal/provider/resource_aci_vrf_fallback_route_test.go index c45240878..cc8f93035 100644 --- a/internal/provider/resource_aci_vrf_fallback_route_test.go +++ b/internal/provider/resource_aci_vrf_fallback_route_test.go @@ -249,24 +249,24 @@ resource "aci_vrf_fallback_route" "test" { parent_dn = aci_vrf_fallback_route_group.test.id prefix_address = "2.2.2.3/24" annotations = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] tags = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "test_value" + }, ] } ` diff --git a/internal/provider/utils.go b/internal/provider/utils.go index cb797732f..1be0a2deb 100644 --- a/internal/provider/utils.go +++ b/internal/provider/utils.go @@ -35,6 +35,18 @@ func SingleNestedAttributeRequiredAttributesNotProvided(attributes map[string]at return false } +type AciObject struct { + Attributes map[string]interface{} `json:"attributes"` + Children []map[string]interface{} `json:"children"` +} + +func NewAciObject() AciObject { + return AciObject{ + Attributes: make(map[string]interface{}), + Children: []map[string]interface{}{}, + } +} + func ContainsString(strings []string, matchString string) bool { for _, stringValue := range strings { if stringValue == matchString { @@ -156,6 +168,7 @@ func (m setToStringNullWhenStateIsNullPlanIsUnknownDuringUpdate) PlanModifyStrin if !req.State.Raw.IsNull() && req.StateValue.IsNull() && req.PlanValue.IsUnknown() { resp.PlanValue = types.StringNull() } + return } type setToSetNullWhenStateIsNullPlanIsUnknownDuringUpdate struct{}