Ddos protection configure api

Hello, I want to use the following api so that when my server is attacked through Ddos L7, I can quickly turn on the under attack mode.