Skip to content

Replication

get_replication(execution_id) async

Get a replication execution by ID.

Parameters:

Name Type Description Default
execution_id int

The ID of the replication execution to get.

required

Returns:

Type Description
ReplicationExecution

The replication execution.

start_replication(policy_id) async

Start a replication execution.

Parameters:

Name Type Description Default
policy_id int

The ID of the policy to start an execution for.

required

Returns:

Type Description
str

The location of the replication execution.

stop_replication(execution_id) async

Stop a replication execution

Parameters:

Name Type Description Default
execution_id int

The execution ID to stop.

required

get_replications(sort=None, policy_id=None, status=None, trigger=None, page=1, page_size=10, limit=None) async

Get a list of replication executions.

Parameters:

Name Type Description Default
sort Optional[str]

The sort order of the results.

None
policy_id Optional[int]

The ID of the policy to filter by.

None
status Optional[str]

The status of the executions to filter by.

None
trigger Optional[str]

The trigger of the executions to filter by.

None
page int

The page of results to return.

1
page_size int

The number of results to return per page.

10
limit Optional[int]

The maximum number of results to return.

None

Returns:

Type Description
List[ReplicationExecution]

The list of replication executions.

get_replication_tasks(execution_id, status=None, resource_type=None, sort=None, page=1, page_size=10, limit=None) async

Get a list of replication tasks for a specific execution.

Parameters:

Name Type Description Default
execution_id int

The ID of the replication execution to get tasks for.

required
sort Optional[str]

The sort order of the results.

None
page int

The page of results to return.

1
page_size int

The number of results to return per page.

10
status Optional[str]

The status of the tasks to filter by.

None
resource_type Optional[str]

The resource type of the tasks to filter by.

None

Returns:

Type Description
List[ReplicationTask]

The list of replication tasks.

get_replication_task_log(execution_id, task_id) async

Get the log of a replication task.

Parameters:

Name Type Description Default
execution_id int

The ID of the execution the task belongs to.

required
task_id int

The ID of the task to get the log for.

required

Returns:

Type Description
str

The log of the task.

get_replication_policy(policy_id) async

Get a specific replication policy.

Parameters:

Name Type Description Default
policy_id int

The ID of the policy to get.

required

Returns:

Type Description
ReplicationPolicy

The replication policy.

create_replication_policy(policy) async

Create a replication policy.

Parameters:

Name Type Description Default
policy ReplicationPolicy

The policy to create.

required

Returns:

Type Description
str

The location of the created policy.

update_replication_policy(policy_id, policy) async

Update a replication policy.

Parameters:

Name Type Description Default
policy_id int

The ID of the policy to update.

required
policy ReplicationPolicy

The updated policy.

required

delete_replication_policy(policy_id) async

Delete a replication policy.

Parameters:

Name Type Description Default
policy_id int

The ID of the policy to delete.

required

get_replication_policies(query=None, sort=None, page=1, page_size=10, name=None, limit=None) async

Get a list of replication policies.

Parameters:

Name Type Description Default
query Optional[str]

Query string to filter the logs.

Supported query patterns are:

* exact match(`"k=v"`)
* fuzzy match(`"k=~v"`)
* range(`"k=[min~max]"`)
* list with union releationship(`"k={v1 v2 v3}"`)
* list with intersection relationship(`"k=(v1 v2 v3)"`).

The value of range and list can be:

* string(enclosed by `"` or `'`)
* integer
* time(in format `"2020-04-09 02:36:00"`)

All of these query patterns should be put in the query string and separated by ",". e.g. "k1=v1,k2=~v2,k3=[min~max]"

None
sort Optional[str]

The sort order of the results.

None
page int

The page of results to return.

1
page_size int

The number of results to return per page.

10
name Optional[str]

(DEPRECATED: use query) The name of the policy to filter by.

None
limit Optional[int]

The maximum number of results to return.

None

Returns:

Type Description
List[ReplicationPolicy]

The list of replication policies.