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 RegionType
- 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 ( RegionalService = "Regional" GlobalService = "Global" ByteplusIpv4EndpointSuffix = "byteplusapi.com" ByteplusBypassEndpointSuffix = "bytepluses.com" )
View Source
const ( TerraformProviderName = "terraform-provider-byteplus" TerraformProviderVersion = "0.0.22" )
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.3
func BeforeTosPutAcl ¶
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 ¶
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 ¶
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 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 ¶
func TagsSchema ¶
func TagsSchemaComputed ¶
func TosAccountAclHash ¶
func TosAccountAclHash(v interface{}) int
func UnsubscribeProductError ¶
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 ¶
func NewBypassClient ¶
func (*BypassSvc) DoBypassSvcCall ¶
func (u *BypassSvc) DoBypassSvcCall(info BypassSvcInfo, input *map[string]interface{}) (output *map[string]interface{}, err error)
func (*BypassSvc) NewTlsClient ¶
func (*BypassSvc) NewTosClient ¶
func (u *BypassSvc) NewTosClient(info *BypassSvcInfo) *client.Client
type BypassSvcInfo ¶
type CallErrorFunc ¶
type Callback ¶
func SetResourceTags ¶
func SetResourceTags(serviceClient *SdkClient, addAction, RemoveAction, resourceType string, resourceData *schema.ResourceData, getUniversalInfo GetUniversalInfo) []Callback
type Config ¶
type Config struct {
AccessKey string
SecretKey string
SessionToken string
Region string
Endpoint string
DisableSSL bool
EnableStandardEndpoint bool
StandardEndpointSuffix string
CustomerHeaders map[string]string
CustomerEndpoints map[string]string
CustomerEndpointSuffix map[string]string
ProxyUrl string
}
type Credentials ¶
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 ¶
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 ¶
type EachResource func([]interface{}, *schema.ResourceData) ([]interface{}, error)
type ExecuteCallFunc ¶
type ExtraRefreshFunc ¶
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 ¶
func ConvertTosAccountAcl() FieldResponseConvert
func ConvertTosPublicAcl ¶
func ConvertTosPublicAcl() FieldResponseConvert
type GetUniversalInfo ¶
type GetUniversalInfo func(actionName string) UniversalInfo
type LockId ¶
type LockId func(d *schema.ResourceData) string
type NextTokenCall ¶
type Project ¶
type Project struct {
Client *SdkClient
}
func NewProjectService ¶
func (*Project) ModifyProject ¶
func (p *Project) ModifyProject(trn *ProjectTrn, resourceData *schema.ResourceData, r *schema.Resource, service ResourceService) []Callback
func (*Project) ModifyProjectOld ¶
func (p *Project) ModifyProjectOld(trn ProjectTrn, resourceData *schema.ResourceData, resource *schema.Resource, key string, sr *StateRefresh) []Callback
type ProjectTrn ¶
type ProjectUpdateEnabled ¶
type ProjectUpdateEnabled interface {
ProjectTrn() *ProjectTrn
}
type Rate ¶
func GetRateInfoMap ¶
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 ServiceCategory ¶
type ServiceCategory int
const ( DefaultServiceCategory ServiceCategory = iota ServiceBypass )
type SpecialParam ¶
type SpecialParam struct {
Type SpecialParamType
Index int
}
type SpecialParamType ¶
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
RegionType RegionType
}
type UnsubscribeEnabled ¶
type UnsubscribeEnabled interface {
// UnsubscribeInfo 判断是否需要退订
UnsubscribeInfo(*schema.ResourceData, *schema.Resource) (*UnsubscribeInfo, error)
}
type UnsubscribeInfo ¶
type UnsubscribeService ¶
type UnsubscribeService struct {
Client *SdkClient
}
func NewUnsubscribeService ¶
func NewUnsubscribeService(c *SdkClient) *UnsubscribeService
func (*UnsubscribeService) UnsubscribeInstance ¶
func (u *UnsubscribeService) UnsubscribeInstance(info *UnsubscribeInfo) []Callback
Source Files
¶
- common_byteplus_bypass_call.go
- common_byteplus_bypass_handler.go
- common_byteplus_bypass_utils.go
- common_byteplus_callback.go
- common_byteplus_client.go
- common_byteplus_config.go
- common_byteplus_const.go
- common_byteplus_convert.go
- common_byteplus_data_source.go
- common_byteplus_diff_collection.go
- common_byteplus_dispatcher.go
- common_byteplus_error.go
- common_byteplus_handler.go
- common_byteplus_hashcodes.go
- common_byteplus_interface.go
- common_byteplus_limit.go
- common_byteplus_lock.go
- common_byteplus_page.go
- common_byteplus_project.go
- common_byteplus_resource_utils.go
- common_byteplus_tags.go
- common_byteplus_tls_handler.go
- common_byteplus_tos_handler.go
- common_byteplus_tos_utils.go
- common_byteplus_universal_client.go
- common_byteplus_unsubscribe.go
- common_byteplus_utils.go
- common_byteplus_version.go
Click to show internal directories.
Click to hide internal directories.