managementv2

package
v0.0.0-...-a3be206 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2024 License: Apache-2.0 Imports: 13 Imported by: 8

Documentation

Index

Constants

View Source
const ErrCodeAPICreation = "APICreationError"

ErrCodeAPICreation ...

View Source
const ErrCodeResourceGroupDoesnotExist = "ResourceGroupDoesnotExist"

ErrCodeResourceGroupDoesnotExist ...

View Source
const ErrCodeResourceQuotaDoesnotExist = "ResourceQuotaDoesnotExist"

ErrCodeResourceQuotaDoesnotExist ...

Variables

This section is empty.

Functions

This section is empty.

Types

type GenericPaginatedResourcesHandler

type GenericPaginatedResourcesHandler struct {
	// contains filtered or unexported fields
}

func NewRCPaginatedResources

func NewRCPaginatedResources(resource interface{}) GenericPaginatedResourcesHandler

func (GenericPaginatedResourcesHandler) Resources

func (pr GenericPaginatedResourcesHandler) Resources(bytes []byte, curURL string) ([]interface{}, string, error)

type QuotaDefinition

type QuotaDefinition struct {
	ID                        string          `json:"_id,omitempty"`
	Revision                  string          `json:"_rev,omitempty"`
	Name                      string          `json:"name,omitmempty"`
	Type                      string          `json:"type,omitempty"`
	ServiceInstanceCountLimit int             `json:"number_of_service_instances,omitempty"`
	AppCountLimit             int             `json:"number_of_apps,omitempty"`
	AppInstanceCountLimit     int             `json:"instances_per_app,omitempty"`
	AppInstanceMemoryLimit    string          `json:"instance_memory,omitempty"`
	TotalAppMemoryLimit       string          `json:"total_app_memory,omitempty"`
	VSICountLimit             int             `json:"vsi_limit,omitempty"`
	ResourceQuotas            []ResourceQuota `json:"resource_quotas,omitempty"`
	CreatedAt                 string          `json:"created_at,omitempty"`
	UpdatedAt                 string          `json:"updated_at,omitempty"`
}

type ResourceGroupQuery

type ResourceGroupQuery struct {
	AccountID      string
	Default        bool
	ResourceID     string
	ResourceOrigin models.ResourceOrigin
}

ResourceGroupQuery is the query filters to get resource groups

func (ResourceGroupQuery) MakeRequest

func (q ResourceGroupQuery) MakeRequest(r *rest.Request) *rest.Request

populate query part of HTTP requests

type ResourceGroupRepository

type ResourceGroupRepository interface {
	// List all available resource groups
	List(*ResourceGroupQuery) ([]models.ResourceGroupv2, error)
	// Get resource group by ID
	Get(id string) (*models.ResourceGroupv2, error)
	// Find resource groups having the specific name
	FindByName(*ResourceGroupQuery, string) ([]models.ResourceGroupv2, error)
	// Create a new resource group
	Create(models.ResourceGroupv2) (*models.ResourceGroupv2, error)
	// Delete an existing resource group
	Delete(id string) error
	// Update an existing resource group
	Update(id string, request *ResourceGroupUpdateRequest) (*models.ResourceGroupv2, error)
}

ResourceGroupQuery ...

type ResourceGroupUpdateRequest

type ResourceGroupUpdateRequest struct {
	Name    string `json:"name,omitempty"`
	QuotaID string `json:"quota_id,omitempty"`
	Default *bool  `json:"default,omitempty"`
}

ResourceGroupUpdateRequest ...

type ResourceManagementAPIv2

type ResourceManagementAPIv2 interface {
	ResourceQuota() ResourceQuotaRepository
	ResourceGroup() ResourceGroupRepository
}

ResourceManagementAPI is the resource client ...

func New

New ...

type ResourceOrigin

type ResourceOrigin string

func (ResourceOrigin) String

func (o ResourceOrigin) String() string

type ResourceQuota

type ResourceQuota struct {
	ID         string `json:"_id,omitempty"`
	ResourceID string `json:"resource_id,omitempty"`
	Limit      int    `json:"limit,omitempty"`
}

type ResourceQuotaRepository

type ResourceQuotaRepository interface {
	// List all quota definitions
	List() ([]QuotaDefinition, error)
	// Query quota definitions having specific name
	FindByName(name string) ([]QuotaDefinition, error)
	// Get quota definition by ID
	Get(id string) (*QuotaDefinition, error)
}

Jump to

Keyboard shortcuts

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