github.com/danp/terraform@v0.9.5-0.20170426144147-39d740081351/builtin/providers/alicloud/errors.go (about)

     1  package alicloud
     2  
     3  import "github.com/denverdino/aliyungo/common"
     4  
     5  const (
     6  	// common
     7  	Notfound = "Not found"
     8  	// ecs
     9  	InstanceNotfound = "Instance.Notfound"
    10  	// disk
    11  	DiskIncorrectStatus       = "IncorrectDiskStatus"
    12  	DiskCreatingSnapshot      = "DiskCreatingSnapshot"
    13  	InstanceLockedForSecurity = "InstanceLockedForSecurity"
    14  	SystemDiskNotFound        = "SystemDiskNotFound"
    15  	// eip
    16  	EipIncorrectStatus      = "IncorrectEipStatus"
    17  	InstanceIncorrectStatus = "IncorrectInstanceStatus"
    18  	HaVipIncorrectStatus    = "IncorrectHaVipStatus"
    19  	// slb
    20  	LoadBalancerNotFound = "InvalidLoadBalancerId.NotFound"
    21  
    22  	// security_group
    23  	InvalidInstanceIdAlreadyExists = "InvalidInstanceId.AlreadyExists"
    24  	InvalidSecurityGroupIdNotFound = "InvalidSecurityGroupId.NotFound"
    25  	SgDependencyViolation          = "DependencyViolation"
    26  
    27  	//Nat gateway
    28  	NatGatewayInvalidRegionId            = "Invalid.RegionId"
    29  	DependencyViolationBandwidthPackages = "DependencyViolation.BandwidthPackages"
    30  	NotFindSnatEntryBySnatId             = "NotFindSnatEntryBySnatId"
    31  	NotFindForwardEntryByForwardId       = "NotFindForwardEntryByForwardId"
    32  
    33  	// vswitch
    34  	VswitcInvalidRegionId = "InvalidRegionId.NotFound"
    35  
    36  	// ess
    37  	InvalidScalingGroupIdNotFound               = "InvalidScalingGroupId.NotFound"
    38  	IncorrectScalingConfigurationLifecycleState = "IncorrectScalingConfigurationLifecycleState"
    39  )
    40  
    41  func GetNotFoundErrorFromString(str string) error {
    42  	return &common.Error{
    43  		ErrorResponse: common.ErrorResponse{
    44  			Code:    InstanceNotfound,
    45  			Message: str,
    46  		},
    47  		StatusCode: -1,
    48  	}
    49  }