Skip to content

Commit

Permalink
Add realized_id attribute to policy fabric objects
Browse files Browse the repository at this point in the history
In addition, remove readonly field from write flow in edge cluster
resource.

Signed-off-by: Anna Khmelnitsky <[email protected]>
  • Loading branch information
annakhm committed Sep 2, 2023
1 parent 56f6b53 commit f76cc63
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 2 deletions.
2 changes: 0 additions & 2 deletions nsxt/resource_nsxt_edge_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,10 @@ func getEdgeClusterMembersFromSchema(d *schema.ResourceData) []model.EdgeCluster
data := member.(map[string]interface{})
description := data["description"].(string)
displayName := data["display_name"].(string)
memberIndex := data["member_index"].(int64)
transportNodeID := data["transport_node_id"].(string)
elem := model.EdgeClusterMember{
Description: &description,
DisplayName: &displayName,
MemberIndex: &memberIndex,
TransportNodeId: &transportNodeID,
}
members = append(members, elem)
Expand Down
6 changes: 6 additions & 0 deletions nsxt/resource_nsxt_policy_transport_zone.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ func resourceNsxtPolicyTransportZone() *schema.Resource {
ForceNew: true,
Computed: true,
},
"realized_id": {
Type: schema.TypeString,
Description: "Computed ID of the realized object",
Computed: true,
},
},
}
}
Expand Down Expand Up @@ -227,6 +232,7 @@ func resourceNsxtPolicyTransportZoneRead(d *schema.ResourceData, m interface{})
d.Set("is_default", obj.IsDefault)
d.Set("transport_type", obj.TzType)
d.Set("uplink_teaming_policy_names", obj.UplinkTeamingPolicyNames)
d.Set("realized_id", obj.RealizationId)

return nil
}
Expand Down
6 changes: 6 additions & 0 deletions nsxt/resource_nsxt_uplink_host_switch_profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,11 @@ func resourceNsxtUplinkHostSwitchProfile() *schema.Resource {
Default: 1700,
ValidateFunc: validation.IntAtLeast(1280),
},
"realized_id": {
Type: schema.TypeString,
Description: "Computed ID of the realized object",
Computed: true,
},
},
}
}
Expand Down Expand Up @@ -323,6 +328,7 @@ func resourceNsxtUplinkHostSwitchProfileRead(d *schema.ResourceData, m interface
d.Set("nsx_id", id)
d.Set("path", uplinkHostSwitchProfile.Path)
d.Set("revision", uplinkHostSwitchProfile.Revision)
d.Set("realized_id", uplinkHostSwitchProfile.RealizationId)
setUplinkHostSwitchProfileSchema(d, uplinkHostSwitchProfile)
return nil
}
Expand Down
1 change: 1 addition & 0 deletions website/docs/r/policy_transport_zone.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ In addition to arguments listed above, the following attributes are exported:

* `revision` - Indicates current revision number of the object as seen by NSX-T API server. This attribute can be useful for debugging.
* `path` - The NSX path of the policy resource.
* `realized_id` - Realized ID for the transport zone. For reference in fabric resources (such as `transport_node`), `realized_id` should be used rather than `id`.

## Importing

Expand Down
1 change: 1 addition & 0 deletions website/docs/r/uplink_host_switch_profile.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ In addition to arguments listed above, the following attributes are exported:
* `id` - ID of the resource.
* `revision` - Indicates current revision number of the object as seen by NSX-T API server. This attribute can be useful for debugging.
* `path` - The NSX path of the policy resource.
* `realized_id` - Realized ID for the profile. For reference in fabric resources (such as `transport_node`), `realized_id` should be used rather than `id`.

## Importing

Expand Down

0 comments on commit f76cc63

Please sign in to comment.