bcm

package
v0.9.159 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// GetMetricDataPath userId - scope - metricName
	GetMetricDataPath = "/json-api/v1/metricdata/%s/%s/%s"
	// BatchMetricDataPath userId - scope
	BatchMetricDataPath = "/json-api/v1/metricdata/metricName/%s/%s"

	Average     = "average"
	Maximum     = "maximum"
	Minimum     = "minimum"
	Sum         = "sum"
	SampleCount = "sampleCount"
)
View Source
const (
	ProductName        = "bcm"
	DefaultBcmEndpoint = ProductName + "." + bce.DEFAULT_REGION + "." + bce.DEFAULT_DOMAIN
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchGetMetricDataRequest

type BatchGetMetricDataRequest struct {
	UserId         string            `json:"userId,omitempty"`
	Scope          string            `json:"scope,omitempty"`
	MetricNames    []string          `json:"metricNames,omitempty"`
	Dimensions     map[string]string `json:"dimensions,omitempty"`
	Statistics     []string          `json:"statistics,omitempty"`
	StartTime      string            `json:"startTime,omitempty"`
	EndTime        string            `json:"endTime,omitempty"`
	PeriodInSecond int               `json:"periodInSecond,omitempty"`
}

type BatchGetMetricDataResponse

type BatchGetMetricDataResponse struct {
	RequestId   string                       `json:"requestId,omitempty"`
	Code        string                       `json:"code,omitempty"`
	Message     string                       `json:"message,omitempty"`
	SuccessList []*SuccessBatchGetMetricData `json:"successList,omitempty"`
	ErrorList   []*ErrorBatchGetMetricData   `json:"errorList,omitempty"`
}

type Client

type Client struct {
	*bce.BceClient
}

Client of BCM service is a kind of BceClient, so derived from BceClient

func NewClient

func NewClient(ak, sk, endpoint string) (*Client, error)

NewClient make the bcm service client with default configuration. Use `cli.Config.xxx` to access the config or change it to non-default value.

func (*Client) BatchGetMetricData

func (c *Client) BatchGetMetricData(req *BatchGetMetricDataRequest) (*BatchGetMetricDataResponse, error)

BatchGetMetricData batch get metric data

func (*Client) GetMetricData

func (c *Client) GetMetricData(req *GetMetricDataRequest) (*GetMetricDataResponse, error)

GetMetricData get metric data

type DataPoints

type DataPoints struct {
	Average     float64 `json:"average,omitempty"`
	Sum         float64 `json:"sum,omitempty"`
	Minimum     float64 `json:"minimum,omitempty"`
	Maximum     float64 `json:"maximum,omitempty"`
	SampleCount int64   `json:"sampleCount,omitempty"`
	Timestamp   string  `json:"timestamp,omitempty"`
}

type Dimension

type Dimension struct {
	Name  string `json:"name,omitempty"`
	Value string `json:"value,omitempty"`
}

type ErrorBatchGetMetricData

type ErrorBatchGetMetricData struct {
	MetricName string       `json:"metricName,omitempty"`
	Dimensions []*Dimension `json:"dimensions,omitempty"`
	Message    string       `json:"message,omitempty"`
}

type GetMetricDataRequest

type GetMetricDataRequest struct {
	UserId         string            `json:"userId,omitempty"`
	Scope          string            `json:"scope,omitempty"`
	MetricName     string            `json:"metricName,omitempty"`
	Dimensions     map[string]string `json:"dimensions,omitempty"`
	Statistics     []string          `json:"statistics,omitempty"`
	StartTime      string            `json:"startTime,omitempty"`
	EndTime        string            `json:"endTime,omitempty"`
	PeriodInSecond int               `json:"periodInSecond,omitempty"`
}

type GetMetricDataResponse

type GetMetricDataResponse struct {
	RequestId  string        `json:"requestId,omitempty"`
	Code       string        `json:"code,omitempty"`
	Message    string        `json:"message,omitempty"`
	DataPoints []*DataPoints `json:"dataPoints,omitempty"`
}

type SuccessBatchGetMetricData

type SuccessBatchGetMetricData struct {
	MetricName string        `json:"metricName,omitempty"`
	Dimensions []*Dimension  `json:"dimensions,omitempty"`
	DataPoints []*DataPoints `json:"dataPoints,omitempty"`
}

Jump to

Keyboard shortcuts

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