Documentation
¶
Index ¶
- Constants
- Variables
- func CloudErrorFromFieldErrors(fieldErrors field.ErrorList) error
- func DeepCopyResourceID(id *azcorearm.ResourceID) *azcorearm.ResourceID
- func DetectTLE(data []byte) (bool, error)
- func IsTLE(s string) bool
- func ListProvisioningStates() iter.Seq[ProvisioningState]
- func ListSubscriptionStates() iter.Seq[SubscriptionState]
- func MarshalJSON(v any) ([]byte, error)
- func Must[T any](v T, err error) T
- func ResourceIDStringToCosmosID(resourceID string) (string, error)
- func ResourceIDToCosmosID(resourceID *azcorearm.ResourceID) (string, error)
- func ToSubscriptionResourceID(subscriptionName string) (*azcorearm.ResourceID, error)
- func ToSubscriptionResourceIDString(subscriptionName string) string
- func WriteCloudError(w http.ResponseWriter, err *CloudError)
- func WriteConflictError(w http.ResponseWriter, resourceID *azcorearm.ResourceID, format string, ...)
- func WriteDeploymentPreflightResponse(w http.ResponseWriter, preflightErrors []CloudErrorBody)
- func WriteError(w http.ResponseWriter, statusCode int, code, target, format string, ...)
- func WriteInternalServerError(w http.ResponseWriter)
- func WriteInvalidRequestContentError(w http.ResponseWriter, err error)
- func WriteJSONResponse(writer http.ResponseWriter, statusCode int, body any) (int, error)
- func WriteResourceNotFoundError(w http.ResponseWriter, resourceID *azcorearm.ResourceID)
- type AccountOwner
- type AvailabilityZone
- type CloudError
- func CloudErrorFromFieldError(fieldError *field.Error) *CloudError
- func NewCloudError(statusCode int, code, target, format string, a ...interface{}) *CloudError
- func NewConflictError(resourceID *azcorearm.ResourceID, format string, a ...interface{}) *CloudError
- func NewContentValidationError(errors []CloudErrorBody) *CloudError
- func NewInternalServerError() *CloudError
- func NewInvalidRequestContentError(err error) *CloudError
- func NewResourceNotFoundError(resourceID *azcorearm.ResourceID) *CloudError
- type CloudErrorBody
- type CorrelationData
- type CosmosMetadata
- func (in *CosmosMetadata) DeepCopy() *CosmosMetadata
- func (in *CosmosMetadata) DeepCopyInto(out *CosmosMetadata)
- func (o *CosmosMetadata) GetCosmosData() *CosmosMetadata
- func (o *CosmosMetadata) GetCosmosUID() string
- func (o *CosmosMetadata) GetEtag() azcore.ETag
- func (o *CosmosMetadata) GetInstanceVersion() int64
- func (o *CosmosMetadata) GetPartitionKey() string
- func (o *CosmosMetadata) GetResourceID() *azcorearm.ResourceID
- func (o *CosmosMetadata) SetEtag(cosmosETag azcore.ETag)
- func (o *CosmosMetadata) SetInstanceVersion(v int64)
- func (o *CosmosMetadata) SetPartitionKey(partitionKey string)
- func (o *CosmosMetadata) SetResourceID(resourceID *azcorearm.ResourceID)
- type CosmosMetadataAccessor
- type CosmosMetadataAccessorPtr
- type CosmosPersistable
- type CreatedByType
- type DeploymentPreflight
- type DeploymentPreflightResource
- func (r *DeploymentPreflightResource) Convert(v any) error
- func (in *DeploymentPreflightResource) DeepCopy() *DeploymentPreflightResource
- func (in *DeploymentPreflightResource) DeepCopyInto(out *DeploymentPreflightResource)
- func (r *DeploymentPreflightResource) ResourceID(subscriptionID, resourceGroup string) string
- type DeploymentPreflightResponse
- type DeploymentPreflightStatus
- type Feature
- type ManagedServiceIdentity
- type ManagedServiceIdentityType
- type NamespaceOperation
- type NamespaceOperationDisplay
- type NamespaceOperationOrigin
- type Operation
- type PagedResponse
- type ProvisioningState
- type ProxyResource
- type Resource
- type Subscription
- func (in *Subscription) DeepCopy() *Subscription
- func (in *Subscription) DeepCopyInto(out *Subscription)
- func (in *Subscription) DeepCopyObject() runtime.Object
- func (s *Subscription) GetObjectKind() schema.ObjectKind
- func (s *Subscription) GetObjectMeta() metav1.Object
- func (s *Subscription) GetRegisteredFeatures() []Feature
- func (s *Subscription) HasRegisteredFeature(featureName string) bool
- type SubscriptionList
- type SubscriptionProperties
- type SubscriptionState
- type SystemData
- type TrackedResource
- type UserAssignedIdentity
- type ZoneMapping
Constants ¶
const ( CloudErrorCodeInternalServerError = "InternalServerError" CloudErrorCodeInvalidParameter = "InvalidParameter" CloudErrorCodeInvalidRequestContent = "InvalidRequestContent" CloudErrorCodeInvalidResource = "InvalidResource" CloudErrorCodeInvalidResourceType = "InvalidResourceType" CloudErrorCodeMultipleErrorsOccurred = "MultipleErrorsOccurred" CloudErrorCodeUnsupportedMediaType = "UnsupportedMediaType" CloudErrorCodeCanceled = "Canceled" CloudErrorCodeConflict = "Conflict" CloudErrorCodeNotFound = "NotFound" CloudErrorCodeInvalidSubscriptionState = "InvalidSubscriptionState" CloudErrorCodeSubscriptionNotFound = "SubscriptionNotFound" CloudErrorCodeResourceNotFound = "ResourceNotFound" CloudErrorCodeResourceGroupNotFound = "ResourceGroupNotFound" CloudErrorCodeInvalidSubscriptionID = "InvalidSubscriptionID" CloudErrorCodeInvalidResourceName = "InvalidResourceName" CloudErrorCodeInvalidResourceGroupName = "InvalidResourceGroupName" CloudErrorCodeLockContention = "LockContention" CloudErrorCodeFeatureNotEnabled = "FeatureNotEnabled" )
CloudError codes
const ( // Azure-specific HTTP header names HeaderNameAsyncOperation = "Azure-AsyncOperation" HeaderNameAsyncNotification = "Azure-AsyncNotification" HeaderNameAsyncNotificationURI = "Azure-AsyncNotificationUri" // Microsoft-specific HTTP header names HeaderNameErrorCode = "X-Ms-Error-Code" HeaderNameHomeTenantID = "X-Ms-Home-Tenant-Id" HeaderNameClientObjectID = "X-Ms-Client-Object-Id" HeaderNameRequestID = "X-Ms-Request-Id" HeaderNameClientRequestID = "X-Ms-Client-Request-Id" HeaderNameCorrelationRequestID = "X-Ms-Correlation-Request-Id" HeaderNameReturnClientRequestID = "X-Ms-Return-Client-Request-Id" HeaderNameARMResourceSystemData = "X-Ms-Arm-Resource-System-Data" HeaderNameIdentityURL = "X-Ms-Identity-Url" HeaderClientPrincipalName = "X-Ms-Client-Principal-Name" )
const ( NamespaceOperationRead = "read" NamespaceOperationWrite = "write" NamespaceOperationDelete = "delete" NamespaceOperationAction = "action" )
The last path segment of Name must be one of these.
const SubscriptionAPIVersion = "2.0"
SubscriptionAPIVersion is the system API version for the subscription endpoint.
Variables ¶
var ( ValidCreatedByTypes = sets.New[CreatedByType]( CreatedByTypeApplication, CreatedByTypeKey, CreatedByTypeManagedIdentity, CreatedByTypeUser) )
var ( ValidManagedServiceIdentityTypes = sets.New[ManagedServiceIdentityType]( ManagedServiceIdentityTypeNone, ManagedServiceIdentityTypeSystemAssigned, ManagedServiceIdentityTypeSystemAssignedUserAssigned, ManagedServiceIdentityTypeUserAssigned) )
var ( ValidNamespaceOperationOrigins = sets.New[NamespaceOperationOrigin]( NamespaceOperationOriginUser, NamespaceOperationOriginSystem, NamespaceOperationOriginUserSystem, ) )
var ( ValidNamespaceOperations = sets.New[string]( NamespaceOperationRead, NamespaceOperationWrite, NamespaceOperationDelete, NamespaceOperationAction, ) )
var ( ValidSubscriptionStates = sets.New( SubscriptionStateRegistered, SubscriptionStateUnregistered, SubscriptionStateWarned, SubscriptionStateDeleted, SubscriptionStateSuspended, ) )
Functions ¶
func DeepCopyResourceID ¶
func DeepCopyResourceID(id *azcorearm.ResourceID) *azcorearm.ResourceID
DeepCopyResourceID creates a true deep copy of an azcorearm.ResourceID by round-tripping through its string representation. This is necessary because ResourceID contains unexported fields (including parent pointers) that cannot be copied by simple struct assignment.
func DetectTLE ¶
DetectTLE returns true if a Template Language Expression is detected in any part of the JSON input.
func ListProvisioningStates ¶
func ListProvisioningStates() iter.Seq[ProvisioningState]
ListProvisioningStates returns an iterator that yields all recognized ProvisioningState values. This function is intended as a test aid.
func ListSubscriptionStates ¶
func ListSubscriptionStates() iter.Seq[SubscriptionState]
ListSubscriptionStates returns an iterator that yields all recognized SubscriptionState values. This function is intended as a test aid.
func MarshalJSON ¶
MarshalJSON returns the JSON encoding of v.
Call this function instead of the marshal functions in "encoding/json" for HTTP responses to ensure the formatting is consistent.
Note, there is nothing ARM-specific about this function other than all ARM response bodies are JSON-formatted. But the "arm" package is currently the lowest layer insofar as it has no dependencies on other ARO-HCP packages.
func Must ¶
Must is a helper function that takes a value and error, returns the value if no error occurred, or panics if an error occurred. This is useful for test setup where we don't expect errors.
func ResourceIDToCosmosID ¶
func ResourceIDToCosmosID(resourceID *azcorearm.ResourceID) (string, error)
func ToSubscriptionResourceID ¶
func ToSubscriptionResourceID(subscriptionName string) (*azcorearm.ResourceID, error)
func WriteCloudError ¶
func WriteCloudError(w http.ResponseWriter, err *CloudError)
WriteCloudError writes a CloudError to the given ResponseWriter
func WriteConflictError ¶
func WriteConflictError(w http.ResponseWriter, resourceID *azcorearm.ResourceID, format string, a ...interface{})
WriteConflictError writes a conflict error to the given ResponseWriter
func WriteDeploymentPreflightResponse ¶
func WriteDeploymentPreflightResponse(w http.ResponseWriter, preflightErrors []CloudErrorBody)
WriteDeploymentPreflightResponse writes an appropriately structured response body to a deployment preflight request using the given error slice. An empty error slice indicates successful validation.
func WriteError ¶
func WriteError(w http.ResponseWriter, statusCode int, code, target, format string, a ...interface{})
WriteError constructs and writes a CloudError to the given ResponseWriter
func WriteInternalServerError ¶
func WriteInternalServerError(w http.ResponseWriter)
WriteInternalServerError writes an internal server error to the given ResponseWriter
func WriteInvalidRequestContentError ¶
func WriteInvalidRequestContentError(w http.ResponseWriter, err error)
WriteInvalidRequestContentError writes an invalid request content error to the given ResponseWriter
func WriteJSONResponse ¶
WriteJSONResponse writes a JSON response body to the http.ResponseWriter in the proper sequence: first setting Content-Type to "application/json", then setting the HTTP status code, and finally writing a JSON encoding of body.
The function accepts anything for the body argument that can be marshalled to JSON. One special case, however, is a byte slice. A byte slice will be written verbatim with the expectation that it was produced by Marshal.
Note, there is nothing ARM-specific about this function other than all ARM response bodies are JSON-formatted. But the "arm" package is currently the lowest layer insofar as it has no dependencies on other ARO-HCP packages.
func WriteResourceNotFoundError ¶
func WriteResourceNotFoundError(w http.ResponseWriter, resourceID *azcorearm.ResourceID)
WriteResourceNotFoundError writes a nonexistent resource error to the given ResponseWriter
Types ¶
type AccountOwner ¶
type AccountOwner struct {
Puid *string `json:"puid,omitempty"`
Email *string `json:"-,omitempty"` // we don't need to nor want to serialize this field
}
func (*AccountOwner) DeepCopy ¶
func (in *AccountOwner) DeepCopy() *AccountOwner
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AccountOwner.
func (*AccountOwner) DeepCopyInto ¶
func (in *AccountOwner) DeepCopyInto(out *AccountOwner)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type AvailabilityZone ¶
type AvailabilityZone struct {
Location *string `json:"location,omitempty"`
ZoneMappings *[]ZoneMapping `json:"zoneMappings,omitempty"`
}
func (*AvailabilityZone) DeepCopy ¶
func (in *AvailabilityZone) DeepCopy() *AvailabilityZone
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AvailabilityZone.
func (*AvailabilityZone) DeepCopyInto ¶
func (in *AvailabilityZone) DeepCopyInto(out *AvailabilityZone)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type CloudError ¶
type CloudError struct {
// The HTTP status code
StatusCode int `json:"-"`
// The response body to be converted to JSON
*CloudErrorBody `json:"error,omitempty"`
}
CloudError represents a complete resource provider error.
func CloudErrorFromFieldError ¶
func CloudErrorFromFieldError(fieldError *field.Error) *CloudError
func NewCloudError ¶
func NewCloudError(statusCode int, code, target, format string, a ...interface{}) *CloudError
NewCloudError returns a new CloudError
func NewConflictError ¶
func NewConflictError(resourceID *azcorearm.ResourceID, format string, a ...interface{}) *CloudError
NewConflictError creates a CloudError for a conflict error
func NewContentValidationError ¶
func NewContentValidationError(errors []CloudErrorBody) *CloudError
NewContentValidationError creates a CloudError from a slice of validation errors. For convenience, if the slice is empty then NewContentValidationError returns nil.
func NewInternalServerError ¶
func NewInternalServerError() *CloudError
NewInternalServerError creates a CloudError for an internal server error
func NewInvalidRequestContentError ¶
func NewInvalidRequestContentError(err error) *CloudError
NewInvalidRequestContentError creates a CloudError for an invalid request content error
func NewResourceNotFoundError ¶
func NewResourceNotFoundError(resourceID *azcorearm.ResourceID) *CloudError
NewResourceNotFoundError creates a CloudError for a nonexistent resource error
func (*CloudError) DeepCopy ¶
func (in *CloudError) DeepCopy() *CloudError
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CloudError.
func (*CloudError) DeepCopyInto ¶
func (in *CloudError) DeepCopyInto(out *CloudError)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*CloudError) Error ¶
func (err *CloudError) Error() string
type CloudErrorBody ¶
type CloudErrorBody struct {
// An identifier for the error. Codes are invariant and are intended to be consumed programmatically.
Code string `json:"code,omitempty"`
// A message describing the error, intended to be suitable for display in a user interface.
Message string `json:"message,omitempty"`
// The target of the particular error. For example, the name of the property in error.
Target string `json:"target,omitempty"`
// A list of additional details about the error.
Details []CloudErrorBody `json:"details,omitempty"`
}
CloudErrorBody represents the structure of the response body for a resource provider error. See https://github.com/cloud-and-ai-microsoft/resource-provider-contract/blob/master/v1.0/common-api-details.md#error-response-content
func NewCloudErrorBodyFromSlice ¶
func NewCloudErrorBodyFromSlice(errors []CloudErrorBody, multipleErrorsMessage string) *CloudErrorBody
NewCloudErrorBodyFromSlice converts a CloudErrorBody slice to a single CloudErrorBody. If there is only one item in the provided slice, that item is returned directly. If there are multiple items in the provided slice, a CloudErrorBody is returned with the code "MultipleErrorsOccurred", the multipleErrorsMessage, and the Details field set to the provided slice. If the provided slice is empty, the function returns nil.
func (*CloudErrorBody) DeepCopy ¶
func (in *CloudErrorBody) DeepCopy() *CloudErrorBody
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CloudErrorBody.
func (*CloudErrorBody) DeepCopyInto ¶
func (in *CloudErrorBody) DeepCopyInto(out *CloudErrorBody)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*CloudErrorBody) String ¶
func (body *CloudErrorBody) String() string
type CorrelationData ¶
type CorrelationData struct {
// RequestID is a generated unique identifier for the current operation.
RequestID uuid.UUID
// ClientRequestID contains the value of header "x-ms-client-request-id".
ClientRequestID string `json:"clientRequestId,omitempty"`
// CorrelationRequestID contains the value of header "x-ms-correlation-request-id".
CorrelationRequestID string `json:"correlationRequestId,omitempty"`
// ClientPrincipalName contains the value of header "x-ms-client-principal-name".
ClientPrincipalName string `json:"clientPrincipalName,omitempty"`
}
CorrelationData represents any data used for metrics or tracing. See: https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-details.md
func NewCorrelationData ¶
func NewCorrelationData(r *http.Request) *CorrelationData
NewCorrelationData allocates and initializes a new CorrelationData from HTTP request headers.
func (*CorrelationData) DeepCopy ¶
func (in *CorrelationData) DeepCopy() *CorrelationData
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CorrelationData.
func (*CorrelationData) DeepCopyInto ¶
func (in *CorrelationData) DeepCopyInto(out *CorrelationData)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type CosmosMetadata ¶
type CosmosMetadata struct {
ResourceID *azcorearm.ResourceID `json:"resourceID"`
// ExistingCosmosUID exists to allow for a migration path from where we are today to a uuid based cosmosID
// and this will be deleted afterwards.
ExistingCosmosUID string `json:"-"`
CosmosETag azcore.ETag `json:"etag,omitempty"`
// InstanceVersion is a field that auto-increments every time the resource is updated. This gives us the ability to
// compare two instances of stored resources and determine which one is newer. We will use this field to integrate
// changefeeds for controllers and decide which changes are newer than the level we have already observed so that we
// can periodically re-list all items.
// The auto-incrementing happens automatically in the storage layer for conditional updates.
InstanceVersion int64 `json:"instanceVersion"`
// PartitionKey is the partition key for the CosmosDB document, it must be set before creation and must be all lowercase.
// On the read-path, during our migration we will fill in an empty value based on the type we're reading.
// Every type that embeds this struct must comment about what the PartitionKey is. For instance, subscriptionID, managementClusterID, etc.
PartitionKey string `json:"partitionKey"`
}
CosmosMetadata contains the information that persisted resources must have for us to support CRUD against them. These are not (currently) all stored in the same place in our various types.
func (*CosmosMetadata) DeepCopy ¶
func (in *CosmosMetadata) DeepCopy() *CosmosMetadata
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CosmosMetadata.
func (*CosmosMetadata) DeepCopyInto ¶
func (in *CosmosMetadata) DeepCopyInto(out *CosmosMetadata)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*CosmosMetadata) GetCosmosData ¶
func (o *CosmosMetadata) GetCosmosData() *CosmosMetadata
func (*CosmosMetadata) GetCosmosUID ¶
func (o *CosmosMetadata) GetCosmosUID() string
func (*CosmosMetadata) GetEtag ¶
func (o *CosmosMetadata) GetEtag() azcore.ETag
func (*CosmosMetadata) GetInstanceVersion ¶
func (o *CosmosMetadata) GetInstanceVersion() int64
GetInstanceVersion returns the monotonically-increasing version counter stored on the document. The CRUD layer auto-increments it via SetInstanceVersion on every Replace (see PrepareForReplace).
func (*CosmosMetadata) GetPartitionKey ¶
func (o *CosmosMetadata) GetPartitionKey() string
GetPartitionKey returns the lowercased partition key stored on the metadata. The CosmosDB CRUD layer is responsible for populating this field on the write path (see EnsurePartitionKey) and on the read path (see the conversion layer's migration fallback); callers may rely on it being set after a successful Create/Get round-trip. The value is lowercased on the way out so callers do not have to do it themselves.
func (*CosmosMetadata) GetResourceID ¶
func (o *CosmosMetadata) GetResourceID() *azcorearm.ResourceID
func (*CosmosMetadata) SetEtag ¶
func (o *CosmosMetadata) SetEtag(cosmosETag azcore.ETag)
func (*CosmosMetadata) SetInstanceVersion ¶
func (o *CosmosMetadata) SetInstanceVersion(v int64)
SetInstanceVersion overwrites the version counter. The CRUD layer is the only legitimate caller; tests can read it via GetInstanceVersion to assert the increment happened.
func (*CosmosMetadata) SetPartitionKey ¶
func (o *CosmosMetadata) SetPartitionKey(partitionKey string)
SetPartitionKey stores the partition key on the metadata, lowercasing the supplied value. Cosmos partition keys are case-sensitive; lowercasing here matches the convention every CRUD already uses and removes a class of "the value differs only in case" bugs at the store/query boundary.
func (*CosmosMetadata) SetResourceID ¶
func (o *CosmosMetadata) SetResourceID(resourceID *azcorearm.ResourceID)
type CosmosMetadataAccessor ¶
type CosmosMetadataAccessor interface {
CosmosPersistable
GetCosmosUID() string
GetResourceID() *azcorearm.ResourceID
SetResourceID(*azcorearm.ResourceID)
GetEtag() azcore.ETag
SetEtag(cosmosETag azcore.ETag)
GetPartitionKey() string
SetPartitionKey(string)
GetInstanceVersion() int64
SetInstanceVersion(int64)
}
type CosmosMetadataAccessorPtr ¶
type CosmosMetadataAccessorPtr[T any] interface { *T CosmosMetadataAccessor }
CosmosMetadataAccessorPtr constrains a type parameter to be a pointer to T that also implements CosmosMetadataAccessor. Generic CRUD code uses this so that a `*T` newObj argument is guaranteed to expose the metadata accessors at compile time, without runtime type assertions.
type CosmosPersistable ¶
type CosmosPersistable interface {
GetCosmosData() *CosmosMetadata
}
type CreatedByType ¶
type CreatedByType string
CreatedByType is the type of identity that created (or modified) the resource
const ( CreatedByTypeApplication CreatedByType = "Application" CreatedByTypeKey CreatedByType = "Key" CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity" CreatedByTypeUser CreatedByType = "User" )
type DeploymentPreflight ¶
type DeploymentPreflight struct {
Resources []json.RawMessage `json:"resources"`
}
DeploymentPreflight represents the body of a deployment preflight request. We use a RawMessage slice here because preflight validation is best effort. So if one resource cannot be unmarshaled we move on to the next instead of failing the whole operation.
func UnmarshalDeploymentPreflight ¶
func UnmarshalDeploymentPreflight(data []byte) (*DeploymentPreflight, error)
UnmarshalDeploymentPreflight unmarshals JSON-encoded data and returns either a DeploymentPreflight instance or an appropriate CloudError with a 200 OK HTTP status code.
func (*DeploymentPreflight) DeepCopy ¶
func (in *DeploymentPreflight) DeepCopy() *DeploymentPreflight
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeploymentPreflight.
func (*DeploymentPreflight) DeepCopyInto ¶
func (in *DeploymentPreflight) DeepCopyInto(out *DeploymentPreflight)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type DeploymentPreflightResource ¶
type DeploymentPreflightResource struct {
Name string `json:"name"`
Type string `json:"type"`
Location string `json:"location"`
APIVersion string `json:"apiVersion,omitempty"`
// Preserve other tracked resource fields as raw data.
Identity json.RawMessage `json:"identity,omitempty"`
Properties json.RawMessage `json:"properties,omitempty"`
Tags json.RawMessage `json:"tags,omitempty"`
SystemData json.RawMessage `json:"systemData,omitempty"`
}
DeploymentPreflightResource represents a desired resource in a deployment preflight request.
func (*DeploymentPreflightResource) Convert ¶
func (r *DeploymentPreflightResource) Convert(v any) error
Convert discards the APIVersion, marshals itself back to raw JSON, and then unmarshals the raw JSON to the given value, which should be an extension of the TrackedResource type.
func (*DeploymentPreflightResource) DeepCopy ¶
func (in *DeploymentPreflightResource) DeepCopy() *DeploymentPreflightResource
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeploymentPreflightResource.
func (*DeploymentPreflightResource) DeepCopyInto ¶
func (in *DeploymentPreflightResource) DeepCopyInto(out *DeploymentPreflightResource)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*DeploymentPreflightResource) ResourceID ¶
func (r *DeploymentPreflightResource) ResourceID(subscriptionID, resourceGroup string) string
ResourceID returns a resource ID string for the resource.
type DeploymentPreflightResponse ¶
type DeploymentPreflightResponse struct {
Status DeploymentPreflightStatus `json:"status"`
Error *CloudErrorBody `json:"error,omitempty"`
}
DeploymentPreflightResponse represents the JSON response structure for a deployment preflight request.
func (*DeploymentPreflightResponse) DeepCopy ¶
func (in *DeploymentPreflightResponse) DeepCopy() *DeploymentPreflightResponse
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeploymentPreflightResponse.
func (*DeploymentPreflightResponse) DeepCopyInto ¶
func (in *DeploymentPreflightResponse) DeepCopyInto(out *DeploymentPreflightResponse)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type DeploymentPreflightStatus ¶
type DeploymentPreflightStatus string
DeploymentPreflightStatus is used in a DeploymentPreflightResponse.
const ( DeploymentPreflightStatusSucceeded DeploymentPreflightStatus = "Succeeded" DeploymentPreflightStatusFailed DeploymentPreflightStatus = "Failed" )
type Feature ¶
func (*Feature) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Feature.
func (*Feature) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ManagedServiceIdentity ¶
type ManagedServiceIdentity struct {
PrincipalID string `json:"principalId,omitempty"`
TenantID string `json:"tenantId,omitempty"`
Type ManagedServiceIdentityType `json:"type"`
UserAssignedIdentities map[string]*UserAssignedIdentity `json:"userAssignedIdentities,omitempty"`
}
Represents to support the ManagedServiceIdentity ARM resource.
func (*ManagedServiceIdentity) DeepCopy ¶
func (in *ManagedServiceIdentity) DeepCopy() *ManagedServiceIdentity
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedServiceIdentity.
func (*ManagedServiceIdentity) DeepCopyInto ¶
func (in *ManagedServiceIdentity) DeepCopyInto(out *ManagedServiceIdentity)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ManagedServiceIdentityType ¶
type ManagedServiceIdentityType string
const ( ManagedServiceIdentityTypeNone ManagedServiceIdentityType = "None" ManagedServiceIdentityTypeSystemAssigned ManagedServiceIdentityType = "SystemAssigned" ManagedServiceIdentityTypeSystemAssignedUserAssigned ManagedServiceIdentityType = "SystemAssigned,UserAssigned" ManagedServiceIdentityTypeUserAssigned ManagedServiceIdentityType = "UserAssigned" )
type NamespaceOperation ¶
type NamespaceOperation struct {
// Operation name: {providerNamespace}/{resourceType}/{operation}
Name string `json:"name"`
// The object that describes the operation.
Display NamespaceOperationDisplay `json:"display"`
// Sources of requests to this operation. Valid values are
// "user", "system", or, the default value, "user,system".
Origin NamespaceOperationOrigin `json:"origin,omitempty"`
// Indicates whether the operation applies to the data-plane.
IsDataAction bool `json:"isDataAction"`
}
func (*NamespaceOperation) DeepCopy ¶
func (in *NamespaceOperation) DeepCopy() *NamespaceOperation
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespaceOperation.
func (*NamespaceOperation) DeepCopyInto ¶
func (in *NamespaceOperation) DeepCopyInto(out *NamespaceOperation)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type NamespaceOperationDisplay ¶
type NamespaceOperationDisplay struct {
// The localized friendly form of the resource provider name.
Provider string `json:"provider"`
// The localized friendly form of the resource type related to this action/operation.
Resource string `json:"resource"`
// The localized friendly name for the operation, as it should be shown to the user.
Operation string `json:"operation"`
// The localized friendly description for the operation, as it should be shown to the user.
Description string `json:"description"`
}
func (*NamespaceOperationDisplay) DeepCopy ¶
func (in *NamespaceOperationDisplay) DeepCopy() *NamespaceOperationDisplay
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespaceOperationDisplay.
func (*NamespaceOperationDisplay) DeepCopyInto ¶
func (in *NamespaceOperationDisplay) DeepCopyInto(out *NamespaceOperationDisplay)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type NamespaceOperationOrigin ¶
type NamespaceOperationOrigin string
const ( NamespaceOperationOriginUser NamespaceOperationOrigin = "user" NamespaceOperationOriginSystem NamespaceOperationOrigin = "system" NamespaceOperationOriginUserSystem NamespaceOperationOrigin = "user,system" )
type Operation ¶
type Operation struct {
ID *azcorearm.ResourceID `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Status ProvisioningState `json:"status"`
StartTime *time.Time `json:"startTime,omitempty"`
EndTime *time.Time `json:"endTime,omitempty"`
PercentComplete float64 `json:"percentComplete,omitempty"`
Properties json.RawMessage `json:"properties,omitempty"`
Error *CloudErrorBody `json:"error,omitempty"`
Operations []Operation `json:"operations,omitempty"`
}
Operation is an ARM-defined resource returned by operation status endpoints.
func (*Operation) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Operation.
func (*Operation) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PagedResponse ¶
type PagedResponse struct {
Value []json.RawMessage `json:"value"`
NextLink string `json:"nextLink,omitempty"`
}
PagedResponse is the response format for resource collection requests.
func NewPagedResponse ¶
func NewPagedResponse() PagedResponse
NewPagedResponse returns a new PagedResponse instance.
func (*PagedResponse) AddValue ¶
func (r *PagedResponse) AddValue(value json.RawMessage)
AddValue adds a JSON encoded value to a PagedResponse.
func (*PagedResponse) DeepCopy ¶
func (in *PagedResponse) DeepCopy() *PagedResponse
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PagedResponse.
func (*PagedResponse) DeepCopyInto ¶
func (in *PagedResponse) DeepCopyInto(out *PagedResponse)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*PagedResponse) SetNextLink ¶
func (r *PagedResponse) SetNextLink(baseURL, skipToken string) error
SetNextLink sets NextLink to a URL with a $skipToken parameter. If skipToken is empty, the function does nothing and returns nil.
type ProvisioningState ¶
type ProvisioningState string
ProvisioningState represents the asynchronous provisioning state of an ARM resource See https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#provisioningstate-property
const ( // Terminal states, defined by ARM ProvisioningStateSucceeded ProvisioningState = "Succeeded" ProvisioningStateFailed ProvisioningState = "Failed" ProvisioningStateCanceled ProvisioningState = "Canceled" // Non-terminal states, defined by ARO-HCP ProvisioningStateAccepted ProvisioningState = "Accepted" ProvisioningStateDeleting ProvisioningState = "Deleting" ProvisioningStateProvisioning ProvisioningState = "Provisioning" ProvisioningStateUpdating ProvisioningState = "Updating" // Exclusive to ExternalAuth ProvisioningStateAwaitingSecret ProvisioningState = "AwaitingSecret" )
func (ProvisioningState) IsTerminal ¶
func (s ProvisioningState) IsTerminal() bool
IsTerminal returns true if the state is terminal.
type ProxyResource ¶
type ProxyResource struct {
Resource
}
ProxyResource represents an ARM resource without location/tags
func NewProxyResource ¶
func NewProxyResource(resourceID *azcorearm.ResourceID) ProxyResource
NewProxyResource returns a ProxyResource initialized from resourceID.
func (*ProxyResource) DeepCopy ¶
func (in *ProxyResource) DeepCopy() *ProxyResource
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProxyResource.
func (*ProxyResource) DeepCopyInto ¶
func (in *ProxyResource) DeepCopyInto(out *ProxyResource)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Resource ¶
type Resource struct {
ID *azcorearm.ResourceID `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Type string `json:"type,omitempty"`
SystemData *SystemData `json:"systemData,omitempty"`
}
Resource represents a basic ARM resource
func NewResource ¶
func NewResource(resourceID *azcorearm.ResourceID) Resource
NewResource returns a Resource initialized from resourceID.
func (*Resource) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Resource.
func (*Resource) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Subscription ¶
type Subscription struct {
// PartitionKey holds the lowercased subscriptionID.
CosmosMetadata `json:"cosmosMetadata"`
// kept so untyped client can function
ResourceID *azcorearm.ResourceID `json:"resourceId,omitempty"`
// The resource provider contract gives an example RegistrationDate
// in RFC1123 format but does not explicitly state a required format
// so we leave it a plain string.
State SubscriptionState `json:"state"`
RegistrationDate *string `json:"registrationDate"`
Properties *SubscriptionProperties `json:"properties"`
// LastUpdated is a copy of the Cosmos DB system generated
// "_ts" last updated timestamp field for metrics reporting.
LastUpdated int `json:"-"`
}
+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
func (*Subscription) DeepCopy ¶
func (in *Subscription) DeepCopy() *Subscription
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Subscription.
func (*Subscription) DeepCopyInto ¶
func (in *Subscription) DeepCopyInto(out *Subscription)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Subscription) DeepCopyObject ¶
func (in *Subscription) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*Subscription) GetObjectKind ¶
func (s *Subscription) GetObjectKind() schema.ObjectKind
func (*Subscription) GetObjectMeta ¶
func (s *Subscription) GetObjectMeta() metav1.Object
GetObjectMeta returns metadata that allows Kubernetes informer machinery to key subscriptions by their subscription ID.
func (*Subscription) GetRegisteredFeatures ¶
func (s *Subscription) GetRegisteredFeatures() []Feature
GetRegisteredFeatures safely returns the RegisteredFeatures from the subscription, returning an empty slice if Properties or RegisteredFeatures is nil.
func (*Subscription) HasRegisteredFeature ¶
func (s *Subscription) HasRegisteredFeature(featureName string) bool
HasRegisteredFeature checks if a subscription has a specific feature registered. The feature name should be in the format "Microsoft.Provider/FeatureName". Returns true if the feature is present and its state is "Registered", false otherwise.
type SubscriptionList ¶
type SubscriptionList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Subscription `json:"items"`
}
SubscriptionList is a list of Subscriptions compatible with runtime.Object for use with Kubernetes informer machinery. +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
func (*SubscriptionList) DeepCopy ¶
func (in *SubscriptionList) DeepCopy() *SubscriptionList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubscriptionList.
func (*SubscriptionList) DeepCopyInto ¶
func (in *SubscriptionList) DeepCopyInto(out *SubscriptionList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*SubscriptionList) DeepCopyObject ¶
func (in *SubscriptionList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*SubscriptionList) GetObjectKind ¶
func (l *SubscriptionList) GetObjectKind() schema.ObjectKind
type SubscriptionProperties ¶
type SubscriptionProperties struct {
TenantId *string `json:"tenantId,omitempty"`
LocationPlacementId *string `json:"locationPlacementId,omitempty"`
QuotaId *string `json:"quotaId,omitempty"`
RegisteredFeatures *[]Feature `json:"registeredFeatures,omitempty"`
AvailabilityZones *AvailabilityZone `json:"availabilityZones,omitempty"`
SpendingLimit *string `json:"spendingLimit,omitempty"`
AccountOwner *AccountOwner `json:"accountOwner,omitempty"`
ManagedByTenants *[]map[string]string `json:"managedByTenants,omitempty"`
AdditionalProperties any `json:"additionalProperties,omitempty"`
}
func (*SubscriptionProperties) DeepCopy ¶
func (in *SubscriptionProperties) DeepCopy() *SubscriptionProperties
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubscriptionProperties.
func (*SubscriptionProperties) DeepCopyInto ¶
func (in *SubscriptionProperties) DeepCopyInto(out *SubscriptionProperties)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type SubscriptionState ¶
type SubscriptionState string
const ( SubscriptionStateRegistered SubscriptionState = "Registered" SubscriptionStateUnregistered SubscriptionState = "Unregistered" SubscriptionStateWarned SubscriptionState = "Warned" SubscriptionStateDeleted SubscriptionState = "Deleted" SubscriptionStateSuspended SubscriptionState = "Suspended" )
type SystemData ¶
type SystemData struct {
// CreatedBy is a string identifier for the identity that created the resource
CreatedBy string `json:"createdBy,omitempty"`
// CreatedByType is the type of identity that created the resource: User, Application, ManagedIdentity
CreatedByType CreatedByType `json:"createdByType,omitempty"`
// The timestamp of resource creation (UTC)
CreatedAt *time.Time `json:"createdAt,omitempty"`
// LastModifiedBy is a string identifier for the identity that last modified the resource
LastModifiedBy string `json:"lastModifiedBy,omitempty"`
// LastModifiedByType is the type of identity that last modified the resource: User, Application, ManagedIdentity
LastModifiedByType CreatedByType `json:"lastModifiedByType,omitempty"`
// LastModifiedAt is the timestamp of resource last modification (UTC)
LastModifiedAt *time.Time `json:"lastModifiedAt,omitempty"`
}
SystemData includes creation and modification metadata for resources See https://eng.ms/docs/products/arm/api_contracts/resourcesystemdata
func (*SystemData) DeepCopy ¶
func (in *SystemData) DeepCopy() *SystemData
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SystemData.
func (*SystemData) DeepCopyInto ¶
func (in *SystemData) DeepCopyInto(out *SystemData)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type TrackedResource ¶
type TrackedResource struct {
Resource
Location string `json:"location,omitempty"`
Tags map[string]string `json:"tags,omitempty"`
}
TrackedResource represents a tracked ARM resource
func NewTrackedResource ¶
func NewTrackedResource(resourceID *azcorearm.ResourceID, azureLocation string) TrackedResource
NewTrackedResource returns a TrackedResource initialized from resourceID.
func (*TrackedResource) DeepCopy ¶
func (in *TrackedResource) DeepCopy() *TrackedResource
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TrackedResource.
func (*TrackedResource) DeepCopyInto ¶
func (in *TrackedResource) DeepCopyInto(out *TrackedResource)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type UserAssignedIdentity ¶
type UserAssignedIdentity struct {
ClientID *string `json:"clientId,omitempty"`
PrincipalID *string `json:"principalId,omitempty"`
}
UserAssignedIdentity - User assigned identity properties https://azure.github.io/typespec-azure/docs/libraries/azure-resource-manager/reference/data-types/#Azure.ResourceManager.CommonTypes.UserAssignedIdentity
func (*UserAssignedIdentity) DeepCopy ¶
func (in *UserAssignedIdentity) DeepCopy() *UserAssignedIdentity
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserAssignedIdentity.
func (*UserAssignedIdentity) DeepCopyInto ¶
func (in *UserAssignedIdentity) DeepCopyInto(out *UserAssignedIdentity)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ZoneMapping ¶
type ZoneMapping struct {
LogicalZone *string `json:"logicalZone,omitempty"`
PhysicalZone *string `json:"physicalZone,omitempty"`
}
func (*ZoneMapping) DeepCopy ¶
func (in *ZoneMapping) DeepCopy() *ZoneMapping
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ZoneMapping.
func (*ZoneMapping) DeepCopyInto ¶
func (in *ZoneMapping) DeepCopyInto(out *ZoneMapping)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.