Table Of Contents
- JSON-RPC 2.0 over WebSocket API
- API Methods
- acme.dns.authenticator
- alert
- alertclasses
- alertservice
- api_key
- app
- app.available
- app.available_space
- app.categories
- app.certificate_choices
- app.config
- app.container_console_choices
- app.container_ids
- app.convert_to_custom
- app.create
- app.delete
- app.get_instance
- app.gpu_choices
- app.ip_choices
- app.latest
- app.outdated_docker_images
- app.pull_images
- app.query
- app.redeploy
- app.rollback
- app.rollback_versions
- app.similar
- app.start
- app.stop
- app.update
- app.upgrade
- app.upgrade_summary
- app.used_ports
- app.image
- app.ix_volume
- app.registry
- audit
- auth
- auth.twofactor
- boot
- boot.environment
- catalog
- certificate
- cloud_backup
- cloudsync
- cloudsync.credentials
- config
- core
- cronjob
- device
- directoryservices
- disk
- dns
- docker
- docker.network
- enclosure.label
- failover.disabled
- failover.reboot
- fc.fc_host
- fcport
- filesystem
- filesystem.acltemplate
- ftp
- group
- idmap
- initshutdownscript
- interface
- interface.bridge_members_choices
- interface.cancel_rollback
- interface.checkin
- interface.checkin_waiting
- interface.choices
- interface.commit
- interface.create
- interface.default_route_will_be_removed
- interface.delete
- interface.get_instance
- interface.has_pending_changes
- interface.ip_in_use
- interface.lacpdu_rate_choices
- interface.lag_ports_choices
- interface.query
- interface.rollback
- interface.save_default_route
- interface.services_restarted_on_sync
- interface.update
- interface.vlan_parent_interface_choices
- interface.websocket_interface
- interface.websocket_local_ip
- interface.xmit_hash_policy_choices
- ipmi
- ipmi.chassis
- ipmi.lan
- ipmi.sel
- iscsi.auth
- iscsi.extent
- iscsi.global
- iscsi.initiator
- iscsi.portal
- iscsi.target
- iscsi.targetextent
- jbof
- k8s_to_docker
- kerberos
- kerberos.keytab
- kerberos.realm
- keychaincredential
- keychaincredential.create
- keychaincredential.delete
- keychaincredential.generate_ssh_key_pair
- keychaincredential.get_instance
- keychaincredential.query
- keychaincredential.remote_ssh_host_key_scan
- keychaincredential.remote_ssh_semiautomatic_setup
- keychaincredential.setup_ssh_connection
- keychaincredential.update
- keychaincredential.used_by
- kmip
- network.configuration
- network.general
- nfs
- nvmet.global
- nvmet.host
- nvmet.host_subsys
- nvmet.namespace
- nvmet.port
- nvmet.port_subsys
- nvmet.subsys
- pool
- pool.attach
- pool.attachments
- pool.create
- pool.ddt_prefetch
- pool.ddt_prune
- pool.detach
- pool.expand
- pool.export
- pool.filesystem_choices
- pool.get_disks
- pool.get_instance
- pool.import_find
- pool.import_pool
- pool.is_upgraded
- pool.offline
- pool.online
- pool.processes
- pool.query
- pool.remove
- pool.replace
- pool.scrub
- pool.update
- pool.upgrade
- pool.validate_name
- pool.dataset
- pool.dataset.attachments
- pool.dataset.change_key
- pool.dataset.checksum_choices
- pool.dataset.compression_choices
- pool.dataset.create
- pool.dataset.delete
- pool.dataset.destroy_snapshots
- pool.dataset.details
- pool.dataset.encryption_algorithm_choices
- pool.dataset.encryption_summary
- pool.dataset.export_key
- pool.dataset.export_keys
- pool.dataset.export_keys_for_replication
- pool.dataset.get_instance
- pool.dataset.get_quota
- pool.dataset.inherit_parent_encryption_properties
- pool.dataset.lock
- pool.dataset.processes
- pool.dataset.promote
- pool.dataset.query
- pool.dataset.recommended_zvol_blocksize
- pool.dataset.recordsize_choices
- pool.dataset.rename
- pool.dataset.set_quota
- pool.dataset.snapshot_count
- pool.dataset.unlock
- pool.dataset.update
- pool.resilver
- pool.scrub
- pool.snapshot
- pool.snapshottask
- pool.snapshottask.create
- pool.snapshottask.delete
- pool.snapshottask.delete_will_change_retention_for
- pool.snapshottask.get_instance
- pool.snapshottask.max_count
- pool.snapshottask.max_total_count
- pool.snapshottask.query
- pool.snapshottask.run
- pool.snapshottask.update
- pool.snapshottask.update_will_change_retention_for
- privilege
- replication
- replication.count_eligible_manual_snapshots
- replication.create
- replication.create_dataset
- replication.delete
- replication.get_instance
- replication.list_datasets
- replication.list_naming_schemas
- replication.query
- replication.restore
- replication.run
- replication.run_onetime
- replication.target_unmatched_snapshots
- replication.update
- replication.config
- reporting
- reporting.exporters
- route
- rsynctask
- service
- sharing.nfs
- sharing.smb
- smb
- snmp
- ssh
- staticroute
- support
- system
- system.advanced
- system.advanced.config
- system.advanced.get_gpu_pci_choices
- system.advanced.login_banner
- system.advanced.sed_global_password
- system.advanced.sed_global_password_is_set
- system.advanced.serial_port_choices
- system.advanced.syslog_certificate_authority_choices
- system.advanced.syslog_certificate_choices
- system.advanced.update
- system.advanced.update_gpu_pci_ids
- system.general
- system.general.checkin
- system.general.checkin_waiting
- system.general.config
- system.general.country_choices
- system.general.kbdmap_choices
- system.general.local_url
- system.general.timezone_choices
- system.general.ui_address_choices
- system.general.ui_certificate_choices
- system.general.ui_httpsprotocols_choices
- system.general.ui_restart
- system.general.ui_v6address_choices
- system.general.update
- system.global
- system.ntpserver
- system.reboot
- system.security
- system.security.info
- systemdataset
- tn_connect
- truecommand
- truenas
- tunable
- update
- ups
- user
- virt.device
- virt.global
- virt.instance
- virt.instance.create
- virt.instance.delete
- virt.instance.device_add
- virt.instance.device_delete
- virt.instance.device_list
- virt.instance.device_update
- virt.instance.get_instance
- virt.instance.image_choices
- virt.instance.query
- virt.instance.restart
- virt.instance.set_bootable_disk
- virt.instance.start
- virt.instance.stop
- virt.instance.update
- virt.volume
- vmware
- API Events
- acme.dns.authenticator
- alert
- alertservice
- api_key
- app
- app.image
- app.registry
- certificate
- cloud_backup
- cloudsync
- cloudsync.credentials
- core
- cronjob
- docker.network
- fc.fc_host
- fcport
- filesystem
- filesystem.acltemplate
- group
- initshutdownscript
- interface
- iscsi.auth
- iscsi.extent
- iscsi.initiator
- iscsi.portal
- iscsi.target
- iscsi.targetextent
- jbof
- kerberos.keytab
- kerberos.realm
- keychaincredential
- nvmet.host
- nvmet.host_subsys
- nvmet.namespace
- nvmet.port
- nvmet.port_subsys
- nvmet.subsys
- pool
- pool.dataset
- pool.scrub
- pool.snapshot
- pool.snapshottask
- privilege
- replication
- reporting
- reporting.exporters
- rsynctask
- service
- sharing.nfs
- sharing.smb
- staticroute
- system.ntpserver
- tunable
- user
- virt.instance
- virt.volume
- vmware
- Jobs
- Query Methods
Previous topic
Next topic
sharing.smb.get_instance¶
Returns instance matching id. If id is not found, Validation error is raised.
Please see query method documentation for options.
No Additional Items
Tuple Validation
Parameter 1: id
id
Type: integerParameter 2: options
options
Type: object Default: {}Query 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 Fk
Type: array of string Default: []No Additional Items
Each item of this array must be:
Extra
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:
[
"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: falseSmbShareEntry
Type: objectSMB share entry on the TrueNAS server.
No Additional PropertiesId
Type: integerPurpose
Type: enum (of string) Default: "DEFAULT_SHARE"This parameter sets the purpose of the SMB share. It controls how the SMB share behaves and what features are
available through options. The DEFAULT_SHARE setting is best for most applications, and should be used, unless
there is a specific reason to change it.
DEFAULT_SHARE: Set the SMB share for best compatibility with common SMB clients.
LEGACY_SHARE: Set the SMB share for compatibility with older TrueNAS versions. Automated backend migrations
use this to help the administrator move to better-supported share settings. It should not be used for new SMB
shares.
TIMEMACHINE_SHARE: The SMB share is presented to MacOS clients as a time machine target. NOTE: aapl_extensions
must be set in the global smb.config
.
MULTIPROTOCOL_SHARE: The SMB share is configured for multi-protocol access. Set this if the path
is shared
through NFS, FTP, or used by containers or apps. NOTE: This setting can reduce SMB share performance because it
turns off some SMB features for safer interoperability with external processes.
TIMELOCKEDSHARE: The SMB share makes files read-only through the SMB protocol after the set graceperiod ends.
WARNING: This setting does not work if the path
is accessed locally or if another SMB share without the
TIMELOCKED_SHARE purpose uses the same path. WARNING: This setting might not meet regulatory requirements for
write-once storage.
PRIVATEDATASETSSHARE: The server uses the specified dataset_naming_schema
in options
to make a new ZFS
dataset when the client connects. The server uses this dataset as the share path during the SMB session.
EXTERNAL_SHARE: The SMB share is a DFS proxy to a share hosted on an external SMB server.
Must be one of:
- "DEFAULT_SHARE"
- "LEGACY_SHARE"
- "TIMEMACHINE_SHARE"
- "MULTIPROTOCOL_SHARE"
- "TIME_LOCKED_SHARE"
- "PRIVATE_DATASETS_SHARE"
- "EXTERNAL_SHARE"
Name
Type: stringSMB share name. SMB share names are case-insensitive and must be unique, and are subject
to the following restrictions:
A share name must be no more than 80 characters in length.
The following characters are illegal in a share name:
\ / [ ] : | < > + = ; , * ? "
Unicode control characters are illegal in a share name.
The following share names are not allowed: global, printers, homes.
"SHARE"
"Macrodata_refinement"
Path
Local server path to share by using the SMB protocol. The path must start with /mnt/
and must be in a
ZFS pool.
Use the string EXTERNAL
if the share works as a DFS proxy.
WARNING: The TrueNAS server does not check if external paths are reachable.
Must be at least 1
characters long
Must be one of:
- "EXTERNAL"
"EXTERNAL"
"/mnt/dozer/SHARE"
"EXTERNAL"
Enabled
Type: boolean Default: trueIf unset, the SMB share is not available over the SMB protocol.
Comment
Type: string Default: ""Text field that is seen next to a share when an SMB client requests a list of SMB shares on the TrueNAS
server.
"Mammalian nurturable"
Readonly
Type: boolean Default: falseIf set, SMB clients cannot create or change files and directories in the SMB share.
NOTE: if set, the share path is still writeable by local processes or other file sharing protocols.
Browsable
Type: boolean Default: trueIf set, the share is included when an SMB client requests a list of SMB shares on the TrueNAS server.
Access Based Share Enumeration
Type: boolean Default: falseIf set, the share is only included when an SMB client requests a list of shares on the SMB server if
the share (not filesystem) access control list (see sharing.smb.getacl
) grants access to the user.
Locked
Type: booleanRead-only value showing if the share is in a locked dataset.
SmbAuditConfig
Type: objectSettings for auditing SMB shares.
NOTE: If a user is a member of groups in the watch_list
and the ignore_list
, the watch_list
has priority, and the SMB session is audited.
{
"enable": true,
"ignore_list": [],
"watch_list": [
"interns"
]
}
{
"enable": true,
"ignore_list": [
"automation"
],
"watch_list": []
}
Enable
Type: boolean Default: falseTurn on auditing for the SMB share. SMB share auditing may not be enabled if enable_smb1
is True
in the SMB service configuration.
Watch List
Type: array of string Default: []Only audit the listed group acounts. If the list is empty, all groups will be audited.
No Additional ItemsEach item of this array must be:
Must be at least 1
characters long
[
"interns",
"contractors"
]
Ignore List
Type: array of string Default: []List of groups that will not be audited.
No Additional ItemsEach item of this array must be:
Must be at least 1
characters long
[
"automation",
"apps"
]
Options
Default: nullAdditional configuration related to the configured SMB share purpose. If None, then the default
options related to the share purpose will be applied.
LegacyOpt
Type: objectThese configuration options apply to shares with the LEGACY_SHARE purpose.
No Additional PropertiesRecyclebin
Type: boolean Default: falseIf set, deleted files are moved to per-user subdirectories in the .recycle
directory. The
SMB server creates the .recycle
directory at the root of the SMB share if the file is in the same
ZFS dataset as the share path
. If the file is in a child ZFS dataset, the server uses the
mountpoint
of that dataset to create the .recycle
directory.
NOTE: this feature does not work with recycle bin features in client operating systems.
WARNING: Do not use this feature instead of backups or ZFS snapshots.
Hostsallow
Type: array of string Default: []A list of IP addresses or subnets that are allowed to access the SMB share. The EXCEPT keyword
may be used to limit a wildcard list.
NOTE: hostname lookups are disabled on the SMB server for performance reasons.
No Additional ItemsEach item of this array must be:
[
"192.168.0.200",
"150.203."
]
[
"150.203.15.0/255.255.255.0"
]
[
"150.203. EXCEPT 150.203.6.66"
]
Hostsdeny
Type: array of string Default: []A list of IP addresses or subnets that are not allowed to access the SMB share. The keyword
ALL
or the netmask 0.0.0.0/0
may be used to deny all by default.
Each item of this array must be:
[
"150.203.4."
]
[
"ALL"
]
[
"0.0.0.0/0"
]
Guestok
Type: boolean Default: falseIf set, guest access to the share is allowed. This should not be used in production environments.
NOTE: If a user account does not exist, the SMB server maps access to the guest account.
WARNING: additional client-side configuration downgrading security settings may be required in order
to use this feature.
Streams
Type: boolean Default: trueIf set, support for SMB alternate data streams is enabled.
WARNING: this value should not be changed once data is written to the SMB share.
Durablehandle
Type: boolean Default: trueIf set, support for SMB durable handles is enabled.
WARNING: this feature is incompatible with multiprotocol and local filesystem access.
Shadowcopy
Type: boolean Default: trueIf set, previous versions of files contained in ZFS snapshots are accessible through standard SMB protocol
operations on previous versions of files.
Fsrvp
Type: boolean Default: falseIf set, enable support for the File Server Remote VSS Protocol. This allows clients to manage
snapshots for the specified SMB share.
Home
Type: boolean Default: falseUse the path
to store user home directories. Each user has a personal home directory and share.
Users cannot access other user directories when connecting to shares.
NOTE: This parameter changes the share name
to homes
. It also creates a dynamic share that mirrors
the username of the user. Both shares use the same path
. You can hide the homes share by turning off browsable
.
The dynamic user home share cannot be hidden.
WARNING: This parameter changes the global server configuration. The SMB server will not authenticate
users without a valid home directory or shell.
Acl
Type: boolean Default: trueIf set, enable mapping of local filesystem ACLs to NT ACLs for SMB clients.
Afp
Type: boolean Default: falseIf set, SMB server will read and store file metadata in an on-disk format compatible with the
legacy AFP file server.
WARNING: this should not be set unless the SMB server is sharing data that was originally written
via the AFP protocol.
Timemachine
Type: boolean Default: falseIf set, MacOS clients can use the share as a time machine target.
Timemachine Quota
Type: integer Default: 0If set, it defines the maximum size of a single time machine sparsebundle volume by limiting the
reported disk size to the SMB client. A value of zero means no quota is applied to the share.
NOTE: Modern MacOS versions you set Time Machine quotas client-side. This gives more predictable
server and client behavior.
Aapl Name Mangling
Type: boolean Default: falseIf set, illegal NTFS characters commonly used by MacOS clients are stored with their native values on the SMB
server's local filesystem.
NOTE: files with illegal NTFS characters in their names may not be accessible to non-MacOS SMB clients.
WARNING: this value should not be changed once data is written to the SMB share.
Vuid
Default: nullThis value is the Time Machine volume UUID for the SMB share. The TrueNAS server uses this value in the mDNS
advertisement for the Time Machine share. MacOS clients may use it to identify the volume. When you create or
update a share, setting this value to None makes the TrueNAS server generate a new UUID for the share.
"d12aafdc-a7ac-4e3c-8bbd-6001f7f19819"
Auxsmbconf
Type: string Default: ""Additional parameters to set on the SMB share. Parameters must be separated by the new-line character.
WARNING: these parameters are not validated and may cause undefined server behavior including
data corruption or data loss.
WARNING: auxiliary parameters are an unsupported configuration.
DefaultOpt
Type: objectThese configuration options apply to shares with the DEFAULT_SHARE purpose.
No Additional PropertiesAapl Name Mangling
Type: boolean Default: falseIf set, illegal NTFS characters commonly used by MacOS clients are stored with their native values on the SMB
server's local filesystem.
NOTE: files with illegal NTFS characters in their names may not be accessible to non-MacOS SMB clients.
WARNING: this value should not be changed once data is written to the SMB share.
TimeMachineOpt
Type: objectThese configuration options apply to shares with the TIMEMACHINE_SHARE purpose.
No Additional PropertiesTimemachine Quota
Type: integer Default: 0If set, it defines the maximum size of a single time machine sparsebundle volume by limiting the
reported disk size to the SMB client.
NOTE: Modern MacOS versions you set Time Machine quotas client-side. This gives more predictable
server and client behavior.
Auto Snapshot
Type: boolean Default: falseIf set, the server makes a ZFS snapshot of the share dataset when the client makes a new
Time Machine backup.
Auto Dataset Creation
Type: boolean Default: falseIf set, the server uses the dataset_naming_schema
to make a new ZFS dataset when the client connects.
The server uses this dataset as the share path during the SMB session.
NOTE: this setting requires the share path to be a dataset mountpoint.
Dataset Naming Schema
Default: nullThe naming schema to use when auto_dataset_creation
is specified. If you do not set a schema,
the server uses %u
(username) if it is not joined to Active Directory. If the server is joined to
Active Directory it uses %D/%u
(domain/username). See the VARIABLE SUBSTITUTIONS
section in the smb.conf
manpage for valid strings.
WARNING: ZFS dataset naming rules are more restrictive than normal path rules.
"%D/%u"
Vuid
Default: nullThis value is the Time Machine volume UUID for the SMB share. The TrueNAS server uses this value in the mDNS
advertisement for the Time Machine share. MacOS clients may use it to identify the volume. When you create or
update a share, setting this value to None makes the TrueNAS server generate a new UUID for the share.
"d12aafdc-a7ac-4e3c-8bbd-6001f7f19819"
MultiprotocolOpt
Type: objectThese configuration options apply to shares with the MULTIPROTOCOL_SHARE purpose.
No Additional PropertiesAapl Name Mangling
Type: boolean Default: falseIf set, illegal NTFS characters commonly used by MacOS clients are stored with their native values on the SMB
server's local filesystem.
NOTE: files with illegal NTFS characters in their names may not be accessible to non-MacOS SMB clients.
WARNING: this value should not be changed once data is written to the SMB share.
TimeLockedOpt
Type: objectThese configuration options apply to shares with the TIMELOCKEDSHARE purpose.
No Additional PropertiesGrace Period
Type: integer Default: 900Time in seconds when write access to the file or directory is allowed.
Aapl Name Mangling
Type: boolean Default: falseIf set, illegal NTFS characters commonly used by MacOS clients are stored with their native values on the SMB
server's local filesystem.
NOTE: files with illegal NTFS characters in their names may not be accessible to non-MacOS SMB clients.
WARNING: this value should not be changed once data is written to the SMB share.
PrivateDatasetOpt
Type: objectThese configuration options apply to shares with the PRIVATEDATASETSSHARE purpose.
No Additional PropertiesDataset Naming Schema
Default: nullThe naming schema to use when auto_dataset_creation
is specified. If you do not set a schema,
the server uses %u
(username) if it is not joined to Active Directory. If the server is joined to
Active Directory it uses %D/%u
(domain/username).
WARNING: ZFS dataset naming rules are more restrictive than normal path rules.
"%D/%u"
Auto Quota
Type: integer Default: 0Set the specified ZFS quota (in gibibytes) on new datasets. If the value is zero, TrueNAS disables
automatic quotas for the share.
10
Aapl Name Mangling
Type: boolean Default: falseIf set, illegal NTFS characters commonly used by MacOS clients are stored with their native values on the SMB
server's local filesystem.
NOTE: files with illegal NTFS characters in their names may not be accessible to non-MacOS SMB clients.
WARNING: this value should not be changed once data is written to the SMB share.
ExternalOpt
Type: objectThese configuration options apply to shares with the EXTERNAL_SHARE purpose.
No Additional PropertiesRemote Path
Type: array of stringThis is the path to the external server and share. Each server entry must include a full domain name or IP
address and share name. Separate the server and share with the \
character.
WARNING: The SMB server and TrueNAS middleware do not check if external paths are reachable.
No Additional ItemsEach item of this array must be:
Must be at least 1
characters long
[
"192.168.0.200\\SHARE"
]
[
"SERVER1.MYDOM.INTERNAL\\SHARE"
]
[
"SERVER1.MYDOM.INTERNAL\\SHARE, SERVER2.MYDOM.INTERNAL\\SHARE"
]
{
"auto_snapshot": true
}
{
"auto_quota": 100
}
Required roles: SHARING_SMB_READ