cas

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: May 24, 2020 License: Apache-2.0 Imports: 29 Imported by: 0

README

Go API client for cas

Tecent Cloud Archive Storage Golang SDK.

Overview

This API client was generated by the OpenAPI Generator project. By using the OpenAPI-spec from a remote server, you can easily generate an API client.

Installation

Install the following dependencies:

go get github.com/stretchr/testify/assert
go get golang.org/x/oauth2
go get golang.org/x/net/context
go get github.com/antihax/optional

Put the package under your project folder and add the following in import:

import "./cas"

Documentation for API Endpoints

All URIs are relative to http://cas.ap-beijing.myqcloud.com/-

Class Method HTTP request Description
ArchiveApi VaultsVaultNameArchivesArchiveIDDelete Delete /vaults/{VaultName}/archives/{ArchiveID} Delete Archive
ArchiveApi VaultsVaultNameArchivesPost Post /vaults/{VaultName}/archives Upload Archive
ArchiveApi VaultsVaultNameMultipartUploadsGet Get /vaults/{VaultName}/multipart-uploads List Multipart Uploads
ArchiveApi VaultsVaultNameMultipartUploadsPost Post /vaults/{VaultName}/multipart-uploads Initiate Multipart Upload
ArchiveApi VaultsVaultNameMultipartUploadsUploadIDDelete Delete /vaults/{VaultName}/multipart-uploads/{uploadID} Abort Multipart Upload
ArchiveApi VaultsVaultNameMultipartUploadsUploadIDGet Get /vaults/{VaultName}/multipart-uploads/{uploadID} List Parts
ArchiveApi VaultsVaultNameMultipartUploadsUploadIDPost Post /vaults/{VaultName}/multipart-uploads/{uploadID} Complete Multipart Upload
ArchiveApi VaultsVaultNameMultipartUploadsUploadIDPut Put /vaults/{VaultName}/multipart-uploads/{uploadID} Upload Part
JobApi VaultsVaultNameJobsGet Get /vaults/{VaultName}/jobs List Job
JobApi VaultsVaultNameJobsJobIDGet Get /vaults/{VaultName}/jobs/<JobID> Describe Job
JobApi VaultsVaultNameJobsJobIDOutputGet Get /vaults/{VaultName}/jobs/<JobID>/output Get Job Output
JobApi VaultsVaultNameJobsPost Post /vaults/{VaultName}/jobs Initiate Job
VaultApi CreateVault Put /vaults/{VaultName} 创建vault
VaultApi GetVault Get /vaults/{VaultName} Describe Vault
VaultApi VaultsGet Get /vaults List Vaults
VaultApi VaultsVaultNameAccessPolicyDelete Delete /vaults/{VaultName}/access-policy Delete Vault Access Policy
VaultApi VaultsVaultNameAccessPolicyGet Get /vaults/{VaultName}/access-policy Get Vault Access Policy 请求读取一个 Vault 的权限
VaultApi VaultsVaultNameAccessPolicyPut Put /vaults/{VaultName}/access-policy Set Vault Access Policy
VaultApi VaultsVaultNameDelete Delete /vaults/{VaultName} 删除vault
VaultApi VaultsVaultNameNotificationConfigurationDelete Delete /vaults/{VaultName}/notification-configuration Delete Vault Notifications
VaultApi VaultsVaultNameNotificationConfigurationGet Get /vaults/{VaultName}/notification-configuration Get Vault Notifications
VaultApi VaultsVaultNameNotificationConfigurationPut Put /vaults/{VaultName}/notification-configuration Set Vault Access Policy

Documentation For Models

Documentation For Authorization

ApiKeyAuth

  • Type: API key

Example

auth := context.WithValue(context.Background(), sw.ContextAPIKey, sw.APIKey{
    Key: "APIKEY",
    Prefix: "Bearer", // Omit if not necessary.
})
r, err := client.Service.Operation(auth, args)

Author

chennqqi@qq.com

Documentation

Index

Constants

View Source
const (
	DefaultSendBufferSize = 8192
	DefaultGetBufferSize  = 1024 * 1024 * 10
	DefaultAuthTimeout    = time.Second * 1200

	DEFAULT_NORMAL_UPLOAD_THRESHOLD = 100 * 1024 * 1024              // 单文件的默认最大上传阈值
	RECOMMEND_MIN_PART_SIZE         = 16 * 1024 * 1024               // 推荐的最小分片大小
	MAX_PART_NUM                    = 10000                          // 最大的分片数目
	MAX_FILE_SIZE                   = 4 * 10000 * 1024 * 1024 * 1024 //最大支持40TB的文件存储
)

Variables

View Source
var (
	// ContextOAuth2 takes an oauth2.TokenSource as authentication for the request.
	ContextOAuth2 = contextKey("token")

	// ContextBasicAuth takes BasicAuth as authentication for the request.
	ContextBasicAuth = contextKey("basic")

	// ContextAccessToken takes a string oauth2 access token as authentication for the request.
	ContextAccessToken = contextKey("accesstoken")

	// ContextAPIKey takes an APIKey as authentication for the request
	ContextAPIKey = contextKey("apikey")
)

Functions

func CacheExpires

func CacheExpires(r *http.Response) time.Time

CacheExpires helper function to determine remaining time before repeating a request.

func CalSignKey

func CalSignKey(start int64, expire time.Duration, accessSecret string) string

Types

type APIClient

type APIClient struct {
	ArchiveApi *ArchiveApiService

	JobApi *JobApiService

	VaultApi *VaultApiService

	ConfigurationAuthor
	// contains filtered or unexported fields
}

APIClient manages communication with the Tecent Cloud Archive Storage Golang SDK. API v1.5.0 In most cases there should be only one, shared, APIClient.

func NewAPIClient

func NewAPIClient(cfg *Configuration) *APIClient

NewAPIClient creates a new API client. Requires a userAgent string describing your application. optionally a custom http.Client to allow for advanced features such as caching.

func (*APIClient) ChangeBasePath

func (c *APIClient) ChangeBasePath(path string)

ChangeBasePath changes base path to allow switching to mocks

func (*APIClient) GetConfig

func (c *APIClient) GetConfig() *Configuration

Allow modification of underlying config for alternate implementations and testing Caution: modifying the configuration while live can cause data races and potentially unwanted behavior

type APIKey

type APIKey struct {
	Key    string
	Prefix string
}

APIKey provides API key based authentication to a request passed via context using ContextAPIKey

type APIResponse

type APIResponse struct {
	*http.Response `json:"-"`
	Message        string `json:"message,omitempty"`
	// Operation is the name of the OpenAPI operation.
	Operation string `json:"operation,omitempty"`
	// RequestURL is the request URL. This value is always available, even if the
	// embedded *http.Response is nil.
	RequestURL string `json:"url,omitempty"`
	// Method is the HTTP method used for the request.  This value is always
	// available, even if the embedded *http.Response is nil.
	Method string `json:"method,omitempty"`
	// Payload holds the contents of the response body (which may be nil or empty).
	// This is provided here as the raw response.Body() reader will have already
	// been drained.
	Payload []byte `json:"-"`
}

APIResponse stores the API response returned by the server.

func NewAPIResponse

func NewAPIResponse(r *http.Response) *APIResponse

NewAPIResponse returns a new APIResonse object.

func NewAPIResponseWithError

func NewAPIResponseWithError(errorMessage string) *APIResponse

NewAPIResponseWithError returns a new APIResponse object with the provided error message.

type ArchiveApiService

type ArchiveApiService service

ArchiveApiService ArchiveApi service

func (*ArchiveApiService) VaultsVaultNameArchivesArchiveIDDelete

func (a *ArchiveApiService) VaultsVaultNameArchivesArchiveIDDelete(ctx _context.Context, vaultName string, archiveID string) (*_nethttp.Response, error)

VaultsVaultNameArchivesArchiveIDDelete Delete Archive Delete Archive 请求实现删除一个 Archive。请求成功以后会返回 x-cas-archive-id 用来表示唯一的 Archive 文件。请求成功返回 204 No Content。在删除 Archive 后,您仍可能成功请求启动对已删除 Archive 的检索任务,但 Archive 检索任务会失败。 在您删除 Archive 时,对相应 Archive ID 正在进行的 Archive 检索可能成功,也可能不成功,具体取决于下面的场景:收到删除 Archive 请求时,Archive 检索任务正在下载 Archive 到缓存池,则 Archive 检索操作可能会失败。 收到删除 Archive 请求时,Archive 检索任务已经下载 Archive 到缓存池,则您将能够下载输出。支持跨账户操作。当操作本账户时,UID 为\&quot;-\&quot;。

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param vaultName
  • @param archiveID

func (*ArchiveApiService) VaultsVaultNameArchivesPost

func (a *ArchiveApiService) VaultsVaultNameArchivesPost(ctx _context.Context, vaultName string, xCasContentSha256 string, contentLength string, xCasSha256TreeHash string, body io.Reader, localVarOptionals *VaultsVaultNameArchivesPostOpts) (*_nethttp.Response, error)

VaultsVaultNameArchivesPost Upload Archive Upload Archive 请求实现上传一个 Archive 到指定 Vault。请求成功以后会返回 x-cas-archive-id 用来表示唯一的Archive 文件。请求成功返回 201 Created。上传文件时,可以指定 x-cas-archive-description 用来做文件内容备注。支持跨账户操作。当操作本账户时,UID为\&quot;-\&quot;。

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param vaultName
  • @param xCasContentSha256
  • @param contentLength
  • @param xCasSha256TreeHash
  • @param body
  • @param optional nil or *VaultsVaultNameArchivesPostOpts - Optional Parameters:
  • @param "XCasArchiveDescription" (optional.String) -

func (*ArchiveApiService) VaultsVaultNameMultipartUploadsGet

func (a *ArchiveApiService) VaultsVaultNameMultipartUploadsGet(ctx _context.Context, vaultName string, localVarOptionals *VaultsVaultNameMultipartUploadsGetOpts) (VaultsSummary, *_nethttp.Response, error)

VaultsVaultNameMultipartUploadsGet List Multipart Uploads List Multipart Uploads请求实现列出正在进行中的分段上传

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param vaultName
  • @param optional nil or *VaultsVaultNameMultipartUploadsGetOpts - Optional Parameters:
  • @param "Limit" (optional.Int64) -
  • @param "Marker" (optional.String) -

@return VaultsSummary

func (*ArchiveApiService) VaultsVaultNameMultipartUploadsPost

func (a *ArchiveApiService) VaultsVaultNameMultipartUploadsPost(ctx _context.Context, vaultName string, xCasPartSize string, localVarOptionals *VaultsVaultNameMultipartUploadsPostOpts) (*_nethttp.Response, error)

VaultsVaultNameMultipartUploadsPost Initiate Multipart Upload Initiate Multipart Upload请求实现初始化分段上传,此请求将返回一个Upload Id用以后续分段上传,此Upload Id有效期24小时。每次分段上传的段大小要求一致(除了最后一个段),且必须为1 MB乘以2的幂次

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param vaultName
  • @param xCasPartSize
  • @param optional nil or *VaultsVaultNameMultipartUploadsPostOpts - Optional Parameters:
  • @param "XCasArchiveDescription" (optional.String) -

func (*ArchiveApiService) VaultsVaultNameMultipartUploadsUploadIDDelete

func (a *ArchiveApiService) VaultsVaultNameMultipartUploadsUploadIDDelete(ctx _context.Context, vaultName string, uploadID string) (*_nethttp.Response, error)

VaultsVaultNameMultipartUploadsUploadIDDelete Abort Multipart Upload Abort Multipart Upload请求实现终止分段上传。

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param vaultName
  • @param uploadID

func (*ArchiveApiService) VaultsVaultNameMultipartUploadsUploadIDGet

func (a *ArchiveApiService) VaultsVaultNameMultipartUploadsUploadIDGet(ctx _context.Context, vaultName string, uploadID string, localVarOptionals *VaultsVaultNameMultipartUploadsUploadIDGetOpts) (ListParts, *_nethttp.Response, error)

VaultsVaultNameMultipartUploadsUploadIDGet List Parts List Parts请求实现列出已上传的数据段。

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param vaultName
  • @param uploadID
  • @param optional nil or *VaultsVaultNameMultipartUploadsUploadIDGetOpts - Optional Parameters:
  • @param "Limit" (optional.Int64) -
  • @param "Marker" (optional.String) -

@return ListParts

func (*ArchiveApiService) VaultsVaultNameMultipartUploadsUploadIDPost

func (a *ArchiveApiService) VaultsVaultNameMultipartUploadsUploadIDPost(ctx _context.Context, vaultName string, uploadID string, xCasSha256TreeHash string, xCasArchiveSize string) (*_nethttp.Response, error)

VaultsVaultNameMultipartUploadsUploadIDPost Complete Multipart Upload Complete Multipart Upload请求实现结束分段上传,形成文件。发起该请求时必须携带全文件的树形哈希值,服务端将比较用户上传的全文树形哈希和利用已上传分块得到的树形哈希,一致则请求成功,不一致则返回失败

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param vaultName
  • @param uploadID
  • @param xCasSha256TreeHash
  • @param xCasArchiveSize

func (*ArchiveApiService) VaultsVaultNameMultipartUploadsUploadIDPut

func (a *ArchiveApiService) VaultsVaultNameMultipartUploadsUploadIDPut(ctx _context.Context, vaultName string, uploadID string, contentRange string, xCasContentSha256 string, xCasSha256TreeHash string, body io.Reader, localVarOptionals *VaultsVaultNameMultipartUploadsUploadIDPutOpts) (*_nethttp.Response, error)

VaultsVaultNameMultipartUploadsUploadIDPut Upload Part Upload Part请求实现上传档案的一段数据。支持乱序上传档案段,支持覆盖已上传的数据段。需在请求中标示该数据段在档案的字节范围。此外,支持并行上传数据段,最多可以上传 10000 段。当x-cas-sha256-tree-hash或x-cas-content-sha256与请求体中的真实文件校验和不一致时,请求返回错误。当Content-Length与请求体中的真实文件大小不一致时,请求返回错误。当Content-Range为必须以初始化分块时对应的块大小严格一致。例如,指定 4 194 304 字节 (4MB) 的段大小,则 0 到 4 194 303 字节 (4MB-1) 以及 4 194 304 (4MB) 到 8 388 607 (8MB-1) 为有效的段范围。2097152( 2MB) 到6291456( 6MB-1)为非法段范围。成功上传段后,将返回 204 No Content

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param vaultName
  • @param uploadID
  • @param contentRange
  • @param xCasContentSha256
  • @param xCasSha256TreeHash
  • @param body
  • @param optional nil or *VaultsVaultNameMultipartUploadsUploadIDPutOpts - Optional Parameters:
  • @param "ContentLength" (optional.String) -

type BasicAuth

type BasicAuth struct {
	UserName string `json:"userName,omitempty"`
	Password string `json:"password,omitempty"`
}

BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth

type Configuration

type Configuration struct {
	Region       string        `json:"region"`
	AppId        string        `json:"appid"`
	AccessKey    string        `json:"access_key"`
	AccessSecret string        `json:"access_secret"`
	SignExpire   time.Duration `json:"secret_expire"`
	SignKey      string        `json:"sign_key"`
	SignKeyStart int64         `json:"sign_key_start"`
	SignKeyEnd   int64         `json:"sing_key_end"`

	BasePath      string            `json:"basePath,omitempty"`
	Host          string            `json:"host,omitempty"`
	Scheme        string            `json:"scheme,omitempty"`
	DefaultHeader map[string]string `json:"defaultHeader,omitempty"`
	UserAgent     string            `json:"userAgent,omitempty"`
	Debug         bool              `json:"debug,omitempty"`
	Servers       []ServerConfiguration
	HTTPClient    *http.Client
}

Configuration stores the configuration of the API client

func NewConfiguration

func NewConfiguration() *Configuration

NewConfiguration returns a new Configuration object

func (*Configuration) AddDefaultHeader

func (c *Configuration) AddDefaultHeader(key string, value string)

AddDefaultHeader adds a new HTTP header to the default header in the request

func (*Configuration) ServerUrl

func (c *Configuration) ServerUrl(index int, variables map[string]string) (string, error)

ServerUrl returns URL based on server settings

type ConfigurationAuthor

type ConfigurationAuthor interface {
	Authorization(method, url, host string,
		headers http.Header, params url.Values) string
}

type ConfigurationModeSecret

type ConfigurationModeSecret struct {
	AccessKey    string
	AccessSecret string
	SignExpire   time.Duration
}

func (*ConfigurationModeSecret) Authorization

func (c *ConfigurationModeSecret) Authorization(method, url, host string,
	headers http.Header, params url.Values) string

type ConfigurationModeSignKey

type ConfigurationModeSignKey struct {
	AppId        string
	AccessKey    string
	SignKey      string
	SignKeyStart int64
	SignKeyEnd   int64
	SignExpire   time.Duration
}

func (*ConfigurationModeSignKey) Authorization

func (c *ConfigurationModeSignKey) Authorization(method, url, host string,
	headers http.Header, params url.Values) string

type ErrorMessage

type ErrorMessage struct {
	// 错误码
	Code string `json:"code,omitempty"`
	// 错误信息
	Message string `json:"message,omitempty"`
	// 类型
	Type string `json:"type,omitempty"`
}

ErrorMessage struct for ErrorMessage

type GenericOpenAPIError

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

GenericOpenAPIError Provides access to the body, error and model on returned errors.

func (GenericOpenAPIError) Body

func (e GenericOpenAPIError) Body() []byte

Body returns the raw bytes of the response

func (GenericOpenAPIError) Error

func (e GenericOpenAPIError) Error() string

Error returns non-empty string if there was an error.

func (GenericOpenAPIError) Model

func (e GenericOpenAPIError) Model() interface{}

Model returns the unpacked model of the error

type JobApiService

type JobApiService service

JobApiService JobApi service

func (*JobApiService) VaultsVaultNameJobsGet

func (a *JobApiService) VaultsVaultNameJobsGet(ctx _context.Context, vaultName string, localVarOptionals *VaultsVaultNameJobsGetOpts) (JobsList, *_nethttp.Response, error)

VaultsVaultNameJobsGet List Job List Jobs 请求实现列出 Vault 的任务,包括正在进行的任务以及最近完成的任务。支持跨账户操作。当操作本账户时,UID为\&quot;-\&quot;。。

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param vaultName
  • @param optional nil or *VaultsVaultNameJobsGetOpts - Optional Parameters:
  • @param "Completed" (optional.Bool) -
  • @param "Limit" (optional.Int64) -
  • @param "Marker" (optional.String) -
  • @param "Statuscode" (optional.String) -

@return JobsList

func (*JobApiService) VaultsVaultNameJobsJobIDGet

VaultsVaultNameJobsJobIDGet Describe Job Describe Job 请求实现获取Vault的具体任务信息。支持跨账户操作。当操作本账户时,UID为\&quot;-\&quot;

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param vaultName
  • @param jobID

@return OneOfJobArchiveSearchInfoJobArchiveListSearchInfoJobArchiveImportInfoJobArchiveExportInfo

func (*JobApiService) VaultsVaultNameJobsJobIDOutputGet

func (a *JobApiService) VaultsVaultNameJobsJobIDOutputGet(ctx _context.Context, vaultName string, jobID string, localVarOptionals *VaultsVaultNameJobsJobIDOutputGetOpts) (JobOutput, *_nethttp.Response, error)

VaultsVaultNameJobsJobIDOutputGet Get Job Output 请求用来输出缓存池中检索出来的 Archive 或Archive列表,缓存池中的内容24小时有效。请求所有数据成功后,返回 200 OK。请求部分数据成功时,返回 206 Partial Content。支持跨账户操作。当操作本账户时,UID 为\&quot;-\&quot;。

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param vaultName
  • @param jobID
  • @param optional nil or *VaultsVaultNameJobsJobIDOutputGetOpts - Optional Parameters:
  • @param "Range_" (optional.String) -

@return JobOutput

func (*JobApiService) VaultsVaultNameJobsPost

func (a *JobApiService) VaultsVaultNameJobsPost(ctx _context.Context, vaultName string, localVarOptionals *VaultsVaultNameJobsPostOpts) (*_nethttp.Response, error)

VaultsVaultNameJobsPost Initiate Job Describe Job Initiate Job 请求实现将档案或者档案列表取出到缓存池。操作完成后,用户可以通过 Get Job Output 请求读取对应档案或者档案列表。

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param vaultName
  • @param optional nil or *VaultsVaultNameJobsPostOpts - Optional Parameters:
  • @param "UNKNOWNBASETYPE" (optional.Interface of UNKNOWN_BASE_TYPE) -

type JobArchiveExportInfo

type JobArchiveExportInfo struct {
	Action                string                        `json:"Action,omitempty"`
	JobId                 string                        `json:"JobId,omitempty"`
	JobDescription        string                        `json:"JobDescription,omitempty"`
	CallBackUrl           string                        `json:"CallBackUrl,omitempty"`
	CreationDate          time.Time                     `json:"CreationDate,omitempty"`
	CompletionDate        time.Time                     `json:"CompletionDate,omitempty"`
	Completed             bool                          `json:"Completed,omitempty"`
	StatusCode            string                        `json:"StatusCode,omitempty"`
	StatusMessage         string                        `json:"StatusMessage,omitempty"`
	VaultQCS              string                        `json:"VaultQCS,omitempty"`
	ArchiveId             string                        `json:"ArchiveId,omitempty"`
	ArchiveSizeInBytes    int64                         `json:"ArchiveSizeInBytes,omitempty"`
	ArchiveSHA256TreeHash string                        `json:"ArchiveSHA256TreeHash,omitempty"`
	RetrievalByteRange    string                        `json:"RetrievalByteRange,omitempty"`
	Bucket                string                        `json:"Bucket,omitempty"`
	Object                string                        `json:"Object,omitempty"`
	Condition             JobArchiveExportInfoCondition `json:"Condition,omitempty"`
	ArchiveDescription    string                        `json:"ArchiveDescription,omitempty"`
}

JobArchiveExportInfo struct for JobArchiveExportInfo

type JobArchiveExportInfoCondition

type JobArchiveExportInfoCondition struct {
	IfModifiedSince  string `json:"If-Modified-Since,omitempty"`
	IfUmodifiedSince string `json:"If-Umodified-Since,omitempty"`
	IfMatch          string `json:"If-Match,omitempty"`
	IfNoneMatch      string `json:"If-None-Match,omitempty"`
}

JobArchiveExportInfoCondition struct for JobArchiveExportInfoCondition

type JobArchiveExportReq

type JobArchiveExportReq struct {
	// pull-from-cos
	Type        string                        `json:"Type,omitempty"`
	Description string                        `json:"Description,omitempty"`
	CallBackUrl string                        `json:"CallBackUrl,omitempty"`
	Bucket      string                        `json:"Bucket,omitempty"`
	Object      string                        `json:"Object,omitempty"`
	Tier        string                        `json:"Tier,omitempty"`
	Range       string                        `json:"Range,omitempty"`
	Condition   JobArchiveExportInfoCondition `json:"Condition,omitempty"`
}

JobArchiveExportReq struct for JobArchiveExportReq

type JobArchiveImportInfo

type JobArchiveImportInfo struct {
	Action                string    `json:"Action,omitempty"`
	JobId                 string    `json:"JobId,omitempty"`
	JobDescription        string    `json:"JobDescription,omitempty"`
	CallBackUrl           string    `json:"CallBackUrl,omitempty"`
	CreationDate          time.Time `json:"CreationDate,omitempty"`
	CompletionDate        time.Time `json:"CompletionDate,omitempty"`
	Completed             bool      `json:"Completed,omitempty"`
	StatusCode            string    `json:"StatusCode,omitempty"`
	StatusMessage         string    `json:"StatusMessage,omitempty"`
	VaultQCS              string    `json:"VaultQCS,omitempty"`
	ArchiveId             string    `json:"ArchiveId,omitempty"`
	ArchiveSizeInBytes    int64     `json:"ArchiveSizeInBytes,omitempty"`
	ArchiveSHA256TreeHash string    `json:"ArchiveSHA256TreeHash,omitempty"`
	RetrievalByteRange    string    `json:"RetrievalByteRange,omitempty"`
	Bucket                string    `json:"Bucket,omitempty"`
	Object                string    `json:"Object,omitempty"`
	Tier                  string    `json:"Tier,omitempty"`
}

JobArchiveImportInfo struct for JobArchiveImportInfo

type JobArchiveImportReq

type JobArchiveImportReq struct {
	// push-to-cos
	Type               string `json:"Type,omitempty"`
	Description        string `json:"Description,omitempty"`
	ArchiveId          string `json:"ArchiveId,omitempty"`
	CallBackUrl        string `json:"CallBackUrl,omitempty"`
	RetrievalByteRange string `json:"RetrievalByteRange,omitempty"`
	Bucket             string `json:"Bucket,omitempty"`
	Object             string `json:"Object,omitempty"`
	Tier               string `json:"Tier,omitempty"`
}

JobArchiveImportReq struct for JobArchiveImportReq

type JobArchiveListSearchInfo

type JobArchiveListSearchInfo struct {
	Action                       string                          `json:"Action,omitempty"`
	JobId                        string                          `json:"JobId,omitempty"`
	JobDescription               string                          `json:"JobDescription,omitempty"`
	CallBackUrl                  string                          `json:"CallBackUrl,omitempty"`
	CreationDate                 time.Time                       `json:"CreationDate,omitempty"`
	CompletionDate               time.Time                       `json:"CompletionDate,omitempty"`
	Completed                    bool                            `json:"Completed,omitempty"`
	StatusCode                   string                          `json:"StatusCode,omitempty"`
	StatusMessage                string                          `json:"StatusMessage,omitempty"`
	VaultQCS                     string                          `json:"VaultQCS,omitempty"`
	InventorySizeInBytes         string                          `json:"InventorySizeInBytes,omitempty"`
	InventoryRetrievalParameters JobInventoryRetrievalParameters `json:"InventoryRetrievalParameters,omitempty"`
}

JobArchiveListSearchInfo struct for JobArchiveListSearchInfo

type JobArchiveListSearchReq

type JobArchiveListSearchReq struct {
	// archive-retrieval
	Type        string `json:"Type,omitempty"`
	CallBackUrl string `json:"CallBackUrl,omitempty"`
	// 默认JSON
	Format                       string                          `json:"Format,omitempty"`
	Description                  string                          `json:"Description,omitempty"`
	InventoryRetrievalParameters JobInventoryRetrievalParameters `json:"InventoryRetrievalParameters,omitempty"`
}

JobArchiveListSearchReq struct for JobArchiveListSearchReq

type JobArchiveSearchInfo

type JobArchiveSearchInfo struct {
	Action                string    `json:"Action,omitempty"`
	JobId                 string    `json:"JobId,omitempty"`
	JobDescription        string    `json:"JobDescription,omitempty"`
	CallBackUrl           string    `json:"CallBackUrl,omitempty"`
	CreationDate          time.Time `json:"CreationDate,omitempty"`
	CompletionDate        time.Time `json:"CompletionDate,omitempty"`
	Completed             bool      `json:"Completed,omitempty"`
	StatusCode            string    `json:"StatusCode,omitempty"`
	StatusMessage         string    `json:"StatusMessage,omitempty"`
	VaultQCS              string    `json:"VaultQCS,omitempty"`
	ArchiveId             string    `json:"ArchiveId,omitempty"`
	ArchiveSizeInBytes    int64     `json:"ArchiveSizeInBytes,omitempty"`
	ArchiveSHA256TreeHash string    `json:"ArchiveSHA256TreeHash,omitempty"`
	RetrievalByteRange    string    `json:"RetrievalByteRange,omitempty"`
	SHA256TreeHash        string    `json:"SHA256TreeHash,omitempty"`
	Tier                  string    `json:"Tier,omitempty"`
}

JobArchiveSearchInfo struct for JobArchiveSearchInfo

type JobArchiveSearchReq

type JobArchiveSearchReq struct {
	// archive-retrieval
	Type               string `json:"Type,omitempty"`
	ArchiveId          string `json:"ArchiveId,omitempty"`
	CallBackUrl        string `json:"CallBackUrl,omitempty"`
	Description        string `json:"Description,omitempty"`
	RetrievalByteRange string `json:"RetrievalByteRange,omitempty"`
	Tier               string `json:"Tier,omitempty"`
}

JobArchiveSearchReq struct for JobArchiveSearchReq

type JobInventoryRetrievalParameters

type JobInventoryRetrievalParameters struct {
	Format    string `json:"Format,omitempty"`
	StartDate string `json:"StartDate,omitempty"`
	EndDate   string `json:"EndDate,omitempty"`
	Limit     string `json:"Limit,omitempty"`
	Marker    string `json:"Marker,omitempty"`
}

JobInventoryRetrievalParameters struct for JobInventoryRetrievalParameters

type JobOutput

type JobOutput struct {
	VaultQCS      string             `json:"VaultQCS,omitempty"`
	InventoryDate time.Time          `json:"InventoryDate,omitempty"`
	ArchiveList   []JobOutputArchive `json:"ArchiveList,omitempty"`
}

JobOutput struct for JobOutput

type JobOutputArchive

type JobOutputArchive struct {
	ArchiveId          string    `json:"ArchiveId,omitempty"`
	ArchiveDescription string    `json:"ArchiveDescription,omitempty"`
	CreationDate       time.Time `json:"CreationDate,omitempty"`
	Size               int32     `json:"Size,omitempty"`
	SHA256TreeHash     string    `json:"SHA256TreeHash,omitempty"`
}

JobOutputArchive struct for JobOutputArchive

type JobsList

type JobsList struct {
	JobList []OneOfJobArchiveSearchInfoJobArchiveListSearchInfoJobArchiveImportInfoJobArchiveExportInfo `json:"JobList,omitempty"`
	Marker  string                                                                                      `json:"Marker,omitempty"`
}

JobsList struct for JobsList

type ListParts

type ListParts struct {
	ArchiveDescription string           `json:"ArchiveDescription,omitempty"`
	CreationDate       time.Time        `json:"CreationDate,omitempty"`
	Marker             string           `json:"Marker,omitempty"`
	MultipartUploadId  string           `json:"MultipartUploadId,omitempty"`
	PartSizeInBytes    int64            `json:"PartSizeInBytes,omitempty"`
	VaultQCS           string           `json:"VaultQCS,omitempty"`
	Parts              []ListPartsParts `json:"Parts,omitempty"`
}

ListParts struct for ListParts

type ListPartsParts

type ListPartsParts struct {
	RangeInBytes   string `json:"RangeInBytes,omitempty"`
	SHA256TreeHash string `json:"SHA256TreeHash,omitempty"`
}

ListPartsParts struct for ListPartsParts

type NotificationConfiguration

type NotificationConfiguration struct {
	CallBackUrl string   `json:"CallBackUrl,omitempty"`
	Events      []string `json:"Events,omitempty"`
}

NotificationConfiguration struct for NotificationConfiguration

type OneOfJobArchiveSearchInfoJobArchiveListSearchInfoJobArchiveImportInfoJobArchiveExportInfo

type OneOfJobArchiveSearchInfoJobArchiveListSearchInfoJobArchiveImportInfoJobArchiveExportInfo struct {
	*JobArchiveListSearchInfo `json:"-"`
	*JobArchiveSearchInfo     `json:"-"`
	*JobArchiveExportInfo     `json:"-"`
	*JobArchiveImportInfo     `json:"-"`
}

func UnmarshalJSON(txt []byte) error func MarshalJSON() ([]byte,error)

func (OneOfJobArchiveSearchInfoJobArchiveListSearchInfoJobArchiveImportInfoJobArchiveExportInfo) MarshalJSON

func (*OneOfJobArchiveSearchInfoJobArchiveListSearchInfoJobArchiveImportInfoJobArchiveExportInfo) UnmarshalJSON

type Policy

type Policy struct {
	Policy string `json:"Policy,omitempty"`
}

Policy struct for Policy

type PolicyCondition

type PolicyCondition struct {
	ConditionOperators map[string]interface{} `json:"ConditionOperators,omitempty"`
}

PolicyCondition struct for PolicyCondition

type PolicyObject

type PolicyObject struct {
	Version   string        `json:"version,omitempty"`
	Statement []PolicyState `json:"statement,omitempty"`
	Action    []string      `json:"action,omitempty"`
	Resource  []string      `json:"resource,omitempty"`
}

PolicyObject struct for PolicyObject

type PolicyState

type PolicyState struct {
	Effect    string               `json:"effect,omitempty"`
	Principal PolicyStatePrincipal `json:"principal,omitempty"`
}

PolicyState struct for PolicyState

type PolicyStatePrincipal

type PolicyStatePrincipal struct {
	Qcs []string `json:"qcs,omitempty"`
}

PolicyStatePrincipal struct for PolicyStatePrincipal

type ServerConfiguration

type ServerConfiguration struct {
	Url         string
	Description string
	Variables   map[string]ServerVariable
}

ServerConfiguration stores the information about a server

type ServerVariable

type ServerVariable struct {
	Description  string
	DefaultValue string
	EnumValues   []string
}

ServerVariable stores the information about a server variable

type Signature

type Signature struct {
	// 签名算法默认sha1
	QSignAlgorithm string `json:"q-sign-algorithm,omitempty"`
	// 用于标识用户身份, SecretID 的字段,在腾讯云的 API 密钥页面中可以查看。
	QAk string `json:"q-ak,omitempty"`
	// 签名的有效起止时间,其使用10位Unix时间戳来表示,有效效力精确到秒。该字段通过分号区分起止,起时在前、止时在后。
	QSignTime int64 `json:"q-sign-time,omitempty"`
	// 用户可以自定义 SignKey 有效时间,使用 10 位 Unix 时间戳来表示,有效效力精确到秒。该字段通过分号区分起止,起始时间在前、终止时间在后。一般 q-key-time 的时间范围大于等于 q-sign-time。
	QKeyTime int64 `json:"q-key-time,omitempty"`
	// 提供密文中包含需要校验的 Headers 列表,必须是小写字符,且需要按字典序排序,以\";\"分隔
	QHeaderList string `json:"q-header-list,omitempty"`
	// 提供密文中包含需要校验的 Parameters 列表,必须是小写字符,以\";\"分隔
	QUrlParamList string `json:"q-url-param-list,omitempty"`
	// 经过 HMAC-SHA1 算法加密的请求校验信息。
	QSignature string `json:"q-signature,omitempty"`
}

Signature struct for Signature

func (*Signature) Sign

func (s *Signature) Sign() string

type UNKNOWN_BASE_TYPE

type UNKNOWN_BASE_TYPE interface {
}

type VaultApiService

type VaultApiService service

VaultApiService VaultApi service

func (*VaultApiService) CreateVault

func (a *VaultApiService) CreateVault(ctx _context.Context, vaultName string) (*_nethttp.Response, error)

CreateVault 创建vault Create Vault 请求实现创建一个 Vault,每个用户支持创建 1000 个 Vault。成功后返回 201 Created。支持跨账户创建。当创建本账户下 valut 时,UID值为\&quot;-\&quot;。

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param vaultName

func (*VaultApiService) GetVault

func (a *VaultApiService) GetVault(ctx _context.Context, vaultName string) (VaultInfo, *_nethttp.Response, error)

GetVault Describe Vault Describe Vault 请求实现读取一个 Vault 的属性。档案数与档案总大小,每日盘点更新,非实时数据。请求成功后返回 200 OK。支持跨账户操作。当操作本账户下 valut 时,UID值为\&quot;-\&quot;。

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param vaultName

@return VaultInfo

func (*VaultApiService) VaultsGet

func (a *VaultApiService) VaultsGet(ctx _context.Context, localVarOptionals *VaultsGetOpts) (VaultsSummary, *_nethttp.Response, error)

VaultsGet List Vaults List Vaults 接口实现列出该账户下所有的文件库。档案数与档案总大小,每日盘点更新,非实时数据。支持跨账户操作。当操作本账户时,UID为\&quot;-\&quot;。

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param optional nil or *VaultsGetOpts - Optional Parameters:
  • @param "Limit" (optional.Int64) - 指定要返回的文件库最大数目。该值为正整数,取值1-1000,默认为 1000
  • @param "Marker" (optional.String) - 按字典序,从该 Marker 开始列出 Vault 的 QCS,如果为空则从头列出 。

@return VaultsSummary

func (*VaultApiService) VaultsVaultNameAccessPolicyDelete

func (a *VaultApiService) VaultsVaultNameAccessPolicyDelete(ctx _context.Context, vaultName string) (*_nethttp.Response, error)

VaultsVaultNameAccessPolicyDelete Delete Vault Access Policy Delete Vault Access Policy 请求删除 Vault 的权限。只支持所有者操作,对应 UID 值为\&quot;-\&quot;。成功后返回 204 No Content。

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param vaultName

func (*VaultApiService) VaultsVaultNameAccessPolicyGet

func (a *VaultApiService) VaultsVaultNameAccessPolicyGet(ctx _context.Context, vaultName string) (Policy, *_nethttp.Response, error)

VaultsVaultNameAccessPolicyGet Get Vault Access Policy 请求读取一个 Vault 的权限 Get Vault Access Policy 请求读取一个 Vault 的权限。只支持所有者操作,对应 UID 值为\&quot;-\&quot;。成功后返回 200 OK。

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param vaultName

@return Policy

func (*VaultApiService) VaultsVaultNameAccessPolicyPut

func (a *VaultApiService) VaultsVaultNameAccessPolicyPut(ctx _context.Context, vaultName string, localVarOptionals *VaultsVaultNameAccessPolicyPutOpts) (*_nethttp.Response, error)

VaultsVaultNameAccessPolicyPut Set Vault Access Policy Set Vault Access Policy 请求实现为一个 Vault 设置权限。具体策略语法参考『认证与鉴权』-『权限管理』只支持所有者设置权限,对应 UID 值为 \&quot;-\&quot;。成功后返回 204 No Content。

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param vaultName
  • @param optional nil or *VaultsVaultNameAccessPolicyPutOpts - Optional Parameters:
  • @param "Policy" (optional.Interface of Policy) -

func (*VaultApiService) VaultsVaultNameDelete

func (a *VaultApiService) VaultsVaultNameDelete(ctx _context.Context, vaultName string) (*_nethttp.Response, error)

VaultsVaultNameDelete 删除vault Delete Vault 请求实现删除一个 Vault,删除前要求 Vault 下无 Archive 同时无 Archive 写入。删除 Vault 时同时删除其权限信息。请求成功后返回 204 NoContent。支持跨账户删除。当删除本账户下 Valut 时,UID值为\&quot;-\&quot;

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param vaultName

func (*VaultApiService) VaultsVaultNameNotificationConfigurationDelete

func (a *VaultApiService) VaultsVaultNameNotificationConfigurationDelete(ctx _context.Context, vaultName string) (*_nethttp.Response, error)

VaultsVaultNameNotificationConfigurationDelete Delete Vault Notifications Delete Vault Notifications请求实现删除指定文件库通知回调策略 请求成功,返回 204 No Content

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param vaultName

func (*VaultApiService) VaultsVaultNameNotificationConfigurationGet

func (a *VaultApiService) VaultsVaultNameNotificationConfigurationGet(ctx _context.Context, vaultName string) (NotificationConfiguration, *_nethttp.Response, error)

VaultsVaultNameNotificationConfigurationGet Get Vault Notifications Get Vault Notifications请求实现读取指定文件库通知回调策略

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param vaultName

@return NotificationConfiguration

func (*VaultApiService) VaultsVaultNameNotificationConfigurationPut

func (a *VaultApiService) VaultsVaultNameNotificationConfigurationPut(ctx _context.Context, vaultName string, localVarOptionals *VaultsVaultNameNotificationConfigurationPutOpts) (*_nethttp.Response, error)

VaultsVaultNameNotificationConfigurationPut Set Vault Access Policy Set Vault Access Policy 请求实现为一个 Vault 设置权限。具体策略语法参考『认证与鉴权』-『权限管理』 只支持所有者设置权限,对应 UID 值为 \&quot;-\&quot;。成功后返回 204 No Content。

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param vaultName
  • @param optional nil or *VaultsVaultNameNotificationConfigurationPutOpts - Optional Parameters:
  • @param "NotificationConfiguration" (optional.Interface of NotificationConfiguration) -

type VaultInfo

type VaultInfo struct {
	CreationDate      string `json:"CreationDate,omitempty"`
	LastInventoryDate string `json:"LastInventoryDate,omitempty"`
	NumberOfArchives  int64  `json:"NumberOfArchives,omitempty"`
	SizeInBytes       int64  `json:"SizeInBytes,omitempty"`
	VaultQCS          string `json:"VaultQCS,omitempty"`
	VaultName         string `json:"VaultName,omitempty"`
}

VaultInfo struct for VaultInfo

type VaultsGetOpts

type VaultsGetOpts struct {
	Limit  optional.Int64
	Marker optional.String
}

VaultsGetOpts Optional parameters for the method 'VaultsGet'

type VaultsSummary

type VaultsSummary struct {
	Marker    string      `json:"Marker,omitempty"`
	VaultList []VaultInfo `json:"VaultList,omitempty"`
}

VaultsSummary struct for VaultsSummary

type VaultsVaultNameAccessPolicyPutOpts

type VaultsVaultNameAccessPolicyPutOpts struct {
	Policy optional.Interface
}

VaultsVaultNameAccessPolicyPutOpts Optional parameters for the method 'VaultsVaultNameAccessPolicyPut'

type VaultsVaultNameArchivesPostOpts

type VaultsVaultNameArchivesPostOpts struct {
	XCasArchiveDescription optional.String
}

VaultsVaultNameArchivesPostOpts Optional parameters for the method 'VaultsVaultNameArchivesPost'

type VaultsVaultNameJobsGetOpts

type VaultsVaultNameJobsGetOpts struct {
	Completed  optional.Bool
	Limit      optional.Int64
	Marker     optional.String
	Statuscode optional.String
}

VaultsVaultNameJobsGetOpts Optional parameters for the method 'VaultsVaultNameJobsGet'

type VaultsVaultNameJobsJobIDOutputGetOpts

type VaultsVaultNameJobsJobIDOutputGetOpts struct {
	Range_ optional.String
}

VaultsVaultNameJobsJobIDOutputGetOpts Optional parameters for the method 'VaultsVaultNameJobsJobIDOutputGet'

type VaultsVaultNameJobsPostOpts

type VaultsVaultNameJobsPostOpts struct {
	UNKNOWNBASETYPE optional.Interface
}

VaultsVaultNameJobsPostOpts Optional parameters for the method 'VaultsVaultNameJobsPost'

type VaultsVaultNameMultipartUploadsGetOpts

type VaultsVaultNameMultipartUploadsGetOpts struct {
	Limit  optional.Int64
	Marker optional.String
}

VaultsVaultNameMultipartUploadsGetOpts Optional parameters for the method 'VaultsVaultNameMultipartUploadsGet'

type VaultsVaultNameMultipartUploadsPostOpts

type VaultsVaultNameMultipartUploadsPostOpts struct {
	XCasArchiveDescription optional.String
}

VaultsVaultNameMultipartUploadsPostOpts Optional parameters for the method 'VaultsVaultNameMultipartUploadsPost'

type VaultsVaultNameMultipartUploadsUploadIDGetOpts

type VaultsVaultNameMultipartUploadsUploadIDGetOpts struct {
	Limit  optional.Int64
	Marker optional.String
}

VaultsVaultNameMultipartUploadsUploadIDGetOpts Optional parameters for the method 'VaultsVaultNameMultipartUploadsUploadIDGet'

type VaultsVaultNameMultipartUploadsUploadIDPutOpts

type VaultsVaultNameMultipartUploadsUploadIDPutOpts struct {
	ContentLength optional.String
}

VaultsVaultNameMultipartUploadsUploadIDPutOpts Optional parameters for the method 'VaultsVaultNameMultipartUploadsUploadIDPut'

type VaultsVaultNameNotificationConfigurationPutOpts

type VaultsVaultNameNotificationConfigurationPutOpts struct {
	NotificationConfiguration optional.Interface
}

VaultsVaultNameNotificationConfigurationPutOpts Optional parameters for the method 'VaultsVaultNameNotificationConfigurationPut'

Jump to

Keyboard shortcuts

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