Documentation ¶
Index ¶
- Variables
- func GenerateIndexObservation(index *sdk.Index) v1alpha1.LogstoreIndexObservation
- func GenerateLogtailObservation(config *sdk.LogConfig) v1alpha1.LogtailObservation
- func GenerateMachineGroupBindingObservation(configs []string) v1alpha1.MachineGroupBindingObservation
- func GenerateMachineGroupObservation(machineGroup *sdk.MachineGroup) v1alpha1.MachineGroupObservation
- func GenerateObservation(project *sdk.LogProject) v1alpha1.ProjectObservation
- func GenerateStoreObservation(store *sdk.LogStore) v1alpha1.StoreObservation
- func IsIndexNotFoundError(err error) bool
- func IsIndexUpdateToDate(cr *v1alpha1.LogstoreIndex, index *sdk.Index) bool
- func IsLogtailNotFoundError(err error) bool
- func IsLogtailUpdateToDate(cr *v1alpha1.Logtail, config *sdk.LogConfig) bool
- func IsMachineGroupNotFoundError(err error) bool
- func IsMachineGroupUpdateToDate(cr *v1alpha1.MachineGroup, machineGroup *sdk.MachineGroup) bool
- func IsNotFoundError(err error) bool
- func IsStoreNotFoundError(err error) bool
- func IsStoreUpdateToDate(cr *v1alpha1.LogStore, store *sdk.LogStore) bool
- type LogClient
- func (c *LogClient) ApplyConfigToMachineGroup(projectName, groupName, confName *string) error
- func (c *LogClient) Create(name, description string) (*sdk.LogProject, error)
- func (c *LogClient) CreateConfig(name string, t v1alpha1.LogtailParameters) error
- func (c *LogClient) CreateIndex(param v1alpha1.LogstoreIndexParameters) error
- func (c *LogClient) CreateMachineGroup(name string, param v1alpha1.MachineGroupParameters) error
- func (c *LogClient) CreateStore(project string, logstore *sdk.LogStore) error
- func (c *LogClient) Delete(name string) error
- func (c *LogClient) DeleteConfig(project string, config string) error
- func (c *LogClient) DeleteIndex(project, logstore *string) error
- func (c *LogClient) DeleteMachineGroup(project *string, machineGroup string) error
- func (c *LogClient) DeleteStore(project string, logstore string) error
- func (c *LogClient) Describe(name string) (*sdk.LogProject, error)
- func (c *LogClient) DescribeConfig(project string, config string) (*sdk.LogConfig, error)
- func (c *LogClient) DescribeIndex(project, logstore *string) (*sdk.Index, error)
- func (c *LogClient) DescribeMachineGroup(project *string, name string) (*sdk.MachineGroup, error)
- func (c *LogClient) DescribeStore(project string, logstore string) (*sdk.LogStore, error)
- func (c *LogClient) GetAppliedConfigs(projectName *string, groupName *string) ([]string, error)
- func (c *LogClient) RemoveConfigFromMachineGroup(projectName, groupName, confName *string) error
- func (c *LogClient) Update(name, description string) (*sdk.LogProject, error)
- func (c *LogClient) UpdateConfig(project string, config *sdk.LogConfig) error
- func (c *LogClient) UpdateIndex(project, logstore *string, index *sdk.Index) error
- func (c *LogClient) UpdateMachineGroup(project, logstore *string, machineGroup *sdk.MachineGroup) error
- func (c *LogClient) UpdateStore(project string, logstore string, ttl int) error
- type LogClientInterface
Constants ¶
This section is empty.
Variables ¶
var ( // ErrCodeLogstoreIndexNotExist is the error code when Logstore index doesn't exist ErrCodeLogstoreIndexNotExist = "IndexConfigNotExist" // ErrCreateIndex is the error when failed to create the resource ErrCreateIndex = "failed to create a Logstore index" // ErrDeleteIndex is the error when failed to delete the resource ErrDeleteIndex = "failed to delete the Logstore index" )
var ( // ErrCodeMachineGroupNotExist is the error code when Logtail MachineGroup doesn't exist ErrCodeMachineGroupNotExist = "MachineGroupNotExist" // ErrCreateMachineGroup is the error when failed to create the resource ErrCreateMachineGroup = "failed to create a Logtail MachineGroup" // ErrDeleteMachineGroup is the error when failed to delete the resource ErrDeleteMachineGroup = "failed to delete the Logtail MachineGroup" // ErrGetAppliedConfigs is the error when getting configs from a machine group ErrGetAppliedConfigs = "failed to get applied configs from a machine group" // ErrApplyConfigToMachineGroup is the error when applying a config to a machine group ErrApplyConfigToMachineGroup = "failed to apply a config to a machine group" // ErrRemoveConfigFromMachineGroup is the error when removing a config from a machine group ErrRemoveConfigFromMachineGroup = "failed to remove a config from a machine group" )
var ( // ErrCodeProjectNotExist error code of ServerError when Project not found ErrCodeProjectNotExist = "ProjectNotExist" // ErrFailedToGetSLSProject is the error of failing to get an SLS project ErrFailedToGetSLSProject = "FailedToGetSLSProject" // ErrFailedToCreateSLSProject is the error of failing to create an SLS project ErrFailedToCreateSLSProject = "FailedToCreateSLSProject" // ErrFailedToUpdateSLSProject is the error of failing to update an SLS project ErrFailedToUpdateSLSProject = "FailedToUpdateSLSProject" // ErrFailedToDeleteSLSProject is the error of failing to delete an SLS project ErrFailedToDeleteSLSProject = "FailedToDeleteSLSProject" // ErrCodeStoreNotExist error code of ServerError when LogStore not found ErrCodeStoreNotExist = "LogStoreNotExist" // ErrFailedToGetSLSStore is the error of failing to get an SLS store ErrFailedToGetSLSStore = "FailedToGetSLSStore" // ErrFailedToCreateSLSStore is the error of failing to create an SLS store ErrFailedToCreateSLSStore = "FailedToCreateSLSStore" // ErrFailedToUpdateSLSStore is the error of failing to update an SLS store ErrFailedToUpdateSLSStore = "FailedToUpdateSLSStore" // ErrFailedToDeleteSLSStore is the error of failing to delete an SLS store ErrFailedToDeleteSLSStore = "FailedToDeleteSLSStore" // ErrCodeLogtailNotExist is the error code when Logtail doesn't exist ErrCodeLogtailNotExist = "ConfigNotExist" )
Functions ¶
func GenerateIndexObservation ¶
func GenerateIndexObservation(index *sdk.Index) v1alpha1.LogstoreIndexObservation
GenerateIndexObservation is used to produce v1alpha1.LogstoreObservation
func GenerateLogtailObservation ¶
func GenerateLogtailObservation(config *sdk.LogConfig) v1alpha1.LogtailObservation
GenerateLogtailObservation is used to produce v1alpha1.LogtailObservation
func GenerateMachineGroupBindingObservation ¶
func GenerateMachineGroupBindingObservation(configs []string) v1alpha1.MachineGroupBindingObservation
GenerateMachineGroupBindingObservation is used to produce observation message
func GenerateMachineGroupObservation ¶
func GenerateMachineGroupObservation(machineGroup *sdk.MachineGroup) v1alpha1.MachineGroupObservation
GenerateMachineGroupObservation is used to produce observation information
func GenerateObservation ¶
func GenerateObservation(project *sdk.LogProject) v1alpha1.ProjectObservation
GenerateObservation is used to produce v1alpha1.ProjectObservation
func GenerateStoreObservation ¶
func GenerateStoreObservation(store *sdk.LogStore) v1alpha1.StoreObservation
GenerateStoreObservation is used to produce v1alpha1.StoreObservation
func IsIndexNotFoundError ¶
IsIndexNotFoundError is helper function to test whether SLS Logstore index cloud not be found
func IsIndexUpdateToDate ¶
func IsIndexUpdateToDate(cr *v1alpha1.LogstoreIndex, index *sdk.Index) bool
IsIndexUpdateToDate checks whether cr is up to date
func IsLogtailNotFoundError ¶
IsLogtailNotFoundError helper function to test for SLS Logtail not found error
func IsLogtailUpdateToDate ¶
IsLogtailUpdateToDate checks whether cr is up to date
func IsMachineGroupNotFoundError ¶
IsMachineGroupNotFoundError is helper function to test whether SLS Logtail MachineGroup cloud not be found
func IsMachineGroupUpdateToDate ¶
func IsMachineGroupUpdateToDate(cr *v1alpha1.MachineGroup, machineGroup *sdk.MachineGroup) bool
IsMachineGroupUpdateToDate checks whether cr is up to date
func IsNotFoundError ¶
IsNotFoundError helper function to test for SLS project not found error
func IsStoreNotFoundError ¶
IsStoreNotFoundError helper function to test for SLS Store not found error
Types ¶
type LogClient ¶
type LogClient struct {
Client sdk.ClientInterface
}
LogClient is the SDK client of SLS
func (*LogClient) ApplyConfigToMachineGroup ¶
ApplyConfigToMachineGroup applied a config to a machine group
func (*LogClient) Create ¶
func (c *LogClient) Create(name, description string) (*sdk.LogProject, error)
Create creates SLS project
func (*LogClient) CreateConfig ¶
func (c *LogClient) CreateConfig(name string, t v1alpha1.LogtailParameters) error
CreateConfig creates SLS Logtail config
func (*LogClient) CreateIndex ¶
func (c *LogClient) CreateIndex(param v1alpha1.LogstoreIndexParameters) error
CreateIndex creates SLS Logstore index
func (*LogClient) CreateMachineGroup ¶
func (c *LogClient) CreateMachineGroup(name string, param v1alpha1.MachineGroupParameters) error
CreateMachineGroup creates SLS Logtail MachineGroup
func (*LogClient) CreateStore ¶
CreateStore creates SLS store
func (*LogClient) DeleteConfig ¶
DeleteConfig deletes SLS Logtail config
func (*LogClient) DeleteIndex ¶
DeleteIndex deletes SLS Logstore index
func (*LogClient) DeleteMachineGroup ¶
DeleteMachineGroup deletes SLS Logtail MachineGroup
func (*LogClient) DeleteStore ¶
DeleteStore deletes SLS store
func (*LogClient) Describe ¶
func (c *LogClient) Describe(name string) (*sdk.LogProject, error)
Describe describes SLS project
func (*LogClient) DescribeConfig ¶
DescribeConfig describes SLS Logtail config
func (*LogClient) DescribeIndex ¶
DescribeIndex describes SLS Logstore index
func (*LogClient) DescribeMachineGroup ¶
DescribeMachineGroup describes SLS Logtail MachineGroup
func (*LogClient) DescribeStore ¶
DescribeStore describes SLS store
func (*LogClient) GetAppliedConfigs ¶
GetAppliedConfigs gets applied configs to a machine group
func (*LogClient) RemoveConfigFromMachineGroup ¶
RemoveConfigFromMachineGroup remove a config from a machine group
func (*LogClient) Update ¶
func (c *LogClient) Update(name, description string) (*sdk.LogProject, error)
Update updates SLS project's description
func (*LogClient) UpdateConfig ¶
UpdateConfig updates SLS Logtail config's description
func (*LogClient) UpdateIndex ¶
UpdateIndex updates SLS Logstore index
func (*LogClient) UpdateMachineGroup ¶
func (c *LogClient) UpdateMachineGroup(project, logstore *string, machineGroup *sdk.MachineGroup) error
UpdateMachineGroup updates SLS Logtail MachineGroup
type LogClientInterface ¶
type LogClientInterface interface { Describe(name string) (*sdk.LogProject, error) Create(name, description string) (*sdk.LogProject, error) Update(name, description string) (*sdk.LogProject, error) Delete(name string) error DescribeStore(project string, logstore string) (*sdk.LogStore, error) CreateStore(project string, store *sdk.LogStore) error UpdateStore(project string, logstore string, ttl int) error DeleteStore(project string, logstore string) error DescribeConfig(project string, config string) (*sdk.LogConfig, error) CreateConfig(name string, config v1alpha1.LogtailParameters) error UpdateConfig(project string, config *sdk.LogConfig) error DeleteConfig(project string, config string) error DescribeIndex(project, logstore *string) (*sdk.Index, error) CreateIndex(param v1alpha1.LogstoreIndexParameters) error UpdateIndex(project, logstore *string, index *sdk.Index) error DeleteIndex(project, logstore *string) error DescribeMachineGroup(project *string, name string) (*sdk.MachineGroup, error) CreateMachineGroup(name string, param v1alpha1.MachineGroupParameters) error UpdateMachineGroup(project, logstore *string, machineGroup *sdk.MachineGroup) error DeleteMachineGroup(project *string, logstore string) error GetAppliedConfigs(projectName *string, groupName *string) ([]string, error) ApplyConfigToMachineGroup(projectName, groupName, confName *string) error RemoveConfigFromMachineGroup(projectName, groupName, confName *string) error }
LogClientInterface is the Log client interface