api

package
v0.2.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 27, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultBaseURL = "https://api.ucloud.cn"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type APIError

type APIError struct {
	Action     string
	Code       int
	Message    string
	RawBody    string
	StatusCode int
}

func (*APIError) Error

func (e *APIError) Error() string

type AccountInfo

type AccountInfo struct {
	Amount          string `json:"Amount"`
	AmountAvailable string `json:"AmountAvailable"`
}

type BaseResponse

type BaseResponse struct {
	Action  string  `json:"Action"`
	RetCode RetCode `json:"RetCode"`
	Message string  `json:"Message"`
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(credential ucloudauth.Credential, opts ...Option) *Client

func (*Client) Do

func (c *Client) Do(ctx context.Context, req Request, out any) error

type DescribeBucketResponse

type DescribeBucketResponse struct {
	BaseResponse
	DataSet []UFileBucketSet `json:"DataSet"`
}

type DescribeUDBInstanceResponse

type DescribeUDBInstanceResponse struct {
	BaseResponse
	DataSet    []UDBInstanceSet `json:"DataSet"`
	TotalCount int              `json:"TotalCount"`
}

type DescribeUDNSRecordResponse

type DescribeUDNSRecordResponse struct {
	BaseResponse
	RecordInfos []RecordInfo `json:"RecordInfos"`
	TotalCount  int          `json:"TotalCount"`
}

type DescribeUDNSZoneResponse

type DescribeUDNSZoneResponse struct {
	BaseResponse
	DNSZoneInfos []ZoneInfo `json:"DNSZoneInfos"`
	TotalCount   int        `json:"TotalCount"`
}

type DescribeUHostInstanceResponse

type DescribeUHostInstanceResponse struct {
	BaseResponse
	TotalCount int        `json:"TotalCount"`
	UHostSet   []UHostSet `json:"UHostSet"`
}

type GetBalanceResponse

type GetBalanceResponse struct {
	BaseResponse
	AccountInfo AccountInfo `json:"AccountInfo"`
}

type GetProjectListResponse

type GetProjectListResponse struct {
	BaseResponse
	ProjectSet []ProjectListInfo `json:"ProjectSet"`
}

type GetRegionResponse

type GetRegionResponse struct {
	BaseResponse
	Regions []RegionInfo `json:"Regions"`
}

type GetUserInfoResponse

type GetUserInfoResponse struct {
	BaseResponse
	DataSet []UserInfo `json:"DataSet"`
}

type Option

type Option func(*Client)

func WithBaseURL

func WithBaseURL(baseURL string) Option

func WithHTTPClient

func WithHTTPClient(httpClient *http.Client) Option

func WithProjectID

func WithProjectID(projectID string) Option

func WithRetryPolicy

func WithRetryPolicy(policy RetryPolicy) Option

type ProjectListInfo

type ProjectListInfo struct {
	IsDefault   bool   `json:"IsDefault"`
	ProjectID   string `json:"ProjectId"`
	ProjectName string `json:"ProjectName"`
}

type RecordInfo

type RecordInfo struct {
	Name     string     `json:"Name"`
	Type     string     `json:"Type"`
	ValueSet []ValueSet `json:"ValueSet"`
}

type RegionInfo

type RegionInfo struct {
	Region string `json:"Region"`
}

type Request

type Request struct {
	Action     string
	Region     string
	ProjectID  string
	Params     map[string]any
	Idempotent bool
}

type RetCode

type RetCode int

func (*RetCode) UnmarshalJSON

func (r *RetCode) UnmarshalJSON(data []byte) error

type RetryPolicy

type RetryPolicy = httpclient.RetryPolicy

func DefaultRetryPolicy

func DefaultRetryPolicy() RetryPolicy

type UDBInstanceSet

type UDBInstanceSet struct {
	DBID         string `json:"DBId"`
	DBSubVersion string `json:"DBSubVersion"`
	DBTypeID     string `json:"DBTypeId"`
	Name         string `json:"Name"`
	Port         int    `json:"Port"`
	SubnetID     string `json:"SubnetId"`
	VirtualIP    string `json:"VirtualIP"`
	VPCID        string `json:"VPCId"`
}

type UFileBucketSet

type UFileBucketSet struct {
	BucketName string `json:"BucketName"`
	Region     string `json:"Region"`
}

type UHostIPSet

type UHostIPSet struct {
	Default string `json:"Default"`
	IP      string `json:"IP"`
	IPMode  string `json:"IPMode"`
	Type    string `json:"Type"`
	Weight  int    `json:"Weight"`
}

type UHostSet

type UHostSet struct {
	IPSet   []UHostIPSet `json:"IPSet"`
	Name    string       `json:"Name"`
	OsType  string       `json:"OsType"`
	State   string       `json:"State"`
	UHostID string       `json:"UHostId"`
}

type UserInfo

type UserInfo struct {
	UserEmail string `json:"UserEmail"`
	UserID    int    `json:"UserId"`
	UserName  string `json:"UserName"`
}

type ValueSet

type ValueSet struct {
	Data      string `json:"Data"`
	IsEnabled int    `json:"IsEnabled"`
}

type ZoneInfo

type ZoneInfo struct {
	DNSZoneID   string `json:"DNSZoneId"`
	DNSZoneName string `json:"DNSZoneName"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL