labels
Creates, updates, deletes, gets or lists a labels resource.
Overview
| Name | labels |
| Type | Resource |
| Id | azure.defender_easm.labels |
Fields
The following fields are returned by SELECT queries:
- get_by_workspace
- list_by_workspace
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
color | string | Label color. |
displayName | string | Label display name. |
provisioningState | string | Resource provisioning state. Known values are: "NotSpecified", "Accepted", "Creating", "Succeeded", "Failed", "Canceled", "ProvisioningResources", "InstallingApplication", "ConfiguringApplication", "MigratingApplicationData", "RunningValidations", "CreatingArtifacts", and "DeletingArtifacts". |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
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}. |
name | string | The name of the resource. |
color | string | Label color. |
displayName | string | Label display name. |
provisioningState | string | Resource provisioning state. Known values are: "NotSpecified", "Accepted", "Creating", "Succeeded", "Failed", "Canceled", "ProvisioningResources", "InstallingApplication", "ConfiguringApplication", "MigratingApplicationData", "RunningValidations", "CreatingArtifacts", and "DeletingArtifacts". |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
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_by_workspace | select | resource_group_name, workspace_name, label_name, subscription_id | Returns a label in the given workspace. | |
list_by_workspace | select | resource_group_name, workspace_name, subscription_id | Returns a list of labels in the given workspace. | |
update | update | resource_group_name, workspace_name, label_name, subscription_id | Update a Label. | |
delete | delete | resource_group_name, workspace_name, label_name, subscription_id | Delete a Label. | |
create_and_update | exec | resource_group_name, workspace_name, label_name, subscription_id | Create or update a Label. |
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 |
|---|---|---|
label_name | string | The name of the Label. Required. |
resource_group_name | string | The name of the resource group. The name is case insensitive. Required. |
subscription_id | string | |
workspace_name | string | The name of the Workspace. Required. |
SELECT examples
- get_by_workspace
- list_by_workspace
Returns a label in the given workspace.
SELECT
id,
name,
color,
displayName,
provisioningState,
systemData,
type
FROM azure.defender_easm.labels
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND workspace_name = '{{ workspace_name }}' -- required
AND label_name = '{{ label_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
Returns a list of labels in the given workspace.
SELECT
id,
name,
color,
displayName,
provisioningState,
systemData,
type
FROM azure.defender_easm.labels
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND workspace_name = '{{ workspace_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
UPDATE examples
- update
Update a Label.
UPDATE azure.defender_easm.labels
SET
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND workspace_name = '{{ workspace_name }}' --required
AND label_name = '{{ label_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
properties,
systemData,
type;
DELETE examples
- delete
Delete a Label.
DELETE FROM azure.defender_easm.labels
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND workspace_name = '{{ workspace_name }}' --required
AND label_name = '{{ label_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;
Lifecycle Methods
- create_and_update
Create or update a Label.
EXEC azure.defender_easm.labels.create_and_update
@resource_group_name='{{ resource_group_name }}' --required,
@workspace_name='{{ workspace_name }}' --required,
@label_name='{{ label_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
@@json=
'{
"properties": "{{ properties }}"
}'
;