defaultoperation

package
v0.33.0 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCreateOrUpdateSubscription

func NewCreateOrUpdateSubscription(opts ctrl.Options) (ctrl.Controller, error)

NewCreateOrUpdateSubscription creates a new CreateOrUpdateSubscription.

func NewDefaultAsyncDelete

func NewDefaultAsyncDelete[P interface {
	*T
	v1.ResourceDataModel
}, T any](opts ctrl.Options, resourceOpts ctrl.ResourceOptions[T]) (ctrl.Controller, error)

NewDefaultAsyncDelete creates a new DefaultAsyncDelete.

func NewDefaultAsyncPut

func NewDefaultAsyncPut[P interface {
	*T
	v1.ResourceDataModel
}, T any](opts ctrl.Options, resourceOpts ctrl.ResourceOptions[T]) (ctrl.Controller, error)

NewDefaultAsyncPut creates a new DefaultAsyncPut.

func NewDefaultSyncDelete

func NewDefaultSyncDelete[P interface {
	*T
	v1.ResourceDataModel
}, T any](opts ctrl.Options, resourceOpts ctrl.ResourceOptions[T]) (ctrl.Controller, error)

NewDefaultSyncDelete creates a new DefaultSyncDelete.

func NewDefaultSyncPut

func NewDefaultSyncPut[P interface {
	*T
	v1.ResourceDataModel
}, T any](opts ctrl.Options, resourceOpts ctrl.ResourceOptions[T]) (ctrl.Controller, error)

NewDefaultSyncPut creates a new DefaultSyncPut.

func NewGetOperationResult

func NewGetOperationResult(opts ctrl.Options) (ctrl.Controller, error)

NewGetOperationResult creates a new GetOperationResult controller.

func NewGetOperationStatus

func NewGetOperationStatus(opts ctrl.Options) (ctrl.Controller, error)

NewGetOperationStatus creates a new GetOperationStatus.

func NewGetOperations

func NewGetOperations(opts ctrl.Options, opsList []v1.Operation) (ctrl.Controller, error)

NewGetOperations creates a new GetOperations controller and returns it, or returns an error if one occurs.

func NewGetResource

func NewGetResource[P interface {
	*T
	v1.ResourceDataModel
}, T any](opts ctrl.Options, resourceOpts ctrl.ResourceOptions[T]) (ctrl.Controller, error)

NewGetResource creates a new GetResource controller instance.

Types

type CreateOrUpdateSubscription

type CreateOrUpdateSubscription struct {
	ctrl.BaseController
}

CreateOrUpdateSubscription is the controller implementation to manage arm subscription lifecycle.

func (*CreateOrUpdateSubscription) Run

CreateOrUpdateSubscription is triggered when the state of the user subscription is changed (setup or tear down). Spec: https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/subscription-lifecycle-api-reference.md#subscription-lifecycle-api-reference

func (*CreateOrUpdateSubscription) Validate

Validate validates subscription request and returns the Subscription object if successful, or nil if an error occurs.

type DefaultAsyncDelete

type DefaultAsyncDelete[P interface {
	*T
	v1.ResourceDataModel
}, T any] struct {
	ctrl.Operation[P, T]
}

DefaultAsyncDelete is the controller implementation to delete async resource.

func (*DefaultAsyncDelete[P, T]) Run

Run executes asynchronous delete operation by validating the request, executing custom delete filters, and starting async job, and returns an async response.

type DefaultAsyncPut

type DefaultAsyncPut[P interface {
	*T
	v1.ResourceDataModel
}, T any] struct {
	ctrl.Operation[P, T]
}

DefaultAsyncPut is the controller implementation to create or update async resource.

func (*DefaultAsyncPut[P, T]) Run

Run executes asynchronous create or update operation by validating new resource metadata, ensuring if it is new resource or updated resource, running custom update filters, and queuing async operation and returns an async response.

type DefaultSyncDelete

type DefaultSyncDelete[P interface {
	*T
	v1.ResourceDataModel
}, T any] struct {
	ctrl.Operation[P, T]
}

DefaultSyncDelete is the controller implementation to delete resource synchronously.

func (*DefaultSyncDelete[P, T]) Run

Run executes synchronous deletion operation. It retrieves the resource from the store, runs custom delete filters, and then deletes the resource from the data store. If the resource is not found, a No Content response is returned. If an error occurs during the delete, an error is returned.

type DefaultSyncPut

type DefaultSyncPut[P interface {
	*T
	v1.ResourceDataModel
}, T any] struct {
	ctrl.Operation[P, T]
}

DefaultSyncPut is the controller implementation to create or update resource synchronously.

func (*DefaultSyncPut[P, T]) Run

Run executes synchronous create or update operation by validating new resource metadata, ensuring if it is new resource or updated resource, running custom update filters, and upserting resource metadata and returns an resource as a response.

type GetOperationResult

type GetOperationResult struct {
	ctrl.BaseController
}

GetOperationResult is the controller implementation to get the result of an async operation.

func (*GetOperationResult) Run

Run returns the response with necessary headers about the async operation - it checks if the operation is in a terminal state, and if not, returns an AsyncOperationResultResponse with the Location and Retry-After headers set. If the operation is in a terminal state, it returns a NoContentResponse. If the operation is not found, it returns a NotFoundResponse. If an error occurs, it returns a BadRequestResponse. Spec: https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#azure-asyncoperation-resource-format

type GetOperationStatus

type GetOperationStatus struct {
	ctrl.BaseController
}

GetOperationStatus is the controller implementation to get an async operation status.

func (*GetOperationStatus) Run

Run returns the status of an asynchronous operation, or a NotFound error if the operation is not found. Spec: https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#azure-asyncoperation-resource-format

type GetOperations

type GetOperations struct {
	ctrl.BaseController
	// contains filtered or unexported fields
}

GetOperations is the controller implementation to get arm rpc available operations.

func (*GetOperations) Run

Run returns the list of available operations/permission for the resource provider at tenant level. Spec: https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/proxy-api-reference.md#exposing-available-operations

type GetResource

type GetResource[P interface {
	*T
	v1.ResourceDataModel
}, T any] struct {
	ctrl.Operation[P, T]
}

GetResource is the controller implementation to get a resource.

func (*GetResource[P, T]) Run

func (e *GetResource[P, T]) Run(ctx context.Context, w http.ResponseWriter, req *http.Request) (rest.Response, error)

Run returns the requested resource from the datastore with etag. If the resource does not exist, a not found response is returned. If an error occurs, an error is returned as an internal error.

type ListResources

type ListResources[P interface {
	*T
	v1.ResourceDataModel
}, T any] struct {
	ctrl.Operation[P, T]
	// contains filtered or unexported fields
}

ListResources is the controller implementation to get the list of resources in resource group.

func NewListResources

func NewListResources[P interface {
	*T
	v1.ResourceDataModel
}, T any](opts ctrl.Options, ctrlOpts ctrl.ResourceOptions[T]) (*ListResources[P, T], error)

NewListResources creates a new ListResources instance.

func (*ListResources[P, T]) Run

Run queries the resource data store with a given type and scope and returns the paginated resource list. An internal error is returned if the query fails.

Jump to

Keyboard shortcuts

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