Documentation
¶
Index ¶
- Constants
- func GetAiCenterUrl(ctr *Center) string
- func GetEFileUrlPrefix(ctr *Center) string
- func GetGroupId(baseUrlAi string, getGroupMembers string, token string) string
- func GetHpcCenterUrl(ctr *Center) string
- func GetJobManagerId(cfg *config.Config, ctr *Center, token string) int
- func GetQueueId(cfg *config.Config, ctr *Center, token string) string
- func GetRestyRequest(timeoutSeconds int64) *resty.Request
- func IsAiResourceGroupAvail(ctr *Center, resourceGroup string, token string) bool
- func IsHpcUserQueueAvail(queueId string) bool
- func NewAuthService() (map[string]*AuthService, error)
- type AuthService
- func (a *AuthService) GetAiCenterUrlPrefix() string
- func (a *AuthService) GetClusterId() string
- func (a *AuthService) GetConfig() *config.Config
- func (a *AuthService) GetEFileUrlPrefix() string
- func (a *AuthService) GetGroupId() string
- func (a *AuthService) GetHpcCenterUrlPrefix() string
- func (a *AuthService) GetJobManagerId() int
- func (a *AuthService) GetQueueId() string
- func (a *AuthService) GetToken() string
- type Center
- type CenterResp
- type ClusterResp
- type ClusterTokens
- type GroupMembers
- type ParastorQuota
- type QueueNamesResp
- type QuotaResp
- type ResourceGroupResp
- type ResourceResp
- type TokenResp
- type TokenState
Constants ¶
View Source
const ( TIMEOUT int64 = 20 CLUSTER_AVAIL_TMP = "11250" // 华东一区【昆山】 SUCCESS = "0" )
View Source
const ( NOT_EXIST = "-1" COMPLETED_OR_FAILED = "816820" )
stop logic
Variables ¶
This section is empty.
Functions ¶
func GetAiCenterUrl ¶
func GetEFileUrlPrefix ¶
func GetHpcCenterUrl ¶
func GetRestyRequest ¶
func GetRestyRequest(timeoutSeconds int64) *resty.Request
func IsAiResourceGroupAvail ¶
func IsHpcUserQueueAvail ¶
func NewAuthService ¶
func NewAuthService() (map[string]*AuthService, error)
Types ¶
type AuthService ¶
type AuthService struct { C *config.Config Token string //区域用户认证token ClusterId string AiCenterUrlPrefix string HpcCenterUrlPrefix string EFileUrlPrefix string JobManagerId int GroupId string QueueId string ResourceGroupAvail bool UserQueueAvail bool }
func GetAuthServiceWithResource ¶
func GetAuthServiceWithResource(asv map[string]*AuthService) (*AuthService, error)
func (*AuthService) GetAiCenterUrlPrefix ¶
func (a *AuthService) GetAiCenterUrlPrefix() string
func (*AuthService) GetClusterId ¶
func (a *AuthService) GetClusterId() string
func (*AuthService) GetConfig ¶
func (a *AuthService) GetConfig() *config.Config
func (*AuthService) GetEFileUrlPrefix ¶
func (a *AuthService) GetEFileUrlPrefix() string
func (*AuthService) GetGroupId ¶
func (a *AuthService) GetGroupId() string
func (*AuthService) GetHpcCenterUrlPrefix ¶
func (a *AuthService) GetHpcCenterUrlPrefix() string
func (*AuthService) GetJobManagerId ¶
func (a *AuthService) GetJobManagerId() int
func (*AuthService) GetQueueId ¶
func (a *AuthService) GetQueueId() string
func (*AuthService) GetToken ¶
func (a *AuthService) GetToken() string
type Center ¶
type Center struct { Code string `json:"code"` Msg string `json:"msg"` Data struct { Id int `json:"id"` Name string `json:"name"` Description string `json:"description"` IngressUrls []interface{} `json:"ingressUrls"` EfileUrls []struct { NodeName string `json:"nodeName"` Enable string `json:"enable"` AppId string `json:"appId,omitempty"` FastTransEnable string `json:"fastTransEnable"` AppSecret string `json:"appSecret,omitempty"` UdpPort string `json:"udpPort"` IsManagerNode string `json:"isManagerNode,omitempty"` Version string `json:"version"` Url string `json:"url"` } `json:"efileUrls"` EshellUrls []struct { NodeName string `json:"nodeName"` Enable string `json:"enable"` AppId string `json:"appId"` FastTransEnable string `json:"fastTransEnable"` AppSecret string `json:"appSecret"` UdpPort string `json:"udpPort"` IsManagerNode string `json:"isManagerNode"` Version string `json:"version"` Url string `json:"url"` } `json:"eshellUrls"` HpcUrls []struct { Enable string `json:"enable"` IsManagerNode string `json:"isManagerNode"` Version string `json:"version"` Url string `json:"url"` NodeName string `json:"nodeName,omitempty"` AppId string `json:"appId,omitempty"` FastTransEnable string `json:"fastTransEnable,omitempty"` AppSecret string `json:"appSecret,omitempty"` UdpPort string `json:"udpPort,omitempty"` } `json:"hpcUrls"` AiUrls []struct { NodeName string `json:"nodeName"` Enable string `json:"enable"` AppId string `json:"appId"` FastTransEnable string `json:"fastTransEnable"` AppSecret string `json:"appSecret"` UdpPort string `json:"udpPort"` IsManagerNode string `json:"isManagerNode"` Version string `json:"version"` Url string `json:"url"` SchedulerType string `json:"schedulerType"` } `json:"aiUrls"` EshellSshHosts []struct { Enable string `json:"enable"` Url string `json:"url"` } `json:"eshellSshHosts"` InternetSshHosts []struct { LimitState string `json:"limitState"` Url string `json:"url"` } `json:"internetSshHosts"` ClusterUserInfo struct { UserName string `json:"userName"` HomePath string `json:"homePath"` UserId string `json:"userId"` UserGroup string `json:"userGroup"` UserShell string `json:"userShell"` } `json:"clusterUserInfo"` } `json:"data"` }
type CenterResp ¶
type CenterResp struct { Code string `json:"code"` Msg string `json:"msg"` Data struct { Id int `json:"id"` Name string `json:"name"` Description string `json:"description"` IngressUrls []interface{} `json:"ingressUrls"` EfileUrls []struct { NodeName string `json:"nodeName"` Enable string `json:"enable"` FastTransEnable string `json:"fastTransEnable"` UdpPort string `json:"udpPort"` Version string `json:"version"` Url string `json:"url"` AppId string `json:"appId,omitempty"` AppSecret string `json:"appSecret,omitempty"` IsManagerNode string `json:"isManagerNode,omitempty"` } `json:"efileUrls"` EshellUrls []struct { Enable string `json:"enable"` Version string `json:"version"` Url string `json:"url"` NodeName string `json:"nodeName,omitempty"` AppId string `json:"appId,omitempty"` AppSecret string `json:"appSecret,omitempty"` FastTransEnable string `json:"fastTransEnable,omitempty"` UdpPort string `json:"udpPort,omitempty"` IsManagerNode string `json:"isManagerNode,omitempty"` } `json:"eshellUrls"` HpcUrls []struct { Enable string `json:"enable"` IsManagerNode string `json:"isManagerNode"` Version string `json:"version"` Url string `json:"url"` } `json:"hpcUrls"` AiUrls []struct { Enable string `json:"enable"` Version string `json:"version"` Url string `json:"url"` } `json:"aiUrls"` EshellSshHosts []struct { Enable string `json:"enable"` Url string `json:"url"` NodeName string `json:"nodeName,omitempty"` AppId string `json:"appId,omitempty"` AppSecret string `json:"appSecret,omitempty"` FastTransEnable string `json:"fastTransEnable,omitempty"` UdpPort string `json:"udpPort,omitempty"` IsManagerNode string `json:"isManagerNode,omitempty"` Version string `json:"version,omitempty"` } `json:"eshellSshHosts"` InternetSshHosts []struct { LimitState string `json:"limitState"` Url string `json:"url"` } `json:"internetSshHosts"` ClusterUserInfo struct { UserName string `json:"userName"` HomePath string `json:"homePath"` } `json:"clusterUserInfo"` } `json:"data"` }
type ClusterResp ¶
type ClusterTokens ¶
func GetClusterTokens ¶
func GetClusterTokens(cfg *config.Config) ([]*ClusterTokens, error)
type GroupMembers ¶
type GroupMembers struct { Code string `json:"code"` Msg string `json:"msg"` Data []struct { AccountId string `json:"accountId"` AccountName string `json:"accountName"` GroupDisplayName string `json:"groupDisplayName"` GroupId string `json:"groupId"` GroupRole string `json:"groupRole"` GroupUsersInfos []struct { UserId string `json:"userId"` UserName string `json:"userName"` ClusterId string `json:"clusterId"` ClusterUserName string `json:"clusterUserName"` } `json:"groupUsersInfos"` } `json:"data"` }
type ParastorQuota ¶
type QueueNamesResp ¶
type QueueNamesResp struct { Code string `json:"code"` Msg string `json:"msg"` Data []struct { QueuePriority int `json:"queuePriority"` QueFreeNcpus string `json:"queFreeNcpus"` QueNodes string `json:"queNodes"` QueNcpus string `json:"queNcpus"` QueMaxNgpus string `json:"queMaxNgpus"` QueMaxPPN string `json:"queMaxPPN"` QueChargeRate string `json:"queChargeRate"` QueMaxNcpus string `json:"queMaxNcpus"` AclHosts string `json:"aclHosts"` QueMaxNdcus string `json:"queMaxNdcus"` QueueName string `json:"queueName"` QueMaxNmlus string `json:"queMaxNmlus"` QueFreeNodes string `json:"queFreeNodes"` QueMaxNodect string `json:"queMaxNodect"` QueMaxGpuPN string `json:"queMaxGpuPN"` Id string `json:"id"` Text string `json:"text"` QueMaxWalltime string `json:"queMaxWalltime"` QueMaxDcuPN string `json:"queMaxDcuPN"` QueueEnabled bool `json:"queueEnabled"` } `json:"data"` }
type QuotaResp ¶
type QuotaResp struct { Code string `json:"code"` Msg string `json:"msg"` Data struct { UserName interface{} `json:"userName"` AccountName interface{} `json:"accountName"` UserMaxCpu int `json:"userMaxCpu"` UserMaxDcu int `json:"userMaxDcu"` UserMaxGpu int `json:"userMaxGpu"` UserMaxMlu int `json:"userMaxMlu"` UserMaxMem int `json:"userMaxMem"` UserMaxNode int `json:"userMaxNode"` UserMaxSubmitJob int `json:"userMaxSubmitJob"` UserMaxRunJob int `json:"userMaxRunJob"` AccountMaxCpu int `json:"accountMaxCpu"` AccountMaxDcu int `json:"accountMaxDcu"` AccountMaxGpu int `json:"accountMaxGpu"` AccountMaxMlu int `json:"accountMaxMlu"` AccountMaxMem int `json:"accountMaxMem"` AccountMaxNode int `json:"accountMaxNode"` AccountMaxSubmitJob int `json:"accountMaxSubmitJob"` AccountMaxRunJob int `json:"accountMaxRunJob"` UserMinCpu int `json:"userMinCpu"` UserMinNode int `json:"userMinNode"` MaxWallTime int `json:"maxWallTime"` } `json:"data"` }
type ResourceGroupResp ¶
type ResourceResp ¶
type ResourceResp struct { Code string `json:"code"` Msg string `json:"msg"` Data struct { Id interface{} `json:"id"` CpuNumber int `json:"cpuNumber"` MluLimits int `json:"mluLimits"` DcuLimits int `json:"dcuLimits"` NvLimits int `json:"nvLimits"` GpuNumber int `json:"gpuNumber"` MemorySize int `json:"memorySize"` ResourceGroup string `json:"resourceGroup"` UserName interface{} `json:"userName"` NodeNumber int `json:"nodeNumber"` MaxTime string `json:"maxTime"` } `json:"data"` }
type TokenState ¶
Click to show internal directories.
Click to hide internal directories.