targets
Creates, updates, deletes, gets or lists a targets resource.
Overview
| Name | targets |
| Type | Resource |
| Id | azure.database_watcher.targets |
Fields
The following fields are returned by SELECT queries:
- get
- list_by_watcher
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long |
name | string | The name of the resource. |
connectionServerName | string | The server name to use in the connection string when connecting to a target. Port number and instance name must be specified separately. Required. |
provisioningState | string | The provisioning state of the resource. Known values are: "Succeeded", "Failed", and "Canceled". (Succeeded, Failed, Canceled) |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
targetAuthenticationType | string | The type of authentication to use when connecting to a target. Required. Known values are: "Aad" and "Sql". (Aad, Sql) |
targetType | string | Discriminator property for TargetProperties. Required. Default value is None. |
targetVault | object | To use SQL authentication when connecting to targets, specify the vault where the login name and password secrets are stored. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long |
name | string | The name of the resource. |
connectionServerName | string | The server name to use in the connection string when connecting to a target. Port number and instance name must be specified separately. Required. |
provisioningState | string | The provisioning state of the resource. Known values are: "Succeeded", "Failed", and "Canceled". (Succeeded, Failed, Canceled) |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
targetAuthenticationType | string | The type of authentication to use when connecting to a target. Required. Known values are: "Aad" and "Sql". (Aad, Sql) |
targetType | string | Discriminator property for TargetProperties. Required. Default value is None. |
targetVault | object | To use SQL authentication when connecting to targets, specify the vault where the login name and password secrets are stored. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | resource_group_name, watcher_name, target_name, subscription_id | Get a Target. | |
list_by_watcher | select | resource_group_name, watcher_name, subscription_id | List Target resources by Watcher. | |
create_or_update | insert | resource_group_name, watcher_name, target_name, subscription_id | Create a Target. | |
create_or_update | replace | resource_group_name, watcher_name, target_name, subscription_id | Create a Target. | |
delete | delete | resource_group_name, watcher_name, target_name, subscription_id | Delete 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.
| Name | Datatype | Description |
|---|---|---|
resource_group_name | string | The name of the resource group. The name is case insensitive. Required. |
subscription_id | string | |
target_name | string | The target resource name. Required. |
watcher_name | string | The database watcher name. Required. |
SELECT examples
- get
- list_by_watcher
Get a Target.
SELECT
id,
name,
connectionServerName,
provisioningState,
systemData,
targetAuthenticationType,
targetType,
targetVault,
type
FROM azure.database_watcher.targets
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND watcher_name = '{{ watcher_name }}' -- required
AND target_name = '{{ target_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
List Target resources by Watcher.
SELECT
id,
name,
connectionServerName,
provisioningState,
systemData,
targetAuthenticationType,
targetType,
targetVault,
type
FROM azure.database_watcher.targets
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND watcher_name = '{{ watcher_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
INSERT examples
- create_or_update
- Manifest
Create a Target.
INSERT INTO azure.database_watcher.targets (
properties,
resource_group_name,
watcher_name,
target_name,
subscription_id
)
SELECT
'{{ properties }}',
'{{ resource_group_name }}',
'{{ watcher_name }}',
'{{ target_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
properties,
systemData,
type
;
# Description fields are for documentation purposes
- name: targets
props:
- name: resource_group_name
value: "{{ resource_group_name }}"
description: Required parameter for the targets resource.
- name: watcher_name
value: "{{ watcher_name }}"
description: Required parameter for the targets resource.
- name: target_name
value: "{{ target_name }}"
description: Required parameter for the targets resource.
- name: subscription_id
value: "{{ subscription_id }}"
description: Required parameter for the targets resource.
- name: properties
description: |
The resource-specific properties for this resource.
value:
targetType: "{{ targetType }}"
targetAuthenticationType: "{{ targetAuthenticationType }}"
targetVault:
akvResourceId: "{{ akvResourceId }}"
akvTargetUser: "{{ akvTargetUser }}"
akvTargetPassword: "{{ akvTargetPassword }}"
connectionServerName: "{{ connectionServerName }}"
provisioningState: "{{ provisioningState }}"
REPLACE examples
- create_or_update
Create a Target.
REPLACE azure.database_watcher.targets
SET
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND watcher_name = '{{ watcher_name }}' --required
AND target_name = '{{ target_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
properties,
systemData,
type;
DELETE examples
- delete
Delete a Target.
DELETE FROM azure.database_watcher.targets
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND watcher_name = '{{ watcher_name }}' --required
AND target_name = '{{ target_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;