VCenter Connections Confirm Inventory Hold

VCenter Connections Confirm Inventory Hold
Confirm a held removal of hosts missing from a vCenter snapshot

A complete vCenter snapshot that would remove an empty or unusually large share of the connection's current hosts is not applied: the hosts it lists are updated and removal is held (inventoryHoldReason on the connection). This operation lets an administrator accept the removal. observedHostCount must equal inventoryHoldObservedHosts and holdId must equal inventoryHoldId. The audit record VCENTER_INVENTORY_REMOVAL_CONFIRMED is written first and the confirmation is armed only after that transaction commits. The worker re-reads the whole inventory on its next baseline (after the running long poll returns, up to about 90 seconds) and removes the missing hosts only if that new snapshot lists exactly the held hosts (same host set, not just the same count), the known host count is unchanged, the same vCenter is read and the confirmation has not expired (vtp.discovery.prune-guard.confirmation-ttl-minutes, default 10); the confirmation is single use and is cleared by any failure, stop or replacement hold, in which case the removal is held again with a new inventoryHoldId. A non-numeric id returns 400 INVALID_CONNECTION_ID, a missing or negative count 400 INVALID_OBSERVED_HOST_COUNT, a missing or blank holdId 400 INVALID_HOLD_ID, an unknown connection 404 CONNECTION_NOT_FOUND, no held removal 409 INVENTORY_HOLD_NOT_ACTIVE, a holdId that is not the current hold's (the hold changed since it was shown) 409 INVENTORY_HOLD_STALE and a different count 409 INVENTORY_HOLD_COUNT_MISMATCH. Requires the ADMIN role.

Request
URI
POST
https://{api_host}/api/v1/vcenter-connections/{id}/inventory-hold/confirm
COPY
Path Parameters
string
id
Required  

vCenter connection id

id example
1

Request Body

The host count (observedHostCount, a non-negative whole number equal to inventoryHoldObservedHosts) and the hold identifier (holdId, equal to inventoryHoldId) the administrator saw.

ConfirmInventoryHoldRequest of type(s) application/json
Required  

Show optional properties

{
    "observedHostCount": 0,
    "holdId": "string"
}
{
    "observedHostCount": 0,
    "holdId": "00000000-0000-4000-8000-000000000031"
}
integer As int32 As int32
observedHostCount
Required  

The host count of the held snapshot, as read from inventoryHoldObservedHosts. It must equal the current hold's count

string
holdId
Required  

The hold the administrator saw, as read from inventoryHoldId. The confirmation applies only to that hold

Authentication
This operation uses the following authentication methods.
Responses
204

204 No Content: the confirmation was recorded and a new baseline requested

Operation doesn't return any data structure

400

400 Bad Request: INVALID_CONNECTION_ID, INVALID_OBSERVED_HOST_COUNT or INVALID_HOLD_ID

Returns ApiErrorResponse of type(s) application/json
{
    "errorCode": "string",
    "message": "string",
    "path": "string",
    "timestamp": "string",
    "reason": "string"
}
errorCode
Required  

Stable machine-readable error code. The known values are listed in ApiErrorCode; the set is not closed, so a client must tolerate an unlisted value.

string
message
Required  

Human-readable error description

string
path
Required  

Request URI path that produced the error

string As date-time As date-time
timestamp
Required  

Timestamp when the error occurred as an ISO 8601 date-time with offset

string
reason
Optional

A finer code, present only where an endpoint documents it. The Rule Pack endpoints' PACK_ENTRY_INVALID carries the import core's code here.


401

401 Unauthorized: UNAUTHENTICATED when the VTP_SESSION cookie is missing, unknown, expired or revoked

Returns Unauthenticated of type(s) application/json
{
    "errorCode": "string",
    "message": "string",
    "path": "string",
    "timestamp": "string",
    "reason": "string"
}
errorCode
Required  

Stable machine-readable error code. The known values are listed in ApiErrorCode; the set is not closed, so a client must tolerate an unlisted value.

string
message
Required  

Human-readable error description

string
path
Required  

Request URI path that produced the error

string As date-time As date-time
timestamp
Required  

Timestamp when the error occurred as an ISO 8601 date-time with offset

string
reason
Optional

A finer code, present only where an endpoint documents it. The Rule Pack endpoints' PACK_ENTRY_INVALID carries the import core's code here.


403

403 Forbidden: FORBIDDEN when the signed-in role is not ADMIN; CSRF_ERROR when the X-XSRF-TOKEN header is missing or wrong on a POST, PUT, PATCH or DELETE (only POST /api/v1/auth/login is exempt, and a request without a valid session gets 401 UNAUTHENTICATED instead); PASSWORD_CHANGE_REQUIRED when the account must change its password first (only GET /api/v1/auth/session, POST /api/v1/auth/logout and POST /api/v1/auth/change-password are exempt)

Returns ApiErrorResponse of type(s) application/json
{
    "errorCode": "string",
    "message": "string",
    "path": "string",
    "timestamp": "string",
    "reason": "string"
}
errorCode
Required  

Stable machine-readable error code. The known values are listed in ApiErrorCode; the set is not closed, so a client must tolerate an unlisted value.

string
message
Required  

Human-readable error description

string
path
Required  

Request URI path that produced the error

string As date-time As date-time
timestamp
Required  

Timestamp when the error occurred as an ISO 8601 date-time with offset

string
reason
Optional

A finer code, present only where an endpoint documents it. The Rule Pack endpoints' PACK_ENTRY_INVALID carries the import core's code here.


404

404 Not Found: CONNECTION_NOT_FOUND

Returns ApiErrorResponse of type(s) application/json
"ApiErrorResponse Object"
errorCode
Required  

Stable machine-readable error code. The known values are listed in ApiErrorCode; the set is not closed, so a client must tolerate an unlisted value.

string
message
Required  

Human-readable error description

string
path
Required  

Request URI path that produced the error

string As date-time As date-time
timestamp
Required  

Timestamp when the error occurred as an ISO 8601 date-time with offset

string
reason
Optional

A finer code, present only where an endpoint documents it. The Rule Pack endpoints' PACK_ENTRY_INVALID carries the import core's code here.


409

409 Conflict: INVENTORY_HOLD_NOT_ACTIVE, INVENTORY_HOLD_STALE or INVENTORY_HOLD_COUNT_MISMATCH

Returns ApiErrorResponse of type(s) application/json
"ApiErrorResponse Object"
errorCode
Required  

Stable machine-readable error code. The known values are listed in ApiErrorCode; the set is not closed, so a client must tolerate an unlisted value.

string
message
Required  

Human-readable error description

string
path
Required  

Request URI path that produced the error

string As date-time As date-time
timestamp
Required  

Timestamp when the error occurred as an ISO 8601 date-time with offset

string
reason
Optional

A finer code, present only where an endpoint documents it. The Rule Pack endpoints' PACK_ENTRY_INVALID carries the import core's code here.


Code Samples
COPY
                    curl -X POST -H 'Authorization: <value>' -H 'Content-Type: application/json' -d '{"observedHostCount":"integer","holdId":"string"}' https://{api_host}/api/v1/vcenter-connections/{id}/inventory-hold/confirm