sep

package
v1.6.0-teta Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Operator actions for handling interventions on a storage endpoint provider

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessGrantRequest

type AccessGrantRequest struct {
	// Storage endpoint provider ID
	// Required: true
	SEPID uint64 `url:"sep_id" json:"sep_id" validate:"required"`

	// Account ID to grant access to the specified SEP. If 0,
	// the SEP will be available for all accounts with no exceptions
	// Required: true
	AccountID uint64 `url:"account_id" json:"account_id" validate:"required"`
}

Request struct for grant access to SEP

type AccessGrantToPoolRequest

type AccessGrantToPoolRequest struct {
	// Storage endpoint provider ID
	// Required: true
	SEPID uint64 `url:"sep_id" json:"sep_id" validate:"required"`

	// Pool name
	// Required: true
	PoolName string `url:"pool_name" json:"pool_name" validate:"required"`

	// Account ID to grant access to the specified pool SEP
	// Required: false
	AccountID uint64 `url:"account_id,omitempty" json:"account_id,omitempty"`

	// Resource group to grant access to the specified pool SEP
	// Required: false
	RGID uint64 `url:"resgroup_id,omitempty" json:"resgroup_id,omitempty"`
}

Request struct for grant access to pool SEP

type AccessRevokeRequest

type AccessRevokeRequest struct {
	// Storage endpoint provider ID
	// Required: true
	SEPID uint64 `url:"sep_id" json:"sep_id" validate:"required"`

	// Account ID to revoke access to the specified SEP
	// Required: true
	AccountID uint64 `url:"account_id" json:"account_id" validate:"required"`
}

Request struct for revoke access to SEP

type AccessRevokeToPoolRequest

type AccessRevokeToPoolRequest struct {
	// Storage endpoint provider ID
	// Required: true
	SEPID uint64 `url:"sep_id" json:"sep_id" validate:"required"`

	// Pool name
	// Required: true
	PoolName string `url:"pool_name" json:"pool_name" validate:"required"`

	// Account ID to grant access to the specified pool SEP
	// Required: false
	AccountID uint64 `url:"account_id,omitempty" json:"account_id,omitempty"`

	// Resource group ID to grant access to the specified pool SEP
	// Required: false
	RGID uint64 `url:"resgroup_id,omitempty" json:"resgroup_id,omitempty"`
}

Request struct for revoke access to pool SEP

type AddConsumerNodesRequest

type AddConsumerNodesRequest struct {
	// Storage endpoint provider ID
	// Required: true
	SEPID uint64 `url:"sep_id" json:"sep_id" validate:"required"`

	// List of nodes IDs
	// Required: true
	ConsumerNIDs []uint64 `url:"consumer_nids" json:"consumer_nids" validate:"min=1"`
}

Request struct for add consumer nodes

type AddProviderNodesRequest

type AddProviderNodesRequest struct {
	// Storage endpoint provider ID
	// Required: true
	SEPID uint64 `url:"sep_id" json:"sep_id" validate:"required"`

	// List of node IDs
	// Required: true
	ProviderNIDs []uint64 `url:"provider_nids" json:"provider_nids" validate:"min=1"`
}

Request struct for add provider nodes

type ByPool added in v1.5.5

type ByPool struct {

	// Disk count
	DiskCount uint64 `json:"disk_count"`

	// Disk usage
	DiskUsage uint64 `json:"disk_usage"`

	// Snapshot count
	SnapshotCount uint64 `json:"snapshot_count"`

	// Snapshot usage
	SnapshotUsage uint64 `json:"snapshot_usage"`

	// Usage
	Usage uint64 `json:"usage"`

	// Usage limit
	UsageLimit uint64 `json:"usage_limit"`
}

type ConfigFieldEditRequest

type ConfigFieldEditRequest struct {
	// Storage endpoint provider ID
	// Required: true
	SEPID uint64 `url:"sep_id" json:"sep_id" validate:"required"`

	// Field name
	// Required: true
	FieldName string `url:"field_name" json:"field_name" validate:"required"`

	// Field value
	// Required: true
	FieldValue string `url:"field_value" json:"field_value" validate:"required"`

	// Field type
	// Should be one of:
	//	- int
	//	- str
	//	- bool
	//	- list
	//	- dict
	// Required: true
	FieldType string `url:"field_type" json:"field_type" validate:"sepFieldType"`
}

Request struct for edit config fields

type ConfigInsertRequest

type ConfigInsertRequest struct {
	// Storage endpoint provider ID
	// Required: true
	SEPID uint64 `url:"sep_id" json:"sep_id" validate:"required"`

	// Storage provider config
	// Required: true
	Config string `url:"config" json:"config" validate:"required"`
}

Request struct for insert config

type ConfigValidateRequest

type ConfigValidateRequest struct {
	// Storage endpoint provider ID
	// Required: true
	SEPID uint64 `url:"sep_id" json:"sep_id" validate:"required"`

	// Storage provider config
	// Required: true
	Config string `url:"config" json:"config" validate:"required"`
}

Request struct for validate config

type ConsumptionRequest

type ConsumptionRequest struct {
	// Storage endpoint provider ID
	// Required: true
	SEPID uint64 `url:"sep_id" json:"sep_id" validate:"required"`
}

Request struct for get consumption info

type CreateRequest

type CreateRequest struct {
	// Grid ID
	// Required: true
	GID uint64 `url:"gid" json:"gid" validate:"required"`

	// SEP name
	// Required: true
	Name string `url:"name" json:"name" validate:"required"`

	// Type of storage
	// Required: true
	SEPType string `url:"sep_type" json:"sep_type" validate:"required"`

	// Description
	// Required: false
	Description string `url:"description,omitempty" json:"description,omitempty"`

	// SEP config
	// Required: false
	Config string `url:"config,omitempty" json:"config,omitempty"`

	// List of provider node IDs
	// Required: false
	ProviderNIDs []uint64 `url:"provider_nids,omitempty" json:"provider_nids,omitempty"`

	// List of consumer node IDs
	// Required: false
	ConsumerNIDs []uint64 `url:"consumer_nids,omitempty" json:"consumer_nids,omitempty"`

	// Enable SEP after creation
	// Required: false
	Enable bool `url:"enable,omitempty" json:"enable,omitempty"`
}

Request struct for create SEP object

type DecommissionRequest

type DecommissionRequest struct {
	// Storage endpoint provider ID
	// Required: true
	SEPID uint64 `url:"sep_id" json:"sep_id" validate:"required"`

	// Clear disks and images physically
	// Required: false
	ClearPhisically bool `url:"clear_physically,omitempty" json:"clear_physically,omitempty"`
}

Request struct for decommission

type DelConsumerNodesRequest

type DelConsumerNodesRequest struct {
	// Storage endpoint provider ID
	// Required: true
	SEPID uint64 `url:"sep_id" json:"sep_id" validate:"required"`

	// List of consumer node IDs
	// Required: true
	ConsumerNIDs []uint64 `url:"consumer_nids" json:"consumer_nids" validate:"min=1"`
}

Request struct for exclude consumer nodes

type DeleteRequest

type DeleteRequest struct {
	// Storage endpoint provider ID
	// Required: true
	SEPID uint64 `url:"sep_id" json:"sep_id" validate:"required"`
}

Request struct for delete SEP

type DisableRequest

type DisableRequest struct {
	// Storage endpoint provider ID
	// Required: true
	SEPID uint64 `url:"sep_id" json:"sep_id" validate:"required"`
}

Request struct for disable SEP

type DiskListRequest

type DiskListRequest struct {
	// Storage endpoint provider ID
	// Required: true
	SEPID uint64 `url:"sep_id" json:"sep_id" validate:"required"`

	// Pool name
	// Required: false
	PoolName string `url:"pool_name,omitempty" json:"pool_name,omitempty"`
}

Request struct for get list of disk IDs

type EnableRequest

type EnableRequest struct {
	// Storage endpoint provider ID
	// Required: true
	SEPID uint64 `url:"sep_id" json:"sep_id" validate:"required"`
}

Request struct for enable SEP

type GetConfigRequest

type GetConfigRequest struct {
	// Storage endpoint provider ID
	// Required: true
	SEPID uint64 `url:"sep_id" json:"sep_id" validate:"required"`
}

Request struct for get SEP config

type GetPoolRequest

type GetPoolRequest struct {
	// Storage endpoint provider ID
	// Required: true
	SEPID uint64 `url:"sep_id" json:"sep_id" validate:"required"`

	// Pool name
	// Required: true
	PoolName string `url:"pool_name" json:"pool_name" validate:"required"`
}

Request struct for get SEP pool config by name

type GetRequest

type GetRequest struct {
	// Storage endpoint provider ID
	// Required: true
	SEPID uint64 `url:"sep_id" json:"sep_id" validate:"required"`
}

Request struct for get SEP parameters

type ItemURI

type ItemURI struct {
	// IP
	IP string `json:"ip"`

	// Port
	Port uint64 `json:"port"`
}

Main information about URI

type ListRequest

type ListRequest struct {
	// Find by ID
	// Required: false
	ByID uint64 `url:"by_id,omitempty" json:"by_id,omitempty"`

	// Find by name
	// Required: false
	Name string `url:"name,omitempty" json:"name,omitempty"`

	// Find by gId
	// Required: false
	GID uint64 `url:"gId,omitempty" json:"gId,omitempty"`

	// Find by sep type
	// Required: false
	Type string `url:"type,omitempty" json:"type,omitempty"`

	// Find by provided physical node id
	// Required: false
	ProvidedBy uint64 `url:"providedBy,omitempty" json:"providedBy,omitempty"`

	// Find by techStatus
	// Required: false
	TechStatus string `url:"techStatus,omitempty" json:"techStatus,omitempty"`

	// Find by consumed physical node id
	// Required: false
	ConsumedBy uint64 `url:"consumedBy,omitempty" json:"consumedBy,omitempty"`

	// Page size
	// Required: false
	Size uint64 `url:"size,omitempty" json:"size,omitempty"`

	// Page number
	// Required: false
	Page uint64 `url:"page,omitempty" json:"page,omitempty"`
}

Request struct for get list of SEPs

type ListSEP

type ListSEP struct {
	// Data
	Data []RecordSEP `json:"data"`

	// Entry count
	EntryCount uint64 `json:"entryCount"`
}

List SEPs

func (ListSEP) FilterByID

func (lsep ListSEP) FilterByID(id uint64) ListSEP

FilterByID returns ListSEP with specified ID.

func (ListSEP) FilterByName

func (lsep ListSEP) FilterByName(name string) ListSEP

FilterByName returns ListSEP with specified Name.

func (ListSEP) FilterByObjStatus

func (lsep ListSEP) FilterByObjStatus(objStatus string) ListSEP

FilterByObjStatus returns ListSEP with specified ObjStatus.

func (ListSEP) FilterByTechStatus

func (lsep ListSEP) FilterByTechStatus(techStatus string) ListSEP

FilterByTechStatus returns ListSEP with specified TechStatus.

func (ListSEP) FilterByType

func (lsep ListSEP) FilterByType(sepType string) ListSEP

FilterByType returns ListSEP with specified Type.

func (ListSEP) FilterFunc

func (lsep ListSEP) FilterFunc(predicate func(RecordSEP) bool) ListSEP

FilterFunc allows filtering ListSEP based on user-specified predicate.

func (ListSEP) FindOne

func (lsep ListSEP) FindOne() RecordSEP

FindOne returns first found RecordSEP If none was found, returns an empty struct.

func (ListSEP) Serialize

func (lsep ListSEP) Serialize(params ...string) (serialization.Serialized, error)

Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions.

In order to serialize with indent make sure to follow these guidelines:

  • First argument -> prefix
  • Second argument -> indent

type ListURIs

type ListURIs []ItemURI

List URIs

type RecordConsumption

type RecordConsumption struct {
	// By pool
	ByPool map[string]ByPool `json:"byPool"`

	// Total resource information
	Total Total `json:"total"`

	// Type
	Type string `json:"type"`
}

Main information about consumption

type RecordPool

type RecordPool struct {
	// List access account IDs
	AccessAccountIDs []uint64 `json:"accessAccountIds"`

	// List access resource group IDs
	AccessResGroupIDs []uint64 `json:"accessResGroupIds"`

	// Name
	Name string `json:"name"`

	//  Page cache ratio
	PageCacheRatio uint64 `json:"pagecache_ratio"`

	// Reference ID
	ReferenceID string `json:"referenceId"`

	// List types
	Types []string `json:"types"`

	// List URIs
	URIs ListURIs `json:"uris"`

	// Usage Limit
	UsageLimit uint64 `json:"usage_limit"`
}

Detailed information about SEP pool

type RecordSEP

type RecordSEP struct {
	// CKey
	CKey string `json:"_ckey"`

	// Meta
	Meta []interface{} `json:"_meta"`

	// Config
	Config SEPConfig `json:"config"`

	// Consumed by
	ConsumedBy []uint64 `json:"consumedBy"`

	// Description
	Description string `json:"desc"`

	// Grid ID
	GID uint64 `json:"gid"`

	// GUID
	GUID uint64 `json:"guid"`

	// ID
	ID uint64 `json:"id"`

	// Milestones
	Milestones uint64 `json:"milestones"`

	// Name
	Name string `json:"name"`

	// Object status
	ObjStatus string `json:"objStatus"`

	// Provided by
	ProvidedBy []uint64 `json:"providedBy"`

	// Shared with
	SharedWith []uint64 `json:"sharedWith"`

	// Tech status
	TechStatus string `json:"techStatus"`

	// Type
	Type string `json:"type"`
}

Detailed information about SEP

func (RecordSEP) Serialize

func (rsep RecordSEP) Serialize(params ...string) (serialization.Serialized, error)

Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions.

In order to serialize with indent make sure to follow these guidelines:

  • First argument -> prefix
  • Second argument -> indent

type SEP

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

Structure for creating request to storage endpoint provider

func New

func New(client interfaces.Caller) *SEP

Builder for SEP endpoints

func (SEP) AccessGrant

func (s SEP) AccessGrant(ctx context.Context, req AccessGrantRequest) (bool, error)

AccessGrant grant access to SEP

func (SEP) AccessGrantToPool

func (s SEP) AccessGrantToPool(ctx context.Context, req AccessGrantToPoolRequest) (bool, error)

AccessGrantToPool grant access to pool SEP

func (SEP) AccessRevoke

func (s SEP) AccessRevoke(ctx context.Context, req AccessRevokeRequest) (bool, error)

AccessRevoke revoke access to SEP

func (SEP) AccessRevokeToPool

func (s SEP) AccessRevokeToPool(ctx context.Context, req AccessRevokeToPoolRequest) (bool, error)

AccessRevokeToPool revoke access to pool SEP

func (SEP) AddConsumerNodes

func (s SEP) AddConsumerNodes(ctx context.Context, req AddConsumerNodesRequest) (bool, error)

AddConsumerNodes add consumer nodes to SEP parameters

func (SEP) AddProviderNodes

func (s SEP) AddProviderNodes(ctx context.Context, req AddProviderNodesRequest) (bool, error)

AddProviderNodes add provider nodes to SEP parameters

func (SEP) ConfigFieldEdit

func (s SEP) ConfigFieldEdit(ctx context.Context, req ConfigFieldEditRequest) (bool, error)

ConfigFieldEdit edit SEP config field value

func (SEP) ConfigInsert

func (s SEP) ConfigInsert(ctx context.Context, req ConfigInsertRequest) (bool, error)

ConfigInsert insert config to SEP

func (SEP) ConfigValidate

func (s SEP) ConfigValidate(ctx context.Context, req ConfigValidateRequest) (bool, error)

ConfigValidate verify config for the SEP

func (SEP) Consumption

func (s SEP) Consumption(ctx context.Context, req ConsumptionRequest) (*RecordConsumption, error)

Consumption get SEP consumption info

func (SEP) Create

func (s SEP) Create(ctx context.Context, req CreateRequest) (uint64, error)

Create creates SEP object

func (SEP) Decommission

func (s SEP) Decommission(ctx context.Context, req DecommissionRequest) (bool, error)

Decommission unlink everything that exists from SEP

func (SEP) DelConsumerNodes

func (s SEP) DelConsumerNodes(ctx context.Context, req DelConsumerNodesRequest) (bool, error)

DelConsumerNodes exclude consumer nodes from SEP parameters

func (SEP) Delete

func (s SEP) Delete(ctx context.Context, req DeleteRequest) (bool, error)

Delete deletes SEP by ID

func (SEP) Disable

func (s SEP) Disable(ctx context.Context, req DisableRequest) (bool, error)

Disable disables SEP by ID

func (SEP) DiskList

func (s SEP) DiskList(ctx context.Context, req DiskListRequest) ([]uint64, error)

DiskList get list of disk IDs, who use this SEP and pool (if provided)

func (SEP) Enable

func (s SEP) Enable(ctx context.Context, req EnableRequest) (bool, error)

Enable enables SEP by ID

func (SEP) Get

func (s SEP) Get(ctx context.Context, req GetRequest) (*RecordSEP, error)

Get gets SEP parameters

func (SEP) GetConfig

func (s SEP) GetConfig(ctx context.Context, req GetConfigRequest) (*SEPConfig, error)

GetConfig gets SEP config

func (SEP) GetPool

func (s SEP) GetPool(ctx context.Context, req GetPoolRequest) (*RecordPool, error)

GetPool gets SEP pool config by name

func (SEP) List

func (s SEP) List(ctx context.Context, req ListRequest) (*ListSEP, error)

List gets list of SEPs

func (SEP) UpdateCapacityLimit

func (s SEP) UpdateCapacityLimit(ctx context.Context, req UpdateCapacityLimitRequest) (uint64, error)

UpdateCapacityLimit updates SEP capacity limit

type SEPConfig

type SEPConfig map[string]interface{}

SEP config

type Total

type Total struct {
	// Capacity limit
	CapacityLimit uint64 `json:"capacity_limit"`

	// Disk count
	DiskCount uint64 `json:"disk_count"`

	// Disk usage
	DiskUsage uint64 `json:"disk_usage"`

	// Snapshot count
	SnapshotCount uint64 `json:"snapshot_count"`

	// Snapshot usage
	SnapshotUsage uint64 `json:"snapshot_usage"`

	// Usage
	Usage uint64 `json:"usage"`

	// Usage limit
	UsageLimit uint64 `json:"usage_limit"`
}

Total resource information

type UpdateCapacityLimitRequest

type UpdateCapacityLimitRequest struct {
	// Storage endpoint provider ID
	// Required: true
	SEPID uint64 `url:"sep_id" json:"sep_id" validate:"required"`
}

Request struct for update capacity limits

Jump to

Keyboard shortcuts

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