Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
samiib committed May 3, 2024
2 parents 51d4ff1 + 6344747 commit a56b548
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 13 deletions.
4 changes: 2 additions & 2 deletions aci/resource_aci_fvesg.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,10 @@ func resourceAciEndpointSecurityGroup() *schema.Resource {
},
},
"relation_fv_rs_cust_qos_pol": {
Type: schema.TypeString,

Type: schema.TypeString,
Optional: true,
Description: "Create relation to qos:CustomPol",
Deprecated: "Remove `relation_fv_rs_cust_qos_pol` configuration as it is not used by ESG configuration. The attribute will be removed in the next major version of the provider.",
},
"relation_fv_rs_intra_epg": {
Type: schema.TypeSet,
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/endpoint_security_group.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ resource "aci_endpoint_security_group" "example" {
- `prio` - (Optional) The contract interface priority. Allowed values are "level1", "level2", "level3", "level4", "level5", "level6", "unspecified", and default value is "unspecified". Type: String.
- `target_dn` - (Required) The distinguished name of the target contract. Type: String.

- `relation_fv_rs_cust_qos_pol` - (Optional) Represents the relation to a Custom QOS Policy (class qosCustomPol). It is a source relation to a custom QoS policy that enables different levels of service to be assigned to network traffic, including specifications for the Differentiated Services Code Point (DSCP) value(s) and the 802.1p Dot1p priority. Type: String.
- `relation_fv_rs_cust_qos_pol` - (Optional) **WARNING:** This attribute is deprecated and will be removed in the next major version. Represents the relation to a Custom QOS Policy (class qosCustomPol). It is a source relation to a custom QoS policy that enables different levels of service to be assigned to network traffic, including specifications for the Differentiated Services Code Point (DSCP) value(s) and the 802.1p Dot1p priority. Type: String.

- `relation_fv_rs_intra_epg` - (Optional) Represents the relation to an Intra EPg Contract (class vzBrCP). Represents that the EPg is moving from "allow all within epg" mode to a "deny all within epg" mode. The only type of traffic allowed between EPs in this EPg is the one specified by contracts EPg associates to this relation. Type: List.

Expand Down
14 changes: 12 additions & 2 deletions internal/provider/data_source_aci_rest_managed.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@ type AciRestManagedDataSource struct {
client *client.Client
}

// AciRestManagedDataSourceModel describes the data source model.
type AciRestManagedDataSourceModel struct {
Id types.String `tfsdk:"id"`
Dn types.String `tfsdk:"dn"`
ClassName types.String `tfsdk:"class_name"`
Content types.Map `tfsdk:"content"`
Child types.Set `tfsdk:"child"`
Annotation types.String `tfsdk:"annotation"`
}

func (d *AciRestManagedDataSource) Metadata(ctx context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
tflog.Debug(ctx, "Start schema of datasource: aci_rest_managed")
resp.TypeName = req.ProviderTypeName + "_rest_managed"
Expand Down Expand Up @@ -114,7 +124,7 @@ func (d *AciRestManagedDataSource) Configure(ctx context.Context, req datasource

func (d *AciRestManagedDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
tflog.Debug(ctx, "Start read of datasource: aci_rest_managed")
var data *AciRestManagedResourceModel
var data *AciRestManagedDataSourceModel

// Read Terraform configuration data into the model
resp.Diagnostics.Append(req.Config.Get(ctx, &data)...)
Expand Down Expand Up @@ -206,7 +216,7 @@ func (d *AciRestManagedDataSource) Read(ctx context.Context, req datasource.Read

}

func dataSourceRestManagedNotFoundError(diags *diag.Diagnostics, data *AciRestManagedResourceModel) {
func dataSourceRestManagedNotFoundError(diags *diag.Diagnostics, data *AciRestManagedDataSourceModel) {
diags.AddError(
"Failed to read aci_rest_managed data source",
fmt.Sprintf("The aci_rest_managed data source with dn '%s' has not been found", data.Dn),
Expand Down
4 changes: 2 additions & 2 deletions legacy-docs/docs/d/rest.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ data "aci_rest" "tenant_rest_children" {

- `id` - Dishtiguished name of object being managed.
- `class_name` - Class name of object being managed.
- `content` - Map of key-value pairs which represents the attributes for the object being managed.
- `content` - A map of key-value pairs which represents the attributes for the object being managed.
- `dn` - Distinguished name of object being managed.
- `children` - Set of children of the object being managed.
- `children.child_class_name` - Class name of the child of the object being managed.
- `children.child_content` - Map of key-value pairs which represents the attributes for child of the object being managed.
- `children.child_content` - A map of key-value pairs which represents the attributes for child of the object being managed.
4 changes: 2 additions & 2 deletions legacy-docs/docs/d/rest_managed.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ data "aci_rest_managed" "example" {
* `class_name` - (string) Which class object is being created.
* `id` - (string) The Distinguished Name of the object.
* `annotation` - (string) Annotation for the class object that is being created. When annotation is provided in content this will take precedence.
* `content` (map) Map of key-value pairs those needed to be passed to the Model object as parameters. Make sure the key name matches the name with the object parameter in ACI.
* `content` - (map) A map of key-value pairs those needed to be passed to the Model object as parameters. Make sure the key name matches the name with the object parameter in ACI.

* `child` - (list) A list of child objects.
* `rn` - (string) The Relative Name of the child object.
* `class_name` - (string) Class name of child object.
* `content` (map) Map of key-value pairs which represents the attributes for the child object.
* `content` - (map) A map of key-value pairs which represents the attributes for the child object.
2 changes: 1 addition & 1 deletion legacy-docs/docs/r/endpoint_security_group.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ resource "aci_endpoint_security_group" "example" {
- `prio` - (Optional) The contract interface priority. Allowed values are "level1", "level2", "level3", "level4", "level5", "level6", "unspecified", and default value is "unspecified". Type: String.
- `target_dn` - (Required) The distinguished name of the target contract. Type: String.

- `relation_fv_rs_cust_qos_pol` - (Optional) Represents the relation to a Custom QOS Policy (class qosCustomPol). It is a source relation to a custom QoS policy that enables different levels of service to be assigned to network traffic, including specifications for the Differentiated Services Code Point (DSCP) value(s) and the 802.1p Dot1p priority. Type: String.
- `relation_fv_rs_cust_qos_pol` - (Optional) **WARNING:** This attribute is deprecated and will be removed in the next major version. Represents the relation to a Custom QOS Policy (class qosCustomPol). It is a source relation to a custom QoS policy that enables different levels of service to be assigned to network traffic, including specifications for the Differentiated Services Code Point (DSCP) value(s) and the 802.1p Dot1p priority. Type: String.

- `relation_fv_rs_intra_epg` - (Optional) Represents the relation to an Intra EPg Contract (class vzBrCP). Represents that the EPg is moving from "allow all within epg" mode to a "deny all within epg" mode. The only type of traffic allowed between EPs in this EPg is the one specified by contracts EPg associates to this relation. Type: List.

Expand Down
2 changes: 1 addition & 1 deletion legacy-docs/docs/r/rest.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ resource "aci_rest" "rest_yaml" {

- `path` - (Required) ACI path where object should be created. Starting with api/node/mo/{parent-dn}(if applicable)/{rn of object}.json
- `class_name` - (Optional) Which class object is being created. (Make sure there is no colon in the classname )
- `content` - (Optional) Map of key-value pairs those needed to be passed to the Model object as parameters. Make sure the key name matches the name with the object parameter in ACI.
- `content` - (Optional) A map of key-value pairs those needed to be passed to the Model object as parameters. Make sure the key name matches the name with the object parameter in ACI.
- `payload` - (Optional) Freestyle JSON or YAML payload which can directly be passed to the REST endpoint added in path. Either of content or payload is required.
- `dn` - (Optional) Distinguished name of object being managed.

Expand Down
7 changes: 5 additions & 2 deletions legacy-docs/docs/r/rest_managed.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,13 @@ resource "aci_rest_managed" "example_tenant_with_child" {

* `annotation` - (string) Annotation for the class object that is being created.
- Default: `orchestrator:terraform`
* `content` (map) Map of key-value pairs those needed to be passed to the Model object as parameters. Make sure the key name matches the name with the object parameter in ACI.
* `content` - (map) A map of key-value pairs those needed to be passed to the Model object as parameters. Make sure the key name matches the name with the object parameter in ACI.

!> The annotation property is not allowed to be set in the content map of the resource.

* `escape_html` - (Boolean) Enable escaping of HTML characters when encoding the JSON payload.
- Default: `true`

* `child` - (list) A list of child objects.

#### Required ####
Expand All @@ -94,7 +97,7 @@ resource "aci_rest_managed" "example_tenant_with_child" {

#### Optional ###

* `content` (map) Map of key-value pairs which represents the attributes for the child object. When annotation is provided in the content of the child it will take precedence over the annotation set at the parent level.
* `content` - (map) A map of key-value pairs which represents the attributes for the child object. When annotation is provided in the content of the child it will take precedence over the annotation set at the parent level.

## Importing ##

Expand Down

0 comments on commit a56b548

Please sign in to comment.