You can do some of it via BGP, which is a standard method for handling routing once you become any sort of server provider with multiple bandwidth providers. It is builtin to some Juniper devices already, for instance:
http://njetwork.wordpress.com/2013/04/30/mitigating-ddos-att...There are other ways to do it via BGP also. Plus there is null-routing, bandwidth limiting, etc.