code: @TaskAction
    public void stopAction() {
      DevServer server =
          devServers.newDevAppServer(CloudSdkOperations.getDefaultHandler(getLogger()));
      try {
        server.stop(runConfig.toStopConfiguration());
      } catch (AppEngineException ex) {
        getLogger().error("Failed to stop server: " + ex.getMessage());
      }
    }
docs: Task entrypoint : Stop the dev appserver (get StopConfiguration from helper).