Documentation
¶
Overview ¶
Package tbclient provides client functions to interact with CB-Tumblebug API
Package tbclient provides client functions to interact with CB-Tumblebug API ¶
Package tbclient provides client functions to interact with CB-Tumblebug API ¶
Package tbclient provides client functions to interact with CB-Tumblebug API ¶
Package tbclient provides client functions to interact with CB-Tumblebug API ¶
Package tbclient provides client functions to interact with CB-Tumblebug API ¶
Package tbclient provides client functions to interact with CB-Tumblebug API ¶
Package tbclient provides client functions to interact with CB-Tumblebug API ¶
Package tbclient provides client functions to interact with CB-Tumblebug API ¶
Package tbclient provides client functions to interact with CB-Tumblebug API ¶
Package tbclient provides client functions to interact with CB-Tumblebug API ¶
Package tbclient provides client functions to interact with CB-Tumblebug API ¶
Package tbclient provides client functions to interact with CB-Tumblebug API ¶
Package tbclient provides client functions to interact with CB-Tumblebug API ¶
Package tbclient provides client functions to interact with CB-Tumblebug API ¶
Package tbclient provides client functions to interact with CB-Tumblebug API
Index ¶
- Constants
- func GetCacheDuration(ctx context.Context) (time.Duration, bool)
- func Init(cfg ApiConfig)
- func SetCacheDuration(ctx context.Context, d time.Duration) context.Context
- type ApiConfig
- type CacheItem
- type CircuitBreakerState
- type K8sClusterList
- type NLBListResponse
- type Session
- func (s *Session) AddFirewallRules(nsId, securityGroupId string, rules []tbmodel.FirewallRuleReq) (tbmodel.SecurityGroupInfo, error)
- func (s *Session) AddK8sNodeGroup(nsId, clusterId string, reqBody tbmodel.K8sNodeGroupReq) (tbmodel.K8sClusterInfo, error)
- func (s *Session) CheckK8sNodeGroupsOnCreation(providerName string) (bool, error)
- func (s *Session) CreateInfra(nsId string, reqBody tbmodel.InfraReq) (tbmodel.InfraInfo, error)
- func (s *Session) CreateInfraDynamic(nsId string, reqBody tbmodel.InfraDynamicReq) (tbmodel.InfraInfo, error)
- func (s *Session) CreateK8sCluster(nsId string, reqBody tbmodel.K8sClusterReq) (tbmodel.K8sClusterInfo, error)
- func (s *Session) CreateNamespace(nsReq tbmodel.NsReq) (tbmodel.NsInfo, error)
- func (s *Session) CreateNlb(nsId, infraId string, req tbmodel.NLBReq) (tbmodel.NLBInfo, error)
- func (s *Session) CreateObjectStorage(nsId string, req tbmodel.ObjectStorageCreateRequest) (tbmodel.ObjectStorageInfo, error)
- func (s *Session) CreateSecurityGroup(nsId string, reqBody tbmodel.SecurityGroupReq, option string) (tbmodel.SecurityGroupInfo, error)
- func (s *Session) CreateSshKey(nsId string, reqBody tbmodel.SshKeyReq) (tbmodel.SshKeyInfo, error)
- func (s *Session) CreateVNet(nsId string, reqBody tbmodel.VNetReq) (tbmodel.VNetInfo, error)
- func (s *Session) Delete(url string) (*resty.Response, error)
- func (s *Session) DeleteInfra(nsId, infraId, option string) (tbmodel.IdList, error)
- func (s *Session) DeleteK8sCluster(nsId, clusterId string) error
- func (s *Session) DeleteK8sNodeGroup(nsId, clusterId, nodeGroupId string) error
- func (s *Session) DeleteNlb(nsId, infraId, nlbId string) error
- func (s *Session) DeleteObjectStorage(nsId string, osId string, option string) error
- func (s *Session) DeleteObjectStorageCORS(nsId string, osId string) error
- func (s *Session) DeleteSecurityGroup(nsId, securityGroupId string) (tbmodel.SimpleMsg, error)
- func (s *Session) DeleteSharedResources(nsId string) (tbmodel.IdList, error)
- func (s *Session) DeleteSshKey(nsId, sshKeyId string) (tbmodel.SimpleMsg, error)
- func (s *Session) DeleteStorageObject(nsId, osId, objectKey string) error
- func (s *Session) DeleteVNet(nsId, vNetId, action string) (tbmodel.SimpleMsg, error)
- func (s *Session) Execute(method, url string) (*resty.Response, error)
- func (s *Session) ExistObjectStorage(nsId string, osId string) (bool, error)
- func (s *Session) Get(url string) (*resty.Response, error)
- func (s *Session) GetAvailableK8sVersions(providerName, regionName string) ([]tbmodel.K8sClusterVersionDetailAvailable, error)
- func (s *Session) GetConnConfig(connectionConfigName string) (tbmodel.ConnConfig, error)
- func (s *Session) GetK8sNodeGroupNamingRule(providerName string) (string, error)
- func (s *Session) GetK8sNodeImages(providerName, regionName string) (bool, []tbmodel.K8sClusterNodeImageDetailAvailable, error)
- func (s *Session) GetK8sRequiredSubnetCount(providerName string) (int, error)
- func (s *Session) GetNlb(nsId, infraId, nlbId string) (tbmodel.NLBInfo, error)
- func (s *Session) GetNlbHealth(nsId, infraId, nlbId string) (tbmodel.NLBInfo, error)
- func (s *Session) GetObjectStorage(nsId string, osId string) (tbmodel.ObjectStorageInfo, error)
- func (s *Session) GetObjectStorageCORS(nsId string, osId string) (tbmodel.ObjectStorageGetCorsResponse, error)
- func (s *Session) GetObjectStorageLocation(nsId string, osId string) (tbmodel.ObjectStorageLocationResponse, error)
- func (s *Session) GetObjectStorageSupport(cspType string) (tbmodel.ObjectStorageSupportResponse, error)
- func (s *Session) GetObjectStorageVersioning(nsId string, osId string) (tbmodel.ObjectStorageGetVersioningResponse, error)
- func (s *Session) GetStorageObject(nsId, osId, objectKey string) (tbmodel.Object, error)
- func (s *Session) Head(url string) (*resty.Response, error)
- func (s *Session) InfraRecommendSpec(planToSearchProperVm string) ([]tbmodel.SpecInfo, error)
- func (s *Session) IsReady() (bool, *string, error)
- func (s *Session) K8sClusterRecommendNode(req tbmodel.RecommendSpecReq) ([]tbmodel.SpecInfo, error)
- func (s *Session) ListNlbs(nsId, infraId string) (NLBListResponse, error)
- func (s *Session) ListObjectStorageIDs(nsId string) (tbmodel.IdList, error)
- func (s *Session) ListObjectStorageObjects(nsId string, osId string) (tbmodel.ObjectStorageListObjectsResponse, error)
- func (s *Session) ListObjectStorages(nsId string, option string, filterKey string, filterVal string) (tbmodel.ObjectStorageListResponse, error)
- func (s *Session) NoCache() *Session
- func (s *Session) Post(url string) (*resty.Response, error)
- func (s *Session) Put(url string) (*resty.Response, error)
- func (s *Session) ReadAllInfra(nsId string) (TbInfraInfoList, error)
- func (s *Session) ReadAllK8sClusters(nsId string) (K8sClusterList, error)
- func (s *Session) ReadInfra(nsId, infraId string) (tbmodel.InfraInfo, error)
- func (s *Session) ReadInfraAccessInfo(nsId, infraId, option, accessInfoOption string) (tbmodel.InfraAccessInfo, error)
- func (s *Session) ReadInfraIDs(nsId string) (tbmodel.IdList, error)
- func (s *Session) ReadK8sCluster(nsId, clusterId string) (tbmodel.K8sClusterInfo, error)
- func (s *Session) ReadNamespace(nsId string) (tbmodel.NsInfo, error)
- func (s *Session) ReadRegionInfo(providerName string, regionName string) (tbmodel.RegionDetail, error)
- func (s *Session) ReadSecurityGroup(nsId, securityGroupId string) (tbmodel.SecurityGroupInfo, error)
- func (s *Session) ReadSshKey(nsId, sshKeyId string) (tbmodel.SshKeyInfo, error)
- func (s *Session) ReadVNet(nsId, vNetId string) (tbmodel.VNetInfo, error)
- func (s *Session) ReadVmOsImage(nsId, vmOsImageId string) (tbmodel.ImageInfo, error)
- func (s *Session) ReadVmSpec(nsId, vmSpecId string) (tbmodel.SpecInfo, error)
- func (s *Session) RemoteCommandToInfra(nsId, infraId, nodeGroupId, nodeId string, reqBody tbmodel.InfraCmdReq) (tbmodel.InfraSshCmdResultForAPI, error)
- func (s *Session) ReviewSpecImagePair(req tbmodel.SpecImagePairReviewReq) (tbmodel.SpecImagePairReviewResult, error)
- func (s *Session) SearchVmOsImage(nsId string, searchImageReq tbmodel.SearchImageRequest) (tbmodel.SearchImageResponse, error)
- func (s *Session) SetBody(body any) *Session
- func (s *Session) SetCacheDuration(d time.Duration) *Session
- func (s *Session) SetContext(ctx context.Context) *Session
- func (s *Session) SetHeader(key, value string) *Session
- func (s *Session) SetHeaders(headers map[string]string) *Session
- func (s *Session) SetObjectStorageCORS(nsId string, osId string, req tbmodel.ObjectStorageSetCorsRequest) error
- func (s *Session) SetObjectStorageVersioning(nsId string, osId string, req tbmodel.ObjectStorageSetVersioningRequest) error
- func (s *Session) SetQueryParam(key, value string) *Session
- func (s *Session) SetQueryParams(params map[string]string) *Session
- func (s *Session) SetResult(res any) *Session
- func (s *Session) SetTraceInfo(ctx context.Context) *Session
- type TbInfraInfoList
- type TumblebugClient
- type TumblebugTransport
Constants ¶
const ( // VeryShortDuration is a duration for very short-term cache VeryShortDuration = 1 * time.Second // ShortDuration is a duration for short-term cache ShortDuration = 2 * time.Second // MediumDuration is a duration for medium-term cache MediumDuration = 5 * time.Second // LongDuration is a duration for long-term cache LongDuration = 10 * time.Second )
const (
// MaxDebugBodyLength is the maximum length of response body for debug logs
MaxDebugBodyLength = 50000
)
Variables ¶
This section is empty.
Functions ¶
func GetCacheDuration ¶ added in v0.5.1
GetCacheDuration retrieves cache duration from the context
Types ¶
type ApiConfig ¶
type ApiConfig struct {
RestUrl string
Username string
Password string
Timeout time.Duration
CacheDuration time.Duration
HttpTransport http.RoundTripper
}
ApiConfig holds the configuration for the Tumblebug client.
type CacheItem ¶ added in v0.5.1
type CacheItem struct {
ResponseBytes []byte
StatusCode int
Header http.Header
ExpiresAt time.Time
}
CacheItem is a struct to store cached item
type CircuitBreakerState ¶ added in v0.5.1
CircuitBreakerState represents the state of a circuit breaker for a specific request
type K8sClusterList ¶ added in v0.5.10
type K8sClusterList struct {
K8sClusters []tbmodel.K8sClusterInfo `json:"K8sClusterInfo"`
}
K8sClusterList wraps the list response for K8s clusters from Tumblebug.
type NLBListResponse ¶ added in v0.5.3
NLBListResponse is the response body for GET /ns/{nsId}/infra/{infraId}/nlb.
type Session ¶ added in v0.5.1
type Session struct {
// contains filtered or unexported fields
}
Session represents a single request scope. It holds the request-specific configuration (headers, context, etc.).
func NewSession ¶ added in v0.5.1
func NewSession() *Session
NewSession creates a new Session using the global client.
func (*Session) AddFirewallRules ¶ added in v0.5.10
func (s *Session) AddFirewallRules(nsId, securityGroupId string, rules []tbmodel.FirewallRuleReq) (tbmodel.SecurityGroupInfo, error)
AddFirewallRules adds firewall rules to an existing Security Group. Used to apply rules that cannot be included in the create request for some CSPs (e.g., Tencent rejects ingress+egress in a single create call).
func (*Session) AddK8sNodeGroup ¶ added in v0.5.10
func (s *Session) AddK8sNodeGroup(nsId, clusterId string, reqBody tbmodel.K8sNodeGroupReq) (tbmodel.K8sClusterInfo, error)
AddK8sNodeGroup adds a worker node group to an existing K8s cluster. Required for AWS (nodeGroupsOnCreation=false); universally compatible with other CSPs.
func (*Session) CheckK8sNodeGroupsOnCreation ¶ added in v0.5.10
CheckK8sNodeGroupsOnCreation checks whether the given CSP requires NodeGroups to be included in the K8s cluster creation request (nodeGroupsOnCreation=true), or allows them to be added separately after cluster creation (nodeGroupsOnCreation=false).
func (*Session) CreateInfra ¶ added in v0.5.1
CreateInfra creates a new Infra (Infrastructure) in the specified namespace
func (*Session) CreateInfraDynamic ¶ added in v0.5.1
func (s *Session) CreateInfraDynamic(nsId string, reqBody tbmodel.InfraDynamicReq) (tbmodel.InfraInfo, error)
CreateInfraDynamic creates a new Infra (Infrastructure) with defaults in the specified namespace
func (*Session) CreateK8sCluster ¶ added in v0.5.10
func (s *Session) CreateK8sCluster(nsId string, reqBody tbmodel.K8sClusterReq) (tbmodel.K8sClusterInfo, error)
CreateK8sCluster creates a K8s cluster using pre-created VNet, SshKey, and SecurityGroup resources.
func (*Session) CreateNamespace ¶ added in v0.5.1
CreateNamespace creates a new namespace in Tumblebug
func (*Session) CreateNlb ¶ added in v0.5.3
CreateNlb creates a new NLB in the specified namespace and infra.
func (*Session) CreateObjectStorage ¶ added in v0.5.1
func (s *Session) CreateObjectStorage(nsId string, req tbmodel.ObjectStorageCreateRequest) (tbmodel.ObjectStorageInfo, error)
CreateObjectStorage creates a new object storage (bucket)
func (*Session) CreateSecurityGroup ¶ added in v0.5.1
func (s *Session) CreateSecurityGroup(nsId string, reqBody tbmodel.SecurityGroupReq, option string) (tbmodel.SecurityGroupInfo, error)
CreateSecurityGroup creates a new Security Group in the specified namespace
func (*Session) CreateSshKey ¶ added in v0.5.1
CreateSshKey creates a new SSH Key in the specified namespace
func (*Session) CreateVNet ¶ added in v0.5.1
CreateVNet creates a new Virtual Network (VNet) in the specified namespace
func (*Session) DeleteInfra ¶ added in v0.5.1
DeleteInfra deletes a specific Infra (Infrastructure) in the specified namespace
func (*Session) DeleteK8sCluster ¶ added in v0.5.10
DeleteK8sCluster deletes a K8s cluster and all its node groups.
func (*Session) DeleteK8sNodeGroup ¶ added in v0.5.10
DeleteK8sNodeGroup deletes a specific node group from a K8s cluster.
func (*Session) DeleteObjectStorage ¶ added in v0.5.1
DeleteObjectStorage deletes an object storage (bucket). option controls the deletion behavior (mutually exclusive):
- "" : Standard delete — fails if the bucket is not empty.
- "empty" : Empty the bucket first, then delete.
- "force" : Force-delete with all contents (passed to Spider as force=true).
- "reconcile": Remove only Tumblebug metadata without calling the CSP delete API.
func (*Session) DeleteObjectStorageCORS ¶ added in v0.5.1
DeleteObjectStorageCORS deletes the CORS configuration of an object storage (bucket)
func (*Session) DeleteSecurityGroup ¶ added in v0.5.1
DeleteSecurityGroup deletes a specific Security Group in the specified namespace
func (*Session) DeleteSharedResources ¶ added in v0.5.1
func (*Session) DeleteSshKey ¶ added in v0.5.1
func (*Session) DeleteStorageObject ¶ added in v0.5.1
DeleteStorageObject deletes a specific object from an object storage bucket.
func (*Session) DeleteVNet ¶ added in v0.5.1
func (*Session) Execute ¶ added in v0.5.1
Execute executes the request with the given method and URL.
func (*Session) ExistObjectStorage ¶ added in v0.5.1
ExistObjectStorage checks the existence of an object storage (bucket)
func (*Session) GetAvailableK8sVersions ¶ added in v0.5.10
func (s *Session) GetAvailableK8sVersions(providerName, regionName string) ([]tbmodel.K8sClusterVersionDetailAvailable, error)
GetAvailableK8sVersions returns the K8s versions supported by the CSP and region.
func (*Session) GetConnConfig ¶ added in v0.5.1
func (s *Session) GetConnConfig(connectionConfigName string) (tbmodel.ConnConfig, error)
func (*Session) GetK8sNodeGroupNamingRule ¶ added in v0.5.10
GetK8sNodeGroupNamingRule returns the CSP-specific node group naming rule (a regex) from Tumblebug's k8sClusterInfo asset data. Returns an empty string when the CSP defines no rule. The regex does not always encode length limits (e.g. Azure omits its 12-char cap), so callers must apply their own safe upper bound in addition.
func (*Session) GetK8sNodeImages ¶ added in v0.5.10
func (s *Session) GetK8sNodeImages(providerName, regionName string) (bool, []tbmodel.K8sClusterNodeImageDetailAvailable, error)
GetK8sNodeImages returns whether the CSP requires node image designation and the curated node image list resolved for the region (preferring an exact region match, falling back to the "common" region entry). Data comes from the same k8sClusterInfo asset used for naming rules and subnet counts, so no extra (still under-development) node-image endpoint is needed.
func (*Session) GetK8sRequiredSubnetCount ¶ added in v0.5.10
GetK8sRequiredSubnetCount returns the number of subnets the CSP requires to create a K8s cluster (e.g. AWS EKS needs 2 across distinct AZs; most CSPs need 1), from Tumblebug's k8sClusterInfo asset data. The value is a required minimum, not an exact/maximum.
func (*Session) GetNlbHealth ¶ added in v0.5.4
GetNlbHealth performs a live health check on NLB targets via CSP and returns the updated NLB info.
func (*Session) GetObjectStorage ¶ added in v0.5.1
GetObjectStorage retrieves details of an object storage (bucket)
func (*Session) GetObjectStorageCORS ¶ added in v0.5.1
func (s *Session) GetObjectStorageCORS(nsId string, osId string) (tbmodel.ObjectStorageGetCorsResponse, error)
GetObjectStorageCORS retrieves the CORS configuration of an object storage (bucket)
func (*Session) GetObjectStorageLocation ¶ added in v0.5.1
func (s *Session) GetObjectStorageLocation(nsId string, osId string) (tbmodel.ObjectStorageLocationResponse, error)
GetObjectStorageLocation retrieves the location of an object storage (bucket)
func (*Session) GetObjectStorageSupport ¶ added in v0.5.1
func (s *Session) GetObjectStorageSupport(cspType string) (tbmodel.ObjectStorageSupportResponse, error)
GetObjectStorageSupport retrieves CSP support information for object storage features If cspType is empty, returns support information for all CSPs
func (*Session) GetObjectStorageVersioning ¶ added in v0.5.1
func (s *Session) GetObjectStorageVersioning(nsId string, osId string) (tbmodel.ObjectStorageGetVersioningResponse, error)
GetObjectStorageVersioning retrieves the versioning configuration of an object storage (bucket)
func (*Session) GetStorageObject ¶ added in v0.5.1
GetStorageObject retrieves metadata of a specific object in an object storage bucket.
func (*Session) InfraRecommendSpec ¶ added in v0.5.1
InfraRecommendSpec finds appropriate VM specs by filtering and prioritzing.
func (*Session) K8sClusterRecommendNode ¶ added in v0.5.10
K8sClusterRecommendNode finds appropriate K8s worker node specs by filtering and prioritizing.
This is the K8s counterpart of InfraRecommendSpec. Tumblebug wraps the shared spec search with validateK8sMinimumRequirements, which rejects filter conditions below the K8s node minimums and injects those minimums when the request omits them.
The request is passed as a struct rather than a JSON string: InfraRecommendSpec accepts a string only to json.Unmarshal it straight back into this same type. nsId is fixed to the system common namespace on the Tumblebug side, so it is not a parameter here.
func (*Session) ListNlbs ¶ added in v0.5.3
func (s *Session) ListNlbs(nsId, infraId string) (NLBListResponse, error)
ListNlbs retrieves all NLBs in the specified namespace and infra.
func (*Session) ListObjectStorageIDs ¶ added in v0.5.7
ListObjectStorageIDs retrieves the list of all object storage IDs in a namespace
func (*Session) ListObjectStorageObjects ¶ added in v0.5.1
func (s *Session) ListObjectStorageObjects(nsId string, osId string) (tbmodel.ObjectStorageListObjectsResponse, error)
ListObjectStorageObjects lists objects in a specific object storage bucket.
func (*Session) ListObjectStorages ¶ added in v0.5.1
func (s *Session) ListObjectStorages(nsId string, option string, filterKey string, filterVal string) (tbmodel.ObjectStorageListResponse, error)
ListObjectStorages retrieves the list of all object storages (buckets) in a namespace
func (*Session) ReadAllInfra ¶ added in v0.5.1
func (s *Session) ReadAllInfra(nsId string) (TbInfraInfoList, error)
ReadAllInfra retrieves all Infras (Infrastructure) in the specified namespace. This call is paced against TB's 2 req/s limit; set a deadline via Session.SetContext to bound how long it waits for a slot.
func (*Session) ReadAllK8sClusters ¶ added in v0.5.10
func (s *Session) ReadAllK8sClusters(nsId string) (K8sClusterList, error)
ReadAllK8sClusters retrieves all K8s clusters in the specified namespace.
func (*Session) ReadInfra ¶ added in v0.5.1
ReadInfra retrieves information about a specific Infra (Infrastructure) in the specified namespace. This call is paced against TB's 2 req/s limit; set a deadline via Session.SetContext to bound how long it waits for a slot.
func (*Session) ReadInfraAccessInfo ¶ added in v0.5.1
func (s *Session) ReadInfraAccessInfo(nsId, infraId, option, accessInfoOption string) (tbmodel.InfraAccessInfo, error)
func (*Session) ReadInfraIDs ¶ added in v0.5.1
ReadInfraIDs retrieves all Infra IDs in the specified namespace. This call is paced against TB's 2 req/s limit; set a deadline via Session.SetContext to bound how long it waits for a slot.
func (*Session) ReadK8sCluster ¶ added in v0.5.10
func (s *Session) ReadK8sCluster(nsId, clusterId string) (tbmodel.K8sClusterInfo, error)
ReadK8sCluster retrieves information about a specific K8s cluster.
func (*Session) ReadNamespace ¶ added in v0.5.1
ReadNamespace retrieves information about a specific namespace
func (*Session) ReadRegionInfo ¶ added in v0.5.1
func (s *Session) ReadRegionInfo(providerName string, regionName string) (tbmodel.RegionDetail, error)
ReadRegionInfo reads region information in a specific provider
func (*Session) ReadSecurityGroup ¶ added in v0.5.1
func (s *Session) ReadSecurityGroup(nsId, securityGroupId string) (tbmodel.SecurityGroupInfo, error)
ReadSecurityGroup retrieves information about a specific Security Group in the specified namespace
func (*Session) ReadSshKey ¶ added in v0.5.1
func (s *Session) ReadSshKey(nsId, sshKeyId string) (tbmodel.SshKeyInfo, error)
ReadSshKey retrieves information about a specific SSH Key in the specified namespace
func (*Session) ReadVNet ¶ added in v0.5.1
ReadVNet retrieves information about a specific Virtual Network (VNet) in the specified namespace
func (*Session) ReadVmOsImage ¶ added in v0.5.1
ReadVmOsImage retrieves information about a specific VM OS Image in the specified namespace
func (*Session) ReadVmSpec ¶ added in v0.5.1
ReadVmSpec retrieves information about a specific VM Spec in the specified namespace
func (*Session) RemoteCommandToInfra ¶ added in v0.5.7
func (s *Session) RemoteCommandToInfra(nsId, infraId, nodeGroupId, nodeId string, reqBody tbmodel.InfraCmdReq) (tbmodel.InfraSshCmdResultForAPI, error)
RemoteCommandToInfra sends a remote command to the nodes of the specified Infra via Tumblebug's remote command API (POST /ns/{nsId}/cmd/infra/{infraId}). Pass nodeGroupId and/or nodeId to target a specific nodeGroup or node; pass "" to target all nodes.
func (*Session) ReviewSpecImagePair ¶ added in v0.5.1
func (s *Session) ReviewSpecImagePair(req tbmodel.SpecImagePairReviewReq) (tbmodel.SpecImagePairReviewResult, error)
ReviewSpecImagePair calls POST /specImagePairReview to validate a spec-image pair and resolve the latest CSP image name (e.g., Alibaba ImageFamily resolution).
func (*Session) SearchVmOsImage ¶ added in v0.5.1
func (s *Session) SearchVmOsImage(nsId string, searchImageReq tbmodel.SearchImageRequest) (tbmodel.SearchImageResponse, error)
SearchVmOsImage searches VM OS images
func (*Session) SetCacheDuration ¶ added in v0.5.1
SetCacheDuration sets the cache duration for the request.
func (*Session) SetContext ¶ added in v0.5.1
SetContext sets the context for the request.
func (*Session) SetHeaders ¶ added in v0.5.1
SetHeaders sets multiple headers.
func (*Session) SetObjectStorageCORS ¶ added in v0.5.1
func (s *Session) SetObjectStorageCORS(nsId string, osId string, req tbmodel.ObjectStorageSetCorsRequest) error
SetObjectStorageCORS sets the CORS configuration of an object storage (bucket)
func (*Session) SetObjectStorageVersioning ¶ added in v0.5.1
func (s *Session) SetObjectStorageVersioning(nsId string, osId string, req tbmodel.ObjectStorageSetVersioningRequest) error
SetObjectStorageVersioning sets the versioning configuration of an object storage (bucket)
func (*Session) SetQueryParam ¶ added in v0.5.1
SetQueryParam sets a single query parameter.
func (*Session) SetQueryParams ¶ added in v0.5.1
SetQueryParams sets multiple query parameters.
func (*Session) SetResult ¶ added in v0.5.1
SetResult sets the result object to unmarshal the response into.
func (*Session) SetTraceInfo ¶ added in v0.5.1
SetTraceInfo injects the OpenTelemetry trace context into the request headers. This enables distributed tracing by propagating the trace ID and span ID to the Tumblebug API. It uses the global TextMapPropagator to ensure compatibility with the configured tracing backend.
Note: This method modifies the request headers in-place (merging with existing headers). It does not affect the request context or other headers, so it is safe to call regardless of the order of SetHeader or SetContext.
type TbInfraInfoList ¶ added in v0.5.1
type TumblebugClient ¶
type TumblebugClient struct {
// contains filtered or unexported fields
}
TumblebugClient is the factory for creating request sessions. It holds the shared configuration and connection pool.
func NewClient ¶
func NewClient(cfg ApiConfig) *TumblebugClient
NewClient creates a new TumblebugClient instance.
func NewDefaultClient ¶
func NewDefaultClient() *TumblebugClient
NewDefaultClient creates a new default client.
func (*TumblebugClient) NewSession ¶ added in v0.5.1
func (c *TumblebugClient) NewSession() *Session
NewSession creates a new Session for making requests.
type TumblebugTransport ¶ added in v0.5.1
type TumblebugTransport struct {
Transport http.RoundTripper
CacheDuration time.Duration
}
TumblebugTransport is a custom http.RoundTripper that adds caching and circuit breaker logic.