resourcescontroller

package
v1.8.5 Latest Latest
Warning

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

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

Documentation

Overview

resourcecontroller implements all controllers for resources

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteResource

func DeleteResource() gin.HandlerFunc

Delete a cluster resource of given group/version/kind by uid.

@Summary	Delete a resource by uid
@Schemes
@Description	Delete a resources
@Tags			resources
@Accept			application/json
@Produce		application/json
@Param			uid	path		string	true	"UID"
@Success		200	{bool}		bool
@Failure		403	{string}	Forbidden
@Failure		401	{object}	rorerror.ErrorData
@Failure		500	{string}	Failure	message
@Router			/v2/resources/uid/{uid} [delete]
@Security		ApiKey || AccessToken

func ExistsResources

func ExistsResources() gin.HandlerFunc

Check if a cluster resource of given uid exists.

@Summary	Check cluster resource by uid
@Schemes
@Description	Get a list of cluster resources
@Tags			resources
@Accept			application/json
@Produce		application/json
@Param			ownerScope		query	aclmodels.Acl2Scope	true	"The kind of the owner, currently only support 'Cluster'"
@Param			ownerSubject	query	string				true	"The name og the owner"
@Param			uid				path	string				true	"UID"
@Success		204
@Failure		404	{string}	NotFound
@Failure		401	{object}	rorerror.ErrorData
@Failure		500	{string}	Failure	message
@Router			/v2/resources/uid/{uid} [head]
@Security		ApiKey || AccessToken

func GetResource

func GetResource() gin.HandlerFunc

Get a cluster resources og given group/version/kind/uid.

@Summary	Get resource
@Schemes
@Description	Get a resource by uid
@Tags			resources
@Accept			application/json
@Produce		application/json
@Param			uid				path		string				true	"The uid of the resource"
@Success		200				{array}		rorresources.Resource
@Failure		403				{string}	Forbidden
@Failure		401				{object}	rorerror.ErrorData
@Failure		500				{string}	Failure	message
@Router			/v2/resources/uid/{uid} [get]
@Security		ApiKey || AccessToken

func GetResourceHashList

func GetResourceHashList() gin.HandlerFunc

Get a list of hashes of saved resources for given cluster. Parameter clusterid must match authorized clusterid

@Summary	Get resource hash list
@Schemes
@Description	Get a resource list
@Tags			resources
@Accept			application/json
@Produce		application/json
@Param			ownerScope		query		aclmodels.Acl2Scope	true	"The kind of the owner, currently only support 'Cluster'"
@Param			ownerSubject	query		string				true	"The name og the owner"
@Success		200				{array}		apiresourcecontracts.HashList
@Failure		403				{string}	Forbidden
@Failure		401				{object}	rorerror.ErrorData
@Failure		500				{string}	Failure	message
@Router			/v2/resources/hashes [get]
@Security		ApiKey || AccessToken

func GetResources

func GetResources() gin.HandlerFunc

Get a list of cluster resources og given group/version/kind.

@Summary	Get resources
@Schemes
@Description	Get a list of resources
@Tags			resources
@Accept			application/json
@Produce		application/json

@Param q query string false "A general query string (NOT IMPLEMENTED YET)" @Param apiversion query string false "The API version for the resource (e.g., 'v1' or 'apps/v1')" @Param kind query string false "The kind of resource" @Param ownerrefs query string false "JSON array of owner references [{'scope': '...', 'subject': '...'}]" @Param uids query string false "Comma-separated list of UIDs" @Param fields query string false "Comma-separated list of fields to include" @Param sort query string false "Comma-separated list of fields to sort by (+field for ascending, -field for descending)" @Param filters query string false "JSON array of filter objects [{'field':'field1','value':'value1','type':'string','operator':'eq'}]" @Param offset query int false "Starting offset for pagination" @Param limit query int false "Maximum number of results to return" @Success 200 {object} rorresources.ResourceSet @Failure 403 {string} Forbidden @Failure 400 {object} rorerror.ErrorData @Failure 401 {object} rorerror.ErrorData @Failure 500 {string} Failure message @Router /v2/resources [get] @Security ApiKey || AccessToken

func NewResource

func NewResource() gin.HandlerFunc

Register a new resource, the resource is in the payload. Parameter clusterid must match authorized clusterid

@Summary	Register  resource
@Schemes
@Description	Registers a  resource
@Tags			resources
@Accept			application/json
@Produce		application/json
@Param			rorresource	body		rorresources.ResourceSet	true	"ResourceUpdate"
@Success		200			{bool}		bool
@Failure		403			{string}	Forbidden
@Failure		401			{object}	rorerror.ErrorData
@Failure		500			{string}	Failure	message
@Router			/v2/resources [post]
@Security		ApiKey || AccessToken

func UpdateResource

func UpdateResource() gin.HandlerFunc

Update a cluster resource of given group/version/kind/uid.

@Summary	Update resource by uid
@Schemes
@Description	Update a resources
@Tags			resources
@Accept			application/json
@Produce		application/json
@Param			uid				path		string										true	"UID"
@Param			resourcereport	body		apiresourcecontracts.ResourceUpdateModel	true	"ResourceUpdate"
@Success		200				{bool}		bool
@Failure		403				{string}	Forbidden
@Failure		401				{object}	rorerror.ErrorData
@Failure		500				{string}	Failure	message
@Router			/v2/resources/uid/{uid} [put]
@Security		ApiKey || AccessToken

Types

This section is empty.

Jump to

Keyboard shortcuts

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