Triggers - Create Or Replace
Creates or replaces an instance of a trigger.
PUT {endpoint}/scan/datasources/{dataSourceName}/scans/{scanName}/triggers/default?api-version=2023-09-01
URI Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
|
data
|
path | True |
string minLength: 3maxLength: 63 pattern: ^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$ |
The dataSource name. |
|
endpoint
|
path | True |
string (url) |
The scanning endpoint of your purview account. Example: https://{accountName}.purview.azure.com. |
|
scan
|
path | True |
string minLength: 3maxLength: 63 pattern: ^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$ |
The scan name. |
|
api-version
|
query | True |
string |
The api version to use. |
Request Body
| Name | Type | Description |
|---|---|---|
| properties |
The properties of trigger. |
|
| validationErrorInfo |
string |
The validation error info of trigger. |
Responses
| Name | Type | Description |
|---|---|---|
| 200 OK |
Success. |
|
| 201 Created |
Success. |
|
| Other Status Codes |
An error response received from the Scanning Service. Headers x-ms-error-code: string |
Security
azure_auth
Azure Active Directory OAuth2 Flow.
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
| Name | Description |
|---|---|
| user_impersonation | impersonate your user account |
Examples
Triggers_CreateOrReplace
Sample request
PUT {endpoint}/scan/datasources/DataSource1/scans/Scan1/triggers/default?api-version=2023-09-01
{
"properties": {
"recurrenceInterval": null,
"scanLevel": "Incremental",
"state": "Enabled",
"recurrence": {
"startTime": "2021-02-12T14:59:00.416Z",
"endTime": "2021-02-25T00:00:00.000Z",
"interval": 1,
"frequency": "Month",
"schedule": {
"hours": [
23
],
"minutes": [
56
],
"monthDays": [
10
]
}
}
}
}
Sample response
x-ms-request-id: d5496da4-9c52-402f-b067-83cc9ddea888
{
"name": "default",
"id": "datasources/AzureBlob-DSTDParv/scans/Scan-PUl/triggers/default",
"properties": {
"recurrence": {
"frequency": "Month",
"interval": 4,
"startTime": "2021-02-12T14:59:00.416Z",
"endTime": "2021-02-25T00:00:00Z",
"schedule": {
"minutes": [
56
],
"hours": [
23
],
"weekDays": null,
"monthDays": null,
"monthlyOccurrences": [
{
"day": "Wednesday",
"occurrence": 2
}
]
}
},
"recurrenceInterval": null,
"createdAt": "2021-02-12T14:58:58.0478425Z",
"lastModifiedAt": "2021-02-12T15:39:53.6482996Z",
"lastScheduled": null,
"scanLevel": "Incremental",
"state": "Enabled"
}
}
x-ms-request-id: d5496da4-9c52-402f-b067-83cc9ddea888
{
"name": "default",
"id": "datasources/AzureBlob-DSTDParv/scans/Scan-PUl/triggers/default",
"properties": {
"recurrence": {
"frequency": "Month",
"interval": 4,
"startTime": "2021-02-12T14:59:00.416Z",
"endTime": "2021-02-25T00:00:00Z",
"schedule": {
"minutes": [
56
],
"hours": [
23
],
"weekDays": null,
"monthDays": null,
"monthlyOccurrences": [
{
"day": "Wednesday",
"occurrence": 2
}
]
}
},
"recurrenceInterval": null,
"createdAt": "2021-02-12T14:58:58.0478425Z",
"lastModifiedAt": "2021-02-12T15:39:53.6482996Z",
"lastScheduled": null,
"scanLevel": "Incremental",
"state": "Enabled"
}
}
Definitions
| Name | Description |
|---|---|
|
Day |
The day of recurrence schedule occurrence. |
|
Days |
The week days of recurrence schedule. |
|
Error |
The error model. |
|
Error |
The error response model. |
|
Recurrence |
Schedule of recurrence. |
|
Recurrence |
The occurrence of recurrence schedule. |
|
Scan |
Scan level type. |
| Trigger |
The trigger object. |
|
Trigger |
The frequency of trigger recurrence. |
|
Trigger |
Properties detail of trigger. |
|
Trigger |
The recurrence of trigger. |
|
Trigger |
The state of trigger. |
DayOfWeek
The day of recurrence schedule occurrence.
| Value | Description |
|---|---|
| Sunday | |
| Monday | |
| Tuesday | |
| Wednesday | |
| Thursday | |
| Friday | |
| Saturday |
DaysOfWeek
The week days of recurrence schedule.
| Value | Description |
|---|---|
| Sunday | |
| Monday | |
| Tuesday | |
| Wednesday | |
| Thursday | |
| Friday | |
| Saturday |
ErrorModel
The error model.
| Name | Type | Description |
|---|---|---|
| code |
string |
A unique error code that identifies the specific error. |
| details |
An array of nested ErrorModel objects that provides additional error details. |
|
| message |
string |
A human-readable error message that provides more details about the error. |
| target |
string |
The specific component that the error is associated with. |
ErrorResponseModel
The error response model.
| Name | Type | Description |
|---|---|---|
| error |
The error model. |
RecurrenceSchedule
Schedule of recurrence.
| Name | Type | Description |
|---|---|---|
| hours |
integer[] (int32) |
The hours of recurrence schedule. |
| minutes |
integer[] (int32) |
The minutes of recurrence schedule. |
| monthDays |
integer[] (int32) |
Month days of recurrence schedule. |
| monthlyOccurrences |
The monthly occurrences of recurrence schedule. |
|
| weekDays |
The week days of recurrence schedule. |
RecurrenceScheduleOccurrence
The occurrence of recurrence schedule.
| Name | Type | Description |
|---|---|---|
| day |
The day of recurrence schedule occurrence. |
|
| occurrence |
integer (int32) |
ScanLevelType
Scan level type.
| Value | Description |
|---|---|
| Full |
the scan is full scan |
| Incremental |
the scan is incremental scan |
Trigger
The trigger object.
| Name | Type | Description |
|---|---|---|
| id |
string |
The resource identifier. |
| name |
string |
The resource name. |
| properties |
The properties of trigger. |
|
| validationErrorInfo |
string |
The validation error info of trigger. |
TriggerFrequency
The frequency of trigger recurrence.
| Value | Description |
|---|---|
| Week | |
| Month | |
| Day | |
| Hour |
TriggerProperties
Properties detail of trigger.
| Name | Type | Default value | Description |
|---|---|---|---|
| createdAt |
string (date-time) |
The create time of trigger. |
|
| incrementalScanStartTime |
string (date-time) |
The incremental scan start time of trigger. |
|
| lastModifiedAt |
string (date-time) |
The last modified time of trigger. |
|
| lastScheduled |
string (date-time) |
The last scheduled time of trigger. |
|
| recurrence |
The recurrence of trigger. |
||
| recurrenceInterval |
string |
The recurrence interval of trigger. |
|
| scanLevel |
The scan level of trigger. |
||
| state | Enabled |
The state of trigger. |
TriggerRecurrence
The recurrence of trigger.
| Name | Type | Description |
|---|---|---|
| endTime |
string (date-time) |
The end time of trigger recurrence. |
| frequency |
The frequency of trigger recurrence. |
|
| interval |
integer (int32) |
The interval of trigger recurrence. |
| schedule |
The schedule of trigger recurrence. |
|
| startTime |
string (date-time) |
The start time of trigger recurrence. |
| timeZone |
string |
The time zone of trigger recurrence. |
TriggerState
The state of trigger.
| Value | Description |
|---|---|
| Enabled | |
| Disabled |