cm

package
v0.0.0-...-8e95ba3 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package cm provides the client and types for making API requests to Cloud Monitor.

欢迎使用云服务器(Cloud Virtual Machine)

腾讯云服务器(Cloud Virtual Machine,以下又称CVM)运行在腾讯数据中心,它提供了可以弹性伸缩的计算服务,可以根据业务需要来构建和托管软件系统。

云服务器向用户提供弹性的计算、存储和网络资源。用户可以使用本文档介绍的 API,并参照相应的示例,对云服务器进行相关操作:如创建、销毁、更改带宽、重启等;支持的全部操作可参见API概览页 (https://cloud.tencent.com/document/api/213/569)。

See cm package documentation for more information. https://docs.aws.amazon.com/sdk-for-go/api/service/cm/

Using the Client

To contact Cloud Monitor with the SDK use the New function to create a new service client. With that client you can make API requests to the service. These clients are safe to use concurrently.

See the SDK's documentation for more information on how to use the SDK. https://docs.aws.amazon.com/sdk-for-go/api/

See sdf.Config documentation for more information on configuring SDK clients. https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config

See the Cloud Monitor client CM for more information on creating client for this service. https://docs.aws.amazon.com/sdk-for-go/api/service/cm/#New

Index

Constants

View Source
const (
	// RegionEnumApBeijing is a RegionEnum enum value
	RegionEnumApBeijing = "ap-beijing"

	// RegionEnumApChengdu is a RegionEnum enum value
	RegionEnumApChengdu = "ap-chengdu"

	// RegionEnumApGuangzhou is a RegionEnum enum value
	RegionEnumApGuangzhou = "ap-guangzhou"

	// RegionEnumApGuangzhouOpen is a RegionEnum enum value
	RegionEnumApGuangzhouOpen = "ap-guangzhou-open"

	// RegionEnumApHongkong is a RegionEnum enum value
	RegionEnumApHongkong = "ap-hongkong"

	// RegionEnumApShanghai is a RegionEnum enum value
	RegionEnumApShanghai = "ap-shanghai"

	// RegionEnumApSingapore is a RegionEnum enum value
	RegionEnumApSingapore = "ap-singapore"

	// RegionEnumEuFrankfurt is a RegionEnum enum value
	RegionEnumEuFrankfurt = "eu-frankfurt"

	// RegionEnumNaSiliconvalley is a RegionEnum enum value
	RegionEnumNaSiliconvalley = "na-siliconvalley"

	// RegionEnumNaToronto is a RegionEnum enum value
	RegionEnumNaToronto = "na-toronto"

	// RegionEnumApShanghaiFsi is a RegionEnum enum value
	RegionEnumApShanghaiFsi = "ap-shanghai-fsi"

	// RegionEnumApShenzhenFsi is a RegionEnum enum value
	RegionEnumApShenzhenFsi = "ap-shenzhen-fsi"
)
View Source
const (
	ServiceName = "monitor"   // Service endpoint prefix API calls made to.
	EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
)

Service information constants

Variables

This section is empty.

Functions

This section is empty.

Types

type CM

type CM struct {
	*client.Client
}

CM provides the API operation methods for making requests to Cloud Monitor. See this package's package overview docs for details on the service.

CM methods are safe to use concurrently. It is not safe to modify mutate any of the struct's properties though.

func New

func New(p client.ConfigProvider, cfgs ...*sdf.Config) *CM

New creates a new instance of the CM client with a session. If additional configuration is needed for the client instance use the optional sdf.Config parameter to add your extra config.

Example:

// Create a CM client from just a session.
svc := cm.New(mySession)

// Create a CM client with additional configuration
svc := cm.New(mySession, aws.NewConfig().WithRegion("us-west-2"))

func (*CM) DescribeBaseMetrics

func (c *CM) DescribeBaseMetrics(input *DescribeBaseMetricsInput) (*DescribeBaseMetricsOutput, error)

DescribeBaseMetrics API operation for Cloud Monitor.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Cloud Monitor's API operation DescribeBaseMetrics for usage and error information.

func (*CM) DescribeBaseMetricsRequest

func (c *CM) DescribeBaseMetricsRequest(input *DescribeBaseMetricsInput) (req *request.Request, output *DescribeBaseMetricsOutput)

DescribeBaseMetricsRequest generates a "aws/request.Request" representing the client's request for the DescribeBaseMetrics operation. The "output" return value will be populated with the request's response once the request completes successfuly.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DescribeBaseMetrics for more information on using the DescribeBaseMetrics API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DescribeBaseMetricsRequest method.
req, resp := client.DescribeBaseMetricsRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*CM) DescribeBaseMetricsWithContext

func (c *CM) DescribeBaseMetricsWithContext(ctx sdf.Context, input *DescribeBaseMetricsInput, opts ...request.Option) (*DescribeBaseMetricsOutput, error)

DescribeBaseMetricsWithContext is the same as DescribeBaseMetrics with the addition of the ability to pass a context and additional request options.

See DescribeBaseMetrics for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

func (*CM) GetMonitorData

func (c *CM) GetMonitorData(input *GetMonitorDataInput) (*GetMonitorDataOutput, error)

GetMonitorData API operation for Cloud Monitor.

本接口 (DescribeInstances) 用于查询一个或多个实例的详细信息。

接口请求域名:cvm.api.qcloud.com

  • 可以根据实例ID、实例名称或者实例计费模式等信息来查询实例的详细信息。过滤信息详细请见过滤器Filter。
  • 如果参数为空,返回当前用户一定数量(Limit所指定的数量,默认为20)的实例。

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Cloud Monitor's API operation GetMonitorData for usage and error information.

func (*CM) GetMonitorDataRequest

func (c *CM) GetMonitorDataRequest(input *GetMonitorDataInput) (req *request.Request, output *GetMonitorDataOutput)

GetMonitorDataRequest generates a "aws/request.Request" representing the client's request for the GetMonitorData operation. The "output" return value will be populated with the request's response once the request completes successfuly.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See GetMonitorData for more information on using the GetMonitorData API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the GetMonitorDataRequest method.
req, resp := client.GetMonitorDataRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*CM) GetMonitorDataWithContext

func (c *CM) GetMonitorDataWithContext(ctx sdf.Context, input *GetMonitorDataInput, opts ...request.Option) (*GetMonitorDataOutput, error)

GetMonitorDataWithContext is the same as GetMonitorData with the addition of the ability to pass a context and additional request options.

See GetMonitorData for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

type DescribeBaseMetricsInput

type DescribeBaseMetricsInput struct {
	MetricName *string `locationName:"metricName" type:"string"`

	// Namespace is a required field
	Namespace *string `locationName:"namespace" type:"string" required:"true"`

	Region *string `type:"string" enum:"RegionEnum"`
	// contains filtered or unexported fields
}

func (DescribeBaseMetricsInput) GoString

func (s DescribeBaseMetricsInput) GoString() string

GoString returns the string representation

func (*DescribeBaseMetricsInput) SetMetricName

SetMetricName sets the MetricName field's value.

func (*DescribeBaseMetricsInput) SetNamespace

SetNamespace sets the Namespace field's value.

func (*DescribeBaseMetricsInput) SetRegion

SetRegion sets the Region field's value.

func (DescribeBaseMetricsInput) String

func (s DescribeBaseMetricsInput) String() string

String returns the string representation

func (*DescribeBaseMetricsInput) Validate

func (s *DescribeBaseMetricsInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type DescribeBaseMetricsOutput

type DescribeBaseMetricsOutput struct {
	Code *int64 `locationName:"code" type:"integer"`

	CodeDesc *string `locationName:"codeDesc" type:"string"`

	Message *string `locationName:"message" type:"string"`

	MetricSet []*Metric `locationName:"metricSet" type:"list"`
	// contains filtered or unexported fields
}

func (DescribeBaseMetricsOutput) GoString

func (s DescribeBaseMetricsOutput) GoString() string

GoString returns the string representation

func (*DescribeBaseMetricsOutput) SetCode

SetCode sets the Code field's value.

func (*DescribeBaseMetricsOutput) SetCodeDesc

SetCodeDesc sets the CodeDesc field's value.

func (*DescribeBaseMetricsOutput) SetMessage

SetMessage sets the Message field's value.

func (*DescribeBaseMetricsOutput) SetMetricSet

SetMetricSet sets the MetricSet field's value.

func (DescribeBaseMetricsOutput) String

func (s DescribeBaseMetricsOutput) String() string

String returns the string representation

type DimensionsFilter

type DimensionsFilter struct {
	Name *string `locationName:"name" type:"string"`

	Values *string `locationName:"value" type:"string"`
	// contains filtered or unexported fields
}

func (DimensionsFilter) GoString

func (s DimensionsFilter) GoString() string

GoString returns the string representation

func (*DimensionsFilter) SetName

func (s *DimensionsFilter) SetName(v string) *DimensionsFilter

SetName sets the Name field's value.

func (*DimensionsFilter) SetValues

func (s *DimensionsFilter) SetValues(v string) *DimensionsFilter

SetValues sets the Values field's value.

func (DimensionsFilter) String

func (s DimensionsFilter) String() string

String returns the string representation

type GetMonitorDataInput

type GetMonitorDataInput struct {
	EndTime *string `locationName:"endTime" type:"string"`

	Filters []*DimensionsFilter `locationName:"dimensions" type:"list" flattened:"true"`

	MetricName *string `locationName:"metricName" type:"string"`

	Namespace *string `locationName:"namespace" type:"string"`

	Period *int64 `locationName:"period" type:"integer"`

	Region *string `type:"string" enum:"RegionEnum"`

	StartTime *string `locationName:"startTime" type:"string"`
	// contains filtered or unexported fields
}

func (GetMonitorDataInput) GoString

func (s GetMonitorDataInput) GoString() string

GoString returns the string representation

func (*GetMonitorDataInput) SetEndTime

SetEndTime sets the EndTime field's value.

func (*GetMonitorDataInput) SetFilters

SetFilters sets the Filters field's value.

func (*GetMonitorDataInput) SetMetricName

func (s *GetMonitorDataInput) SetMetricName(v string) *GetMonitorDataInput

SetMetricName sets the MetricName field's value.

func (*GetMonitorDataInput) SetNamespace

func (s *GetMonitorDataInput) SetNamespace(v string) *GetMonitorDataInput

SetNamespace sets the Namespace field's value.

func (*GetMonitorDataInput) SetPeriod

SetPeriod sets the Period field's value.

func (*GetMonitorDataInput) SetRegion

SetRegion sets the Region field's value.

func (*GetMonitorDataInput) SetStartTime

func (s *GetMonitorDataInput) SetStartTime(v string) *GetMonitorDataInput

SetStartTime sets the StartTime field's value.

func (GetMonitorDataInput) String

func (s GetMonitorDataInput) String() string

String returns the string representation

type GetMonitorDataOutput

type GetMonitorDataOutput struct {
	Code *int64 `locationName:"code" type:"integer"`

	CodeDesc *string `locationName:"codeDesc" type:"string"`

	DataPoints []*float64 `locationName:"dataPoints" type:"list"`

	EndTime *string `locationName:"endTime" type:"string"`

	Message *string `locationName:"message" type:"string"`

	MetricName *string `locationName:"metricName" type:"string"`

	Period *int64 `locationName:"period" type:"integer"`

	StartTime *string `locationName:"startTime" type:"string"`
	// contains filtered or unexported fields
}

func (GetMonitorDataOutput) GoString

func (s GetMonitorDataOutput) GoString() string

GoString returns the string representation

func (*GetMonitorDataOutput) SetCode

SetCode sets the Code field's value.

func (*GetMonitorDataOutput) SetCodeDesc

SetCodeDesc sets the CodeDesc field's value.

func (*GetMonitorDataOutput) SetDataPoints

func (s *GetMonitorDataOutput) SetDataPoints(v []*float64) *GetMonitorDataOutput

SetDataPoints sets the DataPoints field's value.

func (*GetMonitorDataOutput) SetEndTime

SetEndTime sets the EndTime field's value.

func (*GetMonitorDataOutput) SetMessage

SetMessage sets the Message field's value.

func (*GetMonitorDataOutput) SetMetricName

func (s *GetMonitorDataOutput) SetMetricName(v string) *GetMonitorDataOutput

SetMetricName sets the MetricName field's value.

func (*GetMonitorDataOutput) SetPeriod

SetPeriod sets the Period field's value.

func (*GetMonitorDataOutput) SetStartTime

func (s *GetMonitorDataOutput) SetStartTime(v string) *GetMonitorDataOutput

SetStartTime sets the StartTime field's value.

func (GetMonitorDataOutput) String

func (s GetMonitorDataOutput) String() string

String returns the string representation

type Metric

type Metric struct {
	Dimensions *string `locationName:"dimensions" type:"string"`

	MetricCName *string `locationName:"metricCname" type:"string"`

	MetricName *string `locationName:"metricName" type:"string"`

	Namespace *string `locationName:"namespace" type:"string"`

	Period []*int64 `locationName:"period" type:"list"`

	Unit *string `locationName:"unit" type:"string"`

	UnitCname *string `locationName:"unitCname" type:"string"`
	// contains filtered or unexported fields
}

func (Metric) GoString

func (s Metric) GoString() string

GoString returns the string representation

func (*Metric) SetDimensions

func (s *Metric) SetDimensions(v string) *Metric

SetDimensions sets the Dimensions field's value.

func (*Metric) SetMetricCName

func (s *Metric) SetMetricCName(v string) *Metric

SetMetricCName sets the MetricCName field's value.

func (*Metric) SetMetricName

func (s *Metric) SetMetricName(v string) *Metric

SetMetricName sets the MetricName field's value.

func (*Metric) SetNamespace

func (s *Metric) SetNamespace(v string) *Metric

SetNamespace sets the Namespace field's value.

func (*Metric) SetPeriod

func (s *Metric) SetPeriod(v []*int64) *Metric

SetPeriod sets the Period field's value.

func (*Metric) SetUnit

func (s *Metric) SetUnit(v string) *Metric

SetUnit sets the Unit field's value.

func (*Metric) SetUnitCname

func (s *Metric) SetUnitCname(v string) *Metric

SetUnitCname sets the UnitCname field's value.

func (Metric) String

func (s Metric) String() string

String returns the string representation

Directories

Path Synopsis
Package cmiface provides an interface to enable mocking the Cloud Monitor service client for testing your code.
Package cmiface provides an interface to enable mocking the Cloud Monitor service client for testing your code.

Jump to

Keyboard shortcuts

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