Every Tintri VMstore ships with a REST API that can do almost everything the UI does, and most vSphere teams only ever use it for one dashboard. The reasons are always the same: the login is not the vCenter login, the session is a cookie rather than a token header, every update needs a typeId nobody remembers, and the VM the VMstore calls …-VIM-0000000000000024 has to be matched to a vCenter MoRef before anyone trusts an automated action against it. This guide fixes that. It walks the API in the order you actually use it, from login to appliance health, datastore and VM statistics, snapshots, per-VM QoS, SyncVM and clones, replication and alerts, and shows how to tie each VMstore VM to its vCenter identity through the vSphere Automation API. Every call is shown as raw HTTP, curl and PowerShell, and the whole thing is packaged as a Postman collection you can run with newman as a smoke test.
Level: intermediate to advanced · Stack: Tintri VMstore (TxOS 6.0.x, REST API v310.207), vSphere 8 / VCF 9 vCenter (Automation API 9.x), Postman, newman 6.x, PowerShell 7, curl, Python 3 · Build time: about 60 minutes to a green newman run
Contents
- Scope, versions and what was checked
- Architecture: who calls whom
- API basics: versions, roles, paging, typeId
- Authentication and the session lifecycle
- Discover: appliance, controllers, datastore, vCenter registration
- VMs and statistics
- Mapping a VMstore VM to its vCenter identity
- Snapshots: create, list, delete
- Per-VM QoS by API
- SyncVM, clones and task polling
- Replication and alerts
- Packet flow: the network under the API
- The Postman collection and newman
- End-to-end workflow
- API reference table
- Error shapes and what they mean
- Troubleshooting
- What’s next
01. Scope, versions and what was checked
This is the API companion to part 3 of the VMware, Tintri and Cisco series, which covers the design side: networks, vCenter registration, mounts, VAAI, QoS and protection policy. Here the same objects are driven by API. The vCenter side of a deployment (datacenter, cluster, hosts, vLCM image, the NFS mount gap in the REST API) is in the vSphere Automation REST API deploy guide, and fleet scope through Tintri Global Center is in the TGC API guide.
Checked against: the public Tintri REST API reference published on GitHub at tintri.github.io/tintri-rest-api, documentation version v310.207, which maps to TxOS 6.0.3 (the repository was last updated in October 2026), cross-checked against the DTO reference and the example scripts in the public Tintri/tintri-api-examples and Tintri/tintri-python-sdk repositories. The vCenter calls were checked against the vSphere Automation API reference on developer.broadcom.com at /latest/, which is vSphere Automation API 9.1.2 as of December 2026; every call used here is also in the 9.0 reference. Nothing newer than v310 exists as an API family: Tintri versions the API as v310.<minor>, and the paths stay under /api/v310/.
| API version | TxOS | TGC | What it added that this guide uses |
|---|---|---|---|
| v310.101 | 4.6.0.x | 5.0.0 | The floor: from TxOS and TGC 5.6.0.1 onward, versions below v310.101 are deprecated |
| v310.171 | 5.4.2 | 5.5.x | GET /datastore/{uuid}/hypervisorManagerConfig/{managerId}?refresh= |
| v310.183 | 5.5.2.x | 5.5.4.x | Snapshot lock and unlock, data protection config |
| v310.191 | 5.6.0 | 5.6.0 | GET /alert/paginated, IPv6 (needs fullApiVersion v310.191 or later at login), TLS 1.2 only from 5.6.0.1 |
| v310.201 / .203 / .205 | 6.0.0 / 6.0.1 / 6.0.2 | same | No new endpoints listed publicly |
| v310.207 | 6.0.3 | n/a | PUT /servicegroup/{id}/mountIp |
Where a field or behaviour could not be confirmed from those public sources, the text says “check against the API reference for your TxOS version”. If you run TxOS older than 5.6, everything here works except the calls marked v310.191 and later in the reference table; the version matrix above tells you which to drop.
02. Architecture: who calls whom
Three things talk HTTPS in this design, and it is worth being precise about which, because firewall tickets and certificate trust both follow from it. Your workstation or CI runner calls the VMstore admin IP and vCenter. The VMstore itself calls vCenter, using the service account you registered on it, to resolve files into VMs and to request vSphere snapshots for VM-consistent protection. The API never touches the data network: NFS stays on the storage VLAN between the ESXi VMkernel port and the VMstore data IP.
- VMstore REST API:
https://<admin FQDN>/api/v310/...on the admin interface. Tintri’s reference states that all requests must use SSL, and that a request to port 80 is converted to 443. - vCenter Automation API:
https://<vcenter>/api/.... Used here for the session and for VM identity. - One VMstore, one datastore: a VMstore presents a single datastore, and the API accepts the literal
defaultas both the appliance and the datastore identifier. Every path below uses it. - Service accounts: one VMstore account for automation (role decided in section 03) and one vCenter account with read access for the identity lookup. Keep them separate from the account the VMstore uses to talk to vCenter.
03. API basics: versions, roles, paging, typeId
Discover what the box speaks
GET /api/info needs no authentication and returns a RestApi object: productName, preferredVersion and supportedVersionSet. Call it first in every script. It tells you the VMstore is reachable, the certificate chain works, and which versions it accepts.
GET /api/info HTTP/1.1
Host: vmstore01.lab.local
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
{
"typeId": "com.tintri.api.rest.v.dto.domain.RestApi",
"productName": "Tintri VMstore",
"preferredVersion": "v310.207",
"supportedVersionSet": ["v310.207", "..."]
}
The response above is trimmed and illustrative; the exact strings in productName and supportedVersionSet depend on the build, so print them once on yours rather than parsing them blindly.
fullApiVersion decides the behaviour you get
The login body carries an optional fullApiVersion. Tintri’s reference is explicit that if you leave it out, the server uses v310.1. That is the oldest behaviour the API has. Send the version your TxOS supports (v310.207 for 6.0.3) so you get current semantics, IPv6 support and current response shapes. Treat it like a pinned dependency: change it when you upgrade TxOS, test, then commit.
Roles: give automation the least it needs
| Role | Read | Write | User mgmt | Lock snapshot | Use it for |
|---|---|---|---|---|---|
| Read Only | Yes | No | No | No | Monitoring, reports, the Discover/Verify/Troubleshoot folders, newman smoke tests |
| System Admin | Yes | Yes | No | No | Automation that takes snapshots, sets QoS, clones |
| Data Protection Admin | Yes | Yes | No | Yes | Pipelines that manage locked snapshots and protection policy |
| Admin | Yes | Yes | Yes | No | People, not scripts |
The table is from the RBAC section of Tintri’s REST reference (DBA and Data Protection Escalation Admin are also listed there). A Read Only account can call every GET; that is all the smoke test needs. Give the write-capable account to the pipeline, not to every engineer’s Postman.
Paging, filters and the two update envelopes
- Paging. List calls return a
Page:items,filteredTotal,total,absoluteTotal,limit(default 2000),offset,page,pageTotal, andnext/prevas ready-made query strings. Loop onnext, as Tintri’s ownget_vms_paged.pydoes, rather than computing offsets yourself. - Filters. Query parameters follow RFC 6570, for example
/v310/vm?name=app01&live=TRUEor/v310/snapshot?vmUuid=<uuid>&type=USER_GENERATED_SNAPSHOT. Each list call documents its filter spec (VirtualMachineFilterSpec,SnapshotFilterSpec,AlertFilterSpec). - typeId. Every JSON object you send carries a
typeIdnaming its DTO class. Missing or wrong typeIds are the most common cause of a 400. - Request (
com.tintri.api.rest.v310.dto.Request) updates named properties on one or more objects:objectsWithNewValuespluspropertiesToBeUpdated. Only the listed properties change. - MultipleSelectionRequest (
com.tintri.api.rest.v310.dto.MultipleSelectionRequest) applies onenewValueto many IDs:ids,newValue,propertyNames. This is the bulk form, for example QoS on fifty VMs in one call.
04. Authentication and the session lifecycle
Log in
A VMstore login is a POST of a RestApiCredentials object. The response body is the role name as a string, and the session is the JSESSIONID cookie. Every later call sends that cookie. There is no bearer token.
POST /api/v310/session/login HTTP/1.1
Host: vmstore01.lab.local
Content-Type: application/json
Accept: application/json
{
"typeId": "com.tintri.api.rest.vcommon.dto.rbac.RestApiCredentials",
"username": "svc-vmstore-api",
"password": "<from your vault>",
"fullApiVersion": "v310.207"
}
HTTP/1.1 200 OK
Set-Cookie: JSESSIONID=<opaque>; Path=/api; Secure; HttpOnly
Content-Type: application/json
"SYSTEM_ADMIN"
The body string shown is illustrative; it is the role name of the account. Cookie attributes vary by build. What matters is that you capture JSESSIONID and send it back.
curl
#!/usr/bin/env bash
# vmstore-session.sh: log in, show the session, log out. Needs curl and jq.
# Secrets: TINTRI_USER, TINTRI_PASSWORD. Optional: TINTRI_CA (PEM bundle that signs the VMstore cert).
set -euo pipefail
VMSTORE="${VMSTORE:-vmstore01.lab.local}"
API_VERSION="${API_VERSION:-v310.207}"
JAR=$(mktemp); trap 'rm -f "$JAR"' EXIT
CURL=(curl -sS --fail-with-body --max-time 60 -b "$JAR" -c "$JAR" -H 'Accept: application/json')
[ -n "${TINTRI_CA:-}" ] && CURL+=(--cacert "$TINTRI_CA")
"${CURL[@]}" "https://$VMSTORE/api/info" | jq '{productName, preferredVersion}'
jq -n --arg u "$TINTRI_USER" --arg p "$TINTRI_PASSWORD" --arg v "$API_VERSION" \
'{typeId:"com.tintri.api.rest.vcommon.dto.rbac.RestApiCredentials", username:$u, password:$p, fullApiVersion:$v}' |
"${CURL[@]}" -H 'Content-Type: application/json' -X POST --data @- \
"https://$VMSTORE/api/v310/session/login"; echo
"${CURL[@]}" "https://$VMSTORE/api/v310/session/current" | jq '{userName, roles, loginTime, expirationTime}'
"${CURL[@]}" -X POST "https://$VMSTORE/api/v310/session/logout" -o /dev/null -w 'logout HTTP %{http_code}\n'
PowerShell 7
# Connect-VMstore.ps1: returns a WebRequestSession holding JSESSIONID. PowerShell 7.2+.
# Secrets come from the environment: TINTRI_USER, TINTRI_PASSWORD.
param(
[string]$VMstore = 'vmstore01.lab.local',
[string]$ApiVersion = 'v310.207'
)
$ErrorActionPreference = 'Stop'
$base = "https://$VMstore/api"
$info = Invoke-RestMethod -Uri "$base/info" -Method Get
Write-Host "API: $($info.productName) preferred $($info.preferredVersion)"
$body = @{
typeId = 'com.tintri.api.rest.vcommon.dto.rbac.RestApiCredentials'
username = $env:TINTRI_USER
password = $env:TINTRI_PASSWORD
fullApiVersion = $ApiVersion
} | ConvertTo-Json
$role = Invoke-RestMethod -Uri "$base/v310/session/login" -Method Post -Body $body `
-ContentType 'application/json' -SessionVariable tintri
Write-Host "Logged in as $env:TINTRI_USER, role $role"
$cur = Invoke-RestMethod -Uri "$base/v310/session/current" -WebSession $tintri
Write-Host "Session expires $($cur.expirationTime)"
# ... your calls here, always with -WebSession $tintri ...
Invoke-RestMethod -Uri "$base/v310/session/logout" -Method Post -WebSession $tintri | Out-Null
If the VMstore certificate is not signed by a CA your machine trusts, fix the trust (import the issuing CA) rather than adding -SkipCertificateCheck to production scripts. In a lab, -SkipCertificateCheck on each Invoke-RestMethod is the PowerShell 7 equivalent of curl -k.
Session lifetime, inspection and logout
- How long it lives. The public reference does not state a fixed timeout.
GET /v310/session/current(since v310.51) returns yourUserSessionwithloginTime,lastAccessedTimeandexpirationTime; read the expiry from there and log in again on the first 401 rather than guessing. - Who else is logged in.
GET /v310/session/active(since v310.51) lists sessions withuserName,clientIpandclientType. An Admin can end one withPOST /v310/session/{tintriSessionId}/invalidate(since v310.71); theidthere is a Tintri session ID, not the JSESSIONID. - Log out with POST.
POST /v310/session/logoutis the current call and returns 204.GET /v310/session/logoutstill exists but is marked deprecated in v310.207. Older scripts, including some public examples, use the GET; change them. - Always log out. Scripts that log in every five minutes and never log out leave a trail of idle sessions in
session/active, and that is where you will look first when someone asks why the API “feels slow”.
The vCenter side
vCenter uses a token, not a cookie. POST /api/session with HTTP Basic credentials returns the token as a JSON string; send it as the vmware-api-session-id header and end it with DELETE /api/session (204). If you have old scripts on /rest/com/vmware/cis/session, that is the legacy path: the replacement is /api/session, and post 21 covers the rest of the migration.
# curl: vCenter session, VM lookup, logout. Secrets: VC_USER, VC_PASSWORD.
VC=vcenter01.lab.local
TOKEN=$(curl -sS --fail-with-body -X POST -u "$VC_USER:$VC_PASSWORD" "https://$VC/api/session" | jq -r .)
curl -sS -H "vmware-api-session-id: $TOKEN" "https://$VC/api/vcenter/vm?names=app01" | jq .
curl -sS -X DELETE -H "vmware-api-session-id: $TOKEN" "https://$VC/api/session" -o /dev/null -w '%{http_code}\n'
05. Discover: appliance, controllers, datastore, vCenter registration
These are the read-only calls that answer “is this VMstore healthy and wired to the right vCenter” before you change anything. All of them work with a Read Only account.
| Call | What to look at | Bad looks like |
|---|---|---|
GET /v310/appliance/default/info | modelName, osVersion, isAllFlash, currentCapacityGiB | TxOS version differs from what your interop sheet says |
GET /v310/appliance/default/operationalStatus | isFilesystemUp, urgentMessage, alertsUnreadCount, restartFlag, uptime | isFilesystemUp: false; any urgentMessage; restartFlag other than NO_RESTART_REQUIRED |
GET /v310/appliance/default/controller | one role: ACTIVE, one STANDBY, same osVersion | A controller in UNAVAILABLE or REMOVED (UNAVAILABLE exists since v310.121) |
GET /v310/appliance/default/failedComponents | empty | Any entry: a hardware case |
GET /v310/datastore/default/hypervisorManagerConfig | entries with hypervisorType: VMWARE, host, username | No VMware entry: VM names, VM-consistent snapshots and clones into vCenter will not work |
GET /v310/datastore/default/statsSummary | spaceUsedPhysicalGiB, spaceTotalGiB, spaceRemainingDays, latencyTotalMs, operationsTotalIops, vmsCount | spaceRemainingDays below your procurement lead time |
GET /api/v310/appliance/default/operationalStatus HTTP/1.1
Host: vmstore01.lab.local
Cookie: JSESSIONID=<opaque>
Accept: application/json
HTTP/1.1 200 OK
{
"typeId": "com.tintri.api.rest.v310.dto.domain.beans.hardware.ApplianceOperationalInfo",
"isFilesystemUp": true,
"alertsUnreadCount": 3,
"restartFlag": "NO_RESTART_REQUIRED",
"uptime": "41 days 6 hours 12 minutes",
"urgentMessage": null,
"nfsTotalConnectionCount": 48
}
# PowerShell, continuing with $tintri and $base from Connect-VMstore.ps1
$op = Invoke-RestMethod "$base/v310/appliance/default/operationalStatus" -WebSession $tintri
$ctl = @(Invoke-RestMethod "$base/v310/appliance/default/controller" -WebSession $tintri)
$hv = @(Invoke-RestMethod "$base/v310/datastore/default/hypervisorManagerConfig" -WebSession $tintri)
$ds = Invoke-RestMethod "$base/v310/datastore/default/statsSummary" -WebSession $tintri
[pscustomobject]@{
FilesystemUp = $op.isFilesystemUp
Controllers = ($ctl | ForEach-Object { "$($_.locator)=$($_.role)" }) -join ', '
vCenters = ($hv | Where-Object hypervisorType -eq 'VMWARE' | ForEach-Object host) -join ', '
UsedGiB = [math]::Round($ds.spaceUsedPhysicalGiB, 0)
TotalGiB = [math]::Round($ds.spaceTotalGiB, 0)
DaysLeft = $ds.spaceRemainingDays
} | Format-List
Registering vCenter by API is possible with POST /v310/datastore/default/hypervisorManagerConfig (a list of HypervisorManagerConfig with hypervisorType, host, username and password; only the username and password can be edited afterwards, with PUT .../hypervisorManagerConfig/{managerConfigId}). I still do the first registration in the UI, because it is a one-off and the UI shows the certificate it is about to trust. Rotating the password is where the API earns its keep: put the PUT in the same pipeline that rotates the vCenter account. To check the registration without forcing a refresh, use GET .../hypervisorManagerConfig/{managerId}?refresh=false (since v310.171); refresh=true blocks until the VMstore has re-read vCenter, so do not put it in a tight loop.
06. VMs and statistics
GET /v310/vm returns a page of VirtualMachine objects. Each carries uuid.uuid (the Tintri VM UUID, the ID every other VM call takes), a vmware block with the hypervisor view, qosConfig, snapshot, replication, serviceGroup, and stat with the latest statistics slice. Filter by name and live=TRUE so deleted VMs, which the VMstore remembers for a while, do not match.
GET /api/v310/vm?name=app01&live=TRUE&limit=10 HTTP/1.1
Host: vmstore01.lab.local
Cookie: JSESSIONID=<opaque>
HTTP/1.1 200 OK
{
"typeId": "com.tintri.api.rest.v310.dto.Page",
"filteredTotal": 1, "total": 412, "limit": 10, "page": 1, "pageTotal": 1,
"items": [{
"typeId": "com.tintri.api.rest.v310.dto.domain.VirtualMachine",
"uuid": { "uuid": "A1D88A8A-8904-1E35-9DC2-589C317D31A6-VIM-0000000000000070" },
"isLive": true,
"provisionedType": "THIN",
"vmware": {
"name": "app01", "mor": "<hypervisor-assigned id>",
"instanceUuids": ["5003a1b2-...."], "biosUuid": "4203c4d5-....",
"vcenterName": "vcenter01.lab.local", "host": "esx02.lab.local", "isPowered": true
},
"qosConfig": { "minNormalizedIops": 0, "maxNormalizedIops": 0 },
"stat": { "sortedStats": [ { "latencyTotalMs": 1.4, "operationsTotalIops": 820 } ] }
}]
}
# curl, after the login in vmstore-session.sh (reuse "${CURL[@]}" and $VMSTORE)
"${CURL[@]}" "https://$VMSTORE/api/v310/vm?name=app01&live=TRUE" |
jq '.items[] | {uuid: .uuid.uuid, name: .vmware.name, mor: .vmware.mor,
instanceUuids: .vmware.instanceUuids, vcenter: .vmware.vcenterName}'
# every live VM, paging on .next
url="https://$VMSTORE/api/v310/vm?live=TRUE&limit=500"
while :; do
page=$("${CURL[@]}" "$url")
echo "$page" | jq -r '.items[] | [.uuid.uuid, .vmware.name] | @tsv'
next=$(echo "$page" | jq -r '.next // empty')
[ -z "$next" ] && break
url="https://$VMSTORE/api/v310/vm?$next"
done
Which statistics call
| Call | Returns | Use it for |
|---|---|---|
GET /v310/vm (field stat) | Latest slice per VM, in the list | Fleet-wide top-N tables in one call |
GET /v310/vm/{vmId}/statsRealtime | Real-time slices for one VM (VMstore only) | Watching one VM during an incident |
GET /v310/vm/{vmId}/statsHistoric | Historic slices for one VM, filterable by time | Before/after comparisons, change reviews |
GET /v310/datastore/default/statsRealtime, statsHistoric, statsSummary | The same for the whole VMstore | Capacity and headroom |
Stats arrive as a Stats object whose sortedStats collection is, per the DTO description, sorted from start time to end time, so the last element is the newest. The latency split you care about is on each slice: latencyHostMs, latencyNetworkMs, latencyStorageMs, latencyContentionMs (QoS contention), latencyThrottleMs (QoS throttling), and latencyTotalMs. Part 5 of the series explains how to read the split during an incident; the per-VM latency post has the full PowerShell and Python reporter, so I will not repeat it here.
07. Mapping a VMstore VM to its vCenter identity
Before any automation changes a VM it found on the VMstore, it should prove that VM is the one vCenter thinks it is. Names are not identities: two clusters can each have an app01, a VM can be renamed in vCenter between two polls, and a restored or cloned VM can carry the same name as the original. The VMstore gives you three hypervisor-side identifiers in the vmware block of every VM, and vCenter gives you the matching ones.
| VMstore field (VirtualMachineVmwareInfo) | Tintri description | vCenter equivalent | How to use it |
|---|---|---|---|
vmware.mor | The hypervisor assigned ID of the VM | vm in GET /api/vcenter/vm (the MoRef value, for example vm-1042) | Direct lookup key: GET /api/vcenter/vm/{vm}. Unique per vCenter only |
vmware.instanceUuids (list) | The list of UUIDs assigned to the VM by the owning hypervisor | identity.instance_uuid in GET /api/vcenter/vm/{vm} | The proof: must match before you act |
vmware.biosUuid | BIOS UUID as reported by the hypervisor | identity.bios_uuid | Secondary check; clones can share it |
vmware.vcenterName | The hypervisor manager name | The vCenter you are logged in to | Pick the right vCenter when the VMstore serves several |
identity on GET /api/vcenter/vm/{vm} has been in the Automation API since vSphere API 6.7.1, so it is there on every vSphere 8 and 9 vCenter. The list call GET /api/vcenter/vm filters by names, hosts, clusters, datastores, folders, power_states and returns vm, name, power_state, cpu_count, memory_size_mib; it refuses to return more than 4000 VMs (HTTP 500 above that), so filter by cluster on big vCenters. The exact string format of vmware.mor on your TxOS build is the one thing to check before you trust the join: dump one VM and compare it with the vm value vCenter returns for the same machine.
<#
.SYNOPSIS
Get-VMstoreVmMap.ps1: map every live VM on a Tintri VMstore to its vCenter identity and flag mismatches.
.NOTES
PowerShell 7.2+. Read-only on both sides. Secrets from the environment:
TINTRI_USER, TINTRI_PASSWORD, VC_USER, VC_PASSWORD.
Output: vmstore-vm-map-<UTC>.csv in the current directory.
#>
param(
[string]$VMstore = '<VMSTORE_FQDN>',
[string]$VCenter = '<VCENTER_FQDN>',
[string]$ApiVersion = 'v310.207',
[string]$ClusterId = '' # optional vCenter cluster id (domain-cNN) to stay under the 4000-VM list limit
)
$ErrorActionPreference = 'Stop'
$tb = "https://$VMstore/api"
$vb = "https://$VCenter/api"
# --- VMstore session (cookie)
$cred = @{ typeId = 'com.tintri.api.rest.vcommon.dto.rbac.RestApiCredentials'
username = $env:TINTRI_USER; password = $env:TINTRI_PASSWORD; fullApiVersion = $ApiVersion } | ConvertTo-Json
Invoke-RestMethod "$tb/v310/session/login" -Method Post -Body $cred -ContentType 'application/json' -SessionVariable ts | Out-Null
# --- vCenter session (token header)
$pair = [Convert]::ToBase64String([Text.Encoding]::UTF8.GetBytes("$($env:VC_USER):$($env:VC_PASSWORD)"))
$token = Invoke-RestMethod "$vb/session" -Method Post -Headers @{ Authorization = "Basic $pair" }
$vh = @{ 'vmware-api-session-id' = $token }
try {
# all live VMs on the VMstore, following .next
$vms = [System.Collections.Generic.List[object]]::new()
$url = "$tb/v310/vm?live=TRUE&limit=500"
while ($url) {
$page = Invoke-RestMethod $url -WebSession $ts
$page.items | ForEach-Object { $vms.Add($_) }
$url = if ($page.next) { "$tb/v310/vm?$($page.next)" } else { $null }
}
# vCenter inventory once (ids and names)
$listUrl = if ($ClusterId) { "$vb/vcenter/vm?clusters=$ClusterId" } else { "$vb/vcenter/vm" }
$vcVms = Invoke-RestMethod $listUrl -Headers $vh
$byId = @{}; $vcVms | ForEach-Object { $byId[$_.vm] = $_ }
$byName = $vcVms | Group-Object name -AsHashTable -AsString
$rows = foreach ($v in $vms) {
$w = $v.vmware
# skip non-VMware objects and VMs managed by another vCenter (-VCenter must match the name the VMstore reports)
if (-not $w -or ($w.vcenterName -and $w.vcenterName -ne $VCenter)) { continue }
$status = 'NOT_IN_VCENTER'; $vcUuid = $null
if ($w.mor -and $byId.ContainsKey($w.mor)) {
$detail = Invoke-RestMethod "$vb/vcenter/vm/$($w.mor)" -Headers $vh
$vcUuid = $detail.identity.instance_uuid
$status = if (@($w.instanceUuids) -contains $vcUuid) { 'MATCH' } else { 'UUID_MISMATCH' }
} elseif ($byName -and $byName.ContainsKey($w.name)) {
$status = if (@($byName[$w.name]).Count -gt 1) { 'NAME_ONLY_DUPLICATE' } else { 'NAME_ONLY' }
}
[pscustomobject]@{
Name = $w.name
TintriUuid = $v.uuid.uuid
MoRef = $w.mor
VMstoreInstance = (@($w.instanceUuids) -join ';')
vCenterInstance = $vcUuid
Host = $w.host
Status = $status
}
}
$file = "vmstore-vm-map-$((Get-Date).ToUniversalTime().ToString('yyyyMMddTHHmmssZ')).csv"
$rows | Sort-Object Status, Name | Export-Csv $file -NoTypeInformation
$rows | Group-Object Status | Select-Object Name, Count | Format-Table -AutoSize
Write-Host "Wrote $file"
}
finally {
Invoke-RestMethod "$tb/v310/session/logout" -Method Post -WebSession $ts | Out-Null
Invoke-RestMethod "$vb/session" -Method Delete -Headers $vh | Out-Null
}
Expected output on a healthy estate is one line, MATCH with your VM count. Anything else is worth a look before you automate: UUID_MISMATCH usually means a VM was re-registered or restored and the VMstore has not refreshed its view yet, NAME_ONLY means the MoRef format or the vCenter differs, and NOT_IN_VCENTER is a VM the VMstore still sees files for that vCenter no longer has, which is the start of an orphan clean-up. Run it with a Read Only account on both sides.
08. Snapshots: create, list, delete
A manual VMstore snapshot is one POST with a list of SnapshotSpec objects, which means one call can snapshot many VMs. The response is a list of snapshot Tintri UUIDs (they contain -SST-), in the same order as the specs.
POST /api/v310/snapshot HTTP/1.1
Host: vmstore01.lab.local
Cookie: JSESSIONID=<opaque>
Content-Type: application/json
[
{
"typeId": "com.tintri.api.rest.v310.dto.domain.beans.snapshot.SnapshotSpec",
"consistency": "CRASH_CONSISTENT",
"retentionMinutes": 240,
"snapshotName": "pre-patch-2026-12",
"sourceVmTintriUUID": "A1D88A8A-8904-1E35-9DC2-589C317D31A6-VIM-0000000000000070"
}
]
HTTP/1.1 200 OK
["A1D88A8A-8904-1E35-9DC2-589C317D31A6-SST-0000000000000412"]
- consistency:
CRASH_CONSISTENTis a VMstore-only snapshot.VM_CONSISTENTmakes the VMstore ask vCenter for a vSphere snapshot first (through the registered service account), so it needs a working vCenter registration and it briefly stuns the VM.APP_CONSISTENTis documented as not used. - retentionMinutes and replicaRetentionMinutes: if set, must be
-1or greater than 59. The DTO says that without retention the snapshot has unlimited retention, and the POST description says manual snapshots need to be deleted explicitly. Treat API snapshots as yours to delete, and verify theexpirationTimethe VMstore reports on your build before relying on retention to clean up. - The ceiling: the SnapshotSpec reference warns that a VM can only have 128 snapshots, so manual snapshots eat into the room your schedules need. This is why the snapshot sprawl audit exists.
# List the user-generated snapshots of one VM, newest first (curl, logged-in "${CURL[@]}")
"${CURL[@]}" "https://$VMSTORE/api/v310/snapshot?vmUuid=$VM_UUID&type=USER_GENERATED_SNAPSHOT&sortedBy=createTime&sortOrder=DESC&limit=50" |
jq -r '.items[] | [.uuid.uuid, .description // "", .consistency, (.createTime|tostring), (.expirationTime|tostring)] | @tsv'
# One snapshot by Tintri UUID, then delete it
"${CURL[@]}" "https://$VMSTORE/api/v310/snapshot/$SNAP_UUID" | jq '{vmName, consistency, type, createTime, locked}'
"${CURL[@]}" -X DELETE "https://$VMSTORE/api/v310/snapshot/$SNAP_UUID"; echo
Snapshot time fields (createTime, expirationTime) are milliseconds since 1970 per the DTO. The sortedBy and sortOrder parameters are part of the common filter spec; check that createTime is accepted as a sort key on your build, and fall back to sorting client-side if not. Two deletion calls deserve care. DELETE /v310/snapshot/{tintriUuid} removes one snapshot. DELETE /v310/snapshot?vmUuid=<uuid> removes snapshots belonging to that VM, with vmUuid mandatory; never build that URL from a variable that might be empty. Locked snapshots (POST /v310/snapshot/{uuid}/lock and /unlock, since v310.183) need the Data Protection Admin role and are the right tool for ransomware-resistant restore points.
Python: the snapshot lifecycle in one script
#!/usr/bin/env python3
"""vmstore_snapshot.py: create, list and delete VMstore snapshots for one VM by name.
Env: TINTRI_USER, TINTRI_PASSWORD; optional TINTRI_CA (PEM bundle). Python 3.9+, requests.
Examples:
vmstore_snapshot.py --vmstore vmstore01.lab.local --vm app01 list
vmstore_snapshot.py --vmstore vmstore01.lab.local --vm app01 create --name pre-patch --minutes 240
vmstore_snapshot.py --vmstore vmstore01.lab.local --vm app01 delete --uuid <SNAPSHOT_UUID>
"""
import argparse, os, sys, requests
API_VERSION = "v310.207"
def main():
ap = argparse.ArgumentParser()
ap.add_argument("--vmstore", required=True)
ap.add_argument("--vm", required=True)
sub = ap.add_subparsers(dest="action", required=True)
sub.add_parser("list")
c = sub.add_parser("create"); c.add_argument("--name", required=True)
c.add_argument("--minutes", type=int, default=240)
c.add_argument("--consistency", choices=["CRASH_CONSISTENT", "VM_CONSISTENT"], default="CRASH_CONSISTENT")
d = sub.add_parser("delete"); d.add_argument("--uuid", required=True)
a = ap.parse_args()
base = f"https://{a.vmstore}/api/v310"
s = requests.Session()
s.verify = os.environ.get("TINTRI_CA", True)
s.headers.update({"Accept": "application/json"})
r = s.post(f"{base}/session/login", json={
"typeId": "com.tintri.api.rest.vcommon.dto.rbac.RestApiCredentials",
"username": os.environ["TINTRI_USER"], "password": os.environ["TINTRI_PASSWORD"],
"fullApiVersion": API_VERSION}, timeout=60)
r.raise_for_status() # JSESSIONID now lives in s.cookies
try:
r = s.get(f"{base}/vm", params={"name": a.vm, "live": "TRUE"}, timeout=60); r.raise_for_status()
hits = [v for v in r.json().get("items", []) if v.get("vmware", {}).get("name") == a.vm]
if len(hits) != 1:
sys.exit(f"expected exactly one live VM named {a.vm}, found {len(hits)}")
vm_uuid = hits[0]["uuid"]["uuid"]
if a.action == "list":
r = s.get(f"{base}/snapshot", params={"vmUuid": vm_uuid, "limit": 200}, timeout=60); r.raise_for_status()
for sn in r.json().get("items", []):
print(sn["uuid"]["uuid"], sn.get("type"), sn.get("consistency"),
sn.get("createTime"), sn.get("expirationTime"), sn.get("description", ""), sep="\t")
elif a.action == "create":
spec = [{"typeId": "com.tintri.api.rest.v310.dto.domain.beans.snapshot.SnapshotSpec",
"consistency": a.consistency, "retentionMinutes": a.minutes,
"snapshotName": a.name, "sourceVmTintriUUID": vm_uuid}]
r = s.post(f"{base}/snapshot", json=spec, timeout=300)
if r.status_code >= 400:
sys.exit(f"HTTP {r.status_code}: {r.text}")
print("created", r.json()[0])
else:
r = s.get(f"{base}/snapshot/{a.uuid}", timeout=60); r.raise_for_status()
if r.json().get("vmUuid", {}).get("uuid") != vm_uuid:
sys.exit("snapshot does not belong to this VM, refusing to delete")
r = s.delete(f"{base}/snapshot/{a.uuid}", timeout=120)
print(r.status_code, r.text)
finally:
s.post(f"{base}/session/logout", timeout=30)
if __name__ == "__main__":
main()
09. Per-VM QoS by API
QoS on a VMstore is per VM, in normalized IOPS (I/O normalized to 8 KB), with a minimum and a maximum; part 3 covers when to use either. The API has three calls worth knowing.
PUT /api/v310/vm/A1D88A8A-8904-1E35-9DC2-589C317D31A6-VIM-0000000000000070/qosConfig HTTP/1.1
Host: vmstore01.lab.local
Cookie: JSESSIONID=<opaque>
Content-Type: application/json
{
"typeId": "com.tintri.api.rest.v310.dto.Request",
"objectsWithNewValues": [{
"typeId": "com.tintri.api.rest.v310.dto.domain.beans.vm.VirtualMachineQoSConfig",
"minNormalizedIops": 0,
"maxNormalizedIops": 5000
}],
"propertiesToBeUpdated": ["minNormalizedIops", "maxNormalizedIops"]
}
HTTP/1.1 204 No Content
# Bulk: the same ceiling on several VMs in one call (PowerShell, $tintri session)
$body = @{
typeId = 'com.tintri.api.rest.v310.dto.MultipleSelectionRequest'
ids = @('<VM_UUID_1>', '<VM_UUID_2>')
newValue = @{ typeId = 'com.tintri.api.rest.v310.dto.domain.beans.vm.VirtualMachineQoSConfig'
minNormalizedIops = 0; maxNormalizedIops = 5000 }
propertyNames = @('minNormalizedIops', 'maxNormalizedIops')
} | ConvertTo-Json -Depth 5
Invoke-RestMethod "$base/v310/vm/qosConfig" -Method Put -Body $body -ContentType 'application/json' -WebSession $tintri
# Read back what is configured and what is in effect
$vm = Invoke-RestMethod "$base/v310/vm/<VM_UUID_1>" -WebSession $tintri
$vm.qosConfig | Select-Object minNormalizedIops, maxNormalizedIops, effectiveMinNormalizedIops,
effectiveMaxNormalizedIops, inheritanceEnabled, lastUpdatedTime
- Zero means default. The DTO says a VM on default QoS reports 0 for both values. To remove a ceiling, set it back to 0 rather than to a large number, so audits can tell “no ceiling” from “very high ceiling”.
- Configured versus effective.
effectiveMinNormalizedIopsandeffectiveMaxNormalizedIopsshow what is actually applied, andinheritanceEnabledsays whether the VM inherits QoS from a service group. Compare configured with effective in every audit; the QoS audit post builds that report. - System view.
GET /v310/datastore/default/qosInfo(since v310.21) returns system-wide QoS information such as the total minimum IOPS allocated. Check it before adding floors, because floors are promises the box has to keep for everyone at once. - Record what you change. Read the current values first and write them somewhere, so the change can be reversed exactly. The Postman collection does this: it saves
origQosMin/origQosMaxin Discover and restores them in Cleanup.
10. SyncVM, clones and task polling
SyncVM and clone are the two calls that make Tintri popular with test and DBA teams, and both are asynchronous: they return a Task, and you poll GET /v310/task/{id} until jobDone is true. The task states are QUEUED, RUNNING, SUCCESS, FAILED, CANCELLED, CANCEL_PENDING; on failure, error carries a TintriError.
SyncVM
POST /v310/vm/sync (since v310.21, VMstore only) overwrites a target VM, or selected disks of it, with the content of a snapshot, keeping the target VM’s identity in vCenter. Three types exist: FULL_VM, VDISK and FILE_RESTORE (attach snapshot disks to the VM for guest file-level restore). For VDISK, isSkipReboot: false (the default) stops and starts the VM around the operation; with true you are responsible for stopping I/O to those disks.
POST /api/v310/vm/sync HTTP/1.1
Host: vmstore01.lab.local
Cookie: JSESSIONID=<opaque>
Content-Type: application/json
{
"typeId": "com.tintri.api.rest.v310.dto.domain.beans.vm.VirtualMachineSyncSpec",
"type": "VDISK",
"targetVmTintriUuids": ["<TEST_VM_UUID>"],
"snapshotTintriUuid": "<PROD_SNAPSHOT_UUID>",
"sourceDisks": ["scsi0:1"],
"destDisks": ["scsi0:1"]
}
HTTP/1.1 200 OK
{ "typeId": "com.tintri.api.rest.v310.dto.Task", "uuid": { "uuid": "<TASK_ID>" },
"type": "SYNC_VM", "state": "QUEUED", "jobDone": false }
This is destructive by design. SyncVM replaces the target’s data. In the Postman collection it is named
[DESTRUCTIVE]and skipped unless you setallowDestructive=true, on top ofallowWrites=true. Put the same two-key guard in any pipeline that calls it, and double-check the target UUID against vCenter with the mapping in section 07 first.
Clone
POST /v310/vm with a VirtualMachineCloneSpec clones from a VM (vmId, the VMstore takes a snapshot first with the given consistency) or from an existing snapshot (snapshotId), count times (1 to 500 for VMware). The vmware block names the clone and where it lands: cloneVmName, vCenterName (the vCenter as registered on the VMstore), datastoreName, and optionally hostClusterMoref and folderMoref. The VMstore registers the clone in vCenter itself; per the DTO, without a valid vCenterName the clone is not added to inventory.
POST /api/v310/vm HTTP/1.1
Host: vmstore01.lab.local
Cookie: JSESSIONID=<opaque>
Content-Type: application/json
{
"typeId": "com.tintri.api.rest.v310.dto.domain.beans.vm.VirtualMachineCloneSpec",
"snapshotId": "A1D88A8A-8904-1E35-9DC2-589C317D31A6-SST-0000000000000412",
"consistency": "CRASH_CONSISTENT",
"count": 1,
"vmware": {
"typeId": "com.tintri.api.rest.v310.dto.domain.beans.vm.VirtualMachineCloneSpec$VMwareCloneInfo",
"cloneVmName": "app01-test",
"vCenterName": "vcenter01.lab.local",
"datastoreName": "default"
}
}
HTTP/1.1 200 OK
{ "typeId": "com.tintri.api.rest.v310.dto.Task", "uuid": { "uuid": "<TASK_ID>" },
"type": "CLONE", "state": "QUEUED", "jobDone": false }
Two details from the public material. The nested typeId above is the one in Tintri’s own clone sample (VirtualMachineCloneSpec$VMwareCloneInfo); the DTO page lists it as com.tintri.api.rest.v310.dto.domain.beans.vm.VMwareCloneInfo, so if your build rejects one, try the other and check the API reference for your TxOS version. And datastoreName is default in Tintri’s Python SDK clone example, which first confirms that GET /v310/datastore/default/hostResources lists the vCenter as a COMPUTE_RESOURCE; do the same check before cloning. Avoid preserveInstanceUuid: true unless you are restoring a replacement for a deleted VM, because two live VMs with one instance UUID break every identity check in section 07.
# Wait-TintriTask: poll a VMstore task until it finishes (PowerShell, $tintri session)
function Wait-TintriTask {
param([string]$Base, [Microsoft.PowerShell.Commands.WebRequestSession]$Session,
[string]$TaskId, [int]$DelaySeconds = 5, [int]$MaxTries = 120)
for ($i = 1; $i -le $MaxTries; $i++) {
$t = Invoke-RestMethod "$Base/v310/task/$TaskId" -WebSession $Session
Write-Host ("{0} {1} {2}% {3}" -f $t.type, $t.state, [int]$t.progressPercent, $t.progressDescription)
if ($t.jobDone) {
if ($t.state -ne 'SUCCESS') { throw "Task $TaskId ended $($t.state): $($t.error.code) $($t.error.message)" }
return $t
}
Start-Sleep -Seconds $DelaySeconds
}
throw "Task $TaskId still running after $MaxTries polls"
}
$task = Invoke-RestMethod "$base/v310/vm" -Method Post -Body $cloneJson -ContentType 'application/json' -WebSession $tintri
Wait-TintriTask -Base $base -Session $tintri -TaskId $task.uuid.uuid | Select-Object state, targetIds
11. Replication and alerts
Replication
Replication is configured at two levels: paths on the datastore (where to), and per-VM configurations (what, how often, and the RPO alert). For a vSphere team, reading both is daily work and writing them is best left to policy: TGC service groups (post 23) or the VMstore default policy, not per-VM API calls scattered through scripts.
| Call | Since | Notes |
|---|---|---|
GET /v310/datastore/default/replicationPath | v310 (pre-v310.101) | Outgoing paths: displayName, sourceIp, destinationIp, destinationPort, throttle |
POST /v310/datastore/default/testReplicationPath | v310.41 | Tests a path; returns an empty string on success. Replaces the deprecated PUT .../replicationPath/test |
GET /v310/vm/{vmId} | v310 (pre-v310.101) | replication: isEnabled, replicationState, configurationsOutgoing (each with alertThresholdMinutes, isPaused, latestReplicatedSnapshotTime) |
PUT /v310/vm/{vmId}/replicationConfigs | v310.21 | Sets a VM’s outgoing configurations (a list of VirtualMachineReplicationConfig). Replaces the per-config /vm/{vmId}/replicationConfig calls, deprecated since v310.61. Build the body from a GET of the VM and check the required fields against the API reference for your TxOS version |
GET /v310/datastore/default/replicationConfig | v310 (pre-v310.101) | The system-wide default replication configuration |
# Replication lag report for every live VM that replicates (curl + jq, logged-in "${CURL[@]}")
"${CURL[@]}" "https://$VMSTORE/api/v310/vm?live=TRUE&limit=2000" | jq -r '
.items[] | select(.replication.isEnabled == true) |
.vmware.name as $n | (.replication.configurationsOutgoing // [])[] |
[$n, .path.displayName // "", .replicationState // "", (.latestReplicatedSnapshotTime|tostring),
(.alertThresholdMinutes|tostring), (.isPaused|tostring)] | @tsv' | column -t -s $'\t'
Alerts
GET /v310/alert returns a page of Alert objects (severity ALERT or NOTICE, state NEW, ACKNOWLEDGED or ARCHIVED, message, source, notifiedTimestamp), filterable by state, severity and since. On TxOS 5.6 and later there is also GET /v310/alert/paginated (v310.191). Note that PUT /v310/alert/markRead and markArchived act on all alerts; do not call them from a monitoring script, or the people who read the UI lose their unread markers.
GET /api/v310/alert?state=NEW&severity=ALERT&limit=50 HTTP/1.1
Host: vmstore01.lab.local
Cookie: JSESSIONID=<opaque>
HTTP/1.1 200 OK
{ "typeId": "com.tintri.api.rest.v310.dto.Page", "filteredTotal": 1,
"items": [ { "typeId": "com.tintri.api.rest.v310.dto.domain.Alert",
"severity": "ALERT", "state": "NEW", "source": "<component>",
"message": "<alert text>", "notifiedTimestamp": 1764662400000 } ] }
12. Packet flow: the network under the API
API problems and storage problems get confused because both show up as “the VMstore is not responding”. They run on different networks. The API runs on the management VLAN, over HTTPS, and fails with TLS errors, timeouts or 401s. The NFS data path runs on the storage VLAN and fails with slow I/O, APD events and, the classic, an MTU black hole where small packets pass and large ones vanish. Figure 3 shows both, hop by hop, with the places packets are dropped in the two most common misconfigurations.
| Hop | Protocol / port | Check from | Command | Expected |
|---|---|---|---|---|
| Workstation to VMstore API | HTTPS, TCP 443, TLS 1.2 | Workstation | curl -sS https://vmstore01.lab.local/api/info | 200 and a RestApi JSON. TLS 1.2 only on TxOS 5.6.0.1 and later |
| Workstation to vCenter API | HTTPS, TCP 443 | Workstation | curl -sS -o /dev/null -w "%{http_code}" https://vcenter01.lab.local/api/session | 401 (reachable, needs auth) |
| VMstore to vCenter | HTTPS, TCP 443 | VMstore API | GET .../hypervisorManagerConfig/{id}?refresh=false | A ping status that is not an error |
| vmk2 to VMstore data IP | NFSv3, TCP 2049 | ESXi shell | vmkping -I vmk2 -d -s 8972 10.0.30.50 | 0% loss with MTU 9000 (use -s 1472 for 1500) |
| NFS mount state | NFSv3 | ESXi shell | esxcli storage nfs list | Accessible true, Mounted true, Hardware Acceleration Supported |
| VMstore to DR VMstore | TCP 1304 async, 1338 sync (defaults in Tintri’s published guide) | VMstore API | POST .../testReplicationPath | Empty string (success) |
The ports for vCenter (443), vCenter to ESXi (443 and 902), vMotion (TCP 8000) and NFS (2049) are Broadcom’s; the replication ports are the defaults in Tintri’s VMware best-practices guide, so confirm them against the service port list for your TxOS release before you open firewalls. The full MTU and VLAN design is in part 2, and the jumbo frame check automates the vmkping row across every host.
13. The Postman collection and newman
The collection runs the whole guide in order: 01 Auth (API info, VMstore login, current session, vCenter login), 02 Discover (appliance, status, controllers, failed parts, vCenter registration, datastore stats, find the VM, its realtime stats, its vCenter identity), 03 Configure (snapshot, QoS, clone and task poll, SyncVM and task poll), 04 Verify (snapshot listed, QoS read back, replication paths), 05 Troubleshoot (alerts, paginated alerts, failed tasks, active sessions, vCenter registration ping) and 06 Cleanup and logout (restore QoS, delete the test snapshot, log out of both).
- Safe by default. A collection-level pre-request script skips any request whose name starts with
[WRITE]unlessallowWritesistrue, and[DESTRUCTIVE]also needsallowDestructive. With the shipped environment, a run is read-only. Skipping usespm.execution.skipRequest(), which needs the Postman app or newman 6.1.0 or later. - Sessions are captured, not typed. The VMstore login test stores
JSESSIONIDintintriSession, sent as aCookieheader on every VMstore request; the vCenter login stores the token invcSession, sent asvmware-api-session-id. - 401 handling. A collection-level test catches a 401, runs the right login once and retries the failed request, which is the branch in figure 2.
- Task polling. The poll requests call themselves with
postman.setNextRequest()everytaskPollDelayMsuntiljobDone, up totaskPollMaxtries, then assertSUCCESS. - Secrets.
passwordandvcenterPasswordare secret-type variables with empty values. Supply them at run time; never commit a filled environment.
Save the following as 22-vmware-vsphere-tintri-vmstore-rest-api-guide.postman_collection.json and import it into Postman (Import, Files). The environment is the second block; save it as 22-vmware-vsphere-tintri-vmstore-rest-api-guide.postman_environment.json and import it the same way.
{
"info": {
"_postman_id": "b0cf4fd5-1064-54e1-a355-52c0b5d2e258",
"name": "VMware vSphere + Tintri VMstore REST API (v310.207)",
"description": "Companion to 'VMware vSphere with Tintri VMstore: the REST API deploy and operations guide' on vmwareblogs.co.in. Run folders in order. Write requests are prefixed [WRITE] and run only when allowWrites=true; [DESTRUCTIVE] requests also need allowDestructive=true. Checked against Tintri REST API v310.207 (TxOS 6.0.3) and the vSphere Automation API 9.x reference.",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"auth": {
"type": "noauth"
},
"event": [
{
"listen": "prerequest",
"script": {
"type": "text/javascript",
"exec": [
"// Guard: write and destructive requests run only when explicitly enabled.",
"const name = pm.info.requestName || '';",
"if (name.startsWith('[WRITE]') && pm.environment.get('allowWrites') !== 'true') {",
" console.log('SKIP ' + name + ' (set allowWrites=true to run)');",
" pm.execution.skipRequest();",
"}",
"if (name.startsWith('[DESTRUCTIVE]') && pm.environment.get('allowDestructive') !== 'true') {",
" console.log('SKIP ' + name + ' (set allowDestructive=true to run)');",
" pm.execution.skipRequest();",
"}"
]
}
},
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
"// 401 handling: log in again once, then retry the request that failed.",
"if (pm.response.code === 401) {",
" const isVc = pm.request.headers.has('vmware-api-session-id');",
" const flag = isVc ? 'retryAfterVcLogin' : 'retryAfterLogin';",
" if (!pm.environment.get(flag + 'Used')) {",
" pm.environment.set(flag + 'Used', '1');",
" pm.environment.set(flag, pm.info.requestName);",
" console.warn('401 on ' + pm.info.requestName + ': logging in again and retrying once');",
" postman.setNextRequest(isVc ? 'Login to vCenter' : 'Login to VMstore');",
" }",
"}",
"if (pm.response.code >= 400) {",
" try { const e = pm.response.json(); console.warn(JSON.stringify(e)); } catch (err) { console.warn(pm.response.text()); }",
"}"
]
}
}
],
"item": [
{
"name": "01 Auth",
"item": [
{
"name": "Get API info",
"request": {
"method": "GET",
"header": [
{
"key": "Accept",
"value": "application/json"
}
],
"url": "{{baseUrl}}/api/info",
"description": "Unauthenticated. Returns RestApi: productName, preferredVersion, supportedVersionSet."
},
"event": [
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
"const retrying = pm.response.code === 401 && [pm.environment.get('retryAfterLogin'), pm.environment.get('retryAfterVcLogin')].includes(pm.info.requestName);",
"if (retrying) { console.log('401: retry scheduled after login, assertions deferred'); } else {",
"pm.test('GET /api/info returns 200', () => pm.response.to.have.status(200));",
"const info = pm.response.json();",
"pm.test('supportedVersionSet is present', () => pm.expect(info.supportedVersionSet).to.be.an('array').that.is.not.empty);",
"console.log('productName=' + info.productName + ' preferredVersion=' + info.preferredVersion +",
" ' supported=' + JSON.stringify(info.supportedVersionSet));",
"}"
]
}
}
]
},
{
"name": "Login to VMstore",
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Accept",
"value": "application/json"
}
],
"url": "{{baseUrl}}/api/v310/session/login",
"description": "Returns the role name as the body and sets the JSESSIONID cookie.",
"body": {
"mode": "raw",
"raw": "{\n \"typeId\": \"com.tintri.api.rest.vcommon.dto.rbac.RestApiCredentials\",\n \"username\": \"{{username}}\",\n \"password\": \"{{password}}\",\n \"fullApiVersion\": \"{{fullApiVersion}}\"\n}",
"options": {
"raw": {
"language": "json"
}
}
}
},
"event": [
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
"pm.test('login returns 200', () => pm.response.to.have.status(200));",
"const sid = pm.cookies.get('JSESSIONID');",
"pm.test('JSESSIONID cookie captured', () => pm.expect(sid).to.be.a('string').and.not.empty);",
"pm.environment.set('tintriSession', sid);",
"console.log('logged in, role: ' + pm.response.text());",
"const retry = pm.environment.get('retryAfterLogin');",
"if (retry) { pm.environment.unset('retryAfterLogin'); postman.setNextRequest(retry); }"
]
}
}
]
},
{
"name": "Get current VMstore session",
"request": {
"method": "GET",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Accept",
"value": "application/json"
},
{
"key": "Cookie",
"value": "JSESSIONID={{tintriSession}}"
}
],
"url": "{{baseUrl}}/api/v310/session/current"
},
"event": [
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
"const retrying = pm.response.code === 401 && [pm.environment.get('retryAfterLogin'), pm.environment.get('retryAfterVcLogin')].includes(pm.info.requestName);",
"if (retrying) { console.log('401: retry scheduled after login, assertions deferred'); } else {",
"pm.test('session/current returns 200', () => pm.response.to.have.status(200));",
"const s = pm.response.json();",
"pm.test('session belongs to the configured user', () => pm.expect(String(s.userName).toLowerCase()).to.include(String(pm.environment.get('username')).toLowerCase()));",
"console.log('roles=' + JSON.stringify(s.roles) + ' expires=' + s.expirationTime);",
"}"
]
}
}
]
},
{
"name": "Login to vCenter",
"request": {
"method": "POST",
"header": [
{
"key": "Accept",
"value": "application/json"
}
],
"url": "{{vcenterUrl}}/api/session",
"description": "vSphere Automation API session. The body is the token string; send it as vmware-api-session-id.",
"auth": {
"type": "basic",
"basic": [
{
"key": "username",
"value": "{{vcenterUsername}}",
"type": "string"
},
{
"key": "password",
"value": "{{vcenterPassword}}",
"type": "string"
}
]
}
},
"event": [
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
"pm.test('vCenter session created', () => pm.expect(pm.response.code).to.be.oneOf([200, 201]));",
"const token = pm.response.json();",
"pm.test('token is a string', () => pm.expect(token).to.be.a('string').and.not.empty);",
"pm.environment.set('vcSession', token);",
"const retry = pm.environment.get('retryAfterVcLogin');",
"if (retry) { pm.environment.unset('retryAfterVcLogin'); postman.setNextRequest(retry); }"
]
}
}
]
}
]
},
{
"name": "02 Discover",
"item": [
{
"name": "Appliance info",
"request": {
"method": "GET",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Accept",
"value": "application/json"
},
{
"key": "Cookie",
"value": "JSESSIONID={{tintriSession}}"
}
],
"url": "{{baseUrl}}/api/v310/appliance/{{datastoreId}}/info"
},
"event": [
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
"const retrying = pm.response.code === 401 && [pm.environment.get('retryAfterLogin'), pm.environment.get('retryAfterVcLogin')].includes(pm.info.requestName);",
"if (retrying) { console.log('401: retry scheduled after login, assertions deferred'); } else {",
"pm.test('200', () => pm.response.to.have.status(200));",
"const a = pm.response.json();",
"pm.test('model and TxOS version reported', () => { pm.expect(a.modelName).to.be.a('string'); pm.expect(a.osVersion).to.be.a('string'); });",
"console.log(`model=${a.modelName} TxOS=${a.osVersion} allFlash=${a.isAllFlash}`);",
"}"
]
}
}
]
},
{
"name": "Operational status",
"request": {
"method": "GET",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Accept",
"value": "application/json"
},
{
"key": "Cookie",
"value": "JSESSIONID={{tintriSession}}"
}
],
"url": "{{baseUrl}}/api/v310/appliance/{{datastoreId}}/operationalStatus"
},
"event": [
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
"const retrying = pm.response.code === 401 && [pm.environment.get('retryAfterLogin'), pm.environment.get('retryAfterVcLogin')].includes(pm.info.requestName);",
"if (retrying) { console.log('401: retry scheduled after login, assertions deferred'); } else {",
"pm.test('200', () => pm.response.to.have.status(200));",
"const o = pm.response.json();",
"pm.test('file system is up', () => pm.expect(o.isFilesystemUp).to.eql(true));",
"pm.test('no urgent message', () => pm.expect(o.urgentMessage || '').to.eql(''));",
"console.log(`uptime=${o.uptime} unreadAlerts=${o.alertsUnreadCount} restartFlag=${o.restartFlag}`);",
"}"
]
}
}
]
},
{
"name": "Controllers",
"request": {
"method": "GET",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Accept",
"value": "application/json"
},
{
"key": "Cookie",
"value": "JSESSIONID={{tintriSession}}"
}
],
"url": "{{baseUrl}}/api/v310/appliance/{{datastoreId}}/controller"
},
"event": [
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
"const retrying = pm.response.code === 401 && [pm.environment.get('retryAfterLogin'), pm.environment.get('retryAfterVcLogin')].includes(pm.info.requestName);",
"if (retrying) { console.log('401: retry scheduled after login, assertions deferred'); } else {",
"pm.test('200', () => pm.response.to.have.status(200));",
"let c = pm.response.json();",
"c = Array.isArray(c) ? c : (c.items || [c]);",
"const roles = c.map(x => x.role);",
"console.log(c.map(x => `${x.locator} ${x.role} ${x.state} ${x.osVersion}`).join(' | '));",
"pm.test('exactly one ACTIVE controller', () => pm.expect(roles.filter(r => r === 'ACTIVE').length).to.eql(1));",
"pm.test('a STANDBY controller is present', () => pm.expect(roles).to.include('STANDBY'));",
"}"
]
}
}
]
},
{
"name": "Failed components",
"request": {
"method": "GET",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Accept",
"value": "application/json"
},
{
"key": "Cookie",
"value": "JSESSIONID={{tintriSession}}"
}
],
"url": "{{baseUrl}}/api/v310/appliance/{{datastoreId}}/failedComponents"
},
"event": [
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
"const retrying = pm.response.code === 401 && [pm.environment.get('retryAfterLogin'), pm.environment.get('retryAfterVcLogin')].includes(pm.info.requestName);",
"if (retrying) { console.log('401: retry scheduled after login, assertions deferred'); } else {",
"pm.test('200', () => pm.response.to.have.status(200));",
"console.log('failedComponents: ' + pm.response.text());",
"}"
]
}
}
]
},
{
"name": "vCenter registrations (hypervisor managers)",
"request": {
"method": "GET",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Accept",
"value": "application/json"
},
{
"key": "Cookie",
"value": "JSESSIONID={{tintriSession}}"
}
],
"url": "{{baseUrl}}/api/v310/datastore/{{datastoreId}}/hypervisorManagerConfig"
},
"event": [
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
"const retrying = pm.response.code === 401 && [pm.environment.get('retryAfterLogin'), pm.environment.get('retryAfterVcLogin')].includes(pm.info.requestName);",
"if (retrying) { console.log('401: retry scheduled after login, assertions deferred'); } else {",
"pm.test('200', () => pm.response.to.have.status(200));",
"const m = pm.response.json();",
"const vc = m.filter(x => x.hypervisorType === 'VMWARE');",
"pm.test('at least one vCenter is registered', () => pm.expect(vc.length).to.be.above(0));",
"vc.forEach(x => console.log(`vCenter ${x.host} user=${x.username} id=${x.hypervisorManagerId}`));",
"if (vc.length) { pm.environment.set('hypervisorManagerId', vc[0].hypervisorManagerId); }",
"}"
]
}
}
]
},
{
"name": "Datastore stats summary",
"request": {
"method": "GET",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Accept",
"value": "application/json"
},
{
"key": "Cookie",
"value": "JSESSIONID={{tintriSession}}"
}
],
"url": "{{baseUrl}}/api/v310/datastore/{{datastoreId}}/statsSummary"
},
"event": [
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
"const retrying = pm.response.code === 401 && [pm.environment.get('retryAfterLogin'), pm.environment.get('retryAfterVcLogin')].includes(pm.info.requestName);",
"if (retrying) { console.log('401: retry scheduled after login, assertions deferred'); } else {",
"pm.test('200', () => pm.response.to.have.status(200));",
"const s = pm.response.json();",
"console.log(`used ${s.spaceUsedPhysicalGiB} of ${s.spaceTotalGiB} GiB, ${s.spaceRemainingDays} days left, ` +",
" `${s.operationsTotalIops} IOPS, ${s.latencyTotalMs} ms, VMs ${s.vmsCount}`);",
"pm.test('capacity fields present', () => pm.expect(s.spaceTotalGiB).to.be.a('number'));",
"}"
]
}
}
]
},
{
"name": "Find VM by name",
"request": {
"method": "GET",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Accept",
"value": "application/json"
},
{
"key": "Cookie",
"value": "JSESSIONID={{tintriSession}}"
}
],
"url": "{{baseUrl}}/api/v310/vm?name={{vmName}}&live=TRUE&limit=10"
},
"event": [
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
"const retrying = pm.response.code === 401 && [pm.environment.get('retryAfterLogin'), pm.environment.get('retryAfterVcLogin')].includes(pm.info.requestName);",
"if (retrying) { console.log('401: retry scheduled after login, assertions deferred'); } else {",
"pm.test('200', () => pm.response.to.have.status(200));",
"const p = pm.response.json();",
"const hits = (p.items || []).filter(v => v.vmware && v.vmware.name === pm.environment.get('vmName'));",
"pm.test('exactly one live VM with that name', () => pm.expect(hits.length).to.eql(1));",
"if (hits.length === 1) {",
" const v = hits[0];",
" pm.environment.set('vmUuid', v.uuid.uuid);",
" pm.environment.set('vmMor', v.vmware.mor);",
" pm.environment.set('vmInstanceUuid', (v.vmware.instanceUuids || [])[0] || '');",
" pm.environment.set('origQosMin', v.qosConfig ? v.qosConfig.minNormalizedIops : 0);",
" pm.environment.set('origQosMax', v.qosConfig ? v.qosConfig.maxNormalizedIops : 0);",
" console.log(`vmUuid=${v.uuid.uuid} mor=${v.vmware.mor} instanceUuids=${JSON.stringify(v.vmware.instanceUuids)} vCenter=${v.vmware.vcenterName}`);",
"}",
"}"
]
}
}
]
},
{
"name": "VM realtime stats",
"request": {
"method": "GET",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Accept",
"value": "application/json"
},
{
"key": "Cookie",
"value": "JSESSIONID={{tintriSession}}"
}
],
"url": "{{baseUrl}}/api/v310/vm/{{vmUuid}}/statsRealtime"
},
"event": [
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
"const retrying = pm.response.code === 401 && [pm.environment.get('retryAfterLogin'), pm.environment.get('retryAfterVcLogin')].includes(pm.info.requestName);",
"if (retrying) { console.log('401: retry scheduled after login, assertions deferred'); } else {",
"pm.test('200', () => pm.response.to.have.status(200));",
"const items = pm.response.json().items || [];",
"const stats = items.length ? (items[0].sortedStats || []) : [];",
"const s = stats[stats.length - 1];",
"pm.test('at least one sample returned', () => pm.expect(s).to.be.an('object'));",
"if (s) console.log(`total ${s.latencyTotalMs} ms = host ${s.latencyHostMs} / net ${s.latencyNetworkMs} / storage ${s.latencyStorageMs} / contention ${s.latencyContentionMs} / throttle ${s.latencyThrottleMs}; IOPS ${s.operationsTotalIops}`);",
"}"
]
}
}
]
},
{
"name": "vCenter: confirm VM identity",
"request": {
"method": "GET",
"header": [
{
"key": "vmware-api-session-id",
"value": "{{vcSession}}"
},
{
"key": "Accept",
"value": "application/json"
}
],
"url": "{{vcenterUrl}}/api/vcenter/vm/{{vmMor}}"
},
"event": [
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
"const retrying = pm.response.code === 401 && [pm.environment.get('retryAfterLogin'), pm.environment.get('retryAfterVcLogin')].includes(pm.info.requestName);",
"if (retrying) { console.log('401: retry scheduled after login, assertions deferred'); } else {",
"if (pm.response.code === 404) { console.warn('vCenter has no VM with id ' + pm.environment.get('vmMor') + ': check the mor format or the vCenter this VMstore reports'); }",
"pm.test('200 from vCenter', () => pm.response.to.have.status(200));",
"const vm = pm.response.json();",
"const want = String(pm.environment.get('vmInstanceUuid') || '').toLowerCase();",
"pm.test('instance_uuid matches the VMstore record', () => pm.expect(String(vm.identity && vm.identity.instance_uuid).toLowerCase()).to.eql(want));",
"console.log(`vCenter name=${vm.name} power=${vm.power_state} instance_uuid=${vm.identity && vm.identity.instance_uuid}`);",
"}"
]
}
}
]
}
]
},
{
"name": "03 Configure (writes, opt-in)",
"item": [
{
"name": "[WRITE] Take manual snapshot",
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Accept",
"value": "application/json"
},
{
"key": "Cookie",
"value": "JSESSIONID={{tintriSession}}"
}
],
"url": "{{baseUrl}}/api/v310/snapshot",
"body": {
"mode": "raw",
"raw": "[\n {\n \"typeId\": \"com.tintri.api.rest.v310.dto.domain.beans.snapshot.SnapshotSpec\",\n \"consistency\": \"CRASH_CONSISTENT\",\n \"retentionMinutes\": {{snapshotRetentionMinutes}},\n \"snapshotName\": \"{{snapshotName}}\",\n \"sourceVmTintriUUID\": \"{{vmUuid}}\"\n }\n]",
"options": {
"raw": {
"language": "json"
}
}
}
},
"event": [
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
"const retrying = pm.response.code === 401 && [pm.environment.get('retryAfterLogin'), pm.environment.get('retryAfterVcLogin')].includes(pm.info.requestName);",
"if (retrying) { console.log('401: retry scheduled after login, assertions deferred'); } else {",
"pm.test('snapshot created', () => pm.expect(pm.response.code).to.be.oneOf([200, 201]));",
"const ids = pm.response.json();",
"pm.test('one snapshot UUID returned', () => pm.expect(ids).to.be.an('array').with.lengthOf(1));",
"pm.environment.set('snapshotUuid', ids[0]);",
"console.log('snapshot ' + ids[0]);",
"}"
]
}
}
]
},
{
"name": "[WRITE] Set VM QoS",
"request": {
"method": "PUT",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Accept",
"value": "application/json"
},
{
"key": "Cookie",
"value": "JSESSIONID={{tintriSession}}"
}
],
"url": "{{baseUrl}}/api/v310/vm/{{vmUuid}}/qosConfig",
"body": {
"mode": "raw",
"raw": "{\n \"typeId\": \"com.tintri.api.rest.v310.dto.Request\",\n \"objectsWithNewValues\": [\n {\n \"typeId\": \"com.tintri.api.rest.v310.dto.domain.beans.vm.VirtualMachineQoSConfig\",\n \"minNormalizedIops\": {{qosMin}},\n \"maxNormalizedIops\": {{qosMax}}\n }\n ],\n \"propertiesToBeUpdated\": [\n \"minNormalizedIops\",\n \"maxNormalizedIops\"\n ]\n}",
"options": {
"raw": {
"language": "json"
}
}
}
},
"event": [
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
"const retrying = pm.response.code === 401 && [pm.environment.get('retryAfterLogin'), pm.environment.get('retryAfterVcLogin')].includes(pm.info.requestName);",
"if (retrying) { console.log('401: retry scheduled after login, assertions deferred'); } else {",
"pm.test('QoS update accepted (204)', () => pm.response.to.have.status(204));",
"}"
]
}
}
]
},
{
"name": "[WRITE] Clone VM from snapshot",
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Accept",
"value": "application/json"
},
{
"key": "Cookie",
"value": "JSESSIONID={{tintriSession}}"
}
],
"url": "{{baseUrl}}/api/v310/vm",
"body": {
"mode": "raw",
"raw": "{\n \"typeId\": \"com.tintri.api.rest.v310.dto.domain.beans.vm.VirtualMachineCloneSpec\",\n \"snapshotId\": \"{{snapshotUuid}}\",\n \"consistency\": \"CRASH_CONSISTENT\",\n \"count\": 1,\n \"vmware\": {\n \"typeId\": \"com.tintri.api.rest.v310.dto.domain.beans.vm.VirtualMachineCloneSpec$VMwareCloneInfo\",\n \"cloneVmName\": \"{{cloneName}}\",\n \"vCenterName\": \"{{vcenterName}}\",\n \"datastoreName\": \"{{datastoreId}}\"\n }\n}",
"options": {
"raw": {
"language": "json"
}
}
}
},
"event": [
{
"listen": "prerequest",
"script": {
"type": "text/javascript",
"exec": [
"if (!pm.environment.get('snapshotUuid')) { console.log('No snapshotUuid, skipping clone'); pm.execution.skipRequest(); }"
]
}
},
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
"const retrying = pm.response.code === 401 && [pm.environment.get('retryAfterLogin'), pm.environment.get('retryAfterVcLogin')].includes(pm.info.requestName);",
"if (retrying) { console.log('401: retry scheduled after login, assertions deferred'); } else {",
"pm.test('clone accepted', () => pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]));",
"const t = pm.response.json();",
"pm.environment.set('taskId', t.uuid.uuid);",
"pm.environment.set('taskPollCount', 0);",
"console.log(`clone task ${t.uuid.uuid} ${t.state}`);",
"}"
]
}
}
]
},
{
"name": "[WRITE] Poll clone task",
"request": {
"method": "GET",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Accept",
"value": "application/json"
},
{
"key": "Cookie",
"value": "JSESSIONID={{tintriSession}}"
}
],
"url": "{{baseUrl}}/api/v310/task/{{taskId}}"
},
"event": [
{
"listen": "prerequest",
"script": {
"type": "text/javascript",
"exec": [
"const n = Number(pm.environment.get('taskPollCount') || 0);",
"if (!pm.environment.get('taskId')) { console.log('No taskId set, skipping poll'); pm.execution.skipRequest(); }",
"if (n > 0) { setTimeout(() => {}, Number(pm.environment.get('taskPollDelayMs') || 5000)); }"
]
}
},
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
"const retrying = pm.response.code === 401 && [pm.environment.get('retryAfterLogin'), pm.environment.get('retryAfterVcLogin')].includes(pm.info.requestName);",
"if (retrying) { console.log('401: retry scheduled after login, assertions deferred'); } else {",
"pm.test('task lookup returns 200', () => pm.response.to.have.status(200));",
"const t = pm.response.json();",
"const n = Number(pm.environment.get('taskPollCount') || 0) + 1;",
"const max = Number(pm.environment.get('taskPollMax') || 60);",
"console.log(`task ${t.uuid && t.uuid.uuid} ${t.type} ${t.state} ${t.progressPercent || 0}% try ${n}/${max}`);",
"if (!t.jobDone && n < max) {",
" pm.environment.set('taskPollCount', n);",
" postman.setNextRequest(pm.info.requestName);",
"} else {",
" pm.environment.set('taskPollCount', 0);",
" pm.environment.unset('taskId');",
" if (t.error) { console.log('TintriError: ' + JSON.stringify(t.error)); }",
" pm.test('task finished with state SUCCESS', () => pm.expect(t.state).to.eql('SUCCESS'));",
"}",
"}"
]
}
}
]
},
{
"name": "[DESTRUCTIVE] SyncVM: restore one vDisk from snapshot",
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Accept",
"value": "application/json"
},
{
"key": "Cookie",
"value": "JSESSIONID={{tintriSession}}"
}
],
"url": "{{baseUrl}}/api/v310/vm/sync",
"description": "Overwrites the target VM's disk with the disk from the snapshot. The target VM is stopped and started unless isSkipReboot is true.",
"body": {
"mode": "raw",
"raw": "{\n \"typeId\": \"com.tintri.api.rest.v310.dto.domain.beans.vm.VirtualMachineSyncSpec\",\n \"type\": \"VDISK\",\n \"targetVmTintriUuids\": [\n \"{{syncTargetVmUuid}}\"\n ],\n \"snapshotTintriUuid\": \"{{syncSnapshotUuid}}\",\n \"sourceDisks\": [\n \"{{syncDisk}}\"\n ],\n \"destDisks\": [\n \"{{syncDisk}}\"\n ]\n}",
"options": {
"raw": {
"language": "json"
}
}
}
},
"event": [
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
"const retrying = pm.response.code === 401 && [pm.environment.get('retryAfterLogin'), pm.environment.get('retryAfterVcLogin')].includes(pm.info.requestName);",
"if (retrying) { console.log('401: retry scheduled after login, assertions deferred'); } else {",
"pm.test('sync accepted', () => pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]));",
"const t = pm.response.json();",
"pm.environment.set('taskId', t.uuid.uuid);",
"pm.environment.set('taskPollCount', 0);",
"}"
]
}
}
]
},
{
"name": "[DESTRUCTIVE] Poll sync task",
"request": {
"method": "GET",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Accept",
"value": "application/json"
},
{
"key": "Cookie",
"value": "JSESSIONID={{tintriSession}}"
}
],
"url": "{{baseUrl}}/api/v310/task/{{taskId}}"
},
"event": [
{
"listen": "prerequest",
"script": {
"type": "text/javascript",
"exec": [
"const n = Number(pm.environment.get('taskPollCount') || 0);",
"if (!pm.environment.get('taskId')) { console.log('No taskId set, skipping poll'); pm.execution.skipRequest(); }",
"if (n > 0) { setTimeout(() => {}, Number(pm.environment.get('taskPollDelayMs') || 5000)); }"
]
}
},
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
"const retrying = pm.response.code === 401 && [pm.environment.get('retryAfterLogin'), pm.environment.get('retryAfterVcLogin')].includes(pm.info.requestName);",
"if (retrying) { console.log('401: retry scheduled after login, assertions deferred'); } else {",
"pm.test('task lookup returns 200', () => pm.response.to.have.status(200));",
"const t = pm.response.json();",
"const n = Number(pm.environment.get('taskPollCount') || 0) + 1;",
"const max = Number(pm.environment.get('taskPollMax') || 60);",
"console.log(`task ${t.uuid && t.uuid.uuid} ${t.type} ${t.state} ${t.progressPercent || 0}% try ${n}/${max}`);",
"if (!t.jobDone && n < max) {",
" pm.environment.set('taskPollCount', n);",
" postman.setNextRequest(pm.info.requestName);",
"} else {",
" pm.environment.set('taskPollCount', 0);",
" pm.environment.unset('taskId');",
" if (t.error) { console.log('TintriError: ' + JSON.stringify(t.error)); }",
" pm.test('task finished with state SUCCESS', () => pm.expect(t.state).to.eql('SUCCESS'));",
"}",
"}"
]
}
}
]
}
]
},
{
"name": "04 Verify",
"item": [
{
"name": "List user snapshots of the VM",
"request": {
"method": "GET",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Accept",
"value": "application/json"
},
{
"key": "Cookie",
"value": "JSESSIONID={{tintriSession}}"
}
],
"url": "{{baseUrl}}/api/v310/snapshot?vmUuid={{vmUuid}}&type=USER_GENERATED_SNAPSHOT&limit=50"
},
"event": [
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
"const retrying = pm.response.code === 401 && [pm.environment.get('retryAfterLogin'), pm.environment.get('retryAfterVcLogin')].includes(pm.info.requestName);",
"if (retrying) { console.log('401: retry scheduled after login, assertions deferred'); } else {",
"pm.test('200', () => pm.response.to.have.status(200));",
"const items = pm.response.json().items || [];",
"console.log(items.map(s => `${s.uuid.uuid} ${s.description || ''} ${s.consistency} created ${s.createTime} expires ${s.expirationTime}`).join('\\n'));",
"const want = pm.environment.get('snapshotUuid');",
"if (want) pm.test('new snapshot is listed', () => pm.expect(items.map(s => s.uuid.uuid)).to.include(want));",
"}"
]
}
}
]
},
{
"name": "VM detail (QoS, protection, replication)",
"request": {
"method": "GET",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Accept",
"value": "application/json"
},
{
"key": "Cookie",
"value": "JSESSIONID={{tintriSession}}"
}
],
"url": "{{baseUrl}}/api/v310/vm/{{vmUuid}}"
},
"event": [
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
"const retrying = pm.response.code === 401 && [pm.environment.get('retryAfterLogin'), pm.environment.get('retryAfterVcLogin')].includes(pm.info.requestName);",
"if (retrying) { console.log('401: retry scheduled after login, assertions deferred'); } else {",
"pm.test('200', () => pm.response.to.have.status(200));",
"const v = pm.response.json();",
"const q = v.qosConfig || {};",
"console.log(`QoS min=${q.minNormalizedIops} max=${q.maxNormalizedIops} effective=${q.effectiveMinNormalizedIops}/${q.effectiveMaxNormalizedIops} inherited=${q.inheritanceEnabled}`);",
"const r = v.replication || {};",
"console.log(`replication enabled=${r.isEnabled} state=${r.replicationState} outgoing=${(r.configurationsOutgoing || []).length}`);",
"if (pm.environment.get('allowWrites') === 'true') {",
" pm.test('QoS matches requested values', () => {",
" pm.expect(q.minNormalizedIops).to.eql(Number(pm.environment.get('qosMin')));",
" pm.expect(q.maxNormalizedIops).to.eql(Number(pm.environment.get('qosMax')));",
" });",
"}",
"}"
]
}
}
]
},
{
"name": "Replication paths",
"request": {
"method": "GET",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Accept",
"value": "application/json"
},
{
"key": "Cookie",
"value": "JSESSIONID={{tintriSession}}"
}
],
"url": "{{baseUrl}}/api/v310/datastore/{{datastoreId}}/replicationPath"
},
"event": [
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
"const retrying = pm.response.code === 401 && [pm.environment.get('retryAfterLogin'), pm.environment.get('retryAfterVcLogin')].includes(pm.info.requestName);",
"if (retrying) { console.log('401: retry scheduled after login, assertions deferred'); } else {",
"pm.test('200', () => pm.response.to.have.status(200));",
"const paths = pm.response.json();",
"(Array.isArray(paths) ? paths : []).forEach(p => console.log(`${p.displayName}: ${p.sourceIp} -> ${p.destinationIp}:${p.destinationPort}`));",
"}"
]
}
}
]
}
]
},
{
"name": "05 Troubleshoot",
"item": [
{
"name": "New alerts",
"request": {
"method": "GET",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Accept",
"value": "application/json"
},
{
"key": "Cookie",
"value": "JSESSIONID={{tintriSession}}"
}
],
"url": "{{baseUrl}}/api/v310/alert?state=NEW&severity=ALERT&limit=50"
},
"event": [
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
"const retrying = pm.response.code === 401 && [pm.environment.get('retryAfterLogin'), pm.environment.get('retryAfterVcLogin')].includes(pm.info.requestName);",
"if (retrying) { console.log('401: retry scheduled after login, assertions deferred'); } else {",
"pm.test('200', () => pm.response.to.have.status(200));",
"const items = pm.response.json().items || [];",
"console.log(items.map(a => `${a.notifiedTimestamp} ${a.severity} ${a.source}: ${a.message}`).join('\\n'));",
"}"
]
}
}
]
},
{
"name": "Alerts, paginated (v310.191+)",
"request": {
"method": "GET",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Accept",
"value": "application/json"
},
{
"key": "Cookie",
"value": "JSESSIONID={{tintriSession}}"
}
],
"url": "{{baseUrl}}/api/v310/alert/paginated?limit=50"
},
"event": [
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
"const retrying = pm.response.code === 401 && [pm.environment.get('retryAfterLogin'), pm.environment.get('retryAfterVcLogin')].includes(pm.info.requestName);",
"if (retrying) { console.log('401: retry scheduled after login, assertions deferred'); } else {",
"if (pm.response.code === 404) { console.warn('alert/paginated not available: TxOS older than 5.6 (v310.191)'); }",
"pm.test('200 or 404 on older TxOS', () => pm.expect(pm.response.code).to.be.oneOf([200, 404]));",
"}"
]
}
}
]
},
{
"name": "Recent tasks",
"request": {
"method": "GET",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Accept",
"value": "application/json"
},
{
"key": "Cookie",
"value": "JSESSIONID={{tintriSession}}"
}
],
"url": "{{baseUrl}}/api/v310/task?limit=50"
},
"event": [
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
"const retrying = pm.response.code === 401 && [pm.environment.get('retryAfterLogin'), pm.environment.get('retryAfterVcLogin')].includes(pm.info.requestName);",
"if (retrying) { console.log('401: retry scheduled after login, assertions deferred'); } else {",
"pm.test('200', () => pm.response.to.have.status(200));",
"const items = pm.response.json().items || [];",
"const bad = items.filter(t => t.state === 'FAILED');",
"bad.forEach(t => console.log(`FAILED ${t.type} ${t.uuid.uuid}: ${t.error ? t.error.message : ''}`));",
"pm.test('no failed tasks in the recent list', () => pm.expect(bad.length).to.eql(0));",
"}"
]
}
}
]
},
{
"name": "Active API sessions",
"request": {
"method": "GET",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Accept",
"value": "application/json"
},
{
"key": "Cookie",
"value": "JSESSIONID={{tintriSession}}"
}
],
"url": "{{baseUrl}}/api/v310/session/active"
},
"event": [
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
"const retrying = pm.response.code === 401 && [pm.environment.get('retryAfterLogin'), pm.environment.get('retryAfterVcLogin')].includes(pm.info.requestName);",
"if (retrying) { console.log('401: retry scheduled after login, assertions deferred'); } else {",
"pm.test('200', () => pm.response.to.have.status(200));",
"const s = pm.response.json();",
"console.log(`${s.length} sessions: ` + s.map(x => `${x.userName}@${x.clientIp}`).join(', '));",
"}"
]
}
}
]
},
{
"name": "Check vCenter registration (no refresh)",
"request": {
"method": "GET",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Accept",
"value": "application/json"
},
{
"key": "Cookie",
"value": "JSESSIONID={{tintriSession}}"
}
],
"url": "{{baseUrl}}/api/v310/datastore/{{datastoreId}}/hypervisorManagerConfig/{{hypervisorManagerId}}?refresh=false"
},
"event": [
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
"const retrying = pm.response.code === 401 && [pm.environment.get('retryAfterLogin'), pm.environment.get('retryAfterVcLogin')].includes(pm.info.requestName);",
"if (retrying) { console.log('401: retry scheduled after login, assertions deferred'); } else {",
"pm.test('200', () => pm.response.to.have.status(200));",
"const m = pm.response.json();",
"console.log(`${m.host} ping=${m.hypervisorManagerPingStatus}`);",
"}"
]
}
}
]
}
]
},
{
"name": "06 Cleanup and logout",
"item": [
{
"name": "[WRITE] Restore original QoS",
"request": {
"method": "PUT",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Accept",
"value": "application/json"
},
{
"key": "Cookie",
"value": "JSESSIONID={{tintriSession}}"
}
],
"url": "{{baseUrl}}/api/v310/vm/{{vmUuid}}/qosConfig",
"body": {
"mode": "raw",
"raw": "{\n \"typeId\": \"com.tintri.api.rest.v310.dto.Request\",\n \"objectsWithNewValues\": [\n {\n \"typeId\": \"com.tintri.api.rest.v310.dto.domain.beans.vm.VirtualMachineQoSConfig\",\n \"minNormalizedIops\": {{origQosMin}},\n \"maxNormalizedIops\": {{origQosMax}}\n }\n ],\n \"propertiesToBeUpdated\": [\n \"minNormalizedIops\",\n \"maxNormalizedIops\"\n ]\n}",
"options": {
"raw": {
"language": "json"
}
}
}
},
"event": [
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
"const retrying = pm.response.code === 401 && [pm.environment.get('retryAfterLogin'), pm.environment.get('retryAfterVcLogin')].includes(pm.info.requestName);",
"if (retrying) { console.log('401: retry scheduled after login, assertions deferred'); } else {",
"pm.test('QoS restored (204)', () => pm.response.to.have.status(204));",
"}"
]
}
}
]
},
{
"name": "[WRITE] Delete test snapshot",
"request": {
"method": "DELETE",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Accept",
"value": "application/json"
},
{
"key": "Cookie",
"value": "JSESSIONID={{tintriSession}}"
}
],
"url": "{{baseUrl}}/api/v310/snapshot/{{snapshotUuid}}"
},
"event": [
{
"listen": "prerequest",
"script": {
"type": "text/javascript",
"exec": [
"if (!pm.environment.get('snapshotUuid')) { pm.execution.skipRequest(); }"
]
}
},
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
"const retrying = pm.response.code === 401 && [pm.environment.get('retryAfterLogin'), pm.environment.get('retryAfterVcLogin')].includes(pm.info.requestName);",
"if (retrying) { console.log('401: retry scheduled after login, assertions deferred'); } else {",
"pm.test('snapshot deleted', () => pm.expect(pm.response.code).to.be.oneOf([200, 204]));",
"console.log(pm.response.text());",
"pm.environment.unset('snapshotUuid');",
"}"
]
}
}
]
},
{
"name": "Logout from VMstore",
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Accept",
"value": "application/json"
},
{
"key": "Cookie",
"value": "JSESSIONID={{tintriSession}}"
}
],
"url": "{{baseUrl}}/api/v310/session/logout"
},
"event": [
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
"const retrying = pm.response.code === 401 && [pm.environment.get('retryAfterLogin'), pm.environment.get('retryAfterVcLogin')].includes(pm.info.requestName);",
"if (retrying) { console.log('401: retry scheduled after login, assertions deferred'); } else {",
"pm.test('logout returns 204', () => pm.response.to.have.status(204));",
"pm.environment.unset('tintriSession');",
"}"
]
}
}
]
},
{
"name": "Logout from vCenter",
"request": {
"method": "DELETE",
"header": [
{
"key": "vmware-api-session-id",
"value": "{{vcSession}}"
}
],
"url": "{{vcenterUrl}}/api/session"
},
"event": [
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
"const retrying = pm.response.code === 401 && [pm.environment.get('retryAfterLogin'), pm.environment.get('retryAfterVcLogin')].includes(pm.info.requestName);",
"if (retrying) { console.log('401: retry scheduled after login, assertions deferred'); } else {",
"pm.test('vCenter session deleted (204)', () => pm.response.to.have.status(204));",
"pm.environment.unset('vcSession');",
"}"
]
}
}
]
}
]
}
]
}
{
"id": "e95296b8-a829-5c9e-add3-eea40529076b",
"name": "vmstore01.lab.local + vcenter01.lab.local",
"values": [
{
"key": "baseUrl",
"value": "https://vmstore01.lab.local",
"type": "default",
"enabled": true
},
{
"key": "username",
"value": "svc-vmstore-api",
"type": "default",
"enabled": true
},
{
"key": "password",
"value": "",
"type": "secret",
"enabled": true
},
{
"key": "fullApiVersion",
"value": "v310.207",
"type": "default",
"enabled": true
},
{
"key": "datastoreId",
"value": "default",
"type": "default",
"enabled": true
},
{
"key": "vcenterUrl",
"value": "https://vcenter01.lab.local",
"type": "default",
"enabled": true
},
{
"key": "vcenterUsername",
"value": "svc-vmstore-api@vsphere.local",
"type": "default",
"enabled": true
},
{
"key": "vcenterPassword",
"value": "",
"type": "secret",
"enabled": true
},
{
"key": "vcenterName",
"value": "vcenter01.lab.local",
"type": "default",
"enabled": true
},
{
"key": "vmName",
"value": "app01",
"type": "default",
"enabled": true
},
{
"key": "allowWrites",
"value": "false",
"type": "default",
"enabled": true
},
{
"key": "allowDestructive",
"value": "false",
"type": "default",
"enabled": true
},
{
"key": "snapshotName",
"value": "api-smoke-test",
"type": "default",
"enabled": true
},
{
"key": "snapshotRetentionMinutes",
"value": "240",
"type": "default",
"enabled": true
},
{
"key": "cloneName",
"value": "app01-apiclone",
"type": "default",
"enabled": true
},
{
"key": "qosMin",
"value": "0",
"type": "default",
"enabled": true
},
{
"key": "qosMax",
"value": "5000",
"type": "default",
"enabled": true
},
{
"key": "syncTargetVmUuid",
"value": "",
"type": "default",
"enabled": true
},
{
"key": "syncSnapshotUuid",
"value": "",
"type": "default",
"enabled": true
},
{
"key": "syncDisk",
"value": "scsi0:1",
"type": "default",
"enabled": true
},
{
"key": "taskPollMax",
"value": "60",
"type": "default",
"enabled": true
},
{
"key": "taskPollDelayMs",
"value": "5000",
"type": "default",
"enabled": true
},
{
"key": "tintriSession",
"value": "",
"type": "secret",
"enabled": true
},
{
"key": "vcSession",
"value": "",
"type": "secret",
"enabled": true
},
{
"key": "vmUuid",
"value": "",
"type": "default",
"enabled": true
},
{
"key": "vmMor",
"value": "",
"type": "default",
"enabled": true
},
{
"key": "vmInstanceUuid",
"value": "",
"type": "default",
"enabled": true
},
{
"key": "origQosMin",
"value": "0",
"type": "default",
"enabled": true
},
{
"key": "origQosMax",
"value": "0",
"type": "default",
"enabled": true
},
{
"key": "snapshotUuid",
"value": "",
"type": "default",
"enabled": true
},
{
"key": "taskId",
"value": "",
"type": "default",
"enabled": true
},
{
"key": "taskPollCount",
"value": "0",
"type": "default",
"enabled": true
},
{
"key": "hypervisorManagerId",
"value": "",
"type": "default",
"enabled": true
}
],
"_postman_variable_scope": "environment"
}
Run it in Postman
- Import both files, select the environment, set
baseUrl,vcenterUrl,username,vcenterUsername,vcenterNameandvmName, and type the two passwords into the current value only. - If the VMstore or vCenter certificate is not trusted by your machine, add the issuing CA under Settings, Certificates rather than turning off SSL verification globally.
- Open the Collection Runner, keep the folder order, run. With the defaults you get a read-only health and identity check. Set
allowWrites=truefor the snapshot, QoS and clone round trip, against a test VM.
Run it with newman
# newman 6.1+ (npm install -g newman). Read-only smoke test, JUnit output for CI.
newman run 22-vmware-vsphere-tintri-vmstore-rest-api-guide.postman_collection.json \
-e 22-vmware-vsphere-tintri-vmstore-rest-api-guide.postman_environment.json \
--env-var "baseUrl=https://vmstore01.lab.local" \
--env-var "vcenterUrl=https://vcenter01.lab.local" \
--env-var "password=${TINTRI_PASSWORD}" \
--env-var "vcenterPassword=${VC_PASSWORD}" \
--env-var "vmName=app01" \
--ssl-extra-ca-certs /etc/pki/lab-root-ca.pem \
--timeout-request 60000 \
-r cli,junit --reporter-junit-export results/vmstore-smoke.xml
# Lab only: skip certificate verification instead of trusting the CA
# add --insecure (never in a pipeline that holds production credentials)
# Write round trip against a test VM: snapshot, QoS, clone, verify, clean up
newman run ...collection.json -e ...environment.json \
--env-var "allowWrites=true" --env-var "vmName=apitest01" --env-var "cloneName=apitest01-clone" \
--env-var "password=${TINTRI_PASSWORD}" --env-var "vcenterPassword=${VC_PASSWORD}"
# One folder only, for example the troubleshooting checks
newman run ...collection.json -e ...environment.json --folder "01 Auth" --folder "05 Troubleshoot" \
--folder "06 Cleanup and logout" --env-var "password=${TINTRI_PASSWORD}" --env-var "vcenterPassword=${VC_PASSWORD}"
As a CI smoke test, run the read-only form after every TxOS upgrade, vCenter upgrade, certificate rotation and service-account password rotation; those are exactly the changes that break integrations silently. newman exits non-zero when any assertion fails, so a pipeline step fails without extra glue. The JUnit file shows each pm.test as a test case, which makes “exactly one ACTIVE controller” or “instance_uuid matches the VMstore record” visible in the CI UI. For a nightly run from cron on a jump host:
# /etc/cron.d/vmstore-api-smoke (runs as a dedicated user; secrets in a root-only env file)
SHELL=/bin/bash
15 6 * * * svc-api . /etc/vmstore-api/secrets.env && cd /opt/vmstore-api && \
newman run 22-vmware-vsphere-tintri-vmstore-rest-api-guide.postman_collection.json \
-e 22-vmware-vsphere-tintri-vmstore-rest-api-guide.postman_environment.json \
--env-var "password=${TINTRI_PASSWORD}" --env-var "vcenterPassword=${VC_PASSWORD}" \
--ssl-extra-ca-certs /etc/pki/lab-root-ca.pem -r cli,junit \
--reporter-junit-export "/var/log/vmstore-api/smoke-$(date -u +\%Y\%m\%dT\%H\%M\%SZ).xml" \
>> /var/log/vmstore-api/smoke.log 2>&1 || logger -t vmstore-api "newman smoke test FAILED"
14. End-to-end workflow
From nothing to a green newman run and one verified write round trip. Each step has the check that proves it worked.
| # | Step | Verify with | Expected |
|---|---|---|---|
| 1 | Create a VMstore local or AD account for automation with the Read Only role, and a second with System Admin for writes. Create a vCenter account with read access. | VMstore UI user list; GET /v310/session/current after login | Roles shown match what you intended |
| 2 | Trust the certificates: export the issuing CA for the VMstore and vCenter certificates to a PEM file on the workstation or runner. | curl -sS --cacert ca.pem https://vmstore01.lab.local/api/info | 200 with a RestApi body, no -k |
| 3 | Read the API versions and set fullApiVersion to the newest one your TxOS supports. | GET /api/info | supportedVersionSet contains the version you set |
| 4 | Run the curl login script from section 04. | session/current output | Your user, your role, an expirationTime in the future; logout HTTP 204 |
| 5 | Check health and registration (section 05). | operationalStatus, controller, hypervisorManagerConfig | isFilesystemUp: true; one ACTIVE and one STANDBY; your vCenter listed as VMWARE |
| 6 | Run Get-VMstoreVmMap.ps1 with the read-only accounts. | The summary table | All VMs MATCH; investigate anything else before automating |
| 7 | Import the collection and environment; run read-only with newman. | newman summary | 0 failed assertions; [WRITE] requests listed as skipped |
| 8 | Pick a test VM, set allowWrites=true and vmName, run again with the write account. | newman output; VMstore UI | Snapshot created and listed, QoS read back equal, clone task SUCCESS, clone visible in vCenter, QoS restored, snapshot deleted |
| 9 | Delete the clone VM from vCenter (power off, delete from disk). | GET /api/vcenter/vm?names=app01-apiclone | Empty list |
| 10 | Schedule the read-only run (cron or CI) and wire the JUnit output into your alerting. | First scheduled run | A results XML per run, a syslog line on failure |
15. API reference table
Checked against: Tintri REST API v310.207 (TxOS 6.0.3) public reference, and the vSphere Automation API reference on developer.broadcom.com at /latest/ (9.1.2; all calls also present in 9.0). “v310 (pre-v310.101)” means the call predates the oldest supported API version, so it is present on every supported TxOS. VMstore paths are relative to https://<vmstore>/api, vCenter paths to https://<vcenter>.
| Method | Path | Purpose | Key fields | Since |
|---|---|---|---|---|
| GET | /info | API versions, no auth | preferredVersion, supportedVersionSet | v310 (pre-v310.101) |
| POST | /v310/session/login | Log in, sets JSESSIONID | typeId RestApiCredentials, username, password, fullApiVersion | v310 (pre-v310.101) |
| GET | /v310/session/current | Current session | userName, roles, expirationTime | v310.51 |
| GET | /v310/session/active | All sessions | userName, clientIp, clientType | v310.51 |
| POST | /v310/session/{tintriSessionId}/invalidate | End a session (Admin) | path id from session/active | v310.71 |
| POST | /v310/session/logout | Log out (204) | none | v310 (pre-v310.101); GET form deprecated |
| GET | /v310/appliance/default/info | Model, TxOS | modelName, osVersion, isAllFlash | v310 (pre-v310.101) |
| GET | /v310/appliance/default/operationalStatus | Health | isFilesystemUp, urgentMessage, restartFlag | v310 (pre-v310.101) |
| GET | /v310/appliance/default/controller | Controllers | role, state, osVersion | v310.31 |
| GET | /v310/appliance/default/failedComponents | Failed hardware | list | v310 (pre-v310.101) |
| GET / POST | /v310/datastore/default/hypervisorManagerConfig | Read / add vCenter registration | hypervisorType, host, username | v310.21 |
| PUT | /v310/datastore/default/hypervisorManagerConfig/{managerConfigId} | Rotate registration credentials | username, password | v310.21 |
| GET | /v310/datastore/default/hypervisorManagerConfig/{managerId}?refresh= | One registration, optional refresh | hypervisorManagerPingStatus | v310.171 |
| GET | /v310/datastore/default/statsSummary | Latest datastore stats | spaceUsedPhysicalGiB, spaceRemainingDays, latencyTotalMs | v310 (pre-v310.101) |
| GET | /v310/datastore/default/statsRealtime, statsHistoric | Datastore time series | sortedStats[] | v310 (pre-v310.101) |
| GET | /v310/datastore/default/hostResources | vCenter compute targets for clones | hostname, type | v310 (pre-v310.101) |
| GET | /v310/datastore/default/qosInfo | System QoS totals | total minimum IOPS allocated | v310.21 |
| GET | /v310/vm | List VMs (paged) | name, live, limit, offset, next | v310 (pre-v310.101) |
| GET | /v310/vm/{vmId} | One VM | vmware, qosConfig, snapshot, replication, stat | v310 (pre-v310.101) |
| GET | /v310/vm/{vmId}/statsRealtime, statsHistoric | VM time series | latency*Ms, operations*Iops | v310 (pre-v310.101) |
| POST | /v310/snapshot | Manual snapshots | list of SnapshotSpec | v310 (pre-v310.101) |
| GET | /v310/snapshot | List snapshots | vmUuid, type, limit | v310 (pre-v310.101) |
| GET / DELETE | /v310/snapshot/{tintriUuid} | Read / delete one snapshot | uuid | v310 (pre-v310.101) |
| POST | /v310/snapshot/{uuid}/lock, /unlock | Lock / unlock (DPA role) | none | v310.183 |
| PUT | /v310/vm/{vmId}/qosConfig | Per-VM QoS | Request of VirtualMachineQoSConfig | v310.21 |
| PUT | /v310/vm/qosConfig | Bulk QoS | MultipleSelectionRequest | v310.21 |
| POST | /v310/vm/sync | SyncVM, returns Task | type, targetVmTintriUuids, snapshotTintriUuid | v310.21 |
| POST | /v310/vm | Clone, returns Task | VirtualMachineCloneSpec, vmware.cloneVmName | v310 (pre-v310.101) |
| GET | /v310/task/{id} | Task status | state, jobDone, progressPercent, error | v310 (pre-v310.101) |
| GET | /v310/datastore/default/replicationPath | Replication paths | destinationIp, destinationPort | v310 (pre-v310.101) |
| POST | /v310/datastore/default/testReplicationPath | Test a path | TestReplicationPath | v310.41 |
| PUT | /v310/vm/{vmId}/replicationConfigs | Per-VM outgoing replication | list of VirtualMachineReplicationConfig | v310.21 |
| GET | /v310/alert | Alerts (paged) | state, severity, since | v310 (pre-v310.101) |
| GET | /v310/alert/paginated | Alerts, paginated variant | limit, offset | v310.191 |
| PUT | /v310/servicegroup/{id}/mountIp | Service group mount IP | string | v310.207 |
| POST | /api/session (vCenter) | vCenter token | HTTP Basic | vSphere 7.0 (/api); /rest path is legacy |
| GET | /api/vcenter/vm (vCenter) | List VMs (max 4000) | names, clusters, hosts, power_states | vSphere 7.0 (/api) |
| GET | /api/vcenter/vm/{vm} (vCenter) | VM detail with identity | identity.instance_uuid, identity.bios_uuid | identity since API 6.7.1 |
| DELETE | /api/session (vCenter) | End vCenter session (204) | vmware-api-session-id | vSphere 7.0 (/api) |
If you are on older TxOS or older scripts. Replace
GET /v310/session/logoutwithPOST; replacePUT /v310/datastore/{uuid}/replicationPath/testwithPOST /v310/datastore/{uuid}/testReplicationPath; replacePOST/PUT/DELETE /v310/vm/{vmId}/replicationConfigandPOST /v310/vm/replicationConfigwithPUT /v310/vm/{vmId}/replicationConfigs; and on vCenter replace/rest/com/vmware/cis/sessionwith/api/session. A login withoutfullApiVersiongets v310.1 behaviour.
16. Error shapes and what they mean
The VMstore returns a TintriError body on errors. The shape, from Tintri’s reference:
{
"typeId": "com.tintri.api.rest.v310.dto.domain.beans.TintriError",
"code": "ERR-API-8001",
"message": "Failed to find requested resource of type VirtualMachine with id: 'xxxxddd'",
"causeDetails": "",
"title": "Resource not found"
}
vCenter returns its own structure on /api errors: an error_type (for example UNAUTHENTICATED, UNAUTHORIZED, NOT_FOUND, INVALID_ARGUMENT) and a messages list with default_message and id. Log both bodies; the HTTP code alone rarely tells you which of several causes you hit.
| HTTP | Tintri meaning (reference) | Typical cause in practice | What the admin does |
|---|---|---|---|
| 400 | Request validation failed | Missing or wrong typeId; retention not -1 and not above 59 (ERR-API-3105 invalid create snapshot); bad clone spec (ERR-API-3205); unknown query parameter (ERR-API-4003) | Compare the body with the DTO for your API version; print the request |
| 401 | Not authorized, needs a successful login | No cookie, expired session, session invalidated by an admin | Log in again once; if it repeats, check the account is not locked or expired |
| 403 | Forbidden: invalid credentials or licenses | Read Only account doing a write; a licensed feature (Tintri cites /v310/vm/sync) without the licence | Use the write account; check licences on the VMstore |
| 404 | API not found | Wrong path or version prefix; a VM or snapshot UUID that no longer exists (ERR-API-8001); calling a v310.191 endpoint on older TxOS | Check /api/info; re-query the object |
| 405 | Method not allowed | GET where POST is required, for example an old logout script after the GET form is removed | Use the method in the reference table |
| 409 | Conflict: object already exists | Creating something that exists (a service group, a path) | GET it and reuse it; do not retry the create |
| 500 | Internal error | Clone or snapshot workflow failure (ERR-API-3206, ERR-API-3213, ERR-API-3106), SyncVM failure (ERR-API-3701) | Read the task error; check the vCenter registration and VMstore alerts |
| 501 | Not implemented | A VMstore-only call sent to TGC, or the reverse | Send it to the right endpoint |
| 503 | Service unavailable, usually temporary | External service such as AD unavailable; snapshot inventory still loading (ERR-API-9013) | Retry with back-off |
17. Troubleshooting
| Symptom | Likely cause | Check | Fix |
|---|---|---|---|
| curl or Postman fails before any HTTP status | TLS: untrusted CA, or a client that cannot do TLS 1.2 (TxOS 5.6.0.1 and later accept only TLS 1.2) | openssl s_client -connect vmstore01.lab.local:443 -tls1_2 -brief </dev/null | Trust the issuing CA; upgrade the client runtime; do not fall back to -k in production |
| Login returns 200, next call returns 401 | Cookie not sent: header typo, a proxy stripping cookies, or the script not using the session variable | Print request headers; in Postman, the console shows the Cookie header | Send JSESSIONID on every call; bypass the proxy for the VMstore |
| Calls work for a while, then 401 | Session expired or invalidated | GET /v310/session/current expirationTime; session/active | Re-login on 401 (the collection does it once); stop leaking sessions |
| 403 on a write | Account role is Read Only, or the feature needs a licence | session/current roles | Use the System Admin automation account; check licences |
| 404 on a path that is in this guide | TxOS older than the “Since” version; or /api missing from the URL | GET /api/info; the version matrix in section 01 | Use the older equivalent or upgrade TxOS |
| 400 on a PUT that looks right | Wrong typeId or envelope (Request vs MultipleSelectionRequest), or a property missing from propertiesToBeUpdated | Compare with the DTO page for that call | Fix the envelope; the server ignores properties not listed |
| VM list is missing VM names, only files | vCenter registration broken (expired service-account password, DNS) | GET .../hypervisorManagerConfig; VMstore alerts | Rotate the password with the PUT; fix DNS from the VMstore admin network |
| Mapping script shows NAME_ONLY for everything | The mor format differs from vCenter’s vm id, or the VMstore reports another vCenter name | Dump one VM: jq .items[0].vmware | Adjust the join (strip any prefix) or pass the vCenter name the VMstore reports |
| Clone task FAILED | vCenter not a COMPUTE_RESOURCE target, name clash, or no space | GET /v310/task/{id} error; hostResources | Fix the target; pick a unique cloneVmName |
| SyncVM fails on VDISK | Disk identifiers do not exist on source or target | GET /v310/snapshot/{uuid}/disks and the VM’s disks | Use the identifiers the snapshot reports |
| newman shows [WRITE] requests as skipped | Guard working as intended | Run log: “SKIP … set allowWrites=true” | Set the flag only for test VMs |
| newman: “pm.execution.skipRequest is not a function” | newman older than 6.1.0 | newman --version | Upgrade newman |
| vCenter calls 401 after an hour of a long run | vCenter session idle-expired | Postman console | The collection re-logs in once; split very long runs |
| Large NFS I/O stalls while the API looks healthy | Data path problem, not API: MTU black hole or VLAN on the storage path | vmkping -I vmk2 -d -s 8972 <data IP> | Fix MTU end to end (section 12, part 2) |
18. What’s next
With the session, discovery, identity mapping and the write calls in place, the next steps are scale and operations. The Tintri Global Center API guide does the same across a fleet of VMstores with service groups, and the API-driven troubleshooting guide turns the calls here into symptom playbooks with a correlated vCenter and VMstore timeline. The design guide shows how each design decision becomes one of these API calls, the vSphere Automation REST API deploy guide builds the cluster underneath, and the VCF 9 on Tintri NFS guide does it for VCF. For the conceptual background, go back to part 3 and part 5 of the joint series. On the existing site, the daily Tintri fleet sweep, the vSphere and VMstore latency correlation script and the Tintri PowerShell Core Toolkit 5.1 post are the natural companions if you prefer cmdlets to raw REST.
Leave a Reply