Documentation
¶
Index ¶
- Constants
- func DecodeError(statusCode int, body []byte) error
- func ErrorCode(err error) string
- func NewHTTPClient() *http.Client
- func NewTransport() *http.Transport
- func ResolveEndpoint(service, region, siteStack string) string
- type APIError
- type Client
- func (c *Client) DescribeInstances(ctx context.Context, region string, maxResults int32, nextToken string) (DescribeInstancesResponse, error)
- func (c *Client) DescribeRegions(ctx context.Context, region string, maxResults int32) (DescribeRegionsResponse, error)
- func (c *Client) DoOpenAPI(ctx context.Context, req Request, out any) error
- func (c *Client) GetLoginProfile(ctx context.Context, region, userName string) (GetLoginProfileResponse, error)
- func (c *Client) ListProjects(ctx context.Context, region string) (ListProjectsResponse, error)
- func (c *Client) ListUsers(ctx context.Context, region string, limit, offset int32) (ListUsersResponse, error)
- func (c *Client) QueryBalanceAcct(ctx context.Context, region string) (QueryBalanceAcctResponse, error)
- type DescribeInstancesResponse
- type DescribeRegionsResponse
- type ECSEipAddress
- type ECSInstance
- type ECSNetworkInterface
- type ECSRegion
- type ErrorBody
- type GetLoginProfileResponse
- type IAMLoginProfile
- type IAMProject
- type IAMUserMetadata
- type ListProjectsResponse
- type ListUsersResponse
- type Option
- type QueryBalanceAcctResponse
- type Request
- type ResponseMetadata
- type RetryPolicy
- type SignInput
- type Signature
Constants ¶
View Source
const ( Algorithm = "HMAC-SHA256" DateFormat = "20060102T150405Z" HeaderAuthorization = "Authorization" HeaderXDate = "X-Date" HeaderXContentSHA256 = "X-Content-Sha256" HeaderXSecurityToken = "X-Security-Token" )
View Source
const (
DefaultRegion = "cn-beijing"
)
View Source
const (
DefaultTimeout = 30 * time.Second
)
Variables ¶
This section is empty.
Functions ¶
func DecodeError ¶
func NewHTTPClient ¶
func NewTransport ¶
func ResolveEndpoint ¶
ResolveEndpoint returns the HTTPS base URL for a Volcengine OpenAPI service.
Types ¶
type APIError ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) DescribeInstances ¶
func (*Client) DescribeRegions ¶
func (*Client) GetLoginProfile ¶
func (*Client) ListProjects ¶
func (*Client) QueryBalanceAcct ¶
type DescribeInstancesResponse ¶
type DescribeInstancesResponse struct {
ResponseMetadata ResponseMetadata `json:"ResponseMetadata"`
Result struct {
NextToken string `json:"NextToken"`
Instances []ECSInstance `json:"Instances"`
} `json:"Result"`
}
type DescribeRegionsResponse ¶
type DescribeRegionsResponse struct {
ResponseMetadata ResponseMetadata `json:"ResponseMetadata"`
Result struct {
NextToken string `json:"NextToken"`
Regions []ECSRegion `json:"Regions"`
} `json:"Result"`
}
type ECSEipAddress ¶
type ECSEipAddress struct {
IPAddress string `json:"IpAddress"`
}
type ECSInstance ¶
type ECSInstance struct {
InstanceID string `json:"InstanceId"`
Hostname string `json:"Hostname"`
Status string `json:"Status"`
OSType string `json:"OsType"`
EipAddress ECSEipAddress `json:"EipAddress"`
NetworkInterfaces []ECSNetworkInterface `json:"NetworkInterfaces"`
}
type ECSNetworkInterface ¶
type ECSNetworkInterface struct {
PrimaryIPAddress string `json:"PrimaryIpAddress"`
}
type GetLoginProfileResponse ¶
type GetLoginProfileResponse struct {
ResponseMetadata ResponseMetadata `json:"ResponseMetadata"`
Result struct {
LoginProfile IAMLoginProfile `json:"LoginProfile"`
} `json:"Result"`
}
type IAMLoginProfile ¶
type IAMProject ¶
type IAMUserMetadata ¶
type ListProjectsResponse ¶
type ListProjectsResponse struct {
ResponseMetadata ResponseMetadata `json:"ResponseMetadata"`
Result struct {
Projects []IAMProject `json:"Projects"`
Total int32 `json:"Total"`
} `json:"Result"`
}
type ListUsersResponse ¶
type ListUsersResponse struct {
ResponseMetadata ResponseMetadata `json:"ResponseMetadata"`
Result struct {
UserMetadata []IAMUserMetadata `json:"UserMetadata"`
Total int32 `json:"Total"`
Limit int32 `json:"Limit"`
Offset int32 `json:"Offset"`
} `json:"Result"`
}
type Option ¶
type Option func(*Client)
func WithBaseURL ¶
func WithHTTPClient ¶
func WithRetryPolicy ¶
func WithRetryPolicy(p RetryPolicy) Option
func WithSiteStack ¶
type QueryBalanceAcctResponse ¶
type QueryBalanceAcctResponse struct {
ResponseMetadata ResponseMetadata `json:"ResponseMetadata"`
Result struct {
AvailableBalance string `json:"AvailableBalance"`
} `json:"Result"`
}
type ResponseMetadata ¶
type RetryPolicy ¶
type RetryPolicy struct {
MaxAttempts int
BaseDelay time.Duration
MaxDelay time.Duration
Sleep func(context.Context, time.Duration) error
}
func DefaultRetryPolicy ¶
func DefaultRetryPolicy() RetryPolicy
Click to show internal directories.
Click to hide internal directories.