Documentation
¶
Index ¶
- Variables
- func CreateDeploymentOutput(rawOutputs interface{}) (result map[string]AzCliDeploymentOutput)
- func GetResourceTypeDisplayName(resourceType AzureResourceType) string
- func GroupByResourceGroup(resources []*armresources.ResourceReference) (map[string][]*Resource, error)
- type AzCliAccessToken
- type AzCliApim
- type AzCliAppConfig
- type AzCliAppServiceProperties
- type AzCliDeployment
- type AzCliDeploymentAdditionalInfo
- type AzCliDeploymentErrorResponse
- type AzCliDeploymentOutput
- type AzCliDeploymentProperties
- type AzCliDeploymentPropertiesBasicDependency
- type AzCliDeploymentPropertiesDependency
- type AzCliDeploymentResourceReference
- type AzCliDeploymentResult
- type AzCliDeploymentResultProperties
- type AzCliDeploymentStatusMessage
- type AzCliFunctionAppProperties
- type AzCliManagedHSM
- type AzCliResourceOperation
- type AzCliResourceOperationProperties
- type AzCliResourceOperationTargetResource
- type AzCliStaticWebAppEnvironmentProperties
- type AzCliStaticWebAppProperties
- type AzureClient
- func (cli *AzureClient) DeployAppServiceZip(ctx context.Context, subscriptionId string, resourceGroup string, ...) (*string, error)
- func (cli *AzureClient) DeployFunctionAppUsingZipFile(ctx context.Context, subscriptionId string, resourceGroup string, ...) (*string, error)
- func (cli *AzureClient) GetAiModels(ctx context.Context, subscriptionId string, location string) ([]*armcognitiveservices.Model, error)
- func (cli *AzureClient) GetAiUsages(ctx context.Context, subscriptionId string, location string) ([]*armcognitiveservices.Usage, error)
- func (cli *AzureClient) GetApim(ctx context.Context, subscriptionId string, resourceGroupName string, ...) (*AzCliApim, error)
- func (cli *AzureClient) GetAppConfig(ctx context.Context, subscriptionId string, resourceGroupName string, ...) (*AzCliAppConfig, error)
- func (cli *AzureClient) GetAppServiceProperties(ctx context.Context, subscriptionId string, resourceGroup string, ...) (*AzCliAppServiceProperties, error)
- func (cli *AzureClient) GetAppServiceSlotProperties(ctx context.Context, subscriptionId string, resourceGroup string, ...) (*AzCliAppServiceProperties, error)
- func (cli *AzureClient) GetCognitiveAccount(ctx context.Context, subscriptionId string, resourceGroupName string, ...) (armcognitiveservices.Account, error)
- func (cli *AzureClient) GetFunctionAppProperties(ctx context.Context, subscriptionId string, resourceGroup string, ...) (*AzCliFunctionAppProperties, error)
- func (cli *AzureClient) GetManagedHSM(ctx context.Context, subscriptionId string, resourceGroupName string, ...) (*AzCliManagedHSM, error)
- func (cli *AzureClient) GetResourceSkuLocations(ctx context.Context, subscriptionId string, ...) ([]string, error)
- func (cli *AzureClient) GetStaticWebAppApiKey(ctx context.Context, subscriptionId string, resourceGroup string, ...) (*string, error)
- func (cli *AzureClient) GetStaticWebAppEnvironmentProperties(ctx context.Context, subscriptionId string, resourceGroup string, ...) (*AzCliStaticWebAppEnvironmentProperties, error)
- func (cli *AzureClient) GetStaticWebAppProperties(ctx context.Context, subscriptionId string, resourceGroup string, ...) (*AzCliStaticWebAppProperties, error)
- func (cli *AzureClient) PurgeApim(ctx context.Context, subscriptionId string, apimName string, location string) error
- func (cli *AzureClient) PurgeAppConfig(ctx context.Context, subscriptionId string, configName string, location string) error
- func (cli *AzureClient) PurgeCognitiveAccount(ctx context.Context, ...) error
- func (cli *AzureClient) PurgeManagedHSM(ctx context.Context, subscriptionId string, hsmName string, location string) error
- type AzureDeploymentError
- type AzureResourceType
- type ContainerRegistryService
- type DeleteDeploymentProgress
- type DeleteResourceState
- type DeploymentErrorLine
- type DeploymentOperation
- type DeploymentProvisioningState
- type DeploymentService
- type DeploymentType
- type DockerCredentials
- type Filter
- type ListResourceGroupOptions
- type ListResourceGroupResourcesOptions
- type ManagedClustersService
- type ReportDeleteProgress
- type Resource
- type ResourceDeployment
- type ResourceExtended
- type ResourceGroup
- type ResourceService
- func (rs *ResourceService) CheckExistenceByID(ctx context.Context, resourceId arm.ResourceID, apiVersion string) (bool, error)
- func (rs *ResourceService) CreateOrUpdateResourceGroup(ctx context.Context, subscriptionId string, resourceGroupName string, ...) (*ResourceGroup, error)
- func (rs *ResourceService) DeleteResourceGroup(ctx context.Context, subscriptionId string, resourceGroupName string) error
- func (rs *ResourceService) GetRawResource(ctx context.Context, resourceId arm.ResourceID, apiVersion string) (string, error)
- func (rs *ResourceService) GetResource(ctx context.Context, subscriptionId string, resourceId string, ...) (ResourceExtended, error)
- func (rs *ResourceService) ListResourceGroup(ctx context.Context, subscriptionId string, ...) ([]*Resource, error)
- func (rs *ResourceService) ListResourceGroupResources(ctx context.Context, subscriptionId string, resourceGroupName string, ...) ([]*ResourceExtended, error)
- func (rs *ResourceService) ListSubscriptionResources(ctx context.Context, subscriptionId string, ...) ([]*ResourceExtended, error)
- type StackDeployments
- func (d *StackDeployments) CalculateTemplateHash(ctx context.Context, subscriptionId string, template azure.RawArmTemplate) (string, error)
- func (d *StackDeployments) DeleteResourceGroupDeployment(ctx context.Context, subscriptionId, resourceGroupName string, ...) error
- func (d *StackDeployments) DeleteSubscriptionDeployment(ctx context.Context, subscriptionId string, deploymentName string, ...) error
- func (d *StackDeployments) DeployToResourceGroup(ctx context.Context, subscriptionId string, resourceGroup string, ...) (*ResourceDeployment, error)
- func (d *StackDeployments) DeployToSubscription(ctx context.Context, subscriptionId string, location string, ...) (*ResourceDeployment, error)
- func (d *StackDeployments) GenerateDeploymentName(baseName string) string
- func (d *StackDeployments) GetResourceGroupDeployment(ctx context.Context, subscriptionId string, resourceGroupName string, ...) (*ResourceDeployment, error)
- func (d *StackDeployments) GetSubscriptionDeployment(ctx context.Context, subscriptionId string, deploymentName string) (*ResourceDeployment, error)
- func (d *StackDeployments) ListResourceGroupDeploymentOperations(ctx context.Context, subscriptionId string, resourceGroupName string, ...) ([]*armresources.DeploymentOperation, error)
- func (d *StackDeployments) ListResourceGroupDeploymentResources(ctx context.Context, subscriptionId string, resourceGroupName string, ...) ([]*armresources.ResourceReference, error)
- func (d *StackDeployments) ListResourceGroupDeployments(ctx context.Context, subscriptionId string, resourceGroupName string) ([]*ResourceDeployment, error)
- func (d *StackDeployments) ListSubscriptionDeploymentOperations(ctx context.Context, subscriptionId string, deploymentName string) ([]*armresources.DeploymentOperation, error)
- func (d *StackDeployments) ListSubscriptionDeploymentResources(ctx context.Context, subscriptionId string, deploymentName string) ([]*armresources.ResourceReference, error)
- func (d *StackDeployments) ListSubscriptionDeployments(ctx context.Context, subscriptionId string) ([]*ResourceDeployment, error)
- func (d *StackDeployments) ValidatePreflightToResourceGroup(ctx context.Context, subscriptionId string, resourceGroup string, ...) error
- func (d *StackDeployments) ValidatePreflightToSubscription(ctx context.Context, subscriptionId string, location string, ...) error
- func (d *StackDeployments) WhatIfDeployToResourceGroup(ctx context.Context, subscriptionId string, resourceGroup string, ...) (*armresources.WhatIfOperationResult, error)
- func (d *StackDeployments) WhatIfDeployToSubscription(ctx context.Context, subscriptionId string, location string, ...) (*armresources.WhatIfOperationResult, error)
- type StandardDeployments
- func (ds *StandardDeployments) CalculateTemplateHash(ctx context.Context, subscriptionId string, template azure.RawArmTemplate) (string, error)
- func (ds *StandardDeployments) DeleteResourceGroupDeployment(ctx context.Context, subscriptionId, resourceGroupName string, ...) error
- func (ds *StandardDeployments) DeleteSubscriptionDeployment(ctx context.Context, subscriptionId string, deploymentName string, ...) error
- func (ds *StandardDeployments) DeployToResourceGroup(ctx context.Context, subscriptionId, resourceGroup, deploymentName string, ...) (*ResourceDeployment, error)
- func (ds *StandardDeployments) DeployToSubscription(ctx context.Context, subscriptionId string, location string, ...) (*ResourceDeployment, error)
- func (ds *StandardDeployments) GenerateDeploymentName(baseName string) string
- func (ds *StandardDeployments) GetResourceGroupDeployment(ctx context.Context, subscriptionId string, resourceGroupName string, ...) (*ResourceDeployment, error)
- func (ds *StandardDeployments) GetSubscriptionDeployment(ctx context.Context, subscriptionId string, deploymentName string) (*ResourceDeployment, error)
- func (ds *StandardDeployments) ListResourceGroupDeploymentOperations(ctx context.Context, subscriptionId string, resourceGroupName string, ...) ([]*armresources.DeploymentOperation, error)
- func (ds *StandardDeployments) ListResourceGroupDeploymentResources(ctx context.Context, subscriptionId string, resourceGroupName string, ...) ([]*armresources.ResourceReference, error)
- func (ds *StandardDeployments) ListResourceGroupDeployments(ctx context.Context, subscriptionId string, resourceGroupName string) ([]*ResourceDeployment, error)
- func (ds *StandardDeployments) ListSubscriptionDeploymentOperations(ctx context.Context, subscriptionId string, deploymentName string) ([]*armresources.DeploymentOperation, error)
- func (ds *StandardDeployments) ListSubscriptionDeploymentResources(ctx context.Context, subscriptionId string, deploymentName string) ([]*armresources.ResourceReference, error)
- func (ds *StandardDeployments) ListSubscriptionDeployments(ctx context.Context, subscriptionId string) ([]*ResourceDeployment, error)
- func (ds *StandardDeployments) ValidatePreflightToResourceGroup(ctx context.Context, subscriptionId, resourceGroup, deploymentName string, ...) error
- func (ds *StandardDeployments) ValidatePreflightToSubscription(ctx context.Context, subscriptionId string, location string, ...) error
- func (ds *StandardDeployments) WhatIfDeployToResourceGroup(ctx context.Context, subscriptionId, resourceGroup, deploymentName string, ...) (*armresources.WhatIfOperationResult, error)
- func (ds *StandardDeployments) WhatIfDeployToSubscription(ctx context.Context, subscriptionId string, location string, ...) (*armresources.WhatIfOperationResult, error)
- type UserProfileService
Constants ¶
This section is empty.
Variables ¶
var ( ErrAzCliNotLoggedIn = errors.New("cli is not logged in. Try running \"az login\" to fix") ErrAzCliRefreshTokenExpired = errors.New("refresh token has expired. Try running \"az login\" to fix") )
var (
ErrDeploymentNotFound = errors.New("deployment not found")
)
var ErrPreviewNotSupported = errors.New("preview not supported")
var FeatureDeploymentStacks = alpha.MustFeatureKey("deployment.stacks")
Functions ¶
func CreateDeploymentOutput ¶
func CreateDeploymentOutput(rawOutputs interface{}) (result map[string]AzCliDeploymentOutput)
convert from: sdk client outputs: interface{} to map[string]azapi.AzCliDeploymentOutput sdk client parses http response from network as an interface{} this function keeps the compatibility with the previous AzCliDeploymentOutput model
func GetResourceTypeDisplayName ¶
func GetResourceTypeDisplayName(resourceType AzureResourceType) string
GetResourceTypeDisplayName retrieves the display name for the given resource type. If the display name was not found for the given resource type, an empty string is returned instead.
func GroupByResourceGroup ¶
func GroupByResourceGroup(resources []*armresources.ResourceReference) (map[string][]*Resource, error)
GroupByResourceGroup creates a map of resources group by their resource group name. The key is the resource group name and the value is a list of resources in that group.
Types ¶
type AzCliAccessToken ¶
AzCliAccessToken represents the value returned by `az account get-access-token`
type AzCliAppConfig ¶
type AzCliAppServiceProperties ¶
type AzCliAppServiceProperties struct {
HostNames []string
}
type AzCliDeployment ¶
type AzCliDeployment struct {
Id string `json:"id"`
Name string `json:"name"`
Properties AzCliDeploymentProperties `json:"properties"`
}
type AzCliDeploymentAdditionalInfo ¶
type AzCliDeploymentAdditionalInfo struct {
Type string `json:"type"`
Info interface{} `json:"info"`
}
type AzCliDeploymentErrorResponse ¶
type AzCliDeploymentErrorResponse struct {
Code string `json:"code"`
Message string `json:"message"`
Target string `json:"target"`
Details []AzCliDeploymentErrorResponse `json:"details"`
AdditionalInfo AzCliDeploymentAdditionalInfo `json:"additionalInfo"`
}
type AzCliDeploymentOutput ¶
type AzCliDeploymentOutput struct {
Type string `json:"type"`
Value interface{} `json:"value"`
}
func (AzCliDeploymentOutput) Secured ¶
func (o AzCliDeploymentOutput) Secured() bool
type AzCliDeploymentProperties ¶
type AzCliDeploymentProperties struct {
CorrelationId string `json:"correlationId"`
Error AzCliDeploymentErrorResponse `json:"error"`
Dependencies []AzCliDeploymentPropertiesDependency `json:"dependencies"`
OutputResources []AzCliDeploymentResourceReference `json:"outputResources"`
Outputs map[string]AzCliDeploymentOutput `json:"outputs"`
}
type AzCliDeploymentPropertiesDependency ¶
type AzCliDeploymentPropertiesDependency struct {
AzCliDeploymentPropertiesBasicDependency
DependsOn []AzCliDeploymentPropertiesBasicDependency `json:"dependsOn"`
}
type AzCliDeploymentResourceReference ¶
type AzCliDeploymentResourceReference struct {
Id string `json:"id"`
}
type AzCliDeploymentResult ¶
type AzCliDeploymentResult struct {
Properties AzCliDeploymentResultProperties `json:"properties"`
}
type AzCliDeploymentResultProperties ¶
type AzCliDeploymentResultProperties struct {
Outputs map[string]AzCliDeploymentOutput `json:"outputs"`
}
type AzCliDeploymentStatusMessage ¶
type AzCliDeploymentStatusMessage struct {
Err AzCliDeploymentErrorResponse `json:"error"`
Status string `json:"status"`
}
type AzCliFunctionAppProperties ¶
type AzCliFunctionAppProperties struct {
HostNames []string
}
type AzCliManagedHSM ¶
type AzCliResourceOperation ¶
type AzCliResourceOperation struct {
Id string `json:"id"`
OperationId string `json:"operationId"`
Properties AzCliResourceOperationProperties `json:"properties"`
}
type AzCliResourceOperationProperties ¶
type AzCliResourceOperationProperties struct {
ProvisioningOperation string `json:"provisioningOperation"`
ProvisioningState string `json:"provisioningState"`
TargetResource AzCliResourceOperationTargetResource `json:"targetResource"`
StatusCode string `json:"statusCode"`
StatusMessage AzCliDeploymentStatusMessage `json:"statusMessage"`
// While the operation is in progress, this timestamp effectively represents "InProgressTimestamp".
// When the operation ends, this timestamp effectively represents "EndTimestamp".
Timestamp time.Time `json:"timestamp"`
}
type AzCliStaticWebAppProperties ¶
type AzCliStaticWebAppProperties struct {
DefaultHostname string
}
type AzureClient ¶
type AzureClient struct {
// contains filtered or unexported fields
}
func NewAzureClient ¶
func NewAzureClient( credentialProvider account.SubscriptionCredentialProvider, armClientOptions *arm.ClientOptions, ) *AzureClient
func (*AzureClient) DeployAppServiceZip ¶
func (*AzureClient) DeployFunctionAppUsingZipFile ¶
func (*AzureClient) GetAiModels ¶
func (cli *AzureClient) GetAiModels( ctx context.Context, subscriptionId string, location string) ([]*armcognitiveservices.Model, error)
func (*AzureClient) GetAiUsages ¶
func (cli *AzureClient) GetAiUsages( ctx context.Context, subscriptionId string, location string) ([]*armcognitiveservices.Usage, error)
func (*AzureClient) GetAppConfig ¶
func (cli *AzureClient) GetAppConfig( ctx context.Context, subscriptionId string, resourceGroupName string, configName string, ) (*AzCliAppConfig, error)
func (*AzureClient) GetAppServiceProperties ¶
func (cli *AzureClient) GetAppServiceProperties( ctx context.Context, subscriptionId string, resourceGroup string, appName string, ) (*AzCliAppServiceProperties, error)
func (*AzureClient) GetAppServiceSlotProperties ¶
func (cli *AzureClient) GetAppServiceSlotProperties( ctx context.Context, subscriptionId string, resourceGroup string, appName string, slotName string, ) (*AzCliAppServiceProperties, error)
func (*AzureClient) GetCognitiveAccount ¶
func (cli *AzureClient) GetCognitiveAccount( ctx context.Context, subscriptionId string, resourceGroupName string, accountName string) (armcognitiveservices.Account, error)
GetCognitiveAccount finds the cognitive account within a subscription
func (*AzureClient) GetFunctionAppProperties ¶
func (cli *AzureClient) GetFunctionAppProperties( ctx context.Context, subscriptionId string, resourceGroup string, appName string, ) (*AzCliFunctionAppProperties, error)
func (*AzureClient) GetManagedHSM ¶
func (cli *AzureClient) GetManagedHSM( ctx context.Context, subscriptionId string, resourceGroupName string, hsmName string, ) (*AzCliManagedHSM, error)
func (*AzureClient) GetResourceSkuLocations ¶
func (cli *AzureClient) GetResourceSkuLocations( ctx context.Context, subscriptionId string, kind, sku, tier, resourceType string) ([]string, error)
GetResourceSkuLocations retrieves a list of unique locations where a specific resource SKU is available. It filters the resource SKUs based on the provided kind, SKU name, tier, and resource type.
Parameters:
- ctx: The context for the operation.
- subscriptionId: The Azure subscription ID.
- kind: The kind of the resource (e.g., "CognitiveServices").
- sku: The name of the SKU (e.g., "S1").
- tier: The tier of the SKU (e.g., "Standard").
- resourceType: The type of the resource (e.g., "Microsoft.CognitiveServices/accounts").
Returns:
- A slice of strings containing the unique locations where the specified SKU is available.
- An error if the operation fails or no locations are found.
Notes:
- The function ensures that the returned list of locations is sorted in a consistent order.
- If no locations are found for the specified SKU, an error is returned.
func (*AzureClient) GetStaticWebAppApiKey ¶
func (*AzureClient) GetStaticWebAppEnvironmentProperties ¶
func (cli *AzureClient) GetStaticWebAppEnvironmentProperties( ctx context.Context, subscriptionId string, resourceGroup string, appName string, environmentName string, ) (*AzCliStaticWebAppEnvironmentProperties, error)
func (*AzureClient) GetStaticWebAppProperties ¶
func (cli *AzureClient) GetStaticWebAppProperties( ctx context.Context, subscriptionId string, resourceGroup string, appName string, ) (*AzCliStaticWebAppProperties, error)
func (*AzureClient) PurgeAppConfig ¶
func (*AzureClient) PurgeCognitiveAccount ¶
func (cli *AzureClient) PurgeCognitiveAccount( ctx context.Context, subscriptionId, location, resourceGroup, accountName string) error
PurgeCognitiveAccount starts purge operation and wait until it is completed.
func (*AzureClient) PurgeManagedHSM ¶
type AzureDeploymentError ¶
type AzureDeploymentError struct {
Json string
Inner error
Title string
Operation DeploymentOperation
Details *DeploymentErrorLine
}
func NewAzureDeploymentError ¶
func NewAzureDeploymentError(title string, jsonErrorResponse string, operation DeploymentOperation) *AzureDeploymentError
func (*AzureDeploymentError) Error ¶
func (e *AzureDeploymentError) Error() string
type AzureResourceType ¶
type AzureResourceType string
const ( AzureResourceTypeApim AzureResourceType = "Microsoft.ApiManagement/service" AzureResourceTypeAppConfig AzureResourceType = "Microsoft.AppConfiguration/configurationStores" AzureResourceTypeAppInsightComponent AzureResourceType = "Microsoft.Insights/components" AzureResourceTypeAutomationAccount AzureResourceType = "Microsoft.Automation/automationAccounts" AzureResourceTypeCacheForRedis AzureResourceType = "Microsoft.Cache/redis" AzureResourceTypeRedisEnterprise AzureResourceType = "Microsoft.Cache/redisEnterprise" AzureResourceTypeCDNProfile AzureResourceType = "Microsoft.Cdn/profiles" AzureResourceTypeCosmosDb AzureResourceType = "Microsoft.DocumentDB/databaseAccounts" AzureResourceTypeDocumentDB AzureResourceType = "Microsoft.DocumentDB/mongoClusters" AzureResourceTypeEventHubsNamespace AzureResourceType = "Microsoft.EventHub/namespaces" AzureResourceTypeContainerApp AzureResourceType = "Microsoft.App/containerApps" AzureResourceTypeContainerAppJob AzureResourceType = "Microsoft.App/jobs" AzureResourceTypeContainerAppEnvironment AzureResourceType = "Microsoft.App/managedEnvironments" AzureResourceTypeDeployment AzureResourceType = "Microsoft.Resources/deployments" AzureResourceTypeKeyVault AzureResourceType = "Microsoft.KeyVault/vaults" AzureResourceTypeManagedHSM AzureResourceType = "Microsoft.KeyVault/managedHSMs" AzureResourceTypeLoadTest AzureResourceType = "Microsoft.LoadTestService/loadTests" AzureResourceTypeLogAnalyticsWorkspace AzureResourceType = "Microsoft.OperationalInsights/workspaces" AzureResourceTypePortalDashboard AzureResourceType = "Microsoft.Portal/dashboards" AzureResourceTypePostgreSqlServer AzureResourceType = "Microsoft.DBforPostgreSQL/flexibleServers" AzureResourceTypeMySqlServer AzureResourceType = "Microsoft.DBforMySQL/flexibleServers" AzureResourceTypeResourceGroup AzureResourceType = "Microsoft.Resources/resourceGroups" AzureResourceTypeStorageAccount AzureResourceType = "Microsoft.Storage/storageAccounts" AzureResourceTypeStaticWebSite AzureResourceType = "Microsoft.Web/staticSites" AzureResourceTypeServiceBusNamespace AzureResourceType = "Microsoft.ServiceBus/namespaces" AzureResourceTypeServicePlan AzureResourceType = "Microsoft.Web/serverfarms" AzureResourceTypeSqlServer AzureResourceType = "Microsoft.Sql/servers" AzureResourceTypeVirtualNetwork AzureResourceType = "Microsoft.Network/virtualNetworks" AzureResourceTypeWebSite AzureResourceType = "Microsoft.Web/sites" AzureResourceTypeWebSiteSlot AzureResourceType = "Microsoft.Web/sites/slots" AzureResourceTypeContainerRegistry AzureResourceType = "Microsoft.ContainerRegistry/registries" AzureResourceTypeManagedCluster AzureResourceType = "Microsoft.ContainerService/managedClusters" AzureResourceTypeAgentPool AzureResourceType = "Microsoft.ContainerService/managedClusters/agentPools" AzureResourceTypeCognitiveServiceAccount AzureResourceType = "Microsoft.CognitiveServices/accounts" AzureResourceTypeSearchService AzureResourceType = "Microsoft.Search/searchServices" AzureResourceTypeVideoIndexer AzureResourceType = "Microsoft.VideoIndexer/accounts" AzureResourceTypePrivateEndpoint AzureResourceType = "Microsoft.Network/privateEndpoints" AzureResourceTypeDevCenter AzureResourceType = "Microsoft.DevCenter/devcenters" AzureResourceTypeDevCenterProject AzureResourceType = "Microsoft.DevCenter/projects" AzureResourceTypeMachineLearningWorkspace AzureResourceType = "Microsoft.MachineLearningServices/workspaces" AzureResourceTypeMachineLearningConnection AzureResourceType = "Microsoft.MachineLearningServices/workspaces/connections" AzureResourceTypeRoleAssignment AzureResourceType = "Microsoft.Authorization/roleAssignments" //nolint:lll AzureResourceTypeMachineLearningEndpoint AzureResourceType = "Microsoft.MachineLearningServices/workspaces/onlineEndpoints" //nolint:lll AzureResourceTypeCognitiveServiceAccountDeployment AzureResourceType = "Microsoft.CognitiveServices/accounts/deployments" //nolint:lll AzureResourceTypeCognitiveServiceAccountProject AzureResourceType = "Microsoft.CognitiveServices/accounts/projects" //nolint:lll AzureResourceTypeCognitiveServiceAccountCapabilityHost AzureResourceType = "Microsoft.CognitiveServices/accounts/capabilityHosts" )
type ContainerRegistryService ¶
type ContainerRegistryService interface {
// Logs into the specified container registry
Login(ctx context.Context, subscriptionId string, loginServer string) error
// Gets the credentials that could be used to login to the specified container registry.
Credentials(ctx context.Context, subscriptionId string, loginServer string) (*DockerCredentials, error)
// Gets a list of container registries for the specified subscription
GetContainerRegistries(ctx context.Context, subscriptionId string) ([]*armcontainerregistry.Registry, error)
}
ContainerRegistryService provides access to query and login to Azure Container Registries (ACR)
func NewContainerRegistryService ¶
func NewContainerRegistryService( credentialProvider account.SubscriptionCredentialProvider, docker *docker.Cli, armClientOptions *arm.ClientOptions, coreClientOptions *azcore.ClientOptions, ) ContainerRegistryService
Creates a new instance of the ContainerRegistryService
type DeleteDeploymentProgress ¶
type DeleteDeploymentProgress struct {
Name string
Message string
State DeleteResourceState
}
type DeleteResourceState ¶
type DeleteResourceState string
const ( DeleteResourceStateInProgress DeleteResourceState = "InProgress" DeleteResourceStateSucceeded DeleteResourceState = "Succeeded" DeleteResourceStateFailed DeleteResourceState = "Failed" )
type DeploymentErrorLine ¶
type DeploymentErrorLine struct {
// The code of the error line, if applicable
Code string
// The message that represents the error
Message string
// Inner errors
Inner []*DeploymentErrorLine
}
type DeploymentOperation ¶
type DeploymentOperation string
const ( DeploymentOperationDeploy DeploymentOperation = "deploy" DeploymentOperationValidate DeploymentOperation = "validate" DeploymentOperationPreview DeploymentOperation = "preview" )
type DeploymentProvisioningState ¶
type DeploymentProvisioningState string
const ( DeploymentProvisioningStateAccepted DeploymentProvisioningState = "Accepted" DeploymentProvisioningStateCanceled DeploymentProvisioningState = "Canceled" DeploymentProvisioningStateCanceling DeploymentProvisioningState = "Canceling" DeploymentProvisioningStateCreating DeploymentProvisioningState = "Creating" DeploymentProvisioningStateDeleted DeploymentProvisioningState = "Deleted" DeploymentProvisioningStateDeleting DeploymentProvisioningState = "Deleting" DeploymentProvisioningStateDeletingResources DeploymentProvisioningState = "DeletingResources" DeploymentProvisioningStateDeploying DeploymentProvisioningState = "Deploying" DeploymentProvisioningStateFailed DeploymentProvisioningState = "Failed" DeploymentProvisioningStateNotSpecified DeploymentProvisioningState = "NotSpecified" DeploymentProvisioningStateReady DeploymentProvisioningState = "Ready" DeploymentProvisioningStateRunning DeploymentProvisioningState = "Running" DeploymentProvisioningStateSucceeded DeploymentProvisioningState = "Succeeded" DeploymentProvisioningStateUpdatingDenyAssignments DeploymentProvisioningState = "UpdatingDenyAssignments" DeploymentProvisioningStateValidating DeploymentProvisioningState = "Validating" DeploymentProvisioningStateWaiting DeploymentProvisioningState = "Waiting" DeploymentProvisioningStateUpdating DeploymentProvisioningState = "Updating" )
type DeploymentService ¶
type DeploymentService interface {
GenerateDeploymentName(baseName string) string
CalculateTemplateHash(
ctx context.Context,
subscriptionId string,
template azure.RawArmTemplate) (string, error)
ListSubscriptionDeploymentResources(
ctx context.Context,
subscriptionId string,
deploymentName string,
) ([]*armresources.ResourceReference, error)
ListResourceGroupDeploymentResources(
ctx context.Context,
subscriptionId string,
resourceGroupName string,
deploymentName string,
) ([]*armresources.ResourceReference, error)
ListSubscriptionDeployments(
ctx context.Context,
subscriptionId string,
) ([]*ResourceDeployment, error)
GetSubscriptionDeployment(
ctx context.Context,
subscriptionId string,
deploymentName string,
) (*ResourceDeployment, error)
ListResourceGroupDeployments(
ctx context.Context,
subscriptionId string,
resourceGroupName string,
) ([]*ResourceDeployment, error)
GetResourceGroupDeployment(
ctx context.Context,
subscriptionId string,
resourceGroupName string,
deploymentName string,
) (*ResourceDeployment, error)
DeployToSubscription(
ctx context.Context,
subscriptionId string,
location string,
deploymentName string,
armTemplate azure.RawArmTemplate,
parameters azure.ArmParameters,
tags map[string]*string,
options map[string]any,
) (*ResourceDeployment, error)
DeployToResourceGroup(
ctx context.Context,
subscriptionId,
resourceGroup,
deploymentName string,
armTemplate azure.RawArmTemplate,
parameters azure.ArmParameters,
tags map[string]*string,
options map[string]any,
) (*ResourceDeployment, error)
ListSubscriptionDeploymentOperations(
ctx context.Context,
subscriptionId string,
deploymentName string,
) ([]*armresources.DeploymentOperation, error)
ListResourceGroupDeploymentOperations(
ctx context.Context,
subscriptionId string,
resourceGroupName string,
deploymentName string,
) ([]*armresources.DeploymentOperation, error)
ValidatePreflightToSubscription(
ctx context.Context,
subscriptionId string,
location string,
deploymentName string,
armTemplate azure.RawArmTemplate,
parameters azure.ArmParameters,
tags map[string]*string,
options map[string]any,
) error
ValidatePreflightToResourceGroup(
ctx context.Context,
subscriptionId,
resourceGroup,
deploymentName string,
armTemplate azure.RawArmTemplate,
parameters azure.ArmParameters,
tags map[string]*string,
options map[string]any,
) error
WhatIfDeployToSubscription(
ctx context.Context,
subscriptionId string,
location string,
deploymentName string,
armTemplate azure.RawArmTemplate,
parameters azure.ArmParameters,
) (*armresources.WhatIfOperationResult, error)
WhatIfDeployToResourceGroup(
ctx context.Context,
subscriptionId,
resourceGroup,
deploymentName string,
armTemplate azure.RawArmTemplate,
parameters azure.ArmParameters,
) (*armresources.WhatIfOperationResult, error)
DeleteSubscriptionDeployment(
ctx context.Context,
subscriptionId string,
deploymentName string,
options map[string]any,
progress *async.Progress[DeleteDeploymentProgress],
) error
DeleteResourceGroupDeployment(
ctx context.Context,
subscriptionId,
resourceGroupName string,
deploymentName string,
options map[string]any,
progress *async.Progress[DeleteDeploymentProgress],
) error
}
type DeploymentType ¶
type DeploymentType string
const ( DeploymentTypeStandard DeploymentType = "deployments.standard" DeploymentTypeStacks DeploymentType = "deployments.stacks" )
type DockerCredentials ¶
type DockerCredentials struct {
// Username is the name of the user. Note that this may be set to a value like
// '00000000-0000-0000-0000-000000000000' when using access tokens.
Username string
// Password is the password for the user, or the access token when using access tokens.
Password string
LoginServer string
}
Credentials for authenticating with a docker registry, can be both username/password or access token based.
type ListResourceGroupOptions ¶
type ListResourceGroupOptions struct {
// An optional tag filter
TagFilter *Filter
// An optional filter expression to filter the resource group results
// https://learn.microsoft.com/en-us/rest/api/resources/resource-groups/list
Filter *string
}
Optional parameters for resource group listing.
type ListResourceGroupResourcesOptions ¶
type ListResourceGroupResourcesOptions struct {
// An optional filter expression to filter the resource list result
// https://learn.microsoft.com/en-us/rest/api/resources/resources/list-by-resource-group#uri-parameters
Filter *string
}
Optional parameters for resource group resources listing.
type ManagedClustersService ¶
type ManagedClustersService interface {
// Gets the managed cluster resource by name
Get(
ctx context.Context,
subscriptionId string,
resourceGroupName string,
resourceName string,
) (*armcontainerservice.ManagedCluster, error)
// Gets the user credentials for the specified resource
GetUserCredentials(
ctx context.Context,
subscriptionId string,
resourceGroupName string,
resourceName string,
) (*armcontainerservice.CredentialResults, error)
}
ManagedClustersService provides actions on top of Azure Kubernetes Service (AKS) Managed Clusters
func NewManagedClustersService ¶
func NewManagedClustersService( credentialProvider account.SubscriptionCredentialProvider, armClientOptions *arm.ClientOptions, ) ManagedClustersService
Creates a new instance of the ManagedClustersService
type ReportDeleteProgress ¶
type ReportDeleteProgress func(progress *DeleteDeploymentProgress)
type ResourceDeployment ¶
type ResourceDeployment struct {
// The Azure resource id of the deployment operation
Id string
// The location of the deployment
Location string
// The Azure resource id of the actual deployment object
DeploymentId string
// The deployment name
Name string
// The deployment type
Type string
// The tags associated with the deployment
Tags map[string]*string
// The outputs from the deployment
Outputs any
// The hash produced for the template.
TemplateHash *string
// The timestamp of the template deployment.
Timestamp time.Time
// The resources created from the deployment
Resources []*armresources.ResourceReference
// The dependencies of the deployment
Dependencies []*armresources.Dependency
// The status of the deployment
ProvisioningState DeploymentProvisioningState
PortalUrl string
OutputsUrl string
DeploymentUrl string
}
type ResourceExtended ¶
type ResourceGroup ¶
type ResourceService ¶
type ResourceService struct {
// contains filtered or unexported fields
}
func NewResourceService ¶
func NewResourceService( credentialProvider account.SubscriptionCredentialProvider, armClientOptions *arm.ClientOptions, ) *ResourceService
func (*ResourceService) CheckExistenceByID ¶
func (rs *ResourceService) CheckExistenceByID( ctx context.Context, resourceId arm.ResourceID, apiVersion string) (bool, error)
func (*ResourceService) CreateOrUpdateResourceGroup ¶
func (rs *ResourceService) CreateOrUpdateResourceGroup( ctx context.Context, subscriptionId string, resourceGroupName string, location string, tags map[string]*string, ) (*ResourceGroup, error)
func (*ResourceService) DeleteResourceGroup ¶
func (*ResourceService) GetRawResource ¶
func (rs *ResourceService) GetRawResource( ctx context.Context, resourceId arm.ResourceID, apiVersion string) (string, error)
func (*ResourceService) GetResource ¶
func (rs *ResourceService) GetResource( ctx context.Context, subscriptionId string, resourceId string, apiVersion string) (ResourceExtended, error)
func (*ResourceService) ListResourceGroup ¶
func (rs *ResourceService) ListResourceGroup( ctx context.Context, subscriptionId string, listOptions *ListResourceGroupOptions, ) ([]*Resource, error)
func (*ResourceService) ListResourceGroupResources ¶
func (rs *ResourceService) ListResourceGroupResources( ctx context.Context, subscriptionId string, resourceGroupName string, listOptions *ListResourceGroupResourcesOptions, ) ([]*ResourceExtended, error)
func (*ResourceService) ListSubscriptionResources ¶
func (rs *ResourceService) ListSubscriptionResources( ctx context.Context, subscriptionId string, listOptions *armresources.ClientListOptions, ) ([]*ResourceExtended, error)
type StackDeployments ¶
type StackDeployments struct {
// contains filtered or unexported fields
}
func NewStackDeployments ¶
func NewStackDeployments( credentialProvider account.SubscriptionCredentialProvider, armClientOptions *arm.ClientOptions, standardDeployments *StandardDeployments, cloud *cloud.Cloud, clock clock.Clock, ) *StackDeployments
func (*StackDeployments) CalculateTemplateHash ¶
func (d *StackDeployments) CalculateTemplateHash( ctx context.Context, subscriptionId string, template azure.RawArmTemplate, ) (string, error)
func (*StackDeployments) DeleteResourceGroupDeployment ¶
func (*StackDeployments) DeleteSubscriptionDeployment ¶
func (*StackDeployments) DeployToResourceGroup ¶
func (d *StackDeployments) DeployToResourceGroup( ctx context.Context, subscriptionId string, resourceGroup string, deploymentName string, armTemplate azure.RawArmTemplate, parameters azure.ArmParameters, tags map[string]*string, options map[string]any, ) (*ResourceDeployment, error)
func (*StackDeployments) DeployToSubscription ¶
func (d *StackDeployments) DeployToSubscription( ctx context.Context, subscriptionId string, location string, deploymentName string, armTemplate azure.RawArmTemplate, parameters azure.ArmParameters, tags map[string]*string, options map[string]any, ) (*ResourceDeployment, error)
func (*StackDeployments) GenerateDeploymentName ¶
func (d *StackDeployments) GenerateDeploymentName(baseName string) string
GenerateDeploymentName creates a name to use for the deployment stack from the base name.
func (*StackDeployments) GetResourceGroupDeployment ¶
func (d *StackDeployments) GetResourceGroupDeployment( ctx context.Context, subscriptionId string, resourceGroupName string, deploymentName string, ) (*ResourceDeployment, error)
func (*StackDeployments) GetSubscriptionDeployment ¶
func (d *StackDeployments) GetSubscriptionDeployment( ctx context.Context, subscriptionId string, deploymentName string, ) (*ResourceDeployment, error)
func (*StackDeployments) ListResourceGroupDeploymentOperations ¶
func (d *StackDeployments) ListResourceGroupDeploymentOperations( ctx context.Context, subscriptionId string, resourceGroupName string, deploymentName string, ) ([]*armresources.DeploymentOperation, error)
func (*StackDeployments) ListResourceGroupDeploymentResources ¶
func (d *StackDeployments) ListResourceGroupDeploymentResources( ctx context.Context, subscriptionId string, resourceGroupName string, deploymentName string, ) ([]*armresources.ResourceReference, error)
func (*StackDeployments) ListResourceGroupDeployments ¶
func (d *StackDeployments) ListResourceGroupDeployments( ctx context.Context, subscriptionId string, resourceGroupName string, ) ([]*ResourceDeployment, error)
func (*StackDeployments) ListSubscriptionDeploymentOperations ¶
func (d *StackDeployments) ListSubscriptionDeploymentOperations( ctx context.Context, subscriptionId string, deploymentName string, ) ([]*armresources.DeploymentOperation, error)
func (*StackDeployments) ListSubscriptionDeploymentResources ¶
func (d *StackDeployments) ListSubscriptionDeploymentResources( ctx context.Context, subscriptionId string, deploymentName string, ) ([]*armresources.ResourceReference, error)
func (*StackDeployments) ListSubscriptionDeployments ¶
func (d *StackDeployments) ListSubscriptionDeployments( ctx context.Context, subscriptionId string, ) ([]*ResourceDeployment, error)
func (*StackDeployments) ValidatePreflightToResourceGroup ¶
func (d *StackDeployments) ValidatePreflightToResourceGroup( ctx context.Context, subscriptionId string, resourceGroup string, deploymentName string, armTemplate azure.RawArmTemplate, parameters azure.ArmParameters, tags map[string]*string, options map[string]any, ) error
Preflight API validates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager.
func (*StackDeployments) ValidatePreflightToSubscription ¶
func (d *StackDeployments) ValidatePreflightToSubscription( ctx context.Context, subscriptionId string, location string, deploymentName string, armTemplate azure.RawArmTemplate, parameters azure.ArmParameters, tags map[string]*string, options map[string]any, ) error
Preflight API validates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager.
func (*StackDeployments) WhatIfDeployToResourceGroup ¶
func (d *StackDeployments) WhatIfDeployToResourceGroup( ctx context.Context, subscriptionId string, resourceGroup string, deploymentName string, armTemplate azure.RawArmTemplate, parameters azure.ArmParameters, ) (*armresources.WhatIfOperationResult, error)
func (*StackDeployments) WhatIfDeployToSubscription ¶
func (d *StackDeployments) WhatIfDeployToSubscription( ctx context.Context, subscriptionId string, location string, deploymentName string, armTemplate azure.RawArmTemplate, parameters azure.ArmParameters, ) (*armresources.WhatIfOperationResult, error)
type StandardDeployments ¶
type StandardDeployments struct {
// contains filtered or unexported fields
}
func NewStandardDeployments ¶
func NewStandardDeployments( credentialProvider account.SubscriptionCredentialProvider, armClientOptions *arm.ClientOptions, resourceService *ResourceService, cloud *cloud.Cloud, clock clock.Clock, ) *StandardDeployments
func (*StandardDeployments) CalculateTemplateHash ¶
func (ds *StandardDeployments) CalculateTemplateHash( ctx context.Context, subscriptionId string, template azure.RawArmTemplate, ) (string, error)
func (*StandardDeployments) DeleteResourceGroupDeployment ¶
func (*StandardDeployments) DeleteSubscriptionDeployment ¶
func (*StandardDeployments) DeployToResourceGroup ¶
func (ds *StandardDeployments) DeployToResourceGroup( ctx context.Context, subscriptionId, resourceGroup, deploymentName string, armTemplate azure.RawArmTemplate, parameters azure.ArmParameters, tags map[string]*string, options map[string]any, ) (*ResourceDeployment, error)
func (*StandardDeployments) DeployToSubscription ¶
func (ds *StandardDeployments) DeployToSubscription( ctx context.Context, subscriptionId string, location string, deploymentName string, armTemplate azure.RawArmTemplate, parameters azure.ArmParameters, tags map[string]*string, options map[string]any, ) (*ResourceDeployment, error)
func (*StandardDeployments) GenerateDeploymentName ¶
func (ds *StandardDeployments) GenerateDeploymentName(baseName string) string
GenerateDeploymentName creates a name to use for the deployment object for a given environment. It appends the current unix time to the environment name (separated by a hyphen) to provide a unique name for each deployment. If the resulting name is longer than the ARM limit, the longest suffix of the name under the limit is returned.
func (*StandardDeployments) GetResourceGroupDeployment ¶
func (ds *StandardDeployments) GetResourceGroupDeployment( ctx context.Context, subscriptionId string, resourceGroupName string, deploymentName string, ) (*ResourceDeployment, error)
func (*StandardDeployments) GetSubscriptionDeployment ¶
func (ds *StandardDeployments) GetSubscriptionDeployment( ctx context.Context, subscriptionId string, deploymentName string, ) (*ResourceDeployment, error)
func (*StandardDeployments) ListResourceGroupDeploymentOperations ¶
func (ds *StandardDeployments) ListResourceGroupDeploymentOperations( ctx context.Context, subscriptionId string, resourceGroupName string, deploymentName string, ) ([]*armresources.DeploymentOperation, error)
func (*StandardDeployments) ListResourceGroupDeploymentResources ¶
func (ds *StandardDeployments) ListResourceGroupDeploymentResources( ctx context.Context, subscriptionId string, resourceGroupName string, deploymentName string, ) ([]*armresources.ResourceReference, error)
func (*StandardDeployments) ListResourceGroupDeployments ¶
func (ds *StandardDeployments) ListResourceGroupDeployments( ctx context.Context, subscriptionId string, resourceGroupName string, ) ([]*ResourceDeployment, error)
func (*StandardDeployments) ListSubscriptionDeploymentOperations ¶
func (ds *StandardDeployments) ListSubscriptionDeploymentOperations( ctx context.Context, subscriptionId string, deploymentName string, ) ([]*armresources.DeploymentOperation, error)
func (*StandardDeployments) ListSubscriptionDeploymentResources ¶
func (ds *StandardDeployments) ListSubscriptionDeploymentResources( ctx context.Context, subscriptionId string, deploymentName string, ) ([]*armresources.ResourceReference, error)
func (*StandardDeployments) ListSubscriptionDeployments ¶
func (ds *StandardDeployments) ListSubscriptionDeployments( ctx context.Context, subscriptionId string, ) ([]*ResourceDeployment, error)
func (*StandardDeployments) ValidatePreflightToResourceGroup ¶
func (ds *StandardDeployments) ValidatePreflightToResourceGroup( ctx context.Context, subscriptionId, resourceGroup, deploymentName string, armTemplate azure.RawArmTemplate, parameters azure.ArmParameters, tags map[string]*string, options map[string]any, ) error
Preflight API validates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager.
func (*StandardDeployments) ValidatePreflightToSubscription ¶
func (ds *StandardDeployments) ValidatePreflightToSubscription( ctx context.Context, subscriptionId string, location string, deploymentName string, armTemplate azure.RawArmTemplate, parameters azure.ArmParameters, tags map[string]*string, options map[string]any, ) error
Preflight API validates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager.
func (*StandardDeployments) WhatIfDeployToResourceGroup ¶
func (ds *StandardDeployments) WhatIfDeployToResourceGroup( ctx context.Context, subscriptionId, resourceGroup, deploymentName string, armTemplate azure.RawArmTemplate, parameters azure.ArmParameters, ) (*armresources.WhatIfOperationResult, error)
func (*StandardDeployments) WhatIfDeployToSubscription ¶
func (ds *StandardDeployments) WhatIfDeployToSubscription( ctx context.Context, subscriptionId string, location string, deploymentName string, armTemplate azure.RawArmTemplate, parameters azure.ArmParameters, ) (*armresources.WhatIfOperationResult, error)
type UserProfileService ¶
type UserProfileService struct {
// contains filtered or unexported fields
}
UserProfileService allows querying for user profile information.
func NewUserProfileService ¶
func NewUserProfileService( credentialProvider auth.MultiTenantCredentialProvider, coreClientOptions *azcore.ClientOptions, cloud *cloud.Cloud, ) *UserProfileService
func (*UserProfileService) GetAccessToken ¶
func (u *UserProfileService) GetAccessToken(ctx context.Context, tenantId string) (*AzCliAccessToken, error)