diff --git a/docs/data-sources/netflow_exporter_policy.md b/docs/data-sources/netflow_exporter_policy.md index b3076ce3c..07f954b78 100644 --- a/docs/data-sources/netflow_exporter_policy.md +++ b/docs/data-sources/netflow_exporter_policy.md @@ -59,15 +59,23 @@ data "aci_netflow_exporter_policy" "example_tenant" { * `id` - (string) The distinguished name (DN) of the Netflow Exporter Policy object. * `annotation` (annotation) - (string) The annotation of the Netflow Exporter Policy object. * `description` (descr) - (string) The description of the Netflow Exporter Policy object. -* `dscp` (dscp) - (string) The DSCP value of the Netflow Exporter Policy object. -* `destination_address` (dstAddr) - (string) The destination IP address of the remote node. +* `qos_dscp_value` (dscp) - (string) The DSCP value of the Netflow Exporter Policy object. +* `destination_ip_address` (dstAddr) - (string) The destination IP address of the remote node. * `destination_port` (dstPort) - (string) The destination port of the remote node. * `name_alias` (nameAlias) - (string) The name alias of the Netflow Exporter Policy object. * `owner_key` (ownerKey) - (string) The key for enabling clients to own their data for entity correlation. * `owner_tag` (ownerTag) - (string) A tag for enabling clients to add their own data. For example, to indicate who created this object. * `source_ip_type` (sourceIpType) - (string) The type of the source IP address: It can be one of the available management IP address for a given leaf or a custom IP Address. -* `source_address` (srcAddr) - (string) The source IP address. -* `version` (ver) - (string) The collector version. +* `source_ip_address` (srcAddr) - (string) The source IP address. +* `version` (ver) - (string) The NetFlow Exporter Version of the Netflow Exporter Policy object. + +* `relation_to_vrf` - (list) A list of Relation To VRF (ACI object [netflowRsExporterToCtx](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/netflowRsExporterToCtx/overview)) pointing to VRF (ACI Object [fvCtx](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvCtx/overview)). + * `annotation` (annotation) - (string) The annotation of the Relation To VRF object. + * `target_dn` (tDn) - (string) The distinguished name of the target. + +* `relation_to_epg` - (list) A list of Relation To EPG (ACI object [netflowRsExporterToEPg](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/netflowRsExporterToEPg/overview)) pointing to (ACI Object [fvEPg](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvEPg/overview)). + * `annotation` (annotation) - (string) The annotation of the Relation To EPG object. + * `target_dn` (tDn) - (string) The distinguished name of the target. * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later. * `key` (key) - (string) The key used to uniquely identify this configuration object. diff --git a/docs/resources/netflow_exporter_policy.md b/docs/resources/netflow_exporter_policy.md index 635244855..cd106ebb7 100644 --- a/docs/resources/netflow_exporter_policy.md +++ b/docs/resources/netflow_exporter_policy.md @@ -39,10 +39,10 @@ The configuration snippet below creates a Netflow Exporter Policy with only requ ```hcl resource "aci_netflow_exporter_policy" "example_tenant" { - parent_dn = aci_tenant.example.id - destination_address = "2.2.2.1" - destination_port = "https" - name = "netfow_exporter" + parent_dn = aci_tenant.example.id + destination_ip_address = "2.2.2.1" + destination_port = "https" + name = "netfow_exporter" } ``` @@ -53,19 +53,31 @@ The configuration snippet below shows all possible attributes of the Netflow Exp ```hcl resource "aci_netflow_exporter_policy" "full_example_tenant" { - parent_dn = aci_tenant.example.id - annotation = "annotation" - description = "description_1" - dscp = "AF11" - destination_address = "2.2.2.1" - destination_port = "https" - name = "netfow_exporter" - name_alias = "name_alias_1" - owner_key = "owner_key_1" - owner_tag = "owner_tag_1" - source_ip_type = "custom-src-ip" - source_address = "1.1.1.1/10" - version = "v9" + parent_dn = aci_tenant.example.id + annotation = "annotation" + description = "description_1" + qos_dscp_value = "AF11" + destination_ip_address = "2.2.2.1" + destination_port = "https" + name = "netfow_exporter" + name_alias = "name_alias_1" + owner_key = "owner_key_1" + owner_tag = "owner_tag_1" + source_ip_type = "custom-src-ip" + source_ip_address = "1.1.1.1/10" + version = "v9" + relation_to_vrf = [ + { + annotation = "annotation_1" + target_dn = "uni/tn-test_tenant/ctx-test_vrf" + } + ] + relation_to_epg = [ + { + annotation = "annotation_1" + target_dn = "uni/tn-test_tenant/ap-test_ap/epg-test_epg" + } + ] annotations = [ { key = "key_0" @@ -88,7 +100,7 @@ All examples for the Netflow Exporter Policy resource can be found in the [examp ### Required ### -* `destination_address` (dstAddr) - (string) The destination IP address of the remote node. +* `destination_ip_address` (dstAddr) - (string) The destination IP address of the remote node. * `destination_port` (dstPort) - (string) The destination port of the remote node. - Valid Values: `dns`, `ftpData`, `http`, `https`, `pop3`, `rtsp`, `smtp`, `ssh`, `unspecified`. * `name` (name) - (string) The name of the Netflow Exporter Policy object. @@ -108,7 +120,7 @@ All examples for the Netflow Exporter Policy resource can be found in the [examp * `annotation` (annotation) - (string) The annotation of the Netflow Exporter Policy object. - Default: `orchestrator:terraform` * `description` (descr) - (string) The description of the Netflow Exporter Policy object. -* `dscp` (dscp) - (string) The DSCP value of the Netflow Exporter Policy object. +* `qos_dscp_value` (dscp) - (string) The DSCP value of the Netflow Exporter Policy object. - Default: `CS2` - Valid Values: `AF11`, `AF12`, `AF13`, `AF21`, `AF22`, `AF23`, `AF31`, `AF32`, `AF33`, `AF41`, `AF42`, `AF43`, `CS0`, `CS1`, `CS2`, `CS3`, `CS4`, `CS5`, `CS6`, `CS7`, `EF`, `VA`. * `name_alias` (nameAlias) - (string) The name alias of the Netflow Exporter Policy object. @@ -117,11 +129,31 @@ All examples for the Netflow Exporter Policy resource can be found in the [examp * `source_ip_type` (sourceIpType) - (string) The type of the source IP address: It can be one of the available management IP address for a given leaf or a custom IP Address. - Default: `custom-src-ip` - Valid Values: `custom-src-ip`, `inband-mgmt-ip`, `oob-mgmt-ip`, `ptep`. -* `source_address` (srcAddr) - (string) The source IP address. -* `version` (ver) - (string) The collector version. +* `source_ip_address` (srcAddr) - (string) The source IP address. +* `version` (ver) - (string) The NetFlow Exporter Version of the Netflow Exporter Policy object. - Default: `v9` - Valid Values: `cisco-v1`, `v5`, `v9`. +* `relation_to_vrf` - (list) A list of Relation To VRF (ACI object [netflowRsExporterToCtx](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/netflowRsExporterToCtx/overview)) pointing to VRF (ACI Object [fvCtx](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvCtx/overview)) which can be configured using the [aci_vrf](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/vrf) resource. + - Max Items: 1 + + + #### Optional #### + + * `annotation` (annotation) - (string) The annotation of the Relation To VRF object. + - Default: `orchestrator:terraform` + * `target_dn` (tDn) - (string) The distinguished name of the target. + +* `relation_to_epg` - (list) A list of Relation To EPG (ACI object [netflowRsExporterToEPg](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/netflowRsExporterToEPg/overview)) pointing to (ACI Object [fvEPg](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvEPg/overview)). + - Max Items: 1 + + + #### Optional #### + + * `annotation` (annotation) - (string) The annotation of the Relation To EPG object. + - Default: `orchestrator:terraform` + * `target_dn` (tDn) - (string) The distinguished name of the target. + * `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later. #### Required #### diff --git a/examples/resources/aci_netflow_exporter_policy/resource-all-attributes.tf b/examples/resources/aci_netflow_exporter_policy/resource-all-attributes.tf index 56be830db..aa89ae48a 100644 --- a/examples/resources/aci_netflow_exporter_policy/resource-all-attributes.tf +++ b/examples/resources/aci_netflow_exporter_policy/resource-all-attributes.tf @@ -1,18 +1,30 @@ resource "aci_netflow_exporter_policy" "full_example_tenant" { - parent_dn = aci_tenant.example.id - annotation = "annotation" - description = "description_1" - dscp = "AF11" - destination_address = "2.2.2.1" - destination_port = "https" - name = "netfow_exporter" - name_alias = "name_alias_1" - owner_key = "owner_key_1" - owner_tag = "owner_tag_1" - source_ip_type = "custom-src-ip" - source_address = "1.1.1.1/10" - version = "v9" + parent_dn = aci_tenant.example.id + annotation = "annotation" + description = "description_1" + qos_dscp_value = "AF11" + destination_ip_address = "2.2.2.1" + destination_port = "https" + name = "netfow_exporter" + name_alias = "name_alias_1" + owner_key = "owner_key_1" + owner_tag = "owner_tag_1" + source_ip_type = "custom-src-ip" + source_ip_address = "1.1.1.1/10" + version = "v9" + relation_to_vrf = [ + { + annotation = "annotation_1" + target_dn = "uni/tn-test_tenant/ctx-test_vrf" + } + ] + relation_to_epg = [ + { + annotation = "annotation_1" + target_dn = "uni/tn-test_tenant/ap-test_ap/epg-test_epg" + } + ] annotations = [ { key = "key_0" diff --git a/examples/resources/aci_netflow_exporter_policy/resource.tf b/examples/resources/aci_netflow_exporter_policy/resource.tf index 202f09e6e..cbdc83f67 100644 --- a/examples/resources/aci_netflow_exporter_policy/resource.tf +++ b/examples/resources/aci_netflow_exporter_policy/resource.tf @@ -1,7 +1,7 @@ resource "aci_netflow_exporter_policy" "example_tenant" { - parent_dn = aci_tenant.example.id - destination_address = "2.2.2.1" - destination_port = "https" - name = "netfow_exporter" + parent_dn = aci_tenant.example.id + destination_ip_address = "2.2.2.1" + destination_port = "https" + name = "netfow_exporter" } diff --git a/gen/definitions/classes.yaml b/gen/definitions/classes.yaml index 80dd6204b..1affa02a7 100644 --- a/gen/definitions/classes.yaml +++ b/gen/definitions/classes.yaml @@ -347,6 +347,20 @@ netflowExporterPol: - "Fabric -> Access Policies -> Policies -> Interface -> NetFlow -> NetFlow Exporters" sub_category: "Tenant Policies" +netflowRsExporterToEPg: + resource_name: "relation_to_epg" + ui_locations: + - "Tenants -> Policies -> NetFlow -> NetFlow Exporters" + - "Fabric -> Access Policies -> Policies -> Interface -> NetFlow -> NetFlow Exporters" + sub_category: "Tenant Policies" + +netflowRsExporterToCtx: + resource_name: "relation_to_vrf" + ui_locations: + - "Tenants -> Policies -> NetFlow -> NetFlow Exporters" + - "Fabric -> Access Policies -> Policies -> Interface -> NetFlow -> NetFlow Exporters" + sub_category: "Tenant Policies" + netflowRecordPol: resource_name: "netflow_record_policy" ui_locations: diff --git a/gen/definitions/properties.yaml b/gen/definitions/properties.yaml index 7b4cfcf00..503ef73de 100644 --- a/gen/definitions/properties.yaml +++ b/gen/definitions/properties.yaml @@ -914,35 +914,36 @@ netflowExporterPol: - dstAddr - dstPort overwrites: - dst_addr: "destination_address" + dst_addr: "destination_ip_address" dst_port: "destination_port" - src_addr: "source_address" + src_addr: "source_ip_address" ver: "version" + dscp: "qos_dscp_value" documentation: dstAddr: "The destination IP address of the remote node." dstPort: "The destination port of the remote node." - dscp: "The DSCP value of the Netflow Exporter Policy object." + dscp: "The DSCP value of the %s object." srcAddr: "The source IP address." - ver: "The collector version." + ver: "The NetFlow Exporter Version of the %s object." sourceIpType: "The type of the source IP address: It can be one of the available management IP address for a given leaf or a custom IP Address." default_values: parent_dn: "uni/infra" test_values: default: name: "netfow_exporter_default" - destination_address: "2.2.2.1" - source_address: "1.1.1.1/10" + destination_ip_address: "2.2.2.1" + source_ip_address: "1.1.1.1/10" destination_port: "https" all: name: "netfow_exporter" - destination_address: "12.12.12.1" - source_address: "11.11.11.1/11" + destination_ip_address: "12.12.12.1" + source_ip_address: "11.11.11.1/11" destination_port: "ssh" version: "v9" resource_required: - source_address: "1.1.1.1/10" name: "netfow_exporter" - destination_address: "2.2.2.1" + source_ip_address: "1.1.1.1/10" + destination_ip_address: "2.2.2.1" destination_port: "https" datasource_required: name: "netfow_exporter" @@ -955,3 +956,25 @@ netflowExporterPol: - class_name: "fvTenant" parent_dependency: "" parent_dn: "aci_tenant.test.id" + +netflowRsExporterToEPg: + parents: + - class_name: "netflowExporterPol" + target_classes: + - "fvEPg" + targets: + - class_name: "fvAEPg" + target_dn: "uni/tn-test_tenant/ap-test_ap/epg-test_epg" + relation_resource_name: "epg" + static: true + +netflowRsExporterToCtx: + parents: + - class_name: "netflowExporterPol" + target_classes: + - "fvCtx" + targets: + - class_name: "fvCtx" + target_dn: "uni/tn-test_tenant/ctx-test_vrf" + relation_resource_name: "vrf" + static: true \ No newline at end of file diff --git a/gen/meta/netflowRsExporterToCtx.json b/gen/meta/netflowRsExporterToCtx.json new file mode 100644 index 000000000..605c69c69 --- /dev/null +++ b/gen/meta/netflowRsExporterToCtx.json @@ -0,0 +1,915 @@ +{ + "netflow:RsExporterToCtx": { + "contains": { + "aaa:RbacAnnotation": "", + "fault:Counts": "", + "fault:Inst": "", + "health:Inst": "", + "tag:Annotation": "", + "tag:Tag": "" + }, + "rnMap": { + "annotationKey-": "tag:Annotation", + "fault-": "fault:Inst", + "fltCnts": "fault:Counts", + "health": "health:Inst", + "rbacDom-": "aaa:RbacAnnotation", + "tagKey-": "tag:Tag" + }, + "identifiedBy": [ + + ], + "rnFormat": "rsexporterToCtx", + "containedBy": { + "netflow:ExporterPol": "", + "netflow:ExporterPolDef": "" + }, + "superClasses": [ + "reln:To", + "reln:Inst" + ], + "subClasses": { + + }, + "relationInfo": { + "type": "explicit", + "cardinality": "n-to-1", + "fromMo": "netflow:AExporterPol", + "fromRelMo": "netflow:RsExporterToCtx", + "toMo": "fv:Ctx", + "toRelMo": "fv:RtExporterToCtx", + "enforceable": true, + "resolvable": false + }, + "dnFormats": [ + "poldefcont/exporterpold-[{exporterPolDn}]/rsexporterToCtx", + "uni/infra/exporterpol-{name}/rsexporterToCtx", + "uni/tn-{name}/exporterpol-{name}/rsexporterToCtx" + ], + "writeAccess": [ + "admin" + ], + "readAccess": [ + "admin" + ], + "faults": { + "F2551": "fltNetflowRsExporterToCtxResolveFail" + }, + "events": { + "E4214405": "creation||netflow:RsExporterToCtx", + "E4214406": "modification||netflow:RsExporterToCtx", + "E4214407": "deletion||netflow:RsExporterToCtx" + }, + "stats": { + + }, + "versions": "2.2(1k)-", + "isAbstract": false, + "isConfigurable": true, + "isContextRoot": false, + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false, + "isEncrypted": false, + "isExportable": true, + "isPersistent": true, + "isSubjectToQuota": false, + "isObservable": true, + "hasStats": false, + "isStat": false, + "isFaultable": true, + "isDomainable": false, + "isHealthScorable": true, + "shouldCollectHealthStats": false, + "healthCollectionSource": "faults", + "hasEventRules": false, + "abstractionLayer": "regular", + "apicNxProcessing": false, + "monitoringPolicySource": "Parent", + "isCreatableDeletable": "always", + "platformFlavors": [ + + ], + "classId": "9363", + "className": "RsExporterToCtx", + "classPkg": "netflow", + "featureTag": "", + "moCategory": "RelationshipToLocal", + "label": "Relation to Ctx behind which the Exporter resides", + "comment": [ + "Points to the Ctx behind which the Netflow Exporter Resides" + ], + "properties": { + "annotation": { + "versions": "3.2(1l)-", + "comment": [ + "User annotation. Suggested format orchestrator:value" + ], + "isConfigurable": true, + "propGlobalId": "38565", + "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": "40704", + "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": "2.2(1k)-", + "comment": [ + "The monitoring policy attached to this observable object." + ], + "isConfigurable": false, + "propGlobalId": "27832", + "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": "2.2(1k)-", + "comment": [ + "The class ID of the target object. This property is managed internally and should not be modified by the user." + ], + "isConfigurable": false, + "propGlobalId": "27829", + "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": "1997", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "1997", "localName": "fvCtx", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "0", "localName": "unspecified", + "platformFlavors": [ + + ], + "label": "unspecified "} + ], + "default": "fvCtx", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "tDn": { + "versions": "2.2(1k)-", + "comment": [ + "The distinguished name of the target." + ], + "isConfigurable": true, + "propGlobalId": "27828", + "propLocalId": "77", + "label": "Target-dn", + "baseType": "reference:BinRef", + "modelType": "reln:Dn", + "needsPropDelimiters": true, + "uitype": "string", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": true, + "isLike": false, + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "tType": { + "versions": "1.0(1e)-", + "comment": [ + "The type of target." + ], + "isConfigurable": false, + "propGlobalId": "105", + "propLocalId": "81", + "label": "Target Type", + "baseType": "scalar:Enum8", + "modelType": "reln:TargetType", + "needsPropDelimiters": false, + "uitype": "enum", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "2", "localName": "all", + "platformFlavors": [ + + ], + "label": "All "}, + { "value": "mo", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "1", "localName": "mo", + "platformFlavors": [ + + ], + "label": "MO "}, + { "value": "0", "localName": "name", + "platformFlavors": [ + + ], + "label": "Name "} + ], + "default": "mo", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "uid": { + "versions": "1.0(1e)-", + "comment": [ + "A unique identifier for this object." + ], + "isConfigurable": false, + "propGlobalId": "8", + "propLocalId": "8", + "label": "uid", + "baseType": "scalar:Uint16", + "modelType": "scalar:Uint16", + "needsPropDelimiters": false, + "uitype": "auto", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "userdom": { + "versions": "5.0(1k)-", + "isConfigurable": true, + "propGlobalId": "60657", + "propLocalId": "13244", + "label": "userdom", + "baseType": "string:Basic", + "modelType": "mo:UserDomType", + "needsPropDelimiters": false, + "uitype": "string", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validators": [ + {"min" : 0, "max": 1024, + "regexs": [ + {"regex" : "^[a-zA-Z0-9_.:-]+$", "type": "include"} + ] + } + ], + "validValues": [ + { "value": "all", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "} + ], + "default": "all", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + } + } + } +} diff --git a/gen/meta/netflowRsExporterToEPg.json b/gen/meta/netflowRsExporterToEPg.json new file mode 100644 index 000000000..d6963c4b6 --- /dev/null +++ b/gen/meta/netflowRsExporterToEPg.json @@ -0,0 +1,1015 @@ +{ + "netflow:RsExporterToEPg": { + "contains": { + "aaa:RbacAnnotation": "", + "fault:Counts": "", + "fault:Inst": "", + "health:Inst": "", + "tag:Annotation": "", + "tag:Tag": "" + }, + "rnMap": { + "annotationKey-": "tag:Annotation", + "fault-": "fault:Inst", + "fltCnts": "fault:Counts", + "health": "health:Inst", + "rbacDom-": "aaa:RbacAnnotation", + "tagKey-": "tag:Tag" + }, + "identifiedBy": [ + + ], + "rnFormat": "rsexporterToEPg", + "containedBy": { + "netflow:ExporterPol": "", + "netflow:ExporterPolDef": "" + }, + "superClasses": [ + "reln:To", + "reln:Inst" + ], + "subClasses": { + + }, + "relationInfo": { + "type": "explicit", + "cardinality": "n-to-1", + "fromMo": "netflow:AExporterPol", + "fromRelMo": "netflow:RsExporterToEPg", + "toMo": "fv:EPg", + "toRelMo": "fv:RtExporterToEPg", + "enforceable": true, + "resolvable": false + }, + "dnFormats": [ + "poldefcont/exporterpold-[{exporterPolDn}]/rsexporterToEPg", + "uni/infra/exporterpol-{name}/rsexporterToEPg", + "uni/tn-{name}/exporterpol-{name}/rsexporterToEPg" + ], + "writeAccess": [ + "admin" + ], + "readAccess": [ + "admin" + ], + "faults": { + "F2473": "fltNetflowRsExporterToEPgResolveFail" + }, + "events": { + "E4214408": "creation||netflow:RsExporterToEPg", + "E4214409": "modification||netflow:RsExporterToEPg", + "E4214410": "deletion||netflow:RsExporterToEPg" + }, + "stats": { + + }, + "versions": "2.2(1k)-", + "isAbstract": false, + "isConfigurable": true, + "isContextRoot": false, + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false, + "isEncrypted": false, + "isExportable": true, + "isPersistent": true, + "isSubjectToQuota": false, + "isObservable": true, + "hasStats": false, + "isStat": false, + "isFaultable": true, + "isDomainable": false, + "isHealthScorable": true, + "shouldCollectHealthStats": false, + "healthCollectionSource": "faults", + "hasEventRules": false, + "abstractionLayer": "regular", + "apicNxProcessing": false, + "monitoringPolicySource": "Parent", + "isCreatableDeletable": "always", + "platformFlavors": [ + + ], + "classId": "9205", + "className": "RsExporterToEPg", + "classPkg": "netflow", + "featureTag": "", + "moCategory": "RelationshipToLocal", + "label": "Relation to EPg behind which the Exporter resides", + "comment": [ + "Points to the EPg behind which the Netflow Exporter Resides" + ], + "properties": { + "annotation": { + "versions": "3.2(1l)-", + "comment": [ + "User annotation. Suggested format orchestrator:value" + ], + "isConfigurable": true, + "propGlobalId": "38545", + "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": "40684", + "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": "2.2(1k)-", + "comment": [ + "The monitoring policy attached to this observable object." + ], + "isConfigurable": false, + "propGlobalId": "27388", + "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": "2.2(1k)-", + "comment": [ + "The class ID of the target object. This property is managed internally and should not be modified by the user." + ], + "isConfigurable": false, + "propGlobalId": "27368", + "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": "14644", "localName": "cloudEPg", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "14645", "localName": "cloudExtEPg", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "15164", "localName": "cloudISvcEPg", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "18284", "localName": "cloudSvcEPg", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "1899", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "1467", "localName": "dhcpCRelPg", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "1466", "localName": "dhcpPRelPg", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "1981", "localName": "fvAEPg", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "1899", "localName": "fvEPg", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "16474", "localName": "fvESg", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "20529", "localName": "fvIntEPg", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "9196", "localName": "fvTnlEPg", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "4326", "localName": "infraCEPg", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "4325", "localName": "infraPEPg", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "1746", "localName": "l2extInstP", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "1775", "localName": "l3extInstP", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "5987", "localName": "l3extInstPDef", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "2194", "localName": "mgmtInB", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "0", "localName": "unspecified", + "platformFlavors": [ + + ], + "label": "unspecified "}, + { "value": "4694", "localName": "vnsEPpInfo", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "5959", "localName": "vnsREPpInfo", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "5958", "localName": "vnsSDEPpInfo", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "6131", "localName": "vnsSHEPpInfo", + "platformFlavors": [ + + ], + "label": " "} + ], + "default": "fvEPg", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "tDn": { + "versions": "2.2(1k)-", + "comment": [ + "The distinguished name of the target." + ], + "isConfigurable": true, + "propGlobalId": "27367", + "propLocalId": "77", + "label": "Target-dn", + "baseType": "reference:BinRef", + "modelType": "reln:Dn", + "needsPropDelimiters": true, + "uitype": "string", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": true, + "isLike": false, + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "tType": { + "versions": "1.0(1e)-", + "comment": [ + "The type of target." + ], + "isConfigurable": false, + "propGlobalId": "105", + "propLocalId": "81", + "label": "Target Type", + "baseType": "scalar:Enum8", + "modelType": "reln:TargetType", + "needsPropDelimiters": false, + "uitype": "enum", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validValues": [ + { "value": "2", "localName": "all", + "platformFlavors": [ + + ], + "label": "All "}, + { "value": "mo", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "}, + { "value": "1", "localName": "mo", + "platformFlavors": [ + + ], + "label": "MO "}, + { "value": "0", "localName": "name", + "platformFlavors": [ + + ], + "label": "Name "} + ], + "default": "mo", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "uid": { + "versions": "1.0(1e)-", + "comment": [ + "A unique identifier for this object." + ], + "isConfigurable": false, + "propGlobalId": "8", + "propLocalId": "8", + "label": "uid", + "baseType": "scalar:Uint16", + "modelType": "scalar:Uint16", + "needsPropDelimiters": false, + "uitype": "auto", + "createOnly": false, + "readWrite": false, + "readOnly": true, + "isNaming": false, + "secure": false, + "implicit": true, + "mandatory": false, + "isOverride": false, + "isLike": false, + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + }, + "userdom": { + "versions": "5.0(1k)-", + "isConfigurable": true, + "propGlobalId": "60657", + "propLocalId": "13244", + "label": "userdom", + "baseType": "string:Basic", + "modelType": "mo:UserDomType", + "needsPropDelimiters": false, + "uitype": "string", + "createOnly": false, + "readWrite": true, + "readOnly": false, + "isNaming": false, + "secure": false, + "implicit": false, + "mandatory": false, + "isOverride": false, + "isLike": false, + "validators": [ + {"min" : 0, "max": 1024, + "regexs": [ + {"regex" : "^[a-zA-Z0-9_.:-]+$", "type": "include"} + ] + } + ], + "validValues": [ + { "value": "all", "localName": "defaultValue", + "platformFlavors": [ + + ], + "label": " "} + ], + "default": "all", + "platformFlavors": [ + + ], + "isNxosConverged": false, + "isDeprecated": false, + "isHidden": false + } + } + } +} diff --git a/gen/testvars/netflowExporterPol.yaml b/gen/testvars/netflowExporterPol.yaml index 2b1c5f653..afe802cfd 100644 --- a/gen/testvars/netflowExporterPol.yaml +++ b/gen/testvars/netflowExporterPol.yaml @@ -5,14 +5,14 @@ default: annotation: "orchestrator:terraform" description: "" - dscp: "CS2" - destination_address: "2.2.2.1" + qos_dscp_value: "CS2" + destination_ip_address: "2.2.2.1" destination_port: "https" name_alias: "" owner_key: "" owner_tag: "" source_ip_type: "custom-src-ip" - source_address: "1.1.1.1/10" + source_ip_address: "1.1.1.1/10" version: "v9" datasource_non_existing: @@ -22,25 +22,33 @@ datasource_required: name: "netfow_exporter" resource_required: - destination_address: "2.2.2.1" + destination_ip_address: "2.2.2.1" destination_port: "https" name: "netfow_exporter" - source_address: "1.1.1.1/10" + source_ip_address: "1.1.1.1/10" all: annotation: "annotation" description: "description_1" - dscp: "AF11" - destination_address: "12.12.12.1" + qos_dscp_value: "AF11" + destination_ip_address: "12.12.12.1" destination_port: "ssh" name_alias: "name_alias_1" owner_key: "owner_key_1" owner_tag: "owner_tag_1" source_ip_type: "custom-src-ip" - source_address: "11.11.11.1/11" + source_ip_address: "11.11.11.1/11" version: "v9" children: + relation_to_vrf: + - annotation: "annotation_1" + target_dn: "target_dn_1" + deletable_child: true + relation_to_epg: + - annotation: "annotation_1" + target_dn: "target_dn_1" + deletable_child: true annotations: - key: "key_0" value: "value_1" @@ -60,3 +68,12 @@ parents: parent_dependency: "" parent_dn: "aci_tenant.test.id" class_in_parent: false +child_targets: + - class_name: "fvCtx" + target_dn: "uni/tn-test_tenant/ctx-test_vrf" + relation_resource_name: "vrf" + static: true + - class_name: "fvAEPg" + target_dn: "uni/tn-test_tenant/ap-test_ap/epg-test_epg" + relation_resource_name: "epg" + static: true diff --git a/internal/provider/data_source_aci_netflow_exporter_policy.go b/internal/provider/data_source_aci_netflow_exporter_policy.go index 359db1590..600292563 100644 --- a/internal/provider/data_source_aci_netflow_exporter_policy.go +++ b/internal/provider/data_source_aci_netflow_exporter_policy.go @@ -58,12 +58,12 @@ func (d *NetflowExporterPolDataSource) Schema(ctx context.Context, req datasourc Computed: true, MarkdownDescription: `The description of the Netflow Exporter Policy object.`, }, - "dscp": schema.StringAttribute{ + "qos_dscp_value": schema.StringAttribute{ CustomType: customTypes.NetflowExporterPolDscpStringType{}, Computed: true, MarkdownDescription: `The DSCP value of the Netflow Exporter Policy object.`, }, - "destination_address": schema.StringAttribute{ + "destination_ip_address": schema.StringAttribute{ Computed: true, MarkdownDescription: `The destination IP address of the remote node.`, }, @@ -92,13 +92,45 @@ func (d *NetflowExporterPolDataSource) Schema(ctx context.Context, req datasourc Computed: true, MarkdownDescription: `The type of the source IP address: It can be one of the available management IP address for a given leaf or a custom IP Address.`, }, - "source_address": schema.StringAttribute{ + "source_ip_address": schema.StringAttribute{ Computed: true, MarkdownDescription: `The source IP address.`, }, "version": schema.StringAttribute{ Computed: true, - MarkdownDescription: `The collector version.`, + MarkdownDescription: `The NetFlow Exporter Version of the Netflow Exporter Policy object.`, + }, + "relation_to_vrf": schema.SetNestedAttribute{ + MarkdownDescription: `Points to the Ctx behind which the Netflow Exporter Resides`, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "annotation": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The annotation of the Relation To VRF object.`, + }, + "target_dn": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The distinguished name of the target.`, + }, + }, + }, + }, + "relation_to_epg": schema.SetNestedAttribute{ + MarkdownDescription: `Points to the EPg behind which the Netflow Exporter Resides`, + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "annotation": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The annotation of the Relation To EPG object.`, + }, + "target_dn": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The distinguished name of the target.`, + }, + }, + }, }, "annotations": schema.SetNestedAttribute{ MarkdownDescription: ``, diff --git a/internal/provider/data_source_aci_netflow_exporter_policy_test.go b/internal/provider/data_source_aci_netflow_exporter_policy_test.go index 00fc88090..d6e74532d 100644 --- a/internal/provider/data_source_aci_netflow_exporter_policy_test.go +++ b/internal/provider/data_source_aci_netflow_exporter_policy_test.go @@ -24,13 +24,13 @@ func TestAccDataSourceNetflowExporterPolWithFvTenant(t *testing.T) { resource.TestCheckResourceAttr("data.aci_netflow_exporter_policy.test", "name", "netfow_exporter"), resource.TestCheckResourceAttr("data.aci_netflow_exporter_policy.test", "annotation", "orchestrator:terraform"), resource.TestCheckResourceAttr("data.aci_netflow_exporter_policy.test", "description", ""), - resource.TestCheckResourceAttr("data.aci_netflow_exporter_policy.test", "destination_address", "2.2.2.1"), + resource.TestCheckResourceAttr("data.aci_netflow_exporter_policy.test", "destination_ip_address", "2.2.2.1"), resource.TestCheckResourceAttr("data.aci_netflow_exporter_policy.test", "destination_port", "https"), - resource.TestCheckResourceAttr("data.aci_netflow_exporter_policy.test", "dscp", "CS2"), resource.TestCheckResourceAttr("data.aci_netflow_exporter_policy.test", "name_alias", ""), resource.TestCheckResourceAttr("data.aci_netflow_exporter_policy.test", "owner_key", ""), resource.TestCheckResourceAttr("data.aci_netflow_exporter_policy.test", "owner_tag", ""), - resource.TestCheckResourceAttr("data.aci_netflow_exporter_policy.test", "source_address", "1.1.1.1/10"), + resource.TestCheckResourceAttr("data.aci_netflow_exporter_policy.test", "qos_dscp_value", "CS2"), + resource.TestCheckResourceAttr("data.aci_netflow_exporter_policy.test", "source_ip_address", "1.1.1.1/10"), resource.TestCheckResourceAttr("data.aci_netflow_exporter_policy.test", "source_ip_type", "custom-src-ip"), resource.TestCheckResourceAttr("data.aci_netflow_exporter_policy.test", "version", "v9"), ), diff --git a/internal/provider/resource_aci_netflow_exporter_policy.go b/internal/provider/resource_aci_netflow_exporter_policy.go index e6c66dce5..23bd631c5 100644 --- a/internal/provider/resource_aci_netflow_exporter_policy.go +++ b/internal/provider/resource_aci_netflow_exporter_policy.go @@ -15,6 +15,7 @@ import ( "github.com/CiscoDevNet/terraform-provider-aci/v2/internal/validators" "github.com/ciscoecosystem/aci-go-client/v2/client" "github.com/ciscoecosystem/aci-go-client/v2/container" + "github.com/hashicorp/terraform-plugin-framework-validators/setvalidator" "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" "github.com/hashicorp/terraform-plugin-framework/attr" "github.com/hashicorp/terraform-plugin-framework/diag" @@ -46,22 +47,24 @@ type NetflowExporterPolResource struct { // NetflowExporterPolResourceModel describes the resource data model. type NetflowExporterPolResourceModel struct { - Id types.String `tfsdk:"id"` - ParentDn types.String `tfsdk:"parent_dn"` - Annotation types.String `tfsdk:"annotation"` - Descr types.String `tfsdk:"description"` - Dscp customTypes.NetflowExporterPolDscpStringValue `tfsdk:"dscp"` - DstAddr types.String `tfsdk:"destination_address"` - DstPort customTypes.NetflowExporterPolDstPortStringValue `tfsdk:"destination_port"` - Name types.String `tfsdk:"name"` - NameAlias types.String `tfsdk:"name_alias"` - OwnerKey types.String `tfsdk:"owner_key"` - OwnerTag types.String `tfsdk:"owner_tag"` - SourceIpType types.String `tfsdk:"source_ip_type"` - SrcAddr types.String `tfsdk:"source_address"` - Ver types.String `tfsdk:"version"` - TagAnnotation types.Set `tfsdk:"annotations"` - TagTag types.Set `tfsdk:"tags"` + Id types.String `tfsdk:"id"` + ParentDn types.String `tfsdk:"parent_dn"` + Annotation types.String `tfsdk:"annotation"` + Descr types.String `tfsdk:"description"` + Dscp customTypes.NetflowExporterPolDscpStringValue `tfsdk:"qos_dscp_value"` + DstAddr types.String `tfsdk:"destination_ip_address"` + DstPort customTypes.NetflowExporterPolDstPortStringValue `tfsdk:"destination_port"` + Name types.String `tfsdk:"name"` + NameAlias types.String `tfsdk:"name_alias"` + OwnerKey types.String `tfsdk:"owner_key"` + OwnerTag types.String `tfsdk:"owner_tag"` + SourceIpType types.String `tfsdk:"source_ip_type"` + SrcAddr types.String `tfsdk:"source_ip_address"` + Ver types.String `tfsdk:"version"` + NetflowRsExporterToCtx types.Set `tfsdk:"relation_to_vrf"` + NetflowRsExporterToEPg types.Set `tfsdk:"relation_to_epg"` + TagAnnotation types.Set `tfsdk:"annotations"` + TagTag types.Set `tfsdk:"tags"` } func getEmptyNetflowExporterPolResourceModel() *NetflowExporterPolResourceModel { @@ -80,6 +83,18 @@ func getEmptyNetflowExporterPolResourceModel() *NetflowExporterPolResourceModel SourceIpType: basetypes.NewStringNull(), SrcAddr: basetypes.NewStringNull(), Ver: basetypes.NewStringNull(), + NetflowRsExporterToCtx: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "annotation": types.StringType, + "target_dn": types.StringType, + }, + }), + NetflowRsExporterToEPg: types.SetNull(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "annotation": types.StringType, + "target_dn": types.StringType, + }, + }), TagAnnotation: types.SetNull(types.ObjectType{ AttrTypes: map[string]attr.Type{ "key": types.StringType, @@ -95,6 +110,32 @@ func getEmptyNetflowExporterPolResourceModel() *NetflowExporterPolResourceModel } } +// NetflowRsExporterToCtxNetflowExporterPolResourceModel describes the resource data model for the children without relation ships. +type NetflowRsExporterToCtxNetflowExporterPolResourceModel struct { + Annotation types.String `tfsdk:"annotation"` + TDn types.String `tfsdk:"target_dn"` +} + +func getEmptyNetflowRsExporterToCtxNetflowExporterPolResourceModel() NetflowRsExporterToCtxNetflowExporterPolResourceModel { + return NetflowRsExporterToCtxNetflowExporterPolResourceModel{ + Annotation: basetypes.NewStringNull(), + TDn: basetypes.NewStringNull(), + } +} + +// NetflowRsExporterToEPgNetflowExporterPolResourceModel describes the resource data model for the children without relation ships. +type NetflowRsExporterToEPgNetflowExporterPolResourceModel struct { + Annotation types.String `tfsdk:"annotation"` + TDn types.String `tfsdk:"target_dn"` +} + +func getEmptyNetflowRsExporterToEPgNetflowExporterPolResourceModel() NetflowRsExporterToEPgNetflowExporterPolResourceModel { + return NetflowRsExporterToEPgNetflowExporterPolResourceModel{ + Annotation: basetypes.NewStringNull(), + TDn: basetypes.NewStringNull(), + } +} + // TagAnnotationNetflowExporterPolResourceModel describes the resource data model for the children without relation ships. type TagAnnotationNetflowExporterPolResourceModel struct { Key types.String `tfsdk:"key"` @@ -199,7 +240,7 @@ func (r *NetflowExporterPolResource) Schema(ctx context.Context, req resource.Sc }, MarkdownDescription: `The description of the Netflow Exporter Policy object.`, }, - "dscp": schema.StringAttribute{ + "qos_dscp_value": schema.StringAttribute{ CustomType: customTypes.NetflowExporterPolDscpStringType{}, Optional: true, Computed: true, @@ -215,7 +256,7 @@ func (r *NetflowExporterPolResource) Schema(ctx context.Context, req resource.Sc }, MarkdownDescription: `The DSCP value of the Netflow Exporter Policy object.`, }, - "destination_address": schema.StringAttribute{ + "destination_ip_address": schema.StringAttribute{ Required: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), @@ -286,7 +327,7 @@ func (r *NetflowExporterPolResource) Schema(ctx context.Context, req resource.Sc }, MarkdownDescription: `The type of the source IP address: It can be one of the available management IP address for a given leaf or a custom IP Address.`, }, - "source_address": schema.StringAttribute{ + "source_ip_address": schema.StringAttribute{ Optional: true, Computed: true, PlanModifiers: []planmodifier.String{ @@ -305,7 +346,69 @@ func (r *NetflowExporterPolResource) Schema(ctx context.Context, req resource.Sc Validators: []validator.String{ stringvalidator.OneOf("cisco-v1", "v5", "v9"), }, - MarkdownDescription: `The collector version.`, + MarkdownDescription: `The NetFlow Exporter Version of the Netflow Exporter Policy object.`, + }, + "relation_to_vrf": schema.SetNestedAttribute{ + MarkdownDescription: `Points to the Ctx behind which the Netflow Exporter Resides`, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.Set{ + setvalidator.SizeAtMost(1), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "annotation": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The annotation of the Relation To VRF object.`, + }, + "target_dn": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The distinguished name of the target.`, + }, + }, + }, + }, + "relation_to_epg": schema.SetNestedAttribute{ + MarkdownDescription: `Points to the EPg behind which the Netflow Exporter Resides`, + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Set{ + setplanmodifier.UseStateForUnknown(), + }, + Validators: []validator.Set{ + setvalidator.SizeAtMost(1), + }, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "annotation": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The annotation of the Relation To EPG object.`, + }, + "target_dn": schema.StringAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: `The distinguished name of the target.`, + }, + }, + }, }, "annotations": schema.SetNestedAttribute{ MarkdownDescription: ``, @@ -418,13 +521,19 @@ func (r *NetflowExporterPolResource) Create(ctx context.Context, req resource.Cr tflog.Debug(ctx, fmt.Sprintf("Create of resource aci_netflow_exporter_policy with id '%s'", data.Id.ValueString())) + var netflowRsExporterToCtxPlan, netflowRsExporterToCtxState []NetflowRsExporterToCtxNetflowExporterPolResourceModel + data.NetflowRsExporterToCtx.ElementsAs(ctx, &netflowRsExporterToCtxPlan, false) + stateData.NetflowRsExporterToCtx.ElementsAs(ctx, &netflowRsExporterToCtxState, false) + var netflowRsExporterToEPgPlan, netflowRsExporterToEPgState []NetflowRsExporterToEPgNetflowExporterPolResourceModel + data.NetflowRsExporterToEPg.ElementsAs(ctx, &netflowRsExporterToEPgPlan, false) + stateData.NetflowRsExporterToEPg.ElementsAs(ctx, &netflowRsExporterToEPgState, false) var tagAnnotationPlan, tagAnnotationState []TagAnnotationNetflowExporterPolResourceModel data.TagAnnotation.ElementsAs(ctx, &tagAnnotationPlan, false) stateData.TagAnnotation.ElementsAs(ctx, &tagAnnotationState, false) var tagTagPlan, tagTagState []TagTagNetflowExporterPolResourceModel data.TagTag.ElementsAs(ctx, &tagTagPlan, false) stateData.TagTag.ElementsAs(ctx, &tagTagState, false) - jsonPayload := getNetflowExporterPolCreateJsonPayload(ctx, &resp.Diagnostics, true, data, tagAnnotationPlan, tagAnnotationState, tagTagPlan, tagTagState) + jsonPayload := getNetflowExporterPolCreateJsonPayload(ctx, &resp.Diagnostics, true, data, netflowRsExporterToCtxPlan, netflowRsExporterToCtxState, netflowRsExporterToEPgPlan, netflowRsExporterToEPgState, tagAnnotationPlan, tagAnnotationState, tagTagPlan, tagTagState) if resp.Diagnostics.HasError() { return @@ -483,13 +592,19 @@ func (r *NetflowExporterPolResource) Update(ctx context.Context, req resource.Up tflog.Debug(ctx, fmt.Sprintf("Update of resource aci_netflow_exporter_policy with id '%s'", data.Id.ValueString())) + var netflowRsExporterToCtxPlan, netflowRsExporterToCtxState []NetflowRsExporterToCtxNetflowExporterPolResourceModel + data.NetflowRsExporterToCtx.ElementsAs(ctx, &netflowRsExporterToCtxPlan, false) + stateData.NetflowRsExporterToCtx.ElementsAs(ctx, &netflowRsExporterToCtxState, false) + var netflowRsExporterToEPgPlan, netflowRsExporterToEPgState []NetflowRsExporterToEPgNetflowExporterPolResourceModel + data.NetflowRsExporterToEPg.ElementsAs(ctx, &netflowRsExporterToEPgPlan, false) + stateData.NetflowRsExporterToEPg.ElementsAs(ctx, &netflowRsExporterToEPgState, false) var tagAnnotationPlan, tagAnnotationState []TagAnnotationNetflowExporterPolResourceModel data.TagAnnotation.ElementsAs(ctx, &tagAnnotationPlan, false) stateData.TagAnnotation.ElementsAs(ctx, &tagAnnotationState, false) var tagTagPlan, tagTagState []TagTagNetflowExporterPolResourceModel data.TagTag.ElementsAs(ctx, &tagTagPlan, false) stateData.TagTag.ElementsAs(ctx, &tagTagState, false) - jsonPayload := getNetflowExporterPolCreateJsonPayload(ctx, &resp.Diagnostics, false, data, tagAnnotationPlan, tagAnnotationState, tagTagPlan, tagTagState) + jsonPayload := getNetflowExporterPolCreateJsonPayload(ctx, &resp.Diagnostics, false, data, netflowRsExporterToCtxPlan, netflowRsExporterToCtxState, netflowRsExporterToEPgPlan, netflowRsExporterToEPgState, tagAnnotationPlan, tagAnnotationState, tagTagPlan, tagTagState) if resp.Diagnostics.HasError() { return @@ -543,7 +658,7 @@ func (r *NetflowExporterPolResource) ImportState(ctx context.Context, req resour } func getAndSetNetflowExporterPolAttributes(ctx context.Context, diags *diag.Diagnostics, client *client.Client, data *NetflowExporterPolResourceModel) { - requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=children&rsp-subtree-class=%s", data.Id.ValueString(), "netflowExporterPol,tagAnnotation,tagTag"), "GET", nil) + requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=children&rsp-subtree-class=%s", data.Id.ValueString(), "netflowExporterPol,netflowRsExporterToCtx,netflowRsExporterToEPg,tagAnnotation,tagTag"), "GET", nil) *data = *getEmptyNetflowExporterPolResourceModel() @@ -596,6 +711,8 @@ func getAndSetNetflowExporterPolAttributes(ctx context.Context, diags *diag.Diag data.Ver = basetypes.NewStringValue(attributeValue.(string)) } } + NetflowRsExporterToCtxNetflowExporterPolList := make([]NetflowRsExporterToCtxNetflowExporterPolResourceModel, 0) + NetflowRsExporterToEPgNetflowExporterPolList := make([]NetflowRsExporterToEPgNetflowExporterPolResourceModel, 0) TagAnnotationNetflowExporterPolList := make([]TagAnnotationNetflowExporterPolResourceModel, 0) TagTagNetflowExporterPolList := make([]TagTagNetflowExporterPolResourceModel, 0) _, ok := classReadInfo[0].(map[string]interface{})["children"] @@ -604,6 +721,30 @@ func getAndSetNetflowExporterPolAttributes(ctx context.Context, diags *diag.Diag for _, child := range children { for childClassName, childClassDetails := range child.(map[string]interface{}) { childAttributes := childClassDetails.(map[string]interface{})["attributes"].(map[string]interface{}) + if childClassName == "netflowRsExporterToCtx" { + NetflowRsExporterToCtxNetflowExporterPol := getEmptyNetflowRsExporterToCtxNetflowExporterPolResourceModel() + for childAttributeName, childAttributeValue := range childAttributes { + if childAttributeName == "annotation" { + NetflowRsExporterToCtxNetflowExporterPol.Annotation = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "tDn" { + NetflowRsExporterToCtxNetflowExporterPol.TDn = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + NetflowRsExporterToCtxNetflowExporterPolList = append(NetflowRsExporterToCtxNetflowExporterPolList, NetflowRsExporterToCtxNetflowExporterPol) + } + if childClassName == "netflowRsExporterToEPg" { + NetflowRsExporterToEPgNetflowExporterPol := getEmptyNetflowRsExporterToEPgNetflowExporterPolResourceModel() + for childAttributeName, childAttributeValue := range childAttributes { + if childAttributeName == "annotation" { + NetflowRsExporterToEPgNetflowExporterPol.Annotation = basetypes.NewStringValue(childAttributeValue.(string)) + } + if childAttributeName == "tDn" { + NetflowRsExporterToEPgNetflowExporterPol.TDn = basetypes.NewStringValue(childAttributeValue.(string)) + } + } + NetflowRsExporterToEPgNetflowExporterPolList = append(NetflowRsExporterToEPgNetflowExporterPolList, NetflowRsExporterToEPgNetflowExporterPol) + } if childClassName == "tagAnnotation" { TagAnnotationNetflowExporterPol := getEmptyTagAnnotationNetflowExporterPolResourceModel() for childAttributeName, childAttributeValue := range childAttributes { @@ -631,6 +772,10 @@ func getAndSetNetflowExporterPolAttributes(ctx context.Context, diags *diag.Diag } } } + netflowRsExporterToCtxSet, _ := types.SetValueFrom(ctx, data.NetflowRsExporterToCtx.ElementType(ctx), NetflowRsExporterToCtxNetflowExporterPolList) + data.NetflowRsExporterToCtx = netflowRsExporterToCtxSet + netflowRsExporterToEPgSet, _ := types.SetValueFrom(ctx, data.NetflowRsExporterToEPg.ElementType(ctx), NetflowRsExporterToEPgNetflowExporterPolList) + data.NetflowRsExporterToEPg = netflowRsExporterToEPgSet tagAnnotationSet, _ := types.SetValueFrom(ctx, data.TagAnnotation.ElementType(ctx), TagAnnotationNetflowExporterPolList) data.TagAnnotation = tagAnnotationSet tagTagSet, _ := types.SetValueFrom(ctx, data.TagTag.ElementType(ctx), TagTagNetflowExporterPolList) @@ -677,6 +822,60 @@ func setNetflowExporterPolId(ctx context.Context, data *NetflowExporterPolResour data.Id = types.StringValue(fmt.Sprintf("%s/%s", data.ParentDn.ValueString(), rn)) } +func getNetflowExporterPolNetflowRsExporterToCtxChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *NetflowExporterPolResourceModel, netflowRsExporterToCtxPlan, netflowRsExporterToCtxState []NetflowRsExporterToCtxNetflowExporterPolResourceModel) []map[string]interface{} { + + childPayloads := []map[string]interface{}{} + if !data.NetflowRsExporterToCtx.IsUnknown() { + for _, netflowRsExporterToCtx := range netflowRsExporterToCtxPlan { + childMap := map[string]map[string]interface{}{"attributes": {}} + if !netflowRsExporterToCtx.Annotation.IsUnknown() && !netflowRsExporterToCtx.Annotation.IsNull() { + childMap["attributes"]["annotation"] = netflowRsExporterToCtx.Annotation.ValueString() + } else { + childMap["attributes"]["annotation"] = globalAnnotation + } + if !netflowRsExporterToCtx.TDn.IsUnknown() && !netflowRsExporterToCtx.TDn.IsNull() { + childMap["attributes"]["tDn"] = netflowRsExporterToCtx.TDn.ValueString() + } + childPayloads = append(childPayloads, map[string]interface{}{"netflowRsExporterToCtx": childMap}) + } + if len(netflowRsExporterToCtxPlan) == 0 && len(netflowRsExporterToCtxState) == 1 { + childMap := map[string]map[string]interface{}{"attributes": {}} + childMap["attributes"]["status"] = "deleted" + childPayloads = append(childPayloads, map[string]interface{}{"netflowRsExporterToCtx": childMap}) + } + } else { + data.NetflowRsExporterToCtx = types.SetNull(data.NetflowRsExporterToCtx.ElementType(ctx)) + } + + return childPayloads +} +func getNetflowExporterPolNetflowRsExporterToEPgChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *NetflowExporterPolResourceModel, netflowRsExporterToEPgPlan, netflowRsExporterToEPgState []NetflowRsExporterToEPgNetflowExporterPolResourceModel) []map[string]interface{} { + + childPayloads := []map[string]interface{}{} + if !data.NetflowRsExporterToEPg.IsUnknown() { + for _, netflowRsExporterToEPg := range netflowRsExporterToEPgPlan { + childMap := map[string]map[string]interface{}{"attributes": {}} + if !netflowRsExporterToEPg.Annotation.IsUnknown() && !netflowRsExporterToEPg.Annotation.IsNull() { + childMap["attributes"]["annotation"] = netflowRsExporterToEPg.Annotation.ValueString() + } else { + childMap["attributes"]["annotation"] = globalAnnotation + } + if !netflowRsExporterToEPg.TDn.IsUnknown() && !netflowRsExporterToEPg.TDn.IsNull() { + childMap["attributes"]["tDn"] = netflowRsExporterToEPg.TDn.ValueString() + } + childPayloads = append(childPayloads, map[string]interface{}{"netflowRsExporterToEPg": childMap}) + } + if len(netflowRsExporterToEPgPlan) == 0 && len(netflowRsExporterToEPgState) == 1 { + childMap := map[string]map[string]interface{}{"attributes": {}} + childMap["attributes"]["status"] = "deleted" + childPayloads = append(childPayloads, map[string]interface{}{"netflowRsExporterToEPg": childMap}) + } + } else { + data.NetflowRsExporterToEPg = types.SetNull(data.NetflowRsExporterToEPg.ElementType(ctx)) + } + + return childPayloads +} func getNetflowExporterPolTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *NetflowExporterPolResourceModel, tagAnnotationPlan, tagAnnotationState []TagAnnotationNetflowExporterPolResourceModel) []map[string]interface{} { childPayloads := []map[string]interface{}{} @@ -756,7 +955,7 @@ func getNetflowExporterPolTagTagChildPayloads(ctx context.Context, diags *diag.D return childPayloads } -func getNetflowExporterPolCreateJsonPayload(ctx context.Context, diags *diag.Diagnostics, createType bool, data *NetflowExporterPolResourceModel, tagAnnotationPlan, tagAnnotationState []TagAnnotationNetflowExporterPolResourceModel, tagTagPlan, tagTagState []TagTagNetflowExporterPolResourceModel) *container.Container { +func getNetflowExporterPolCreateJsonPayload(ctx context.Context, diags *diag.Diagnostics, createType bool, data *NetflowExporterPolResourceModel, netflowRsExporterToCtxPlan, netflowRsExporterToCtxState []NetflowRsExporterToCtxNetflowExporterPolResourceModel, netflowRsExporterToEPgPlan, netflowRsExporterToEPgState []NetflowRsExporterToEPgNetflowExporterPolResourceModel, tagAnnotationPlan, tagAnnotationState []TagAnnotationNetflowExporterPolResourceModel, tagTagPlan, tagTagState []TagTagNetflowExporterPolResourceModel) *container.Container { payloadMap := map[string]interface{}{} payloadMap["attributes"] = map[string]string{} @@ -765,6 +964,18 @@ func getNetflowExporterPolCreateJsonPayload(ctx context.Context, diags *diag.Dia } childPayloads := []map[string]interface{}{} + NetflowRsExporterToCtxchildPayloads := getNetflowExporterPolNetflowRsExporterToCtxChildPayloads(ctx, diags, data, netflowRsExporterToCtxPlan, netflowRsExporterToCtxState) + if NetflowRsExporterToCtxchildPayloads == nil { + return nil + } + childPayloads = append(childPayloads, NetflowRsExporterToCtxchildPayloads...) + + NetflowRsExporterToEPgchildPayloads := getNetflowExporterPolNetflowRsExporterToEPgChildPayloads(ctx, diags, data, netflowRsExporterToEPgPlan, netflowRsExporterToEPgState) + if NetflowRsExporterToEPgchildPayloads == nil { + return nil + } + childPayloads = append(childPayloads, NetflowRsExporterToEPgchildPayloads...) + TagAnnotationchildPayloads := getNetflowExporterPolTagAnnotationChildPayloads(ctx, diags, data, tagAnnotationPlan, tagAnnotationState) if TagAnnotationchildPayloads == nil { return nil diff --git a/internal/provider/resource_aci_netflow_exporter_policy_test.go b/internal/provider/resource_aci_netflow_exporter_policy_test.go index 94ff67dcc..9453a1985 100644 --- a/internal/provider/resource_aci_netflow_exporter_policy_test.go +++ b/internal/provider/resource_aci_netflow_exporter_policy_test.go @@ -28,20 +28,20 @@ func TestAccResourceNetflowExporterPolWithFvTenant(t *testing.T) { resource.TestCheckResourceAttr("aci_netflow_exporter_policy.allow_test_2", "annotation", "orchestrator:terraform"), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.allow_test", "description", ""), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.allow_test_2", "description", ""), - resource.TestCheckResourceAttr("aci_netflow_exporter_policy.allow_test", "destination_address", "2.2.2.1"), - resource.TestCheckResourceAttr("aci_netflow_exporter_policy.allow_test_2", "destination_address", "2.2.2.1"), + resource.TestCheckResourceAttr("aci_netflow_exporter_policy.allow_test", "destination_ip_address", "2.2.2.1"), + resource.TestCheckResourceAttr("aci_netflow_exporter_policy.allow_test_2", "destination_ip_address", "2.2.2.1"), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.allow_test", "destination_port", "https"), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.allow_test_2", "destination_port", "https"), - resource.TestCheckResourceAttr("aci_netflow_exporter_policy.allow_test", "dscp", "CS2"), - resource.TestCheckResourceAttr("aci_netflow_exporter_policy.allow_test_2", "dscp", "CS2"), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.allow_test", "name_alias", ""), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.allow_test_2", "name_alias", ""), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.allow_test", "owner_key", ""), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.allow_test_2", "owner_key", ""), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.allow_test", "owner_tag", ""), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.allow_test_2", "owner_tag", ""), - resource.TestCheckResourceAttr("aci_netflow_exporter_policy.allow_test", "source_address", "1.1.1.1/10"), - resource.TestCheckResourceAttr("aci_netflow_exporter_policy.allow_test_2", "source_address", "1.1.1.1/10"), + resource.TestCheckResourceAttr("aci_netflow_exporter_policy.allow_test", "qos_dscp_value", "CS2"), + resource.TestCheckResourceAttr("aci_netflow_exporter_policy.allow_test_2", "qos_dscp_value", "CS2"), + resource.TestCheckResourceAttr("aci_netflow_exporter_policy.allow_test", "source_ip_address", "1.1.1.1/10"), + resource.TestCheckResourceAttr("aci_netflow_exporter_policy.allow_test_2", "source_ip_address", "1.1.1.1/10"), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.allow_test", "source_ip_type", "custom-src-ip"), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.allow_test_2", "source_ip_type", "custom-src-ip"), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.allow_test", "version", "v9"), @@ -80,20 +80,20 @@ func TestAccResourceNetflowExporterPolWithFvTenant(t *testing.T) { resource.TestCheckResourceAttr("aci_netflow_exporter_policy.allow_test_2", "annotation", "orchestrator:terraform"), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.allow_test", "description", ""), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.allow_test_2", "description", ""), - resource.TestCheckResourceAttr("aci_netflow_exporter_policy.allow_test", "destination_address", "2.2.2.1"), - resource.TestCheckResourceAttr("aci_netflow_exporter_policy.allow_test_2", "destination_address", "2.2.2.1"), + resource.TestCheckResourceAttr("aci_netflow_exporter_policy.allow_test", "destination_ip_address", "2.2.2.1"), + resource.TestCheckResourceAttr("aci_netflow_exporter_policy.allow_test_2", "destination_ip_address", "2.2.2.1"), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.allow_test", "destination_port", "https"), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.allow_test_2", "destination_port", "https"), - resource.TestCheckResourceAttr("aci_netflow_exporter_policy.allow_test", "dscp", "CS2"), - resource.TestCheckResourceAttr("aci_netflow_exporter_policy.allow_test_2", "dscp", "CS2"), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.allow_test", "name_alias", ""), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.allow_test_2", "name_alias", ""), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.allow_test", "owner_key", ""), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.allow_test_2", "owner_key", ""), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.allow_test", "owner_tag", ""), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.allow_test_2", "owner_tag", ""), - resource.TestCheckResourceAttr("aci_netflow_exporter_policy.allow_test", "source_address", "1.1.1.1/10"), - resource.TestCheckResourceAttr("aci_netflow_exporter_policy.allow_test_2", "source_address", "1.1.1.1/10"), + resource.TestCheckResourceAttr("aci_netflow_exporter_policy.allow_test", "qos_dscp_value", "CS2"), + resource.TestCheckResourceAttr("aci_netflow_exporter_policy.allow_test_2", "qos_dscp_value", "CS2"), + resource.TestCheckResourceAttr("aci_netflow_exporter_policy.allow_test", "source_ip_address", "1.1.1.1/10"), + resource.TestCheckResourceAttr("aci_netflow_exporter_policy.allow_test_2", "source_ip_address", "1.1.1.1/10"), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.allow_test", "source_ip_type", "custom-src-ip"), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.allow_test_2", "source_ip_type", "custom-src-ip"), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.allow_test", "version", "v9"), @@ -115,13 +115,13 @@ func TestAccResourceNetflowExporterPolWithFvTenant(t *testing.T) { resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "name", "netfow_exporter"), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "annotation", "orchestrator:terraform"), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "description", ""), - resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "destination_address", "2.2.2.1"), + resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "destination_ip_address", "2.2.2.1"), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "destination_port", "https"), - resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "dscp", "CS2"), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "name_alias", ""), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "owner_key", ""), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "owner_tag", ""), - resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "source_address", "1.1.1.1/10"), + resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "qos_dscp_value", "CS2"), + resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "source_ip_address", "1.1.1.1/10"), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "source_ip_type", "custom-src-ip"), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "version", "v9"), ), @@ -134,13 +134,13 @@ func TestAccResourceNetflowExporterPolWithFvTenant(t *testing.T) { resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "name", "netfow_exporter"), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "annotation", "annotation"), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "description", "description_1"), - resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "destination_address", "12.12.12.1"), + resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "destination_ip_address", "12.12.12.1"), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "destination_port", "ssh"), - resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "dscp", "AF11"), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "name_alias", "name_alias_1"), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "owner_key", "owner_key_1"), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "owner_tag", "owner_tag_1"), - resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "source_address", "11.11.11.1/11"), + resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "qos_dscp_value", "AF11"), + resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "source_ip_address", "11.11.11.1/11"), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "source_ip_type", "custom-src-ip"), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "version", "v9"), ), @@ -150,10 +150,10 @@ func TestAccResourceNetflowExporterPolWithFvTenant(t *testing.T) { Config: testConfigNetflowExporterPolMinDependencyWithFvTenant, ExpectNonEmptyPlan: false, Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "destination_address", "2.2.2.1"), + resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "destination_ip_address", "2.2.2.1"), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "destination_port", "https"), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "name", "netfow_exporter"), - resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "source_address", "1.1.1.1/10"), + resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "source_ip_address", "1.1.1.1/10"), ), }, // Update with empty strings config or default value @@ -161,16 +161,16 @@ func TestAccResourceNetflowExporterPolWithFvTenant(t *testing.T) { Config: testConfigNetflowExporterPolResetDependencyWithFvTenant, ExpectNonEmptyPlan: false, Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "destination_address", "2.2.2.1"), + resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "destination_ip_address", "2.2.2.1"), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "destination_port", "https"), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "name", "netfow_exporter"), - resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "source_address", "1.1.1.1/10"), + resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "source_ip_address", "1.1.1.1/10"), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "annotation", "orchestrator:terraform"), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "description", ""), - resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "dscp", "CS2"), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "name_alias", ""), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "owner_key", ""), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "owner_tag", ""), + resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "qos_dscp_value", "CS2"), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "source_ip_type", "custom-src-ip"), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "version", "v9"), ), @@ -186,22 +186,26 @@ func TestAccResourceNetflowExporterPolWithFvTenant(t *testing.T) { Config: testConfigNetflowExporterPolChildrenDependencyWithFvTenant, ExpectNonEmptyPlan: false, Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "destination_address", "2.2.2.1"), + resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "destination_ip_address", "2.2.2.1"), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "destination_port", "https"), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "name", "netfow_exporter"), - resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "source_address", "1.1.1.1/10"), + resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "source_ip_address", "1.1.1.1/10"), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "annotation", "orchestrator:terraform"), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "description", ""), - resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "dscp", "CS2"), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "name_alias", ""), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "owner_key", ""), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "owner_tag", ""), + resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "qos_dscp_value", "CS2"), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "source_ip_type", "custom-src-ip"), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "version", "v9"), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "annotations.0.key", "key_0"), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "annotations.0.value", "value_1"), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "annotations.1.key", "key_1"), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "annotations.1.value", "test_value"), + resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "relation_to_epg.0.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "relation_to_epg.0.target_dn", "uni/tn-test_tenant/ap-test_ap/epg-test_epg"), + resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "relation_to_vrf.0.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "relation_to_vrf.0.target_dn", "uni/tn-test_tenant/ctx-test_vrf"), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "tags.0.key", "key_0"), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "tags.0.value", "value_1"), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "tags.1.key", "key_1"), @@ -224,6 +228,12 @@ func TestAccResourceNetflowExporterPolWithFvTenant(t *testing.T) { resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "annotations.1.key", "key_1"), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "annotations.1.value", "test_value"), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "annotations.#", "2"), + resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "relation_to_epg.0.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "relation_to_epg.0.target_dn", "uni/tn-test_tenant/ap-test_ap/epg-test_epg"), + resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "relation_to_epg.#", "1"), + resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "relation_to_vrf.0.annotation", "annotation_1"), + resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "relation_to_vrf.0.target_dn", "uni/tn-test_tenant/ctx-test_vrf"), + resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "relation_to_vrf.#", "1"), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "tags.0.key", "key_0"), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "tags.0.value", "value_1"), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "tags.1.key", "key_1"), @@ -239,6 +249,8 @@ func TestAccResourceNetflowExporterPolWithFvTenant(t *testing.T) { resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "annotations.0.key", "key_1"), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "annotations.0.value", "test_value"), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "annotations.#", "1"), + resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "relation_to_epg.#", "0"), + resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "relation_to_vrf.#", "0"), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "tags.0.key", "key_1"), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "tags.0.value", "test_value"), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "tags.#", "1"), @@ -250,6 +262,8 @@ func TestAccResourceNetflowExporterPolWithFvTenant(t *testing.T) { ExpectNonEmptyPlan: false, Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "annotations.#", "0"), + resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "relation_to_epg.#", "0"), + resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "relation_to_vrf.#", "0"), resource.TestCheckResourceAttr("aci_netflow_exporter_policy.test", "tags.#", "0"), ), }, @@ -257,20 +271,23 @@ func TestAccResourceNetflowExporterPolWithFvTenant(t *testing.T) { }) } +const testChildDependencyConfigNetflowExporterPol = ` +` + const testConfigNetflowExporterPolMinDependencyWithFvTenantAllowExisting = testConfigFvTenantMin + ` resource "aci_netflow_exporter_policy" "allow_test" { parent_dn = aci_tenant.test.id - destination_address = "2.2.2.1" + destination_ip_address = "2.2.2.1" destination_port = "https" name = "netfow_exporter" - source_address = "1.1.1.1/10" + source_ip_address = "1.1.1.1/10" } resource "aci_netflow_exporter_policy" "allow_test_2" { parent_dn = aci_tenant.test.id - destination_address = "2.2.2.1" + destination_ip_address = "2.2.2.1" destination_port = "https" name = "netfow_exporter" - source_address = "1.1.1.1/10" + source_ip_address = "1.1.1.1/10" depends_on = [aci_netflow_exporter_policy.allow_test] } ` @@ -278,10 +295,10 @@ resource "aci_netflow_exporter_policy" "allow_test_2" { const testConfigNetflowExporterPolMinDependencyWithFvTenant = testConfigFvTenantMin + ` resource "aci_netflow_exporter_policy" "test" { parent_dn = aci_tenant.test.id - destination_address = "2.2.2.1" + destination_ip_address = "2.2.2.1" destination_port = "https" name = "netfow_exporter" - source_address = "1.1.1.1/10" + source_ip_address = "1.1.1.1/10" } ` @@ -291,13 +308,13 @@ resource "aci_netflow_exporter_policy" "test" { name = "netfow_exporter" annotation = "annotation" description = "description_1" - destination_address = "12.12.12.1" + destination_ip_address = "12.12.12.1" destination_port = "ssh" - dscp = "AF11" name_alias = "name_alias_1" owner_key = "owner_key_1" owner_tag = "owner_tag_1" - source_address = "11.11.11.1/11" + qos_dscp_value = "AF11" + source_ip_address = "11.11.11.1/11" source_ip_type = "custom-src-ip" version = "v9" } @@ -309,24 +326,24 @@ resource "aci_netflow_exporter_policy" "test" { name = "netfow_exporter" annotation = "orchestrator:terraform" description = "" - destination_address = "2.2.2.1" + destination_ip_address = "2.2.2.1" destination_port = "https" - dscp = "CS2" name_alias = "" owner_key = "" owner_tag = "" - source_address = "1.1.1.1/10" + qos_dscp_value = "CS2" + source_ip_address = "1.1.1.1/10" source_ip_type = "custom-src-ip" version = "v9" } ` -const testConfigNetflowExporterPolChildrenDependencyWithFvTenant = testConfigFvTenantMin + ` +const testConfigNetflowExporterPolChildrenDependencyWithFvTenant = testChildDependencyConfigNetflowExporterPol + testConfigFvTenantMin + ` resource "aci_netflow_exporter_policy" "test" { parent_dn = aci_tenant.test.id - destination_address = "2.2.2.1" + destination_ip_address = "2.2.2.1" destination_port = "https" name = "netfow_exporter" - source_address = "1.1.1.1/10" + source_ip_address = "1.1.1.1/10" annotations = [ { key = "key_0" @@ -337,6 +354,18 @@ resource "aci_netflow_exporter_policy" "test" { value = "test_value" }, ] + relation_to_epg = [ + { + annotation = "annotation_1" + target_dn = "uni/tn-test_tenant/ap-test_ap/epg-test_epg" + }, + ] + relation_to_vrf = [ + { + annotation = "annotation_1" + target_dn = "uni/tn-test_tenant/ctx-test_vrf" + }, + ] tags = [ { key = "key_0" @@ -350,29 +379,31 @@ resource "aci_netflow_exporter_policy" "test" { } ` -const testConfigNetflowExporterPolChildrenRemoveFromConfigDependencyWithFvTenant = testConfigFvTenantMin + ` +const testConfigNetflowExporterPolChildrenRemoveFromConfigDependencyWithFvTenant = testChildDependencyConfigNetflowExporterPol + testConfigFvTenantMin + ` resource "aci_netflow_exporter_policy" "test" { parent_dn = aci_tenant.test.id - destination_address = "2.2.2.1" + destination_ip_address = "2.2.2.1" destination_port = "https" name = "netfow_exporter" - source_address = "1.1.1.1/10" + source_ip_address = "1.1.1.1/10" } ` -const testConfigNetflowExporterPolChildrenRemoveOneDependencyWithFvTenant = testConfigFvTenantMin + ` +const testConfigNetflowExporterPolChildrenRemoveOneDependencyWithFvTenant = testChildDependencyConfigNetflowExporterPol + testConfigFvTenantMin + ` resource "aci_netflow_exporter_policy" "test" { parent_dn = aci_tenant.test.id - destination_address = "2.2.2.1" + destination_ip_address = "2.2.2.1" destination_port = "https" name = "netfow_exporter" - source_address = "1.1.1.1/10" + source_ip_address = "1.1.1.1/10" annotations = [ { key = "key_1" value = "test_value" }, ] + relation_to_epg = [] + relation_to_vrf = [] tags = [ { key = "key_1" @@ -382,14 +413,16 @@ resource "aci_netflow_exporter_policy" "test" { } ` -const testConfigNetflowExporterPolChildrenRemoveAllDependencyWithFvTenant = testConfigFvTenantMin + ` +const testConfigNetflowExporterPolChildrenRemoveAllDependencyWithFvTenant = testChildDependencyConfigNetflowExporterPol + testConfigFvTenantMin + ` resource "aci_netflow_exporter_policy" "test" { parent_dn = aci_tenant.test.id - destination_address = "2.2.2.1" + destination_ip_address = "2.2.2.1" destination_port = "https" name = "netfow_exporter" - source_address = "1.1.1.1/10" + source_ip_address = "1.1.1.1/10" annotations = [] + relation_to_epg = [] + relation_to_vrf = [] tags = [] } `