dryrun

package
v0.0.0-...-a1c3796 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2024 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FAIL    = "Fail"
	SUCCESS = "Success"
	SLB     = "ccmSLB"
	VPC     = "ccmVPC"
	ECS     = "ccmECS"
	PVTZ    = "ccmPVTZ"
)
View Source
const (
	NORMAL  = MessageLevel("normal")
	ERROR   = MessageLevel("error")
	WARN    = MessageLevel("warn")
	UNKNOWN = MessageLevel("unknown")
)
View Source
const (
	ContextService = ContextKey("ctx.service")
	ContextMessage = ContextKey("ctx.msg")
	ContextSLB     = ContextKey("ctx.slb")
	ContextNLB     = ContextKey("ctx.nlb")
)
View Source
const BATCHSIZE = 20

Variables

View Source
var Message = cache{
	Data: make(map[string]CheckResult),
}

Functions

func AddEvent

func AddEvent(checkName string, name string, id string, msgCode string, msgLevel MessageLevel, msg string)

func NewDryRunCloud

func NewDryRunCloud() prvd.Provider

func ResultEvent

func ResultEvent(client client.Client, status string, reason string) error

Types

type CheckResult

type CheckResult struct {
	Name         string
	ItemResults  map[string]ItemResult `json:"instanceResults,omitempty"`
	PassCount    int
	FailedCount  int
	WarnCount    int
	UnknownCount int
}

type ContextKey

type ContextKey string

type DryRunALB

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

func NewDryRunALB

func NewDryRunALB(
	auth *base.ClientMgr, alb *alb.ALBProvider,
) *DryRunALB

func (DryRunALB) CreateALB

func (DryRunALB) CreateALBListener

func (p DryRunALB) CreateALBListener(ctx context.Context, resLS *albmodel.Listener) (albmodel.ListenerStatus, error)

ALB Listener

func (DryRunALB) CreateALBListenerRule

func (p DryRunALB) CreateALBListenerRule(ctx context.Context, resLR *albmodel.ListenerRule) (albmodel.ListenerRuleStatus, error)

ALB Listener Rule

func (DryRunALB) CreateALBListenerRules

func (p DryRunALB) CreateALBListenerRules(ctx context.Context, resLR []*albmodel.ListenerRule) (map[int]albmodel.ListenerRuleStatus, error)

func (DryRunALB) CreateALBServerGroup

func (p DryRunALB) CreateALBServerGroup(ctx context.Context, resSGP *albmodel.ServerGroup, trackingProvider tracking.TrackingProvider) (albmodel.ServerGroupStatus, error)

ALB ServerGroup

func (DryRunALB) DeleteALB

func (p DryRunALB) DeleteALB(ctx context.Context, lbID string) error

func (DryRunALB) DeleteALBListener

func (p DryRunALB) DeleteALBListener(ctx context.Context, lsID string) error

func (DryRunALB) DeleteALBListenerRule

func (p DryRunALB) DeleteALBListenerRule(ctx context.Context, sdkLRId string) error

func (DryRunALB) DeleteALBListenerRules

func (p DryRunALB) DeleteALBListenerRules(ctx context.Context, sdkLRIds []string) error

func (DryRunALB) DeleteALBServerGroup

func (p DryRunALB) DeleteALBServerGroup(ctx context.Context, serverGroupID string) error

func (DryRunALB) DeregisterALBServers

func (p DryRunALB) DeregisterALBServers(ctx context.Context, serverGroupID string, sdkServers []albsdk.BackendServer) error

func (DryRunALB) DescribeALBZones

func (p DryRunALB) DescribeALBZones(request *albsdk.DescribeZonesRequest) (response *albsdk.DescribeZonesResponse, err error)

func (DryRunALB) ListALBListenerRules

func (p DryRunALB) ListALBListenerRules(ctx context.Context, lsID string) ([]albsdk.Rule, error)

func (DryRunALB) ListALBListeners

func (p DryRunALB) ListALBListeners(ctx context.Context, lbID string) ([]albsdk.Listener, error)

func (DryRunALB) ListALBServerGroupsWithTags

func (p DryRunALB) ListALBServerGroupsWithTags(ctx context.Context, tagFilters map[string]string) ([]albmodel.ServerGroupWithTags, error)

ALB Tags

func (DryRunALB) ListALBServers

func (p DryRunALB) ListALBServers(ctx context.Context, serverGroupID string) ([]albsdk.BackendServer, error)

func (DryRunALB) ListALBsWithTags

func (p DryRunALB) ListALBsWithTags(ctx context.Context, tagFilters map[string]string) ([]albmodel.AlbLoadBalancerWithTags, error)

func (DryRunALB) RegisterALBServers

func (p DryRunALB) RegisterALBServers(ctx context.Context, serverGroupID string, resServers []albmodel.BackendItem) error

ALB Server

func (DryRunALB) ReplaceALBServers

func (p DryRunALB) ReplaceALBServers(ctx context.Context, serverGroupID string, resServers []albmodel.BackendItem, sdkServers []albsdk.BackendServer) error

func (DryRunALB) ReuseALB

func (DryRunALB) TagALBResources

func (p DryRunALB) TagALBResources(request *albsdk.TagResourcesRequest) (response *albsdk.TagResourcesResponse, err error)

func (DryRunALB) UpdateALB

func (DryRunALB) UpdateALBListener

func (p DryRunALB) UpdateALBListener(ctx context.Context, resLS *albmodel.Listener, sdkLB *albsdk.Listener) (albmodel.ListenerStatus, error)

func (DryRunALB) UpdateALBListenerRule

func (p DryRunALB) UpdateALBListenerRule(ctx context.Context, resLR *albmodel.ListenerRule, sdkLR *albsdk.Rule) (albmodel.ListenerRuleStatus, error)

func (DryRunALB) UpdateALBListenerRules

func (p DryRunALB) UpdateALBListenerRules(ctx context.Context, matches []albmodel.ResAndSDKListenerRulePair) error

func (DryRunALB) UpdateALBServerGroup

func (p DryRunALB) UpdateALBServerGroup(ctx context.Context, resSGP *albmodel.ServerGroup, sdkSGP albmodel.ServerGroupWithTags) (albmodel.ServerGroupStatus, error)

type DryRunCAS

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

func NewDryRunCAS

func NewDryRunCAS(
	auth *base.ClientMgr, cas *casprvd.CASProvider,
) *DryRunCAS

func (DryRunCAS) DescribeSSLCertificateList

func (c DryRunCAS) DescribeSSLCertificateList(ctx context.Context) ([]model.CertificateInfo, error)

func (DryRunCAS) DescribeSSLCertificatePublicKeyDetail

func (c DryRunCAS) DescribeSSLCertificatePublicKeyDetail(ctx context.Context, certId string) (*model.CertificateInfo, error)

type DryRunECS

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

func NewDryRunECS

func NewDryRunECS(
	auth *base.ClientMgr,
	ecs *ecs.ECSProvider,
) *DryRunECS

func (*DryRunECS) DescribeNetworkInterfaces

func (d *DryRunECS) DescribeNetworkInterfaces(vpcId string, ips []string, ipVersionType model.AddressIPVersionType) (map[string]string, error)

func (*DryRunECS) GetInstancesByIP

func (d *DryRunECS) GetInstancesByIP(ctx context.Context, ips []string) (*prvd.NodeAttribute, error)

func (*DryRunECS) ListInstances

func (d *DryRunECS) ListInstances(ctx context.Context, ids []string) (map[string]*prvd.NodeAttribute, error)

type DryRunNLB

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

func NewDryRunNLB

func NewDryRunNLB(
	auth *base.ClientMgr, nlb *nlb.NLBProvider,
) *DryRunNLB

func (DryRunNLB) AddNLBServers

func (d DryRunNLB) AddNLBServers(ctx context.Context, sgId string, backends []nlbmodel.ServerGroupServer) error

func (DryRunNLB) AttachCommonBandwidthPackageToLoadBalancer

func (d DryRunNLB) AttachCommonBandwidthPackageToLoadBalancer(ctx context.Context, lbId string, bandwidthPackageId string) error

func (DryRunNLB) CreateNLB

func (d DryRunNLB) CreateNLB(ctx context.Context, mdl *nlbmodel.NetworkLoadBalancer) error

func (DryRunNLB) CreateNLBListener

func (d DryRunNLB) CreateNLBListener(ctx context.Context, lbId string, lis *nlbmodel.ListenerAttribute) error

func (DryRunNLB) CreateNLBServerGroup

func (d DryRunNLB) CreateNLBServerGroup(ctx context.Context, sg *nlbmodel.ServerGroup) error

func (DryRunNLB) DeleteNLB

func (d DryRunNLB) DeleteNLB(ctx context.Context, mdl *nlbmodel.NetworkLoadBalancer) error

func (DryRunNLB) DeleteNLBListener

func (d DryRunNLB) DeleteNLBListener(ctx context.Context, listenerId string) error

func (DryRunNLB) DeleteNLBServerGroup

func (d DryRunNLB) DeleteNLBServerGroup(ctx context.Context, sgId string) error

func (DryRunNLB) DescribeNLB

func (d DryRunNLB) DescribeNLB(ctx context.Context, mdl *nlbmodel.NetworkLoadBalancer) error

func (DryRunNLB) DetachCommonBandwidthPackageFromLoadBalancer

func (d DryRunNLB) DetachCommonBandwidthPackageFromLoadBalancer(ctx context.Context, lbId string, bandwidthPackageId string) error

func (DryRunNLB) FindNLB

func (DryRunNLB) GetNLBServerGroup

func (d DryRunNLB) GetNLBServerGroup(ctx context.Context, sgId string) (*nlbmodel.ServerGroup, error)

func (DryRunNLB) ListNLBListeners

func (d DryRunNLB) ListNLBListeners(ctx context.Context, lbId string) ([]*nlbmodel.ListenerAttribute, error)

func (DryRunNLB) ListNLBServerGroups

func (d DryRunNLB) ListNLBServerGroups(ctx context.Context, tags []tag.Tag) ([]*nlbmodel.ServerGroup, error)

func (DryRunNLB) ListNLBTagResources

func (d DryRunNLB) ListNLBTagResources(ctx context.Context, lbId string) ([]tag.Tag, error)

func (DryRunNLB) RemoveNLBServers

func (d DryRunNLB) RemoveNLBServers(ctx context.Context, sgId string, backends []nlbmodel.ServerGroupServer) error

func (DryRunNLB) StartNLBListener

func (d DryRunNLB) StartNLBListener(ctx context.Context, listenerId string) error

func (DryRunNLB) StopNLBListener

func (d DryRunNLB) StopNLBListener(ctx context.Context, listenerId string) error

func (DryRunNLB) TagNLBResource

func (d DryRunNLB) TagNLBResource(ctx context.Context, resourceId string, resourceType nlbmodel.TagResourceType, tags []tag.Tag) error

func (DryRunNLB) UntagNLBResources

func (d DryRunNLB) UntagNLBResources(ctx context.Context, resourceId string, resourceType nlbmodel.TagResourceType, tagKey []*string) error

func (DryRunNLB) UpdateLoadBalancerProtection

func (d DryRunNLB) UpdateLoadBalancerProtection(ctx context.Context, lbId string,
	delCfg *nlbmodel.DeletionProtectionConfig, modCfg *nlbmodel.ModificationProtectionConfig) error

func (DryRunNLB) UpdateNLB

func (d DryRunNLB) UpdateNLB(ctx context.Context, mdl *nlbmodel.NetworkLoadBalancer) error

func (DryRunNLB) UpdateNLBAddressType

func (d DryRunNLB) UpdateNLBAddressType(ctx context.Context, mdl *nlbmodel.NetworkLoadBalancer) error

func (DryRunNLB) UpdateNLBIPv6AddressType

func (d DryRunNLB) UpdateNLBIPv6AddressType(ctx context.Context, mdl *nlbmodel.NetworkLoadBalancer) error

func (DryRunNLB) UpdateNLBListener

func (d DryRunNLB) UpdateNLBListener(ctx context.Context, lis *nlbmodel.ListenerAttribute) error

func (DryRunNLB) UpdateNLBSecurityGroupIds

func (d DryRunNLB) UpdateNLBSecurityGroupIds(ctx context.Context, mdl *nlbmodel.NetworkLoadBalancer, added, removed []string) error

func (DryRunNLB) UpdateNLBServerGroup

func (d DryRunNLB) UpdateNLBServerGroup(ctx context.Context, sg *nlbmodel.ServerGroup) error

func (DryRunNLB) UpdateNLBServers

func (d DryRunNLB) UpdateNLBServers(ctx context.Context, sgId string, backends []nlbmodel.ServerGroupServer) error

func (DryRunNLB) UpdateNLBZones

func (d DryRunNLB) UpdateNLBZones(ctx context.Context, mdl *nlbmodel.NetworkLoadBalancer) error

type DryRunPVTZ

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

func NewDryRunPVTZ

func NewDryRunPVTZ(
	auth *base.ClientMgr,
	pvtz *pvtz.PVTZProvider,
) *DryRunPVTZ

func (*DryRunPVTZ) DeletePVTZ

func (p *DryRunPVTZ) DeletePVTZ(ctx context.Context, ep *model.PvtzEndpoint) error

func (*DryRunPVTZ) ListPVTZ

func (p *DryRunPVTZ) ListPVTZ(ctx context.Context) ([]*model.PvtzEndpoint, error)

func (*DryRunPVTZ) SearchPVTZ

func (p *DryRunPVTZ) SearchPVTZ(ctx context.Context, ep *model.PvtzEndpoint, exact bool) ([]*model.PvtzEndpoint, error)

func (*DryRunPVTZ) UpdatePVTZ

func (p *DryRunPVTZ) UpdatePVTZ(ctx context.Context, ep *model.PvtzEndpoint) error

type DryRunSLB

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

func NewDryRunSLB

func NewDryRunSLB(
	auth *base.ClientMgr, slb *slb.SLBProvider,
) *DryRunSLB

func (*DryRunSLB) AddVServerGroupBackendServers

func (m *DryRunSLB) AddVServerGroupBackendServers(ctx context.Context, vGroupId string, backends string) error

func (*DryRunSLB) CreateLoadBalancer

func (m *DryRunSLB) CreateLoadBalancer(ctx context.Context, mdl *model.LoadBalancer, clientToken string) error

func (*DryRunSLB) CreateLoadBalancerHTTPListener

func (m *DryRunSLB) CreateLoadBalancerHTTPListener(ctx context.Context, lbId string, listener model.ListenerAttribute) error

func (*DryRunSLB) CreateLoadBalancerHTTPSListener

func (m *DryRunSLB) CreateLoadBalancerHTTPSListener(ctx context.Context, lbId string, listener model.ListenerAttribute) error

func (*DryRunSLB) CreateLoadBalancerTCPListener

func (m *DryRunSLB) CreateLoadBalancerTCPListener(ctx context.Context, lbId string, listener model.ListenerAttribute) error

func (*DryRunSLB) CreateLoadBalancerUDPListener

func (m *DryRunSLB) CreateLoadBalancerUDPListener(ctx context.Context, lbId string, listener model.ListenerAttribute) error

func (*DryRunSLB) CreateVServerGroup

func (m *DryRunSLB) CreateVServerGroup(ctx context.Context, vg *model.VServerGroup, lbId string) error

func (*DryRunSLB) DeleteLoadBalancer

func (m *DryRunSLB) DeleteLoadBalancer(ctx context.Context, mdl *model.LoadBalancer) error

func (*DryRunSLB) DeleteLoadBalancerListener

func (m *DryRunSLB) DeleteLoadBalancerListener(ctx context.Context, lbId string, port int, proto string) error

func (*DryRunSLB) DeleteVServerGroup

func (m *DryRunSLB) DeleteVServerGroup(ctx context.Context, vGroupId string) error

func (*DryRunSLB) DescribeLoadBalancer

func (m *DryRunSLB) DescribeLoadBalancer(ctx context.Context, mdl *model.LoadBalancer) error

func (*DryRunSLB) DescribeLoadBalancerListeners

func (m *DryRunSLB) DescribeLoadBalancerListeners(ctx context.Context, lbId string) ([]model.ListenerAttribute, error)

Listener

func (*DryRunSLB) DescribeServerCertificateById

func (m *DryRunSLB) DescribeServerCertificateById(ctx context.Context, serverCertificateId string) (*model.CertAttribute, error)

func (*DryRunSLB) DescribeVServerGroupAttribute

func (m *DryRunSLB) DescribeVServerGroupAttribute(ctx context.Context, vGroupId string) (model.VServerGroup, error)

func (*DryRunSLB) DescribeVServerGroups

func (m *DryRunSLB) DescribeVServerGroups(ctx context.Context, lbId string) ([]model.VServerGroup, error)

VServerGroup

func (*DryRunSLB) FindLoadBalancer

func (m *DryRunSLB) FindLoadBalancer(ctx context.Context, mdl *model.LoadBalancer) error

func (*DryRunSLB) ListCLBTagResources

func (m *DryRunSLB) ListCLBTagResources(ctx context.Context, lbId string) ([]tag.Tag, error)

func (*DryRunSLB) ModifyLoadBalancerInstanceChargeType

func (m *DryRunSLB) ModifyLoadBalancerInstanceChargeType(ctx context.Context, lbId string, instanceChargeType string, spec string) error

func (*DryRunSLB) ModifyLoadBalancerInstanceSpec

func (m *DryRunSLB) ModifyLoadBalancerInstanceSpec(ctx context.Context, lbId string, spec string) error

func (*DryRunSLB) ModifyLoadBalancerInternetSpec

func (m *DryRunSLB) ModifyLoadBalancerInternetSpec(ctx context.Context, lbId string, chargeType string, bandwidth int) error

func (*DryRunSLB) ModifyVServerGroupBackendServers

func (m *DryRunSLB) ModifyVServerGroupBackendServers(ctx context.Context, vGroupId string, old string, new string) error

func (*DryRunSLB) RemoveVServerGroupBackendServers

func (m *DryRunSLB) RemoveVServerGroupBackendServers(ctx context.Context, vGroupId string, backends string) error

func (*DryRunSLB) SetLoadBalancerDeleteProtection

func (m *DryRunSLB) SetLoadBalancerDeleteProtection(ctx context.Context, lbId string, flag string) error

func (*DryRunSLB) SetLoadBalancerHTTPListenerAttribute

func (m *DryRunSLB) SetLoadBalancerHTTPListenerAttribute(ctx context.Context, lbId string, listener model.ListenerAttribute) error

func (*DryRunSLB) SetLoadBalancerHTTPSListenerAttribute

func (m *DryRunSLB) SetLoadBalancerHTTPSListenerAttribute(ctx context.Context, lbId string, listener model.ListenerAttribute) error

func (*DryRunSLB) SetLoadBalancerModificationProtection

func (m *DryRunSLB) SetLoadBalancerModificationProtection(ctx context.Context, lbId string, flag string) error

func (*DryRunSLB) SetLoadBalancerName

func (m *DryRunSLB) SetLoadBalancerName(ctx context.Context, lbId string, name string) error

func (*DryRunSLB) SetLoadBalancerTCPListenerAttribute

func (m *DryRunSLB) SetLoadBalancerTCPListenerAttribute(ctx context.Context, lbId string, listener model.ListenerAttribute) error

func (*DryRunSLB) SetLoadBalancerUDPListenerAttribute

func (m *DryRunSLB) SetLoadBalancerUDPListenerAttribute(ctx context.Context, lbId string, listener model.ListenerAttribute) error

func (*DryRunSLB) SetVServerGroupAttribute

func (m *DryRunSLB) SetVServerGroupAttribute(ctx context.Context, vGroupId string, backends string) error

func (*DryRunSLB) StartLoadBalancerListener

func (m *DryRunSLB) StartLoadBalancerListener(ctx context.Context, lbId string, port int, proto string) error

func (*DryRunSLB) StopLoadBalancerListener

func (m *DryRunSLB) StopLoadBalancerListener(ctx context.Context, lbId string, port int, proto string) error

func (*DryRunSLB) TagCLBResource

func (m *DryRunSLB) TagCLBResource(ctx context.Context, resourceId string, tags []tag.Tag) error

Tag

func (*DryRunSLB) UntagResources

func (m *DryRunSLB) UntagResources(ctx context.Context, lbId string, tagKey *[]string) error

type DryRunSLS

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

func NewDryRunSLS

func NewDryRunSLS(
	auth *base.ClientMgr, sls *slsprvd.SLSProvider,
) *DryRunSLS

func (DryRunSLS) AnalyzeProductLog

func (s DryRunSLS) AnalyzeProductLog(request *sls.AnalyzeProductLogRequest) (response *sls.AnalyzeProductLogResponse, err error)

type DryRunVPC

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

func NewDryRunVPC

func NewDryRunVPC(
	auth *base.ClientMgr,
	vpc *vpc.VPCProvider,
) *DryRunVPC

func (*DryRunVPC) CreateRoute

func (m *DryRunVPC) CreateRoute(ctx context.Context, table string, provideID string, destinationCIDR string) (*model.Route, error)

func (*DryRunVPC) DeleteRoute

func (m *DryRunVPC) DeleteRoute(ctx context.Context, table, provideID, destinationCIDR string) error

func (*DryRunVPC) DescribeEipAddresses

func (m *DryRunVPC) DescribeEipAddresses(ctx context.Context, instanceType string, instanceId string) ([]string, error)

func (*DryRunVPC) DescribeVSwitches

func (m *DryRunVPC) DescribeVSwitches(ctx context.Context, vpcID string) ([]servicesvpc.VSwitch, error)

func (*DryRunVPC) DescribeVpcCIDRBlock

func (m *DryRunVPC) DescribeVpcCIDRBlock(ctx context.Context, vpcId string, ipVersion model.AddressIPVersionType) ([]*net.IPNet, error)

func (*DryRunVPC) FindRoute

func (m *DryRunVPC) FindRoute(ctx context.Context, table, pvid, cidr string) (*model.Route, error)

func (*DryRunVPC) ListRoute

func (m *DryRunVPC) ListRoute(ctx context.Context, table string) ([]*model.Route, error)

func (*DryRunVPC) ListRouteTables

func (m *DryRunVPC) ListRouteTables(ctx context.Context, vpcID string) ([]string, error)

type ItemResult

type ItemResult struct {
	Name         string
	Id           string
	MessageLevel MessageLevel
	MessageCode  string
	AffectCode   string
	AdviseCode   string
	Message      string
}

type MessageLevel

type MessageLevel string

type Result

type Result struct {
	State        string
	Reason       string
	CheckResults []CheckResult
}

Jump to

Keyboard shortcuts

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