aliyun

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var OpenAPILatency = prometheus.NewHistogramVec(
	prometheus.HistogramOpts{
		Name:    "aliyun_openapi_latency",
		Help:    "aliyun openapi latency in ms",
		Buckets: []float64{50, 100, 200, 400, 800, 1600, 3200, 6400, 12800, 13800, 14800, 16800, 20800, 28800, 44800},
	},
	[]string{"api", "error"},
)

Functions

func MsSince

func MsSince(start time.Time) float64

MsSince returns milliseconds since start.

func RegionFromContext

func RegionFromContext(ctx context.Context) string

func RegisterPrometheus

func RegisterPrometheus()

RegisterPrometheus register metrics to prometheus server

func WithRegion

func WithRegion(ctx context.Context, region string) context.Context

Types

type ClientInterface

type ClientInterface interface {
	VPC() *vpc.Client
	ECS() *ecs.Client
	CS() *cs.Client
}

func NewSimpleClient

func NewSimpleClient() (ClientInterface, error)

type Cluster

type Cluster struct {
	Name                   string    `json:"name"`
	ClusterID              string    `json:"cluster_id"`
	RegionID               string    `json:"region_id"`
	Size                   int       `json:"size"`
	State                  string    `json:"state"`
	ClusterType            string    `json:"cluster_type"`
	Created                time.Time `json:"created"`
	Updated                time.Time `json:"updated"`
	CurrentVersion         string    `json:"current_version"`
	ResourceGroupID        string    `json:"resource_group_id"`
	VPCID                  string    `json:"vpc_id"`
	VSwitchID              string    `json:"vswitch_id"`
	SecurityGroupID        string    `json:"security_group_id"`
	ZoneID                 string    `json:"zone_id"`
	ExternalLoadbalancerID string    `json:"external_loadbalancer_id"`
}

type Clusters

type Clusters struct {
	Clusters []Cluster `json:"clusters,omitempty"`
	PageInfo PageInfo  `json:"page_info"`
}

type DescribeClusterUserKubeconfigResp

type DescribeClusterUserKubeconfigResp struct {
	Config string `json:"config"`
}

type OpenAPI

type OpenAPI struct {
	ReadOnlyRateLimiter flowcontrol.RateLimiter
	// contains filtered or unexported fields
}

func NewOpenAPI

func NewOpenAPI() (*OpenAPI, error)

func (*OpenAPI) DescribeClusterDetail

func (a *OpenAPI) DescribeClusterDetail(ctx context.Context, clusterID string) (*Cluster, error)

func (*OpenAPI) DescribeClusterUserKubeconfig

func (a *OpenAPI) DescribeClusterUserKubeconfig(ctx context.Context, clusterID string, privateAddr bool) ([]byte, error)

func (*OpenAPI) DescribeClustersV1Request

func (a *OpenAPI) DescribeClustersV1Request(ctx context.Context) ([]Cluster, error)

func (*OpenAPI) DescribeInstances

func (a *OpenAPI) DescribeInstances(ctx context.Context, vpcID string) ([]ecs.Instance, error)

func (*OpenAPI) DescribeNetworkInterface

func (a *OpenAPI) DescribeNetworkInterface(ctx context.Context, networkInterfaceID, nicType string) ([]ecs.NetworkInterfaceSet, error)

func (*OpenAPI) DescribeVSwitches

func (a *OpenAPI) DescribeVSwitches(ctx context.Context, vpcID string) ([]vpc.VSwitch, error)

type PageInfo

type PageInfo struct {
	TotalCount int `json:"total_count"`
	PageNumber int `json:"page_number"`
	PageSize   int `json:"page_size"`
}

type SimpleClient

type SimpleClient struct {
	// contains filtered or unexported fields
}

func (*SimpleClient) CS

func (c *SimpleClient) CS() *cs.Client

func (*SimpleClient) ECS

func (c *SimpleClient) ECS() *ecs.Client

func (*SimpleClient) VPC

func (c *SimpleClient) VPC() *vpc.Client

Jump to

Keyboard shortcuts

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