targets
Creates, updates, deletes, gets or lists a targets
resource.
Overview
Name | targets |
Type | Resource |
Id | azure.db_watcher.targets |
Fields
- vw_targets
- targets
Name | Datatype | Description |
---|---|---|
connection_server_name | text | field from the properties object |
provisioning_state | text | field from the properties object |
resourceGroupName | text | field from the properties object |
subscriptionId | text | field from the properties object |
targetName | text | field from the properties object |
target_authentication_type | text | field from the properties object |
target_type | text | field from the properties object |
target_vault | text | field from the properties object |
watcherName | text | field from the properties object |
Name | Datatype | Description |
---|---|---|
properties | object | The generic properties of a target. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | resourceGroupName, subscriptionId, targetName, watcherName | Get a Target |
list_by_watcher | SELECT | resourceGroupName, subscriptionId, watcherName | List Target resources by Watcher |
create_or_update | INSERT | resourceGroupName, subscriptionId, targetName, watcherName | Create a Target |
delete | DELETE | resourceGroupName, subscriptionId, targetName, watcherName | Delete a Target |
SELECT
examples
List Target resources by Watcher
- vw_targets
- targets
SELECT
connection_server_name,
provisioning_state,
resourceGroupName,
subscriptionId,
targetName,
target_authentication_type,
target_type,
target_vault,
watcherName
FROM azure.db_watcher.vw_targets
WHERE resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}'
AND watcherName = '{{ watcherName }}';
SELECT
properties
FROM azure.db_watcher.targets
WHERE resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}'
AND watcherName = '{{ watcherName }}';
INSERT
example
Use the following StackQL query and manifest file to create a new targets
resource.
- All Properties
- Manifest
/*+ create */
INSERT INTO azure.db_watcher.targets (
resourceGroupName,
subscriptionId,
targetName,
watcherName,
properties
)
SELECT
'{{ resourceGroupName }}',
'{{ subscriptionId }}',
'{{ targetName }}',
'{{ watcherName }}',
'{{ properties }}'
;
- name: your_resource_model_name
props:
- name: properties
value:
- name: targetType
value: string
- name: targetAuthenticationType
value: []
- name: targetVault
value:
- name: akvResourceId
value: string
- name: akvTargetUser
value: string
- name: akvTargetPassword
value: string
- name: connectionServerName
value: string
- name: provisioningState
value: []
DELETE
example
Deletes the specified targets
resource.
/*+ delete */
DELETE FROM azure.db_watcher.targets
WHERE resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}'
AND targetName = '{{ targetName }}'
AND watcherName = '{{ watcherName }}';