diff --git a/docs/data-sources/relation_to_taboo_contract.md b/docs/data-sources/relation_to_taboo_contract.md deleted file mode 100644 index 51f998859..000000000 --- a/docs/data-sources/relation_to_taboo_contract.md +++ /dev/null @@ -1,87 +0,0 @@ ---- -# 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: "Application Management" -layout: "aci" -page_title: "ACI: aci_relation_to_taboo_contract" -sidebar_current: "docs-aci-data-source-aci_relation_to_taboo_contract" -description: |- - Data source for Relation To Taboo Contract ---- - -# aci_relation_to_taboo_contract # - -Data source for Relation To Taboo Contract - -## API Information ## - -* Class: [fvRsProtBy](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsProtBy/overview) - -* Supported in ACI versions: 1.0(1e) and later. - -* Distinguished Name Formats: - - Too many DN formats to display, see model documentation for all possible parents of [fvRsProtBy](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsProtBy/overview). - - `uni/tn-{name}/ap-{name}/epg-{name}/rsprotBy-{tnVzTabooName}` - - `uni/tn-{name}/l2out-{name}/instP-{name}/rsprov-{tnVzBrCPName}` - - `uni/tn-{name}/out-{name}/instP-{name}/rsprov-{tnVzBrCPName}` - -## GUI Information ## - -* Locations: - - `Tenants -> Application Profiles -> Application EPGs -> Contracts` - - `Tenants -> Networking -> L3Outs -> External EPGs -> Contracts` - - `Tenants -> Networking -> L2Outs -> External EPGs -> Contracts` - -## Example Usage ## - -```hcl - -data "aci_relation_to_taboo_contract" "example_application_epg" { - parent_dn = aci_application_epg.example.id - taboo_contract_name = aci_taboo_contract.example.name -} - -``` - -## Schema ## - -### Required ### - -* `parent_dn` - (string) The distinguished name (DN) of the parent object, possible resources: - - [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_application_epg](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/application_epg) ([fvAEPg](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvAEPg/overview)) - - [aci_endpoint_security_group](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/endpoint_security_group) ([fvESg](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvESg/overview)) - - [aci_l2out_extepg](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/l2out_extepg) ([l2extInstP](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/l2extInstP/overview)) - - [aci_external_network_instance_profile](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/external_network_instance_profile) ([l3extInstP](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/l3extInstP/overview)) - - [aci_node_mgmt_epg](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/node_mgmt_epg) ([mgmtInB](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/mgmtInB/overview)) - - The distinguished name (DN) of classes below can be used but currently there is no available resource for it: - - [cloudISvcEPg](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/cloudISvcEPg/overview) - - [dhcpCRelPg](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/dhcpCRelPg/overview) - - [dhcpPRelPg](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/dhcpPRelPg/overview) - - [fvIntEPg](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvIntEPg/overview) - - [fvTnlEPg](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvTnlEPg/overview) - - [infraCEPg](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/infraCEPg/overview) - - [infraPEPg](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/infraPEPg/overview) - - [l3extInstPDef](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/l3extInstPDef/overview) - - [vnsEPpInfo](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/vnsEPpInfo/overview) - - [vnsREPpInfo](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/vnsREPpInfo/overview) - - [vnsSDEPpInfo](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/vnsSDEPpInfo/overview) - - [vnsSHEPpInfo](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/vnsSHEPpInfo/overview) - -* `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`. - -### Read-Only ### - -* `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/resources/relation_to_taboo_contract.md b/docs/resources/relation_to_taboo_contract.md deleted file mode 100644 index 0d840e253..000000000 --- a/docs/resources/relation_to_taboo_contract.md +++ /dev/null @@ -1,146 +0,0 @@ ---- -# 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: "Application Management" -layout: "aci" -page_title: "ACI: aci_relation_to_taboo_contract" -sidebar_current: "docs-aci-resource-aci_relation_to_taboo_contract" -description: |- - Manages ACI Relation To Taboo Contract ---- - -# aci_relation_to_taboo_contract # - -Manages ACI Relation To Taboo Contract - - - -## API Information ## - -* Class: [fvRsProtBy](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsProtBy/overview) - -* Supported in ACI versions: 1.0(1e) and later. - -* Distinguished Name Formats: - - Too many DN formats to display, see model documentation for all possible parents of [fvRsProtBy](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsProtBy/overview). - - `uni/tn-{name}/ap-{name}/epg-{name}/rsprotBy-{tnVzTabooName}` - - `uni/tn-{name}/l2out-{name}/instP-{name}/rsprov-{tnVzBrCPName}` - - `uni/tn-{name}/out-{name}/instP-{name}/rsprov-{tnVzBrCPName}` - -## GUI Information ## - -* Locations: - - `Tenants -> Application Profiles -> Application EPGs -> Contracts` - - `Tenants -> Networking -> L3Outs -> External EPGs -> Contracts` - - `Tenants -> Networking -> L2Outs -> External EPGs -> Contracts` - -## Example Usage ## - -The configuration snippet below creates a Relation To Taboo Contract with only required attributes. - -```hcl - -resource "aci_relation_to_taboo_contract" "example_application_epg" { - parent_dn = aci_application_epg.example.id - taboo_contract_name = aci_taboo_contract.example.name -} - -``` -The configuration snippet below shows all possible attributes of the Relation To Taboo Contract. - -!> This example might not be valid configuration and is only used to show all possible attributes. - -```hcl - -resource "aci_relation_to_taboo_contract" "full_example_application_epg" { - parent_dn = aci_application_epg.example.id - annotation = "annotation" - taboo_contract_name = aci_taboo_contract.example.name - annotations = [ - { - key = "key_0" - value = "value_1" - } - ] - tags = [ - { - key = "key_0" - value = "value_1" - } - ] -} - -``` - -All examples for the Relation To Taboo Contract resource can be found in the [examples](https://github.com/CiscoDevNet/terraform-provider-aci/tree/master/examples/resources/aci_relation_to_taboo_contract) folder. - -## Schema ## - -### Required ### - -* `parent_dn` - (string) The distinguished name (DN) of the parent object, possible resources: - - [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_application_epg](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/application_epg) ([fvAEPg](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvAEPg/overview)) - - [aci_endpoint_security_group](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/endpoint_security_group) ([fvESg](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvESg/overview)) - - [aci_l2out_extepg](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/l2out_extepg) ([l2extInstP](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/l2extInstP/overview)) - - [aci_external_network_instance_profile](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/external_network_instance_profile) ([l3extInstP](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/l3extInstP/overview)) - - [aci_node_mgmt_epg](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/node_mgmt_epg) ([mgmtInB](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/mgmtInB/overview)) - - The distinguished name (DN) of classes below can be used but currently there is no available resource for it: - - [cloudISvcEPg](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/cloudISvcEPg/overview) - - [dhcpCRelPg](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/dhcpCRelPg/overview) - - [dhcpPRelPg](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/dhcpPRelPg/overview) - - [fvIntEPg](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvIntEPg/overview) - - [fvTnlEPg](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvTnlEPg/overview) - - [infraCEPg](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/infraCEPg/overview) - - [infraPEPg](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/infraPEPg/overview) - - [l3extInstPDef](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/l3extInstPDef/overview) - - [vnsEPpInfo](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/vnsEPpInfo/overview) - - [vnsREPpInfo](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/vnsREPpInfo/overview) - - [vnsSDEPpInfo](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/vnsSDEPpInfo/overview) - - [vnsSHEPpInfo](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/vnsSHEPpInfo/overview) - -* `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`. - -### Read-Only ### - -* `id` - (string) The distinguished name (DN) of the Relation To Taboo Contract object. - -### Optional ### - -* `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. - -* `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 Relation To Taboo Contract 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_relation_to_taboo_contract.example_application_epg uni/tn-{name}/ap-{name}/epg-{name}/rsprotBy-{tnVzTabooName} -``` - -Starting in Terraform version 1.5, an existing Relation To Taboo Contract can be imported -using [import blocks](https://developer.hashicorp.com/terraform/language/import) via the following configuration: - -``` -import { - id = "uni/tn-{name}/ap-{name}/epg-{name}/rsprotBy-{tnVzTabooName}" - to = aci_relation_to_taboo_contract.example_application_epg -} -``` diff --git a/examples/data-sources/aci_relation_to_taboo_contract/data-source.tf b/examples/data-sources/aci_relation_to_taboo_contract/data-source.tf deleted file mode 100644 index d3f67ab55..000000000 --- a/examples/data-sources/aci_relation_to_taboo_contract/data-source.tf +++ /dev/null @@ -1,5 +0,0 @@ - -data "aci_relation_to_taboo_contract" "example_application_epg" { - parent_dn = aci_application_epg.example.id - taboo_contract_name = aci_taboo_contract.example.name -} diff --git a/examples/data-sources/aci_relation_to_taboo_contract/provider.tf b/examples/data-sources/aci_relation_to_taboo_contract/provider.tf deleted file mode 100644 index 975fca093..000000000 --- a/examples/data-sources/aci_relation_to_taboo_contract/provider.tf +++ /dev/null @@ -1,14 +0,0 @@ -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_relation_to_taboo_contract/provider.tf b/examples/resources/aci_relation_to_taboo_contract/provider.tf deleted file mode 100644 index 975fca093..000000000 --- a/examples/resources/aci_relation_to_taboo_contract/provider.tf +++ /dev/null @@ -1,14 +0,0 @@ -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_relation_to_taboo_contract/resource-all-attributes.tf b/examples/resources/aci_relation_to_taboo_contract/resource-all-attributes.tf deleted file mode 100644 index c6e4e55f0..000000000 --- a/examples/resources/aci_relation_to_taboo_contract/resource-all-attributes.tf +++ /dev/null @@ -1,18 +0,0 @@ - -resource "aci_relation_to_taboo_contract" "full_example_application_epg" { - parent_dn = aci_application_epg.example.id - annotation = "annotation" - taboo_contract_name = aci_taboo_contract.example.name - annotations = [ - { - key = "key_0" - value = "value_1" - } - ] - tags = [ - { - key = "key_0" - value = "value_1" - } - ] -} diff --git a/examples/resources/aci_relation_to_taboo_contract/resource.tf b/examples/resources/aci_relation_to_taboo_contract/resource.tf deleted file mode 100644 index 752f8a0df..000000000 --- a/examples/resources/aci_relation_to_taboo_contract/resource.tf +++ /dev/null @@ -1,5 +0,0 @@ - -resource "aci_relation_to_taboo_contract" "example_application_epg" { - parent_dn = aci_application_epg.example.id - taboo_contract_name = aci_taboo_contract.example.name -} diff --git a/gen/meta/fvRsProtBy.json b/gen/meta/fvRsProtBy.json deleted file mode 100644 index 1d1e06210..000000000 --- a/gen/meta/fvRsProtBy.json +++ /dev/null @@ -1,1123 +0,0 @@ -{ - "fv:RsProtBy": { - "contains": { - "aaa:RbacAnnotation": "", - "fault:Counts": "", - "fault:Inst": "", - "fv:TabooCtxDefCont": "", - "health:Inst": "", - "tag:Annotation": "", - "tag:Tag": "" - }, - "rnMap": { - "annotationKey-": "tag:Annotation", - "fault-": "fault:Inst", - "fltCnts": "fault:Counts", - "health": "health:Inst", - "rbacDom-": "aaa:RbacAnnotation", - "tabooCtxdefDn-": "fv:TabooCtxDefCont", - "tagKey-": "tag:Tag" - }, - "identifiedBy": [ - "tnVzTabooName" - ], - "rnFormat": "rsprotBy-{tnVzTabooName}", - "containedBy": { - "cloud:EPg": "", - "cloud:ExtEPg": "", - "cloud:ISvcEPg": "", - "cloud:SvcEPg": "", - "dhcp:CRelPg": "", - "dhcp:PRelPg": "", - "fv:AEPg": "", - "fv:ESg": "", - "fv:IntEPg": "", - "fv:TnlEPg": "", - "infra:CEPg": "", - "infra:PEPg": "", - "l2ext:InstP": "", - "l3ext:InstP": "", - "l3ext:InstPDef": "", - "mgmt:InB": "", - "vns:EPpInfo": "", - "vns:REPpInfo": "", - "vns:SDEPpInfo": "", - "vns:SHEPpInfo": "" - }, - "superClasses": [ - "pol:NToRef", - "reln:To", - "reln:Inst" - ], - "subClasses": { - - }, - "relationInfo": { - "type": "named", - "cardinality": "n-to-m", - "fromMo": "fv:EPg", - "fromRelMo": "fv:RsProtBy", - "toMo": "vz:Taboo", - "toRelMo": "vz:RtProtBy", - "enforceable": true, - "resolvable": true - }, - "dnFormats": [ - "uni/tn-{name}/intap/intepg-{name}/rsprotBy-{tnVzTabooName}", - "uni/tn-{name}/cloudapp-{name}/cloudsvcepg-{name}/rsprotBy-{tnVzTabooName}", - "uni/tn-{name}/cloudapp-{name}/rsprotBy-{tnVzTabooName}", - "uni/tn-{name}/ap-{name}/esg-{name}/rsprotBy-{tnVzTabooName}", - "uni/tn-{name}/cloudapp-{name}/rsprotBy-{tnVzTabooName}", - "uni/tn-{name}/cloudapp-{name}/rsprotBy-{tnVzTabooName}", - "uni/svcdefcont/tensvcdef-{name}/ldevdef-[{lDevDn}]/sepg-{name}/rsprotBy-{tnVzTabooName}", - "uni/tn-{name}/ldevdef-[{lDevDn}]/sepg-{name}/rsprotBy-{tnVzTabooName}", - "uni/tn-{name}/cloudapp-{name}/sepg-{name}/rsprotBy-{tnVzTabooName}", - "uni/tn-{name}/cloudapp-{name}/cloudextepg-{name}/rsprotBy-{tnVzTabooName}", - "uni/tn-{name}/cloudapp-{name}/cloudepg-{name}/rsprotBy-{tnVzTabooName}", - "uni/tn-{name}/cloudapp-{name}/rsprotBy-{tnVzTabooName}", - "uni/tn-{name}/Tnlepg-{name}/rsprotBy-{tnVzTabooName}", - "uni/tn-{name}/LDevInst-[{priKey}]-ctx-{ctxName}/epgDn-[{shEpgDn}]/rsprotBy-{tnVzTabooName}", - "outdefcont-{id}/rsoutDefContToOut-[{tDn}]/outdef-{name}/instPdef-{name}/rsprotBy-{tnVzTabooName}", - "uni/tn-{name}/acIpToIp-{name}/acl3outcont/outdef-{name}/instPdef-{name}/rsprotBy-{tnVzTabooName}", - "uni/tn-{name}/acExtToEp-{name}/acl3outcont/outdef-{name}/instPdef-{name}/rsprotBy-{tnVzTabooName}", - "uni/tn-{name}/acEpToExt-{name}/acl3outcont/outdef-{name}/instPdef-{name}/rsprotBy-{tnVzTabooName}", - "uni/tn-{name}/acEpToEp-{name}/acl3outcont/outdef-{name}/instPdef-{name}/rsprotBy-{tnVzTabooName}", - "uni/tn-{name}/acAnyToEp-{name}/acl3outcont/outdef-{name}/instPdef-{name}/rsprotBy-{tnVzTabooName}", - "uni/tn-{name}/acEpToAny-{name}/acl3outcont/outdef-{name}/instPdef-{name}/rsprotBy-{tnVzTabooName}", - "uni/tn-{name}/epgToEp-{name}/acl3outcont/outdef-{name}/instPdef-{name}/rsprotBy-{tnVzTabooName}", - "uni/tn-{name}/epToEpg-{name}/acl3outcont/outdef-{name}/instPdef-{name}/rsprotBy-{tnVzTabooName}", - "uni/tn-{name}/ipToEpg-{name}/acl3outcont/outdef-{name}/instPdef-{name}/rsprotBy-{tnVzTabooName}", - "uni/tn-{name}/epgToIp-{name}/acl3outcont/outdef-{name}/instPdef-{name}/rsprotBy-{tnVzTabooName}", - "uni/tn-{name}/epgToEpg-{name}/acl3outcont/outdef-{name}/instPdef-{name}/rsprotBy-{tnVzTabooName}", - "uni/epp/sec-[{epgPKey}]/ac-{name}/acl3outcont/outdef-{name}/instPdef-{name}/rsprotBy-{tnVzTabooName}", - "uni/epp/fv-[{epgPKey}]/ac-{name}/acl3outcont/outdef-{name}/instPdef-{name}/rsprotBy-{tnVzTabooName}", - "uni/epp/rtd-[{epgPKey}]/ac-{name}/acl3outcont/outdef-{name}/instPdef-{name}/rsprotBy-{tnVzTabooName}", - "uni/tn-{name}/ldevCtx-c-{ctrctNameOrLbl}-g-{graphNameOrLbl}-n-{nodeNameOrLbl}/lIfCtx-c-{connNameOrLbl}/outdef-{name}/instPdef-{name}/rsprotBy-{tnVzTabooName}", - "uni/tn-{name}/outdef-{name}/instPdef-{name}/rsprotBy-{tnVzTabooName}", - "uni/tn-{name}/LDevInst-[{priKey}]-ctx-{ctxName}/bd-[{bdDn}]/rsprotBy-{tnVzTabooName}", - "uni/ldev-[{priKey}]-ctx-[{ctxDn}]-bd-[{bdDn}]/rsprotBy-{tnVzTabooName}", - "uni/tn-{name}/LDevInst-[{priKey}]-ctx-{ctxName}/G-{graphRn}-N-{nodeRn}-C-{connRn}/rsprotBy-{tnVzTabooName}", - "uni/vDev-[{priKey}]-tn-[{tnDn}]-ctx-{ctxName}/rndrInfo/eppContr/G-{graphRn}-N-{nodeRn}-C-{connRn}/rsprotBy-{tnVzTabooName}", - "uni/tn-{name}/clp-{name}/cepg-{name}/rsprotBy-{tnVzTabooName}", - "uni/tn-{name}/provp-{name}/pepg-{name}/rsprotBy-{tnVzTabooName}", - "uni/tn-{name}/provp-{name}/rsprotBy-{tnVzTabooName}", - "uni/tn-{name}/clp-{name}/rsprotBy-{tnVzTabooName}", - "uni/tn-{name}/mgmtp-{name}/inb-{name}/rsprotBy-{tnVzTabooName}", - "uni/tn-{name}/ap-{name}/epg-{name}/rsprotBy-{tnVzTabooName}", - "uni/tn-{name}/out-{name}/instP-{name}/rsprotBy-{tnVzTabooName}", - "uni/tn-{name}/l2out-{name}/instP-{name}/rsprotBy-{tnVzTabooName}", - "uni/tn-{name}/clp-{name}/cdhcp-{name}/rsprotBy-{tnVzTabooName}", - "uni/tn-{name}/provp-{name}/pdhcp-{name}/rsprotBy-{tnVzTabooName}" - ], - "writeAccess": [ - "admin", - "tenant-epg", - "tenant-network-profile" - ], - "readAccess": [ - "admin", - "tenant-epg", - "tenant-network-profile" - ], - "faults": { - "F0973": "fltFvRsProtByResolveFail" - }, - "events": { - "E4214180": "creation||fv:RsProtBy", - "E4214181": "modification||fv:RsProtBy", - "E4214182": "deletion||fv:RsProtBy" - }, - "stats": { - - }, - "versions": "1.0(1e)-", - "isAbstract": false, - "isConfigurable": true, - "isContextRoot": false, - "isNxosConverged": false, - "isDeprecated": false, - "isHidden": false, - "isEncrypted": false, - "isExportable": true, - "isPersistent": true, - "isSubjectToQuota": true, - "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": "1916", - "className": "RsProtBy", - "classPkg": "fv", - "featureTag": "", - "moCategory": "RelationshipToLocal", - "label": "Taboo Contract Association", - "comment": [ - "The taboo contract for which the EPG will be a provider and consumer." - ], - "properties": { - "annotation": { - "versions": "3.2(1l)-", - "comment": [ - "User annotation. Suggested format orchestrator:value" - ], - "isConfigurable": true, - "propGlobalId": "37654", - "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": "39793", - "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": "14263", - "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": [ - "null" - ], - "isConfigurable": false, - "propGlobalId": "12232", - "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": "1306", "localName": "defaultValue", - "platformFlavors": [ - - ], - "label": " "}, - { "value": "0", "localName": "unspecified", - "platformFlavors": [ - - ], - "label": "unspecified "}, - { "value": "1306", "localName": "vzTaboo", - "platformFlavors": [ - - ], - "label": " "} - ], - "default": "vzTaboo", - "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 - }, - "tnVzTabooName": { - "versions": "1.0(1e)-", - "comment": [ - "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." - ], - "isConfigurable": true, - "propGlobalId": "12231", - "propLocalId": "3996", - "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": false, - "isLike": false, - "validators": [ - {"min" : 1, "max": 64, - "regexs": [ - {"regex" : "^[a-zA-Z0-9_.:-]+$", "type": "include"} - ] - } - ], - "platformFlavors": [ - - ], - "isNxosConverged": false, - "isDeprecated": false, - "isHidden": false - }, - "triggerSt": { - "versions": "1.0(1e)-", - "comment": [ - "The ability to trigger a task" - ], - "isConfigurable": false, - "propGlobalId": "16151", - "propLocalId": "898", - "label": "triggerSt", - "baseType": "scalar:Enum8", - "modelType": "fv:TriggerSt", - "needsPropDelimiters": false, - "uitype": "enum", - "createOnly": false, - "readWrite": false, - "readOnly": true, - "isNaming": false, - "secure": false, - "implicit": true, - "mandatory": false, - "isOverride": false, - "isLike": false, - "validValues": [ - { "value": "not_triggerable", "localName": "defaultValue", - "platformFlavors": [ - - ], - "label": " "}, - { "value": "0", "localName": "not_triggerable", - "platformFlavors": [ - - ], - "label": "not_triggerable "}, - { "value": "1", "localName": "triggerable", - "platformFlavors": [ - - ], - "label": "triggerable "} - ], - "default": "not_triggerable", - "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/testvars/fvRsProtBy.yaml b/gen/testvars/fvRsProtBy.yaml deleted file mode 100644 index 839e41a70..000000000 --- a/gen/testvars/fvRsProtBy.yaml +++ /dev/null @@ -1,39 +0,0 @@ -# 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" - -datasource_non_existing: - taboo_contract_name: "non_existing_tn_vz_taboo_name" - -datasource_required: - taboo_contract_name: "test_tn_vz_taboo_name" - -resource_required: - taboo_contract_name: "test_tn_vz_taboo_name" - -all: - annotation: "annotation" - -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" - -parents: - - class_name: "fvAEPg" - parent_dependency: "fvAp" - parent_dn: "aci_application_epg.test.id" - class_in_parent: false diff --git a/internal/provider/data_source_aci_relation_to_taboo_contract.go b/internal/provider/data_source_aci_relation_to_taboo_contract.go deleted file mode 100644 index 526c245ae..000000000 --- a/internal/provider/data_source_aci_relation_to_taboo_contract.go +++ /dev/null @@ -1,149 +0,0 @@ -// 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-log/tflog" -) - -// Ensure provider defined types fully satisfy framework interfaces. -var _ datasource.DataSource = &FvRsProtByDataSource{} - -func NewFvRsProtByDataSource() datasource.DataSource { - return &FvRsProtByDataSource{} -} - -// FvRsProtByDataSource defines the data source implementation. -type FvRsProtByDataSource struct { - client *client.Client -} - -func (d *FvRsProtByDataSource) Metadata(ctx context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) { - tflog.Debug(ctx, "Start metadata of datasource: aci_relation_to_taboo_contract") - resp.TypeName = req.ProviderTypeName + "_relation_to_taboo_contract" - tflog.Debug(ctx, "End metadata of datasource: aci_relation_to_taboo_contract") -} - -func (d *FvRsProtByDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) { - tflog.Debug(ctx, "Start schema of datasource: aci_relation_to_taboo_contract") - resp.Schema = schema.Schema{ - // This description is used by the documentation generator and the language server. - MarkdownDescription: "The relation_to_taboo_contract datasource for the 'fvRsProtBy' class", - - Attributes: map[string]schema.Attribute{ - "id": schema.StringAttribute{ - Computed: true, - MarkdownDescription: "The distinguished name (DN) of the Relation To Taboo Contract object.", - }, - "parent_dn": schema.StringAttribute{ - Required: true, - MarkdownDescription: "The distinguished name (DN) of the parent object.", - }, - "annotation": schema.StringAttribute{ - Computed: true, - MarkdownDescription: `The annotation of the Relation To Taboo Contract object.`, - }, - "taboo_contract_name": schema.StringAttribute{ - Required: 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.`, - }, - }, - }, - }, - }, - } - tflog.Debug(ctx, "End schema of datasource: aci_relation_to_taboo_contract") -} - -func (d *FvRsProtByDataSource) Configure(ctx context.Context, req datasource.ConfigureRequest, resp *datasource.ConfigureResponse) { - tflog.Debug(ctx, "Start configure of datasource: aci_relation_to_taboo_contract") - // 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_relation_to_taboo_contract") -} - -func (d *FvRsProtByDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) { - tflog.Debug(ctx, "Start read of datasource: aci_relation_to_taboo_contract") - var data *FvRsProtByResourceModel - - // Read Terraform configuration data into the model - resp.Diagnostics.Append(req.Config.Get(ctx, &data)...) - - if resp.Diagnostics.HasError() { - return - } - - setFvRsProtById(ctx, data) - - // Create a copy of the Id for when not found during getAndSetFvRsProtByAttributes - cachedId := data.Id.ValueString() - - tflog.Debug(ctx, fmt.Sprintf("Read of datasource aci_relation_to_taboo_contract with id '%s'", data.Id.ValueString())) - - getAndSetFvRsProtByAttributes(ctx, &resp.Diagnostics, d.client, data) - - if data.Id.IsNull() { - resp.Diagnostics.AddError( - "Failed to read aci_relation_to_taboo_contract data source", - fmt.Sprintf("The aci_relation_to_taboo_contract 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_relation_to_taboo_contract with id '%s'", data.Id.ValueString())) -} diff --git a/internal/provider/data_source_aci_relation_to_taboo_contract_test.go b/internal/provider/data_source_aci_relation_to_taboo_contract_test.go deleted file mode 100644 index 50c3eba9d..000000000 --- a/internal/provider/data_source_aci_relation_to_taboo_contract_test.go +++ /dev/null @@ -1,49 +0,0 @@ -// 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 TestAccDataSourceFvRsProtByWithFvAEPg(t *testing.T) { - - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, - Steps: []resource.TestStep{ - { - Config: testConfigFvRsProtByDataSourceDependencyWithFvAEPg, - ExpectNonEmptyPlan: false, - Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("data.aci_relation_to_taboo_contract.test", "taboo_contract_name", "test_tn_vz_taboo_name"), - resource.TestCheckResourceAttr("data.aci_relation_to_taboo_contract.test", "annotation", "orchestrator:terraform"), - ), - }, - { - Config: testConfigFvRsProtByNotExistingFvAEPg, - ExpectError: regexp.MustCompile("Failed to read aci_relation_to_taboo_contract data source"), - }, - }, - }) -} - -const testConfigFvRsProtByDataSourceDependencyWithFvAEPg = testConfigFvRsProtByMinDependencyWithFvAEPg + ` -data "aci_relation_to_taboo_contract" "test" { - parent_dn = aci_application_epg.test.id - taboo_contract_name = "test_tn_vz_taboo_name" - depends_on = [aci_relation_to_taboo_contract.test] -} -` - -const testConfigFvRsProtByNotExistingFvAEPg = testConfigFvAEPgMinDependencyWithFvAp + ` -data "aci_relation_to_taboo_contract" "test_non_existing" { - parent_dn = aci_application_epg.test.id - taboo_contract_name = "non_existing_tn_vz_taboo_name" -} -` diff --git a/internal/provider/provider.go b/internal/provider/provider.go index a0dd11ba4..0a5a3bd89 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -218,7 +218,6 @@ func (p *AciProvider) Resources(ctx context.Context) []func() resource.Resource NewFvRsConsResource, NewFvRsConsIfResource, NewFvRsIntraEpgResource, - NewFvRsProtByResource, NewFvRsProvResource, NewFvRsSecInheritedResource, NewFvSCrtrnResource, @@ -261,7 +260,6 @@ func (p *AciProvider) DataSources(ctx context.Context) []func() datasource.DataS NewFvRsConsDataSource, NewFvRsConsIfDataSource, NewFvRsIntraEpgDataSource, - NewFvRsProtByDataSource, NewFvRsProvDataSource, NewFvRsSecInheritedDataSource, NewFvSCrtrnDataSource, diff --git a/internal/provider/resource_aci_relation_to_taboo_contract.go b/internal/provider/resource_aci_relation_to_taboo_contract.go deleted file mode 100644 index e1faf9691..000000000 --- a/internal/provider/resource_aci_relation_to_taboo_contract.go +++ /dev/null @@ -1,643 +0,0 @@ -// 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" - "reflect" - "strings" - - "github.com/ciscoecosystem/aci-go-client/v2/client" - "github.com/ciscoecosystem/aci-go-client/v2/container" - "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/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/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 = &FvRsProtByResource{} -var _ resource.ResourceWithImportState = &FvRsProtByResource{} - -func NewFvRsProtByResource() resource.Resource { - return &FvRsProtByResource{} -} - -// FvRsProtByResource defines the resource implementation. -type FvRsProtByResource struct { - client *client.Client -} - -// FvRsProtByResourceModel describes the resource data model. -type FvRsProtByResourceModel struct { - Id types.String `tfsdk:"id"` - ParentDn types.String `tfsdk:"parent_dn"` - Annotation types.String `tfsdk:"annotation"` - TnVzTabooName types.String `tfsdk:"taboo_contract_name"` - TagAnnotation types.Set `tfsdk:"annotations"` - TagTag types.Set `tfsdk:"tags"` -} - -func getEmptyFvRsProtByResourceModel() *FvRsProtByResourceModel { - return &FvRsProtByResourceModel{ - Id: basetypes.NewStringNull(), - ParentDn: basetypes.NewStringNull(), - 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, - }, - }), - } -} - -// TagAnnotationFvRsProtByResourceModel describes the resource data model for the children without relation ships. -type TagAnnotationFvRsProtByResourceModel struct { - Key types.String `tfsdk:"key"` - Value types.String `tfsdk:"value"` -} - -func getEmptyTagAnnotationFvRsProtByResourceModel() TagAnnotationFvRsProtByResourceModel { - return TagAnnotationFvRsProtByResourceModel{ - Key: basetypes.NewStringNull(), - Value: basetypes.NewStringNull(), - } -} - -// TagTagFvRsProtByResourceModel describes the resource data model for the children without relation ships. -type TagTagFvRsProtByResourceModel struct { - Key types.String `tfsdk:"key"` - Value types.String `tfsdk:"value"` -} - -func getEmptyTagTagFvRsProtByResourceModel() TagTagFvRsProtByResourceModel { - return TagTagFvRsProtByResourceModel{ - Key: basetypes.NewStringNull(), - Value: basetypes.NewStringNull(), - } -} - -type FvRsProtByIdentifier struct { - TnVzTabooName types.String -} - -func (r *FvRsProtByResource) ModifyPlan(ctx context.Context, req resource.ModifyPlanRequest, resp *resource.ModifyPlanResponse) { - if !req.Plan.Raw.IsNull() { - var planData, stateData *FvRsProtByResourceModel - resp.Diagnostics.Append(req.Plan.Get(ctx, &planData)...) - resp.Diagnostics.Append(req.State.Get(ctx, &stateData)...) - - if resp.Diagnostics.HasError() { - return - } - - if (planData.Id.IsUnknown() || planData.Id.IsNull()) && !planData.ParentDn.IsUnknown() && !planData.TnVzTabooName.IsUnknown() { - setFvRsProtById(ctx, planData) - } - - if stateData == nil && !globalAllowExistingOnCreate && !planData.Id.IsUnknown() && !planData.Id.IsNull() { - CheckDn(ctx, &resp.Diagnostics, r.client, "fvRsProtBy", planData.Id.ValueString()) - if resp.Diagnostics.HasError() { - return - } - } - - resp.Diagnostics.Append(resp.Plan.Set(ctx, &planData)...) - } -} - -func (r *FvRsProtByResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { - tflog.Debug(ctx, "Start metadata of resource: aci_relation_to_taboo_contract") - resp.TypeName = req.ProviderTypeName + "_relation_to_taboo_contract" - tflog.Debug(ctx, "End metadata of resource: aci_relation_to_taboo_contract") -} - -func (r *FvRsProtByResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { - tflog.Debug(ctx, "Start schema of resource: aci_relation_to_taboo_contract") - resp.Schema = schema.Schema{ - // This description is used by the documentation generator and the language server. - MarkdownDescription: "The relation_to_taboo_contract resource for the 'fvRsProtBy' class", - - Attributes: map[string]schema.Attribute{ - "id": schema.StringAttribute{ - Computed: true, - MarkdownDescription: "The distinguished name (DN) of the Relation To Taboo Contract object.", - PlanModifiers: []planmodifier.String{ - stringplanmodifier.UseStateForUnknown(), - }, - }, - "parent_dn": schema.StringAttribute{ - Required: true, - MarkdownDescription: "The distinguished name (DN) of the parent object.", - PlanModifiers: []planmodifier.String{ - stringplanmodifier.UseStateForUnknown(), - stringplanmodifier.RequiresReplace(), - }, - }, - "annotation": schema.StringAttribute{ - Optional: true, - Computed: true, - PlanModifiers: []planmodifier.String{ - stringplanmodifier.UseStateForUnknown(), - SetToStringNullWhenStateIsNullPlanIsUnknownDuringUpdate(), - }, - Default: stringdefault.StaticString(globalAnnotation), - MarkdownDescription: `The annotation of the Relation To Taboo Contract object.`, - }, - "taboo_contract_name": schema.StringAttribute{ - Required: true, - PlanModifiers: []planmodifier.String{ - stringplanmodifier.UseStateForUnknown(), - SetToStringNullWhenStateIsNullPlanIsUnknownDuringUpdate(), - stringplanmodifier.RequiresReplace(), - }, - 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{ - 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_relation_to_taboo_contract") -} - -func (r *FvRsProtByResource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse) { - tflog.Debug(ctx, "Start configure of resource: aci_relation_to_taboo_contract") - // 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_relation_to_taboo_contract") -} - -func (r *FvRsProtByResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { - tflog.Debug(ctx, "Start create of resource: aci_relation_to_taboo_contract") - // On create retrieve information on current state prior to making any changes in order to determine child delete operations - var stateData *FvRsProtByResourceModel - resp.Diagnostics.Append(req.Plan.Get(ctx, &stateData)...) - if stateData.Id.IsUnknown() || stateData.Id.IsNull() { - setFvRsProtById(ctx, stateData) - } - getAndSetFvRsProtByAttributes(ctx, &resp.Diagnostics, r.client, stateData) - if !globalAllowExistingOnCreate && !stateData.Id.IsNull() { - resp.Diagnostics.AddError( - "Object Already Exists", - fmt.Sprintf("The fvRsProtBy object with DN '%s' already exists.", stateData.Id.ValueString()), - ) - return - } - - var data *FvRsProtByResourceModel - - // 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() { - setFvRsProtById(ctx, data) - } - - tflog.Debug(ctx, fmt.Sprintf("Create of resource aci_relation_to_taboo_contract with id '%s'", data.Id.ValueString())) - - var tagAnnotationPlan, tagAnnotationState []TagAnnotationFvRsProtByResourceModel - data.TagAnnotation.ElementsAs(ctx, &tagAnnotationPlan, false) - stateData.TagAnnotation.ElementsAs(ctx, &tagAnnotationState, false) - var tagTagPlan, tagTagState []TagTagFvRsProtByResourceModel - data.TagTag.ElementsAs(ctx, &tagTagPlan, false) - stateData.TagTag.ElementsAs(ctx, &tagTagState, false) - jsonPayload := getFvRsProtByCreateJsonPayload(ctx, &resp.Diagnostics, true, data, 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 - } - - getAndSetFvRsProtByAttributes(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_relation_to_taboo_contract with id '%s'", data.Id.ValueString())) -} - -func (r *FvRsProtByResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { - tflog.Debug(ctx, "Start read of resource: aci_relation_to_taboo_contract") - var data *FvRsProtByResourceModel - - // 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_relation_to_taboo_contract with id '%s'", data.Id.ValueString())) - - getAndSetFvRsProtByAttributes(ctx, &resp.Diagnostics, r.client, data) - - // Save updated data into Terraform state - if data.Id.IsNull() { - var emptyData *FvRsProtByResourceModel - 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_relation_to_taboo_contract with id '%s'", data.Id.ValueString())) -} - -func (r *FvRsProtByResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { - tflog.Debug(ctx, "Start update of resource: aci_relation_to_taboo_contract") - var data *FvRsProtByResourceModel - var stateData *FvRsProtByResourceModel - - // Read Terraform plan data into the model - resp.Diagnostics.Append(req.Plan.Get(ctx, &data)...) - resp.Diagnostics.Append(req.State.Get(ctx, &stateData)...) - - if resp.Diagnostics.HasError() { - return - } - - tflog.Debug(ctx, fmt.Sprintf("Update of resource aci_relation_to_taboo_contract with id '%s'", data.Id.ValueString())) - - var tagAnnotationPlan, tagAnnotationState []TagAnnotationFvRsProtByResourceModel - data.TagAnnotation.ElementsAs(ctx, &tagAnnotationPlan, false) - stateData.TagAnnotation.ElementsAs(ctx, &tagAnnotationState, false) - var tagTagPlan, tagTagState []TagTagFvRsProtByResourceModel - data.TagTag.ElementsAs(ctx, &tagTagPlan, false) - stateData.TagTag.ElementsAs(ctx, &tagTagState, false) - jsonPayload := getFvRsProtByCreateJsonPayload(ctx, &resp.Diagnostics, false, data, 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 - } - - getAndSetFvRsProtByAttributes(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_relation_to_taboo_contract with id '%s'", data.Id.ValueString())) -} - -func (r *FvRsProtByResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { - tflog.Debug(ctx, "Start delete of resource: aci_relation_to_taboo_contract") - var data *FvRsProtByResourceModel - - // 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_relation_to_taboo_contract with id '%s'", data.Id.ValueString())) - jsonPayload := GetDeleteJsonPayload(ctx, &resp.Diagnostics, "fvRsProtBy", 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_relation_to_taboo_contract with id '%s'", data.Id.ValueString())) -} - -func (r *FvRsProtByResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { - tflog.Debug(ctx, "Start import state of resource: aci_relation_to_taboo_contract") - resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) - - var stateData *FvRsProtByResourceModel - resp.Diagnostics.Append(resp.State.Get(ctx, &stateData)...) - tflog.Debug(ctx, fmt.Sprintf("Import state of resource aci_relation_to_taboo_contract with id '%s'", stateData.Id.ValueString())) - - tflog.Debug(ctx, "End import of state resource: aci_relation_to_taboo_contract") -} - -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) - - *data = *getEmptyFvRsProtByResourceModel() - - if diags.HasError() { - return - } - if requestData.Search("imdata").Search("fvRsProtBy").Data() != nil { - classReadInfo := requestData.Search("imdata").Search("fvRsProtBy").Data().([]interface{}) - if len(classReadInfo) == 1 { - attributes := classReadInfo[0].(map[string]interface{})["attributes"].(map[string]interface{}) - for attributeName, attributeValue := range attributes { - if attributeName == "dn" { - data.Id = basetypes.NewStringValue(attributeValue.(string)) - setFvRsProtByParentDn(ctx, attributeValue.(string), data) - } - if attributeName == "annotation" { - data.Annotation = basetypes.NewStringValue(attributeValue.(string)) - } - if attributeName == "tnVzTabooName" { - data.TnVzTabooName = basetypes.NewStringValue(attributeValue.(string)) - } - } - TagAnnotationFvRsProtByList := make([]TagAnnotationFvRsProtByResourceModel, 0) - TagTagFvRsProtByList := make([]TagTagFvRsProtByResourceModel, 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 == "tagAnnotation" { - TagAnnotationFvRsProtBy := getEmptyTagAnnotationFvRsProtByResourceModel() - for childAttributeName, childAttributeValue := range childAttributes { - if childAttributeName == "key" { - TagAnnotationFvRsProtBy.Key = basetypes.NewStringValue(childAttributeValue.(string)) - } - if childAttributeName == "value" { - TagAnnotationFvRsProtBy.Value = basetypes.NewStringValue(childAttributeValue.(string)) - } - } - TagAnnotationFvRsProtByList = append(TagAnnotationFvRsProtByList, TagAnnotationFvRsProtBy) - } - if childClassName == "tagTag" { - TagTagFvRsProtBy := getEmptyTagTagFvRsProtByResourceModel() - for childAttributeName, childAttributeValue := range childAttributes { - if childAttributeName == "key" { - TagTagFvRsProtBy.Key = basetypes.NewStringValue(childAttributeValue.(string)) - } - if childAttributeName == "value" { - TagTagFvRsProtBy.Value = basetypes.NewStringValue(childAttributeValue.(string)) - } - } - TagTagFvRsProtByList = append(TagTagFvRsProtByList, TagTagFvRsProtBy) - } - } - } - } - tagAnnotationSet, _ := types.SetValueFrom(ctx, data.TagAnnotation.ElementType(ctx), TagAnnotationFvRsProtByList) - data.TagAnnotation = tagAnnotationSet - tagTagSet, _ := types.SetValueFrom(ctx, data.TagTag.ElementType(ctx), TagTagFvRsProtByList) - data.TagTag = tagTagSet - } else { - diags.AddError( - "too many results in response", - fmt.Sprintf("%v matches returned for class 'fvRsProtBy'. Please report this issue to the provider developers.", len(classReadInfo)), - ) - } - } else { - data.Id = basetypes.NewStringNull() - } -} - -func getFvRsProtByRn(ctx context.Context, data *FvRsProtByResourceModel) string { - rn := "rsprotBy-{tnVzTabooName}" - for _, identifier := range []string{"tnVzTabooName"} { - fieldName := fmt.Sprintf("%s%s", strings.ToUpper(identifier[:1]), identifier[1:]) - fieldValue := reflect.ValueOf(data).Elem().FieldByName(fieldName).Interface().(basetypes.StringValue).ValueString() - rn = strings.ReplaceAll(rn, fmt.Sprintf("{%s}", identifier), fieldValue) - } - return rn -} - -func setFvRsProtByParentDn(ctx context.Context, dn string, data *FvRsProtByResourceModel) { - bracketIndex := 0 - rnIndex := 0 - for i := len(dn) - 1; i >= 0; i-- { - if string(dn[i]) == "]" { - bracketIndex = bracketIndex + 1 - } else if string(dn[i]) == "[" { - bracketIndex = bracketIndex - 1 - } else if string(dn[i]) == "/" && bracketIndex == 0 { - rnIndex = i - break - } - } - data.ParentDn = basetypes.NewStringValue(dn[:rnIndex]) -} - -func setFvRsProtById(ctx context.Context, data *FvRsProtByResourceModel) { - rn := getFvRsProtByRn(ctx, data) - 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{} { - - childPayloads := []map[string]interface{}{} - if !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() - } - if !tagAnnotation.Value.IsUnknown() && !tagAnnotation.Value.IsNull() { - childMap["attributes"]["value"] = tagAnnotation.Value.ValueString() - } - childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap}) - tagAnnotationIdentifier := TagAnnotationIdentifier{} - tagAnnotationIdentifier.Key = tagAnnotation.Key - tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier) - } - for _, tagAnnotation := range tagAnnotationState { - delete := true - for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers { - if tagAnnotationIdentifier.Key == tagAnnotation.Key { - delete = false - break - } - } - 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}) - } - } - } else { - data.TagAnnotation = types.SetNull(data.TagAnnotation.ElementType(ctx)) - } - - return childPayloads -} -func getFvRsProtByTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvRsProtByResourceModel, tagTagPlan, tagTagState []TagTagFvRsProtByResourceModel) []map[string]interface{} { - - childPayloads := []map[string]interface{}{} - if !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() - } - if !tagTag.Value.IsUnknown() && !tagTag.Value.IsNull() { - childMap["attributes"]["value"] = tagTag.Value.ValueString() - } - childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap}) - tagTagIdentifier := TagTagIdentifier{} - tagTagIdentifier.Key = tagTag.Key - tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier) - } - for _, tagTag := range tagTagState { - delete := true - for _, tagTagIdentifier := range tagTagIdentifiers { - if tagTagIdentifier.Key == tagTag.Key { - delete = false - break - } - } - 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}) - } - } - } else { - data.TagTag = types.SetNull(data.TagTag.ElementType(ctx)) - } - - return childPayloads -} - -func getFvRsProtByCreateJsonPayload(ctx context.Context, diags *diag.Diagnostics, createType bool, data *FvRsProtByResourceModel, tagAnnotationPlan, tagAnnotationState []TagAnnotationFvRsProtByResourceModel, tagTagPlan, tagTagState []TagTagFvRsProtByResourceModel) *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{}{} - - TagAnnotationchildPayloads := getFvRsProtByTagAnnotationChildPayloads(ctx, diags, data, tagAnnotationPlan, tagAnnotationState) - if TagAnnotationchildPayloads == nil { - return nil - } - childPayloads = append(childPayloads, TagAnnotationchildPayloads...) - - TagTagchildPayloads := getFvRsProtByTagTagChildPayloads(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.TnVzTabooName.IsNull() && !data.TnVzTabooName.IsUnknown() { - payloadMap["attributes"].(map[string]string)["tnVzTabooName"] = data.TnVzTabooName.ValueString() - } - - payload, err := json.Marshal(map[string]interface{}{"fvRsProtBy": 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_relation_to_taboo_contract_test.go b/internal/provider/resource_aci_relation_to_taboo_contract_test.go deleted file mode 100644 index 90f12ba9c..000000000 --- a/internal/provider/resource_aci_relation_to_taboo_contract_test.go +++ /dev/null @@ -1,271 +0,0 @@ -// 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 TestAccResourceFvRsProtByWithFvAEPg(t *testing.T) { - - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, - Steps: []resource.TestStep{ - // Create with minimum config and verify default APIC values - { - Config: testConfigFvRsProtByMinDependencyWithFvAEPgAllowExisting, - ExpectNonEmptyPlan: false, - Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("aci_relation_to_taboo_contract.allow_test", "taboo_contract_name", "test_tn_vz_taboo_name"), - resource.TestCheckResourceAttr("aci_relation_to_taboo_contract.allow_test_2", "taboo_contract_name", "test_tn_vz_taboo_name"), - resource.TestCheckResourceAttr("aci_relation_to_taboo_contract.allow_test", "annotation", "orchestrator:terraform"), - resource.TestCheckResourceAttr("aci_relation_to_taboo_contract.allow_test_2", "annotation", "orchestrator:terraform"), - ), - }, - }, - }) - - setEnvVariable(t, "ACI_ALLOW_EXISTING_ON_CREATE", "false") - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, - Steps: []resource.TestStep{ - // Create with minimum config and verify default APIC values - { - Config: testConfigFvRsProtByMinDependencyWithFvAEPgAllowExisting, - ExpectError: regexp.MustCompile("Object Already Exists"), - }, - }, - }) - - setEnvVariable(t, "ACI_ALLOW_EXISTING_ON_CREATE", "true") - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, - Steps: []resource.TestStep{ - // Create with minimum config and verify default APIC values - { - Config: testConfigFvRsProtByMinDependencyWithFvAEPgAllowExisting, - ExpectNonEmptyPlan: false, - Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("aci_relation_to_taboo_contract.allow_test", "taboo_contract_name", "test_tn_vz_taboo_name"), - resource.TestCheckResourceAttr("aci_relation_to_taboo_contract.allow_test_2", "taboo_contract_name", "test_tn_vz_taboo_name"), - resource.TestCheckResourceAttr("aci_relation_to_taboo_contract.allow_test", "annotation", "orchestrator:terraform"), - resource.TestCheckResourceAttr("aci_relation_to_taboo_contract.allow_test_2", "annotation", "orchestrator:terraform"), - ), - }, - }, - }) - - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, - Steps: []resource.TestStep{ - // Create with minimum config and verify default APIC values - { - Config: testConfigFvRsProtByMinDependencyWithFvAEPg, - ExpectNonEmptyPlan: false, - Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("aci_relation_to_taboo_contract.test", "taboo_contract_name", "test_tn_vz_taboo_name"), - resource.TestCheckResourceAttr("aci_relation_to_taboo_contract.test", "annotation", "orchestrator:terraform"), - ), - }, - // Update with all config and verify default APIC values - { - Config: testConfigFvRsProtByAllDependencyWithFvAEPg, - ExpectNonEmptyPlan: false, - Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("aci_relation_to_taboo_contract.test", "taboo_contract_name", "test_tn_vz_taboo_name"), - resource.TestCheckResourceAttr("aci_relation_to_taboo_contract.test", "annotation", "annotation"), - ), - }, - // Update with minimum config and verify config is unchanged - { - Config: testConfigFvRsProtByMinDependencyWithFvAEPg, - ExpectNonEmptyPlan: false, - Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("aci_relation_to_taboo_contract.test", "taboo_contract_name", "test_tn_vz_taboo_name"), - ), - }, - // Update with empty strings config or default value - { - Config: testConfigFvRsProtByResetDependencyWithFvAEPg, - ExpectNonEmptyPlan: false, - Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("aci_relation_to_taboo_contract.test", "taboo_contract_name", "test_tn_vz_taboo_name"), - resource.TestCheckResourceAttr("aci_relation_to_taboo_contract.test", "annotation", "orchestrator:terraform"), - ), - }, - // Import testing - { - ResourceName: "aci_relation_to_taboo_contract.test", - ImportState: true, - ImportStateVerify: true, - }, - // Update with children - { - Config: testConfigFvRsProtByChildrenDependencyWithFvAEPg, - ExpectNonEmptyPlan: false, - Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("aci_relation_to_taboo_contract.test", "taboo_contract_name", "test_tn_vz_taboo_name"), - resource.TestCheckResourceAttr("aci_relation_to_taboo_contract.test", "annotation", "orchestrator:terraform"), - resource.TestCheckResourceAttr("aci_relation_to_taboo_contract.test", "annotations.0.key", "key_0"), - resource.TestCheckResourceAttr("aci_relation_to_taboo_contract.test", "annotations.0.value", "value_1"), - resource.TestCheckResourceAttr("aci_relation_to_taboo_contract.test", "annotations.1.key", "key_1"), - resource.TestCheckResourceAttr("aci_relation_to_taboo_contract.test", "annotations.1.value", "test_value"), - resource.TestCheckResourceAttr("aci_relation_to_taboo_contract.test", "tags.0.key", "key_0"), - resource.TestCheckResourceAttr("aci_relation_to_taboo_contract.test", "tags.0.value", "value_1"), - resource.TestCheckResourceAttr("aci_relation_to_taboo_contract.test", "tags.1.key", "key_1"), - resource.TestCheckResourceAttr("aci_relation_to_taboo_contract.test", "tags.1.value", "test_value"), - ), - }, - // Import testing with children - { - ResourceName: "aci_relation_to_taboo_contract.test", - ImportState: true, - ImportStateVerify: true, - }, - // Update with children removed from config - { - Config: testConfigFvRsProtByChildrenRemoveFromConfigDependencyWithFvAEPg, - ExpectNonEmptyPlan: false, - Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("aci_relation_to_taboo_contract.test", "annotations.0.key", "key_0"), - resource.TestCheckResourceAttr("aci_relation_to_taboo_contract.test", "annotations.0.value", "value_1"), - resource.TestCheckResourceAttr("aci_relation_to_taboo_contract.test", "annotations.1.key", "key_1"), - resource.TestCheckResourceAttr("aci_relation_to_taboo_contract.test", "annotations.1.value", "test_value"), - resource.TestCheckResourceAttr("aci_relation_to_taboo_contract.test", "annotations.#", "2"), - resource.TestCheckResourceAttr("aci_relation_to_taboo_contract.test", "tags.0.key", "key_0"), - resource.TestCheckResourceAttr("aci_relation_to_taboo_contract.test", "tags.0.value", "value_1"), - resource.TestCheckResourceAttr("aci_relation_to_taboo_contract.test", "tags.1.key", "key_1"), - resource.TestCheckResourceAttr("aci_relation_to_taboo_contract.test", "tags.1.value", "test_value"), - resource.TestCheckResourceAttr("aci_relation_to_taboo_contract.test", "tags.#", "2"), - ), - }, - // Update with children first child removed - { - Config: testConfigFvRsProtByChildrenRemoveOneDependencyWithFvAEPg, - ExpectNonEmptyPlan: false, - Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("aci_relation_to_taboo_contract.test", "annotations.0.key", "key_1"), - resource.TestCheckResourceAttr("aci_relation_to_taboo_contract.test", "annotations.0.value", "test_value"), - resource.TestCheckResourceAttr("aci_relation_to_taboo_contract.test", "annotations.#", "1"), - resource.TestCheckResourceAttr("aci_relation_to_taboo_contract.test", "tags.0.key", "key_1"), - resource.TestCheckResourceAttr("aci_relation_to_taboo_contract.test", "tags.0.value", "test_value"), - resource.TestCheckResourceAttr("aci_relation_to_taboo_contract.test", "tags.#", "1"), - ), - }, - // Update with all children removed - { - Config: testConfigFvRsProtByChildrenRemoveAllDependencyWithFvAEPg, - ExpectNonEmptyPlan: false, - Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("aci_relation_to_taboo_contract.test", "annotations.#", "0"), - resource.TestCheckResourceAttr("aci_relation_to_taboo_contract.test", "tags.#", "0"), - ), - }, - }, - }) -} - -const testConfigFvRsProtByMinDependencyWithFvAEPgAllowExisting = testConfigFvAEPgMinDependencyWithFvAp + ` -resource "aci_relation_to_taboo_contract" "allow_test" { - parent_dn = aci_application_epg.test.id - taboo_contract_name = "test_tn_vz_taboo_name" -} -resource "aci_relation_to_taboo_contract" "allow_test_2" { - parent_dn = aci_application_epg.test.id - taboo_contract_name = "test_tn_vz_taboo_name" - depends_on = [aci_relation_to_taboo_contract.allow_test] -} -` - -const testConfigFvRsProtByMinDependencyWithFvAEPg = testConfigFvAEPgMinDependencyWithFvAp + ` -resource "aci_relation_to_taboo_contract" "test" { - parent_dn = aci_application_epg.test.id - taboo_contract_name = "test_tn_vz_taboo_name" -} -` - -const testConfigFvRsProtByAllDependencyWithFvAEPg = testConfigFvAEPgMinDependencyWithFvAp + ` -resource "aci_relation_to_taboo_contract" "test" { - parent_dn = aci_application_epg.test.id - taboo_contract_name = "test_tn_vz_taboo_name" - annotation = "annotation" -} -` - -const testConfigFvRsProtByResetDependencyWithFvAEPg = testConfigFvAEPgMinDependencyWithFvAp + ` -resource "aci_relation_to_taboo_contract" "test" { - parent_dn = aci_application_epg.test.id - taboo_contract_name = "test_tn_vz_taboo_name" - annotation = "orchestrator:terraform" -} -` -const testConfigFvRsProtByChildrenDependencyWithFvAEPg = testConfigFvAEPgMinDependencyWithFvAp + ` -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" - }, - ] - tags = [ - { - key = "key_0" - value = "value_1" - }, - { - key = "key_1" - value = "test_value" - }, - ] -} -` - -const testConfigFvRsProtByChildrenRemoveFromConfigDependencyWithFvAEPg = testConfigFvAEPgMinDependencyWithFvAp + ` -resource "aci_relation_to_taboo_contract" "test" { - parent_dn = aci_application_epg.test.id - taboo_contract_name = "test_tn_vz_taboo_name" -} -` - -const testConfigFvRsProtByChildrenRemoveOneDependencyWithFvAEPg = testConfigFvAEPgMinDependencyWithFvAp + ` -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_1" - value = "test_value" - }, - ] - tags = [ - { - key = "key_1" - value = "test_value" - }, - ] -} -` - -const testConfigFvRsProtByChildrenRemoveAllDependencyWithFvAEPg = testConfigFvAEPgMinDependencyWithFvAp + ` -resource "aci_relation_to_taboo_contract" "test" { - parent_dn = aci_application_epg.test.id - taboo_contract_name = "test_tn_vz_taboo_name" - annotations = [] - tags = [] -} -`