Help us shape the future of Go! Take the 2026 Go Developer Survey

resourcescontroller

package
v1.16.4 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2026 License: Apache-2.0 Imports: 25 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 resource
@Tags			resources
@Accept			application/json
@Produce		application/json
@Param			uid	path		string	true	"UID"
@Success		200	{object}	rorresources.ResourceUpdateResults
@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	aclscope.Scope	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		aclscope.Scope	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		201			{object}	rorresources.ResourceUpdateResults
@Failure		403			{string}	Forbidden
@Failure		401			{object}	rorerror.ErrorData
@Failure		500			{string}	Failure	message
@Router			/v2/resources [post]
@Security		ApiKey || AccessToken

func PatchResource

func PatchResource() gin.HandlerFunc

Patch a resource by uid. Only the fields present in the request body are updated; all other fields in the stored document are preserved.

@Summary	Patch resource by uid
@Schemes
@Description	Partially update a resource
@Tags			resources
@Accept			application/json
@Produce		application/json
@Param			uid		path		string	true	"UID"
@Param			patch	body		object	true	"Partial resource fields to update"
@Success		200		{object}	rorresources.ResourceUpdateResults
@Failure		400		{object}	responses.Cluster
@Failure		403		{string}	Forbidden
@Failure		401		{object}	rorerror.ErrorData
@Failure		404		{string}	Not	Found
@Failure		500		{string}	Failure	message
@Router			/v2/resources/uid/{uid} [patch]
@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 resource
@Tags			resources
@Accept			application/json
@Produce		application/json
@Param			uid			path		string					true	"UID"
@Param			rorresource	body		rorresources.Resource	true	"Resource"
@Success		200			{object}	rorresources.ResourceUpdateResults
@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