labels
Creates, updates, deletes, gets or lists a labels
resource.
Overview
Name | labels |
Type | Resource |
Id | azure.defender.labels |
Fields
- vw_labels
- labels
Name | Datatype | Description |
---|---|---|
color | text | field from the properties object |
display_name | text | field from the properties object |
labelName | 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 |
workspaceName | text | field from the properties object |
Name | Datatype | Description |
---|---|---|
properties | object | Label properties. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get_by_workspace | SELECT | labelName, resourceGroupName, subscriptionId, workspaceName | Returns a label in the given workspace. |
list_by_workspace | SELECT | resourceGroupName, subscriptionId, workspaceName | Returns a list of labels in the given workspace. |
create_and_update | INSERT | labelName, resourceGroupName, subscriptionId, workspaceName | Create or update a Label. |
delete | DELETE | labelName, resourceGroupName, subscriptionId, workspaceName | Delete a Label. |
update | UPDATE | labelName, resourceGroupName, subscriptionId, workspaceName | Update a Label. |
SELECT
examples
Returns a list of labels in the given workspace.
- vw_labels
- labels
SELECT
color,
display_name,
labelName,
provisioning_state,
resourceGroupName,
subscriptionId,
workspaceName
FROM azure.defender.vw_labels
WHERE resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}'
AND workspaceName = '{{ workspaceName }}';
SELECT
properties
FROM azure.defender.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.
- All Properties
- Manifest
/*+ create */
INSERT INTO azure.defender.labels (
labelName,
resourceGroupName,
subscriptionId,
workspaceName,
properties
)
SELECT
'{{ labelName }}',
'{{ resourceGroupName }}',
'{{ subscriptionId }}',
'{{ workspaceName }}',
'{{ properties }}'
;
- name: your_resource_model_name
props:
- name: properties
value:
- name: displayName
value: string
- name: color
value: string
- name: provisioningState
value: []
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 }}';