alicloud

package
v0.0.0-...-61f8e7f Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Copyright © 2019 Allan Hung <hung.allan@gmail.com>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddInstanceTags

func AddInstanceTags(aliClient *AliClient, ecsInstance ecs.Instance, ecsTags []ecs.AddTagsTag) error

func QueryECS

func QueryECS(aliClient *AliClient, queryFlags QueryFlags) ([]ecs.Instance, error)

func QueryVpc

func QueryVpc(aliClient *AliClient, pageSize int) ([]ecs.Vpc, error)

Types

type AliClient

type AliClient struct {
	RegionID  string
	EcsClient ecs.Client
	// contains filtered or unexported fields
}

func NewAliClient

func NewAliClient(cfg *AliCloudConfig) (*AliClient, error)

type AliCloudConfig

type AliCloudConfig struct {
	RegionID        string    `json:"regionId" yaml:"regionId"`
	AccessKeyID     string    `json:"accessKeyId" yaml:"accessKeyId"`
	AccessKeySecret string    `json:"accessKeySecret" yaml:"accessKeySecret"`
	VPCID           string    `json:"vpcId" yaml:"vpcId"`
	RoleName        string    `json:"-" yaml:"-"` // For ECS RAM role only
	StsToken        string    `json:"-" yaml:"-"`
	ExpireTime      time.Time `json:"-" yaml:"-"`
}

func (*AliCloudConfig) GetCloudConfig

func (a *AliCloudConfig) GetCloudConfig() error

type QueryFlags

type QueryFlags struct {
	InstanceId   string
	InstanceName string
	PageSize     int
	Tag          types.ArgList
	RegName      types.ArgList
	NoTagKey     types.ArgList
	NoTagValue   types.ArgList
	Cron         string
}

Jump to

Keyboard shortcuts

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