你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Software Update Configurations - List

获取帐户的所有软件更新配置。

GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurations?api-version=2019-06-01
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurations?api-version=2019-06-01&$filter={$filter}

URI 参数

Name In Required Type Description
automationAccountName
path True
  • string

自动化帐户的名称。

resourceGroupName
path True
  • string

Azure 资源组的名称。

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

subscriptionId
path True
  • string

获取唯一标识 Microsoft Azure 订阅的订阅凭据。 此订阅 ID 是每个服务调用的 URI 的一部分。

api-version
query True
  • string

客户端 API 版本。

$filter
query
  • string

要应用于操作的筛选器。

请求头

Name Required Type Description
clientRequestId
  • string

标识此特定客户端请求。

响应

Name Type Description
200 OK

返回软件更新配置的列表。

Other Status Codes

描述操作失败的原因的自动化错误响应。

安全性

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 模拟用户帐户

示例

List software update configurations
List software update configurations Targeting a specific azure virtual machine

List software update configurations

Sample Request

GET https://management.azure.com/subscriptions/1a7d4044-286c-4acb-969a-96639265bf2e/resourceGroups/mygroup/providers/Microsoft.Automation/automationAccounts/myaccount/softwareUpdateConfigurations?api-version=2019-06-01

Sample Response

{
  "value": [
    {
      "name": "testpatch-01",
      "id": "/subscriptions/1a7d4044-286c-4acb-969a-96639265bf2e/resourceGroups/Mo-Resources-WCUS/providers/Microsoft.Automation/automationAccounts/Mo-AAA-WCUS/softwareUpdateConfigurations/testpatch-01",
      "properties": {
        "updateConfiguration": {
          "operatingSystem": "Windows",
          "windows": {
            "includedUpdateClassifications": "Critical, Security, UpdateRollup, FeaturePack, ServicePack, Definition, Tools, Updates",
            "excludedKbNumbers": null
          },
          "linux": null,
          "targets": {
            "azureQueries": [
              {
                "scope": [
                  "/subscriptions/422b6c61-95b0-4213-b3be-7282315df71d/resourceGroups/a-stasku-rg0",
                  "/subscriptions/422b6c61-95b0-4213-b3be-7282315df71d"
                ],
                "tagSettings": {
                  "tags": {
                    "tag1": [
                      "tag1Value1",
                      "tag1Value2"
                    ],
                    "tag2": [
                      "tag2Value1",
                      "tag2Value2"
                    ]
                  },
                  "filterOperator": "All"
                },
                "locations": null
              }
            ]
          },
          "duration": "PT2H",
          "azureVirtualMachines": [
            "/subscriptions/1a7d4044-286c-4acb-969a-96639265bf2e/resourceGroups/myresources/providers/Microsoft.Compute/virtualMachines/vm-01",
            "/subscriptions/1a7d4044-286c-4acb-969a-96639265bf2e/resourceGroups/myresources/providers/Microsoft.Compute/virtualMachines/vm-02",
            "/subscriptions/1a7d4044-286c-4acb-969a-96639265bf2e/resourceGroups/myresources/providers/Microsoft.Compute/virtualMachines/vm-03"
          ],
          "nonAzureComputerNames": null
        },
        "tasks": {
          "preTask": {
            "source": "HelloWorld",
            "parameters": {
              "COMPUTERNAME": "Computer1"
            }
          },
          "postTask": {
            "source": "GetCache",
            "parameters": null
          }
        },
        "frequency": "Week",
        "startTime": "2017-10-19T12:22:00-07:00",
        "creationTime": "2017-10-19T18:54:50.5233333+00:00",
        "lastModifiedTime": "2017-10-19T18:54:50.68+00:00",
        "provisioningState": "Succeeded",
        "nextRun": "2017-10-23T12:22:00-07:00"
      }
    },
    {
      "name": "testpatch-02",
      "id": "/subscriptions/1a7d4044-286c-4acb-969a-96639265bf2e/resourceGroups/Mo-Resources-WCUS/providers/Microsoft.Automation/automationAccounts/Mo-AAA-WCUS/softwareUpdateConfigurations/testpatch-02",
      "properties": {
        "updateConfiguration": {
          "operatingSystem": "Windows",
          "windows": {
            "includedUpdateClassifications": "Critical, FeaturePack",
            "excludedKbNumbers": null
          },
          "linux": null,
          "targets": {
            "azureQueries": [
              {
                "scope": [
                  "/subscriptions/422b6c61-95b0-4213-b3be-7282315df71d/resourceGroups/a-stasku-rg0",
                  "/subscriptions/422b6c61-95b0-4213-b3be-7282315df71d"
                ],
                "tagSettings": {
                  "tags": {
                    "tag1": [
                      "tag1Value1",
                      "tag1Value2"
                    ],
                    "tag2": [
                      "tag2Value1",
                      "tag2Value2"
                    ]
                  },
                  "filterOperator": "All"
                },
                "locations": [
                  "Japan East",
                  "UK South"
                ]
              }
            ]
          },
          "duration": "PT2H30M",
          "azureVirtualMachines": [
            "/subscriptions/1a7d4044-286c-4acb-969a-96639265bf2e/resourceGroups/myresources/providers/Microsoft.Compute/virtualMachines/vm-04",
            "/subscriptions/1a7d4044-286c-4acb-969a-96639265bf2e/resourceGroups/myresources/providers/Microsoft.Compute/virtualMachines/vm-05",
            "/subscriptions/1a7d4044-286c-4acb-969a-96639265bf2e/resourceGroups/myresources/providers/Microsoft.Compute/virtualMachines/vm-06"
          ],
          "nonAzureComputerNames": null
        },
        "tasks": {
          "preTask": {
            "source": "HelloWorld",
            "parameters": {
              "COMPUTERNAME": "Computer1"
            }
          },
          "postTask": {
            "source": "GetCache",
            "parameters": null
          }
        },
        "frequency": "Hour",
        "startTime": "2018-05-05T12:26:00-07:00",
        "creationTime": "2017-08-11T21:52:02.7733333+00:00",
        "lastModifiedTime": "2017-08-11T21:52:22.88+00:00",
        "provisioningState": "Succeeded",
        "nextRun": "2018-05-05T12:26:00-07:00"
      }
    }
  ]
}

List software update configurations Targeting a specific azure virtual machine

Sample Request

GET https://management.azure.com/subscriptions/1a7d4044-286c-4acb-969a-96639265bf2e/resourceGroups/mygroup/providers/Microsoft.Automation/automationAccounts/myaccount/softwareUpdateConfigurations?api-version=2019-06-01&$filter=properties/updateConfiguration/azureVirtualMachines/any(m: m eq '/subscriptions/1a7d4044-286c-4acb-969a-96639265bf2e/resourceGroups/myresources/providers/Microsoft.Compute/virtualMachines/vm-01')

Sample Response

{
  "value": [
    {
      "name": "testpatch-01",
      "id": "/subscriptions/1a7d4044-286c-4acb-969a-96639265bf2e/resourceGroups/Mo-Resources-WCUS/providers/Microsoft.Automation/automationAccounts/Mo-AAA-WCUS/softwareUpdateConfigurations/testpatch-01",
      "properties": {
        "updateConfiguration": {
          "operatingSystem": "Windows",
          "windows": {
            "includedUpdateClassifications": "Critical, Security, UpdateRollup, FeaturePack, ServicePack, Definition, Tools, Updates",
            "excludedKbNumbers": null
          },
          "linux": null,
          "duration": "PT2H",
          "azureVirtualMachines": [
            "/subscriptions/1a7d4044-286c-4acb-969a-96639265bf2e/resourceGroups/myresources/providers/Microsoft.Compute/virtualMachines/vm-01",
            "/subscriptions/1a7d4044-286c-4acb-969a-96639265bf2e/resourceGroups/myresources/providers/Microsoft.Compute/virtualMachines/vm-02",
            "/subscriptions/1a7d4044-286c-4acb-969a-96639265bf2e/resourceGroups/myresources/providers/Microsoft.Compute/virtualMachines/vm-03"
          ],
          "nonAzureComputerNames": null
        },
        "tasks": {
          "preTask": {
            "source": "HelloWorld",
            "parameters": {
              "COMPUTERNAME": "Computer1"
            }
          },
          "postTask": {
            "source": "GetCache",
            "parameters": null
          }
        },
        "frequency": "Week",
        "startTime": "2017-10-19T12:22:00-07:00",
        "creationTime": "2017-10-19T18:54:50.5233333+00:00",
        "lastModifiedTime": "2017-10-19T18:54:50.68+00:00",
        "provisioningState": "Succeeded",
        "nextRun": "2017-10-23T12:22:00-07:00"
      }
    },
    {
      "name": "testpatch-02",
      "id": "/subscriptions/1a7d4044-286c-4acb-969a-96639265bf2e/resourceGroups/Mo-Resources-WCUS/providers/Microsoft.Automation/automationAccounts/Mo-AAA-WCUS/softwareUpdateConfigurations/testpatch-02",
      "properties": {
        "updateConfiguration": {
          "operatingSystem": "Windows",
          "windows": {
            "includedUpdateClassifications": "Critical, FeaturePack",
            "excludedKbNumbers": null
          },
          "linux": null,
          "duration": "PT2H30M",
          "azureVirtualMachines": [
            "/subscriptions/1a7d4044-286c-4acb-969a-96639265bf2e/resourceGroups/myresources/providers/Microsoft.Compute/virtualMachines/vm-01",
            "/subscriptions/1a7d4044-286c-4acb-969a-96639265bf2e/resourceGroups/myresources/providers/Microsoft.Compute/virtualMachines/vm-05",
            "/subscriptions/1a7d4044-286c-4acb-969a-96639265bf2e/resourceGroups/myresources/providers/Microsoft.Compute/virtualMachines/vm-06"
          ],
          "nonAzureComputerNames": null
        },
        "tasks": {
          "preTask": {
            "source": "HelloWorld",
            "parameters": {
              "COMPUTERNAME": "Computer1"
            }
          },
          "postTask": {
            "source": "GetCache",
            "parameters": null
          }
        },
        "frequency": "Hour",
        "startTime": "2018-05-05T12:26:00-07:00",
        "creationTime": "2017-08-11T21:52:02.7733333+00:00",
        "lastModifiedTime": "2017-08-11T21:52:22.88+00:00",
        "provisioningState": "Succeeded",
        "nextRun": "2018-05-05T12:26:00-07:00"
      }
    }
  ]
}

定义

AzureQueryProperties

Azure 查询更新配置。

ErrorResponse

操作失败的错误响应

LinuxProperties

特定于 Linux 的更新配置。

LinuxUpdateClasses

软件更新配置中包含的更新分类。

NonAzureQueryProperties

更新配置的非 Azure 查询。

OperatingSystemType

目标计算机的操作系统

ScheduleFrequency

获取或设置计划的频率。

softwareUpdateConfigurationCollectionItem

软件更新配置集合项属性。

softwareUpdateConfigurationListResult

列出所有软件更新配置的结果

softwareUpdateConfigurationTasks

软件更新配置的任务属性。

TagOperators

按任意或所有指定标记筛选 VM。

TagSettingsProperties

VM 的标记筛选器信息。

TargetProperties

特定于更新配置的组。

taskProperties

软件更新配置的任务属性。

updateConfiguration

更新软件更新配置的特定属性。

WindowsProperties

Windows特定的更新配置。

WindowsUpdateClasses

软件更新配置中包含的更新分类。 带所需值的逗号分隔字符串

AzureQueryProperties

Azure 查询更新配置。

Name Type Description
locations
  • string[]

要限定查询范围的位置列表。

scope
  • string[]

订阅或资源组 ARM ID 的列表。

tagSettings

VM 的标记设置。

ErrorResponse

操作失败的错误响应

Name Type Description
code
  • string

错误代码

message
  • string

指示操作失败的原因的错误消息。

LinuxProperties

特定于 Linux 的更新配置。

Name Type Description
excludedPackageNameMasks
  • string[]

从软件更新配置中排除的包。

includedPackageClassifications

软件更新配置中包含的更新分类。

includedPackageNameMasks
  • string[]

软件更新配置中包含的包。

rebootSetting
  • string

软件更新配置的重新启动设置。

LinuxUpdateClasses

软件更新配置中包含的更新分类。

Name Type Description
Critical
  • string
Other
  • string
Security
  • string
Unclassified
  • string

NonAzureQueryProperties

更新配置的非 Azure 查询。

Name Type Description
functionAlias
  • string

Log Analytics 保存的搜索名称。

workspaceId
  • string

保存的搜索所在的 Log Analytics 工作区 ID。

OperatingSystemType

目标计算机的操作系统

Name Type Description
Linux
  • string
Windows
  • string

ScheduleFrequency

获取或设置计划的频率。

Name Type Description
Day
  • string
Hour
  • string
Minute
  • string

分钟计划的最低允许间隔为 15 分钟。

Month
  • string
OneTime
  • string
Week
  • string

softwareUpdateConfigurationCollectionItem

软件更新配置集合项属性。

Name Type Description
id
  • string

软件更新配置的资源 ID

name
  • string

软件更新配置的名称。

properties.creationTime
  • string

软件更新配置的创建时间,该配置仅在响应中显示。

properties.frequency

与软件更新配置关联的计划的执行频率

properties.lastModifiedTime
  • string

上次修改软件更新配置时,该配置仅在响应中显示。

properties.nextRun
  • string

更新的 ext 运行时。

properties.provisioningState
  • string

软件更新配置的预配状态,仅显示在响应中。

properties.startTime
  • string

更新的开始时间。

properties.tasks

预定义和后期任务

properties.updateConfiguration

更新软件更新配置的特定属性。

softwareUpdateConfigurationListResult

列出所有软件更新配置的结果

Name Type Description
value

列出所有软件更新配置时返回的外部对象

softwareUpdateConfigurationTasks

软件更新配置的任务属性。

Name Type Description
postTask

发布任务属性。

preTask

预任务属性。

TagOperators

按任意或所有指定标记筛选 VM。

Name Type Description
All
  • string
Any
  • string

TagSettingsProperties

VM 的标记筛选器信息。

Name Type Description
filterOperator

按任意或所有指定标记筛选 VM。

tags
  • object

标记的字典及其值列表。

TargetProperties

特定于更新配置的组。

Name Type Description
azureQueries

软件更新配置中的 Azure 查询列表。

nonAzureQueries

软件更新配置中的非 Azure 查询列表。

taskProperties

软件更新配置的任务属性。

Name Type Description
parameters
  • object

获取或设置任务的参数。

source
  • string

获取或设置 Runbook 的名称。

updateConfiguration

更新软件更新配置的特定属性。

Name Type Description
azureVirtualMachines
  • string[]

针对软件更新配置的 Azure 虚拟机的 Azure 资源 ID 列表。

duration
  • string

软件更新配置运行允许的最大时间。 需要根据 ISO8601 使用 PT[n]H[n]M[n]S 格式指定持续时间

linux

特定于 Linux 的更新配置。

nonAzureComputerNames
  • string[]

软件更新配置面向的非 Azure 计算机的名称列表。

operatingSystem

目标计算机的操作系统

targets

对软件更新配置的目标进行分组。

windows

Windows特定的更新配置。

WindowsProperties

Windows特定的更新配置。

Name Type Description
excludedKbNumbers
  • string[]

从软件更新配置中排除的 KB 数。

includedKbNumbers
  • string[]

软件更新配置中包含的 KB 编号。

includedUpdateClassifications

软件更新配置中包含的更新分类。 带所需值的逗号分隔字符串

rebootSetting
  • string

软件更新配置的重新启动设置。

WindowsUpdateClasses

软件更新配置中包含的更新分类。 带所需值的逗号分隔字符串

Name Type Description
Critical
  • string
Definition
  • string
FeaturePack
  • string
Security
  • string
ServicePack
  • string
Tools
  • string
Unclassified
  • string
UpdateRollup
  • string
Updates
  • string