Triggers - Create Or Replace
建立或取代觸發程序的實例。
PUT {endpoint}/scan/datasources/{dataSourceName}/scans/{scanName}/triggers/default?api-version=2023-09-01
URI 參數
| 名稱 | 位於 | 必要 | 類型 | Description |
|---|---|---|---|---|
|
data
|
path | True |
string minLength: 3maxLength: 63 pattern: ^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$ |
dataSource 名稱。 |
|
endpoint
|
path | True |
string (url) |
purview 帳戶的掃描端點。 範例:https://{accountName}.purview.azure.com。 |
|
scan
|
path | True |
string minLength: 3maxLength: 63 pattern: ^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$ |
掃描名稱。 |
|
api-version
|
query | True |
string |
要使用的 API 版本。 |
要求本文
| 名稱 | 類型 | Description |
|---|---|---|
| properties |
觸發程序的屬性。 |
|
| validationErrorInfo |
string |
觸發程式的驗證錯誤資訊。 |
回應
| 名稱 | 類型 | Description |
|---|---|---|
| 200 OK |
成功。 |
|
| 201 Created |
成功。 |
|
| Other Status Codes |
從掃描服務收到的錯誤回應。 標題 x-ms-error-code: string |
安全性
azure_auth
Azure Active Directory OAuth2 Flow。
類型:
oauth2
Flow:
implicit
授權 URL:
https://login.microsoftonline.com/common/oauth2/authorize
範圍
| 名稱 | Description |
|---|---|
| user_impersonation | 模擬您的用戶帳戶 |
範例
Triggers_CreateOrReplace
範例要求
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
]
}
}
}
}
範例回覆
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"
}
}
定義
| 名稱 | Description |
|---|---|
|
Day |
週期排程發生的日期。 |
|
Days |
週期排程的星期幾。 |
|
Error |
錯誤模型。 |
|
Error |
錯誤回應模型。 |
|
Recurrence |
週期排程。 |
|
Recurrence |
週期排程的發生次數。 |
|
Scan |
掃描層級類型。 |
| Trigger |
觸發程序物件。 |
|
Trigger |
觸發程式週期的頻率。 |
|
Trigger |
觸發程式的屬性詳細數據。 |
|
Trigger |
觸發程序的迴圈。 |
|
Trigger |
觸發程序的狀態。 |
DayOfWeek
週期排程發生的日期。
| 值 | Description |
|---|---|
| Sunday | |
| Monday | |
| Tuesday | |
| Wednesday | |
| Thursday | |
| Friday | |
| Saturday |
DaysOfWeek
週期排程的星期幾。
| 值 | Description |
|---|---|
| Sunday | |
| Monday | |
| Tuesday | |
| Wednesday | |
| Thursday | |
| Friday | |
| Saturday |
ErrorModel
錯誤模型。
| 名稱 | 類型 | Description |
|---|---|---|
| code |
string |
識別特定錯誤的唯一錯誤碼。 |
| details |
提供其他錯誤詳細數據的巢狀 ErrorModel 物件陣列。 |
|
| message |
string |
人類可讀取的錯誤訊息,可提供錯誤的詳細數據。 |
| target |
string |
錯誤相關聯的特定元件。 |
ErrorResponseModel
錯誤回應模型。
| 名稱 | 類型 | Description |
|---|---|---|
| error |
錯誤模型。 |
RecurrenceSchedule
週期排程。
| 名稱 | 類型 | Description |
|---|---|---|
| hours |
integer[] (int32) |
週期排程的時數。 |
| minutes |
integer[] (int32) |
週期排程的分鐘數。 |
| monthDays |
integer[] (int32) |
週期排程的月份天數。 |
| monthlyOccurrences |
週期排程的每月發生次數。 |
|
| weekDays |
週期排程的星期幾。 |
RecurrenceScheduleOccurrence
週期排程的發生次數。
| 名稱 | 類型 | Description |
|---|---|---|
| day |
週期排程發生的日期。 |
|
| occurrence |
integer (int32) |
ScanLevelType
掃描層級類型。
| 值 | Description |
|---|---|
| Full |
掃描是完整掃描 |
| Incremental |
掃描是累加掃描 |
Trigger
觸發程序物件。
| 名稱 | 類型 | Description |
|---|---|---|
| id |
string |
資源標識碼。 |
| name |
string |
資源名稱。 |
| properties |
觸發程序的屬性。 |
|
| validationErrorInfo |
string |
觸發程式的驗證錯誤資訊。 |
TriggerFrequency
觸發程式週期的頻率。
| 值 | Description |
|---|---|
| Week | |
| Month | |
| Day | |
| Hour |
TriggerProperties
觸發程式的屬性詳細數據。
| 名稱 | 類型 | 預設值 | Description |
|---|---|---|---|
| createdAt |
string (date-time) |
觸發程式的建立時間。 |
|
| incrementalScanStartTime |
string (date-time) |
觸發程式的累加掃描開始時間。 |
|
| lastModifiedAt |
string (date-time) |
觸發程式上次修改的時間。 |
|
| lastScheduled |
string (date-time) |
觸發程式的最後一個排程時間。 |
|
| recurrence |
觸發程序的迴圈。 |
||
| recurrenceInterval |
string |
觸發程式的周期間隔。 |
|
| scanLevel |
觸發程式的掃描層級。 |
||
| state | Enabled |
觸發程序的狀態。 |
TriggerRecurrence
觸發程序的迴圈。
| 名稱 | 類型 | Description |
|---|---|---|
| endTime |
string (date-time) |
觸發程式週期的結束時間。 |
| frequency |
觸發程式週期的頻率。 |
|
| interval |
integer (int32) |
觸發程式週期的間隔。 |
| schedule |
觸發程式週期的排程。 |
|
| startTime |
string (date-time) |
觸發程式週期的開始時間。 |
| timeZone |
string |
觸發程式週期的時區。 |
TriggerState
觸發程序的狀態。
| 值 | Description |
|---|---|
| Enabled | |
| Disabled |