Skip to content

Commit

Permalink
introduce Delete() method for resourceDatacenterConnectivityTemplate
Browse files Browse the repository at this point in the history
  • Loading branch information
chrismarget-j committed Jul 25, 2023
1 parent a93f110 commit c075964
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion apstra/resource_datacenter_connectivity_template.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,13 @@ func (o *resourceDatacenterConnectivityTemplate) Delete(ctx context.Context, req
resp.Diagnostics.AddError(fmt.Sprintf(blueprint.ErrDCBlueprintCreate, state.BlueprintId), err.Error())
return
}
_ = bp

err = bp.DeleteConnectivityTemplate(ctx, apstra.ObjectId(state.Id.ValueString()))
if err != nil {
var ace apstra.ApstraClientErr
if errors.As(err, &ace) && ace.Type() == apstra.ErrNotfound {
return // 404 is okay
}
resp.Diagnostics.AddError(fmt.Sprintf("failed while deleting Connectivity Template %s", state.Id), err.Error())
}
}

0 comments on commit c075964

Please sign in to comment.