Documentation ¶
Index ¶
- type AzureCliScript
- type AzureCliScriptProperties
- type AzurePowerShellScript
- type AzurePowerShellScriptProperties
- type AzureResourceBase
- type CleanupOptions
- type Client
- func (client *Client) BeginCreate(ctx context.Context, resourceGroupName string, scriptName string, ...) (*runtime.Poller[ClientCreateResponse], error)
- func (client *Client) Delete(ctx context.Context, resourceGroupName string, scriptName string, ...) (ClientDeleteResponse, error)
- func (client *Client) Get(ctx context.Context, resourceGroupName string, scriptName string, ...) (ClientGetResponse, error)
- func (client *Client) GetLogs(ctx context.Context, resourceGroupName string, scriptName string, ...) (ClientGetLogsResponse, error)
- func (client *Client) GetLogsDefault(ctx context.Context, resourceGroupName string, scriptName string, ...) (ClientGetLogsDefaultResponse, error)
- func (client *Client) NewListByResourceGroupPager(resourceGroupName string, options *ClientListByResourceGroupOptions) *runtime.Pager[ClientListByResourceGroupResponse]
- func (client *Client) NewListBySubscriptionPager(options *ClientListBySubscriptionOptions) *runtime.Pager[ClientListBySubscriptionResponse]
- func (client *Client) Update(ctx context.Context, resourceGroupName string, scriptName string, ...) (ClientUpdateResponse, error)
- type ClientBeginCreateOptions
- type ClientCreateResponse
- type ClientDeleteOptions
- type ClientDeleteResponse
- type ClientFactory
- type ClientGetLogsDefaultOptions
- type ClientGetLogsDefaultResponse
- type ClientGetLogsOptions
- type ClientGetLogsResponse
- type ClientGetOptions
- type ClientGetResponse
- type ClientListByResourceGroupOptions
- type ClientListByResourceGroupResponse
- type ClientListBySubscriptionOptions
- type ClientListBySubscriptionResponse
- type ClientUpdateOptions
- type ClientUpdateResponse
- type ContainerConfiguration
- type CreatedByType
- type DeploymentScript
- type DeploymentScriptClassification
- type DeploymentScriptListResult
- type DeploymentScriptUpdateParameter
- type EnvironmentVariable
- type Error
- type ErrorAdditionalInfo
- type ErrorResponse
- type LogProperties
- type ManagedServiceIdentity
- type ManagedServiceIdentityType
- type ScriptLog
- type ScriptLogsList
- type ScriptProvisioningState
- type ScriptStatus
- type ScriptType
- type StorageAccountConfiguration
- type SystemData
- type UserAssignedIdentity
Examples ¶
- Client.BeginCreate (DeploymentScriptsCreate)
- Client.BeginCreate (DeploymentScriptsCreateMinCreate)
- Client.BeginCreate (DeploymentScriptsCreateNoUserManagedIdentity)
- Client.BeginCreate (DeploymentScriptsCreateUsingCustomAciName)
- Client.BeginCreate (DeploymentScriptsCreateUsingExistingStorageAccount)
- Client.Delete
- Client.Get
- Client.GetLogs
- Client.GetLogsDefault (DeploymentScriptsGetLogs)
- Client.GetLogsDefault (DeploymentScriptsGetLogsWithTail)
- Client.NewListByResourceGroupPager
- Client.NewListBySubscriptionPager
- Client.Update
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AzureCliScript ¶
type AzureCliScript struct { // REQUIRED; Type of the script. Kind *ScriptType // REQUIRED; The location of the ACI and the storage account for the deployment script. Location *string // REQUIRED; Properties of the Azure CLI script object. Properties *AzureCliScriptProperties // Optional property. Managed identity to be used for this deployment script. Currently, only user-assigned MSI is supported. Identity *ManagedServiceIdentity // Resource tags. Tags map[string]*string // READ-ONLY; String Id used to locate any resource on Azure. ID *string // READ-ONLY; Name of this resource. Name *string // READ-ONLY; The system metadata related to this resource. SystemData *SystemData // READ-ONLY; Type of this resource. Type *string }
AzureCliScript - Object model for the Azure CLI script.
func (*AzureCliScript) GetDeploymentScript ¶
func (a *AzureCliScript) GetDeploymentScript() *DeploymentScript
GetDeploymentScript implements the DeploymentScriptClassification interface for type AzureCliScript.
func (AzureCliScript) MarshalJSON ¶
func (a AzureCliScript) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AzureCliScript.
func (*AzureCliScript) UnmarshalJSON ¶
func (a *AzureCliScript) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AzureCliScript.
type AzureCliScriptProperties ¶
type AzureCliScriptProperties struct { // REQUIRED; Azure CLI module version to be used. AzCliVersion *string // REQUIRED; Interval for which the service retains the script resource after it reaches a terminal state. Resource will be // deleted when this duration expires. Duration is based on ISO 8601 pattern (for example // P1D means one day). RetentionInterval *string // Command line arguments to pass to the script. Arguments are separated by spaces. ex: -Name blue* -Location 'West US 2' Arguments *string // The clean up preference when the script execution gets in a terminal state. Default setting is 'Always'. CleanupPreference *CleanupOptions // Container settings. ContainerSettings *ContainerConfiguration // The environment variables to pass over to the script. EnvironmentVariables []*EnvironmentVariable // Gets or sets how the deployment script should be forced to execute even if the script resource has not changed. Can be // current time stamp or a GUID. ForceUpdateTag *string // Uri for the script. This is the entry point for the external script. PrimaryScriptURI *string // Script body. ScriptContent *string // Storage Account settings. StorageAccountSettings *StorageAccountConfiguration // Supporting files for the external script. SupportingScriptUris []*string // Maximum allowed script execution time specified in ISO 8601 format. Default value is P1D Timeout *string // READ-ONLY; List of script outputs. Outputs map[string]any // READ-ONLY; State of the script execution. This only appears in the response. ProvisioningState *ScriptProvisioningState // READ-ONLY; Contains the results of script execution. Status *ScriptStatus }
AzureCliScriptProperties - Properties of the Azure CLI script object.
func (AzureCliScriptProperties) MarshalJSON ¶
func (a AzureCliScriptProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AzureCliScriptProperties.
func (*AzureCliScriptProperties) UnmarshalJSON ¶
func (a *AzureCliScriptProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AzureCliScriptProperties.
type AzurePowerShellScript ¶
type AzurePowerShellScript struct { // REQUIRED; Type of the script. Kind *ScriptType // REQUIRED; The location of the ACI and the storage account for the deployment script. Location *string // REQUIRED; Properties of the Azure PowerShell script object. Properties *AzurePowerShellScriptProperties // Optional property. Managed identity to be used for this deployment script. Currently, only user-assigned MSI is supported. Identity *ManagedServiceIdentity // Resource tags. Tags map[string]*string // READ-ONLY; String Id used to locate any resource on Azure. ID *string // READ-ONLY; Name of this resource. Name *string // READ-ONLY; The system metadata related to this resource. SystemData *SystemData // READ-ONLY; Type of this resource. Type *string }
AzurePowerShellScript - Object model for the Azure PowerShell script.
func (*AzurePowerShellScript) GetDeploymentScript ¶
func (a *AzurePowerShellScript) GetDeploymentScript() *DeploymentScript
GetDeploymentScript implements the DeploymentScriptClassification interface for type AzurePowerShellScript.
func (AzurePowerShellScript) MarshalJSON ¶
func (a AzurePowerShellScript) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AzurePowerShellScript.
func (*AzurePowerShellScript) UnmarshalJSON ¶
func (a *AzurePowerShellScript) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AzurePowerShellScript.
type AzurePowerShellScriptProperties ¶
type AzurePowerShellScriptProperties struct { // REQUIRED; Azure PowerShell module version to be used. AzPowerShellVersion *string // REQUIRED; Interval for which the service retains the script resource after it reaches a terminal state. Resource will be // deleted when this duration expires. Duration is based on ISO 8601 pattern (for example // P1D means one day). RetentionInterval *string // Command line arguments to pass to the script. Arguments are separated by spaces. ex: -Name blue* -Location 'West US 2' Arguments *string // The clean up preference when the script execution gets in a terminal state. Default setting is 'Always'. CleanupPreference *CleanupOptions // Container settings. ContainerSettings *ContainerConfiguration // The environment variables to pass over to the script. EnvironmentVariables []*EnvironmentVariable // Gets or sets how the deployment script should be forced to execute even if the script resource has not changed. Can be // current time stamp or a GUID. ForceUpdateTag *string // Uri for the script. This is the entry point for the external script. PrimaryScriptURI *string // Script body. ScriptContent *string // Storage Account settings. StorageAccountSettings *StorageAccountConfiguration // Supporting files for the external script. SupportingScriptUris []*string // Maximum allowed script execution time specified in ISO 8601 format. Default value is P1D Timeout *string // READ-ONLY; List of script outputs. Outputs map[string]any // READ-ONLY; State of the script execution. This only appears in the response. ProvisioningState *ScriptProvisioningState // READ-ONLY; Contains the results of script execution. Status *ScriptStatus }
AzurePowerShellScriptProperties - Properties of the Azure PowerShell script object.
func (AzurePowerShellScriptProperties) MarshalJSON ¶
func (a AzurePowerShellScriptProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AzurePowerShellScriptProperties.
func (*AzurePowerShellScriptProperties) UnmarshalJSON ¶
func (a *AzurePowerShellScriptProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AzurePowerShellScriptProperties.
type AzureResourceBase ¶
type AzureResourceBase struct { // READ-ONLY; String Id used to locate any resource on Azure. ID *string // READ-ONLY; Name of this resource. Name *string // READ-ONLY; Type of this resource. Type *string }
AzureResourceBase - Common properties for all Azure resources.
func (AzureResourceBase) MarshalJSON ¶
func (a AzureResourceBase) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AzureResourceBase.
func (*AzureResourceBase) UnmarshalJSON ¶
func (a *AzureResourceBase) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AzureResourceBase.
type CleanupOptions ¶
type CleanupOptions string
CleanupOptions - The clean up preference when the script execution gets in a terminal state. Default setting is 'Always'.
const ( CleanupOptionsAlways CleanupOptions = "Always" CleanupOptionsOnExpiration CleanupOptions = "OnExpiration" CleanupOptionsOnSuccess CleanupOptions = "OnSuccess" )
func PossibleCleanupOptionsValues ¶
func PossibleCleanupOptionsValues() []CleanupOptions
PossibleCleanupOptionsValues returns the possible values for the CleanupOptions const type.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client contains the methods for the DeploymentScripts group. Don't use this type directly, use NewClient() instead.
func NewClient ¶
func NewClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*Client, error)
NewClient creates a new instance of Client with the specified values.
- subscriptionID - Subscription Id which forms part of the URI for every service call.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*Client) BeginCreate ¶
func (client *Client) BeginCreate(ctx context.Context, resourceGroupName string, scriptName string, deploymentScript DeploymentScriptClassification, options *ClientBeginCreateOptions) (*runtime.Poller[ClientCreateResponse], error)
BeginCreate - Creates a deployment script. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2020-10-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- scriptName - Name of the deployment script.
- deploymentScript - Deployment script supplied to the operation.
- options - ClientBeginCreateOptions contains the optional parameters for the Client.BeginCreate method.
Example (DeploymentScriptsCreate) ¶
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
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armdeploymentscripts.NewClientFactory("<subscription-id>", 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-13T23:19:45.000Z"); return t}()), // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-13T23:19:45.000Z"); return t}()), // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-13T23:19:45.000Z"); 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"), // }, // }, // }
Output:
Example (DeploymentScriptsCreateMinCreate) ¶
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
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armdeploymentscripts.NewClientFactory("<subscription-id>", 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-13T23:19:45.000Z"); return t}()), // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-13T23:19:45.000Z"); return t}()), // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-13T23:19:45.000Z"); 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"), // }, // }, // }
Output:
Example (DeploymentScriptsCreateNoUserManagedIdentity) ¶
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
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armdeploymentscripts.NewClientFactory("<subscription-id>", 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-13T23:19:45.000Z"); return t}()), // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-13T23:19:45.000Z"); return t}()), // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-13T23:19:45.000Z"); 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"), // }, // }, // }
Output:
Example (DeploymentScriptsCreateUsingCustomAciName) ¶
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
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armdeploymentscripts.NewClientFactory("<subscription-id>", 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-13T23:19:45.000Z"); return t}()), // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-13T23:19:45.000Z"); return t}()), // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-13T23:19:45.000Z"); 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"), // }, // }, // }
Output:
Example (DeploymentScriptsCreateUsingExistingStorageAccount) ¶
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
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armdeploymentscripts.NewClientFactory("<subscription-id>", 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-13T23:19:45.000Z"); return t}()), // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-13T23:19:45.000Z"); return t}()), // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-13T23:19:45.000Z"); 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"), // }, // }, // }
Output:
func (*Client) Delete ¶
func (client *Client) Delete(ctx context.Context, resourceGroupName string, scriptName string, options *ClientDeleteOptions) (ClientDeleteResponse, error)
Delete - Deletes a deployment script. When operation completes, status code 200 returned without content. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2020-10-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- scriptName - Name of the deployment script.
- options - ClientDeleteOptions contains the optional parameters for the Client.Delete method.
Example ¶
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
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armdeploymentscripts.NewClientFactory("<subscription-id>", 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) }
Output:
func (*Client) Get ¶
func (client *Client) Get(ctx context.Context, resourceGroupName string, scriptName string, options *ClientGetOptions) (ClientGetResponse, error)
Get - Gets a deployment script with a given name. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2020-10-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- scriptName - Name of the deployment script.
- options - ClientGetOptions contains the optional parameters for the Client.Get method.
Example ¶
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
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armdeploymentscripts.NewClientFactory("<subscription-id>", 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.107Z"); 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.107Z"); 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-13T23:19:45.000Z"); return t}()), // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-13T23:19:45.000Z"); return t}()), // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-13T23:19:45.000Z"); 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"), // }, // }, // }
Output:
func (*Client) GetLogs ¶
func (client *Client) GetLogs(ctx context.Context, resourceGroupName string, scriptName string, options *ClientGetLogsOptions) (ClientGetLogsResponse, error)
GetLogs - Gets deployment script logs for a given deployment script name. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2020-10-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- scriptName - Name of the deployment script.
- options - ClientGetLogsOptions contains the optional parameters for the Client.GetLogs method.
Example ¶
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
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armdeploymentscripts.NewClientFactory("<subscription-id>", 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"), // }, // }}, // }
Output:
func (*Client) GetLogsDefault ¶
func (client *Client) GetLogsDefault(ctx context.Context, resourceGroupName string, scriptName string, options *ClientGetLogsDefaultOptions) (ClientGetLogsDefaultResponse, error)
GetLogsDefault - Gets deployment script logs for a given deployment script name. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2020-10-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- scriptName - Name of the deployment script.
- options - ClientGetLogsDefaultOptions contains the optional parameters for the Client.GetLogsDefault method.
Example (DeploymentScriptsGetLogs) ¶
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
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armdeploymentscripts.NewClientFactory("<subscription-id>", 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"), // }, // }
Output:
Example (DeploymentScriptsGetLogsWithTail) ¶
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
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armdeploymentscripts.NewClientFactory("<subscription-id>", 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"), // }, // }
Output:
func (*Client) NewListByResourceGroupPager ¶
func (client *Client) NewListByResourceGroupPager(resourceGroupName string, options *ClientListByResourceGroupOptions) *runtime.Pager[ClientListByResourceGroupResponse]
NewListByResourceGroupPager - Lists deployments scripts.
Generated from API version 2020-10-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- options - ClientListByResourceGroupOptions contains the optional parameters for the Client.NewListByResourceGroupPager method.
Example ¶
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
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armdeploymentscripts.NewClientFactory("<subscription-id>", 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.107Z"); 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.107Z"); 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-13T23:19:45.000Z"); return t}()), // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-13T23:19:45.000Z"); return t}()), // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-13T23:19:45.000Z"); 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"), // }, // }}, // } }
Output:
func (*Client) NewListBySubscriptionPager ¶
func (client *Client) NewListBySubscriptionPager(options *ClientListBySubscriptionOptions) *runtime.Pager[ClientListBySubscriptionResponse]
NewListBySubscriptionPager - Lists all deployment scripts for a given subscription.
Generated from API version 2020-10-01
- options - ClientListBySubscriptionOptions contains the optional parameters for the Client.NewListBySubscriptionPager method.
Example ¶
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
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armdeploymentscripts.NewClientFactory("<subscription-id>", 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.107Z"); 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.107Z"); 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-13T23:19:45.000Z"); return t}()), // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-13T23:19:45.000Z"); return t}()), // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-13T23:19:45.000Z"); 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"), // }, // }}, // } }
Output:
func (*Client) Update ¶
func (client *Client) Update(ctx context.Context, resourceGroupName string, scriptName string, options *ClientUpdateOptions) (ClientUpdateResponse, error)
Update - Updates deployment script tags with specified values. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2020-10-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- scriptName - Name of the deployment script.
- options - ClientUpdateOptions contains the optional parameters for the Client.Update method.
Example ¶
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
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armdeploymentscripts.NewClientFactory("<subscription-id>", 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.107Z"); 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.107Z"); 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-13T23:19:45.000Z"); return t}()), // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-13T23:19:45.000Z"); return t}()), // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-13T23:19:45.000Z"); 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"), // }, // }, // }
Output:
type ClientBeginCreateOptions ¶
type ClientBeginCreateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
ClientBeginCreateOptions contains the optional parameters for the Client.BeginCreate method.
type ClientCreateResponse ¶
type ClientCreateResponse struct { // Deployment script object. DeploymentScriptClassification }
ClientCreateResponse contains the response from method Client.BeginCreate.
func (ClientCreateResponse) MarshalJSON ¶ added in v2.1.0
func (c ClientCreateResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ClientCreateResponse.
func (*ClientCreateResponse) UnmarshalJSON ¶
func (c *ClientCreateResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ClientCreateResponse.
type ClientDeleteOptions ¶
type ClientDeleteOptions struct { }
ClientDeleteOptions contains the optional parameters for the Client.Delete method.
type ClientDeleteResponse ¶
type ClientDeleteResponse struct { }
ClientDeleteResponse contains the response from method Client.Delete.
type ClientFactory ¶
type ClientFactory struct {
// contains filtered or unexported fields
}
ClientFactory is a client factory used to create any client in this module. Don't use this type directly, use NewClientFactory instead.
func NewClientFactory ¶
func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error)
NewClientFactory creates a new instance of ClientFactory with the specified values. The parameter values will be propagated to any client created from this factory.
- subscriptionID - Subscription Id which forms part of the URI for every service call.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*ClientFactory) NewClient ¶
func (c *ClientFactory) NewClient() *Client
NewClient creates a new instance of Client.
type ClientGetLogsDefaultOptions ¶
type ClientGetLogsDefaultOptions struct { // The number of lines to show from the tail of the deployment script log. Valid value is a positive number up to 1000. If // 'tail' is not provided, all available logs are shown up to container instance // log capacity of 4mb. Tail *int32 }
ClientGetLogsDefaultOptions contains the optional parameters for the Client.GetLogsDefault method.
type ClientGetLogsDefaultResponse ¶
type ClientGetLogsDefaultResponse struct { // Script execution log object. ScriptLog }
ClientGetLogsDefaultResponse contains the response from method Client.GetLogsDefault.
type ClientGetLogsOptions ¶
type ClientGetLogsOptions struct { }
ClientGetLogsOptions contains the optional parameters for the Client.GetLogs method.
type ClientGetLogsResponse ¶
type ClientGetLogsResponse struct { // Deployment script execution logs. ScriptLogsList }
ClientGetLogsResponse contains the response from method Client.GetLogs.
type ClientGetOptions ¶
type ClientGetOptions struct { }
ClientGetOptions contains the optional parameters for the Client.Get method.
type ClientGetResponse ¶
type ClientGetResponse struct { // Deployment script object. DeploymentScriptClassification }
ClientGetResponse contains the response from method Client.Get.
func (*ClientGetResponse) UnmarshalJSON ¶
func (c *ClientGetResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ClientGetResponse.
type ClientListByResourceGroupOptions ¶
type ClientListByResourceGroupOptions struct { }
ClientListByResourceGroupOptions contains the optional parameters for the Client.NewListByResourceGroupPager method.
type ClientListByResourceGroupResponse ¶
type ClientListByResourceGroupResponse struct { // List of deployment scripts. DeploymentScriptListResult }
ClientListByResourceGroupResponse contains the response from method Client.NewListByResourceGroupPager.
type ClientListBySubscriptionOptions ¶
type ClientListBySubscriptionOptions struct { }
ClientListBySubscriptionOptions contains the optional parameters for the Client.NewListBySubscriptionPager method.
type ClientListBySubscriptionResponse ¶
type ClientListBySubscriptionResponse struct { // List of deployment scripts. DeploymentScriptListResult }
ClientListBySubscriptionResponse contains the response from method Client.NewListBySubscriptionPager.
type ClientUpdateOptions ¶
type ClientUpdateOptions struct { // Deployment script resource with the tags to be updated. DeploymentScript *DeploymentScriptUpdateParameter }
ClientUpdateOptions contains the optional parameters for the Client.Update method.
type ClientUpdateResponse ¶
type ClientUpdateResponse struct { // Deployment script object. DeploymentScriptClassification }
ClientUpdateResponse contains the response from method Client.Update.
func (*ClientUpdateResponse) UnmarshalJSON ¶
func (c *ClientUpdateResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ClientUpdateResponse.
type ContainerConfiguration ¶
type ContainerConfiguration struct { // Container group name, if not specified then the name will get auto-generated. Not specifying a 'containerGroupName' indicates // the system to generate a unique name which might end up flagging an Azure // Policy as non-compliant. Use 'containerGroupName' when you have an Azure Policy that expects a specific naming convention // or when you want to fully control the name. 'containerGroupName' property must // be between 1 and 63 characters long, must contain only lowercase letters, numbers, and dashes and it cannot start or end // with a dash and consecutive dashes are not allowed. To specify a // 'containerGroupName', add the following object to properties: { "containerSettings": { "containerGroupName": "contoso-container" // } }. If you do not want to specify a 'containerGroupName' then do not // add 'containerSettings' property. ContainerGroupName *string }
ContainerConfiguration - Settings to customize ACI container instance.
func (ContainerConfiguration) MarshalJSON ¶
func (c ContainerConfiguration) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ContainerConfiguration.
func (*ContainerConfiguration) UnmarshalJSON ¶
func (c *ContainerConfiguration) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ContainerConfiguration.
type CreatedByType ¶
type CreatedByType string
CreatedByType - The type of identity that created the resource.
const ( CreatedByTypeApplication CreatedByType = "Application" CreatedByTypeKey CreatedByType = "Key" CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity" CreatedByTypeUser CreatedByType = "User" )
func PossibleCreatedByTypeValues ¶
func PossibleCreatedByTypeValues() []CreatedByType
PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type.
type DeploymentScript ¶
type DeploymentScript struct { // REQUIRED; Type of the script. Kind *ScriptType // REQUIRED; The location of the ACI and the storage account for the deployment script. Location *string // Optional property. Managed identity to be used for this deployment script. Currently, only user-assigned MSI is supported. Identity *ManagedServiceIdentity // Resource tags. Tags map[string]*string // READ-ONLY; String Id used to locate any resource on Azure. ID *string // READ-ONLY; Name of this resource. Name *string // READ-ONLY; The system metadata related to this resource. SystemData *SystemData // READ-ONLY; Type of this resource. Type *string }
DeploymentScript - Deployment script object.
func (*DeploymentScript) GetDeploymentScript ¶
func (d *DeploymentScript) GetDeploymentScript() *DeploymentScript
GetDeploymentScript implements the DeploymentScriptClassification interface for type DeploymentScript.
func (DeploymentScript) MarshalJSON ¶
func (d DeploymentScript) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DeploymentScript.
func (*DeploymentScript) UnmarshalJSON ¶
func (d *DeploymentScript) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DeploymentScript.
type DeploymentScriptClassification ¶
type DeploymentScriptClassification interface { // GetDeploymentScript returns the DeploymentScript content of the underlying type. GetDeploymentScript() *DeploymentScript }
DeploymentScriptClassification provides polymorphic access to related types. Call the interface's GetDeploymentScript() method to access the common type. Use a type switch to determine the concrete type. The possible types are: - *AzureCliScript, *AzurePowerShellScript, *DeploymentScript
type DeploymentScriptListResult ¶
type DeploymentScriptListResult struct { // An array of deployment scripts. Value []DeploymentScriptClassification // READ-ONLY; The URL to use for getting the next set of results. NextLink *string }
DeploymentScriptListResult - List of deployment scripts.
func (DeploymentScriptListResult) MarshalJSON ¶
func (d DeploymentScriptListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DeploymentScriptListResult.
func (*DeploymentScriptListResult) UnmarshalJSON ¶
func (d *DeploymentScriptListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DeploymentScriptListResult.
type DeploymentScriptUpdateParameter ¶
type DeploymentScriptUpdateParameter struct { // Resource tags to be updated. Tags map[string]*string // READ-ONLY; String Id used to locate any resource on Azure. ID *string // READ-ONLY; Name of this resource. Name *string // READ-ONLY; Type of this resource. Type *string }
DeploymentScriptUpdateParameter - Deployment script parameters to be updated.
func (DeploymentScriptUpdateParameter) MarshalJSON ¶
func (d DeploymentScriptUpdateParameter) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DeploymentScriptUpdateParameter.
func (*DeploymentScriptUpdateParameter) UnmarshalJSON ¶
func (d *DeploymentScriptUpdateParameter) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DeploymentScriptUpdateParameter.
type EnvironmentVariable ¶
type EnvironmentVariable struct { // REQUIRED; The name of the environment variable. Name *string // The value of the secure environment variable. SecureValue *string // The value of the environment variable. Value *string }
EnvironmentVariable - The environment variable to pass to the script in the container instance.
func (EnvironmentVariable) MarshalJSON ¶
func (e EnvironmentVariable) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type EnvironmentVariable.
func (*EnvironmentVariable) UnmarshalJSON ¶
func (e *EnvironmentVariable) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentVariable.
type Error ¶
type Error struct { // Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows // the OData error response format.) Error *ErrorResponse }
Error - Deployment scripts error response.
func (Error) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Error.
func (*Error) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface for type Error.
type ErrorAdditionalInfo ¶
type ErrorAdditionalInfo struct { // READ-ONLY; The additional info. Info any // READ-ONLY; The additional info type. Type *string }
ErrorAdditionalInfo - The resource management error additional info.
func (ErrorAdditionalInfo) MarshalJSON ¶
func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ErrorAdditionalInfo.
func (*ErrorAdditionalInfo) UnmarshalJSON ¶
func (e *ErrorAdditionalInfo) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ErrorAdditionalInfo.
type ErrorResponse ¶
type ErrorResponse struct { // READ-ONLY; The error additional info. AdditionalInfo []*ErrorAdditionalInfo // READ-ONLY; The error code. Code *string // READ-ONLY; The error details. Details []*ErrorResponse // READ-ONLY; The error message. Message *string // READ-ONLY; The error target. Target *string }
ErrorResponse - Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.)
func (ErrorResponse) MarshalJSON ¶
func (e ErrorResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ErrorResponse.
func (*ErrorResponse) UnmarshalJSON ¶
func (e *ErrorResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponse.
type LogProperties ¶
type LogProperties struct { // READ-ONLY; Script execution logs in text format. Log *string }
LogProperties - Script log properties.
func (LogProperties) MarshalJSON ¶
func (l LogProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type LogProperties.
func (*LogProperties) UnmarshalJSON ¶
func (l *LogProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type LogProperties.
type ManagedServiceIdentity ¶
type ManagedServiceIdentity struct { // Type of the managed identity. Type *ManagedServiceIdentityType // The list of user-assigned managed identities associated with the resource. Key is the Azure resource Id of the managed // identity. UserAssignedIdentities map[string]*UserAssignedIdentity // READ-ONLY; ID of the Azure Active Directory. TenantID *string }
ManagedServiceIdentity - Managed identity generic object.
func (ManagedServiceIdentity) MarshalJSON ¶
func (m ManagedServiceIdentity) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ManagedServiceIdentity.
func (*ManagedServiceIdentity) UnmarshalJSON ¶
func (m *ManagedServiceIdentity) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ManagedServiceIdentity.
type ManagedServiceIdentityType ¶
type ManagedServiceIdentityType string
ManagedServiceIdentityType - Type of the managed identity.
const (
ManagedServiceIdentityTypeUserAssigned ManagedServiceIdentityType = "UserAssigned"
)
func PossibleManagedServiceIdentityTypeValues ¶
func PossibleManagedServiceIdentityTypeValues() []ManagedServiceIdentityType
PossibleManagedServiceIdentityTypeValues returns the possible values for the ManagedServiceIdentityType const type.
type ScriptLog ¶
type ScriptLog struct { // Script log properties. Properties *LogProperties // READ-ONLY; String Id used to locate any resource on Azure. ID *string // READ-ONLY; Name of this resource. Name *string // READ-ONLY; Type of this resource. Type *string }
ScriptLog - Script execution log object.
func (ScriptLog) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type ScriptLog.
func (*ScriptLog) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface for type ScriptLog.
type ScriptLogsList ¶
type ScriptLogsList struct { // Deployment scripts logs. Value []*ScriptLog }
ScriptLogsList - Deployment script execution logs.
func (ScriptLogsList) MarshalJSON ¶
func (s ScriptLogsList) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ScriptLogsList.
func (*ScriptLogsList) UnmarshalJSON ¶
func (s *ScriptLogsList) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ScriptLogsList.
type ScriptProvisioningState ¶
type ScriptProvisioningState string
ScriptProvisioningState - State of the script execution. This only appears in the response.
const ( ScriptProvisioningStateCanceled ScriptProvisioningState = "Canceled" ScriptProvisioningStateCreating ScriptProvisioningState = "Creating" ScriptProvisioningStateFailed ScriptProvisioningState = "Failed" ScriptProvisioningStateProvisioningResources ScriptProvisioningState = "ProvisioningResources" ScriptProvisioningStateRunning ScriptProvisioningState = "Running" ScriptProvisioningStateSucceeded ScriptProvisioningState = "Succeeded" )
func PossibleScriptProvisioningStateValues ¶
func PossibleScriptProvisioningStateValues() []ScriptProvisioningState
PossibleScriptProvisioningStateValues returns the possible values for the ScriptProvisioningState const type.
type ScriptStatus ¶
type ScriptStatus struct { // Error that is relayed from the script execution. Error *ErrorResponse // READ-ONLY; ACI resource Id. ContainerInstanceID *string // READ-ONLY; End time of the script execution. EndTime *time.Time // READ-ONLY; Time the deployment script resource will expire. ExpirationTime *time.Time // READ-ONLY; Start time of the script execution. StartTime *time.Time // READ-ONLY; Storage account resource Id. StorageAccountID *string }
ScriptStatus - Generic object modeling results of script execution.
func (ScriptStatus) MarshalJSON ¶
func (s ScriptStatus) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ScriptStatus.
func (*ScriptStatus) UnmarshalJSON ¶
func (s *ScriptStatus) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ScriptStatus.
type ScriptType ¶
type ScriptType string
ScriptType - Type of the script.
const ( ScriptTypeAzureCLI ScriptType = "AzureCLI" ScriptTypeAzurePowerShell ScriptType = "AzurePowerShell" )
func PossibleScriptTypeValues ¶
func PossibleScriptTypeValues() []ScriptType
PossibleScriptTypeValues returns the possible values for the ScriptType const type.
type StorageAccountConfiguration ¶
type StorageAccountConfiguration struct { // The storage account access key. StorageAccountKey *string // The storage account name. StorageAccountName *string }
StorageAccountConfiguration - Settings to use an existing storage account. Valid storage account kinds are: Storage, StorageV2 and FileStorage
func (StorageAccountConfiguration) MarshalJSON ¶
func (s StorageAccountConfiguration) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type StorageAccountConfiguration.
func (*StorageAccountConfiguration) UnmarshalJSON ¶
func (s *StorageAccountConfiguration) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type StorageAccountConfiguration.
type SystemData ¶
type SystemData struct { // The timestamp of resource creation (UTC). CreatedAt *time.Time // The identity that created the resource. CreatedBy *string // The type of identity that created the resource. CreatedByType *CreatedByType // The timestamp of resource last modification (UTC) LastModifiedAt *time.Time // The identity that last modified the resource. LastModifiedBy *string // The type of identity that last modified the resource. LastModifiedByType *CreatedByType }
SystemData - Metadata pertaining to creation and last modification of the resource.
func (SystemData) MarshalJSON ¶
func (s SystemData) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SystemData.
func (*SystemData) UnmarshalJSON ¶
func (s *SystemData) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SystemData.
type UserAssignedIdentity ¶
type UserAssignedIdentity struct { // READ-ONLY; Client App Id associated with this identity. ClientID *string // READ-ONLY; Azure Active Directory principal ID associated with this identity. PrincipalID *string }
UserAssignedIdentity - User-assigned managed identity.
func (UserAssignedIdentity) MarshalJSON ¶
func (u UserAssignedIdentity) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type UserAssignedIdentity.
func (*UserAssignedIdentity) UnmarshalJSON ¶
func (u *UserAssignedIdentity) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type UserAssignedIdentity.