Documentation
¶
Overview ¶
Package nb makes client API calls to noobaa servers.
Index ¶
- Constants
- func FindPortByName(srv *corev1.Service, portName string) *corev1.ServicePort
- func GetAPIPortName(api string) string
- type APIRouter
- type APIRouterNodePort
- type APIRouterPodPort
- type APIRouterServicePort
- type AccountAllowedBuckets
- type AccountInfo
- type AddExternalConnectionParams
- type AllowedBuckets
- type BucketInfo
- type CheckExternalConnectionReply
- type ChunkCoderConfig
- type ChunkSplitConfig
- type Client
- type CloudAuthMethod
- type CreateAccountParams
- type CreateAccountReply
- type CreateAuthParams
- type CreateAuthReply
- type CreateBucketParams
- type CreateCloudPoolParams
- type CreateHostsPoolParams
- type CreateSystemParams
- type CreateSystemReply
- type CreateTierParams
- type CreateTieringPolicyParams
- type DeleteAccountParams
- type DeleteBucketParams
- type DeleteExternalConnectionParams
- type DeletePoolParams
- type EditExternalConnectionCredentialsParams
- type EndpointType
- type ExternalConnectionInfo
- type ExternalConnectionStatus
- type ListAccountsReply
- type ListBucketsReply
- type PoolHostsInfo
- type PoolInfo
- type RPCClient
- func (c *RPCClient) AddExternalConnectionAPI(params AddExternalConnectionParams) error
- func (c *RPCClient) Call(req *RPCRequest, res RPCResponseIfc) error
- func (c *RPCClient) CheckExternalConnectionAPI(params AddExternalConnectionParams) (CheckExternalConnectionReply, error)
- func (c *RPCClient) CreateAccountAPI(params CreateAccountParams) (CreateAccountReply, error)
- func (c *RPCClient) CreateAuthAPI(params CreateAuthParams) (CreateAuthReply, error)
- func (c *RPCClient) CreateBucketAPI(params CreateBucketParams) error
- func (c *RPCClient) CreateCloudPoolAPI(params CreateCloudPoolParams) error
- func (c *RPCClient) CreateHostsPoolAPI(params CreateHostsPoolParams) error
- func (c *RPCClient) CreateSystemAPI(params CreateSystemParams) (CreateSystemReply, error)
- func (c *RPCClient) CreateTierAPI(params CreateTierParams) error
- func (c *RPCClient) CreateTieringPolicyAPI(params CreateTieringPolicyParams) error
- func (c *RPCClient) DeleteAccountAPI(params DeleteAccountParams) error
- func (c *RPCClient) DeleteBucketAPI(params DeleteBucketParams) error
- func (c *RPCClient) DeleteExternalConnectionAPI(params DeleteExternalConnectionParams) error
- func (c *RPCClient) DeletePoolAPI(params DeletePoolParams) error
- func (c *RPCClient) EditExternalConnectionCredentialsAPI(params EditExternalConnectionCredentialsParams) error
- func (c *RPCClient) GetAuthToken() string
- func (c *RPCClient) ListAccountsAPI() (ListAccountsReply, error)
- func (c *RPCClient) ListBucketsAPI() (ListBucketsReply, error)
- func (c *RPCClient) ReadAccountAPI(params ReadAccountParams) (AccountInfo, error)
- func (c *RPCClient) ReadAuthAPI() (ReadAuthReply, error)
- func (c *RPCClient) ReadBucketAPI(params ReadBucketParams) (BucketInfo, error)
- func (c *RPCClient) ReadSystemAPI() (SystemInfo, error)
- func (c *RPCClient) SetAuthToken(token string)
- func (c *RPCClient) UpdateAccountS3Access(params UpdateAccountS3AccessParams) error
- type RPCError
- type RPCRequest
- type RPCResponse
- type RPCResponseIfc
- type ReadAccountParams
- type ReadAuthReply
- type ReadBucketParams
- type S3AccessKeys
- type SystemInfo
- type TierItem
- type UpdateAccountS3AccessParams
Constants ¶
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 ¶
GetAPIPortName maps every noobaa api name to the service port name that serves it.
Types ¶
type APIRouter ¶
APIRouter should be able to map noobaa api names to actual addresses See implementations below: APIRouterNodePort, APIRouterPodPort, APIRouterServicePort
type APIRouterNodePort ¶
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 ¶
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 APIRouterServicePort ¶
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 ¶ added in v1.1.0
type AccountAllowedBuckets struct {
FullPermission bool `json:"full_permission"`
PermissionList []string `json:"permission_list"`
}
AccountAllowedBuckets is part of CreateAccountParams
type AccountInfo ¶ added in v1.1.0
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 ¶ added in v1.1.0
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 ¶ added in v1.1.0
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 BucketInfo ¶ added in v1.1.0
type BucketInfo struct {
Name string `json:"name"`
}
BucketInfo is a struct of bucket info returned by the API
type CheckExternalConnectionReply ¶ added in v1.1.0
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 ¶ added in v1.1.0
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 ¶ added in v1.1.0
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(CreateTieringPolicyParams) error
DeleteBucketAPI(DeleteBucketParams) error
DeleteAccountAPI(DeleteAccountParams) error
DeletePoolAPI(DeletePoolParams) error
UpdateAccountS3Access(UpdateAccountS3AccessParams) error
AddExternalConnectionAPI(AddExternalConnectionParams) error
CheckExternalConnectionAPI(AddExternalConnectionParams) (CheckExternalConnectionReply, error)
EditExternalConnectionCredentialsAPI(EditExternalConnectionCredentialsParams) error
DeleteExternalConnectionAPI(DeleteExternalConnectionParams) error
}
Client is the interface providing typed noobaa API calls
type CreateAccountParams ¶ added in v1.1.0
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 ¶ added in v1.1.0
type CreateAccountReply struct {
Token string `json:"token"`
AccessKeys []S3AccessKeys `json:"access_keys"`
}
CreateAccountReply is the reply of account_api.create_account()
type CreateAuthParams ¶ added in v1.0.0
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 ¶ added in v1.0.0
type CreateAuthReply struct {
Token string `json:"token"`
}
CreateAuthReply is the reply of auth_api.create_auth()
type CreateBucketParams ¶ added in v1.0.0
type CreateBucketParams struct {
Name string `json:"name"`
Tiering string `json:"tiering,omitempty"`
}
CreateBucketParams is the params of bucket_api.create_bucket()
type CreateCloudPoolParams ¶ added in v1.1.0
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 ¶ added in v1.1.0
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 ¶ added in v1.1.0
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 CreateTieringPolicyParams ¶ added in v1.1.0
type CreateTieringPolicyParams struct {
Name string `json:"name"`
Tiers []TierItem `json:"tiers"`
ChunkSplitConfig *ChunkSplitConfig `json:"chunk_split_config,omitempty"`
}
CreateTieringPolicyParams is the reply of tiering_policy_api.create_policy()
type DeleteAccountParams ¶ added in v1.1.0
type DeleteAccountParams struct {
Email string `json:"email"`
}
DeleteAccountParams is the params of account_api.delete_account()
type DeleteBucketParams ¶ added in v1.0.0
type DeleteBucketParams struct {
Name string `json:"name"`
}
DeleteBucketParams is the params of bucket_api.delete_bucket()
type DeleteExternalConnectionParams ¶ added in v1.1.0
type DeleteExternalConnectionParams struct {
Name string `json:"connection_name"`
}
DeleteExternalConnectionParams is the params of account_api.delete_external_connection()
type DeletePoolParams ¶ added in v1.1.0
type DeletePoolParams struct {
Name string `json:"name"`
}
DeletePoolParams is the params of pool_api.delete_pool()
type EditExternalConnectionCredentialsParams ¶ added in v1.1.0
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 ExternalConnectionInfo ¶ added in v1.1.0
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 ¶ added in v1.1.0
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 ¶ added in v1.0.0
type ListBucketsReply struct {
Buckets []struct {
Name string `json:"name"`
} `json:"buckets"`
}
ListBucketsReply is the reply of bucket_api.list_buckets()
type PoolHostsInfo ¶ added in v1.1.0
type PoolHostsInfo struct {
// TODO encode/decode BigInt
VolumeSize int64 `json:"volume_size"`
}
PoolHostsInfo is the config/info of a hosts pool
type PoolInfo ¶ added in v1.1.0
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 ¶
RPCClient makes API calls to noobaa. Requests to noobaa are plain http requests with json request and json response.
func (*RPCClient) AddExternalConnectionAPI ¶ added in v1.1.0
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 ¶ added in v1.1.0
func (c *RPCClient) CheckExternalConnectionAPI(params AddExternalConnectionParams) (CheckExternalConnectionReply, error)
CheckExternalConnectionAPI calls account_api.check_external_connection()
func (*RPCClient) CreateAccountAPI ¶ added in v1.1.0
func (c *RPCClient) CreateAccountAPI(params CreateAccountParams) (CreateAccountReply, error)
CreateAccountAPI calls account_api.create_account()
func (*RPCClient) CreateAuthAPI ¶ added in v1.0.0
func (c *RPCClient) CreateAuthAPI(params CreateAuthParams) (CreateAuthReply, error)
CreateAuthAPI calls auth_api.create_auth()
func (*RPCClient) CreateBucketAPI ¶ added in v1.0.0
func (c *RPCClient) CreateBucketAPI(params CreateBucketParams) error
CreateBucketAPI calls bucket_api.create_bucket()
func (*RPCClient) CreateCloudPoolAPI ¶ added in v1.1.0
func (c *RPCClient) CreateCloudPoolAPI(params CreateCloudPoolParams) error
CreateCloudPoolAPI calls pool_api.create_cloud_pool()
func (*RPCClient) CreateHostsPoolAPI ¶ added in v1.1.0
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 ¶ added in v1.1.0
func (c *RPCClient) CreateTierAPI(params CreateTierParams) error
CreateTierAPI calls tier_api.create_tier()
func (*RPCClient) CreateTieringPolicyAPI ¶ added in v1.1.0
func (c *RPCClient) CreateTieringPolicyAPI(params CreateTieringPolicyParams) error
CreateTieringPolicyAPI calls tiering_policy_api.create_policy()
func (*RPCClient) DeleteAccountAPI ¶ added in v1.1.0
func (c *RPCClient) DeleteAccountAPI(params DeleteAccountParams) error
DeleteAccountAPI calls account_api.delete_account()
func (*RPCClient) DeleteBucketAPI ¶ added in v1.0.0
func (c *RPCClient) DeleteBucketAPI(params DeleteBucketParams) error
DeleteBucketAPI calls bucket_api.delete_bucket()
func (*RPCClient) DeleteExternalConnectionAPI ¶ added in v1.1.0
func (c *RPCClient) DeleteExternalConnectionAPI(params DeleteExternalConnectionParams) error
DeleteExternalConnectionAPI calls account_api.delete_external_connection()
func (*RPCClient) DeletePoolAPI ¶ added in v1.1.0
func (c *RPCClient) DeletePoolAPI(params DeletePoolParams) error
DeletePoolAPI calls pool_api.delete_pool()
func (*RPCClient) EditExternalConnectionCredentialsAPI ¶ added in v1.1.0
func (c *RPCClient) EditExternalConnectionCredentialsAPI(params EditExternalConnectionCredentialsParams) error
EditExternalConnectionCredentialsAPI calls account_api.edit_external_connection_credentials()
func (*RPCClient) GetAuthToken ¶ added in v1.0.0
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 ¶ added in v1.0.0
func (c *RPCClient) ListBucketsAPI() (ListBucketsReply, error)
ListBucketsAPI calls bucket_api.list_buckets()
func (*RPCClient) ReadAccountAPI ¶ added in v1.1.0
func (c *RPCClient) ReadAccountAPI(params ReadAccountParams) (AccountInfo, error)
ReadAccountAPI calls account_api.read_account()
func (*RPCClient) ReadAuthAPI ¶ added in v1.0.0
func (c *RPCClient) ReadAuthAPI() (ReadAuthReply, error)
ReadAuthAPI calls auth_api.read_auth()
func (*RPCClient) ReadBucketAPI ¶ added in v1.2.0
func (c *RPCClient) ReadBucketAPI(params ReadBucketParams) (BucketInfo, error)
ReadBucketAPI calls bucket_api.read_bucket()
func (*RPCClient) ReadSystemAPI ¶ added in v1.1.0
func (c *RPCClient) ReadSystemAPI() (SystemInfo, error)
ReadSystemAPI calls system_api.read_system()
func (*RPCClient) SetAuthToken ¶
SetAuthToken is setting the client token for next calls
func (*RPCClient) UpdateAccountS3Access ¶ added in v1.1.0
func (c *RPCClient) UpdateAccountS3Access(params UpdateAccountS3AccessParams) error
UpdateAccountS3Access calls account_api.update_account_s3_access()
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 ¶ added in v1.1.0
type ReadAccountParams struct {
Email string `json:"email"`
}
ReadAccountParams is the params to account_api.read_account()
type ReadAuthReply ¶ added in v1.0.0
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 ¶ added in v1.2.0
type ReadBucketParams struct {
Name string `json:"name"`
}
ReadBucketParams is the params to bucket_api.read_bucket()
type S3AccessKeys ¶ added in v1.1.0
type S3AccessKeys struct {
AccessKey string `json:"access_key"`
SecretKey string `json:"secret_key"`
}
S3AccessKeys is a struct holding S3 access and secret keys
type SystemInfo ¶ added in v1.1.0
type SystemInfo struct {
Accounts []AccountInfo `json:"accounts"`
Buckets []BucketInfo `json:"buckets"`
Pools []PoolInfo `json:"pools"`
}
SystemInfo is a struct of system info returned by the API
type UpdateAccountS3AccessParams ¶ added in v1.1.0
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()