Documentation
¶
Index ¶
Constants ¶
View Source
const ( // ZonalAllocationFailedAzErrorCode is an Azure error code indicating that there is insufficient capacity in the target zone. ZonalAllocationFailedAzErrorCode = "ZonalAllocationFailed" // SkuNotAvailableAzErrorCode is an Azure error code that indicates the specific resource SKU (e.g., a virtual machine size) selected isn't currently available. SkuNotAvailableAzErrorCode = "SkuNotAvailable" // AllocationFailedAzErrorCode is an Azure error code that indicates that there is insufficient capacity in the region AllocationFailedAzErrorCode = "AllocationFailed" // ResourceQuotaExceededAzErrorCode is an Azure error code that indicates that the quota has exceeded for a subscription, resource group, or error code ResourceQuotaExceededAzErrorCode = "ResourceQuotaExceeded" // OperationNotAllowedAzErrorCode is an Azure error code that indicates that the operation isn't allowed. OperationNotAllowedAzErrorCode = "OperationNotAllowed" // BadRequestAzErrorCode is an Azure error code that indicates that the request is invalid. BadRequestAzErrorCode = "BadRequest" // CorrelationRequestIDAzHeaderKey is the Azure API response header key whose value is a request correlation ID. CorrelationRequestIDAzHeaderKey = "x-ms-correlation-request-id" // RequestIDAzHeaderKey is the Azure API response header key whose value is the request ID. RequestIDAzHeaderKey = "x-ms-request-id" // ErrorCodeAzHeaderKey is the Azure API response header key whose value is the underline error code as set by the server. ErrorCodeAzHeaderKey = "x-ms-error-code" // ClientRequestIDAzHeaderKey is the Azure API response header key whose value is the client request ID. ClientRequestIDAzHeaderKey = "x-ms-client-request-id" )
Variables ¶
View Source
var ( // ExceedingQuotaRegex is a regex pattern to identify if an "OperationNotAllowed" error is caused by exceeding quota limits. ExceedingQuotaRegex = regexp.MustCompile(`(?i)exceeding.*quota`) // NotSupportedRegex is a regex pattern to identify if a "BadRequest" error is caused by an unsupported operation or resource. NotSupportedRegex = regexp.MustCompile(`(?i)not\s+supported`) )
Functions ¶
func GetMatchingErrorCode ¶
GetMatchingErrorCode gets a matching codes.Code for the given azure error code.
func IsNotFoundAzAPIError ¶
IsNotFoundAzAPIError checks if error is an AZ API error and if it is a 404 response code.
func LogAzAPIError ¶
LogAzAPIError collects additional information from AZ response and logs it as part of the error log message.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.