Webhook - Create Or Update

建立 Webhook 名稱所識別的 Webhook。

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks/{webhookName}?api-version=2015-10-31

URI 參數

名稱 位於 必要 類型 Description
automationAccountName
path True

string

自動化帳戶的名稱。

resourceGroupName
path True

string

Azure 資源群組的名稱。

Regex pattern: ^[-\w\._]+$

subscriptionId
path True

string

取得用來唯一識別 Microsoft Azure 訂用帳戶的訂用帳戶認證。 訂用帳戶識別碼會構成每個服務呼叫 URI 的一部分。

webhookName
path True

string

Webhook 名稱。

api-version
query True

string

用戶端 API 版本。

要求本文

名稱 必要 類型 Description
name True

string

取得或設定 Webhook 的名稱。

properties.expiryTime

string

取得或設定到期時間。

properties.isEnabled

boolean

取得或設定已啟用 Webhook 旗標的值。

properties.parameters

object

取得或設定作業的參數。

properties.runOn

string

取得或設定將執行 Webhook 作業的混合式背景工作群組名稱。

properties.runbook

RunbookAssociationProperty

取得或設定 Runbook。

properties.uri

string

取得或設定 URI。

回應

名稱 類型 Description
200 OK

Webhook

確定

201 Created

Webhook

建立時間

Other Status Codes

ErrorResponse

描述作業失敗原因的自動化錯誤回應。

安全性

azure_auth

Azure Active Directory OAuth2 Flow

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

名稱 Description
user_impersonation 模擬您的用戶帳戶

範例

Create or update webhook

Sample Request

PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/myAutomationAccount33/webhooks/TestWebhook?api-version=2015-10-31

{
  "name": "TestWebhook",
  "properties": {
    "isEnabled": true,
    "uri": "<uri>",
    "expiryTime": "2018-03-29T22:18:13.7002872Z",
    "runbook": {
      "name": "TestRunbook"
    }
  }
}

Sample Response

{
  "id": "/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/myAutomationAccount33/webhooks/TestWebhook",
  "name": "TestWebhook",
  "type": "Microsoft.Automation/AutomationAccounts/Webhooks",
  "properties": {
    "isEnabled": true,
    "expiryTime": "2018-03-29T22:18:13.7002872+00:00",
    "runbook": {
      "name": "TestRunbook"
    },
    "lastInvokedTime": null,
    "runOn": null,
    "parameters": null,
    "uri": "",
    "creationTime": "2017-03-29T22:18:14.6651862+00:00",
    "lastModifiedBy": "",
    "lastModifiedTime": "2017-03-29T22:18:14.6651862+00:00"
  }
}
{
  "id": "/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/myAutomationAccount33/webhooks/TestWebhook",
  "name": "TestWebhook",
  "type": "Microsoft.Automation/AutomationAccounts/Webhooks",
  "properties": {
    "isEnabled": true,
    "expiryTime": "2018-03-29T22:18:13.7002872+00:00",
    "runbook": {
      "name": "TestRunbook"
    },
    "lastInvokedTime": null,
    "runOn": null,
    "parameters": null,
    "uri": "",
    "creationTime": "2017-03-29T22:18:14.6651862+00:00",
    "lastModifiedBy": "",
    "lastModifiedTime": "2017-03-29T22:18:14.6651862+00:00"
  }
}

定義

名稱 Description
ErrorResponse

作業失敗的錯誤回應

RunbookAssociationProperty

與實體相關聯的 Runbook 屬性。

Webhook

Webhook 類型的定義。

WebhookCreateOrUpdateParameters

提供給建立或更新 Webhook 作業的參數。

ErrorResponse

作業失敗的錯誤回應

名稱 類型 Description
code

string

錯誤碼

message

string

錯誤訊息,指出作業失敗的原因。

RunbookAssociationProperty

與實體相關聯的 Runbook 屬性。

名稱 類型 Description
name

string

取得或設定 Runbook 的名稱。

Webhook

Webhook 類型的定義。

名稱 類型 預設值 Description
id

string

資源的完整資源標識碼

name

string

資源的名稱

properties.creationTime

string

取得或設定建立時間。

properties.description

string

取得或設定描述。

properties.expiryTime

string

取得或設定到期時間。

properties.isEnabled

boolean

False

取得或設定 Webhook 已啟用旗標的值。

properties.lastInvokedTime

string

取得或設定上次叫用的時間。

properties.lastModifiedBy

string

上次修改 Webhook 的使用者詳細數據

properties.lastModifiedTime

string

取得或設定上次修改的時間。

properties.parameters

object

取得或設定當 Webhook 呼叫與它相關聯的 Runbook 時所建立之作業的參數。

properties.runOn

string

取得或設定將執行 Webhook 作業的混合式背景工作群組名稱。

properties.runbook

RunbookAssociationProperty

取得或設定與 Webhook 相關聯的 Runbook。

properties.uri

string

取得或設定 Webhook URI。

type

string

資源類型。

WebhookCreateOrUpdateParameters

提供給建立或更新 Webhook 作業的參數。

名稱 類型 Description
name

string

取得或設定 Webhook 的名稱。

properties.expiryTime

string

取得或設定到期時間。

properties.isEnabled

boolean

取得或設定已啟用 Webhook 旗標的值。

properties.parameters

object

取得或設定作業的參數。

properties.runOn

string

取得或設定將執行 Webhook 作業的混合式背景工作群組名稱。

properties.runbook

RunbookAssociationProperty

取得或設定 Runbook。

properties.uri

string

取得或設定 URI。