sep

package
v1.10.1 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2025 License: Apache-2.0 Imports: 8 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"`
}

AccessGrantRequest struct to 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"`
}

AccessGrantToPoolRequest struct to 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"`
}

AccessRevokeRequest struct to 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"`
}

AccessRevokeToPoolRequest struct to 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"`
}

AddConsumerNodesRequest struct to add consumer nodes

type AddPoolRequest added in v1.8.0

type AddPoolRequest struct {
	// ID of SEP to add new pool
	// Required: true
	SEPID uint64 `url:"sep_id" json:"sep_id" validate:"required"`

	// method Async/Sync
	// Default: true
	// Required: false
	Sync bool `url:"sync" json:"sync"`

	// Pool structure which contains fields such as "name", "types", "accessAccountIds", "accessResGroupIds"
	// Required: true
	Pool string `url:"pool" json:"pool" validate:"required"`
}

AddPoolRequest struct to add pool to storage endpoint (SEP)

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"`
}

AddProviderNodesRequest struct to 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"`
}

ConfigFieldEditRequest struct to 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"`
}

ConfigInsertRequest struct to 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"`
}

ConfigValidateRequest struct to validate config

type ConsumptionRequest

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

ConsumptionRequest struct to 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"`

	// SEP config
	// Required: true
	Config string `url:"config" json:"config" validate:"required"`

	// Description
	// Required: false
	Description string `url:"description,omitempty" json:"description,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"`
}

CreateRequest struct to 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"`
}

DecommissionRequest 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"`
}

DelConsumerNodesRequest struct to exclude consumer nodes

type DelPoolRequest added in v1.8.0

type DelPoolRequest struct {
	// ID of SEP to delete pool
	// Required: true
	SEPID uint64 `url:"sep_id" json:"sep_id" validate:"required"`

	// Name of pool to delete
	// Required: true
	PoolName string `url:"pool_name" json:"pool_name" validate:"required"`
}

DelPoolRequest struct to delete pool from storage endpoint (SEP)

type DeleteRequest

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

DeleteRequest struct to delete SEP

type DisableRequest

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

DisableRequest struct to 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"`
}

DiskListRequest struct to 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"`
}

EnableRequest struct to enable SEP

type GetConfigRequest

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

GetConfigRequest struct to 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"`
}

GetPoolRequest struct to 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"`
}

GetRequest struct to 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"`

	// Sort by one of supported fields, format +|-(field)
	// Required: false
	SortBy string `url:"sortBy,omitempty" json:"sortBy,omitempty" validate:"omitempty,sortBy"`

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

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

ListRequest struct to 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) IDs added in v1.6.8

func (ls ListSEP) IDs() []uint64

IDs gets array of SEPIDs from ListSEP 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 {
	// 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"`

	// MultipathNum
	MultipathNum uint64 `json:"multipathNum"`

	// 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 grants access to SEP

func (SEP) AccessGrantToPool

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

AccessGrantToPool grants access to pool SEP

func (SEP) AccessRevoke

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

AccessRevoke revokes access to SEP

func (SEP) AccessRevokeToPool

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

AccessRevokeToPool revokes access to pool SEP

func (SEP) AddConsumerNodes

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

AddConsumerNodes adds consumer nodes to SEP parameters

func (SEP) AddPool added in v1.8.0

func (s SEP) AddPool(ctx context.Context, req AddPoolRequest) (string, error)

AddPool adds pool to SEP

func (SEP) AddProviderNodes

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

AddProviderNodes adds provider nodes to SEP parameters

func (SEP) ConfigFieldEdit

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

ConfigFieldEdit edits SEP config field value

func (SEP) ConfigInsert

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

ConfigInsert inserts config to SEP

func (SEP) ConfigValidate

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

ConfigValidate verifies config for the SEP

func (SEP) Consumption

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

Consumption gets 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 excludes consumer nodes from SEP parameters

func (SEP) DelPool added in v1.8.0

func (s SEP) DelPool(ctx context.Context, req DelPoolRequest) (bool, error)

DelPool deletes pool from SEP

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 gets 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 as a RecordSEP struct

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) GetRaw added in v1.6.6

func (s SEP) GetRaw(ctx context.Context, req GetRequest) ([]byte, error)

GetRaw gets SEP parameters as an array of bytes

func (SEP) List

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

List gets list of SEPs as a ListSEP struct

func (SEP) ListRaw added in v1.6.6

func (s SEP) ListRaw(ctx context.Context, req ListRequest) ([]byte, error)

ListRaw gets list of SEPs as an array of bytes

func (SEP) SharedLockStart added in v1.9.0

func (s SEP) SharedLockStart(ctx context.Context, req SharedLockStartRequest) (bool, error)

SharedLockStart start shared locks without AsyncMode

func (SEP) SharedLockStartAsync added in v1.9.0

func (s SEP) SharedLockStartAsync(ctx context.Context, req SharedLockStartRequest) (string, error)

SharedLockStartAsync start shared locks with AsyncMode

func (SEP) SharedLockStop added in v1.9.0

func (s SEP) SharedLockStop(ctx context.Context, req SharedLockStopRequest) (bool, error)

SharedLockStop stop shared locks without AsyncMode

func (SEP) SharedLockStopAsync added in v1.9.0

func (s SEP) SharedLockStopAsync(ctx context.Context, req SharedLockStopRequest) (string, error)

SharedLockStopAsync stop shared locks with AsyncMode

type SEPConfig

type SEPConfig map[string]interface{}

SEP config

type SharedLockStartRequest added in v1.9.0

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

	// List of node IDs for start locks
	// Required: false
	Nodes []uint64 `url:"nodes,omitempty" json:"nodes,omitempty"`

	// List of pool names for start locks
	// Required: false
	VGNames []string `url:"vg_names,omitempty" json:"vg_names,omitempty"`

	// If there are LOCKs, ignore them
	// Default: false
	// Required: false
	IgnoreStartedLock bool `url:"ignore_started_lock" json:"ignore_started_lock"`
}

SharedLockStartRequest struct to start shared locks

type SharedLockStopRequest added in v1.9.0

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

	// List of node IDs for stop locks
	// Required: false
	Nodes []uint64 `url:"nodes,omitempty" json:"nodes,omitempty"`

	// List of pool names for stop locks
	// Required: false
	VGNames []string `url:"vg_names,omitempty" json:"vg_names,omitempty"`
}

SharedLockStopRequest struct to stop shared locks

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

Jump to

Keyboard shortcuts

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