アカウントのすべてのソフトウェア更新プログラムの構成を取得します。
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurations?api-version=2019-06-01
With optional parameters:
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurations?api-version=2019-06-01&$filter={$filter}
URI パラメーター
名前 |
/ |
必須 |
型 |
説明 |
automationAccountName
|
path |
True
|
string
|
Automation アカウントの名前。
|
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
|
操作に適用するフィルター。
|
名前 |
必須 |
型 |
説明 |
clientRequestId
|
|
string
|
この特定のクライアント要求を識別します。
|
応答
セキュリティ
azure_auth
Azure Active Directory OAuth2 フロー
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
名前 |
説明 |
user_impersonation
|
ユーザー アカウントの借用
|
例
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
import com.azure.core.util.Context;
/** Samples for SoftwareUpdateConfigurations List. */
public final class Main {
/*
* x-ms-original-file: specification/automation/resource-manager/Microsoft.Automation/stable/2019-06-01/examples/softwareUpdateConfiguration/listSoftwareUpdateConfigurations.json
*/
/**
* Sample code: List software update configurations.
*
* @param manager Entry point to AutomationManager.
*/
public static void listSoftwareUpdateConfigurations(
com.azure.resourcemanager.automation.AutomationManager manager) {
manager.softwareUpdateConfigurations().listWithResponse("mygroup", "myaccount", null, null, Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.automation import AutomationClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-automation
# USAGE
python list_software_update_configurations.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = AutomationClient(
credential=DefaultAzureCredential(),
subscription_id="1a7d4044-286c-4acb-969a-96639265bf2e",
)
response = client.software_update_configurations.list(
resource_group_name="mygroup",
automation_account_name="myaccount",
)
print(response)
# x-ms-original-file: specification/automation/resource-manager/Microsoft.Automation/stable/2019-06-01/examples/softwareUpdateConfiguration/listSoftwareUpdateConfigurations.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armautomation_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/automation/armautomation"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/432872fac1d0f8edcae98a0e8504afc0ee302710/specification/automation/resource-manager/Microsoft.Automation/stable/2019-06-01/examples/softwareUpdateConfiguration/listSoftwareUpdateConfigurations.json
func ExampleSoftwareUpdateConfigurationsClient_List_listSoftwareUpdateConfigurations() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armautomation.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewSoftwareUpdateConfigurationsClient().List(ctx, "mygroup", "myaccount", &armautomation.SoftwareUpdateConfigurationsClientListOptions{ClientRequestID: nil,
Filter: nil,
})
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.SoftwareUpdateConfigurationListResult = armautomation.SoftwareUpdateConfigurationListResult{
// Value: []*armautomation.SoftwareUpdateConfigurationCollectionItem{
// {
// Name: to.Ptr("testpatch-01"),
// ID: to.Ptr("/subscriptions/1a7d4044-286c-4acb-969a-96639265bf2e/resourceGroups/Mo-Resources-WCUS/providers/Microsoft.Automation/automationAccounts/Mo-AAA-WCUS/softwareUpdateConfigurations/testpatch-01"),
// Properties: &armautomation.SoftwareUpdateConfigurationCollectionItemProperties{
// CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-10-19T18:54:50.523Z"); return t}()),
// Frequency: to.Ptr(armautomation.ScheduleFrequencyWeek),
// LastModifiedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-10-19T18:54:50.680Z"); return t}()),
// NextRun: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-10-23T19:22:00.000Z"); return t}()),
// ProvisioningState: to.Ptr("Succeeded"),
// StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-10-19T19:22:00.000Z"); return t}()),
// Tasks: &armautomation.SoftwareUpdateConfigurationTasks{
// PostTask: &armautomation.TaskProperties{
// Source: to.Ptr("GetCache"),
// },
// PreTask: &armautomation.TaskProperties{
// Parameters: map[string]*string{
// "COMPUTERNAME": to.Ptr("Computer1"),
// },
// Source: to.Ptr("HelloWorld"),
// },
// },
// UpdateConfiguration: &armautomation.UpdateConfiguration{
// AzureVirtualMachines: []*string{
// to.Ptr("/subscriptions/1a7d4044-286c-4acb-969a-96639265bf2e/resourceGroups/myresources/providers/Microsoft.Compute/virtualMachines/vm-01"),
// to.Ptr("/subscriptions/1a7d4044-286c-4acb-969a-96639265bf2e/resourceGroups/myresources/providers/Microsoft.Compute/virtualMachines/vm-02"),
// to.Ptr("/subscriptions/1a7d4044-286c-4acb-969a-96639265bf2e/resourceGroups/myresources/providers/Microsoft.Compute/virtualMachines/vm-03")},
// Duration: to.Ptr("PT2H"),
// OperatingSystem: to.Ptr(armautomation.OperatingSystemTypeWindows),
// Targets: &armautomation.TargetProperties{
// AzureQueries: []*armautomation.AzureQueryProperties{
// {
// Scope: []*string{
// to.Ptr("/subscriptions/422b6c61-95b0-4213-b3be-7282315df71d/resourceGroups/a-stasku-rg0"),
// to.Ptr("/subscriptions/422b6c61-95b0-4213-b3be-7282315df71d")},
// TagSettings: &armautomation.TagSettingsProperties{
// FilterOperator: to.Ptr(armautomation.TagOperatorsAll),
// Tags: map[string][]*string{
// "tag1": []*string{
// to.Ptr("tag1Value1"),
// to.Ptr("tag1Value2")},
// "tag2": []*string{
// to.Ptr("tag2Value1"),
// to.Ptr("tag2Value2")},
// },
// },
// }},
// },
// Windows: &armautomation.WindowsProperties{
// IncludedUpdateClassifications: to.Ptr(armautomation.WindowsUpdateClasses("Critical, Security, UpdateRollup, FeaturePack, ServicePack, Definition, Tools, Updates")),
// },
// },
// },
// },
// {
// Name: to.Ptr("testpatch-02"),
// ID: to.Ptr("/subscriptions/1a7d4044-286c-4acb-969a-96639265bf2e/resourceGroups/Mo-Resources-WCUS/providers/Microsoft.Automation/automationAccounts/Mo-AAA-WCUS/softwareUpdateConfigurations/testpatch-02"),
// Properties: &armautomation.SoftwareUpdateConfigurationCollectionItemProperties{
// CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-11T21:52:02.773Z"); return t}()),
// Frequency: to.Ptr(armautomation.ScheduleFrequencyHour),
// LastModifiedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-11T21:52:22.880Z"); return t}()),
// NextRun: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-05T19:26:00.000Z"); return t}()),
// ProvisioningState: to.Ptr("Succeeded"),
// StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-05T19:26:00.000Z"); return t}()),
// Tasks: &armautomation.SoftwareUpdateConfigurationTasks{
// PostTask: &armautomation.TaskProperties{
// Source: to.Ptr("GetCache"),
// },
// PreTask: &armautomation.TaskProperties{
// Parameters: map[string]*string{
// "COMPUTERNAME": to.Ptr("Computer1"),
// },
// Source: to.Ptr("HelloWorld"),
// },
// },
// UpdateConfiguration: &armautomation.UpdateConfiguration{
// AzureVirtualMachines: []*string{
// to.Ptr("/subscriptions/1a7d4044-286c-4acb-969a-96639265bf2e/resourceGroups/myresources/providers/Microsoft.Compute/virtualMachines/vm-04"),
// to.Ptr("/subscriptions/1a7d4044-286c-4acb-969a-96639265bf2e/resourceGroups/myresources/providers/Microsoft.Compute/virtualMachines/vm-05"),
// to.Ptr("/subscriptions/1a7d4044-286c-4acb-969a-96639265bf2e/resourceGroups/myresources/providers/Microsoft.Compute/virtualMachines/vm-06")},
// Duration: to.Ptr("PT2H30M"),
// OperatingSystem: to.Ptr(armautomation.OperatingSystemTypeWindows),
// Targets: &armautomation.TargetProperties{
// AzureQueries: []*armautomation.AzureQueryProperties{
// {
// Locations: []*string{
// to.Ptr("Japan East"),
// to.Ptr("UK South")},
// Scope: []*string{
// to.Ptr("/subscriptions/422b6c61-95b0-4213-b3be-7282315df71d/resourceGroups/a-stasku-rg0"),
// to.Ptr("/subscriptions/422b6c61-95b0-4213-b3be-7282315df71d")},
// TagSettings: &armautomation.TagSettingsProperties{
// FilterOperator: to.Ptr(armautomation.TagOperatorsAll),
// Tags: map[string][]*string{
// "tag1": []*string{
// to.Ptr("tag1Value1"),
// to.Ptr("tag1Value2")},
// "tag2": []*string{
// to.Ptr("tag2Value1"),
// to.Ptr("tag2Value2")},
// },
// },
// }},
// },
// Windows: &armautomation.WindowsProperties{
// IncludedUpdateClassifications: to.Ptr(armautomation.WindowsUpdateClasses("Critical, FeaturePack")),
// },
// },
// },
// }},
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { AutomationClient } = require("@azure/arm-automation");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Get all software update configurations for the account.
*
* @summary Get all software update configurations for the account.
* x-ms-original-file: specification/automation/resource-manager/Microsoft.Automation/stable/2019-06-01/examples/softwareUpdateConfiguration/listSoftwareUpdateConfigurations.json
*/
async function listSoftwareUpdateConfigurations() {
const subscriptionId =
process.env["AUTOMATION_SUBSCRIPTION_ID"] || "1a7d4044-286c-4acb-969a-96639265bf2e";
const resourceGroupName = process.env["AUTOMATION_RESOURCE_GROUP"] || "mygroup";
const automationAccountName = "myaccount";
const credential = new DefaultAzureCredential();
const client = new AutomationClient(credential, subscriptionId);
const result = await client.softwareUpdateConfigurations.list(
resourceGroupName,
automationAccountName
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using System;
using System.Threading.Tasks;
using System.Xml;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Automation;
using Azure.ResourceManager.Automation.Models;
// Generated from example definition: specification/automation/resource-manager/Microsoft.Automation/stable/2019-06-01/examples/softwareUpdateConfiguration/listSoftwareUpdateConfigurations.json
// this example is just showing the usage of "SoftwareUpdateConfigurations_List" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this AutomationAccountResource created on azure
// for more information of creating AutomationAccountResource, please refer to the document of AutomationAccountResource
string subscriptionId = "1a7d4044-286c-4acb-969a-96639265bf2e";
string resourceGroupName = "mygroup";
string automationAccountName = "myaccount";
ResourceIdentifier automationAccountResourceId = AutomationAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, automationAccountName);
AutomationAccountResource automationAccount = client.GetAutomationAccountResource(automationAccountResourceId);
// get the collection of this SoftwareUpdateConfigurationResource
SoftwareUpdateConfigurationCollection collection = automationAccount.GetSoftwareUpdateConfigurations();
// invoke the operation and iterate over the result
await foreach (SoftwareUpdateConfigurationCollectionItem item in collection.GetAllAsync())
{
Console.WriteLine($"Succeeded: {item}");
}
Console.WriteLine($"Succeeded");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
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')
import com.azure.core.util.Context;
/** Samples for SoftwareUpdateConfigurations List. */
public final class Main {
/*
* x-ms-original-file: specification/automation/resource-manager/Microsoft.Automation/stable/2019-06-01/examples/softwareUpdateConfiguration/listSoftwareUpdateConfigurationsByVm.json
*/
/**
* Sample code: List software update configurations Targeting a specific azure virtual machine.
*
* @param manager Entry point to AutomationManager.
*/
public static void listSoftwareUpdateConfigurationsTargetingASpecificAzureVirtualMachine(
com.azure.resourcemanager.automation.AutomationManager manager) {
manager
.softwareUpdateConfigurations()
.listWithResponse(
"mygroup",
"myaccount",
null,
"properties/updateConfiguration/azureVirtualMachines/any(m: m eq"
+ " '/subscriptions/1a7d4044-286c-4acb-969a-96639265bf2e/resourceGroups/myresources/providers/Microsoft.Compute/virtualMachines/vm-01')",
Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.automation import AutomationClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-automation
# USAGE
python list_software_update_configurations_by_vm.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = AutomationClient(
credential=DefaultAzureCredential(),
subscription_id="1a7d4044-286c-4acb-969a-96639265bf2e",
)
response = client.software_update_configurations.list(
resource_group_name="mygroup",
automation_account_name="myaccount",
)
print(response)
# x-ms-original-file: specification/automation/resource-manager/Microsoft.Automation/stable/2019-06-01/examples/softwareUpdateConfiguration/listSoftwareUpdateConfigurationsByVm.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armautomation_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/automation/armautomation"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/432872fac1d0f8edcae98a0e8504afc0ee302710/specification/automation/resource-manager/Microsoft.Automation/stable/2019-06-01/examples/softwareUpdateConfiguration/listSoftwareUpdateConfigurationsByVm.json
func ExampleSoftwareUpdateConfigurationsClient_List_listSoftwareUpdateConfigurationsTargetingASpecificAzureVirtualMachine() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armautomation.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewSoftwareUpdateConfigurationsClient().List(ctx, "mygroup", "myaccount", &armautomation.SoftwareUpdateConfigurationsClientListOptions{ClientRequestID: nil,
Filter: to.Ptr("properties/updateConfiguration/azureVirtualMachines/any(m: m eq '/subscriptions/1a7d4044-286c-4acb-969a-96639265bf2e/resourceGroups/myresources/providers/Microsoft.Compute/virtualMachines/vm-01')"),
})
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.SoftwareUpdateConfigurationListResult = armautomation.SoftwareUpdateConfigurationListResult{
// Value: []*armautomation.SoftwareUpdateConfigurationCollectionItem{
// {
// Name: to.Ptr("testpatch-01"),
// ID: to.Ptr("/subscriptions/1a7d4044-286c-4acb-969a-96639265bf2e/resourceGroups/Mo-Resources-WCUS/providers/Microsoft.Automation/automationAccounts/Mo-AAA-WCUS/softwareUpdateConfigurations/testpatch-01"),
// Properties: &armautomation.SoftwareUpdateConfigurationCollectionItemProperties{
// CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-10-19T18:54:50.523Z"); return t}()),
// Frequency: to.Ptr(armautomation.ScheduleFrequencyWeek),
// LastModifiedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-10-19T18:54:50.680Z"); return t}()),
// NextRun: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-10-23T19:22:00.000Z"); return t}()),
// ProvisioningState: to.Ptr("Succeeded"),
// StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-10-19T19:22:00.000Z"); return t}()),
// Tasks: &armautomation.SoftwareUpdateConfigurationTasks{
// PostTask: &armautomation.TaskProperties{
// Source: to.Ptr("GetCache"),
// },
// PreTask: &armautomation.TaskProperties{
// Parameters: map[string]*string{
// "COMPUTERNAME": to.Ptr("Computer1"),
// },
// Source: to.Ptr("HelloWorld"),
// },
// },
// UpdateConfiguration: &armautomation.UpdateConfiguration{
// AzureVirtualMachines: []*string{
// to.Ptr("/subscriptions/1a7d4044-286c-4acb-969a-96639265bf2e/resourceGroups/myresources/providers/Microsoft.Compute/virtualMachines/vm-01"),
// to.Ptr("/subscriptions/1a7d4044-286c-4acb-969a-96639265bf2e/resourceGroups/myresources/providers/Microsoft.Compute/virtualMachines/vm-02"),
// to.Ptr("/subscriptions/1a7d4044-286c-4acb-969a-96639265bf2e/resourceGroups/myresources/providers/Microsoft.Compute/virtualMachines/vm-03")},
// Duration: to.Ptr("PT2H"),
// OperatingSystem: to.Ptr(armautomation.OperatingSystemTypeWindows),
// Windows: &armautomation.WindowsProperties{
// IncludedUpdateClassifications: to.Ptr(armautomation.WindowsUpdateClasses("Critical, Security, UpdateRollup, FeaturePack, ServicePack, Definition, Tools, Updates")),
// },
// },
// },
// },
// {
// Name: to.Ptr("testpatch-02"),
// ID: to.Ptr("/subscriptions/1a7d4044-286c-4acb-969a-96639265bf2e/resourceGroups/Mo-Resources-WCUS/providers/Microsoft.Automation/automationAccounts/Mo-AAA-WCUS/softwareUpdateConfigurations/testpatch-02"),
// Properties: &armautomation.SoftwareUpdateConfigurationCollectionItemProperties{
// CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-11T21:52:02.773Z"); return t}()),
// Frequency: to.Ptr(armautomation.ScheduleFrequencyHour),
// LastModifiedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-11T21:52:22.880Z"); return t}()),
// NextRun: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-05T19:26:00.000Z"); return t}()),
// ProvisioningState: to.Ptr("Succeeded"),
// StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-05T19:26:00.000Z"); return t}()),
// Tasks: &armautomation.SoftwareUpdateConfigurationTasks{
// PostTask: &armautomation.TaskProperties{
// Source: to.Ptr("GetCache"),
// },
// PreTask: &armautomation.TaskProperties{
// Parameters: map[string]*string{
// "COMPUTERNAME": to.Ptr("Computer1"),
// },
// Source: to.Ptr("HelloWorld"),
// },
// },
// UpdateConfiguration: &armautomation.UpdateConfiguration{
// AzureVirtualMachines: []*string{
// to.Ptr("/subscriptions/1a7d4044-286c-4acb-969a-96639265bf2e/resourceGroups/myresources/providers/Microsoft.Compute/virtualMachines/vm-01"),
// to.Ptr("/subscriptions/1a7d4044-286c-4acb-969a-96639265bf2e/resourceGroups/myresources/providers/Microsoft.Compute/virtualMachines/vm-05"),
// to.Ptr("/subscriptions/1a7d4044-286c-4acb-969a-96639265bf2e/resourceGroups/myresources/providers/Microsoft.Compute/virtualMachines/vm-06")},
// Duration: to.Ptr("PT2H30M"),
// OperatingSystem: to.Ptr(armautomation.OperatingSystemTypeWindows),
// Windows: &armautomation.WindowsProperties{
// IncludedUpdateClassifications: to.Ptr(armautomation.WindowsUpdateClasses("Critical, FeaturePack")),
// },
// },
// },
// }},
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { AutomationClient } = require("@azure/arm-automation");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Get all software update configurations for the account.
*
* @summary Get all software update configurations for the account.
* x-ms-original-file: specification/automation/resource-manager/Microsoft.Automation/stable/2019-06-01/examples/softwareUpdateConfiguration/listSoftwareUpdateConfigurationsByVm.json
*/
async function listSoftwareUpdateConfigurationsTargetingASpecificAzureVirtualMachine() {
const subscriptionId =
process.env["AUTOMATION_SUBSCRIPTION_ID"] || "1a7d4044-286c-4acb-969a-96639265bf2e";
const resourceGroupName = process.env["AUTOMATION_RESOURCE_GROUP"] || "mygroup";
const automationAccountName = "myaccount";
const filter =
"properties/updateConfiguration/azureVirtualMachines/any(m: m eq '/subscriptions/1a7d4044-286c-4acb-969a-96639265bf2e/resourceGroups/myresources/providers/Microsoft.Compute/virtualMachines/vm-01')";
const options = { filter };
const credential = new DefaultAzureCredential();
const client = new AutomationClient(credential, subscriptionId);
const result = await client.softwareUpdateConfigurations.list(
resourceGroupName,
automationAccountName,
options
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using System;
using System.Threading.Tasks;
using System.Xml;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Automation;
using Azure.ResourceManager.Automation.Models;
// Generated from example definition: specification/automation/resource-manager/Microsoft.Automation/stable/2019-06-01/examples/softwareUpdateConfiguration/listSoftwareUpdateConfigurationsByVm.json
// this example is just showing the usage of "SoftwareUpdateConfigurations_List" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this AutomationAccountResource created on azure
// for more information of creating AutomationAccountResource, please refer to the document of AutomationAccountResource
string subscriptionId = "1a7d4044-286c-4acb-969a-96639265bf2e";
string resourceGroupName = "mygroup";
string automationAccountName = "myaccount";
ResourceIdentifier automationAccountResourceId = AutomationAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, automationAccountName);
AutomationAccountResource automationAccount = client.GetAutomationAccountResource(automationAccountResourceId);
// get the collection of this SoftwareUpdateConfigurationResource
SoftwareUpdateConfigurationCollection collection = automationAccount.GetSoftwareUpdateConfigurations();
// invoke the operation and iterate over the result
string filter = "properties/updateConfiguration/azureVirtualMachines/any(m: m eq '/subscriptions/1a7d4044-286c-4acb-969a-96639265bf2e/resourceGroups/myresources/providers/Microsoft.Compute/virtualMachines/vm-01')";
await foreach (SoftwareUpdateConfigurationCollectionItem item in collection.GetAllAsync(filter: filter))
{
Console.WriteLine($"Succeeded: {item}");
}
Console.WriteLine($"Succeeded");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
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 クエリ。
名前 |
型 |
説明 |
locations
|
string[]
|
クエリのスコープを設定する場所の一覧。
|
scope
|
string[]
|
サブスクリプションまたはリソース グループの ARM ID の一覧。
|
tagSettings
|
TagSettingsProperties
|
VM のタグ設定。
|
ErrorResponse
操作エラーのエラー応答
名前 |
型 |
説明 |
code
|
string
|
エラー コード
|
message
|
string
|
操作が失敗した理由を示すエラー メッセージ。
|
LinuxProperties
Linux 固有の更新プログラムの構成。
名前 |
型 |
説明 |
excludedPackageNameMasks
|
string[]
|
ソフトウェア更新プログラムの構成から除外されたパッケージ。
|
includedPackageClassifications
|
LinuxUpdateClasses
|
ソフトウェア更新プログラムの構成に含まれる更新プログラムの分類。
|
includedPackageNameMasks
|
string[]
|
ソフトウェア更新プログラムの構成から含まれるパッケージ。
|
rebootSetting
|
string
|
ソフトウェア更新プログラムの構成の再起動設定。
|
LinuxUpdateClasses
ソフトウェア更新プログラムの構成に含まれる更新プログラムの分類。
名前 |
型 |
説明 |
Critical
|
string
|
|
Other
|
string
|
|
Security
|
string
|
|
Unclassified
|
string
|
|
NonAzureQueryProperties
更新プログラムの構成に対する Azure 以外のクエリ。
名前 |
型 |
説明 |
functionAlias
|
string
|
Log Analytics の保存された検索名。
|
workspaceId
|
string
|
保存された検索が存在する Log Analytics のワークスペース ID。
|
OperatingSystemType
ターゲット マシンのオペレーティング システム
名前 |
型 |
説明 |
Linux
|
string
|
|
Windows
|
string
|
|
ScheduleFrequency
スケジュールの頻度を取得または設定します。
名前 |
型 |
説明 |
Day
|
string
|
|
Hour
|
string
|
|
Minute
|
string
|
Minute スケジュールの最小許容間隔は 15 分です。
|
Month
|
string
|
|
OneTime
|
string
|
|
Week
|
string
|
|
softwareUpdateConfigurationCollectionItem
ソフトウェア更新プログラムの構成コレクション項目のプロパティ。
名前 |
型 |
説明 |
id
|
string
|
ソフトウェア更新プログラムの構成のリソース ID
|
name
|
string
|
ソフトウェア更新プログラムの構成の名前。
|
properties.creationTime
|
string
|
応答にのみ表示されるソフトウェア更新プログラムの構成の作成時間。
|
properties.frequency
|
ScheduleFrequency
|
ソフトウェア更新プログラムの構成に関連付けられているスケジュールの実行頻度
|
properties.lastModifiedTime
|
string
|
前回ソフトウェア更新プログラムの構成が変更されました。これは応答にのみ表示されます。
|
properties.nextRun
|
string
|
更新プログラムの ext ランタイム。
|
properties.provisioningState
|
string
|
応答にのみ表示されるソフトウェア更新プログラム構成のプロビジョニング状態。
|
properties.startTime
|
string
|
更新の開始時刻。
|
properties.tasks
|
softwareUpdateConfigurationTasks
|
事前タスクと事後タスクの定義
|
properties.updateConfiguration
|
updateConfiguration
|
ソフトウェア更新プログラムの構成の特定のプロパティを更新します。
|
softwareUpdateConfigurationListResult
すべてのソフトウェア更新プログラムの構成を一覧表示した結果
softwareUpdateConfigurationTasks
ソフトウェア更新プログラムの構成のタスク プロパティ。
TagOperators
指定した任意のタグまたはすべてのタグで VM をフィルター処理します。
名前 |
型 |
説明 |
All
|
string
|
|
Any
|
string
|
|
VM のタグ フィルター情報。
名前 |
型 |
説明 |
filterOperator
|
TagOperators
|
指定した任意のタグまたはすべてのタグで VM をフィルター処理します。
|
tags
|
object
|
値のリストを含むタグのディクショナリ。
|
TargetProperties
更新構成に固有のグループ。
taskProperties
ソフトウェア更新プログラムの構成のタスク プロパティ。
名前 |
型 |
説明 |
parameters
|
object
|
タスクのパラメーターを取得または設定します。
|
source
|
string
|
Runbook の名前を取得または設定します。
|
updateConfiguration
ソフトウェア更新プログラムの構成の特定のプロパティを更新します。
名前 |
型 |
説明 |
azureVirtualMachines
|
string[]
|
ソフトウェア更新プログラムの構成の対象となる Azure 仮想マシンの Azure リソース ID の一覧。
|
duration
|
string
|
ソフトウェア更新プログラム構成の実行に許可される最大時間。 期間は、ISO8601に従って PT[n]H[n]M[n]S 形式を使用して指定する必要があります
|
linux
|
LinuxProperties
|
Linux 固有の更新プログラムの構成。
|
nonAzureComputerNames
|
string[]
|
ソフトウェア更新プログラムの構成の対象となる Azure 以外のマシンの名前の一覧。
|
operatingSystem
|
OperatingSystemType
|
ターゲット マシンのオペレーティング システム
|
targets
|
TargetProperties
|
ソフトウェア更新プログラムの構成のターゲットをグループ化します。
|
windows
|
WindowsProperties
|
Windows 固有の更新プログラムの構成。
|
WindowsProperties
Windows 固有の更新プログラムの構成。
名前 |
型 |
説明 |
excludedKbNumbers
|
string[]
|
ソフトウェア更新プログラムの構成から除外される KB 番号。
|
includedKbNumbers
|
string[]
|
ソフトウェア更新プログラムの構成に含まれる KB 番号。
|
includedUpdateClassifications
|
WindowsUpdateClasses
|
ソフトウェア更新プログラムの構成に含まれる更新プログラムの分類。 必要な値を含むコンマ区切り文字列
|
rebootSetting
|
string
|
ソフトウェア更新プログラムの構成の再起動設定。
|
WindowsUpdateClasses
ソフトウェア更新プログラムの構成に含まれる更新プログラムの分類。 必要な値を含むコンマ区切り文字列
名前 |
型 |
説明 |
Critical
|
string
|
|
Definition
|
string
|
|
FeaturePack
|
string
|
|
Security
|
string
|
|
ServicePack
|
string
|
|
Tools
|
string
|
|
Unclassified
|
string
|
|
UpdateRollup
|
string
|
|
Updates
|
string
|
|