Pinecone TypeScript SDK - v9.0.0
    Preparing search index...

    Class BackupSchedules

    Backup schedules create index backups at a recurring cadence and retain them for a set number of days. Access them through Pinecone.backupSchedules; do not construct this class directly. Use Backups.create for a single backup.

    import { Pinecone } from '@pinecone-database/pinecone';

    const pc = new Pinecone();
    const schedules = await pc.backupSchedules.list('product-catalog');
    Index
    • Creates an enabled backup schedule for an index.

      Parameters

      • indexName: string

        The serverless or BYOC index to back up, such as product-catalog.

      • options: CreateBackupScheduleOptions

        The schedule name, frequency, and number of days to retain each backup.

      Returns Promise<BackupScheduleModel>

      The schedule configuration, ID, and nextScheduledRun.

      Errors.PineconeArgumentError when the index name or schedule name is empty.

      import { Pinecone } from '@pinecone-database/pinecone';

      const pc = new Pinecone();
      const schedule = await pc.backupSchedules.create('product-catalog', {
      name: 'catalog-daily',
      frequency: 'daily',
      retentionDays: 30,
      });
      console.log(schedule.scheduleId, schedule.nextScheduledRun);

      Backups.create for a single backup.

    • Deletes a backup schedule, stopping future runs.

      Existing backups remain until their retention window ends.

      Parameters

      • scheduleId: string

        The ID of the schedule to delete.

      Returns Promise<void>

      Resolves when the schedule has been deleted.

      Errors.PineconeArgumentError when the schedule ID is empty.

      import { Pinecone } from '@pinecone-database/pinecone';

      const pc = new Pinecone();
      await pc.backupSchedules.delete('e88f7273-42aa-47e9-af73-593827136867');
    • Lists one page of backups produced or planned by a schedule.

      Check each backup status: the page can include runs that have not started.

      Parameters

      • scheduleId: string

        The ID of the schedule whose history to list.

      • Optionaloptions: ListBackupSchedulesOptions

        Page size and continuation token. Omit to fetch the first page with the default size.

      Returns Promise<BackupScheduleHistoryList>

      Backups in data; pass pagination.next as paginationToken to fetch the next page.

      Errors.PineconeArgumentError when the schedule ID is empty.

      import { Pinecone } from '@pinecone-database/pinecone';

      const pc = new Pinecone();
      const page = await pc.backupSchedules.history('e88f7273-42aa-47e9-af73-593827136867');
      for (const backup of page.data) {
      console.log(backup.backupId, backup.status);
      }

      Backups.listByIndex for all backups of an index, including unscheduled backups.

    • Lists one page of enabled and disabled backup schedules for an index.

      Parameters

      • indexName: string

        The index whose schedules to list.

      • Optionaloptions: ListBackupSchedulesOptions

        Page size and continuation token. Omit to fetch the first page with the default size.

      Returns Promise<BackupScheduleList>

      Schedules in data; pass pagination.next as paginationToken to fetch the next page.

      Errors.PineconeArgumentError when the index name is empty.

      import { Pinecone } from '@pinecone-database/pinecone';

      const pc = new Pinecone();
      const page = await pc.backupSchedules.list('product-catalog', { limit: 10 });
      console.log(page.data, page.pagination?.next);