nb

package
v2.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2019 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package nb makes client API calls to noobaa servers.

Index

Constants

View Source
const (
	// CloudAuthMethodAwsV2 enum
	CloudAuthMethodAwsV2 CloudAuthMethod = "AWS_V2"
	// CloudAuthMethodAwsV4 enum
	CloudAuthMethodAwsV4 CloudAuthMethod = "AWS_V4"

	// EndpointTypeAws enum
	EndpointTypeAws EndpointType = "AWS"
	// EndpointTypeAzure enum
	EndpointTypeAzure EndpointType = "AZURE"
	// EndpointTypeGoogle enum
	EndpointTypeGoogle EndpointType = "GOOGLE"
	// EndpointTypeS3Compat enum
	EndpointTypeS3Compat EndpointType = "S3_COMPATIBLE"

	// ExternalConnectionSuccess enum
	ExternalConnectionSuccess ExternalConnectionStatus = "SUCCESS"
	// ExternalConnectionTimeout enum
	ExternalConnectionTimeout ExternalConnectionStatus = "TIMEOUT"
	// ExternalConnectionInvalidEndpoint enum
	ExternalConnectionInvalidEndpoint ExternalConnectionStatus = "INVALID_ENDPOINT"
	// ExternalConnectionInvalidCredentials enum
	ExternalConnectionInvalidCredentials ExternalConnectionStatus = "INVALID_CREDENTIALS"
	// ExternalConnectionNotSupported enum
	ExternalConnectionNotSupported ExternalConnectionStatus = "NOT_SUPPORTED"
	// ExternalConnectionTimeSkew enum
	ExternalConnectionTimeSkew ExternalConnectionStatus = "TIME_SKEW"
	// ExternalConnectionUnknownFailure enum
	ExternalConnectionUnknownFailure ExternalConnectionStatus = "UNKNOWN_FAILURE"
)

Variables

This section is empty.

Functions

func FindPortByName

func FindPortByName(srv *corev1.Service, portName string) *corev1.ServicePort

FindPortByName returns the port in the service that matches the given name.

func GetAPIPortName

func GetAPIPortName(api string) string

GetAPIPortName maps every noobaa api name to the service port name that serves it.

Types

type APIRouter

type APIRouter interface {
	GetAddress(api string) string
}

APIRouter should be able to map noobaa api names to actual addresses See implementations below: APIRouterNodePort, APIRouterPodPort, APIRouterServicePort

type APIRouterNodePort

type APIRouterNodePort struct {
	ServiceMgmt *corev1.Service
	NodeIP      string
}

APIRouterNodePort uses the service node port to route to NodeIP:NodePorts

func (*APIRouterNodePort) GetAddress

func (r *APIRouterNodePort) GetAddress(api string) string

GetAddress implements the router

type APIRouterPodPort

type APIRouterPodPort struct {
	ServiceMgmt *corev1.Service
	PodIP       string
}

APIRouterPodPort uses the service target port to route to PodIP:TargetPort

func (*APIRouterPodPort) GetAddress

func (r *APIRouterPodPort) GetAddress(api string) string

GetAddress implements the router

type APIRouterPortForward added in v2.0.2

type APIRouterPortForward struct {
	ServiceMgmt  *corev1.Service
	PodNamespace string
	PodName      string
	// Start() will setup these fields:
	PF                   *portforward.PortForwarder
	StopChan             chan struct{}
	MapRemotePortToLocal map[uint16]uint16
}

APIRouterPortForward uses portforwarding to the the pod

func (*APIRouterPortForward) GetAddress added in v2.0.2

func (r *APIRouterPortForward) GetAddress(api string) string

GetAddress implements the router

func (*APIRouterPortForward) Start added in v2.0.2

func (r *APIRouterPortForward) Start() error

Start initializes and runs portforwarding by listening on to local ports and forwarding their connections to the target pod ports See

func (*APIRouterPortForward) Stop added in v2.0.2

func (r *APIRouterPortForward) Stop()

Stop the port forwarding

type APIRouterServicePort

type APIRouterServicePort struct {
	ServiceMgmt *corev1.Service
}

APIRouterServicePort uses the service port to route to Srv.Namespace:Port

func (*APIRouterServicePort) GetAddress

func (r *APIRouterServicePort) GetAddress(api string) string

GetAddress implements the router

type AccountAllowedBuckets

type AccountAllowedBuckets struct {
	FullPermission bool     `json:"full_permission"`
	PermissionList []string `json:"permission_list"`
}

AccountAllowedBuckets is part of CreateAccountParams

type AccountInfo

type AccountInfo struct {
	Name               string         `json:"name"`
	Email              string         `json:"email"`
	IsSupport          bool           `json:"is_support"`
	HasLogin           bool           `json:"has_login"`
	HasS3Access        bool           `json:"has_s3_access"`
	CanCreateBuckets   bool           `json:"can_create_buckets"`
	NextPasswordChange int64          `json:"next_password_change"`
	DefaultPool        string         `json:"default_pool"`
	AccessKeys         []S3AccessKeys `json:"access_keys"`
	AllowedIPs         []struct {
		Start string `json:"start"`
		End   string `json:"end"`
	} `json:"allowed_ips"`
	ExternalConnections struct {
		Count       int                      `json:"count"`
		Connections []ExternalConnectionInfo `json:"connections"`
	} `json:"external_connections"`
	AllowedBuckets AllowedBuckets `json:"allowed_buckets"`
	Systems        []struct {
		Name  string   `json:"name"`
		Roles []string `json:"roles"`
	} `json:"systems"`
	Preferences struct {
		UITheme string `json:"ui_theme"`
	} `json:"preferences"`
}

AccountInfo is a struct of account info returned by the API

type AddExternalConnectionParams

type AddExternalConnectionParams struct {
	Name         string          `json:"name"`
	EndpointType EndpointType    `json:"endpoint_type"`
	Endpoint     string          `json:"endpoint"`
	Identity     string          `json:"identity"`
	Secret       string          `json:"secret"`
	AuthMethod   CloudAuthMethod `json:"auth_method,omitempty"`
}

AddExternalConnectionParams is the params of account_api.add_external_connection()

type AllowedBuckets

type AllowedBuckets struct {
	FullPermission bool     `json:"full_permission"`
	PermissionList []string `json:"permission_list"`
}

AllowedBuckets is a struct for setting which buckets an account can access

type BigInt added in v2.0.2

type BigInt struct {
	N    int64 `json:"n"`
	Peta int64 `json:"peta"`
}

BigInt is an api type to handle large integers that cannot be represented by JSON which is limited to 53 bits (less than 8 PB)

func (BigInt) MarshalJSON added in v2.0.3

func (n BigInt) MarshalJSON() ([]byte, error)

MarshalJSON is custom marshalling because the json schema is oneOf integer or {n,peta}

func (*BigInt) UnmarshalJSON added in v2.0.3

func (n *BigInt) UnmarshalJSON(data []byte) error

UnmarshalJSON is custom unmarshalling because the json schema is oneOf integer or {n,peta}

type BucketClaimInfo added in v2.0.2

type BucketClaimInfo struct {
	BucketClass string `json:"bucket_class,omitempty"`
	Namespace   string `json:"namespace,omitempty"`
}

BucketClaimInfo is the params of bucket_api.create_bucket()

type BucketInfo

type BucketInfo struct {
	Name        string             `json:"name"`
	BucketType  string             `json:"bucket_type"`
	Mode        string             `json:"mode"`
	Undeletable string             `json:"undeletable"`
	BucketClaim *BucketClaimInfo   `json:"bucket_claim,omitempty"`
	Tiering     *TieringPolicyInfo `json:"tiering,omitempty"`
}

BucketInfo is a struct of bucket info returned by the API

type CheckExternalConnectionReply

type CheckExternalConnectionReply struct {
	Status ExternalConnectionStatus `json:"status"`
	Error  struct {
		Code    string `json:"code"`
		Message string `json:"message"`
	} `json:"error,omitempty"`
}

CheckExternalConnectionReply is the reply of account_api.check_external_connection()

type ChunkCoderConfig

type ChunkCoderConfig struct {
	DigestType     *string `json:"digest_type,omitempty"`
	FragDigestType *string `json:"frag_digest_type,omitempty"`
	CompressType   *string `json:"compress_type,omitempty"`
	CipherType     *string `json:"cipher_type,omitempty"`
	// Data Copies:
	Replicas *int64 `json:"replicas,omitempty"`
	// Erasure Coding:
	DataFrags   *int64  `json:"data_frags,omitempty"`
	ParityFrags *int64  `json:"parity_frags,omitempty"`
	ParityType  *string `json:"parity_type,omitempty"`
	// LRC:
	LrcGroup *int64  `json:"lrc_group,omitempty"`
	LrcFrags *int64  `json:"lrc_frags,omitempty"`
	LrcType  *string `json:"lrc_type,omitempty"`
}

ChunkCoderConfig defines a storage coding configuration

type ChunkSplitConfig

type ChunkSplitConfig struct {
	AvgChunk   int64 `json:"avg_chunk"`
	DeltaChunk int64 `json:"delta_chunk"`
}

ChunkSplitConfig defines a storage chunking (splitting objects) configuration

type Client

type Client interface {
	SetAuthToken(token string)
	GetAuthToken() string

	ReadAuthAPI() (ReadAuthReply, error)
	ReadAccountAPI(ReadAccountParams) (AccountInfo, error)
	ReadSystemAPI() (SystemInfo, error)
	ReadBucketAPI(ReadBucketParams) (BucketInfo, error)

	ListAccountsAPI() (ListAccountsReply, error)
	ListBucketsAPI() (ListBucketsReply, error)

	CreateAuthAPI(CreateAuthParams) (CreateAuthReply, error)
	CreateSystemAPI(CreateSystemParams) (CreateSystemReply, error)
	CreateAccountAPI(CreateAccountParams) (CreateAccountReply, error)
	CreateBucketAPI(CreateBucketParams) error
	CreateHostsPoolAPI(CreateHostsPoolParams) error
	CreateCloudPoolAPI(CreateCloudPoolParams) error
	CreateTierAPI(CreateTierParams) error
	CreateTieringPolicyAPI(TieringPolicyInfo) error

	DeleteBucketAPI(DeleteBucketParams) error
	DeleteAccountAPI(DeleteAccountParams) error
	DeletePoolAPI(DeletePoolParams) error

	UpdateAccountS3Access(UpdateAccountS3AccessParams) error
	UpdateAllBucketsDefaultPool(UpdateDefaultPoolParams) error

	AddExternalConnectionAPI(AddExternalConnectionParams) error
	CheckExternalConnectionAPI(AddExternalConnectionParams) (CheckExternalConnectionReply, error)
	EditExternalConnectionCredentialsAPI(EditExternalConnectionCredentialsParams) error
	DeleteExternalConnectionAPI(DeleteExternalConnectionParams) error
}

Client is the interface providing typed noobaa API calls

func NewClient

func NewClient(router APIRouter) Client

NewClient initializes an RPCClient with defaults

type CloudAuthMethod

type CloudAuthMethod string

CloudAuthMethod is an enum

type CreateAccountParams

type CreateAccountParams struct {
	Name              string                `json:"name"`
	Email             string                `json:"email"`
	HasLogin          bool                  `json:"has_login"`
	S3Access          bool                  `json:"s3_access"`
	AllowBucketCreate bool                  `json:"allow_bucket_creation"`
	AllowedBuckets    AccountAllowedBuckets `json:"allowed_buckets"`
	DefaultPool       string                `json:"default_pool,omitempty"`
}

CreateAccountParams is the params of account_api.create_account()

type CreateAccountReply

type CreateAccountReply struct {
	Token      string         `json:"token"`
	AccessKeys []S3AccessKeys `json:"access_keys"`
}

CreateAccountReply is the reply of account_api.create_account()

type CreateAuthParams

type CreateAuthParams struct {
	System   string `json:"system"`
	Role     string `json:"role"`
	Email    string `json:"email"`
	Password string `json:"password"`
}

CreateAuthParams is the params of auth_api.create_auth()

type CreateAuthReply

type CreateAuthReply struct {
	Token string `json:"token"`
}

CreateAuthReply is the reply of auth_api.create_auth()

type CreateBucketParams

type CreateBucketParams struct {
	Name        string           `json:"name"`
	Tiering     string           `json:"tiering,omitempty"`
	BucketClaim *BucketClaimInfo `json:"bucket_claim,omitempty"`
}

CreateBucketParams is the params of bucket_api.create_bucket()

type CreateCloudPoolParams

type CreateCloudPoolParams struct {
	Name         string `json:"name"`
	Connection   string `json:"connection"`
	TargetBucket string `json:"target_bucket"`
}

CreateCloudPoolParams is the reply of pool_api.create_cloud_pool()

type CreateHostsPoolParams

type CreateHostsPoolParams struct {
	Name       string        `json:"name"`
	IsManaged  bool          `json:"is_managed"`
	HostCount  int           `json:"host_count"`
	HostConfig PoolHostsInfo `json:"host_config"`
}

CreateHostsPoolParams is the params of pool_api.create_hosts_pool()

type CreateSystemParams

type CreateSystemParams struct {
	Name     string `json:"name"`
	Email    string `json:"email"`
	Password string `json:"password"`
}

CreateSystemParams is the params of system_api.create_system()

type CreateSystemReply

type CreateSystemReply struct {
	Token         string `json:"token"`
	OperatorToken string `json:"operator_token"`
}

CreateSystemReply is the reply of system_api.create_system()

type CreateTierParams

type CreateTierParams struct {
	Name             string            `json:"name"`
	DataPlacement    string            `json:"data_placement,omitempty"`
	AttachedPools    []string          `json:"attached_pools,omitempty"`
	ChunkCoderConfig *ChunkCoderConfig `json:"chunk_coder_config,omitempty"`
}

CreateTierParams is the reply of tier_api.create_tier()

type DeleteAccountParams

type DeleteAccountParams struct {
	Email string `json:"email"`
}

DeleteAccountParams is the params of account_api.delete_account()

type DeleteBucketParams

type DeleteBucketParams struct {
	Name string `json:"name"`
}

DeleteBucketParams is the params of bucket_api.delete_bucket()

type DeleteExternalConnectionParams

type DeleteExternalConnectionParams struct {
	Name string `json:"connection_name"`
}

DeleteExternalConnectionParams is the params of account_api.delete_external_connection()

type DeletePoolParams

type DeletePoolParams struct {
	Name string `json:"name"`
}

DeletePoolParams is the params of pool_api.delete_pool()

type EditExternalConnectionCredentialsParams

type EditExternalConnectionCredentialsParams struct {
	Name     string `json:"name"`
	Identity string `json:"identity"`
	Secret   string `json:"secret"`
}

EditExternalConnectionCredentialsParams is the params of account_api.edit_external_connection_credentials()

type EndpointType

type EndpointType string

EndpointType is an enum

type ExternalConnectionInfo

type ExternalConnectionInfo struct {
	Name         string          `json:"name"`
	EndpointType EndpointType    `json:"endpoint_type"`
	Endpoint     string          `json:"endpoint"`
	Identity     string          `json:"identity"`
	AuthMethod   CloudAuthMethod `json:"auth_method,omitempty"`
	Usage        []struct {
		UsageType      string `json:"usage_type"`
		Entity         string `json:"entity"`
		ExternalEntity string `json:"external_entity"`
	} `json:"usage"`
}

ExternalConnectionInfo is a struct for reply with connection info

type ExternalConnectionStatus

type ExternalConnectionStatus string

ExternalConnectionStatus is an enum

type ListAccountsReply

type ListAccountsReply struct {
	Accounts []*AccountInfo `json:"accounts"`
}

ListAccountsReply is the reply to account_api.list_accounts()

type ListBucketsReply

type ListBucketsReply struct {
	Buckets []struct {
		Name string `json:"name"`
	} `json:"buckets"`
}

ListBucketsReply is the reply of bucket_api.list_buckets()

type PoolHostsInfo

type PoolHostsInfo struct {
	// TODO encode/decode BigInt
	VolumeSize int64 `json:"volume_size"`
}

PoolHostsInfo is the config/info of a hosts pool

type PoolInfo

type PoolInfo struct {
	Name         string `json:"name"`
	ResourceType string `json:"resource_type"`
	Mode         string `json:"mode,omitempty"`
	Region       string `json:"region,omitempty"`
	PoolNodeType string `json:"pool_node_type,omitempty"`
	Undeletable  string `json:"undeletable,omitempty"`
	CloudInfo    *struct {
		EndpointType EndpointType    `json:"endpoint_type,omitempty"`
		Endpoint     string          `json:"endpoint,omitempty"`
		TargetBucket string          `json:"target_bucket,omitempty"`
		Identity     string          `json:"identity,omitempty"`
		NodeName     string          `json:"node_name,omitempty"`
		CreatedBy    string          `json:"created_by,omitempty"`
		Host         string          `json:"host,omitempty"`
		AuthMethod   CloudAuthMethod `json:"auth_method,omitempty"`
	} `json:"cloud_info,omitempty"`
	MongoInfo *map[string]interface{} `json:"mongo_info,omitempty"`
	HostInfo  *PoolHostsInfo          `json:"host_info,omitempty"`
	Hosts     *struct {
		ConfiguredCount int64 `json:"configured_count"`
		Count           int64 `json:"count"`
	} `json:"hosts,omitempty"`
}

PoolInfo is a struct of pool info returned by the API

type RPCClient

type RPCClient struct {
	Router     APIRouter
	HTTPClient http.Client
	AuthToken  string
}

RPCClient makes API calls to noobaa. Requests to noobaa are plain http requests with json request and json response.

func (*RPCClient) AddExternalConnectionAPI

func (c *RPCClient) AddExternalConnectionAPI(params AddExternalConnectionParams) error

AddExternalConnectionAPI calls account_api.add_external_connection()

func (*RPCClient) Call

func (c *RPCClient) Call(req *RPCRequest, res RPCResponseIfc) error

Call an API method to noobaa. The response type should be defined to include RPCResponseIfc inline. This is needed in order for json.Unmarshal() to decode into the reply structure.

func (*RPCClient) CheckExternalConnectionAPI

func (c *RPCClient) CheckExternalConnectionAPI(params AddExternalConnectionParams) (CheckExternalConnectionReply, error)

CheckExternalConnectionAPI calls account_api.check_external_connection()

func (*RPCClient) CreateAccountAPI

func (c *RPCClient) CreateAccountAPI(params CreateAccountParams) (CreateAccountReply, error)

CreateAccountAPI calls account_api.create_account()

func (*RPCClient) CreateAuthAPI

func (c *RPCClient) CreateAuthAPI(params CreateAuthParams) (CreateAuthReply, error)

CreateAuthAPI calls auth_api.create_auth()

func (*RPCClient) CreateBucketAPI

func (c *RPCClient) CreateBucketAPI(params CreateBucketParams) error

CreateBucketAPI calls bucket_api.create_bucket()

func (*RPCClient) CreateCloudPoolAPI

func (c *RPCClient) CreateCloudPoolAPI(params CreateCloudPoolParams) error

CreateCloudPoolAPI calls pool_api.create_cloud_pool()

func (*RPCClient) CreateHostsPoolAPI

func (c *RPCClient) CreateHostsPoolAPI(params CreateHostsPoolParams) error

CreateHostsPoolAPI calls pool_api.create_hosts_pool()

func (*RPCClient) CreateSystemAPI

func (c *RPCClient) CreateSystemAPI(params CreateSystemParams) (CreateSystemReply, error)

CreateSystemAPI calls system_api.create_system()

func (*RPCClient) CreateTierAPI

func (c *RPCClient) CreateTierAPI(params CreateTierParams) error

CreateTierAPI calls tier_api.create_tier()

func (*RPCClient) CreateTieringPolicyAPI

func (c *RPCClient) CreateTieringPolicyAPI(params TieringPolicyInfo) error

CreateTieringPolicyAPI calls tiering_policy_api.create_policy()

func (*RPCClient) DeleteAccountAPI

func (c *RPCClient) DeleteAccountAPI(params DeleteAccountParams) error

DeleteAccountAPI calls account_api.delete_account()

func (*RPCClient) DeleteBucketAPI

func (c *RPCClient) DeleteBucketAPI(params DeleteBucketParams) error

DeleteBucketAPI calls bucket_api.delete_bucket()

func (*RPCClient) DeleteExternalConnectionAPI

func (c *RPCClient) DeleteExternalConnectionAPI(params DeleteExternalConnectionParams) error

DeleteExternalConnectionAPI calls account_api.delete_external_connection()

func (*RPCClient) DeletePoolAPI

func (c *RPCClient) DeletePoolAPI(params DeletePoolParams) error

DeletePoolAPI calls pool_api.delete_pool()

func (*RPCClient) EditExternalConnectionCredentialsAPI

func (c *RPCClient) EditExternalConnectionCredentialsAPI(params EditExternalConnectionCredentialsParams) error

EditExternalConnectionCredentialsAPI calls account_api.edit_external_connection_credentials()

func (*RPCClient) GetAuthToken

func (c *RPCClient) GetAuthToken() string

GetAuthToken is getting the client token for next calls

func (*RPCClient) ListAccountsAPI

func (c *RPCClient) ListAccountsAPI() (ListAccountsReply, error)

ListAccountsAPI calls account_api.list_accounts()

func (*RPCClient) ListBucketsAPI

func (c *RPCClient) ListBucketsAPI() (ListBucketsReply, error)

ListBucketsAPI calls bucket_api.list_buckets()

func (*RPCClient) ReadAccountAPI

func (c *RPCClient) ReadAccountAPI(params ReadAccountParams) (AccountInfo, error)

ReadAccountAPI calls account_api.read_account()

func (*RPCClient) ReadAuthAPI

func (c *RPCClient) ReadAuthAPI() (ReadAuthReply, error)

ReadAuthAPI calls auth_api.read_auth()

func (*RPCClient) ReadBucketAPI

func (c *RPCClient) ReadBucketAPI(params ReadBucketParams) (BucketInfo, error)

ReadBucketAPI calls bucket_api.read_bucket()

func (*RPCClient) ReadSystemAPI

func (c *RPCClient) ReadSystemAPI() (SystemInfo, error)

ReadSystemAPI calls system_api.read_system()

func (*RPCClient) SetAuthToken

func (c *RPCClient) SetAuthToken(token string)

SetAuthToken is setting the client token for next calls

func (*RPCClient) UpdateAccountS3Access

func (c *RPCClient) UpdateAccountS3Access(params UpdateAccountS3AccessParams) error

UpdateAccountS3Access calls account_api.update_account_s3_access()

func (*RPCClient) UpdateAllBucketsDefaultPool added in v2.0.2

func (c *RPCClient) UpdateAllBucketsDefaultPool(params UpdateDefaultPoolParams) error

UpdateAllBucketsDefaultPool calls bucket_api.update_all_buckets_default_pool()

type RPCError

type RPCError struct {
	RPCCode string `json:"rpc_code,omitempty"`
	Message string `json:"message"`
}

RPCError is a struct sent by noobaa servers to denote an error response.

func (*RPCError) Error

func (e *RPCError) Error() string

Error is implementing the standard error type interface

type RPCRequest

type RPCRequest struct {
	API       string      `json:"api"`
	Method    string      `json:"method"`
	AuthToken string      `json:"auth_token,omitempty"`
	Params    interface{} `json:"params,omitempty"`
}

RPCRequest is the structure encoded in every request

type RPCResponse

type RPCResponse struct {
	Op        string    `json:"op"`
	RequestID string    `json:"reqid"`
	Took      float64   `json:"took"`
	Error     *RPCError `json:"error,omitempty"`
}

RPCResponse is the structure encoded in every response Specific API response structures should include this inline, and add the standard Reply field with the specific fields. Refer to examples.

func (*RPCResponse) Response

func (r *RPCResponse) Response() *RPCResponse

Response is implementing the RPCResponseIfc interface

type RPCResponseIfc

type RPCResponseIfc interface {
	Response() *RPCResponse
}

RPCResponseIfc is the interface for response structs. RPCResponse is the only real implementor of it.

type ReadAccountParams

type ReadAccountParams struct {
	Email string `json:"email"`
}

ReadAccountParams is the params to account_api.read_account()

type ReadAuthReply

type ReadAuthReply struct {
	Account struct {
		Name               string `json:"name"`
		Email              string `json:"email"`
		IsSupport          bool   `json:"is_support"`
		MustChangePassword bool   `json:"must_change_password"`
	} `json:"account"`
	System struct {
		Name string `json:"name"`
	} `json:"system"`
	AuthorizedBy string                 `json:"authorized_by"`
	Role         string                 `json:"role"`
	Extra        map[string]interface{} `json:"extra"`
}

ReadAuthReply is the reply of auth_api.read_auth()

type ReadBucketParams

type ReadBucketParams struct {
	Name string `json:"name"`
}

ReadBucketParams is the params to bucket_api.read_bucket()

type S3AccessKeys

type S3AccessKeys struct {
	AccessKey string `json:"access_key"`
	SecretKey string `json:"secret_key"`
}

S3AccessKeys is a struct holding S3 access and secret keys

type StorageInfo added in v2.0.2

type StorageInfo struct {
	Total           *BigInt `json:"total,omitempty"`
	Free            *BigInt `json:"free,omitempty"`
	UnavailableFree *BigInt `json:"unavailable_free,omitempty"`
	UnavailableUsed *BigInt `json:"unavailable_used,omitempty"`
	Used            *BigInt `json:"used,omitempty"`
	UsedOther       *BigInt `json:"used_other,omitempty"`
	UsedReduced     *BigInt `json:"used_reduced,omitempty"`
	Alloc           *BigInt `json:"alloc,omitempty"`
	Limit           *BigInt `json:"limit,omitempty"`
	Reserved        *BigInt `json:"reserved,omitempty"`
	Real            *BigInt `json:"real,omitempty"`
}

StorageInfo contains storage capacity information with specific break down

type SystemInfo

type SystemInfo struct {
	Accounts []AccountInfo `json:"accounts"`
	Buckets  []BucketInfo  `json:"buckets"`
	Pools    []PoolInfo    `json:"pools"`
	Tiers    []TierInfo    `json:"tiers"`
	Version  string        `json:"version"`
}

SystemInfo is a struct of system info returned by the API

type TierInfo added in v2.0.2

type TierInfo struct {
	Name             string            `json:"name"`
	DataPlacement    string            `json:"data_placement,omitempty"`
	AttachedPools    []string          `json:"attached_pools,omitempty"`
	ChunkCoderConfig *ChunkCoderConfig `json:"chunk_coder_config,omitempty"`
	DataCapacity     *StorageInfo      `json:"data,omitempty"`
	StorageCapacity  *StorageInfo      `json:"storage,omitempty"`
}

TierInfo is the information of a tier

type TierItem

type TierItem struct {
	Order int64  `json:"order"`
	Tier  string `json:"tier"`
	Mode  string `json:"mode,omitempty"`
}

TierItem is an item in a tiering policy

type TieringPolicyInfo added in v2.0.2

type TieringPolicyInfo struct {
	Name             string            `json:"name"`
	Tiers            []TierItem        `json:"tiers"`
	ChunkSplitConfig *ChunkSplitConfig `json:"chunk_split_config,omitempty"`
	DataCapacity     *StorageInfo      `json:"data,omitempty"`
	StorageCapacity  *StorageInfo      `json:"storage,omitempty"`
}

TieringPolicyInfo is the information of a tiering policy

type UpdateAccountS3AccessParams

type UpdateAccountS3AccessParams struct {
	Email               string          `json:"email"`
	S3Access            bool            `json:"s3_access"`
	DefaultPool         *string         `json:"default_pool,omitempty"`
	AllowBucketCreation *bool           `json:"allow_bucket_creation,omitempty"`
	AllowBuckets        *AllowedBuckets `json:"allowed_buckets,omitempty"`
}

UpdateAccountS3AccessParams is the params of account_api.update_account_s3_access()

type UpdateDefaultPoolParams added in v2.0.2

type UpdateDefaultPoolParams struct {
	PoolName string `json:"pool_name"`
}

UpdateDefaultPoolParams is the params of bucket_api.update_all_buckets_default_pool()

Jump to

Keyboard shortcuts

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