Documentation ¶
Index ¶
- Constants
- Variables
- func AccessDeniedError(err error) bool
- func BeforeTosPutAcl(d *schema.ResourceData, call SdkCall, data *map[string]interface{}, err error) (bool, error)
- func CallProcess(calls []SdkCall, d *schema.ResourceData, client *SdkClient, ...) (err error)
- func CheckResourceUtilRemoved(d *schema.ResourceData, readResourceFunc ReadResourceFunc, ...) error
- func ClbAclEntryHash(v interface{}) int
- func Convert(d *schema.ResourceData, k string, v interface{}, t RequestConvert, index int, ...) (err error)
- func DataSourceToRequest(d *schema.ResourceData, r *schema.Resource, info DataSourceInfo) (req map[string]interface{}, err error)
- func DefaultMapValue(source *map[string]interface{}, key string, ...)
- func DownLineToFilter(s string) string
- func DownLineToHump(s string) string
- func DownLineToHumpAndFirstLower(s string) string
- func DownLineToSpace(s string) string
- func FilterSystemTags(tags []interface{}) []interface{}
- func GetFinalKey(t RequestConvert, k string, isRoot bool) string
- func GetSetDifference(key string, d *schema.ResourceData, f schema.SchemaSetFunc, supportUpdate bool) (add *schema.Set, remove *schema.Set, modify *schema.Set, ...)
- func HumpToDownLine(s string) string
- func InitLocks()
- func MergeDateSourceToResource(source map[string]*schema.Schema, target *map[string]*schema.Schema)
- func ObtainSdkValue(keyPattern string, obj interface{}) (interface{}, error)
- func ReleaseLock(key string)
- func RequestConvertDefault(v interface{}, k string, t RequestConvert, req *map[string]interface{}, ...) error
- func RequestConvertListFilter(v interface{}, k string, t RequestConvert, index int, ...) (int, error)
- func RequestConvertListN(v interface{}, k string, t RequestConvert, req *map[string]interface{}, ...) error
- func RequestConvertSingleN(v interface{}, k string, t RequestConvert, req *map[string]interface{}, ...) error
- func RequestConvertWithFilter(v interface{}, k string, t RequestConvert, index int, ...) (int, error)
- func RequestConvertWithN(v interface{}, k string, t RequestConvert, req *map[string]interface{}, ...) error
- func RequestCreateConvert(d *schema.ResourceData, k string, t RequestConvert, index int, ...) (int, error)
- func RequestUpdateConvert(d *schema.ResourceData, k string, t RequestConvert, index int, ...) (int, error)
- func ResourceDateToRequest(d *schema.ResourceData, resource *schema.Resource, isUpdate bool, ...) (map[string]interface{}, error)
- func ResourceFlowLimitExceededError(err error) bool
- func ResourceNotFoundError(err error) bool
- func ResponseToDataSource(d *schema.ResourceData, r *schema.Resource, info DataSourceInfo, ...) (err error)
- func ResponseToResourceData(d *schema.ResourceData, resource *schema.Resource, data interface{}, ...) (rd interface{}, err error)
- func SortAndStartTransJson(source map[string]interface{}) (map[string]interface{}, error)
- func TagsSchema() *schema.Schema
- func TagsSchemaComputed() *schema.Schema
- func TosAccountAclHash(v interface{}) int
- func TryLock(key string)
- func UnsubscribeProductConflictError(err error) bool
- func UnsubscribeProductError(err error) bool
- func WithNextTokenQuery(condition map[string]interface{}, maxResultsParam string, ...) (data []interface{}, err error)
- func WithPageNumberQuery(condition map[string]interface{}, pageSizeParam string, pageNumParam string, ...) (data []interface{}, err error)
- func WithPageOffsetQuery(condition map[string]interface{}, limitParam string, pageParam string, ...) (data []interface{}, err error)
- func WithSimpleQuery(condition map[string]interface{}, call PageCall) (data []interface{}, err error)
- type AfterCallFunc
- type BeforeCallFunc
- type BypassSvc
- type BypassSvcInfo
- type CallErrorFunc
- type CallFunc
- type Callback
- type Config
- type ContentType
- type Credentials
- type DataSourceInfo
- type DecodeNextToken
- type Dispatcher
- func (d *Dispatcher) Create(resourceService ResourceService, resourceDate *schema.ResourceData, ...) (err error)
- func (d *Dispatcher) Data(resourceService ResourceService, resourceDate *schema.ResourceData, ...) (err error)
- func (d *Dispatcher) Delete(resourceService ResourceService, resourceDate *schema.ResourceData, ...) (err error)
- func (d *Dispatcher) Read(resourceService ResourceService, resourceDate *schema.ResourceData, ...) (err error)
- func (d *Dispatcher) Update(resourceService ResourceService, resourceDate *schema.ResourceData, ...) (err error)
- type EachResource
- type ExecuteCallFunc
- type ExtraData
- type ExtraRefreshFunc
- type FieldRequestConvert
- type FieldResponseConvert
- type GetUniversalInfo
- type HttpMethod
- type LockId
- type NextTokenCall
- type PageCall
- type Project
- type ProjectTrn
- type ProjectUpdateEnabled
- type Rate
- type ReadResourceFunc
- type RequestContentType
- type RequestConvert
- type RequestConvertMode
- type RequestConvertType
- type ResourceResponseHandler
- type ResourceService
- type ResponseConvert
- type SdkCall
- type SdkClient
- type ServiceCategory
- type SpecialParam
- type SpecialParamType
- type StateRefresh
- type Universal
- type UniversalInfo
- type UnsubscribeEnabled
- type UnsubscribeInfo
- type UnsubscribeService
Constants ¶
View Source
const ( BypassInfoUrlParam = "BYPASS_URL_PARAM" BypassInfoInput = "BYPASS_INPUT" )
View Source
const ( BypassPath = "PATH" BypassDomain = "DOMAIN" BypassHeader = "HEADER" BypassParam = "PARAM" BypassUrlParam = "URL_PARAM" BypassResponse = "RESPONSE" BypassFilePath = "FILE_PATH" BypassResponseData = "RESPONSE_DATA" )
View Source
const ( TerraformProviderName = "terraform-provider-volcengine" TerraformProviderVersion = "0.0.152" )
Variables ¶
View Source
var TagsHash = func(v interface{}) int { if v == nil { return hashcode.String("") } m := v.(map[string]interface{}) var ( buf bytes.Buffer ) buf.WriteString(fmt.Sprintf("%v#%v", m["key"], m["value"])) return hashcode.String(buf.String()) }
View Source
var VkeTagsResponseHash = func(v interface{}) int { if v == nil { return hashcode.String("") } m := v.(map[string]interface{}) var ( buf bytes.Buffer ) buf.WriteString(fmt.Sprintf("%s-", strings.ToLower(m["key"].(string)))) buf.WriteString(fmt.Sprintf("%s-", strings.ToLower(m["value"].(string)))) buf.WriteString(fmt.Sprintf("%s-", strings.ToLower(m["type"].(string)))) return hashcode.String(buf.String()) }
Functions ¶
func AccessDeniedError ¶ added in v0.0.145
func BeforeTosPutAcl ¶ added in v0.0.22
func CallProcess ¶
func CallProcess(calls []SdkCall, d *schema.ResourceData, client *SdkClient, service ResourceService) (err error)
func CheckResourceUtilRemoved ¶
func CheckResourceUtilRemoved(d *schema.ResourceData, readResourceFunc ReadResourceFunc, timeout time.Duration) error
func ClbAclEntryHash ¶
func ClbAclEntryHash(v interface{}) int
func Convert ¶
func Convert(d *schema.ResourceData, k string, v interface{}, t RequestConvert, index int, req *map[string]interface{}, chain string, forceGet bool, contentType RequestContentType, schemaChain string, setIndex []int) (err error)
func DataSourceToRequest ¶
func DataSourceToRequest(d *schema.ResourceData, r *schema.Resource, info DataSourceInfo) (req map[string]interface{}, err error)
func DefaultMapValue ¶ added in v0.0.35
func DownLineToFilter ¶
DownLineToFilter instance_name ->instance-name
func DownLineToHump ¶
DownLineToHump Convert instance_name -> InstanceName
func DownLineToHumpAndFirstLower ¶
DownLineToHumpAndFirstLower Convert instance_name -> instanceName
func DownLineToSpace ¶
DownLineToSpace instance_name ->instance name
func FilterSystemTags ¶ added in v0.0.64
func FilterSystemTags(tags []interface{}) []interface{}
func GetFinalKey ¶
func GetFinalKey(t RequestConvert, k string, isRoot bool) string
func GetSetDifference ¶
func HumpToDownLine ¶
HumpToDownLine Convert InstanceName -> instance_name
func ObtainSdkValue ¶
func ReleaseLock ¶
func ReleaseLock(key string)
func RequestConvertDefault ¶
func RequestConvertDefault(v interface{}, k string, t RequestConvert, req *map[string]interface{}, chain string) error
func RequestConvertListN ¶
func RequestConvertListN(v interface{}, k string, t RequestConvert, req *map[string]interface{}, chain string, d *schema.ResourceData, forceGet bool, single bool, contentType RequestContentType, schemaChain string, indexes []int) error
func RequestConvertSingleN ¶
func RequestConvertSingleN(v interface{}, k string, t RequestConvert, req *map[string]interface{}, chain string) error
func RequestConvertWithN ¶
func RequestConvertWithN(v interface{}, k string, t RequestConvert, req *map[string]interface{}, chain string) error
func RequestCreateConvert ¶
func RequestCreateConvert(d *schema.ResourceData, k string, t RequestConvert, index int, req *map[string]interface{}, forceGet bool, contentType RequestContentType) (int, error)
func RequestUpdateConvert ¶
func RequestUpdateConvert(d *schema.ResourceData, k string, t RequestConvert, index int, req *map[string]interface{}, contentType RequestContentType) (int, error)
func ResourceDateToRequest ¶
func ResourceDateToRequest(d *schema.ResourceData, resource *schema.Resource, isUpdate bool, convert map[string]RequestConvert, mode RequestConvertMode, contentType RequestContentType) (map[string]interface{}, error)
func ResourceFlowLimitExceededError ¶ added in v0.0.80
func ResourceNotFoundError ¶
func ResponseToDataSource ¶
func ResponseToDataSource(d *schema.ResourceData, r *schema.Resource, info DataSourceInfo, collection []interface{}) (err error)
func ResponseToResourceData ¶
func ResponseToResourceData(d *schema.ResourceData, resource *schema.Resource, data interface{}, extra map[string]ResponseConvert, start ...bool) (rd interface{}, err error)
func SortAndStartTransJson ¶ added in v0.0.22
func TagsSchema ¶ added in v0.0.35
func TagsSchemaComputed ¶ added in v0.0.35
func TosAccountAclHash ¶ added in v0.0.22
func TosAccountAclHash(v interface{}) int
func UnsubscribeProductConflictError ¶ added in v0.0.141
func UnsubscribeProductError ¶ added in v0.0.85
func WithNextTokenQuery ¶
func WithNextTokenQuery(condition map[string]interface{}, maxResultsParam string, nextTokenParam string, maxResults int, decode DecodeNextToken, call NextTokenCall) (data []interface{}, err error)
func WithPageNumberQuery ¶
func WithPageOffsetQuery ¶
func WithSimpleQuery ¶
Types ¶
type AfterCallFunc ¶
type BeforeCallFunc ¶
type BypassSvc ¶ added in v0.0.78
func NewBypassClient ¶ added in v0.0.78
func (*BypassSvc) DoBypassSvcCall ¶ added in v0.0.78
func (u *BypassSvc) DoBypassSvcCall(info BypassSvcInfo, input *map[string]interface{}) (output *map[string]interface{}, err error)
func (*BypassSvc) NewTlsClient ¶ added in v0.0.78
func (*BypassSvc) NewTosClient ¶ added in v0.0.78
func (u *BypassSvc) NewTosClient(info *BypassSvcInfo) *client.Client
type BypassSvcInfo ¶ added in v0.0.78
type CallErrorFunc ¶
type CallFunc ¶ added in v0.0.43
type CallFunc func(d *schema.ResourceData, client *SdkClient, call SdkCall) error
type Callback ¶
func SetResourceTags ¶ added in v0.0.43
func SetResourceTags(serviceClient *SdkClient, addAction, RemoveAction, resourceType string, resourceData *schema.ResourceData, getUniversalInfo GetUniversalInfo) []Callback
type Config ¶
type Credentials ¶ added in v0.0.22
type DataSourceInfo ¶
type DataSourceInfo struct { RequestConverts map[string]RequestConvert ResponseConverts map[string]ResponseConvert NameField string IdField string CollectField string ContentType RequestContentType ExtraData ExtraData ServiceCategory ServiceCategory EachResource EachResource }
type DecodeNextToken ¶
type Dispatcher ¶
type Dispatcher struct { }
func DefaultDispatcher ¶ added in v0.0.64
func DefaultDispatcher() *Dispatcher
func (*Dispatcher) Create ¶
func (d *Dispatcher) Create(resourceService ResourceService, resourceDate *schema.ResourceData, resource *schema.Resource) (err error)
func (*Dispatcher) Data ¶
func (d *Dispatcher) Data(resourceService ResourceService, resourceDate *schema.ResourceData, resource *schema.Resource) (err error)
func (*Dispatcher) Delete ¶
func (d *Dispatcher) Delete(resourceService ResourceService, resourceDate *schema.ResourceData, resource *schema.Resource) (err error)
func (*Dispatcher) Read ¶
func (d *Dispatcher) Read(resourceService ResourceService, resourceDate *schema.ResourceData, resource *schema.Resource) (err error)
func (*Dispatcher) Update ¶
func (d *Dispatcher) Update(resourceService ResourceService, resourceDate *schema.ResourceData, resource *schema.Resource) (err error)
type EachResource ¶ added in v0.0.103
type EachResource func([]interface{}, *schema.ResourceData) ([]interface{}, error)
type ExecuteCallFunc ¶
type ExtraRefreshFunc ¶ added in v0.0.100
type ExtraRefreshFunc func(d *schema.ResourceData, client *SdkClient, call SdkCall) (map[ResourceService]*StateRefresh, error)
type FieldRequestConvert ¶
type FieldRequestConvert func(*schema.ResourceData, interface{}) interface{}
type FieldResponseConvert ¶
type FieldResponseConvert func(interface{}) interface{}
func ConvertTosAccountAcl ¶ added in v0.0.22
func ConvertTosAccountAcl() FieldResponseConvert
func ConvertTosPublicAcl ¶ added in v0.0.22
func ConvertTosPublicAcl() FieldResponseConvert
type GetUniversalInfo ¶ added in v0.0.43
type GetUniversalInfo func(actionName string) UniversalInfo
type LockId ¶
type LockId func(d *schema.ResourceData) string
type NextTokenCall ¶
type Project ¶ added in v0.0.61
type Project struct {
Client *SdkClient
}
func NewProjectService ¶ added in v0.0.61
func (*Project) ModifyProject ¶ added in v0.0.61
func (p *Project) ModifyProject(trn *ProjectTrn, resourceData *schema.ResourceData, r *schema.Resource, service ResourceService) []Callback
func (*Project) ModifyProjectOld ¶ added in v0.0.65
func (p *Project) ModifyProjectOld(trn ProjectTrn, resourceData *schema.ResourceData, resource *schema.Resource, key string, sr *StateRefresh) []Callback
type ProjectTrn ¶ added in v0.0.61
type ProjectUpdateEnabled ¶ added in v0.0.65
type ProjectUpdateEnabled interface {
ProjectTrn() *ProjectTrn
}
type Rate ¶ added in v0.0.52
func GetRateInfoMap ¶ added in v0.0.105
type ReadResourceFunc ¶
type ReadResourceFunc func(d *schema.ResourceData, resourceId string) (map[string]interface{}, error)
type RequestContentType ¶
type RequestContentType int
const ( ContentTypeDefault RequestContentType = iota ContentTypeJson )
type RequestConvert ¶
type RequestConvert struct { ConvertType RequestConvertType Convert FieldRequestConvert Ignore bool ForceGet bool TargetField string NextLevelConvert map[string]RequestConvert StartIndex int SpecialParam *SpecialParam }
type RequestConvertMode ¶
type RequestConvertMode int
const ( RequestConvertAll RequestConvertMode = iota RequestConvertInConvert RequestConvertIgnore )
type RequestConvertType ¶
type RequestConvertType int
const ( ConvertDefault RequestConvertType = iota ConvertWithN ConvertListUnique ConvertListN ConvertSingleN ConvertJsonObject ConvertJsonArray ConvertJsonObjectArray )
type ResourceResponseHandler ¶
type ResourceResponseHandler func() (map[string]interface{}, map[string]ResponseConvert, error)
type ResourceService ¶
type ResourceService interface { //GetClient 获取客户端 GetClient() *SdkClient // ReadResources 读取资源列表 ReadResources(map[string]interface{}) ([]interface{}, error) // ReadResource 读取单个资源 ReadResource(*schema.ResourceData, string) (map[string]interface{}, error) // RefreshResourceState 刷新资源状态 RefreshResourceState(*schema.ResourceData, []string, time.Duration, string) *resource.StateChangeConf // WithResourceResponseHandlers 接口结果 -> terraform 映射 WithResourceResponseHandlers(map[string]interface{}) []ResourceResponseHandler // CreateResource 创建资源 CreateResource(*schema.ResourceData, *schema.Resource) []Callback // ModifyResource 修改资源 ModifyResource(*schema.ResourceData, *schema.Resource) []Callback // RemoveResource 删除资源 RemoveResource(*schema.ResourceData, *schema.Resource) []Callback // DatasourceResources data_source读取资源 DatasourceResources(*schema.ResourceData, *schema.Resource) DataSourceInfo // ReadResourceId 获取资源ID ReadResourceId(string) string }
type ResponseConvert ¶
type ResponseConvert struct { TargetField string KeepDefault bool Convert FieldResponseConvert Ignore bool Chain string }
type SdkCall ¶
type SdkCall struct { Action string BeforeCall BeforeCallFunc ExecuteCall ExecuteCallFunc CallError CallErrorFunc AfterCall AfterCallFunc Convert map[string]RequestConvert ConvertMode RequestConvertMode SdkParam *map[string]interface{} RequestIdField string Refresh *StateRefresh ExtraRefresh map[ResourceService]*StateRefresh AfterRefresh CallFunc ContentType RequestContentType LockId LockId AfterLocked CallFunc ServiceCategory ServiceCategory ExtraRefreshCall ExtraRefreshFunc // contains filtered or unexported fields }
func (*SdkCall) InitReadCall ¶
func (*SdkCall) InitWriteCall ¶
type SdkClient ¶
type SdkClient struct { Region string VpcClient *vpc.VPC ClbClient *clb.CLB EcsClient *ecs.ECS EbsClient *storageebs.STORAGEEBS NatClient *natgateway.NATGATEWAY VpnClient *vpn.VPN AutoScalingClient *autoscaling.AUTOSCALING RdsClient *rdsmysql.RDSMYSQL RdsClientV2 *rdsmysqlv2.RDSMYSQLV2 IamClient *iam.IAM UniversalClient *Universal BypassSvcClient *BypassSvc }
type ServiceCategory ¶ added in v0.0.22
type ServiceCategory int
const ( DefaultServiceCategory ServiceCategory = iota ServiceBypass )
type SpecialParam ¶ added in v0.0.22
type SpecialParam struct { Type SpecialParamType Index int }
type SpecialParamType ¶ added in v0.0.22
type SpecialParamType int
const ( DomainParam SpecialParamType = iota HeaderParam PathParam UrlParam FilePathParam )
type StateRefresh ¶
type Universal ¶
func NewUniversalClient ¶
type UniversalInfo ¶
type UniversalInfo struct { ServiceName string Action string Version string HttpMethod HttpMethod ContentType ContentType }
type UnsubscribeEnabled ¶ added in v0.0.85
type UnsubscribeEnabled interface { // UnsubscribeInfo 判断是否需要退订 UnsubscribeInfo(*schema.ResourceData, *schema.Resource) (*UnsubscribeInfo, error) }
type UnsubscribeInfo ¶ added in v0.0.85
type UnsubscribeService ¶ added in v0.0.85
type UnsubscribeService struct {
Client *SdkClient
}
func NewUnsubscribeService ¶ added in v0.0.85
func NewUnsubscribeService(c *SdkClient) *UnsubscribeService
func (*UnsubscribeService) UnsubscribeInstance ¶ added in v0.0.85
func (u *UnsubscribeService) UnsubscribeInstance(info *UnsubscribeInfo) []Callback
Source Files ¶
- common_volcengine_bypass_call.go
- common_volcengine_bypass_handler.go
- common_volcengine_bypass_utils.go
- common_volcengine_callback.go
- common_volcengine_client.go
- common_volcengine_config.go
- common_volcengine_const.go
- common_volcengine_convert.go
- common_volcengine_data_source.go
- common_volcengine_diff_collection.go
- common_volcengine_dispatcher.go
- common_volcengine_error.go
- common_volcengine_handler.go
- common_volcengine_hashcodes.go
- common_volcengine_interface.go
- common_volcengine_limit.go
- common_volcengine_lock.go
- common_volcengine_page.go
- common_volcengine_project.go
- common_volcengine_resource_util.go
- common_volcengine_sync_limit.go
- common_volcengine_tags.go
- common_volcengine_tls_handler.go
- common_volcengine_tos_handler.go
- common_volcengine_tos_utils.go
- common_volcengine_universal_client.go
- common_volcengine_unsubscribe.go
- common_volcengine_util.go
- common_volcengine_version.go
Click to show internal directories.
Click to hide internal directories.