Interface Replications

interface Replications {
    cancel: ((id) => Promise<void>);
    delete: ((id) => Promise<void>);
    deleteAll: (() => Promise<void>);
    get: ((id, opts?) => Promise<null | {
        collection: string;
        id: string;
        scheduledForCancel: NonNullable<undefined | boolean>;
        scheduledForDelete: NonNullable<undefined | boolean>;
        shard: string;
        sourceNode: string;
        status: {
            errors: {
                message: string;
                whenErroredUnixMs: number;
            }[];
            state: NonNullable<undefined | "REGISTERED" | "HYDRATING" | "FINALIZING" | "DEHYDRATING" | "READY" | "CANCELLED">;
            whenStartedUnixMs: number;
        };
        statusHistory: {
            errors: {
                message: string;
                whenErroredUnixMs: number;
            }[];
            state: NonNullable<undefined | "REGISTERED" | "HYDRATING" | "FINALIZING" | "DEHYDRATING" | "READY" | "CANCELLED">;
            whenStartedUnixMs: number;
        }[];
        targetNode: string;
        type: NonNullable<"COPY" | "MOVE">;
        uncancelable: NonNullable<undefined | boolean>;
        whenStartedUnixMs: number;
    }>);
    query: ((opts?) => Promise<{
        collection: string;
        id: string;
        scheduledForCancel: NonNullable<undefined | boolean>;
        scheduledForDelete: NonNullable<undefined | boolean>;
        shard: string;
        sourceNode: string;
        status: {
            errors: {
                message: string;
                whenErroredUnixMs: number;
            }[];
            state: NonNullable<undefined | "REGISTERED" | "HYDRATING" | "FINALIZING" | "DEHYDRATING" | "READY" | "CANCELLED">;
            whenStartedUnixMs: number;
        };
        statusHistory: {
            errors: {
                message: string;
                whenErroredUnixMs: number;
            }[];
            state: NonNullable<undefined | "REGISTERED" | "HYDRATING" | "FINALIZING" | "DEHYDRATING" | "READY" | "CANCELLED">;
            whenStartedUnixMs: number;
        }[];
        targetNode: string;
        type: NonNullable<"COPY" | "MOVE">;
        uncancelable: NonNullable<undefined | boolean>;
        whenStartedUnixMs: number;
    }[]>);
}

Properties

cancel: ((id) => Promise<void>)

Cancel a replication operation.

Type declaration

    • (id): Promise<void>
    • Parameters

      • id: string

        The ID of the replication operation to cancel.

      Returns Promise<void>

Returns

A promise that resolves when the operation is cancelled.

delete: ((id) => Promise<void>)

Delete a replication operation.

Type declaration

    • (id): Promise<void>
    • Parameters

      • id: string

        The ID of the replication operation to delete.

      Returns Promise<void>

Returns

A promise that resolves when the operation is deleted.

deleteAll: (() => Promise<void>)

Delete all replication operations.

Type declaration

    • (): Promise<void>
    • Returns Promise<void>

Returns

A promise that resolves when all operations are deleted.

get: ((id, opts?) => Promise<null | {
    collection: string;
    id: string;
    scheduledForCancel: NonNullable<undefined | boolean>;
    scheduledForDelete: NonNullable<undefined | boolean>;
    shard: string;
    sourceNode: string;
    status: {
        errors: {
            message: string;
            whenErroredUnixMs: number;
        }[];
        state: NonNullable<undefined | "REGISTERED" | "HYDRATING" | "FINALIZING" | "DEHYDRATING" | "READY" | "CANCELLED">;
        whenStartedUnixMs: number;
    };
    statusHistory: {
        errors: {
            message: string;
            whenErroredUnixMs: number;
        }[];
        state: NonNullable<undefined | "REGISTERED" | "HYDRATING" | "FINALIZING" | "DEHYDRATING" | "READY" | "CANCELLED">;
        whenStartedUnixMs: number;
    }[];
    targetNode: string;
    type: NonNullable<"COPY" | "MOVE">;
    uncancelable: NonNullable<undefined | boolean>;
    whenStartedUnixMs: number;
}>)

Get a specific replication operation by ID.

Type declaration

    • (id, opts?): Promise<null | {
          collection: string;
          id: string;
          scheduledForCancel: NonNullable<undefined | boolean>;
          scheduledForDelete: NonNullable<undefined | boolean>;
          shard: string;
          sourceNode: string;
          status: {
              errors: {
                  message: string;
                  whenErroredUnixMs: number;
              }[];
              state: NonNullable<undefined | "REGISTERED" | "HYDRATING" | "FINALIZING" | "DEHYDRATING" | "READY" | "CANCELLED">;
              whenStartedUnixMs: number;
          };
          statusHistory: {
              errors: {
                  message: string;
                  whenErroredUnixMs: number;
              }[];
              state: NonNullable<undefined | "REGISTERED" | "HYDRATING" | "FINALIZING" | "DEHYDRATING" | "READY" | "CANCELLED">;
              whenStartedUnixMs: number;
          }[];
          targetNode: string;
          type: NonNullable<"COPY" | "MOVE">;
          uncancelable: NonNullable<undefined | boolean>;
          whenStartedUnixMs: number;
      }>
    • Parameters

      • id: string

        The ID of the replication operation to get.

      • Optional opts: {
            includeHistory?: boolean;
        }
        • Optional includeHistory?: boolean

          Whether to include the status history in the response.

      Returns Promise<null | {
          collection: string;
          id: string;
          scheduledForCancel: NonNullable<undefined | boolean>;
          scheduledForDelete: NonNullable<undefined | boolean>;
          shard: string;
          sourceNode: string;
          status: {
              errors: {
                  message: string;
                  whenErroredUnixMs: number;
              }[];
              state: NonNullable<undefined | "REGISTERED" | "HYDRATING" | "FINALIZING" | "DEHYDRATING" | "READY" | "CANCELLED">;
              whenStartedUnixMs: number;
          };
          statusHistory: {
              errors: {
                  message: string;
                  whenErroredUnixMs: number;
              }[];
              state: NonNullable<undefined | "REGISTERED" | "HYDRATING" | "FINALIZING" | "DEHYDRATING" | "READY" | "CANCELLED">;
              whenStartedUnixMs: number;
          }[];
          targetNode: string;
          type: NonNullable<"COPY" | "MOVE">;
          uncancelable: NonNullable<undefined | boolean>;
          whenStartedUnixMs: number;
      }>

Returns

The replication operation or null if not found.

query: ((opts?) => Promise<{
    collection: string;
    id: string;
    scheduledForCancel: NonNullable<undefined | boolean>;
    scheduledForDelete: NonNullable<undefined | boolean>;
    shard: string;
    sourceNode: string;
    status: {
        errors: {
            message: string;
            whenErroredUnixMs: number;
        }[];
        state: NonNullable<undefined | "REGISTERED" | "HYDRATING" | "FINALIZING" | "DEHYDRATING" | "READY" | "CANCELLED">;
        whenStartedUnixMs: number;
    };
    statusHistory: {
        errors: {
            message: string;
            whenErroredUnixMs: number;
        }[];
        state: NonNullable<undefined | "REGISTERED" | "HYDRATING" | "FINALIZING" | "DEHYDRATING" | "READY" | "CANCELLED">;
        whenStartedUnixMs: number;
    }[];
    targetNode: string;
    type: NonNullable<"COPY" | "MOVE">;
    uncancelable: NonNullable<undefined | boolean>;
    whenStartedUnixMs: number;
}[]>)

Query all replication operations with optional filters.

Type declaration

    • (opts?): Promise<{
          collection: string;
          id: string;
          scheduledForCancel: NonNullable<undefined | boolean>;
          scheduledForDelete: NonNullable<undefined | boolean>;
          shard: string;
          sourceNode: string;
          status: {
              errors: {
                  message: string;
                  whenErroredUnixMs: number;
              }[];
              state: NonNullable<undefined | "REGISTERED" | "HYDRATING" | "FINALIZING" | "DEHYDRATING" | "READY" | "CANCELLED">;
              whenStartedUnixMs: number;
          };
          statusHistory: {
              errors: {
                  message: string;
                  whenErroredUnixMs: number;
              }[];
              state: NonNullable<undefined | "REGISTERED" | "HYDRATING" | "FINALIZING" | "DEHYDRATING" | "READY" | "CANCELLED">;
              whenStartedUnixMs: number;
          }[];
          targetNode: string;
          type: NonNullable<"COPY" | "MOVE">;
          uncancelable: NonNullable<undefined | boolean>;
          whenStartedUnixMs: number;
      }[]>
    • Parameters

      Returns Promise<{
          collection: string;
          id: string;
          scheduledForCancel: NonNullable<undefined | boolean>;
          scheduledForDelete: NonNullable<undefined | boolean>;
          shard: string;
          sourceNode: string;
          status: {
              errors: {
                  message: string;
                  whenErroredUnixMs: number;
              }[];
              state: NonNullable<undefined | "REGISTERED" | "HYDRATING" | "FINALIZING" | "DEHYDRATING" | "READY" | "CANCELLED">;
              whenStartedUnixMs: number;
          };
          statusHistory: {
              errors: {
                  message: string;
                  whenErroredUnixMs: number;
              }[];
              state: NonNullable<undefined | "REGISTERED" | "HYDRATING" | "FINALIZING" | "DEHYDRATING" | "READY" | "CANCELLED">;
              whenStartedUnixMs: number;
          }[];
          targetNode: string;
          type: NonNullable<"COPY" | "MOVE">;
          uncancelable: NonNullable<undefined | boolean>;
          whenStartedUnixMs: number;
      }[]>

Returns

A list of replication operations matching the query.