log_shipping_tokens

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2023 License: MIT Imports: 6 Imported by: 1

README

Log Shipping Tokens

Compatible with Logz.io's Manage Log Shipping Tokens API.

To create a new log shipping token:

client, _ := log_shipping_tokens.New(apiToken, apiServerAddress)
token, err := client.CreateLogShippingToken(log_shipping_tokens.CreateLogShippingToken{
                Name: "client_integration_test",
            })
function func name
create log shipping token func (c *LogShippingTokensClient) CreateLogShippingToken(token CreateLogShippingToken) (*LogShippingToken, error)
delete log shipping token func (c *LogShippingTokensClient) DeleteLogShippingToken(tokenId int32) error
get log shipping token func (c *LogShippingTokensClient) GetLogShippingToken(tokenId int32) (*LogShippingToken, error)
get available number of tokens func (c *LogShippingTokensClient) GetLogShippingLimitsToken() (*LogShippingTokensLimits, error)
retrieve tokens func (c *LogShippingTokensClient) RetrieveLogShippingTokens(retrieveRequest RetrieveLogShippingTokensRequest) (*RetrieveLogShippingTokensResponse, error)
update log shipping token func (c *LogShippingTokensClient) UpdateLogShippingToken(tokenId int32, token UpdateLogShippingToken) (*LogShippingToken, error)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateLogShippingToken

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

type FieldError

type FieldError struct {
	Field   string
	Message string
}

func (FieldError) Error

func (e FieldError) Error() string

type LogShippingToken

type LogShippingToken struct {
	Name      string  `json:"name"`
	Id        int32   `json:"id"`
	Token     string  `json:"token"`
	UpdatedAt float64 `json:"updatedAt"`
	UpdatedBy string  `json:"updatedBy"`
	CreatedAt float64 `json:"createdAt"`
	CreatedBy string  `json:"createdBy"`
	Enabled   bool    `json:"enabled"`
}

type LogShippingTokensClient

type LogShippingTokensClient struct {
	*client.Client
}

func New

func New(apiToken, baseUrl string) (*LogShippingTokensClient, error)

func (*LogShippingTokensClient) CreateLogShippingToken

func (c *LogShippingTokensClient) CreateLogShippingToken(token CreateLogShippingToken) (*LogShippingToken, error)

CreateLogShippingToken creates a log shipping token, returns the created token if successful, an error otherwise

func (*LogShippingTokensClient) DeleteLogShippingToken

func (c *LogShippingTokensClient) DeleteLogShippingToken(tokenId int32) error

DeleteLogShippingToken deletes a log shipping token, specified by its unique id, returns an error if a problem is encountered

func (*LogShippingTokensClient) GetLogShippingLimitsToken

func (c *LogShippingTokensClient) GetLogShippingLimitsToken() (*LogShippingTokensLimits, error)

GetLogShippingLimitsToken returns the number of log shipping tokens currently in use and the number of available tokens that can be enabled, error otherwise. Disabled tokens don't count against the token limit.

func (*LogShippingTokensClient) GetLogShippingToken

func (c *LogShippingTokensClient) GetLogShippingToken(tokenId int32) (*LogShippingToken, error)

GetLogShippingToken returns a log shipping token given its unique identifier, an error otherwise

func (*LogShippingTokensClient) RetrieveLogShippingTokens

func (c *LogShippingTokensClient) RetrieveLogShippingTokens(retrieveRequest RetrieveLogShippingTokensRequest) (*RetrieveLogShippingTokensResponse, error)

RetrieveLogShippingTokens returns the relevant shipping tokens, filtered, sorted and paginated as per the request, error otherwise

func (*LogShippingTokensClient) UpdateLogShippingToken

func (c *LogShippingTokensClient) UpdateLogShippingToken(tokenId int32, token UpdateLogShippingToken) (*LogShippingToken, error)

UpdateLogShippingToken updates an existing log shipping token, based on the supplied token identifier, using the parameters of the specified token Returns the updated token if successful, an error otherwise

type LogShippingTokensLimits

type LogShippingTokensLimits struct {
	MaxAllowedTokens   int32 `json:"maxAllowedTokens"`   // The number of log shipping tokens this account can have.
	NumOfEnabledTokens int32 `json:"numOfEnabledTokens"` // The number of log shipping tokens currently enabled for this account.
}

type RetrieveLogShippingTokensRequest

type RetrieveLogShippingTokensRequest struct {
	Filter     ShippingTokensFilterRequest     `json:"filter"`
	Sort       []ShippingTokensSortRequest     `json:"sort"`
	Pagination ShippingTokensPaginationRequest `json:"pagination,omitempty"`
}

type RetrieveLogShippingTokensResponse

type RetrieveLogShippingTokensResponse struct {
	Total      int32                           `json:"total"`
	Results    []LogShippingToken              `json:"results"`
	Pagination ShippingTokensPaginationRequest `json:"pagination"`
}

type ShippingTokensFilterRequest

type ShippingTokensFilterRequest struct {
	Enabled string `json:"enabled"`
}

type ShippingTokensPaginationRequest

type ShippingTokensPaginationRequest struct {
	PageNumber int32 `json:"pageNumber,omitempty"`
	PageSize   int32 `json:"pageSize,omitempty"`
}

type ShippingTokensSortRequest

type ShippingTokensSortRequest struct {
	Field      string `json:"field"`
	Descending string `json:"descending"`
}

type UpdateLogShippingToken

type UpdateLogShippingToken struct {
	Name    string `json:"name"`
	Enabled string `json:"enabled"`
}

Jump to

Keyboard shortcuts

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