Documentation
¶
Index ¶
- Constants
- func AuthHeaderValue(signature, accessKey string, signedHeaders []string) string
- func DecodeError(statusCode int, body []byte) error
- func ErrorCode(err error) string
- func IsAccessDenied(err error) bool
- func IsNotFound(err error) bool
- func IsProjectNotFound(err error) bool
- func NewHTTPClient() *http.Client
- func ResolveProjectID(ctx context.Context, client *Client, domainID, targetRegion string) (string, error)
- func Sign(req *SignRequest) (map[string]string, error)
- type APIError
- type AccountBalance
- type COCCreateScriptRequest
- type COCCreateScriptResponse
- type COCDeleteScriptResponse
- type COCExecuteInstancesBatchInfo
- type COCExecuteResourceInstance
- type COCExecuteScriptRequest
- type COCExecuteScriptResponse
- type COCExecutionInstance
- type COCGetScriptJobBatchResponse
- type COCGetScriptJobInfoResponse
- type COCJobScriptBatchDetail
- type COCJobScriptOrderInfo
- type COCJobScriptOrderInfoProps
- type COCResourceInstance
- type COCScriptExecuteParam
- type COCScriptProperties
- type Client
- func (c *Client) COCCreateScript(ctx context.Context, region, projectID string, body []byte) (COCCreateScriptResponse, error)
- func (c *Client) COCDeleteScript(ctx context.Context, region, projectID, scriptUUID string) (COCDeleteScriptResponse, error)
- func (c *Client) COCExecuteScript(ctx context.Context, region, projectID, scriptUUID string, body []byte) (COCExecuteScriptResponse, error)
- func (c *Client) COCGetScriptJobBatch(ctx context.Context, region, projectID, executeUUID string, batchIndex int32) (COCGetScriptJobBatchResponse, error)
- func (c *Client) COCGetScriptJobInfo(ctx context.Context, region, projectID, executeUUID string) (COCGetScriptJobInfoResponse, error)
- func (c *Client) DoJSON(ctx context.Context, req Request, out any) error
- type CreatePermanentAccessKeyOption
- type CreatePermanentAccessKeyRequest
- type CreatePermanentAccessKeyResponse
- type CreateRDSDBUserRequest
- type CreateRDSDBUserResponse
- type CreateUserOption
- type CreateUserRequest
- type CreateUserResponse
- type DNSLink
- type DNSMeta
- type DNSRecord
- type DNSZone
- type DeleteRDSDBUserResponse
- type ECSServerAddress
- type ECSServerDetail
- type IAMDomain
- type IAMGroup
- type IAMPermanentCredential
- type IAMProject
- type IAMUser
- type IAMUserV5
- type LTSLogGroup
- type ListAuthDomainsResponse
- type ListECSServersDetailsResponse
- type ListGroupsForUserResponse
- type ListGroupsResponse
- type ListLogGroupsResponse
- type ListPermanentAccessKeysResponse
- type ListProjectsResponse
- type ListRDSDBUsersResponse
- type ListRDSInstancesResponse
- type ListRecordSetsResponse
- type ListRegionsResponse
- type ListSmsSignResponse
- type ListSmsTemplateResponse
- type ListTracesResponse
- type ListUsersResponse
- type ListUsersV5Response
- type ListZonesResponse
- type MSGSMSSign
- type MSGSMSTemplate
- type Option
- type ProjectCatalog
- type ProjectNotFoundError
- type RDSDBUser
- type RDSDatastore
- type RDSInstance
- type Region
- type Request
- type RetryPolicy
- type Retryer
- type ShowCustomerAccountBalancesResponse
- type ShowPermanentAccessKeyResponse
- type ShowUserResponse
- type SignRequest
- type Trace
- type TraceMetaData
- type TraceUser
Constants ¶
const ( BasicDateFormat = "20060102T150405Z" Algorithm = "SDK-HMAC-SHA256" HeaderXDate = "X-Sdk-Date" HeaderHost = "host" HeaderAuthorization = "Authorization" HeaderContentSha256 = "X-Sdk-Content-Sha256" )
const (
DefaultTimeout = 30 * time.Second
)
Variables ¶
This section is empty.
Functions ¶
func AuthHeaderValue ¶
func DecodeError ¶
func IsAccessDenied ¶ added in v0.2.5
func IsNotFound ¶
func IsProjectNotFound ¶
func NewHTTPClient ¶
Types ¶
type AccountBalance ¶
type COCCreateScriptRequest ¶ added in v0.3.3
type COCCreateScriptResponse ¶ added in v0.3.3
type COCCreateScriptResponse struct {
Data string `json:"data"`
}
type COCDeleteScriptResponse ¶ added in v0.3.3
type COCDeleteScriptResponse struct {
Data string `json:"data,omitempty"`
}
type COCExecuteInstancesBatchInfo ¶ added in v0.3.3
type COCExecuteInstancesBatchInfo struct {
BatchIndex int32 `json:"batch_index"`
TargetInstances []COCExecuteResourceInstance `json:"target_instances"`
RotationStrategy string `json:"rotation_strategy"`
}
type COCExecuteResourceInstance ¶ added in v0.3.3
type COCExecuteScriptRequest ¶ added in v0.3.3
type COCExecuteScriptRequest struct {
ExecuteParam COCScriptExecuteParam `json:"execute_param"`
ExecuteBatches []COCExecuteInstancesBatchInfo `json:"execute_batches"`
}
type COCExecuteScriptResponse ¶ added in v0.3.3
type COCExecuteScriptResponse struct {
Data string `json:"data"`
}
type COCExecutionInstance ¶ added in v0.3.3
type COCExecutionInstance struct {
TargetInstance *COCResourceInstance `json:"target_instance,omitempty"`
Status string `json:"status,omitempty"`
Message string `json:"message,omitempty"`
}
type COCGetScriptJobBatchResponse ¶ added in v0.3.3
type COCGetScriptJobBatchResponse struct {
Data *COCJobScriptBatchDetail `json:"data,omitempty"`
}
type COCGetScriptJobInfoResponse ¶ added in v0.3.3
type COCGetScriptJobInfoResponse struct {
Data *COCJobScriptOrderInfo `json:"data,omitempty"`
}
type COCJobScriptBatchDetail ¶ added in v0.3.3
type COCJobScriptBatchDetail struct {
BatchIndex int32 `json:"batch_index,omitempty"`
TotalInstances int32 `json:"total_instances,omitempty"`
ExecuteInstances []COCExecutionInstance `json:"execute_instances,omitempty"`
}
type COCJobScriptOrderInfo ¶ added in v0.3.3
type COCJobScriptOrderInfo struct {
ExecuteUUID string `json:"execute_uuid,omitempty"`
Status string `json:"status,omitempty"`
Properties *COCJobScriptOrderInfoProps `json:"properties,omitempty"`
}
type COCJobScriptOrderInfoProps ¶ added in v0.3.3
type COCJobScriptOrderInfoProps struct {
CurrentExecuteBatchIndex int32 `json:"current_execute_batch_index,omitempty"`
}
type COCResourceInstance ¶ added in v0.3.3
type COCScriptExecuteParam ¶ added in v0.3.3
type COCScriptProperties ¶ added in v0.3.3
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) COCCreateScript ¶ added in v0.3.3
func (*Client) COCDeleteScript ¶ added in v0.3.3
func (*Client) COCExecuteScript ¶ added in v0.3.3
func (*Client) COCGetScriptJobBatch ¶ added in v0.3.3
func (*Client) COCGetScriptJobInfo ¶ added in v0.3.3
type CreatePermanentAccessKeyOption ¶ added in v0.3.1
type CreatePermanentAccessKeyRequest ¶ added in v0.3.1
type CreatePermanentAccessKeyRequest struct {
Credential CreatePermanentAccessKeyOption `json:"credential"`
}
type CreatePermanentAccessKeyResponse ¶ added in v0.3.1
type CreatePermanentAccessKeyResponse struct {
Credential IAMPermanentCredential `json:"credential"`
}
type CreateRDSDBUserRequest ¶ added in v0.3.1
type CreateRDSDBUserResponse ¶ added in v0.3.1
type CreateRDSDBUserResponse struct {
Resp string `json:"resp,omitempty"`
}
type CreateUserOption ¶
type CreateUserRequest ¶
type CreateUserRequest struct {
User CreateUserOption `json:"user"`
}
type CreateUserResponse ¶
type DNSZone ¶ added in v0.3.1
type DNSZone struct {
ID string `json:"id"`
Name string `json:"name"`
Email string `json:"email"`
Description string `json:"description"`
Status string `json:"status"`
ZoneType string `json:"zone_type"`
RecordNum int64 `json:"record_num"`
PoolID string `json:"pool_id"`
ProjectID string `json:"project_id"`
}
DNSZone is the per-zone wire representation. `Name` is fully-qualified with a trailing dot ("example.com.") in DNS API responses; the cloudlist driver trims the dot before surfacing.
type DeleteRDSDBUserResponse ¶ added in v0.3.1
type DeleteRDSDBUserResponse struct {
Resp string `json:"resp,omitempty"`
}
type ECSServerAddress ¶
type ECSServerDetail ¶
type ECSServerDetail struct {
ID string `json:"id"`
Status string `json:"status"`
Name string `json:"name"`
Addresses map[string][]ECSServerAddress `json:"addresses"`
}
type IAMPermanentCredential ¶ added in v0.3.1
type IAMProject ¶
type LTSLogGroup ¶ added in v0.3.1
type ListAuthDomainsResponse ¶
type ListAuthDomainsResponse struct {
Domains []IAMDomain `json:"domains"`
}
type ListECSServersDetailsResponse ¶
type ListECSServersDetailsResponse struct {
Count int32 `json:"count"`
Servers []ECSServerDetail `json:"servers"`
}
type ListGroupsForUserResponse ¶ added in v0.3.1
type ListGroupsForUserResponse struct {
Groups []IAMGroup `json:"groups"`
}
ListGroupsForUserResponse models the keystone `GET /v3/users/{user_id}/groups` payload.
type ListGroupsResponse ¶
type ListGroupsResponse struct {
Groups []IAMGroup `json:"groups"`
}
type ListLogGroupsResponse ¶ added in v0.3.1
type ListLogGroupsResponse struct {
LogGroups []LTSLogGroup `json:"log_groups"`
}
type ListPermanentAccessKeysResponse ¶ added in v0.3.1
type ListPermanentAccessKeysResponse struct {
Credentials []IAMPermanentCredential `json:"credentials"`
}
type ListProjectsResponse ¶
type ListProjectsResponse struct {
Projects []IAMProject `json:"projects"`
}
type ListRDSDBUsersResponse ¶ added in v0.3.1
type ListRDSInstancesResponse ¶
type ListRDSInstancesResponse struct {
Instances []RDSInstance `json:"instances"`
TotalCount *int32 `json:"total_count"`
}
type ListRecordSetsResponse ¶ added in v0.3.1
type ListRecordSetsResponse struct {
Links *DNSLink `json:"links"`
Metadata DNSMeta `json:"metadata"`
RecordSets []DNSRecord `json:"recordsets"`
}
ListRecordSetsResponse is the typed shape of `GET /v2/zones/{zone_id}/recordsets`. Records is heterogeneous over record type — the wire format keeps every value as a string, with type-specific formatting (e.g. MX is "<preference> <exchange>").
type ListRegionsResponse ¶
type ListRegionsResponse struct {
Regions []Region `json:"regions"`
}
type ListSmsSignResponse ¶ added in v0.3.1
type ListSmsSignResponse struct {
Results []MSGSMSSign `json:"results"`
Total int64 `json:"total"`
}
type ListSmsTemplateResponse ¶ added in v0.3.1
type ListSmsTemplateResponse struct {
Results []MSGSMSTemplate `json:"results"`
Total int64 `json:"total"`
}
type ListTracesResponse ¶ added in v0.3.1
type ListTracesResponse struct {
Traces []Trace `json:"traces"`
MetaData TraceMetaData `json:"meta_data"`
}
type ListUsersResponse ¶
type ListUsersResponse struct {
Users []IAMUser `json:"users"`
}
type ListUsersV5Response ¶
type ListUsersV5Response struct {
Users []IAMUserV5 `json:"users"`
}
type ListZonesResponse ¶ added in v0.3.1
type ListZonesResponse struct {
Links *DNSLink `json:"links"`
Metadata DNSMeta `json:"metadata"`
Zones []DNSZone `json:"zones"`
}
ListZonesResponse is the typed shape of `GET /v2/zones`. Only public zones are listed at this path; private zones use a separate endpoint.
type MSGSMSSign ¶ added in v0.3.1
type MSGSMSTemplate ¶ added in v0.3.1
type MSGSMSTemplate struct {
ID string `json:"id"`
TemplateID string `json:"template_id"`
TemplateName string `json:"template_name"`
Content string `json:"template_content"`
Status string `json:"status"`
FlowStatus string `json:"flow_status"`
TemplateType string `json:"template_type"`
CreateTime string `json:"create_time"`
Reason string `json:"review_desc"`
}
type Option ¶
type Option func(*Client)
func WithBaseURL ¶
func WithHTTPClient ¶
func WithRetryPolicy ¶
type ProjectCatalog ¶ added in v0.3.2
type ProjectCatalog struct {
// contains filtered or unexported fields
}
func ListAccessibleProjectCatalog ¶ added in v0.3.2
func ListAccessibleProjectCatalog(ctx context.Context, client *Client, domainID string) (*ProjectCatalog, error)
ListAccessibleProjectCatalog fetches the project list visible to the current credential and indexes it by region name.
func NewProjectCatalog ¶ added in v0.3.2
func NewProjectCatalog(projects []IAMProject, domainID string) *ProjectCatalog
NewProjectCatalog indexes IAM projects by region name, preferring projects in domainID when duplicate names are present.
func (*ProjectCatalog) FilterRegions ¶ added in v0.3.2
func (c *ProjectCatalog) FilterRegions(regions []string) []string
FilterRegions keeps only regions that exist in the catalog.
type ProjectNotFoundError ¶
type ProjectNotFoundError struct {
Region string
}
func (*ProjectNotFoundError) Error ¶
func (e *ProjectNotFoundError) Error() string
type RDSDBUser ¶ added in v0.3.1
type RDSDBUser struct {
Name string `json:"name"`
Host string `json:"host,omitempty"`
Comment string `json:"comment,omitempty"`
State string `json:"state,omitempty"`
}
RDSDBUser models the RDS MySQL user resource. The control-plane endpoints share this shape across engines (MySQL, PostgreSQL); per-engine paths differ but the request/response payloads are equivalent.
type RDSDatastore ¶
type RDSInstance ¶
type RetryPolicy ¶
type RetryPolicy = httpclient.RetryPolicy
func DefaultRetryPolicy ¶
func DefaultRetryPolicy() RetryPolicy
type ShowCustomerAccountBalancesResponse ¶
type ShowCustomerAccountBalancesResponse struct {
AccountBalances []AccountBalance `json:"account_balances"`
}
type ShowUserResponse ¶
type SignRequest ¶
type Trace ¶ added in v0.3.1
type Trace struct {
TraceID string `json:"trace_id"`
TraceName string `json:"trace_name"`
TraceRating string `json:"trace_rating"`
TraceType string `json:"trace_type"`
Code string `json:"code"`
APIService string `json:"service_type"`
OperationID string `json:"operation_id"`
ResourceID string `json:"resource_id"`
ResourceName string `json:"resource_name"`
ResourceType string `json:"resource_type"`
SourceIP string `json:"source_ip"`
Time int64 `json:"time"`
User TraceUser `json:"user"`
}