Possible but not an easy task.
$reason = 'Some string';
$nullTargets = new Targets([]);
$urls = ['https://example.com/abc'];
$purgeCommand = new PurgeCommand($reason, $nullTargets, $urls);
Then you have to build/get the Purger
instance and run execute
:
$purger->execute($purgeCommand);
Build the Purger
instance manually is not an easy task. Get it from Sunny’s container is a better choice. See https://github.com/typisttech/sunny#extending-sunny
—
Sunny doesn’t expect you to purge single url only because I believe purging more urls doesn’t hurt whereas purging less urls usually causes troubles.
What is your use case of purging single url but not its related urls?