Share via


DatabaseWatcherTargetCollection.GetIfExists(String, CancellationToken) Method

Definition

Tries to get details for this resource from the service.

  • Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/targets/{targetName}
  • Operation Id: Target_Get
  • Default Api Version: 2025-01-02
  • Resource: DatabaseWatcherTargetResource
public virtual Azure.NullableResponse<Azure.ResourceManager.DatabaseWatcher.DatabaseWatcherTargetResource> GetIfExists(string targetName, System.Threading.CancellationToken cancellationToken = default);
abstract member GetIfExists : string * System.Threading.CancellationToken -> Azure.NullableResponse<Azure.ResourceManager.DatabaseWatcher.DatabaseWatcherTargetResource>
override this.GetIfExists : string * System.Threading.CancellationToken -> Azure.NullableResponse<Azure.ResourceManager.DatabaseWatcher.DatabaseWatcherTargetResource>
Public Overridable Function GetIfExists (targetName As String, Optional cancellationToken As CancellationToken = Nothing) As NullableResponse(Of DatabaseWatcherTargetResource)

Parameters

targetName
String

The target resource name.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

targetName is an empty string, and was expected to be non-empty.

targetName is null.

Applies to