4.11.0
This commit is contained in:
@@ -40,6 +40,7 @@ func flattenTrunk(d *schema.ResourceData, trunkItem *trunk.ItemTrunk) {
|
||||
d.Set("account_ids", trunkItem.AccountIDs)
|
||||
d.Set("ovs_bridge", trunkItem.OVSBridge)
|
||||
d.Set("native_vlan_id", trunkItem.NativeVLANID)
|
||||
d.Set("mtu", trunkItem.MTU)
|
||||
d.Set("status", trunkItem.Status)
|
||||
d.Set("trunk_tags", trunkItem.TrunkTags)
|
||||
d.Set("created_at", trunkItem.CreatedAt)
|
||||
@@ -66,6 +67,7 @@ func flattenTrunkList(trunkList *trunk.ListTrunks) []map[string]interface{} {
|
||||
"name": trunkItem.Name,
|
||||
"native_vlan_id": trunkItem.NativeVLANID,
|
||||
"ovs_bridge": trunkItem.OVSBridge,
|
||||
"mtu": trunkItem.MTU,
|
||||
"status": trunkItem.Status,
|
||||
"trunk_tags": trunkItem.TrunkTags,
|
||||
"updated_at": trunkItem.UpdatedAt,
|
||||
|
||||
@@ -37,6 +37,10 @@ func resourceTrunkCreate(ctx context.Context, d *schema.ResourceData, m interfac
|
||||
createReq.Description = description.(string)
|
||||
}
|
||||
|
||||
if mtu, ok := d.GetOk("mtu"); ok {
|
||||
createReq.MTU = uint64(mtu.(int))
|
||||
}
|
||||
|
||||
accountIDs := make([]uint64, 0)
|
||||
|
||||
if accountAccess, ok := d.GetOk("account_ids"); ok {
|
||||
@@ -108,11 +112,19 @@ func resourceTrunkUpdate(ctx context.Context, d *schema.ResourceData, m interfac
|
||||
return diag.FromErr(err)
|
||||
}
|
||||
|
||||
if d.HasChanges("name", "trunk_tags", "description", "native_vlan_id") {
|
||||
if d.HasChanges("name", "trunk_tags", "description", "native_vlan_id", "mtu") {
|
||||
req := trunk.UpdateRequest{
|
||||
TrunkID: uint64(id),
|
||||
Name: d.Get("name").(string),
|
||||
TrunkTags: d.Get("trunk_tags").(string),
|
||||
TrunkID: uint64(id),
|
||||
}
|
||||
|
||||
if d.HasChange("name") {
|
||||
name := d.Get("name").(string)
|
||||
req.Name = name
|
||||
}
|
||||
|
||||
if d.HasChange("trunk_tags") {
|
||||
trunkTags := d.Get("trunk_tags").(string)
|
||||
req.TrunkTags = trunkTags
|
||||
}
|
||||
|
||||
if d.HasChange("description") {
|
||||
@@ -125,6 +137,11 @@ func resourceTrunkUpdate(ctx context.Context, d *schema.ResourceData, m interfac
|
||||
req.NativeVLANID = nativeVLANID
|
||||
}
|
||||
|
||||
if d.HasChange("mtu") {
|
||||
mtu := d.Get("mtu").(int)
|
||||
req.MTU = uint64(mtu)
|
||||
}
|
||||
|
||||
if _, err := c.CloudBroker().Trunk().Update(ctx, req); err != nil {
|
||||
return diag.FromErr(err)
|
||||
}
|
||||
|
||||
@@ -62,6 +62,12 @@ func resourceTrunkSchemaMake() map[string]*schema.Schema {
|
||||
Computed: true,
|
||||
Description: "MAC address",
|
||||
},
|
||||
"mtu": {
|
||||
Type: schema.TypeInt,
|
||||
Optional: true,
|
||||
Default: 1500,
|
||||
Description: "Maximum Transmission Unit",
|
||||
},
|
||||
"status": {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
@@ -147,6 +153,11 @@ func dataSourceTrunkSchemaMake() map[string]*schema.Schema {
|
||||
Computed: true,
|
||||
Description: "Native VLAN ID",
|
||||
},
|
||||
"mtu": {
|
||||
Type: schema.TypeInt,
|
||||
Computed: true,
|
||||
Description: "Maximum Transmission Unit",
|
||||
},
|
||||
"status": {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
@@ -303,6 +314,11 @@ func dataSourceTrunkListSchemaMake() map[string]*schema.Schema {
|
||||
Computed: true,
|
||||
Description: "OVS bridge name",
|
||||
},
|
||||
"mtu": {
|
||||
Type: schema.TypeInt,
|
||||
Computed: true,
|
||||
Description: "Maximum Transmission Unit",
|
||||
},
|
||||
"status": {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
|
||||
Reference in New Issue
Block a user