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 COCBatchExecuteCommandRequest
- type COCBatchExecuteCommandResponse
- type COCDescribeJobResponse
- type COCJobInstanceResult
- type Client
- func (c *Client) COCBatchExecuteCommand(ctx context.Context, region string, body []byte) (COCBatchExecuteCommandResponse, error)
- func (c *Client) COCDescribeJob(ctx context.Context, region, orderID string) (COCDescribeJobResponse, 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 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 COCBatchExecuteCommandRequest ¶ added in v0.3.1
type COCBatchExecuteCommandRequest struct {
InstanceIDs []string `json:"instance_ids"`
WorkingDir string `json:"working_dir,omitempty"`
Content string `json:"content"`
ScriptType string `json:"script_type"`
Username string `json:"username,omitempty"`
ExecutionMode string `json:"execution_mode,omitempty"`
TimeoutSec int64 `json:"execute_timeout,omitempty"`
}
type COCBatchExecuteCommandResponse ¶ added in v0.3.1
type COCDescribeJobResponse ¶ added in v0.3.1
type COCDescribeJobResponse struct {
OrderID string `json:"order_id"`
JobID string `json:"job_id"`
Status string `json:"status"`
Results []COCJobInstanceResult `json:"instances"`
}
type COCJobInstanceResult ¶ added in v0.3.1
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) COCBatchExecuteCommand ¶ added in v0.3.1
func (c *Client) COCBatchExecuteCommand(ctx context.Context, region string, body []byte) (COCBatchExecuteCommandResponse, error)
COCBatchExecuteCommand submits a script execution against `instanceIDs`. `script` is the raw shell content; the driver wraps it in /bin/bash.
func (*Client) COCDescribeJob ¶ added in v0.3.1
func (c *Client) COCDescribeJob(ctx context.Context, region, orderID string) (COCDescribeJobResponse, error)
COCDescribeJob polls the status of a previously submitted execution.
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 {
Signs []MSGSMSSign `json:"signs"`
TotalCount int `json:"total_count"`
}
type ListSmsTemplateResponse ¶ added in v0.3.1
type ListSmsTemplateResponse struct {
Templates []MSGSMSTemplate `json:"templates"`
TotalCount int `json:"total_count"`
}
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 Option ¶
type Option func(*Client)
func WithBaseURL ¶
func WithHTTPClient ¶
func WithRetryPolicy ¶
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"`
}