Aller au contenu principal

Outils d’action (operate)

Ces outils changent la configuration ou démarrent une action (sauvegarde, restauration, export). Un jeton OAuth avec la portée operate voit ces 21 outils. Les textes de la source sont en anglais.

start_backup​

Start a backup. Portée operate. Lecture seule : non. Destructif : non.

Starts a backup of an agent endpoint now: files (the folders of its file policy; without a file policy: refused no_file_policy), baremetal (an image, with the bare metal policy) or mssql (the SQL Server databases of its SQL Server policy; give policy_id when the machine has several). The agent must be online.

Paramètres

NomTypeObligatoireDescription
endpoint_idstring (uuid)ouiId of the endpoint.
kind"files" | "baremetal" | "mssql"nonDéfaut : "files".
policy_idstring (uuid)nonId of the SQL Server policy (mssql only), when the machine has several.

cancel_job​

Cancel a backup. Portée operate. Lecture seule : non. Destructif : non.

Cancels a backup (files, image or SQL Server) that is scheduled or running. A running backup stops when the agent answers; the data already sent is kept.

Paramètres

NomTypeObligatoireDescription
job_idstring (uuid)ouiId of the job.

rename_endpoint​

Rename an endpoint. Portée operate. Lecture seule : non. Destructif : non.

Gives a display name to an endpoint (for example soumettre.fr for the machine ns3221049), or removes it. The hostname (name) does not change: the agent, the restores and the audit keep it. An empty or null display_name shows the hostname again.

Paramètres

NomTypeObligatoireDescription
endpoint_idstring (uuid)ouiId of the endpoint.
display_nameanyouiNew display name, at most 100 characters after trim; empty or null to remove it.

set_endpoint_tags​

Set the tags of an endpoint. Portée operate. Lecture seule : non. Destructif : non.

Sets or removes tags on one endpoint (agent or Microsoft 365 tenant). set adds a tag or changes the value of its key (one value per key); remove takes keys away (a key the endpoint does not have is skipped). All or nothing. A key that the MSP does not have is refused, with the keys that exist: use list_tag_keys, never guess a name. To make a new key, confirm the exact name with the user before create_key: true. One endpoint per call: for several endpoints, use the portal (Fleet, selection, tags).

Paramètres

NomTypeObligatoireDescription
endpoint_idstring (uuid)ouiId of the endpoint.
setarray of anynonTags to add or change, for example {key: "site", value: "Lyon"}. Keys compare without case. Éléments maximum : 20.
removearray of anynonTag keys to remove from the endpoint, for example site Éléments maximum : 20.
create_keybooleannontrue creates the keys of set that the MSP does not have. Confirm the name with the user first. Défaut : false.

update_file_policy​

Change the file policy. Portée operate. Lecture seule : non. Destructif : oui.

Creates or changes the file backup policy of an agent endpoint. Give only the fields to change; each given field replaces the target value (paths is the whole new list). Without a policy, paths, schedule, timezone, enabled and retention are required to create one (by default no excludes, cache folders skipped, other file systems included). A field not given keeps its target value: the current value, or the value of a delayed change still open. The tool returns the difference. Immediate: added paths, schedule, timezone, window_minutes, first_backup_window, a longer retention, enabled=true. Delayed 72 hours (destructive, delayed_changes): removed paths, changed excludes or filters, a shorter retention, enabled=false. Until a delayed change applies, the old value stays in force: paths added with their excludes are backed up without these excludes for 72 hours. To avoid a large first backup, set schedule.start_at after the effective_at of the delayed changes. A field set back to its current value cancels the delayed change of that field: the answer lists it in cancelled_actions.

Paramètres

NomTypeObligatoireDescription
endpoint_idstring (uuid)ouiId of the endpoint.
pathsarray of stringnonÉléments minimum : 1.
excludesarray of stringnon
exclude_cachesbooleannon
one_file_systembooleannon
scheduleanynon
timezonestringnonIANA timezone, for example Europe/Paris or UTC; service validates the name. Longueur : 1 à 255.
enabledbooleannon
window_minutesanynonMinutes after the planned time, 1 to 1439 (2 hours = 120), or max. At its end a backup not started is missed and a running one is stopped. It never goes past the next run (one backup at a time), nor 23 h 59. schedule.window_minutes wins for its runs.
first_backup_windowanynonFirst backup of the policy, until it has a snapshot: unlimited (default) runs past the end of the window; respect is stopped at the end of the window (interrupted) and resumes at the next run. Each resume reads all the data again: on a large volume or a slow disk the first backup may never end. schedule.first_backup_window wins for its runs.
retentionanynon

update_baremetal_policy​

Change the bare metal policy. Portée operate. Lecture seule : non. Destructif : oui.

Creates or changes the bare metal (full machine image) policy of an agent endpoint. Give only the fields to change. Without a policy, schedule, timezone, enabled and retention are required to create one. A field not given keeps its target value: the current value, or the value of a delayed change still open. Immediate: disks, schedule, timezone, window_minutes, first_backup_window, a longer retention, enabled=true. Delayed 72 hours (delayed_changes): a shorter retention, enabled=false; until then the old value stays in force. A field set back to its current value cancels the delayed change of that field: the answer lists it in cancelled_actions. A machine in BIOS mode or with an MBR system disk (agent.boot of get_endpoint) gets no new policy and cannot turn one on: baremetal_unsupported_boot.

Paramètres

NomTypeObligatoireDescription
endpoint_idstring (uuid)ouiId of the endpoint.
disks"system" | array of integernonWindows disk numbers; lot 2 supports one system disk. The agent must verify the selected disk contains Windows. Linux: system only. Défaut : "system".
scheduleanynon
timezonestringnonIANA timezone, for example Europe/Paris or UTC; service validates the name. Longueur : 1 à 255.
enabledbooleannon
window_minutesanynonMinutes after the planned time, 1 to 1439 (2 hours = 120), or max. At its end a backup not started is missed and a running one is stopped. It never goes past the next run (one backup at a time), nor 23 h 59. schedule.window_minutes wins for its runs.
first_backup_windowanynonFirst backup of the policy, until it has a snapshot: unlimited (default) runs past the end of the window; respect is stopped at the end of the window (interrupted) and resumes at the next run. Each resume reads all the data again: on a large volume or a slow disk the first backup may never end. schedule.first_backup_window wins for its runs.
retentionanynon

cancel_pending_action​

Cancel a delayed change. Portée operate. Lecture seule : non. Destructif : non.

Cancels a destructive change that waits its 72 hours (list_pending_actions), also of a SQL Server policy (removed databases, shorter retention, turning off). The current value stays. Note: update_file_policy, update_baremetal_policy and update_mssql_policy can also cancel delayed changes, without this tool, when the new policy no longer asks for them (listed in their cancelled_actions).

Paramètres

NomTypeObligatoireDescription
pending_action_idstring (uuid)ouiId of the pending action.

start_restore​

Start a restore. Portée operate. Lecture seule : non. Destructif : oui.

Restores files of a restore point (list_snapshots) to an agent of the same client. By default: to a new folder on the target (directory mode, the default folder of the OS), without overwriting existing files. paths are paths of the backup: given by the user, or found with search_snapshot (a file named without its folder) or browse_snapshot, then confirmed with the user. ["/"] restores the whole snapshot. original mode writes the files back to their place and needs to be asked for explicitly, as overwriting (if_changed). A target of another client is refused: use the portal for that. The answer gives where each path is written on the target. Follow the restore with get_restore_session.

Paramètres

NomTypeObligatoireDescription
source_endpoint_idstring (uuid)ouiId of the agent endpoint that made the backup.
snapshot_idstringouiId of the restore point (list_snapshots)
pathsarray of stringnonPaths of the backup to restore, as given by the user or found with search_snapshot. Default: ["/"], the whole snapshot. Défaut : ["/"]. Éléments : 1 à 1000.
target_endpoint_idstring (uuid)nonId of the agent endpoint that restores; default the source.
mode"directory" | "original"nondirectory (default): into a folder. original: back to the original place. Défaut : "directory".
target_directorystringnondirectory mode: the folder on the target. Default: the restore folder of the OS with the date. Longueur : 2 à 4096.
overwrite"never" | "if_changed"nonnever (default): an existing file is not touched. if_changed: a file with another size or date is replaced. Défaut : "never".

cancel_restore​

Cancel a restore. Portée operate. Lecture seule : non. Destructif : non.

Cancels a restore (files or SQL Server) started from the portal or the MCP. A pending one ends at once; a running one when the agent answers. A SQL Server database already restored stays.

Paramètres

NomTypeObligatoireDescription
restore_session_idstring (uuid)ouiId of the restore session.

preview_m365_restore​

Preview an M365 restore. Portée operate. Lecture seule : non. Destructif : non.

First step of a OneDrive / SharePoint restore: counts the files and folders and the bytes of a selection at a point in time, and gives a confirmation_token (single use, valid 10 minutes, for this exact selection) that start_m365_restore needs. Nothing is restored. The files go to a new restoration folder of the original drive: through MCP a restore never writes in place and never overwrites a file (that is done in the BaaStide portal). Restoration must be turned on for the tenant in the portal. Show the counts to the user and ask for the confirmation before start_m365_restore.

Paramètres

NomTypeObligatoireDescription
endpoint_idstring (uuid)ouiId of the M365 endpoint.
resource_idstring (uuid)ouiId of the BaaStide resource: the user of the OneDrive, or the SharePoint document library.
workload"onedrive" | "sharepoint"ouionedrive for a user's OneDrive, sharepoint for a document library.
atstring (date-time)ouiPoint in time of the backup to restore from (ISO 8601, UTC)
item_idsarray of stringnonMicrosoft ids of the files and folders to restore (a folder brings everything below it). Leave out to restore the whole resource. Éléments : 1 à 1000.

start_m365_restore​

Start an M365 restore. Portée operate. Lecture seule : non. Destructif : oui.

Starts a OneDrive / SharePoint restore previewed with preview_m365_restore and confirmed by the user: the same selection, and its confirmation_token (single use; expired after 10 minutes or for another selection: preview again). The files go to a new restoration folder of the original drive; the original files do not change. Follow it with get_m365_restore.

Paramètres

NomTypeObligatoireDescription
endpoint_idstring (uuid)ouiId of the M365 endpoint.
resource_idstring (uuid)ouiId of the BaaStide resource: the user of the OneDrive, or the SharePoint document library.
workload"onedrive" | "sharepoint"ouionedrive for a user's OneDrive, sharepoint for a document library.
atstring (date-time)ouiPoint in time of the backup to restore from (ISO 8601, UTC)
item_idsarray of stringnonMicrosoft ids of the files and folders to restore (a folder brings everything below it). Leave out to restore the whole resource. Éléments : 1 à 1000.
confirmation_tokenstringouiconfirmation_token of preview_m365_restore for this selection. Longueur : 1 à 128.
tenant_domain_confirmationstringnonThe tenant domain as typed by the user, when the preview gave confirmation_reasons. Never fill it in yourself. Longueur : 1 à 255.

cancel_m365_restore​

Cancel an M365 restore. Portée operate. Lecture seule : non. Destructif : non.

Cancels an open OneDrive / SharePoint restore: no new file is written; the files already restored stay.

Paramètres

NomTypeObligatoireDescription
endpoint_idstring (uuid)ouiId of the M365 endpoint.
restore_idstring (uuid)ouiId of the restore.

start_pst_export​

Start a PST export. Portée operate. Lecture seule : non. Destructif : non.

Starts a PST export of one or more whole mailboxes of an M365 tenant (an endpoint of type m365): the mail, the calendars or both, as they were at a point in time of the backup (default: now). One export per mailbox; the answer gives the id of each. A PST export has known gaps: no read state, flag or category, items are not the original MIME, a recurring event is its series only (no moved or cancelled occurrence). Tell the user and set accept_gaps only after the user agreed. When an export is ready, the user gets an email with the link to it; it can be downloaded for 7 days. Follow it with get_m365_export. The file is downloaded in the BaaStide portal only, by a person who logs in: give the user portal_url.

Paramètres

NomTypeObligatoireDescription
endpoint_idstring (uuid)ouiId of the M365 endpoint.
resource_idsarray of string (uuid)ouiIds of the BaaStide resources of the mailboxes (users or shared mailboxes), 1 to 10. Each mailbox is exported whole. Éléments : 1 à 10.
contentarray of "mail" | "calendar"nonWhat goes in the PST: mail, calendar or both. Défaut : ["mail"]. Éléments : 1 à 2.
atstring (date-time)nonPoint in time of the backup to export (ISO 8601, UTC). Leave out for the latest backup.
accept_gapstrueouiThe user agreed to the known gaps of a PST export (see the description). Never set it without asking.

update_mssql_policy​

Change the SQL Server policy. Portée operate. Lecture seule : non. Destructif : oui.

Creates or changes the SQL Server backup policy of a Windows agent endpoint (full backups of the databases of one instance). Give only the fields to change; a field not given keeps its target value (the current value, or the value of a delayed change still open). databases: all (every user database online at the time of the backup, new ones join alone, less exclude; include_system adds master, model and msdb) or a list of names. Without a SQL Server policy, instance, schedules, timezone, enabled and retention are required to create one (databases default all). With several SQL Server policies on the machine, give policy_id. Immediate: added databases, schedules, timezone, window_minutes, first_backup_window, a longer retention, enabled=true. Delayed 72 hours (destructive, delayed_changes, cancellable with cancel_pending_action): removed databases (also a new exclusion, include_system off, a list in place of all, another instance), a shorter retention, enabled=false. Until then the old value stays in force. The SQL Server connection (login, password) is never set here: it is set in the BaaStide portal.

Paramètres

NomTypeObligatoireDescription
endpoint_idstring (uuid)ouiId of the Windows agent endpoint.
policy_idstring (uuid)nonId of the SQL Server policy, when the machine has several.
namestringnonName of the policy. Longueur : 1 à 100.
instancestringnonMSSQLSERVER for the default instance, else the instance name.
databases"all" | array of stringnonall, or the list of the databases to back up.
excludearray of stringnonWith all only: databases not backed up. Éléments maximum : 1000.
include_systembooleannonWith all only: also master, model and msdb.
schedulesarray of anynonThe whole new list of schedules. Éléments : 1 à 20.
timezonestringnonIANA timezone, for example Europe/Paris or UTC; service validates the name. Longueur : 1 à 255.
enabledbooleannonOff: the scheduler creates no run. A manual run still works. Turning it off takes effect 72 h later [B1].
window_minutesanynonWindow of the runs, minutes after the planned time (1 to 1439), or max
first_backup_windowanynon
retentionanynon

preview_mssql_restore​

Preview a SQL Server restore. Portée operate. Lecture seule : non. Destructif : non.

First step of a SQL Server restore: checks the restore of databases of a restore point under NEW names on an instance of the source machine or of another machine of the same client, and gives a confirmation_token (single use, valid 10 minutes, for this exact choice) that start_mssql_restore needs. Nothing is restored. The answer gives each database with its size, the space it takes, the new name (proposed when not given) and the SQL Server version check. A name that exists on the target instance is refused. Through MCP a restore never overwrites a database, never restores a system database, and never changes the SQL Server connection: an overwrite is done in the BaaStide portal. Show the databases and names to the user and ask for the confirmation before start_mssql_restore.

Paramètres

NomTypeObligatoireDescription
source_endpoint_idstring (uuid)ouiId of the agent endpoint that made the backup.
snapshot_idstringouiId of the SQL Server restore point (list_snapshots, backup_kind mssql)
target_endpoint_idstring (uuid)nonId of the agent endpoint that restores, of the same client; default the source.
checkdbbooleannonRun DBCC CHECKDB on each new database after the restore. Défaut : false.
instancestringnonInstance of the target machine. Default: the instance of the restore point.
databasesarray of objectouiThe databases to restore. Without target_database, the server proposes a free name. Éléments : 1 à 100.
databases[].database_namestringouiDatabase of the restore point (list_snapshot_databases); not a system database. Longueur : 1 à 128.
databases[].target_databaseanynonNew database name; it must not exist on the target instance.

start_mssql_restore​

Start a SQL Server restore. Portée operate. Lecture seule : non. Destructif : oui.

Starts a SQL Server restore previewed with preview_mssql_restore and confirmed by the user: the request of the preview, and its confirmation_token (single use; expired after 10 minutes or for another choice: preview again). Each database is restored under its new name; the existing databases do not change. Follow it with get_restore_session (result per database).

Paramètres

NomTypeObligatoireDescription
source_endpoint_idstring (uuid)ouiId of the agent endpoint that made the backup.
snapshot_idstringouiId of the SQL Server restore point (list_snapshots, backup_kind mssql)
target_endpoint_idstring (uuid)nonId of the agent endpoint that restores, of the same client; default the source.
checkdbbooleannonRun DBCC CHECKDB on each new database after the restore. Défaut : false.
instancestringouiInstance of the target machine, as in the request of the preview.
databasesarray of objectouiThe databases and their new names, as in the request of the preview. Éléments : 1 à 100.
databases[].database_namestringouiDatabase of the restore point (list_snapshot_databases); not a system database. Longueur : 1 à 128.
databases[].target_databaseanyouiNew database name; it must not exist on the target instance.
confirmation_tokenstringouiconfirmation_token of preview_mssql_restore for this request. Longueur : 1 à 128.

update_vm_policy​

Change the VM selection. Portée operate. Lecture seule : non. Destructif : oui.

Ticks or unticks guests in the VM policies of a host: the VMs of the Hyper-V policies of a Hyper-V host, or the VMs and containers of the Proxmox policies of a Proxmox VE node. A policy backs up every protectable guest of the host except the unticked ones; a new guest is ticked by default. All the vm_key of one call are of this host. Same rule as update_file_policy: ticking (include) applies at once; unticking (exclude) reduces the protection, so it waits 72 hours and can be cancelled with cancel_pending_action (delayed_changes). Until then the guest is still backed up. Ticking again a guest whose unticking waits cancels that delayed change (cancelled_actions). The policy is created in the BaaStide portal; this tool changes only its selection.

Paramètres

NomTypeObligatoireDescription
endpoint_idstring (uuid)ouiId of the Hyper-V host or Proxmox node (agent endpoint)
excludearray of anynonGuests to untick (no backup any more, after 72 hours) Défaut : []. Éléments maximum : 100.
includearray of anynonGuests to tick again (backed up from the next run) Défaut : []. Éléments maximum : 100.

update_hyperv_policy​

Change the Hyper-V VM selection. Portée operate. Lecture seule : non. Destructif : oui.

Ticks or unticks Hyper-V VMs in the Hyper-V policies of a host: update_vm_policy for Hyper-V only, prefer update_vm_policy. Same rule as update_file_policy: ticking (include) applies at once; unticking (exclude) reduces the protection, so it waits 72 hours and can be cancelled with cancel_pending_action (delayed_changes). Until then the guest is still backed up. Ticking again a guest whose unticking waits cancels that delayed change (cancelled_actions). The policy is created in the BaaStide portal; this tool changes only its selection.

Paramètres

NomTypeObligatoireDescription
endpoint_idstring (uuid)ouiId of the Hyper-V host (agent endpoint)
excludearray of anynonGuests to untick (no backup any more, after 72 hours) Défaut : []. Éléments maximum : 100.
includearray of anynonGuests to tick again (backed up from the next run) Défaut : []. Éléments maximum : 100.

preview_vm_restore​

Preview a VM restore. Portée operate. Lecture seule : non. Destructif : non.

First step of the restore of a Hyper-V VM, or of a Proxmox VM or container: checks the target host (hypervisor, version, agent online) and gives the totals (bytes of the disks, free space of the target volume or storage), the virtual TPM of a Hyper-V VM after the restore (tpm: preserved, the VM starts with its TPM and BitLocker does not ask for its recovery key; empty, a new TPM and BitLocker asks for it; null, no TPM or Proxmox; tpm_reason says why) and the warnings, with a confirmation_token (single use, valid 10 minutes, for this exact request) that start_vm_restore needs. Nothing is restored. Through MCP a restore always makes a NEW VM or container, with a new ID, on the source host or another host of the same client; the guest of the restore point is never changed. Replacing a guest by its restore point is done in the BaaStide portal only, by a person: never offer it here. A Proxmox VM with a TPM is restored in the portal only, by a person who has the BitLocker recovery key (tpm_restore_portal_only). A Proxmox storage that the target node does not have is refused (target_storage_invalid). ct_static_ip_source_running: the container has a fixed IP address and the source runs, keep start false. Show the totals and the warnings to the user and ask for the confirmation before start_vm_restore.

Paramètres

NomTypeObligatoireDescription
source_endpoint_idstring (uuid)ouiId of the Hyper-V host or Proxmox node that made the backup.
snapshot_idstringouiRestore point of the VM or container (list_vm_snapshots)
target_endpoint_idstring (uuid)nonId of the Host of the same client and the same hypervisor that restores; default the source host (list_vm_restore_targets)
namestringnonName of the new VM or container. Default: <name>-restore-<YYYYMMDD> Longueur : 1 à 100.
target_pathstringnonHyper-V only. Folder of the new VM on a local volume of the target, such as D:\VMs. Default: the default folder of the disks of the host. Longueur : 4 à 4096.
switchstring | nullnonHyper-V only. Virtual switch of the target host for the network cards. Null: not connected. Default: the switch of the source if the target has it.
target_storagestringnonProxmox only. Storage of the node for the new disks, from proxmox.node.storages of get_endpoint: content images (VM) or rootdir (container). Default: the source storage of each disk.
target_format"raw" | "qcow2"nonProxmox VM only. Default: qcow2 on a dir storage, raw elsewhere.
bridgestring | nullnonProxmox only. Bridge of the node for the network cards. Null: cards with link_down=1. Default: the bridge of the source if the node has it.
keep_macsbooleannonKeep the MAC addresses of the source. Only when the user asks: with the source running on the same network, the addresses conflict. Défaut : false.
startbooleannonStart the new VM or container after the restore. Default: not started. Défaut : false.

start_vm_restore​

Start a VM restore. Portée operate. Lecture seule : non. Destructif : oui.

Starts the restore of a Hyper-V VM, or of a Proxmox VM or container, as a new one, previewed with preview_vm_restore and confirmed by the user: the same request, and its confirmation_token (single use; expired after 10 minutes or for another request: preview again). The guest of the restore point does not change. The new guest is not started unless start is true. Follow it with get_restore_session.

Paramètres

NomTypeObligatoireDescription
source_endpoint_idstring (uuid)ouiId of the Hyper-V host or Proxmox node that made the backup.
snapshot_idstringouiRestore point of the VM or container (list_vm_snapshots)
target_endpoint_idstring (uuid)nonId of the Host of the same client and the same hypervisor that restores; default the source host (list_vm_restore_targets)
namestringnonName of the new VM or container. Default: <name>-restore-<YYYYMMDD> Longueur : 1 à 100.
target_pathstringnonHyper-V only. Folder of the new VM on a local volume of the target, such as D:\VMs. Default: the default folder of the disks of the host. Longueur : 4 à 4096.
switchstring | nullnonHyper-V only. Virtual switch of the target host for the network cards. Null: not connected. Default: the switch of the source if the target has it.
target_storagestringnonProxmox only. Storage of the node for the new disks, from proxmox.node.storages of get_endpoint: content images (VM) or rootdir (container). Default: the source storage of each disk.
target_format"raw" | "qcow2"nonProxmox VM only. Default: qcow2 on a dir storage, raw elsewhere.
bridgestring | nullnonProxmox only. Bridge of the node for the network cards. Null: cards with link_down=1. Default: the bridge of the source if the node has it.
keep_macsbooleannonKeep the MAC addresses of the source. Only when the user asks: with the source running on the same network, the addresses conflict. Défaut : false.
startbooleannonStart the new VM or container after the restore. Default: not started. Défaut : false.
confirmation_tokenstringouiconfirmation_token of preview_vm_restore for this request. Longueur : 1 à 128.

cancel_vm_restore​

Cancel a VM restore. Portée operate. Lecture seule : non. Destructif : non.

Cancels an open restore of a Hyper-V VM, or of a Proxmox VM or container. A pending one ends at once; a running one when the agent answers, and the agent removes the new guest and its disks.

Paramètres

NomTypeObligatoireDescription
restore_session_idstring (uuid)ouiId of the restore session of the VM restore.