Documentation ¶
Index ¶
- Constants
- func Acquire()
- func CallProcess(calls []SdkCall, d *schema.ResourceData, client *SdkClient, ...) (err 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 DownLineToFilter(s string) string
- func DownLineToHump(s string) string
- func DownLineToHumpAndFirstLower(s string) string
- func DownLineToSpace(s string) string
- func EcsInstanceImportDiffSuppress(k, old, new string, d *schema.ResourceData) bool
- 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 InitSyncLimit()
- func MergeDateSourceToResource(source map[string]*schema.Schema, target *map[string]*schema.Schema)
- func ObtainSdkValue(keyPattern string, obj interface{}) (interface{}, error)
- func Release()
- 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 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 TryLock(key string)
- 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 CallErrorFunc
- type Callback
- type Config
- 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 ExecuteCallFunc
- type ExtraData
- type FieldRequestConvert
- type FieldResponseConvert
- type LockId
- type NextTokenCall
- type PageCall
- type RequestContentType
- type RequestConvert
- type RequestConvertMode
- type RequestConvertType
- type ResourceResponseHandler
- type ResourceService
- type ResponseConvert
- type SdkCall
- type SdkClient
- type StateRefresh
Constants ¶
View Source
const ( TerraformProviderName = "terraform-provider-vestack" TerraformProviderVersion = "0.0.2" )
Variables ¶
This section is empty.
Functions ¶
func CallProcess ¶
func CallProcess(calls []SdkCall, d *schema.ResourceData, client *SdkClient, service ResourceService) (err 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) (err error)
func DataSourceToRequest ¶
func DataSourceToRequest(d *schema.ResourceData, r *schema.Resource, info DataSourceInfo) (req map[string]interface{}, err error)
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 EcsInstanceImportDiffSuppress ¶
func EcsInstanceImportDiffSuppress(k, old, new string, d *schema.ResourceData) bool
func GetFinalKey ¶
func GetFinalKey(t RequestConvert, k string, isRoot bool) string
func GetSetDifference ¶
func HumpToDownLine ¶
HumpToDownLine Convert InstanceName -> instance_name
func InitSyncLimit ¶
func InitSyncLimit()
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) 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 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 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 CallErrorFunc ¶
type Config ¶
type DataSourceInfo ¶
type DataSourceInfo struct { RequestConverts map[string]RequestConvert ResponseConverts map[string]ResponseConvert NameField string IdField string CollectField string ContentType RequestContentType ExtraData ExtraData }
type DecodeNextToken ¶
type Dispatcher ¶
type Dispatcher struct { }
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 ExecuteCallFunc ¶
type FieldRequestConvert ¶
type FieldRequestConvert func(*schema.ResourceData, interface{}) interface{}
type FieldResponseConvert ¶
type FieldResponseConvert func(interface{}) interface{}
type LockId ¶
type LockId func(d *schema.ResourceData) string
type NextTokenCall ¶
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 }
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 }
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 ContentType RequestContentType LockId LockId }
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 }
Source Files ¶
- common_vestack_callback.go
- common_vestack_client.go
- common_vestack_config.go
- common_vestack_const.go
- common_vestack_convert.go
- common_vestack_data_source.go
- common_vestack_diff_collection.go
- common_vestack_diff_suppress_func.go
- common_vestack_dispatcher.go
- common_vestack_error.go
- common_vestack_handler.go
- common_vestack_hashcodes.go
- common_vestack_interface.go
- common_vestack_lock.go
- common_vestack_page.go
- common_vestack_sync_limit.go
- common_vestack_util.go
- common_vestack_version.go
Click to show internal directories.
Click to hide internal directories.