# IRPCTest.TestVaultAvailability

Location: [gRPC API](https://developer.m-files.com/APIs/gRPC-API/index.md) > [Vault API](https://developer.m-files.com/APIs/gRPC-API/vault/index.md) > [Connection and health checks](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCTest/index.md)

HTML version: https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCTest/TestVaultAvailability/

Badges: `Vault API / standard` `write` `no session`

Checks that a vault on this server is online and that its database and file data storage can be
accessed. No session needed.

- **Service:** [Connection and health checks](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCTest/index.md) `MFiles.IRPCTest`
- **gRPC method:** `/MFiles.IRPCTest/TestVaultAvailability`
- **HTTP (mf-http-grpc):** `POST /grpc/v1/test-vault-availability`
- **Request:** [`TestVaultAvailabilityRequest`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCTest/TestVaultAvailability/index.md#request)
- **Response:** [`TestVaultAvailabilityResponse`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCTest/TestVaultAvailability/index.md#response)
- **Book and level:** Vault API, standard
- **Kind:** write
- **Session:** Not needed: the call can be made before logging in.
- **Idempotent:** no
- **Returns metadata structure version:** no
- **Streaming:** none (unary)

<a id="remarks"></a>

## Remarks

Needs no session; an `mfiles-session-id-bin` header, if sent, is ignored. The call succeeds with an
empty response when the vault passes the checks.

When the vault is fully online, the server checks that the vault database and the vault's file
data storage can be accessed. A failed check returns the error code of the failure, with any
details replaced by `********`.

When the vault is not fully online, or the server is shutting down, the result depends on
`check_online_status`:

- `false`: the call succeeds without checking anything. Use this when an offline vault is not an
  error for you.
- `true`: the call fails with `E_MFILES_SHUTDOWN_IN_PROGRESS`, `E_MFILES_VAULT_OFFLINE`,
  `E_MFILES_VAULT_GOING_OFFLINE` or `E_MFILES_VAULT_NOT_READY` (the vault is still starting).
  The exception is a vault taken offline by its scheduled optimization job: the call succeeds.

An unknown vault GUID fails with `E_MFILES_UNKNOWN_VAULT` ("The specified document vault does not
exist.", with the detail `Vault ID: <guid>`) whatever `check_online_status` is. An empty string
counts as the all-zero GUID and fails the same way; a malformed GUID fails with `E_INVALIDARG`
("The parameter is incorrect.").

For a load balancer probe, prefer
[CheckVaultHealthAnonymous](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCTest/CheckVaultHealthAnonymous/index.md), which is made for
that purpose.

<a id="request"></a>

## Request: TestVaultAvailabilityRequest

> Nested message fields are expanded to depth 3; follow a type link for deeper levels and for the type's own page.

| Field | Type | Description |
|---|---|---|
| `vault` | `string` | The vault GUID, with or without braces, in any case. |
| `check_online_status` | `bool` | `true` to fail when the vault is not fully online; `false` to succeed without checks in that case. |

<a id="response"></a>

## Response: TestVaultAvailabilityResponse

No fields.

<a id="related"></a>

## Related methods

- [CheckVaultHealthAnonymous](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCTest/CheckVaultHealthAnonymous/index.md): Succeeds when a vault on this server is ready for use; fails otherwise. No session needed. Made for load balancer health probes.
