alicloud

package
v0.8.6 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2017 License: MPL-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClassicNet = InstanceNetWork("classic")
	VpcNet     = InstanceNetWork("vpc")
)
View Source
const (
	Http  = Protocal("http")
	Https = Protocal("https")
	Tcp   = Protocal("tcp")
	Udp   = Protocal("udp")
)

Constants of protocal definition

View Source
const (
	// common
	Notfound = "Not found"
	// ecs
	InstanceNotfound = "Instance.Notfound"
	// disk
	DiskIncorrectStatus       = "IncorrectDiskStatus"
	DiskCreatingSnapshot      = "DiskCreatingSnapshot"
	InstanceLockedForSecurity = "InstanceLockedForSecurity"
	// eip
	EipIncorrectStatus      = "IncorrectEipStatus"
	InstanceIncorrectStatus = "IncorrectInstanceStatus"
	HaVipIncorrectStatus    = "IncorrectHaVipStatus"
	// slb
	LoadBalancerNotFound = "InvalidLoadBalancerId.NotFound"

	// security_group
	InvalidInstanceIdAlreadyExists = "InvalidInstanceId.AlreadyExists"
	InvalidSecurityGroupIdNotFound = "InvalidSecurityGroupId.NotFound"
	SgDependencyViolation          = "DependencyViolation"

	//Nat gateway
	NatGatewayInvalidRegionId            = "Invalid.RegionId"
	DependencyViolationBandwidthPackages = "DependencyViolation.BandwidthPackages"

	// vswitch
	VswitcInvalidRegionId = "InvalidRegionId.NotFound"
)
View Source
const (
	GroupRuleIngress = GroupRuleDirection("ingress")
	GroupRuleEgress  = GroupRuleDirection("egress")
)
View Source
const (
	GroupRuleTcp  = GroupRuleIpProtocol("tcp")
	GroupRuleUdp  = GroupRuleIpProtocol("udp")
	GroupRuleIcmp = GroupRuleIpProtocol("icmp")
	GroupRuleGre  = GroupRuleIpProtocol("gre")
	GroupRuleAll  = GroupRuleIpProtocol("all")
)
View Source
const (
	GroupRuleInternet = GroupRuleNicType("internet")
	GroupRuleIntranet = GroupRuleNicType("intranet")
)
View Source
const (
	GroupRulePolicyAccept = GroupRulePolicy("accept")
	GroupRulePolicyDrop   = GroupRulePolicy("drop")
)
View Source
const (
	NatGatewaySmallSpec  = NatGatewaySpec("Small")
	NatGatewayMiddleSpec = NatGatewaySpec("Middle")
	NatGatewayLargeSpec  = NatGatewaySpec("Large")
)

Variables

View Source
var ValidProtocals = []Protocal{Http, Https, Tcp, Udp}

ValidProtocals network protocal list

Functions

func AddTags

func AddTags(client *ecs.Client, args *AddTagsArgs) error

func DeleteBandwidthPackage

func DeleteBandwidthPackage(client *ecs.Client, args *DeleteBandwidthPackageArgs) error

func DeleteNatGateway

func DeleteNatGateway(client *ecs.Client, args *DeleteNatGatewayArgs) error

func DescribeSnatTableEntries

func DescribeSnatTableEntries(client *ecs.Client, args *DescribeSnatTableEntriesArgs)

func ModifyNatGatewayAttribute

func ModifyNatGatewayAttribute(client *ecs.Client, args *ModifyNatGatewayAttributeArgs) error

func ModifyNatGatewaySpec

func ModifyNatGatewaySpec(client *ecs.Client, args *ModifyNatGatewaySpecArgs) error

func Provider

func Provider() terraform.ResourceProvider

Provider returns a schema.Provider for alicloud

func RemoveTags

func RemoveTags(client *ecs.Client, args *RemoveTagsArgs) error

func String

func String(v string) *string

Types

type AddTagsArgs

type AddTagsArgs struct {
	ResourceId   string
	ResourceType ecs.TagResourceType //image, instance, snapshot or disk
	RegionId     common.Region
	Tag          []Tag
}

type AliyunClient

type AliyunClient struct {
	Region common.Region
	// contains filtered or unexported fields
}

AliyunClient of aliyun

func (*AliyunClient) DescribeEipAddress

func (client *AliyunClient) DescribeEipAddress(allocationId string) (*ecs.EipAddressSetType, error)

func (*AliyunClient) DescribeImage

func (client *AliyunClient) DescribeImage(imageId string) (*ecs.ImageType, error)

func (*AliyunClient) DescribeLoadBalancerAttribute

func (client *AliyunClient) DescribeLoadBalancerAttribute(slbId string) (*slb.LoadBalancerType, error)

func (*AliyunClient) DescribeNatGateway

func (client *AliyunClient) DescribeNatGateway(natGatewayId string) (*NatGatewaySetType, error)

func (*AliyunClient) DescribeSecurity

func (client *AliyunClient) DescribeSecurity(securityGroupId string) (*ecs.DescribeSecurityGroupAttributeResponse, error)

func (*AliyunClient) DescribeSecurityGroupRule

func (client *AliyunClient) DescribeSecurityGroupRule(securityGroupId, types, ip_protocol, port_range string) (*ecs.PermissionType, error)

func (*AliyunClient) DescribeVpc

func (client *AliyunClient) DescribeVpc(vpcId string) (*ecs.VpcSetType, error)

func (*AliyunClient) DescribeZone

func (client *AliyunClient) DescribeZone(zoneID string) (*ecs.ZoneType, error)

DescribeZone validate zoneId is valid in region

func (*AliyunClient) DiskAvailable

func (client *AliyunClient) DiskAvailable(zone *ecs.ZoneType, diskCategory ecs.DiskCategory) error

func (*AliyunClient) JoinSecurityGroups

func (client *AliyunClient) JoinSecurityGroups(instanceId string, securityGroupIds []string) error

todo: support syc

func (*AliyunClient) LeaveSecurityGroups

func (client *AliyunClient) LeaveSecurityGroups(instanceId string, securityGroupIds []string) error

func (*AliyunClient) QueryInstancesById

func (client *AliyunClient) QueryInstancesById(id string) (instance *ecs.InstanceAttributesType, err error)

func (*AliyunClient) QueryInstancesByIds

func (client *AliyunClient) QueryInstancesByIds(ids []string) (instances []ecs.InstanceAttributesType, err error)

func (*AliyunClient) QueryRouteEntry

func (client *AliyunClient) QueryRouteEntry(routeTableId, cidrBlock, nextHopType, nextHopId string) (rn *ecs.RouteEntrySetType, err error)

func (*AliyunClient) QueryRouteTableById

func (client *AliyunClient) QueryRouteTableById(routeTableId string) (rt *ecs.RouteTableSetType, err error)

func (*AliyunClient) QueryRouteTables

func (client *AliyunClient) QueryRouteTables(args *ecs.DescribeRouteTablesArgs) (routeTables []ecs.RouteTableSetType, err error)

func (*AliyunClient) QueryVswitchById

func (client *AliyunClient) QueryVswitchById(vpcId, vswitchId string) (vsw *ecs.VSwitchSetType, err error)

func (*AliyunClient) QueryVswitches

func (client *AliyunClient) QueryVswitches(args *ecs.DescribeVSwitchesArgs) (vswitches []ecs.VSwitchSetType, err error)

describe vswitch by param filters

func (*AliyunClient) ResourceAvailable

func (client *AliyunClient) ResourceAvailable(zone *ecs.ZoneType, resourceType ecs.ResourceType) error

ResourceAvailable check resource available for zone

func (*AliyunClient) RevokeSecurityGroup

func (client *AliyunClient) RevokeSecurityGroup(args *ecs.RevokeSecurityGroupArgs) error

type BandwidthPackageIdType

type BandwidthPackageIdType struct {
	BandwidthPackageId []string
}

type BandwidthPackageType

type BandwidthPackageType struct {
	IpCount   int
	Bandwidth int
	Zone      string
}

type Config

type Config struct {
	AccessKey string
	SecretKey string
	Region    common.Region
}

Config of aliyun

func (*Config) Client

func (c *Config) Client() (*AliyunClient, error)

Client for AliyunClient

type CreateNatGatewayArgs

type CreateNatGatewayArgs struct {
	RegionId         common.Region
	VpcId            string
	Spec             string
	BandwidthPackage []BandwidthPackageType
	Name             string
	Description      string
	ClientToken      string
}

type CreateNatGatewayResponse

type CreateNatGatewayResponse struct {
	common.Response
	NatGatewayId        string
	ForwardTableIds     ForwardTableIdType
	BandwidthPackageIds BandwidthPackageIdType
}

func CreateNatGateway

func CreateNatGateway(client *ecs.Client, args *CreateNatGatewayArgs) (resp *CreateNatGatewayResponse, err error)

CreateNatGateway creates Virtual Private Cloud

You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/vpc&createvpc

type DeleteBandwidthPackageArgs

type DeleteBandwidthPackageArgs struct {
	RegionId           common.Region
	BandwidthPackageId string
}

type DeleteBandwidthPackageResponse

type DeleteBandwidthPackageResponse struct {
	common.Response
}

type DeleteNatGatewayArgs

type DeleteNatGatewayArgs struct {
	RegionId     common.Region
	NatGatewayId string
}

type DeleteNatGatewayResponse

type DeleteNatGatewayResponse struct {
	common.Response
}

type DescribeBandwidthPackageType

type DescribeBandwidthPackageType struct {
	Bandwidth          string
	BandwidthPackageId string
	IpCount            string
}

type DescribeBandwidthPackagesArgs

type DescribeBandwidthPackagesArgs struct {
	RegionId           common.Region
	BandwidthPackageId string
	NatGatewayId       string
}

type DescribeBandwidthPackagesResponse

type DescribeBandwidthPackagesResponse struct {
	common.Response
	BandwidthPackages struct {
		BandwidthPackage []DescribeBandwidthPackageType
	}
}

type DescribeNatGatewayResponse

type DescribeNatGatewayResponse struct {
	common.Response
	common.PaginationResult
	NatGateways struct {
		NatGateway []NatGatewaySetType
	}
}

type DescribeNatGatewaysArgs

type DescribeNatGatewaysArgs struct {
	RegionId     common.Region
	NatGatewayId string
	VpcId        string
	common.Pagination
}

type DescribeSnatTableEntriesArgs

type DescribeSnatTableEntriesArgs struct {
	RegionId common.Region
}

type ForwardTableIdType

type ForwardTableIdType struct {
	ForwardTableId []string
}

type GroupRuleDirection

type GroupRuleDirection string

type GroupRuleIpProtocol

type GroupRuleIpProtocol string

type GroupRuleNicType

type GroupRuleNicType string

type GroupRulePolicy

type GroupRulePolicy string

type InstanceNetWork

type InstanceNetWork string

type Listener

type Listener struct {
	InstancePort     int
	LoadBalancerPort int
	Protocol         string
	SSLCertificateId string
	Bandwidth        int
}

type ModifyNatGatewayAttributeArgs

type ModifyNatGatewayAttributeArgs struct {
	RegionId     common.Region
	NatGatewayId string
	Name         string
	Description  string
}

type ModifyNatGatewayAttributeResponse

type ModifyNatGatewayAttributeResponse struct {
	common.Response
}

type ModifyNatGatewaySpecArgs

type ModifyNatGatewaySpecArgs struct {
	RegionId     common.Region
	NatGatewayId string
	Spec         NatGatewaySpec
}

type NatGatewaySetType

type NatGatewaySetType struct {
	BusinessStatus      string
	Description         string
	BandwidthPackageIds BandwidthPackageIdType
	ForwardTableIds     ForwardTableIdType
	InstanceChargeType  string
	Name                string
	NatGatewayId        string
	RegionId            common.Region
	Spec                string
	Status              string
	VpcId               string
}

func DescribeNatGateways

func DescribeNatGateways(client *ecs.Client, args *DescribeNatGatewaysArgs) (natGateways []NatGatewaySetType,
	pagination *common.PaginationResult, err error)

type NatGatewaySpec

type NatGatewaySpec string

type Protocal

type Protocal string

Protocal represents network protocal

type RemoveTagsArgs

type RemoveTagsArgs struct {
	ResourceId   string
	ResourceType ecs.TagResourceType //image, instance, snapshot or disk
	RegionId     common.Region
	Tag          []Tag
}

type Tag

type Tag struct {
	Key   string
	Value string
}

Jump to

Keyboard shortcuts

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