arm

package
v0.0.0-...-5851d12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 24, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CloudErrorCodeInternalServerError      = "InternalServerError"
	CloudErrorCodeServiceUnavailable       = "ServiceUnavailable"
	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

View Source
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"
)
View Source
const (
	NamespaceOperationRead   = "read"
	NamespaceOperationWrite  = "write"
	NamespaceOperationDelete = "delete"
	NamespaceOperationAction = "action"
)

The last path segment of Name must be one of these.

View Source
const SubscriptionAPIVersion = "2.0"

SubscriptionAPIVersion is the system API version for the subscription endpoint.

Variables

Functions

func CloudErrorFromFieldErrors

func CloudErrorFromFieldErrors(fieldErrors field.ErrorList) error

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

func DetectTLE(data []byte) (bool, error)

DetectTLE returns true if a Template Language Expression is detected in any part of the JSON input.

func IsTLE

func IsTLE(s string) bool

IsTLE returns true if s is a Template Language Expression.

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

func MarshalJSON(v any) ([]byte, error)

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

func Must[T any](v T, err error) T

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 ResourceIDStringToCosmosID

func ResourceIDStringToCosmosID(resourceID string) (string, error)

func ResourceIDToCosmosID

func ResourceIDToCosmosID(resourceID *azcorearm.ResourceID) (string, error)

func ToSubscriptionResourceID

func ToSubscriptionResourceID(subscriptionName string) (*azcorearm.ResourceID, error)

func ToSubscriptionResourceIDString

func ToSubscriptionResourceIDString(subscriptionName string) string

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

func WriteJSONResponse(writer http.ResponseWriter, statusCode int, body any) (int, error)

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

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeploymentPreflightResource.

func (*DeploymentPreflightResource) DeepCopyInto

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

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeploymentPreflightResponse.

func (*DeploymentPreflightResponse) DeepCopyInto

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

type Feature struct {
	Name  *string `json:"name,omitempty"`
	State *string `json:"state,omitempty"`
}

func (*Feature) DeepCopy

func (in *Feature) DeepCopy() *Feature

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Feature.

func (*Feature) DeepCopyInto

func (in *Feature) DeepCopyInto(out *Feature)

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

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

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespaceOperationDisplay.

func (*NamespaceOperationDisplay) DeepCopyInto

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

func (in *Operation) DeepCopy() *Operation

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Operation.

func (*Operation) DeepCopyInto

func (in *Operation) DeepCopyInto(out *Operation)

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 (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

func (in *Resource) DeepCopy() *Resource

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Resource.

func (*Resource) DeepCopyInto

func (in *Resource) DeepCopyInto(out *Resource)

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

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

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL