Skip to main content

targets

Creates, updates, deletes, gets or lists a targets resource.

Overview

Nametargets
TypeResource
Idazure.db_watcher.targets

Fields

The following fields are returned by SELECT queries:

Azure operation completed successfully.

NameDatatypeDescription
propertiesobjectThe resource-specific properties for this resource.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectsubscriptionId, resourceGroupName, watcherName, targetNameGet a Target
list_by_watcherselectsubscriptionId, resourceGroupName, watcherNameList Target resources by Watcher
create_or_updateinsertsubscriptionId, resourceGroupName, watcherName, targetNameCreate a Target
deletedeletesubscriptionId, resourceGroupName, watcherName, targetNameDelete a Target

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
resourceGroupNamestringThe name of the resource group. The name is case insensitive.
subscriptionIdstring (uuid)The ID of the target subscription. The value must be an UUID.
targetNamestringThe target resource name.
watcherNamestringThe database watcher name.

SELECT examples

Get a Target

SELECT
properties
FROM azure.db_watcher.targets
WHERE subscriptionId = '{{ subscriptionId }}' -- required
AND resourceGroupName = '{{ resourceGroupName }}' -- required
AND watcherName = '{{ watcherName }}' -- required
AND targetName = '{{ targetName }}' -- required
;

INSERT examples

Create a Target

INSERT INTO azure.db_watcher.targets (
data__properties,
subscriptionId,
resourceGroupName,
watcherName,
targetName
)
SELECT
'{{ properties }}',
'{{ subscriptionId }}',
'{{ resourceGroupName }}',
'{{ watcherName }}',
'{{ targetName }}'
RETURNING
properties
;

DELETE examples

Delete a Target

DELETE FROM azure.db_watcher.targets
WHERE subscriptionId = '{{ subscriptionId }}' --required
AND resourceGroupName = '{{ resourceGroupName }}' --required
AND watcherName = '{{ watcherName }}' --required
AND targetName = '{{ targetName }}' --required
;