api

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: May 6, 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 CreateUDBUserResponse added in v0.3.1

type CreateUDBUserResponse struct {
	BaseResponse
}

type DeleteUDBUserResponse added in v0.3.1

type DeleteUDBUserResponse struct {
	BaseResponse
}

type DescribeActionLogListResponse added in v0.3.1

type DescribeActionLogListResponse struct {
	BaseResponse
	TotalCount int         `json:"TotalCount"`
	Events     []UActEvent `json:"Events"`
	NextToken  string      `json:"NextToken,omitempty"`
}

type DescribeBucketResponse

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

type DescribeMemberListResponse added in v0.3.0

type DescribeMemberListResponse struct {
	BaseResponse
	MemberSet  []MemberInfo `json:"MemberSet"`
	TotalCount int          `json:"TotalCount"`
}

type DescribeUDBInstanceResponse

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

type DescribeUDBUserResponse added in v0.3.1

type DescribeUDBUserResponse struct {
	BaseResponse
	DataSet []UDBUser `json:"DataSet"`
}

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 DescribeULogTopicResponse added in v0.3.1

type DescribeULogTopicResponse struct {
	BaseResponse
	TotalCount int         `json:"TotalCount"`
	Topics     []ULogTopic `json:"Topics"`
}

type DescribeUSMSSignatureResponse added in v0.3.1

type DescribeUSMSSignatureResponse struct {
	BaseResponse
	TotalCount int             `json:"TotalCount"`
	Signatures []USMSSignature `json:"Data"`
}

type DescribeUSMSTemplateResponse added in v0.3.1

type DescribeUSMSTemplateResponse struct {
	BaseResponse
	TotalCount int            `json:"TotalCount"`
	Templates  []USMSTemplate `json:"Data"`
}

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 IAMAttachPoliciesToUserResponse added in v0.3.0

type IAMAttachPoliciesToUserResponse struct {
	BaseResponse
}

type IAMCreateUserApiKeyResponse added in v0.3.1

type IAMCreateUserApiKeyResponse struct {
	BaseResponse
	AccessKeyID     string `json:"AccessKeyID"`
	AccessKeySecret string `json:"AccessKeySecret"`
	Status          string `json:"Status,omitempty"`
	CreatedAt       string `json:"CreatedAt,omitempty"`
}

type IAMCreateUserResponse added in v0.3.0

type IAMCreateUserResponse struct {
	BaseResponse
	APIAccess       bool   `json:"APIAccess"`
	AccessKeyID     string `json:"AccessKeyID"`
	AccessKeySecret string `json:"AccessKeySecret"`
	CompanyID       int64  `json:"CompanyId"`
	ConsoleAccess   bool   `json:"ConsoleAccess"`
	DisplayName     string `json:"DisplayName"`
	Password        string `json:"Password"`
	UserName        string `json:"UserName"`
}

type IAMDeleteUserApiKeyResponse added in v0.3.1

type IAMDeleteUserApiKeyResponse struct {
	BaseResponse
}

type IAMDeleteUserResponse added in v0.3.0

type IAMDeleteUserResponse struct {
	BaseResponse
}

type IAMDetachPoliciesFromUserResponse added in v0.3.1

type IAMDetachPoliciesFromUserResponse struct {
	BaseResponse
}

IAMDetachPoliciesFromUserResponse is the no-content reply from the `DetachPoliciesFromUser` action.

type IAMListPoliciesForUserResponse added in v0.3.1

type IAMListPoliciesForUserResponse struct {
	BaseResponse
	TotalCount int                     `json:"TotalCount"`
	Policies   []IAMUserAttachedPolicy `json:"Policies"`
}

IAMListPoliciesForUserResponse maps the `ListPoliciesForUser` action that enumerates the policies bound to a sub user. Field names mirror the URN- based attachments documented for `AttachPoliciesToUser`.

type IAMListPoliciesResponse added in v0.3.0

type IAMListPoliciesResponse struct {
	BaseResponse
	Policies   []IAMPolicyInfo `json:"Policies"`
	TotalCount int             `json:"TotalCount"`
}

type IAMListUserApiKeysResponse added in v0.3.1

type IAMListUserApiKeysResponse struct {
	BaseResponse
	TotalCount int             `json:"TotalCount"`
	ApiKeys    []IAMUserApiKey `json:"ApiKeys"`
}

type IAMListUsersResponse added in v0.3.0

type IAMListUsersResponse struct {
	BaseResponse
	TotalCount int              `json:"TotalCount"`
	Users      []IAMUserSummary `json:"Users"`
}

type IAMPolicyInfo added in v0.3.0

type IAMPolicyInfo struct {
	PolicyName string `json:"PolicyName"`
	PolicyURN  string `json:"PolicyURN"`
}

type IAMRemoveUserFromProjectResponse added in v0.3.0

type IAMRemoveUserFromProjectResponse struct {
	BaseResponse
}

type IAMUserApiKey added in v0.3.1

type IAMUserApiKey struct {
	AccessKeyID string `json:"AccessKeyID"`
	Status      string `json:"Status,omitempty"`
	CreatedAt   string `json:"CreatedAt,omitempty"`
}

IAMUserApiKey models the persistent fields of a UCloud IAM user API key. Field names follow the casing of UCloud's other IAM responses; verify against the upstream SDK before relying on this in production.

type IAMUserAttachedPolicy added in v0.3.1

type IAMUserAttachedPolicy struct {
	PolicyURN  string `json:"PolicyURN"`
	PolicyName string `json:"PolicyName,omitempty"`
	Scope      string `json:"Scope,omitempty"`
	ProjectID  string `json:"ProjectID,omitempty"`
}

type IAMUserSummary added in v0.3.0

type IAMUserSummary struct {
	CreatedAt   int64  `json:"CreatedAt"`
	DisplayName string `json:"DisplayName"`
	Email       string `json:"Email"`
	Status      string `json:"Status"`
	UserName    string `json:"UserName"`
}

type MemberInfo added in v0.3.0

type MemberInfo struct {
	ActivateFlag int                 `json:"ActivateFlag"`
	Created      int64               `json:"Created"`
	LastLogin    int64               `json:"LastLogin"`
	MemberEmail  string              `json:"MemberEmail"`
	MemberName   string              `json:"MemberName"`
	ProjectSet   []MemberProjectInfo `json:"ProjectSet"`
	State        string              `json:"State"`
}

type MemberProjectInfo added in v0.3.0

type MemberProjectInfo struct {
	CharacterID string `json:"CharacterId"`
	ProjectID   string `json:"ProjectId"`
	ProjectName string `json:"ProjectName"`
}

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 UActEvent added in v0.3.1

type UActEvent struct {
	EventID         string `json:"EventId"`
	EventName       string `json:"EventName"`
	EventTime       string `json:"EventTime"`
	EventSource     string `json:"EventSource"`
	UserName        string `json:"UserName"`
	SourceIPAddress string `json:"SourceIPAddress"`
	Region          string `json:"Region"`
	Status          string `json:"Status"`
	AccessKey       string `json:"AccessKeyId"`
	ResourceName    string `json:"ResourceName"`
	ResourceType    string `json:"ResourceType"`
}

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 UDBUser added in v0.3.1

type UDBUser struct {
	UserName string `json:"UserName"`
	IsLock   string `json:"IsLock,omitempty"`
}

UDBUser models a user account on a UCloud UDB instance.

type UFileBucketSet

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

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 ULogTopic added in v0.3.1

type ULogTopic struct {
	TopicID    string `json:"TopicID"`
	TopicName  string `json:"TopicName"`
	LogSetID   string `json:"LogSetID"`
	LogSetName string `json:"LogSetName"`
	Region     string `json:"Region"`
	CreateTime int64  `json:"CreateTime"`
	UpdateTime int64  `json:"UpdateTime"`
}

type USMSSignature added in v0.3.1

type USMSSignature struct {
	SigID      string `json:"SigId"`
	SigContent string `json:"SigContent"`
	Status     int    `json:"Status"`
	ErrMsg     string `json:"ErrMsg,omitempty"`
	UpdateTime int64  `json:"UpdateTime"`
	SigType    int    `json:"SigType"`
}

type USMSTemplate added in v0.3.1

type USMSTemplate struct {
	TemplateID   string `json:"TemplateId"`
	Template     string `json:"Template"`
	TemplateName string `json:"TemplateName"`
	TemplateType int    `json:"TemplateType"`
	Status       int    `json:"Status"`
	ErrMsg       string `json:"ErrMsg,omitempty"`
	UpdateTime   int64  `json:"UpdateTime"`
}

type UpdateBucketResponse added in v0.3.1

type UpdateBucketResponse struct {
	BaseResponse
	BucketName string `json:"BucketName"`
	BucketID   string `json:"BucketId"`
}

UpdateBucketResponse maps the JSON-RPC `UpdateBucket` action used to flip a UFile bucket's access type between private / public / limited (受限公开读).

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