Hey everyone.
I’m trying to automate our disaster recovery backups using the CX as Code gen-cc-exporter tool. Currently, I’m just running gen-cc-exporter run in a cron job, which works fine, but I’d prefer to have this triggered via an API call from our Node.js orchestration service. That way, I can handle retries and logging more gracefully than just tailing a Docker container’s stdout.
I’ve been digging through the Genesys Cloud Platform API docs (/api/v2/...) and the CX as Code documentation, but I can’t find a REST endpoint that actually initiates a full configuration export. The docs mention that the exporter uses the standard Platform APIs to pull data, but that implies it’s just a client-side script hitting endpoints one by one.
Is there a hidden admin API or a webhook event I can listen for to start an export job? Or am I stuck with SSHing into a server to run the CLI?
Here’s how I’m currently invoking it in my script:
const { exec } = require('child_process');
const exportCmd = `gen-cc-exporter run --output-dir ./backup --include-templates`;
exec(exportCmd, (error, stdout, stderr) => {
if (error) {
console.error(`Export failed: ${stderr}`);
// Retry logic here
return;
}
console.log('Export completed');
});
It feels clunky to manage this via subprocess calls. If there’s no API, is there a recommended pattern for handling the export lifecycle programmatically? Maybe polling a specific status endpoint?
Thanks.