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. : Targets_Get.
  • Default Api Version. : 2025-01-02.
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 null.

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

Applies to