replication.query¶
No Additional Items
Tuple Validation
Parameter 1: filters
filters
Type: array Default: []List of filters for query results. See API documentation for "Query Methods" for more guidance.
No Additional ItemsEach item of this array must be:
[
[
"name",
"=",
"bob"
]
]
[
[
"OR",
[
[
[
"name",
"=",
"bob"
]
],
[
[
"name",
"=",
"larry"
]
]
]
]
]
Parameter 2: options
options
Type: objectQuery options customize the results returned by a query method. More complete documentation with examples
are covered in the "Query methods" section of the TrueNAS API documentation.
Relationships
Type: boolean Default: trueExtend
Default: nullExtend Fk
Type: array of string Default: []No Additional Items
Each item of this array must be:
Extend Context
Default: nullPrefix
Default: nullExtra
Type: object Default: {}Extra options are defined on a per-endpoint basis and are described in the documentation for the associated
query method.
Order By
Type: array of string Default: []An array of field names describing the manner in which query results should be ordered. The field names may
also have one of more of the following special prefixes: -
(reverse sort direction), nulls_first:
(place
any null values at the head of the results list), nulls_last:
(place any null values at the tail of the
results list).
Each item of this array must be:
[
"size",
"-devname",
"nulls_first:-expiretime"
]
Select
Type: array Default: []An array of field names specifying the exact fields to include in the query return. The dot character .
may be used to explicitly select only subkeys of the query result.
Each item of this array must be:
No Additional Items
Each item of this array must be:
[
"username",
"Authentication.status"
]
Count
Type: boolean Default: falseReturn a numeric value representing the number of items that match the specified query-filters
.
Get
Type: boolean Default: falseReturn the JSON object of the first result matching the specified query-filters
. The query fails
if there specified query-filters
return no results.
Offset
Type: integer Default: 0This specifies the beginning offset of the results array. When combined with the limit
query-option
it may be used to implement pagination of large results arrays. WARNING: some query methods provide
volatile results and the onus is on the developer to understand whether pagination is appropriate
for a particular query API method.
Limit
Type: integer Default: 0This specifies the maximum number of results matching the specified query-filters
to return. When
combined wtih the offset
query-option it may be used to implement pagination of large results arrays.
WARNING: some query methods provide volatile results and the onus is on the developer to understand whether
pagination is appropriate for a particular query API method.
Force Sql Filters
Type: boolean Default: falseResult
No Additional Items
Each item of this array must be:
ReplicationQueryResultItem
Type: objectNo Additional Properties
Id
Type: integerName
Type: stringname for replication task
Must be at least 1
characters long
Direction
Type: enum (of string)whether task will PUSH
or PULL
snapshots
Must be one of:
- "PUSH"
- "PULL"
Transport
Type: enum (of string)method of snapshots transfer
* SSH
transfers snapshots via SSH connection. This method is supported everywhere but does not achieve
great performance
* SSH+NETCAT
uses unencrypted connection for data transfer. This can only be used in trusted networks
and requires a port (specified by range from netcat_active_side_port_min
to netcat_active_side_port_max
)
to be open on netcat_active_side
* LOCAL
replicates to or from localhost
Must be one of:
- "SSH"
- "SSH+NETCAT"
- "LOCAL"
Keychain Credential of type SSH_CREDENTIALS
KeychainCredentialEntry
Type: objectNo Additional Properties
Id
Type: integerName
Type: stringDistinguishes this Keychain Credential from others.
Must be at least 1
characters long
Type
Type: enum (of string)Must be one of:
- "SSH_KEY_PAIR"
- "SSH_CREDENTIALS"
Attributes
SSHKeyPair
Type: objectAt least one of the two keys must be provided on creation.
No Additional PropertiesPrivate Key
Default: nullPublic Key
Default: nullCan be omitted and automatically derived from the private key.
SSHCredentials
Type: objectNo Additional Properties
Host
Type: stringPort
Type: integer Default: 22Username
Type: string Default: "root"Private Key
Type: integerKeychain Credential ID.
Remote Host Key
Type: stringCan be discovered with keychaincredential.remotesshhostkeyscan.
Connect Timeout
Type: integer Default: 10Netcat Active Side
Must be one of:
- "LOCAL"
- "REMOTE"
Netcat Active Side Listen Address
Netcat Active Side Port Min
Value must be greater or equal to 1
and lesser or equal to 65535
Netcat Active Side Port Max
Value must be greater or equal to 1
and lesser or equal to 65535
Netcat Passive Side Connect Address
Sudo
Type: booleanwhether SSH
and SSH+NETCAT
transports should use sudo (which is expected to be passwordless) to run zfs
command on the remote machine.
Source Datasets
Type: array of stringlist of datasets to replicate snapshots from
Must contain a minimum of 1
items
Each item of this array must be:
Target Dataset
Type: stringdataset to put snapshots into
Recursive
Type: booleanExclude
Type: array of stringNo Additional Items
Each item of this array must be:
Properties
Type: booleanwhether we should send dataset properties along with snapshots
Properties Exclude
Type: array of stringNo Additional Items
Each item of this array must be:
Must be at least 1
characters long
Properties Override
Type: objectEach additional property must conform to the following schema
Type: stringReplicate
Type: booleanEncryption
Type: booleanEncryption Inherit
Encryption Key
Encryption Key Format
Must be one of:
- "HEX"
- "PASSPHRASE"
Encryption Key Location
Periodic Snapshot Tasks
Type: array of objectlist of periodic snapshot tasks that are sources of snapshots for this replication task. Only push replication
tasks can be bound to periodic snapshot tasks.
Each item of this array must be:
PoolSnapshotTaskDBEntry
Type: objectNo Additional Properties
Dataset
Type: stringRecursive
Type: boolean Default: falseLifetime Value
Type: integer Default: 2Lifetime Unit
Type: enum (of string) Default: "WEEK"Must be one of:
- "HOUR"
- "DAY"
- "WEEK"
- "MONTH"
- "YEAR"
Enabled
Type: boolean Default: trueExclude
Type: array of string Default: []No Additional Items
Each item of this array must be:
Naming Schema
Type: string Default: "auto-%Y-%m-%d_%H-%M"Allow Empty
Type: boolean Default: truePoolSnapshotTaskCron
Type: objectNo Additional Properties
Minute
Type: string Default: "00"Hour
Type: string Default: "*""00" - "23"
Dom
Type: string Default: "*""1" - "31"
Month
Type: string Default: "*""1" (January) - "12" (December)
Dow
Type: string Default: "*""1" (Monday) - "7" (Sunday)
Begin
Type: string Default: "00:00"End
Type: string Default: "23:59"Id
Type: integerState
Type: stringNaming Schema
Type: array of stringlist of naming schemas for pull replication
No Additional ItemsEach item of this array must be:
Also Include Naming Schema
Type: array of stringlist of naming schemas for push replication
No Additional ItemsEach item of this array must be:
Name Regex
replicate all snapshots which names match specified regular expression
Must be at least 1
characters long
Auto
Type: booleanallows replication to run automatically on schedule or after bound periodic snapshot task
schedule to run replication task. Only auto
replication tasks without bound periodic snapshot tasks can have a
schedule
ReplicationTimeCronModel
Type: objectNo Additional Properties
Minute
Type: string Default: "00"Hour
Type: string Default: "*""00" - "23"
Dom
Type: string Default: "*""1" - "31"
Month
Type: string Default: "*""1" (January) - "12" (December)
Dow
Type: string Default: "*""1" (Monday) - "7" (Sunday)
Begin
Type: string Default: "00:00"End
Type: string Default: "23:59"restricts when replication task with bound periodic snapshot tasks runs. For example, you can have periodic
snapshot tasks that run every 15 minutes, but only run replication task every hour.
ReplicationTimeCronModel
Type: objectNo Additional Properties
Minute
Type: string Default: "00"Hour
Type: string Default: "*""00" - "23"
Dom
Type: string Default: "*""1" - "31"
Month
Type: string Default: "*""1" (January) - "12" (December)
Dow
Type: string Default: "*""1" (Monday) - "7" (Sunday)
Begin
Type: string Default: "00:00"End
Type: string Default: "23:59"Only Matching Schedule
Type: booleanwill only replicate snapshots that match schedule
or restrict_schedule
Allow From Scratch
Type: booleanwill destroy all snapshots on target side and replicate everything from scratch if none of the snapshots on
target side matches source snapshots
Readonly
Type: enum (of string)controls destination datasets readonly property:
* SET
will set all destination datasets to readonly=on after finishing the replication
* REQUIRE
will require all existing destination datasets to have readonly=on property
* IGNORE
will avoid this kind of behavior
Must be one of:
- "SET"
- "REQUIRE"
- "IGNORE"
Hold Pending Snapshots
Type: booleanwill prevent source snapshots from being deleted by retention of replication fails for some reason
Retention Policy
Type: enum (of string)specifies how to delete old snapshots on target side:
* SOURCE
deletes snapshots that are absent on source side
* CUSTOM
deletes snapshots that are older than lifetime_value
and lifetime_unit
* NONE
does not delete any snapshots
Must be one of:
- "SOURCE"
- "CUSTOM"
- "NONE"
Lifetime Value
Value must be greater or equal to 1
Lifetime Unit
Must be one of:
- "HOUR"
- "DAY"
- "WEEK"
- "MONTH"
- "YEAR"
Lifetimes
Type: array of objectNo Additional Items
Each item of this array must be:
ReplicationLifetimeModel
Type: objectNo Additional Properties
CronModel
Type: objectEach field can either be a single value or a comma-separated list of values.
A "*" represents the full list of values.
Minute
Type: string Default: "*""00" - "59"
Hour
Type: string Default: "*""00" - "23"
Dom
Type: string Default: "*""1" - "31"
Month
Type: string Default: "*""1" (January) - "12" (December)
Dow
Type: string Default: "*""1" (Monday) - "7" (Sunday)
Lifetime Value
Type: integerValue must be greater or equal to 1
Lifetime Unit
Type: enum (of string)Must be one of:
- "HOUR"
- "DAY"
- "WEEK"
- "MONTH"
- "YEAR"
Compression
compresses SSH stream. Available only for SSH transport
Must be one of:
- "LZ4"
- "PIGZ"
- "PLZIP"
Speed Limit
limits speed of SSH stream. Available only for SSH transport
Value must be greater or equal to 1
Large Block
Type: booleanEmbed
Type: booleanCompressed
Type: booleanRetries
Type: integernumber of retries before considering replication failed
Value must be greater or equal to 1
Logging Level
Must be one of:
- "DEBUG"
- "INFO"
- "WARNING"
- "ERROR"
Enabled
Type: booleanState
Type: objectJob
Has Encrypted Dataset Keys
Type: booleanReplicationQueryResultItem
Type: objectNo Additional Properties
Id
Type: integerName
Type: stringname for replication task
Must be at least 1
characters long
Direction
Type: enum (of string)whether task will PUSH
or PULL
snapshots
Must be one of:
- "PUSH"
- "PULL"
Transport
Type: enum (of string)method of snapshots transfer
* SSH
transfers snapshots via SSH connection. This method is supported everywhere but does not achieve
great performance
* SSH+NETCAT
uses unencrypted connection for data transfer. This can only be used in trusted networks
and requires a port (specified by range from netcat_active_side_port_min
to netcat_active_side_port_max
)
to be open on netcat_active_side
* LOCAL
replicates to or from localhost
Must be one of:
- "SSH"
- "SSH+NETCAT"
- "LOCAL"
Keychain Credential of type SSH_CREDENTIALS
Netcat Active Side
Must be one of:
- "LOCAL"
- "REMOTE"
Netcat Active Side Listen Address
Netcat Active Side Port Min
Value must be greater or equal to 1
and lesser or equal to 65535
Netcat Active Side Port Max
Value must be greater or equal to 1
and lesser or equal to 65535
Netcat Passive Side Connect Address
Sudo
Type: booleanwhether SSH
and SSH+NETCAT
transports should use sudo (which is expected to be passwordless) to run zfs
command on the remote machine.
Source Datasets
Type: array of stringlist of datasets to replicate snapshots from
Must contain a minimum of 1
items
Each item of this array must be:
Target Dataset
Type: stringdataset to put snapshots into
Recursive
Type: booleanExclude
Type: array of stringNo Additional Items
Each item of this array must be:
Properties
Type: booleanwhether we should send dataset properties along with snapshots
Properties Exclude
Type: array of stringNo Additional Items
Each item of this array must be:
Must be at least 1
characters long
Properties Override
Type: objectEach additional property must conform to the following schema
Type: stringReplicate
Type: booleanEncryption
Type: booleanEncryption Inherit
Encryption Key
Encryption Key Format
Must be one of:
- "HEX"
- "PASSPHRASE"
Encryption Key Location
Periodic Snapshot Tasks
Type: arraylist of periodic snapshot tasks that are sources of snapshots for this replication task. Only push replication
tasks can be bound to periodic snapshot tasks.
Each item of this array must be:
Naming Schema
Type: array of stringlist of naming schemas for pull replication
No Additional ItemsEach item of this array must be:
Also Include Naming Schema
Type: array of stringlist of naming schemas for push replication
No Additional ItemsEach item of this array must be:
Name Regex
replicate all snapshots which names match specified regular expression
Must be at least 1
characters long
Auto
Type: booleanallows replication to run automatically on schedule or after bound periodic snapshot task
schedule to run replication task. Only auto
replication tasks without bound periodic snapshot tasks can have a
schedule
restricts when replication task with bound periodic snapshot tasks runs. For example, you can have periodic
snapshot tasks that run every 15 minutes, but only run replication task every hour.
Only Matching Schedule
Type: booleanwill only replicate snapshots that match schedule
or restrict_schedule
Allow From Scratch
Type: booleanwill destroy all snapshots on target side and replicate everything from scratch if none of the snapshots on
target side matches source snapshots
Readonly
Type: enum (of string)controls destination datasets readonly property:
* SET
will set all destination datasets to readonly=on after finishing the replication
* REQUIRE
will require all existing destination datasets to have readonly=on property
* IGNORE
will avoid this kind of behavior
Must be one of:
- "SET"
- "REQUIRE"
- "IGNORE"
Hold Pending Snapshots
Type: booleanwill prevent source snapshots from being deleted by retention of replication fails for some reason
Retention Policy
Type: enum (of string)specifies how to delete old snapshots on target side:
* SOURCE
deletes snapshots that are absent on source side
* CUSTOM
deletes snapshots that are older than lifetime_value
and lifetime_unit
* NONE
does not delete any snapshots
Must be one of:
- "SOURCE"
- "CUSTOM"
- "NONE"
Lifetime Value
Value must be greater or equal to 1
Lifetime Unit
Must be one of:
- "HOUR"
- "DAY"
- "WEEK"
- "MONTH"
- "YEAR"
Lifetimes
Type: arrayNo Additional Items
Each item of this array must be:
Compression
compresses SSH stream. Available only for SSH transport
Must be one of:
- "LZ4"
- "PIGZ"
- "PLZIP"
Speed Limit
limits speed of SSH stream. Available only for SSH transport
Value must be greater or equal to 1
Large Block
Type: booleanEmbed
Type: booleanCompressed
Type: booleanRetries
Type: integernumber of retries before considering replication failed
Value must be greater or equal to 1
Logging Level
Must be one of:
- "DEBUG"
- "INFO"
- "WARNING"
- "ERROR"
Enabled
Type: booleanState
Type: objectJob
Has Encrypted Dataset Keys
Type: booleanRequired roles: REPLICATION_TASK_READ