From 25e2d94a5fab8a4af066fd3d2e5a17c7b1a1614c Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 19 May 2023 18:08:56 +0000 Subject: [PATCH] CodeGen from PR 23959 in Azure/azure-rest-api-specs Merge b16d72ae87892c1db25e17b4b575eed4923f67a7 into d0d161eb19d5efd1c3d23d47a5491a53f41cbd7c --- .../armdeploymentscripts/CHANGELOG.md | 4 + .../armdeploymentscripts/autorest.md | 6 +- .../client_example_test.go | 764 ------------------ .../armdeploymentscripts/constants.go | 2 +- .../resources/armdeploymentscripts/go.mod | 2 +- 5 files changed, 9 insertions(+), 769 deletions(-) delete mode 100644 sdk/resourcemanager/resources/armdeploymentscripts/client_example_test.go diff --git a/sdk/resourcemanager/resources/armdeploymentscripts/CHANGELOG.md b/sdk/resourcemanager/resources/armdeploymentscripts/CHANGELOG.md index e8b874b65876..6d8fae1b4068 100644 --- a/sdk/resourcemanager/resources/armdeploymentscripts/CHANGELOG.md +++ b/sdk/resourcemanager/resources/armdeploymentscripts/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History +## 2.0.2 (2023-05-19) +### Other Changes + + ## 2.0.1 (2023-04-14) ### Bug Fixes diff --git a/sdk/resourcemanager/resources/armdeploymentscripts/autorest.md b/sdk/resourcemanager/resources/armdeploymentscripts/autorest.md index 74f1541b6636..bff62fb1d214 100644 --- a/sdk/resourcemanager/resources/armdeploymentscripts/autorest.md +++ b/sdk/resourcemanager/resources/armdeploymentscripts/autorest.md @@ -5,9 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/resources/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/resources/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/resources/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/resources/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 2.0.1 +module-version: 2.0.2 package-deploymentscripts: true ``` \ No newline at end of file diff --git a/sdk/resourcemanager/resources/armdeploymentscripts/client_example_test.go b/sdk/resourcemanager/resources/armdeploymentscripts/client_example_test.go deleted file mode 100644 index 1ea0e3d5ebe9..000000000000 --- a/sdk/resourcemanager/resources/armdeploymentscripts/client_example_test.go +++ /dev/null @@ -1,764 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armdeploymentscripts_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/resources/armdeploymentscripts/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/resources/resource-manager/Microsoft.Resources/stable/2020-10-01/examples/DeploymentScripts_Create.json -func ExampleClient_BeginCreate_deploymentScriptsCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdeploymentscripts.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClient().BeginCreate(ctx, "script-rg", "MyDeploymentScript", &armdeploymentscripts.AzurePowerShellScript{ - Identity: &armdeploymentscripts.ManagedServiceIdentity{ - Type: to.Ptr(armdeploymentscripts.ManagedServiceIdentityTypeUserAssigned), - UserAssignedIdentities: map[string]*armdeploymentscripts.UserAssignedIdentity{ - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uai": {}, - }, - }, - Kind: to.Ptr(armdeploymentscripts.ScriptTypeAzurePowerShell), - Location: to.Ptr("westus"), - Properties: &armdeploymentscripts.AzurePowerShellScriptProperties{ - CleanupPreference: to.Ptr(armdeploymentscripts.CleanupOptionsAlways), - Arguments: to.Ptr("-Location 'westus' -Name \"*rg2\""), - RetentionInterval: to.Ptr("PT7D"), - ScriptContent: to.Ptr("Param([string]$Location,[string]$Name) $deploymentScriptOutputs['test'] = 'value' Get-AzResourceGroup -Location $Location -Name $Name"), - SupportingScriptUris: []*string{ - to.Ptr("https://uri1.to.supporting.script"), - to.Ptr("https://uri2.to.supporting.script")}, - Timeout: to.Ptr("PT1H"), - AzPowerShellVersion: to.Ptr("1.7.0"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %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 = armdeploymentscripts.ClientCreateResponse{ - // DeploymentScriptClassification: &armdeploymentscripts.AzurePowerShellScript{ - // Identity: &armdeploymentscripts.ManagedServiceIdentity{ - // Type: to.Ptr(armdeploymentscripts.ManagedServiceIdentityTypeUserAssigned), - // UserAssignedIdentities: map[string]*armdeploymentscripts.UserAssignedIdentity{ - // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uai": &armdeploymentscripts.UserAssignedIdentity{ - // }, - // }, - // }, - // Kind: to.Ptr(armdeploymentscripts.ScriptTypeAzurePowerShell), - // Location: to.Ptr("westus"), - // Properties: &armdeploymentscripts.AzurePowerShellScriptProperties{ - // CleanupPreference: to.Ptr(armdeploymentscripts.CleanupOptionsAlways), - // Outputs: map[string]any{ - // "output1": "value1", - // }, - // ProvisioningState: to.Ptr(armdeploymentscripts.ScriptProvisioningStateSucceeded), - // Status: &armdeploymentscripts.ScriptStatus{ - // ContainerInstanceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.ContainerInstance/containerGroups/scriptContainer"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-13T15:19:45-08:00"); return t}()), - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-13T15:19:45-08:00"); return t}()), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-13T15:19:45-08:00"); return t}()), - // StorageAccountID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.Storage/storageAccounts/scriptStorage"), - // }, - // Arguments: to.Ptr("-Location 'westus' -Name \"*rg2\""), - // RetentionInterval: to.Ptr("P7D"), - // ScriptContent: to.Ptr("Param([string]$Location,[string]$Name) $deploymentScriptOutputs['test'] = 'value' Get-AzResourceGroup -Location $Location -Name $Name"), - // SupportingScriptUris: []*string{ - // to.Ptr("https://uri1.to.supporting.script"), - // to.Ptr("https://uri2.to.supporting.script")}, - // Timeout: to.Ptr("PT1H"), - // AzPowerShellVersion: to.Ptr("1.7.0"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/resources/resource-manager/Microsoft.Resources/stable/2020-10-01/examples/DeploymentScripts_Create_No_UserManagedIdentity.json -func ExampleClient_BeginCreate_deploymentScriptsCreateNoUserManagedIdentity() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdeploymentscripts.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClient().BeginCreate(ctx, "script-rg", "MyDeploymentScript", &armdeploymentscripts.AzurePowerShellScript{ - Kind: to.Ptr(armdeploymentscripts.ScriptTypeAzurePowerShell), - Location: to.Ptr("westus"), - Properties: &armdeploymentscripts.AzurePowerShellScriptProperties{ - CleanupPreference: to.Ptr(armdeploymentscripts.CleanupOptionsAlways), - Arguments: to.Ptr("-Location 'westus' -Name \"*rg2\""), - RetentionInterval: to.Ptr("PT7D"), - ScriptContent: to.Ptr("Param([string]$Location,[string]$Name) $deploymentScriptOutputs['test'] = 'value' Get-AzResourceGroup -Location $Location -Name $Name"), - SupportingScriptUris: []*string{ - to.Ptr("https://uri1.to.supporting.script"), - to.Ptr("https://uri2.to.supporting.script")}, - Timeout: to.Ptr("PT1H"), - AzPowerShellVersion: to.Ptr("1.7.0"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %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 = armdeploymentscripts.ClientCreateResponse{ - // DeploymentScriptClassification: &armdeploymentscripts.AzurePowerShellScript{ - // Kind: to.Ptr(armdeploymentscripts.ScriptTypeAzurePowerShell), - // Location: to.Ptr("westus"), - // Properties: &armdeploymentscripts.AzurePowerShellScriptProperties{ - // CleanupPreference: to.Ptr(armdeploymentscripts.CleanupOptionsAlways), - // Outputs: map[string]any{ - // "output1": "value1", - // }, - // ProvisioningState: to.Ptr(armdeploymentscripts.ScriptProvisioningStateSucceeded), - // Status: &armdeploymentscripts.ScriptStatus{ - // ContainerInstanceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.ContainerInstance/containerGroups/scriptContainer"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-13T15:19:45-08:00"); return t}()), - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-13T15:19:45-08:00"); return t}()), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-13T15:19:45-08:00"); return t}()), - // StorageAccountID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.Storage/storageAccounts/scriptStorage"), - // }, - // Arguments: to.Ptr("-Location 'westus' -Name \"*rg2\""), - // RetentionInterval: to.Ptr("P7D"), - // ScriptContent: to.Ptr("Param([string]$Location,[string]$Name) $deploymentScriptOutputs['test'] = 'value' Get-AzResourceGroup -Location $Location -Name $Name"), - // SupportingScriptUris: []*string{ - // to.Ptr("https://uri1.to.supporting.script"), - // to.Ptr("https://uri2.to.supporting.script")}, - // Timeout: to.Ptr("PT1H"), - // AzPowerShellVersion: to.Ptr("1.7.0"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/resources/resource-manager/Microsoft.Resources/stable/2020-10-01/examples/DeploymentScripts_Min_Create.json -func ExampleClient_BeginCreate_deploymentScriptsCreateMinCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdeploymentscripts.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClient().BeginCreate(ctx, "script-rg", "MyDeploymentScript", &armdeploymentscripts.AzurePowerShellScript{ - Identity: &armdeploymentscripts.ManagedServiceIdentity{ - Type: to.Ptr(armdeploymentscripts.ManagedServiceIdentityTypeUserAssigned), - UserAssignedIdentities: map[string]*armdeploymentscripts.UserAssignedIdentity{ - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uai": {}, - }, - }, - Kind: to.Ptr(armdeploymentscripts.ScriptTypeAzurePowerShell), - Location: to.Ptr("westus"), - Properties: &armdeploymentscripts.AzurePowerShellScriptProperties{ - Arguments: to.Ptr("-Location 'westus' -Name \"*rg2\""), - RetentionInterval: to.Ptr("P7D"), - ScriptContent: to.Ptr("Param([string]$Location,[string]$Name) $deploymentScriptOutputs['test'] = 'value' Get-AzResourceGroup -Location $Location -Name $Name"), - AzPowerShellVersion: to.Ptr("1.7.0"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %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 = armdeploymentscripts.ClientCreateResponse{ - // DeploymentScriptClassification: &armdeploymentscripts.AzurePowerShellScript{ - // Identity: &armdeploymentscripts.ManagedServiceIdentity{ - // Type: to.Ptr(armdeploymentscripts.ManagedServiceIdentityTypeUserAssigned), - // UserAssignedIdentities: map[string]*armdeploymentscripts.UserAssignedIdentity{ - // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uai": &armdeploymentscripts.UserAssignedIdentity{ - // }, - // }, - // }, - // Kind: to.Ptr(armdeploymentscripts.ScriptTypeAzurePowerShell), - // Location: to.Ptr("westus"), - // Properties: &armdeploymentscripts.AzurePowerShellScriptProperties{ - // CleanupPreference: to.Ptr(armdeploymentscripts.CleanupOptionsAlways), - // Outputs: map[string]any{ - // "output1": "value1", - // }, - // ProvisioningState: to.Ptr(armdeploymentscripts.ScriptProvisioningStateSucceeded), - // Status: &armdeploymentscripts.ScriptStatus{ - // ContainerInstanceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.ContainerInstance/containerGroups/scriptContainer"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-13T15:19:45-08:00"); return t}()), - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-13T15:19:45-08:00"); return t}()), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-13T15:19:45-08:00"); return t}()), - // StorageAccountID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.Storage/storageAccounts/scriptStorage"), - // }, - // Arguments: to.Ptr("-Location 'westus' -Name \"*rg2\""), - // RetentionInterval: to.Ptr("P7D"), - // ScriptContent: to.Ptr("Param([string]$Location,[string]$Name) $deploymentScriptOutputs['test'] = 'value' Get-AzResourceGroup -Location $Location -Name $Name"), - // Timeout: to.Ptr("PT1H"), - // AzPowerShellVersion: to.Ptr("1.7.0"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/resources/resource-manager/Microsoft.Resources/stable/2020-10-01/examples/DeploymentScripts_Create_Using_Custom_Aci_Name.json -func ExampleClient_BeginCreate_deploymentScriptsCreateUsingCustomAciName() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdeploymentscripts.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClient().BeginCreate(ctx, "script-rg", "MyDeploymentScript", &armdeploymentscripts.AzurePowerShellScript{ - Identity: &armdeploymentscripts.ManagedServiceIdentity{ - Type: to.Ptr(armdeploymentscripts.ManagedServiceIdentityTypeUserAssigned), - UserAssignedIdentities: map[string]*armdeploymentscripts.UserAssignedIdentity{ - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uai": {}, - }, - }, - Kind: to.Ptr(armdeploymentscripts.ScriptTypeAzurePowerShell), - Location: to.Ptr("westus"), - Properties: &armdeploymentscripts.AzurePowerShellScriptProperties{ - CleanupPreference: to.Ptr(armdeploymentscripts.CleanupOptionsAlways), - ContainerSettings: &armdeploymentscripts.ContainerConfiguration{ - ContainerGroupName: to.Ptr("contoso-aci"), - }, - Arguments: to.Ptr("-Location 'westus' -Name \"*rg2\""), - RetentionInterval: to.Ptr("PT7D"), - ScriptContent: to.Ptr("Param([string]$Location,[string]$Name) $deploymentScriptOutputs['test'] = 'value' Get-AzResourceGroup -Location $Location -Name $Name"), - SupportingScriptUris: []*string{ - to.Ptr("https://uri1.to.supporting.script"), - to.Ptr("https://uri2.to.supporting.script")}, - Timeout: to.Ptr("PT1H"), - AzPowerShellVersion: to.Ptr("1.7.0"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %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 = armdeploymentscripts.ClientCreateResponse{ - // DeploymentScriptClassification: &armdeploymentscripts.AzurePowerShellScript{ - // Identity: &armdeploymentscripts.ManagedServiceIdentity{ - // Type: to.Ptr(armdeploymentscripts.ManagedServiceIdentityTypeUserAssigned), - // UserAssignedIdentities: map[string]*armdeploymentscripts.UserAssignedIdentity{ - // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uai": &armdeploymentscripts.UserAssignedIdentity{ - // }, - // }, - // }, - // Kind: to.Ptr(armdeploymentscripts.ScriptTypeAzurePowerShell), - // Location: to.Ptr("westus"), - // Properties: &armdeploymentscripts.AzurePowerShellScriptProperties{ - // CleanupPreference: to.Ptr(armdeploymentscripts.CleanupOptionsAlways), - // ContainerSettings: &armdeploymentscripts.ContainerConfiguration{ - // ContainerGroupName: to.Ptr("contoso-aci"), - // }, - // Outputs: map[string]any{ - // "output1": "value1", - // }, - // ProvisioningState: to.Ptr(armdeploymentscripts.ScriptProvisioningStateSucceeded), - // Status: &armdeploymentscripts.ScriptStatus{ - // ContainerInstanceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.ContainerInstance/containerGroups/scriptContainer"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-13T15:19:45-08:00"); return t}()), - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-13T15:19:45-08:00"); return t}()), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-13T15:19:45-08:00"); return t}()), - // StorageAccountID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.Storage/storageAccounts/scriptStorage"), - // }, - // Arguments: to.Ptr("-Location 'westus' -Name \"*rg2\""), - // RetentionInterval: to.Ptr("P7D"), - // ScriptContent: to.Ptr("Param([string]$Location,[string]$Name) $deploymentScriptOutputs['test'] = 'value' Get-AzResourceGroup -Location $Location -Name $Name"), - // SupportingScriptUris: []*string{ - // to.Ptr("https://uri1.to.supporting.script"), - // to.Ptr("https://uri2.to.supporting.script")}, - // Timeout: to.Ptr("PT1H"), - // AzPowerShellVersion: to.Ptr("1.7.0"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/resources/resource-manager/Microsoft.Resources/stable/2020-10-01/examples/DeploymentScripts_Create_Using_Existing_StorageAccount.json -func ExampleClient_BeginCreate_deploymentScriptsCreateUsingExistingStorageAccount() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdeploymentscripts.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClient().BeginCreate(ctx, "script-rg", "MyDeploymentScript", &armdeploymentscripts.AzurePowerShellScript{ - Identity: &armdeploymentscripts.ManagedServiceIdentity{ - Type: to.Ptr(armdeploymentscripts.ManagedServiceIdentityTypeUserAssigned), - UserAssignedIdentities: map[string]*armdeploymentscripts.UserAssignedIdentity{ - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uai": {}, - }, - }, - Kind: to.Ptr(armdeploymentscripts.ScriptTypeAzurePowerShell), - Location: to.Ptr("westus"), - Properties: &armdeploymentscripts.AzurePowerShellScriptProperties{ - CleanupPreference: to.Ptr(armdeploymentscripts.CleanupOptionsAlways), - StorageAccountSettings: &armdeploymentscripts.StorageAccountConfiguration{ - StorageAccountKey: to.Ptr("contosostoragekey"), - StorageAccountName: to.Ptr("contosostorage"), - }, - Arguments: to.Ptr("-Location 'westus' -Name \"*rg2\""), - RetentionInterval: to.Ptr("PT7D"), - ScriptContent: to.Ptr("Param([string]$Location,[string]$Name) $deploymentScriptOutputs['test'] = 'value' Get-AzResourceGroup -Location $Location -Name $Name"), - SupportingScriptUris: []*string{ - to.Ptr("https://uri1.to.supporting.script"), - to.Ptr("https://uri2.to.supporting.script")}, - Timeout: to.Ptr("PT1H"), - AzPowerShellVersion: to.Ptr("1.7.0"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %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 = armdeploymentscripts.ClientCreateResponse{ - // DeploymentScriptClassification: &armdeploymentscripts.AzurePowerShellScript{ - // Identity: &armdeploymentscripts.ManagedServiceIdentity{ - // Type: to.Ptr(armdeploymentscripts.ManagedServiceIdentityTypeUserAssigned), - // UserAssignedIdentities: map[string]*armdeploymentscripts.UserAssignedIdentity{ - // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uai": &armdeploymentscripts.UserAssignedIdentity{ - // }, - // }, - // }, - // Kind: to.Ptr(armdeploymentscripts.ScriptTypeAzurePowerShell), - // Location: to.Ptr("westus"), - // Properties: &armdeploymentscripts.AzurePowerShellScriptProperties{ - // CleanupPreference: to.Ptr(armdeploymentscripts.CleanupOptionsAlways), - // Outputs: map[string]any{ - // "output1": "value1", - // }, - // ProvisioningState: to.Ptr(armdeploymentscripts.ScriptProvisioningStateSucceeded), - // Status: &armdeploymentscripts.ScriptStatus{ - // ContainerInstanceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.ContainerInstance/containerGroups/scriptContainer"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-13T15:19:45-08:00"); return t}()), - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-13T15:19:45-08:00"); return t}()), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-13T15:19:45-08:00"); return t}()), - // StorageAccountID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.Storage/storageAccounts/scriptStorage"), - // }, - // StorageAccountSettings: &armdeploymentscripts.StorageAccountConfiguration{ - // StorageAccountName: to.Ptr("contosostorage"), - // }, - // Arguments: to.Ptr("-Location 'westus' -Name \"*rg2\""), - // RetentionInterval: to.Ptr("P7D"), - // ScriptContent: to.Ptr("Param([string]$Location,[string]$Name) $deploymentScriptOutputs['test'] = 'value' Get-AzResourceGroup -Location $Location -Name $Name"), - // SupportingScriptUris: []*string{ - // to.Ptr("https://uri1.to.supporting.script"), - // to.Ptr("https://uri2.to.supporting.script")}, - // Timeout: to.Ptr("PT1H"), - // AzPowerShellVersion: to.Ptr("1.7.0"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/resources/resource-manager/Microsoft.Resources/stable/2020-10-01/examples/DeploymentScripts_Update.json -func ExampleClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdeploymentscripts.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewClient().Update(ctx, "script-rg", "MyDeploymentScript", &armdeploymentscripts.ClientUpdateOptions{DeploymentScript: &armdeploymentscripts.DeploymentScriptUpdateParameter{ - Tags: map[string]*string{}, - }, - }) - 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 = armdeploymentscripts.ClientUpdateResponse{ - // DeploymentScriptClassification: &armdeploymentscripts.AzurePowerShellScript{ - // Identity: &armdeploymentscripts.ManagedServiceIdentity{ - // Type: to.Ptr(armdeploymentscripts.ManagedServiceIdentityTypeUserAssigned), - // UserAssignedIdentities: map[string]*armdeploymentscripts.UserAssignedIdentity{ - // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uai": &armdeploymentscripts.UserAssignedIdentity{ - // }, - // }, - // }, - // Kind: to.Ptr(armdeploymentscripts.ScriptTypeAzurePowerShell), - // Location: to.Ptr("westus"), - // SystemData: &armdeploymentscripts.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-01T01:01:01.1075056Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armdeploymentscripts.CreatedByTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-01T01:01:01.1075056Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armdeploymentscripts.CreatedByTypeApplication), - // }, - // Tags: map[string]*string{ - // }, - // Properties: &armdeploymentscripts.AzurePowerShellScriptProperties{ - // CleanupPreference: to.Ptr(armdeploymentscripts.CleanupOptionsAlways), - // Outputs: map[string]any{ - // "output1": "value1", - // }, - // ProvisioningState: to.Ptr(armdeploymentscripts.ScriptProvisioningStateSucceeded), - // Status: &armdeploymentscripts.ScriptStatus{ - // ContainerInstanceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.ContainerInstance/containerGroups/scriptContainer"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-13T15:19:45-08:00"); return t}()), - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-13T15:19:45-08:00"); return t}()), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-13T15:19:45-08:00"); return t}()), - // StorageAccountID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.Storage/storageAccounts/scriptStorage"), - // }, - // Arguments: to.Ptr("-Location 'westus' -Name \"*rg2\""), - // RetentionInterval: to.Ptr("P7D"), - // ScriptContent: to.Ptr("Param([string]$Location,[string]$Name) $deploymentScriptOutputs['test'] = 'value' Get-AzResourceGroup -Location $Location -Name $Name"), - // SupportingScriptUris: []*string{ - // to.Ptr("https://uri1.to.supporting.script"), - // to.Ptr("https://uri2.to.supporting.script")}, - // Timeout: to.Ptr("PT1H"), - // AzPowerShellVersion: to.Ptr("1.7.0"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/resources/resource-manager/Microsoft.Resources/stable/2020-10-01/examples/DeploymentScripts_Get.json -func ExampleClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdeploymentscripts.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewClient().Get(ctx, "script-rg", "MyDeploymentScript", 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 = armdeploymentscripts.ClientGetResponse{ - // DeploymentScriptClassification: &armdeploymentscripts.AzurePowerShellScript{ - // Identity: &armdeploymentscripts.ManagedServiceIdentity{ - // Type: to.Ptr(armdeploymentscripts.ManagedServiceIdentityTypeUserAssigned), - // UserAssignedIdentities: map[string]*armdeploymentscripts.UserAssignedIdentity{ - // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uai": &armdeploymentscripts.UserAssignedIdentity{ - // }, - // }, - // }, - // Kind: to.Ptr(armdeploymentscripts.ScriptTypeAzurePowerShell), - // Location: to.Ptr("westus"), - // SystemData: &armdeploymentscripts.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-01T01:01:01.1075056Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armdeploymentscripts.CreatedByTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-01T01:01:01.1075056Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armdeploymentscripts.CreatedByTypeApplication), - // }, - // Properties: &armdeploymentscripts.AzurePowerShellScriptProperties{ - // CleanupPreference: to.Ptr(armdeploymentscripts.CleanupOptionsAlways), - // Outputs: map[string]any{ - // "output1": "value1", - // }, - // ProvisioningState: to.Ptr(armdeploymentscripts.ScriptProvisioningStateSucceeded), - // Status: &armdeploymentscripts.ScriptStatus{ - // ContainerInstanceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.ContainerInstance/containerGroups/scriptContainer"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-13T15:19:45-08:00"); return t}()), - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-13T15:19:45-08:00"); return t}()), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-13T15:19:45-08:00"); return t}()), - // StorageAccountID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.Storage/storageAccounts/scriptStorage"), - // }, - // Arguments: to.Ptr("-Location 'westus' -Name \"*rg2\""), - // RetentionInterval: to.Ptr("PT7D"), - // ScriptContent: to.Ptr("Param([string]$Location,[string]$Name) $deploymentScriptOutputs['test'] = 'value' Get-AzResourceGroup -Location $Location -Name $Name"), - // Timeout: to.Ptr("PT1H"), - // AzPowerShellVersion: to.Ptr("1.7.0"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/resources/resource-manager/Microsoft.Resources/stable/2020-10-01/examples/DeploymentScripts_Delete.json -func ExampleClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdeploymentscripts.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewClient().Delete(ctx, "script-rg", "MyDeploymentScript", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/resources/resource-manager/Microsoft.Resources/stable/2020-10-01/examples/DeploymentScripts_ListBySubscription.json -func ExampleClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdeploymentscripts.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DeploymentScriptListResult = armdeploymentscripts.DeploymentScriptListResult{ - // Value: []armdeploymentscripts.DeploymentScriptClassification{ - // &armdeploymentscripts.AzurePowerShellScript{ - // Identity: &armdeploymentscripts.ManagedServiceIdentity{ - // Type: to.Ptr(armdeploymentscripts.ManagedServiceIdentityTypeUserAssigned), - // UserAssignedIdentities: map[string]*armdeploymentscripts.UserAssignedIdentity{ - // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uai": &armdeploymentscripts.UserAssignedIdentity{ - // }, - // }, - // }, - // Kind: to.Ptr(armdeploymentscripts.ScriptTypeAzurePowerShell), - // Location: to.Ptr("westus"), - // SystemData: &armdeploymentscripts.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-01T01:01:01.1075056Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armdeploymentscripts.CreatedByTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-01T01:01:01.1075056Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armdeploymentscripts.CreatedByTypeApplication), - // }, - // Properties: &armdeploymentscripts.AzurePowerShellScriptProperties{ - // CleanupPreference: to.Ptr(armdeploymentscripts.CleanupOptionsAlways), - // Outputs: map[string]any{ - // "output1": "value1", - // }, - // ProvisioningState: to.Ptr(armdeploymentscripts.ScriptProvisioningStateSucceeded), - // Status: &armdeploymentscripts.ScriptStatus{ - // ContainerInstanceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.ContainerInstance/containerGroups/scriptContainer"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-13T15:19:45-08:00"); return t}()), - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-13T15:19:45-08:00"); return t}()), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-13T15:19:45-08:00"); return t}()), - // StorageAccountID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.Storage/storageAccounts/scriptStorage"), - // }, - // Arguments: to.Ptr("-Location 'westus' -Name \"*rg2\""), - // RetentionInterval: to.Ptr("PT7D"), - // ScriptContent: to.Ptr("Param([string]$Location,[string]$Name) $deploymentScriptOutputs['test'] = 'value' Get-AzResourceGroup -Location $Location -Name $Name"), - // Timeout: to.Ptr("PT1H"), - // AzPowerShellVersion: to.Ptr("1.7.0"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/resources/resource-manager/Microsoft.Resources/stable/2020-10-01/examples/DeploymentScripts_GetLogs.json -func ExampleClient_GetLogs() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdeploymentscripts.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewClient().GetLogs(ctx, "script-rg", "MyDeploymentScript", 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.ScriptLogsList = armdeploymentscripts.ScriptLogsList{ - // Value: []*armdeploymentscripts.ScriptLog{ - // { - // Properties: &armdeploymentscripts.LogProperties{ - // Log: to.Ptr("script execution stdout/stderr logs"), - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/resources/resource-manager/Microsoft.Resources/stable/2020-10-01/examples/DeploymentScripts_GetLogsDefault.json -func ExampleClient_GetLogsDefault_deploymentScriptsGetLogs() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdeploymentscripts.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewClient().GetLogsDefault(ctx, "script-rg", "MyDeploymentScript", &armdeploymentscripts.ClientGetLogsDefaultOptions{Tail: 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.ScriptLog = armdeploymentscripts.ScriptLog{ - // Properties: &armdeploymentscripts.LogProperties{ - // Log: to.Ptr("script execution stdout/stderr logs"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/resources/resource-manager/Microsoft.Resources/stable/2020-10-01/examples/DeploymentScripts_GetLogsDefaultWithTail.json -func ExampleClient_GetLogsDefault_deploymentScriptsGetLogsWithTail() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdeploymentscripts.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewClient().GetLogsDefault(ctx, "script-rg", "MyDeploymentScript", &armdeploymentscripts.ClientGetLogsDefaultOptions{Tail: to.Ptr[int32](5)}) - 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.ScriptLog = armdeploymentscripts.ScriptLog{ - // Properties: &armdeploymentscripts.LogProperties{ - // Log: to.Ptr("script execution stdout/stderr logs"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/resources/resource-manager/Microsoft.Resources/stable/2020-10-01/examples/DeploymentScripts_ListByResourceGroup.json -func ExampleClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdeploymentscripts.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewClient().NewListByResourceGroupPager("script-rg", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DeploymentScriptListResult = armdeploymentscripts.DeploymentScriptListResult{ - // Value: []armdeploymentscripts.DeploymentScriptClassification{ - // &armdeploymentscripts.AzurePowerShellScript{ - // Identity: &armdeploymentscripts.ManagedServiceIdentity{ - // Type: to.Ptr(armdeploymentscripts.ManagedServiceIdentityTypeUserAssigned), - // UserAssignedIdentities: map[string]*armdeploymentscripts.UserAssignedIdentity{ - // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/uai": &armdeploymentscripts.UserAssignedIdentity{ - // }, - // }, - // }, - // Kind: to.Ptr(armdeploymentscripts.ScriptTypeAzurePowerShell), - // Location: to.Ptr("westus"), - // SystemData: &armdeploymentscripts.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-01T01:01:01.1075056Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armdeploymentscripts.CreatedByTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-01T01:01:01.1075056Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armdeploymentscripts.CreatedByTypeApplication), - // }, - // Properties: &armdeploymentscripts.AzurePowerShellScriptProperties{ - // CleanupPreference: to.Ptr(armdeploymentscripts.CleanupOptionsAlways), - // Outputs: map[string]any{ - // "output1": "value1", - // }, - // ProvisioningState: to.Ptr(armdeploymentscripts.ScriptProvisioningStateSucceeded), - // Status: &armdeploymentscripts.ScriptStatus{ - // ContainerInstanceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.ContainerInstance/containerGroups/scriptContainer"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-13T15:19:45-08:00"); return t}()), - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-13T15:19:45-08:00"); return t}()), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-13T15:19:45-08:00"); return t}()), - // StorageAccountID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scriptRG/providers/Microsoft.Storage/storageAccounts/scriptStorage"), - // }, - // Arguments: to.Ptr("-Location 'westus' -Name \"*rg2\""), - // RetentionInterval: to.Ptr("P7D"), - // ScriptContent: to.Ptr("Param([string]$Location,[string]$Name) $deploymentScriptOutputs['test'] = 'value' Get-AzResourceGroup -Location $Location -Name $Name"), - // SupportingScriptUris: []*string{ - // to.Ptr("https://uri1.to.supporting.script"), - // to.Ptr("https://uri2.to.supporting.script")}, - // Timeout: to.Ptr("PT1H"), - // AzPowerShellVersion: to.Ptr("1.7.0"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/resources/armdeploymentscripts/constants.go b/sdk/resourcemanager/resources/armdeploymentscripts/constants.go index 834b676b4482..576361faf9e6 100644 --- a/sdk/resourcemanager/resources/armdeploymentscripts/constants.go +++ b/sdk/resourcemanager/resources/armdeploymentscripts/constants.go @@ -11,7 +11,7 @@ package armdeploymentscripts const ( moduleName = "armdeploymentscripts" - moduleVersion = "v2.0.1" + moduleVersion = "v2.0.2" ) // CleanupOptions - The clean up preference when the script execution gets in a terminal state. Default setting is 'Always'. diff --git a/sdk/resourcemanager/resources/armdeploymentscripts/go.mod b/sdk/resourcemanager/resources/armdeploymentscripts/go.mod index 8d7224d04757..08ca5330ef95 100644 --- a/sdk/resourcemanager/resources/armdeploymentscripts/go.mod +++ b/sdk/resourcemanager/resources/armdeploymentscripts/go.mod @@ -4,7 +4,6 @@ go 1.18 require ( github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.1.2 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/msi/armmsi v0.6.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armdeploymentscripts v1.0.0 @@ -12,6 +11,7 @@ require ( ) require ( + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.0.0 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v0.7.0 // indirect