共用方式為


Runbook - Update

更新 Runbook 名稱所識別的 Runbook。

PATCH https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}?api-version=2023-11-01

URI 參數

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

string

自動化帳戶的名稱。

resourceGroupName
path True

string

minLength: 1
maxLength: 90
pattern: ^[-\w\._]+$

Azure 資源群組的名稱。

runbookName
path True

string

pattern: ^[a-zA-Z][a-zA-Z-_0-9]*$

Runbook 名稱。

subscriptionId
path True

string

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

api-version
query True

string

用戶端 API 版本。

要求本文

名稱 類型 Description
location

string

取得或設定資源的位置。

name

string

取得或設定資源的名稱。

properties.description

string

取得或設定 Runbook 的描述。

properties.logActivityTrace

integer (int32)

取得或設定 Runbook 的活動層級追蹤選項。

properties.logProgress

boolean

取得或設定進度記錄選項。

properties.logVerbose

boolean

取得或設定詳細信息記錄選項。

tags

object

取得或設定附加至資源的標記。

回應

名稱 類型 Description
200 OK

Runbook

還行

Other Status Codes

ErrorResponse

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

安全性

azure_auth

Azure Active Directory OAuth2 Flow

類型: oauth2
Flow: implicit
授權 URL: https://login.microsoftonline.com/common/oauth2/authorize

範圍

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

範例

Update runbook

範例要求

PATCH https://management.azure.com/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/ContoseAutomationAccount/runbooks/Get-AzureVMTutorial?api-version=2023-11-01

{
  "properties": {
    "description": "Updated Description of the Runbook",
    "logVerbose": false,
    "logProgress": true,
    "logActivityTrace": 1
  }
}

範例回覆

{
  "id": "/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/ContoseAutomationAccount/runbooks/Get-AzureVMTutorial",
  "name": "Get-AzureVMTutorial",
  "type": "Microsoft.Automation/AutomationAccounts/Runbooks",
  "location": "East US 2",
  "tags": {
    "tag01": "value01",
    "tag02": "value02"
  },
  "etag": "\"636265044994500000\"",
  "properties": {
    "description": "Updated Description of the Runbook",
    "logVerbose": false,
    "logProgress": true,
    "logActivityTrace": 1,
    "runbookType": "PowerShellWorkflow",
    "parameters": {},
    "state": "Published",
    "jobCount": 0,
    "provisioningState": "Succeeded",
    "outputTypes": [],
    "creationTime": "2017-03-30T21:01:33.777+00:00",
    "lastModifiedBy": "myEmaild@microsoft.com",
    "lastModifiedTime": "2017-03-30T21:01:39.45+00:00"
  }
}

定義

名稱 Description
ContentHash

Runbook 屬性類型的定義。

ContentLink

內容連結的定義。

ErrorResponse

作業失敗的錯誤回應

Runbook

Runbook 類型的定義。

RunbookDraft
RunbookParameter

Runbook 參數類型的定義。

RunbookProvisioningState

取得或設定 Runbook 的布建狀態。

RunbookState

取得或設定 Runbook 的狀態。

RunbookTypeEnum

取得或設定 Runbook 的類型。

RunbookUpdateParameters

提供給更新 Runbook 作業的參數。

ContentHash

Runbook 屬性類型的定義。

名稱 類型 Description
algorithm

string

取得或設定用來哈希內容的內容哈希演算法。

value

string

取得或設定內容的預期哈希值。

內容連結的定義。

名稱 類型 Description
contentHash

ContentHash

設定哈希。

uri

string

設定內容的 URI。

version

string

設定內容的版本。

ErrorResponse

作業失敗的錯誤回應

名稱 類型 Description
code

string

錯誤碼

message

string

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

Runbook

Runbook 類型的定義。

名稱 類型 Description
etag

string

取得或設定資源的 etag。

id

string

資源的完整資源標識碼

location

string

資源所在的 Azure 區域

name

string

資源的名稱

properties.creationTime

string (date-time)

取得或設定建立時間。

properties.description

string

取得或設定描述。

properties.draft

RunbookDraft

取得或設定草稿 Runbook 屬性。

properties.jobCount

integer (int32)

取得或設定 Runbook 的作業計數。

properties.lastModifiedBy

string

取得或設定 上次修改的 。

properties.lastModifiedTime

string (date-time)

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

properties.logActivityTrace

integer (int32)

取得或設定記錄 Runbook 活動追蹤的選項。

properties.logProgress

boolean

取得或設定進度記錄選項。

properties.logVerbose

boolean

取得或設定詳細信息記錄選項。

properties.outputTypes

string[]

取得或設定 Runbook 輸出類型。

properties.parameters

<string,  RunbookParameter>

取得或設定 Runbook 參數。

properties.provisioningState

RunbookProvisioningState

取得或設定 Runbook 的布建狀態。

properties.publishContentLink

ContentLink

取得或設定已發佈的 Runbook 內容連結。

properties.runbookType

RunbookTypeEnum

取得或設定 Runbook 的類型。

properties.state

RunbookState

取得或設定 Runbook 的狀態。

tags

object

資源標籤。

type

string

資源的型別。

RunbookDraft

名稱 類型 Description
creationTime

string (date-time)

取得或設定 Runbook 草稿的建立時間。

draftContentLink

ContentLink

取得或設定草稿 Runbook 內容連結。

inEdit

boolean

取得或設定 Runbook 是否處於編輯模式。

lastModifiedTime

string (date-time)

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

outputTypes

string[]

取得或設定 Runbook 輸出類型。

parameters

<string,  RunbookParameter>

取得或設定 Runbook 草稿參數。

RunbookParameter

Runbook 參數類型的定義。

名稱 類型 Description
defaultValue

string

取得或設定參數的預設值。

isMandatory

boolean

取得或設定布爾值,指出參數是否為必要參數。

position

integer (int32)

取得或設定參數的位置。

type

string

取得或設定 參數的類型。

RunbookProvisioningState

取得或設定 Runbook 的布建狀態。

Description
Succeeded

RunbookState

取得或設定 Runbook 的狀態。

Description
Edit
New
Published

RunbookTypeEnum

取得或設定 Runbook 的類型。

Description
Graph
GraphPowerShell
GraphPowerShellWorkflow
PowerShell
PowerShell72
PowerShellWorkflow
Python2
Python3
Script

RunbookUpdateParameters

提供給更新 Runbook 作業的參數。

名稱 類型 Description
location

string

取得或設定資源的位置。

name

string

取得或設定資源的名稱。

properties.description

string

取得或設定 Runbook 的描述。

properties.logActivityTrace

integer (int32)

取得或設定 Runbook 的活動層級追蹤選項。

properties.logProgress

boolean

取得或設定進度記錄選項。

properties.logVerbose

boolean

取得或設定詳細信息記錄選項。

tags

object

取得或設定附加至資源的標記。