verender

package
v1.0.97 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2023 License: Apache-2.0 Imports: 15 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DefaultRegion  = "cn-north-1"
	ServiceVersion = "2021-12-31"
	ServiceName    = "verender"
	StatusOk       = 0
	MINPARTSIZE    = 5 << 20
	MAXPARTSIZE    = 5 << 30
	MAXOBJECTSIZE  = MAXPARTS * MAXPARTSIZE
	MAXPARTS       = 10000
)

Variables

View Source
var (
	ServiceInfo = &base.ServiceInfo{
		Timeout: 5 * time.Second,
		Host:    "open.volcengineapi.com",
		Header: http.Header{
			"Accept": []string{"application/json"},
		},
		Credentials: base.Credentials{AccessKeyID: "", SecretAccessKey: "", Service: "verender", Region: DefaultRegion},
	}

	ApiInfoList = map[string]*base.ApiInfo{
		"ListWorkspaces": {
			Method: http.MethodGet,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"ListWorkspaces"},
				"Version": []string{ServiceVersion},
			},
			Timeout: 15 * time.Second,
		},
		"PurchaseWorkspace": {
			Method: http.MethodPost,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"PurchaseWorkspace"},
				"Version": []string{ServiceVersion},
			},
		},
		"UpdateWorkspace": {
			Method: http.MethodPost,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"UpdateWorkspace"},
				"Version": []string{ServiceVersion},
			},
		},
		"DeleteWorkspace": {
			Method: http.MethodPost,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"DeleteWorkspace"},
				"Version": []string{ServiceVersion},
			},
		},
		"ListResourcePools": {
			Method: http.MethodGet,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"ListResourcePools"},
				"Version": []string{ServiceVersion},
			},
		},
		"GetWorkspaceLimit": {
			Method: http.MethodGet,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"GetWorkspaceLimit"},
				"Version": []string{ServiceVersion},
			},
		},
		"GetHardwareSpecifications": {
			Method: http.MethodGet,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"GetWorkspaceHardwareSpecifications"},
				"Version": []string{ServiceVersion},
			},
		},
		"ListJobs": {
			Method: http.MethodGet,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"ListRenderJobs"},
				"Version": []string{ServiceVersion},
			},
			Timeout: 15 * time.Second,
		},
		"GetRenderJob": {
			Method: http.MethodGet,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"GetRenderJob"},
				"Version": []string{ServiceVersion},
			},
		},
		"CreateJob": {
			Method: http.MethodPost,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"CreateRenderJob"},
				"Version": []string{ServiceVersion},
			},
		},
		"EditJob": {
			Method: http.MethodPost,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"EditRenderJob"},
				"Version": []string{ServiceVersion},
			},
		},
		"DeleteJob": {
			Method: http.MethodPost,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"DeleteRenderJob"},
				"Version": []string{ServiceVersion},
			},
		},
		"SetJobPriority": {
			Method: http.MethodPost,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"UpdateRenderJobPriority"},
				"Version": []string{ServiceVersion},
			},
		},
		"StartJob": {
			Method: http.MethodPost,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"StartRenderJob"},
				"Version": []string{ServiceVersion},
			},
		},
		"PauseJob": {
			Method: http.MethodPost,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"PauseRenderJob"},
				"Version": []string{ServiceVersion},
			},
		},
		"StopJob": {
			Method: http.MethodPost,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"StopRenderJob"},
				"Version": []string{ServiceVersion},
			},
		},
		"FullSpeedJob": {
			Method: http.MethodPost,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"FullSpeedRenderJob"},
				"Version": []string{ServiceVersion},
			},
		},
		"RetryJob": {
			Method: http.MethodPost,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"RetryJob"},
				"Version": []string{ServiceVersion},
			},
		},
		"PauseJobs": {
			Method: http.MethodPost,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"PauseJobs"},
				"Version": []string{ServiceVersion},
			},
		},
		"ResumeJobs": {
			Method: http.MethodPost,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"ResumeJobs"},
				"Version": []string{ServiceVersion},
			},
		},
		"StopJobs": {
			Method: http.MethodPost,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"StopJobs"},
				"Version": []string{ServiceVersion},
			},
		},
		"DeleteJobs": {
			Method: http.MethodPost,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"DeleteJobs"},
				"Version": []string{ServiceVersion},
			},
		},
		"FullSpeedJobs": {
			Method: http.MethodPost,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"FullSpeedRenderJobs"},
				"Version": []string{ServiceVersion},
			},
		},
		"GetLayerFrames": {
			Method: http.MethodPost,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"GetLayerFrames"},
				"Version": []string{ServiceVersion},
			},
		},
		"GetAccountStatistics": {
			Method: http.MethodPost,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"GetAccountStatistics"},
				"Version": []string{ServiceVersion},
			},
			Timeout: 15 * time.Second,
		},
		"GetAccountStatisticDetails": {
			Method: http.MethodPost,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"GetAccountStatisticDetails"},
				"Version": []string{ServiceVersion},
			},
			Timeout: 15 * time.Second,
		},
		"DownloadStatisticDetails": {
			Method: http.MethodPost,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"DownloadStatisticDetails"},
				"Version": []string{ServiceVersion},
			},
			Timeout: 15 * time.Second,
		},
		"GetCurrentUser": {
			Method: http.MethodGet,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"GetCurrentUser"},
				"Version": []string{ServiceVersion},
			},
		},
		"GetJobOverallStatistics": {
			Method: http.MethodGet,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"GetJobOverallStatistics"},
				"Version": []string{ServiceVersion},
			},
			Timeout: 15 * time.Second,
		},
		"GetStorageAccess": {
			Method: http.MethodGet,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"GetStorageAccess"},
				"Version": []string{ServiceVersion},
			},
		},
		"ListMyMessages": {
			Method: http.MethodGet,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"ListMyMessages"},
				"Version": []string{ServiceVersion},
			},
		},
		"MarkMessageAsRead": {
			Method: http.MethodPost,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"MarkMessageAsRead"},
				"Version": []string{ServiceVersion},
			},
		},
		"BatchMarkMessagesAsRead": {
			Method: http.MethodPost,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"BatchMarkMessagesAsRead"},
				"Version": []string{ServiceVersion},
			},
		},
		"MarkAllMessagesAsRead": {
			Method: http.MethodPost,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"MarkAllMessagesAsRead"},
				"Version": []string{ServiceVersion},
			},
		},
		"DeleteMessage": {
			Method: http.MethodPost,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"DeleteMessage"},
				"Version": []string{ServiceVersion},
			},
		},
		"BatchDeleteMessages": {
			Method: http.MethodPost,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"BatchDeleteMessages"},
				"Version": []string{ServiceVersion},
			},
		},
		"DeleteAllMessages": {
			Method: http.MethodPost,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"DeleteAllMessages"},
				"Version": []string{ServiceVersion},
			},
		},
		"DeleteAllReadMessages": {
			Method: http.MethodPost,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"DeleteAllReadMessages"},
				"Version": []string{ServiceVersion},
			},
		},
	}
)
View Source
var AllowedFileTypes = map[string]struct{}{"asset": {}, "scene_file": {}, "client_script": {}}
View Source
var OrderTypeMap = map[string]string{"descend": "1", "ascend": "2"}

Functions

func GetMinioClient

func GetMinioClient(ak, sk, token, endpoint string) (*minio.Client, error)

Types

type AccountStatisticDetails

type AccountStatisticDetails struct {
	Total      int64              `json:"Total"`
	Items      []StatisticsRecord `json:"Items"`
	Workspaces []WorkspaceInfo    `json:"Workspaces"`
	Users      []UserInfo         `json:"Users"`
	JobTypes   []string           `json:"JobTypes"`
}

type AccountStatistics

type AccountStatistics struct {
	Summary    StatisticsSummary  `json:"Summary"`
	Statistics []StatisticsRecord `json:"Statistics"`
	Workspaces []WorkspaceInfo    `json:"Workspaces"`
	Users      []UserInfo         `json:"Users"`
}

type BatchJobRequest

type BatchJobRequest struct {
	JobIds []string `json:"JobIds"`
}

type CellSpec

type CellSpec struct {
	ComputerResourceType  string `json:"ComputerResourceType"`
	ComputerResourceCount int    `json:"ComputerResourceCount"`
	ID                    int64  `json:"id"`
}

type CreateJobResponse

type CreateJobResponse struct {
	Metadata  ResponseMetaData `json:"ResponseMetadata"`
	JobDetail RenderJobInfo    `json:"Result,omitempty"`
}

type DeleteWorkspaceResp

type DeleteWorkspaceResp struct {
	MetaData ResponseMetaData `json:"ResponseMetadata"`
}

type Error

type Error struct {
	CodeN   int    `json:"CodeN"`
	Code    string `json:"Code"`
	Message string `json:"Message"`
}

type FrameInfo

type FrameInfo struct {
	Start        int    `json:"Start"`
	End          int    `json:"End"`
	Status       string `json:"Status"`
	CpuTime      int64  `json:"CpuTime"`
	GpuTime      int64  `json:"GpuTime"`
	StartingTime string `json:"StartingTime"`
	FinishedTime string `json:"FinishedTime"`
	ExitCode     int32  `json:"ExitCode,omitempty"`
	Error        string `json:"Error,omitempty"`
}

type FrameList

type FrameList struct {
	Frames      []FrameInfo `json:"FrameList"`
	TotalFrames int         `json:"TotalFrames"`
}

type FrameProcess

type FrameProcess struct {
	Total      int `json:"total"`
	Waiting    int `json:"waiting"`
	Processing int `json:"processing"`
	Success    int `json:"success"`
	Failed     int `json:"failed"`
	Stopped    int `json:"stopped"`
	Paused     int `json:"paused"`
	ToStart    int `json:"to_start"`
}

type FrameSettings

type FrameSettings struct {
	Start int `json:"Start"`
	End   int `json:"End"`
	Step  int `json:"Step"`
}

type GetAccountStatisticDetailsResponse

type GetAccountStatisticDetailsResponse struct {
	MetaData ResponseMetaData        `json:"ResponseMetadata"`
	Details  AccountStatisticDetails `json:"Result"`
}

type GetAccountStatisticsResponse

type GetAccountStatisticsResponse struct {
	MetaData    ResponseMetaData  `json:"ResponseMetadata"`
	AccountStat AccountStatistics `json:"Result"`
}

type GetFramesRequest

type GetFramesRequest struct {
	RenderJobId string
	PageNum     int
	PageSize    int
}

type GetFramesResponse

type GetFramesResponse struct {
	MetaData ResponseMetaData `json:"ResponseMetadata"`
	Frames   FrameList        `json:"Result"`
}

type GetJobOverallStatisticsResponse

type GetJobOverallStatisticsResponse struct {
	MetaData ResponseMetaData     `json:"ResponseMetadata"`
	Stat     JobOverallStatistics `json:"Result"`
}

type GetJobResponse

type GetJobResponse struct {
	ResponseMetaData `json:"ResponseMetaData"`
	JobResult        `json:"Result"`
}

type GetLayerFramesRequest

type GetLayerFramesRequest struct {
	RenderJobId   string         `json:"RenderJobId"`
	LayerRequests []LayerRequest `json:"LayerRequests"`
}

type GetLayerFramesResponse

type GetLayerFramesResponse struct {
	MetaData    ResponseMetaData `json:"ResponseMetadata"`
	LayerFrames []LayerFrameList `json:"Result"`
}

type GetStorageAccessResponse

type GetStorageAccessResponse struct {
	ResponseMetaData `json:"ResponseMetaData"`
	WorkspaceResult  `json:"Result"`
	Time             time.Time `json:"Time"`
}

type GetUserInfoResult

type GetUserInfoResult struct {
	MetaData ResponseMetaData `json:"ResponseMetadata"`
	User     UserInfo         `json:"Result,omitempty"`
}

type GetWorkspaceHardwareSpecificationResponse

type GetWorkspaceHardwareSpecificationResponse struct {
	MetaData      ResponseMetaData                 `json:"ResponseMetaData"`
	HardwareSpecs []WorkspaceHardwareSpecification `json:"Result"`
}

type GetWorkspaceLimitResponse

type GetWorkspaceLimitResponse struct {
	MetaData       ResponseMetaData `json:"ResponseMetadata"`
	WorkspaceLimit WorkspaceLimit   `json:"Result"`
}

type HardwareSpec

type HardwareSpec struct {
	ResourcePoolId     int    `json:"ResourcePoolId,omitempty"`
	ResourcePoolName   string `json:"ResourcePoolName,omitempty"`
	ResourcePoolRegion string `json:"ResourcePoolRegion,omitempty"`
	CpsId              int    `json:"CpsId,omitempty"`
	CpsName            string `json:"CpsName,omitempty"`
	SupportCpu         string `json:"SupportCpu,omitempty"`
	SupportGpu         string `json:"SupportGpu,omitempty"`
}

type Job

type Job struct {
	JobInfo
	Client *base.Client
}

func (*Job) GetJobInfo

func (j *Job) GetJobInfo() Job

type JobInfo

type JobInfo struct {
	// request
	UserId                int64              `json:"UserId,omitempty"`
	AccountId             int64              `json:"AccountId,omitempty"`
	UserName              string             `json:"UserName"`
	WorkspaceId           int64              `json:"WorkspaceId,omitempty"`
	Title                 string             `json:"Title"`
	Description           string             `json:"Description,omitempty"`
	DccTool               string             `json:"DccTool"`
	DccToolVersion        string             `json:"DccToolVersion,omitempty"`
	Renderer              string             `json:"Renderer"`
	RendererVersion       string             `json:"RendererVersion,omitempty"`
	Tryout                bool               `json:"Tryout"`
	TryoutFrameNumbers    []string           `json:"TryoutFrameNumbers,omitempty"`
	SceneFile             string             `json:"SceneFile"`
	OutputFormat          string             `json:"OutputFormat,omitempty"`
	Resolutions           []Resolutions      `json:"Resolutions,omitempty"`
	PathMapping           map[string]string  `json:"PathMapping,omitempty"`
	FrameSettings         FrameSettings      `json:"FrameSettings,omitempty"`
	Cameras               []string           `json:"Cameras,omitempty"`
	Layers                []string           `json:"Layers,omitempty"`
	LayerInformationList  []LayerInformation `json:"LayerInformationList,omitempty"`
	TimeoutReminder       int64              `json:"TimeoutReminder,omitempty"`
	TimeoutStopper        int64              `json:"TimeoutStopper,omitempty"`
	FrameProcess          FrameProcess       `json:"FrameProcess,omitempty"`
	OutputImageTemple     OutputImageTemple  `json:"OutputImageTemple,omitempty"`
	WantedCellSpecs       []CellSpec         `json:"WantedCellSpecs,omitempty"`
	UseLegacyRenderLayers *bool              `json:"UseLegacyRenderLayers,omitempty"`
	RenderImageTag        *string            `json:"RenderImageTag,omitempty"`
	Environment           map[string]string  `json:"Environment,omitempty"`
	CallbackTarget        *string            `json:"CallbackTarget,omitempty"`
	UserData              *string            `json:"UserData,omitempty"`

	// response
	JobId               string      `json:"JobId,omitempty"`
	Priority            int         `json:"Priority,omitempty"`
	CreatedAt           string      `json:"CreatedAt,omitempty"`
	StoppedAt           string      `json:"StoppedAt,omitempty"`
	Stage               string      `json:"Stage,omitempty"`
	Statistics          Statistics  `json:"Statistics,omitempty"`
	Error               string      `json:"Error,omitempty"`
	ResultBucket        string      `json:"ResultBucket,omitempty"`
	ResultDirectoryPath string      `json:"ResultDirectoryPath,omitempty"`
	FrameList           []FrameInfo `json:"FrameList,omitempty"`
	Paused              bool        `json:"Paused,omitempty"`
	CompletionAt        string      `json:"CompletionAt,omitempty"`
	OutputBytes         int64       `json:"OutputBytes,omitempty"`
	Progress            *Progress   `json:"Progress,omitempty"`
}

type JobList

type JobList struct {
	Jobs      []JobInfo `json:"Jobs"`
	TotalJobs int       `json:"TotalJobs"`
}

type JobOverallStatistics

type JobOverallStatistics struct {
	Failed  int64 `json:"Failed"`
	Running int64 `json:"Running"`
	Success int64 `json:"Success"`
	Waiting int64 `json:"Waiting"`
}

type JobResult

type JobResult struct {
	Job JobInfo `json:"Job"`
}

type LayerFrameInfo

type LayerFrameInfo struct {
	FrameNumber  int     `json:"frame_number"`
	Status       int     `json:"status"`
	StartingTime string  `json:"starting_time,omitempty"`
	FinishedTime string  `json:"finished_time,omitempty"`
	CpuTime      int64   `json:"cpu_time,omitempty"`
	GpuTime      int64   `json:"gpu_time,omitempty"`
	Cost         float64 `json:"cost,omitempty"`
}

type LayerFrameList

type LayerFrameList struct {
	LayerFrameList []LayerFrameInfo `json:"FrameInformationList"`
	Summary        FrameProcess     `json:"FrameProcess"`
	CpuTime        int64            `json:"CpuTime"`
	GpuTime        int64            `json:"GpuTime"`
	Cost           float64          `json:"Cost"`
	Total          int              `json:"Total"`
}

type LayerInformation

type LayerInformation struct {
	LayerIndex   int          `json:"layer_index"`
	FrameProcess FrameProcess `json:"frame_process"`
	Cost         float64      `json:"cost"`
}

type LayerRequest

type LayerRequest struct {
	LayerIndex int   `json:"LayerIndex"`
	PageNum    int   `json:"PageNum,omitempty"`
	PageSize   int   `json:"PageSize,omitempty"`
	Statuses   []int `json:"Statuses,omitempty"`
}

type ListJobRequest

type ListJobRequest struct {
	OrderBy  string
	PageNum  int
	PageSize int
	Tryout   int
	Keyword  string
	Status   string
	JobType  string
}

type ListJobResponse

type ListJobResponse struct {
	MetaData ResponseMetaData `json:"ResponseMetadata"`
	JobsData JobList          `json:"Result,omitempty"`
}

type ListMessageRequest

type ListMessageRequest struct {
	PageNum  int64 `json:"PageNum,omitempty"`
	PageSize int64 `json:"PageSize,omitempty"`
}

type ListMessageResponse

type ListMessageResponse struct {
	MetaData ResponseMetaData `json:"ResponseMetadata"`
	Messages MessageList      `json:"Result"`
}

type ListResourcePoolResponse

type ListResourcePoolResponse struct {
	MetaData      ResponseMetaData `json:"ResponseMetadata"`
	ResourcePools []ResourcePool   `json:"Result"`
}

type ListWorkspaceRequest

type ListWorkspaceRequest struct {
	WorkspaceId        int64
	WorkspaceName      string
	PageNum            int64
	PageSize           int64
	StartPurchaseTime  string
	EndPurchaseTime    string
	OrderBy            string
	OrderType          string
	FuzzyWorkspaceName string
	FuzzySearchContent string
}

type ListWorkspaceResponse

type ListWorkspaceResponse struct {
	MetaData   ResponseMetaData `json:"ResponseMetadata"`
	Workspaces WorkspaceList    `json:"Result,omitempty"`
}

type MessageIdList

type MessageIdList struct {
	MessageIds []int `json:"MessageIds"`
}

type MessageInfo

type MessageInfo struct {
	Id             int    `json:"Id"`
	Publisher      string `json:"Publisher"`
	MessageType    string `json:"MessageType"`
	MessageSubType string `json:"MessageSubType"`
	Title          string `json:"Title"`
	Content        string `json:"Content"`
	MarkAsRead     bool   `json:"MarkAsRead"`
	CreatedAt      string `json:"CreatedAt"`
}

type MessageList

type MessageList struct {
	Messages    []MessageInfo `json:"Messages"`
	Total       int64         `json:"Total"`
	TotalUnread int64         `json:"TotalUnread"`
}

type ObjectInfo

type ObjectInfo struct {
	Etag          string
	Key           string
	ContentLength int64
	ContentType   string
	LastModified  time.Time
}

type OutputImageTemple

type OutputImageTemple struct {
	Padding         int    `json:"Padding"`
	ImageNameTemple string `json:"ImageNameTemple"`
	SceneName       string `json:"SceneName"`
	Extension       string `json:"Extension"`
}

type Progress

type Progress struct {
	Finished int `json:"Finished"`
	Total    int `json:"Total"`
}

type PurchaseWorkspaceResponse

type PurchaseWorkspaceResponse struct {
	MetaData      ResponseMetaData `json:"ResponseMetadata"`
	WorkspaceInfo Workspace        `json:"Result"`
}

type RenderJobInfo

type RenderJobInfo struct {
	Job JobInfo `json:"RenderJob"`
}

type Resolutions

type Resolutions struct {
	Width  int `json:"Width"`
	Height int `json:"Height"`
}

type ResourcePool

type ResourcePool struct {
	ResourcePoolId     int    `json:"ResourcePoolId"`
	ResourcePoolName   string `json:"ResourcePoolName"`
	ResourcePoolRegion string `json:"ResourcePoolRegion"`
	CpsId              int    `json:"CpsId"`
	CpsName            string `json:"CpsName"`
	SupportCpu         string `json:"SupportCpu"`
	SupportGpu         string `json:"SupportGpu"`
}

type ResponseMetaData

type ResponseMetaData struct {
	RequestId string `json:"RequestId"`
	Action    string `json:"Action"`
	Version   string `json:"Version"`
	Service   string `json:"Service"`
	Region    string `json:"Region"`
	Error     Error  `json:"Error"`
}

type Statistics

type Statistics struct {
	CpuTime int     `json:"CpuTime"`
	GpuTime int     `json:"GpuTime"`
	Cost    float64 `json:"Cost"`
}

type StatisticsFilter

type StatisticsFilter struct {
	WorkspaceIds []int    `json:"WorkspaceIds,omitempty"`
	UserIds      []int    `json:"UserIds,omitempty"`
	JobTypes     []string `json:"JobTypes,omitempty"`
	Keyword      string   `json:"Keyword,omitempty"`
}

type StatisticsRecord

type StatisticsRecord struct {
	StartTime     string  `json:"StartTime"`
	EndTime       string  `json:"EndTime"`
	JobType       string  `json:"JobType"`
	CpuTime       int64   `json:"CpuTime"`
	GpuTime       int64   `json:"GpuTime"`
	JobTime       int64   `json:"JobTime"`
	TotalFrames   int64   `json:"TotalFrames"`
	TotalJobs     int64   `json:"TotalJobs"`
	TotalBytes    int64   `json:"TotalBytes,omitempty"`
	TotalCost     float64 `json:"TotalCost,omitempty"`
	JobId         string  `json:"JobId,omitempty"`
	JobName       string  `json:"JobName,omitempty"`
	JobDesc       string  `json:"JobDescription,omitempty"`
	WorkspaceId   int     `json:"WorkspaceId,omitempty"`
	WorkspaceName string  `json:"WorkspaceName,omitempty"`
	UserId        int     `json:"UserId,omitempty"`
	UserName      string  `json:"UserName,omitempty"`
}

type StatisticsRequest

type StatisticsRequest struct {
	StartTime  string           `json:"StartTime,omitempty"`
	EndTime    string           `json:"EndTime,omitempty"`
	TimeType   string           `json:"TimeType,omitempty"`
	PageNum    int64            `json:"PageNum,omitempty"`
	PageSize   int64            `json:"PageSize,omitempty"`
	OrderField string           `json:"OrderField,omitempty"`
	OrderBy    string           `json:"OrderBy,omitempty"`
	FileName   string           `json:"FileName,omitempty"`
	Filter     StatisticsFilter `json:"-"`
}

type StatisticsSummary

type StatisticsSummary struct {
	TotalCost    float64 `json:"TotalCost"`
	TotalJobs    int64   `json:"TotalJobs"`
	CpuTime      int64   `json:"CpuTime"`
	GpuTime      int64   `json:"GpuTime"`
	TotalFrames  int64   `json:"TotalFrames"`
	TotalBytes   int64   `json:"TotalBytes"`
	TotalJobTime int64   `json:"TotalJobTime"`
}

type StorageSpec

type StorageSpec struct {
	Id               int    `json:"Id,omitempty"`
	StorageTotal     int64  `json:"StorageTotal,omitempty"`
	StorageAvailable int64  `json:"StorageAvailable,omitempty"`
	ValidStartTime   string `json:"ValidStartTime,omitempty"`
}

type UserInfo

type UserInfo struct {
	AccountId int    `json:"AccountId,omitempty"`
	UserId    int    `json:"UserId"`
	UserName  string `json:"UserName"`
}

type Verender

type Verender struct {
	Client *base.Client
}

Verender

func NewInstance

func NewInstance(ak, sk string) *Verender

NewInstance create an instance

func (*Verender) BatchDeleteMessages

func (v *Verender) BatchDeleteMessages(r *MessageIdList) error

func (*Verender) BatchMarkMessagesAsRead

func (v *Verender) BatchMarkMessagesAsRead(r *MessageIdList) error

func (*Verender) DeleteAllMessages

func (v *Verender) DeleteAllMessages() error

func (*Verender) DeleteAllReadMessages

func (v *Verender) DeleteAllReadMessages() error

func (*Verender) DeleteMessage

func (v *Verender) DeleteMessage(id int) error

func (*Verender) DeleteWorkspace

func (v *Verender) DeleteWorkspace(w *Workspace) error

func (*Verender) DownloadStatisticDetails

func (v *Verender) DownloadStatisticDetails(r *StatisticsRequest) error

func (*Verender) GetAPIInfo

func (v *Verender) GetAPIInfo(api string) *base.ApiInfo

GetAPIInfo interface

func (*Verender) GetAccountStatisticDetails

func (v *Verender) GetAccountStatisticDetails(r *StatisticsRequest) (*AccountStatisticDetails, error)

func (*Verender) GetAccountStatistics

func (v *Verender) GetAccountStatistics(r *StatisticsRequest) (*AccountStatistics, error)

func (*Verender) GetCurrentUser

func (v *Verender) GetCurrentUser() (*UserInfo, error)

func (*Verender) GetHardwareSpecifications

func (v *Verender) GetHardwareSpecifications(workspaceId int) (*[]WorkspaceHardwareSpecification, error)

func (*Verender) GetJobOverallStatistics

func (v *Verender) GetJobOverallStatistics() (*JobOverallStatistics, error)

func (*Verender) GetServiceInfo

func (v *Verender) GetServiceInfo(env string) *base.ServiceInfo

GetServiceInfo interface

func (*Verender) GetWorkspace

func (v *Verender) GetWorkspace(workspaceId int64) (*Workspace, error)

func (*Verender) GetWorkspaceLimit

func (v *Verender) GetWorkspaceLimit() (*WorkspaceLimit, error)

GetWorkspaceLimit 返回当前登录用户可创建的工作区个数和单个工作区可使用的存储空间上限

func (*Verender) ListMyMessages

func (v *Verender) ListMyMessages(r *ListMessageRequest) (*MessageList, error)

func (*Verender) ListResourcePools

func (v *Verender) ListResourcePools() (*[]ResourcePool, error)

ListResourcePools 此接口用于购买工作区时指定ResourcePoolId和CpsId参数

func (*Verender) ListWorkspaces

func (v *Verender) ListWorkspaces(r *ListWorkspaceRequest) (*WorkspaceList, error)

func (*Verender) MarkAllMessagesAsRead

func (v *Verender) MarkAllMessagesAsRead() error

func (*Verender) MarkMessageAsRead

func (v *Verender) MarkMessageAsRead(id int) error

func (*Verender) PurchaseWorkspace

func (v *Verender) PurchaseWorkspace(w *Workspace) (*Workspace, error)

PurchaseWorkspace 需要指定WorkspaceName, Description, StorageTotal, ResourcePoolId, CpsId

func (*Verender) SetHost

func (v *Verender) SetHost(host string)

SetHost .

func (*Verender) SetRegion

func (v *Verender) SetRegion(env, region string)

SetRegion

func (*Verender) SetSchema

func (v *Verender) SetSchema(schema string)

SetSchema .

func (*Verender) UpdateWorkspace

func (v *Verender) UpdateWorkspace(w *Workspace) (*Workspace, error)

UpdateWorkspace 只能修改WorkspaceName, Description, StorageTotal, 其中StorageTotal不能比当前小

type Workspace

type Workspace struct {
	ClusterEndpoint       string        `json:"-"`
	BucketName            string        `json:"-"`
	BucketToken           string        `json:"-"`
	VolumeName            string        `json:"-"`
	ClusterName           string        `json:"-"`
	AccessKey             string        `json:"-"`
	SecretKey             string        `json:"-"`
	Time                  time.Time     `json:"-"`
	MinioClient           *minio.Client `json:"-"`
	Client                *base.Client  `json:"-"`
	WorkspaceId           int           `json:"Id,omitempty"`
	WorkspaceName         string        `json:"Name,omitempty"`
	Description           string        `json:"Description,omitempty"`
	ResourcePoolId        int           `json:"ResourcePoolId,omitempty"`
	CpsId                 int           `json:"CpsId,omitempty"`
	StorageTotal          int64         `json:"StorageTotal,omitempty"`
	AccountId             int           `json:"AccountId,omitempty"`
	UserId                int           `json:"UserId,omitempty"`
	AccountUserName       string        `json:"AccountUserName,omitempty"`
	CreatedAt             string        `json:"CreatedAt,omitempty"`
	UpdateAt              string        `json:"UpdateAt,omitempty"`
	Specification         *StorageSpec  `json:"Specification,omitempty"`
	Status                string        `json:"Status,omitempty"`
	HardwareSpecification *HardwareSpec `json:"HardwareSpecification,omitempty"`
}

func (*Workspace) CreateJob

func (w *Workspace) CreateJob(job *JobInfo) (*JobInfo, error)

CreateJob 创建任务之前需要先上传工程文件到边缘存储

func (*Workspace) DeleteJob

func (w *Workspace) DeleteJob(jobId string) error

func (*Workspace) DeleteJobs

func (w *Workspace) DeleteJobs(r *BatchJobRequest) error

func (*Workspace) DownloadFile

func (w *Workspace) DownloadFile(local string, target string) error

func (*Workspace) EditJob

func (w *Workspace) EditJob(job *JobInfo) error

func (*Workspace) FullSpeedJob

func (w *Workspace) FullSpeedJob(jobId string) error

FullSpeedJob 试渲染完成后, 需要继续渲染剩余帧时使用FullSpeedJob

func (*Workspace) FullSpeedJobs

func (w *Workspace) FullSpeedJobs(r *BatchJobRequest) error

func (*Workspace) GetJob

func (w *Workspace) GetJob(jobId string) (*Job, error)

func (*Workspace) GetLayerFrames

func (w *Workspace) GetLayerFrames(r *GetLayerFramesRequest) (*[]LayerFrameList, error)

func (*Workspace) GetStorageAccess

func (w *Workspace) GetStorageAccess() Workspace

func (*Workspace) ListJobs

func (w *Workspace) ListJobs(r *ListJobRequest) (*JobList, error)

func (*Workspace) ListObject

func (w *Workspace) ListObject(prefix, startAfter string, maxKeys int) (*[]string, *[]string, string, error)

func (*Workspace) PauseJob

func (w *Workspace) PauseJob(jobId string) error

func (*Workspace) PauseJobs

func (w *Workspace) PauseJobs(r *BatchJobRequest) error

func (*Workspace) ResumeJob

func (w *Workspace) ResumeJob(jobId string) error

func (*Workspace) ResumeJobs

func (w *Workspace) ResumeJobs(r *BatchJobRequest) error

func (*Workspace) RetryJob

func (w *Workspace) RetryJob(jobId string) error

func (*Workspace) StatObject

func (w *Workspace) StatObject(key string) (*ObjectInfo, error)

func (*Workspace) StopJob

func (w *Workspace) StopJob(jobId string) error

func (*Workspace) StopJobs

func (w *Workspace) StopJobs(r *BatchJobRequest) error

func (*Workspace) UpdateJobPriority

func (w *Workspace) UpdateJobPriority(jobId string, priority int) error

func (*Workspace) UploadFile

func (w *Workspace) UploadFile(filePath string, fileType string) (string, error)

UploadFile 上传本地文件到边缘存储的根目录,只保留文件名

func (*Workspace) UploadFolder

func (w *Workspace) UploadFolder(localPath string, suffix string) ([]string, error)

UploadFolder 上传本地目录(包括子目录和文件)到边缘存储, 且保留目录层级信息

type WorkspaceHardwareSpecification

type WorkspaceHardwareSpecification struct {
	Type   string `json:"Type"`
	Count  int    `json:"Count"`
	SpecID int    `json:"SpecId"`
}

type WorkspaceInfo

type WorkspaceInfo struct {
	WorkspaceId   int    `json:"WorkspaceId"`
	WorkspaceName string `json:"WorkspaceName"`
}

type WorkspaceLimit

type WorkspaceLimit struct {
	WorkspaceSizeUpperLimit   int `json:"WorkspaceSizeUpperLimit"`
	WorkspaceAmountUpperLimit int `json:"WorkspaceAmountUpperLimit"`
}

type WorkspaceList

type WorkspaceList struct {
	Total      int         `json:"Total"`
	Workspaces []Workspace `json:"Workspaces"`
}

type WorkspaceResult

type WorkspaceResult struct {
	ClusterEndpoint string `json:"cluster_endpoint"`
	BucketName      string `json:"bucket_name"`
	BucketToken     string `json:"bucket_token"`
	VolumeName      string `json:"volume_name"`
	ClusterName     string `json:"cluster_name"`
	AccessKey       string `json:"access_key"`
	SecretKey       string `json:"secret_key"`
	WorkspaceId     int    `json:"workspace_id"`
}

Jump to

Keyboard shortcuts

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