Skip to main content

ListRefreshExternalCollectionJobs()

Addedv3.0.x

This operation lists the external collection refresh jobs of all or specified collections.

func (c *Client) ListRefreshExternalCollectionJobs(ctx context.Context, option ListRefreshExternalCollectionJobsOption, callOptions ...grpc.CallOption) ([]*entity.RefreshExternalCollectionJobInfo, error) {

Request Syntax

option := client.NewListRefreshExternalCollectionJobsOption(collectionName)

result, err := client.ListRefreshExternalCollectionJobs(option)

PARAMETERS:

  • collectionName (string) -

    The name of the target collection. If this parameter is left unspecified, the refresh jobs of all external collections are turned.

RETURN TYPE:

[]*entity.RefreshExternalCollectionJobInfo

RETURNS:

A list of entity.RefreshExternalCollectionJobInfo struct, each recording the details of the an external collection refresh job.

type RefreshExternalCollectionJobInfo struct {
JobID int64
CollectionName string
State RefreshExternalCollectionState
Progress int64
Reason string
ExternalSource string
StartTime int64
EndTime int64
}

PARAMETERS:

PARAMETERS:

  • JobID (int64) -

    The job ID specified in the current request.

  • CollectionName (string) -

    The name of the external collection specified in RefreshExternalCollection().

  • State (string) -

    The current state of the specified job. Possible values are:

    • RefreshPending

    • RefreshInProgress

    • RefreshFailed

    • RefreshCompleted

  • Progress (int64) -

    The current progress of the specified job. The value is an integer ranging from 0 to 100.

  • Reason (string) -

    The error prompt if the refresh operation failed. It is an empty string in normal cases.

  • ExternalSource (string) -

    The external source URI specified in RefreshExternalCollection().

  • StartTime (int64) -

    The timestamp in milliseconds at which the specified job starts.

  • EndTime (int64) -

    The timestamp in milliseconds at which the specified job ends.

Example

// List refresh jobs of a specified collection
option := client.NewListRefreshExternalCollectionJobsOption("test_collection")

// List refresh jobs of all external collections
option = client.NewListRefreshExternalCollectionJobsOption()

result, err = client.ListRefreshExternalCollectionJobs(option)