Skip to main content

labels

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

Overview

Namelabels
TypeResource
Idazure.defender.labels

Fields

NameDatatypeDescription
colortextfield from the properties object
display_nametextfield from the properties object
labelNametextfield from the properties object
provisioning_statetextfield from the properties object
resourceGroupNametextfield from the properties object
subscriptionIdtextfield from the properties object
workspaceNametextfield from the properties object

Methods

NameAccessible byRequired ParamsDescription
get_by_workspaceSELECTlabelName, resourceGroupName, subscriptionId, workspaceNameReturns a label in the given workspace.
list_by_workspaceSELECTresourceGroupName, subscriptionId, workspaceNameReturns a list of labels in the given workspace.
create_and_updateINSERTlabelName, resourceGroupName, subscriptionId, workspaceNameCreate or update a Label.
deleteDELETElabelName, resourceGroupName, subscriptionId, workspaceNameDelete a Label.
updateUPDATElabelName, resourceGroupName, subscriptionId, workspaceNameUpdate a Label.

SELECT examples

Returns a list of labels in the given workspace.

SELECT
color,
display_name,
labelName,
provisioning_state,
resourceGroupName,
subscriptionId,
workspaceName
FROM azure.defender.vw_labels
WHERE resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}'
AND workspaceName = '{{ workspaceName }}';

INSERT example

Use the following StackQL query and manifest file to create a new labels resource.

/*+ create */
INSERT INTO azure.defender.labels (
labelName,
resourceGroupName,
subscriptionId,
workspaceName,
properties
)
SELECT
'{{ labelName }}',
'{{ resourceGroupName }}',
'{{ subscriptionId }}',
'{{ workspaceName }}',
'{{ properties }}'
;

UPDATE example

Updates a labels resource.

/*+ update */
UPDATE azure.defender.labels
SET
properties = '{{ properties }}'
WHERE
labelName = '{{ labelName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}'
AND workspaceName = '{{ workspaceName }}';

DELETE example

Deletes the specified labels resource.

/*+ delete */
DELETE FROM azure.defender.labels
WHERE labelName = '{{ labelName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}'
AND workspaceName = '{{ workspaceName }}';