| @@ -4,7 +4,7 @@ import ( | |||||
| "net/url" | "net/url" | ||||
| "gitlink.org.cn/cloudream/common/consts/errorcode" | "gitlink.org.cn/cloudream/common/consts/errorcode" | ||||
| stgsdk "gitlink.org.cn/cloudream/common/sdks/storage" | |||||
| cdssdk "gitlink.org.cn/cloudream/common/sdks/storage" | |||||
| myhttp "gitlink.org.cn/cloudream/common/utils/http" | myhttp "gitlink.org.cn/cloudream/common/utils/http" | ||||
| ) | ) | ||||
| @@ -15,8 +15,8 @@ type PackageGetWithObjectCacheInfos struct { | |||||
| PackageID int64 `json:"packageID"` | PackageID int64 `json:"packageID"` | ||||
| } | } | ||||
| type PackageGetWithObjectCacheInfosResp struct { | type PackageGetWithObjectCacheInfosResp struct { | ||||
| Package stgsdk.Package `json:"package"` | |||||
| ObjectCacheInfos []stgsdk.ObjectCacheInfo `json:"objectCacheInfos"` | |||||
| Package cdssdk.Package `json:"package"` | |||||
| ObjectCacheInfos []cdssdk.ObjectCacheInfo `json:"objectCacheInfos"` | |||||
| } | } | ||||
| func (c *Client) PackageGetWithObjectCacheInfos(req PackageGetWithObjectCacheInfos) (*PackageGetWithObjectCacheInfosResp, error) { | func (c *Client) PackageGetWithObjectCacheInfos(req PackageGetWithObjectCacheInfos) (*PackageGetWithObjectCacheInfosResp, error) { | ||||
| @@ -1,27 +1,29 @@ | |||||
| package pcmsdk | package pcmsdk | ||||
| import schsdk "gitlink.org.cn/cloudream/common/sdks/scheduler" | |||||
| type ParticipantID int64 | |||||
| type Participant struct { | type Participant struct { | ||||
| ID schsdk.SlwNodeID `json:"id"` | |||||
| Name string `json:"name"` | |||||
| Type string `json:"type"` | |||||
| ID ParticipantID `json:"id"` | |||||
| Name string `json:"name"` | |||||
| Type string `json:"type"` | |||||
| } | } | ||||
| type ImageID string | |||||
| type Image struct { | type Image struct { | ||||
| ImageID schsdk.SlwNodeImageID `json:"imageID"` | |||||
| ImageName string `json:"imageName"` | |||||
| ImageStatus string `json:"imageStatus"` | |||||
| ImageID ImageID `json:"imageID"` | |||||
| ImageName string `json:"imageName"` | |||||
| ImageStatus string `json:"imageStatus"` | |||||
| } | } | ||||
| type ResourceID string | type ResourceID string | ||||
| type Resource struct { | type Resource struct { | ||||
| ParticipantID schsdk.SlwNodeID `json:"participantID"` | |||||
| ParticipantName string `json:"participantName"` | |||||
| SpecName string `json:"specName"` | |||||
| SpecID ResourceID `json:"specId"` | |||||
| SpecPrice float64 `json:"specPrice"` | |||||
| ParticipantID ParticipantID `json:"participantID"` | |||||
| ParticipantName string `json:"participantName"` | |||||
| SpecName string `json:"specName"` | |||||
| SpecID ResourceID `json:"specId"` | |||||
| SpecPrice float64 `json:"specPrice"` | |||||
| } | } | ||||
| type TaskID string | type TaskID string | ||||
| @@ -15,13 +15,14 @@ import ( | |||||
| const CodeOK int = 200 | const CodeOK int = 200 | ||||
| type UploadImageReq struct { | type UploadImageReq struct { | ||||
| SlwNodeID schsdk.SlwNodeID `json:"slwNodeID"` | |||||
| ImagePath string `json:"imagePath"` | |||||
| PartID ParticipantID `json:"partID"` | |||||
| ImagePath string `json:"imagePath"` | |||||
| } | } | ||||
| type UploadImageResp struct { | type UploadImageResp struct { | ||||
| Result string `json:"result"` | |||||
| ImageID schsdk.SlwNodeImageID `json:"imageID"` | |||||
| Result string `json:"result"` | |||||
| ImageID ImageID `json:"imageID"` | |||||
| Name string `json:"name"` | |||||
| } | } | ||||
| // TODO | // TODO | ||||
| @@ -93,7 +94,7 @@ func (c *Client) GetParticipants() (*GetParticipantsResp, error) { | |||||
| } | } | ||||
| type GetImageListReq struct { | type GetImageListReq struct { | ||||
| PartID schsdk.SlwNodeID `json:"partId"` | |||||
| PartID ParticipantID `json:"partId"` | |||||
| } | } | ||||
| type GetImageListResp struct { | type GetImageListResp struct { | ||||
| @@ -133,8 +134,8 @@ func (c *Client) GetImageList(req GetImageListReq) (*GetImageListResp, error) { | |||||
| } | } | ||||
| type DeleteImageReq struct { | type DeleteImageReq struct { | ||||
| PartID schsdk.SlwNodeID `json:"partID"` | |||||
| ImageID schsdk.SlwNodeImageID `json:"imageID"` | |||||
| PartID ParticipantID `json:"partID"` | |||||
| ImageID ImageID `json:"imageID"` | |||||
| } | } | ||||
| func (c *Client) DeleteImage(req DeleteImageReq) error { | func (c *Client) DeleteImage(req DeleteImageReq) error { | ||||
| @@ -167,12 +168,12 @@ func (c *Client) DeleteImage(req DeleteImageReq) error { | |||||
| } | } | ||||
| type SubmitTaskReq struct { | type SubmitTaskReq struct { | ||||
| PartID schsdk.SlwNodeID `json:"partId"` | |||||
| ImageID schsdk.SlwNodeImageID `json:"imageId"` | |||||
| ResourceID ResourceID `json:"resourceId"` | |||||
| CMD string `json:"cmd"` | |||||
| Params []schsdk.KVPair `json:"params"` | |||||
| Envs []schsdk.KVPair `json:"envs"` | |||||
| PartID ParticipantID `json:"partId"` | |||||
| ImageID ImageID `json:"imageId"` | |||||
| ResourceID ResourceID `json:"resourceId"` | |||||
| CMD string `json:"cmd"` | |||||
| Params []schsdk.KVPair `json:"params"` | |||||
| Envs []schsdk.KVPair `json:"envs"` | |||||
| } | } | ||||
| type SubmitTaskResp struct { | type SubmitTaskResp struct { | ||||
| @@ -212,8 +213,8 @@ func (c *Client) SubmitTask(req SubmitTaskReq) (*SubmitTaskResp, error) { | |||||
| } | } | ||||
| type GetTaskReq struct { | type GetTaskReq struct { | ||||
| PartID schsdk.SlwNodeID `json:"partId"` | |||||
| TaskID TaskID `json:"taskId"` | |||||
| PartID ParticipantID `json:"partId"` | |||||
| TaskID TaskID `json:"taskId"` | |||||
| } | } | ||||
| type GetTaskResp struct { | type GetTaskResp struct { | ||||
| @@ -265,8 +266,8 @@ func (c *Client) GetTask(req GetTaskReq) (*GetTaskResp, error) { | |||||
| } | } | ||||
| type DeleteTaskReq struct { | type DeleteTaskReq struct { | ||||
| PartID schsdk.SlwNodeID `json:"partId"` | |||||
| TaskID TaskID `json:"taskId"` | |||||
| PartID ParticipantID `json:"partId"` | |||||
| TaskID TaskID `json:"taskId"` | |||||
| } | } | ||||
| func (c *Client) DeleteTask(req DeleteTaskReq) error { | func (c *Client) DeleteTask(req DeleteTaskReq) error { | ||||
| @@ -299,7 +300,7 @@ func (c *Client) DeleteTask(req DeleteTaskReq) error { | |||||
| } | } | ||||
| type GetResourceSpecs struct { | type GetResourceSpecs struct { | ||||
| PartID schsdk.SlwNodeID `json:"partId"` | |||||
| PartID ParticipantID `json:"partId"` | |||||
| } | } | ||||
| type GetResourceSpecsResp struct { | type GetResourceSpecsResp struct { | ||||
| @@ -3,7 +3,7 @@ package schsdk | |||||
| import ( | import ( | ||||
| "gitlink.org.cn/cloudream/common/pkgs/mq" | "gitlink.org.cn/cloudream/common/pkgs/mq" | ||||
| "gitlink.org.cn/cloudream/common/pkgs/types" | "gitlink.org.cn/cloudream/common/pkgs/types" | ||||
| stgsdk "gitlink.org.cn/cloudream/common/sdks/storage" | |||||
| cdssdk "gitlink.org.cn/cloudream/common/sdks/storage" | |||||
| "gitlink.org.cn/cloudream/common/utils/serder" | "gitlink.org.cn/cloudream/common/utils/serder" | ||||
| ) | ) | ||||
| @@ -23,9 +23,8 @@ type JobSetID string | |||||
| type ImageID string | type ImageID string | ||||
| type SlwNodeID int64 | |||||
| type SlwNodeImageID string | |||||
| // 计算中心ID | |||||
| type CCID string | |||||
| type JobSetInfo struct { | type JobSetInfo struct { | ||||
| Jobs []JobInfo `json:"jobs"` | Jobs []JobInfo `json:"jobs"` | ||||
| @@ -62,7 +61,7 @@ type ResourceJobInfo struct { | |||||
| JobInfoBase | JobInfoBase | ||||
| Type string `json:"type" union:"Resource"` | Type string `json:"type" union:"Resource"` | ||||
| BucketID int64 `json:"bucketID"` | BucketID int64 `json:"bucketID"` | ||||
| Redundancy stgsdk.TypedRedundancyInfo `json:"redundancy"` | |||||
| Redundancy cdssdk.TypedRedundancyInfo `json:"redundancy"` | |||||
| TargetLocalJobID string `json:"targetLocalJobID"` | TargetLocalJobID string `json:"targetLocalJobID"` | ||||
| } | } | ||||
| @@ -155,5 +154,5 @@ type JobSetFilesUploadScheme struct { | |||||
| type LocalFileUploadScheme struct { | type LocalFileUploadScheme struct { | ||||
| LocalPath string `json:"localPath"` | LocalPath string `json:"localPath"` | ||||
| UploadToStgNodeID *int64 `json:"uploadToStgNodeID"` | |||||
| UploadToCDSNodeID *int64 `json:"uploadToCDSNodeID"` | |||||
| } | } | ||||
| @@ -1,4 +1,4 @@ | |||||
| package stgsdk | |||||
| package cdssdk | |||||
| import ( | import ( | ||||
| "net/url" | "net/url" | ||||
| @@ -1,4 +1,4 @@ | |||||
| package stgsdk | |||||
| package cdssdk | |||||
| import ( | import ( | ||||
| "gitlink.org.cn/cloudream/common/sdks" | "gitlink.org.cn/cloudream/common/sdks" | ||||
| @@ -1,4 +1,4 @@ | |||||
| package stgsdk | |||||
| package cdssdk | |||||
| type Config struct { | type Config struct { | ||||
| URL string `json:"url"` | URL string `json:"url"` | ||||
| @@ -1,4 +1,4 @@ | |||||
| package stgsdk | |||||
| package cdssdk | |||||
| import ( | import ( | ||||
| "fmt" | "fmt" | ||||
| @@ -1,4 +1,4 @@ | |||||
| package stgsdk | |||||
| package cdssdk | |||||
| import ( | import ( | ||||
| "fmt" | "fmt" | ||||
| @@ -1,4 +1,4 @@ | |||||
| package stgsdk | |||||
| package cdssdk | |||||
| import ( | import ( | ||||
| "fmt" | "fmt" | ||||
| @@ -1,4 +1,4 @@ | |||||
| package stgsdk | |||||
| package cdssdk | |||||
| import ( | import ( | ||||
| "fmt" | "fmt" | ||||
| @@ -1,4 +1,4 @@ | |||||
| package stgsdk | |||||
| package cdssdk | |||||
| import ( | import ( | ||||
| "bytes" | "bytes" | ||||
| @@ -1,4 +1,4 @@ | |||||
| package stgsdk | |||||
| package cdssdk | |||||
| import "path/filepath" | import "path/filepath" | ||||
| @@ -3,7 +3,6 @@ package uopsdk | |||||
| import ( | import ( | ||||
| "gitlink.org.cn/cloudream/common/pkgs/mq" | "gitlink.org.cn/cloudream/common/pkgs/mq" | ||||
| "gitlink.org.cn/cloudream/common/pkgs/types" | "gitlink.org.cn/cloudream/common/pkgs/types" | ||||
| schsdk "gitlink.org.cn/cloudream/common/sdks/scheduler" | |||||
| "gitlink.org.cn/cloudream/common/utils/serder" | "gitlink.org.cn/cloudream/common/utils/serder" | ||||
| ) | ) | ||||
| @@ -18,12 +17,12 @@ const ( | |||||
| ResourceTypeMemory ResourceType = "MEMORY" | ResourceTypeMemory ResourceType = "MEMORY" | ||||
| ) | ) | ||||
| type SlwNodeID int64 | |||||
| type SlwNode struct { | type SlwNode struct { | ||||
| ID schsdk.SlwNodeID `json:"id"` | |||||
| Name string `json:"name"` | |||||
| SlwRegionID int64 `json:"slwRegionID"` | |||||
| StgNodeID int64 `json:"stgNodeID"` | |||||
| StorageID int64 `json:"StorageID"` | |||||
| ID SlwNodeID `json:"id"` | |||||
| Name string `json:"name"` | |||||
| SlwRegionID int64 `json:"slwRegionID"` | |||||
| } | } | ||||
| type ResourceData interface { | type ResourceData interface { | ||||
| @@ -5,7 +5,6 @@ import ( | |||||
| "net/url" | "net/url" | ||||
| "strings" | "strings" | ||||
| schsdk "gitlink.org.cn/cloudream/common/sdks/scheduler" | |||||
| myhttp "gitlink.org.cn/cloudream/common/utils/http" | myhttp "gitlink.org.cn/cloudream/common/utils/http" | ||||
| "gitlink.org.cn/cloudream/common/utils/serder" | "gitlink.org.cn/cloudream/common/utils/serder" | ||||
| ) | ) | ||||
| @@ -40,7 +39,7 @@ func (c *Client) GetAllSlwNodeInfo() ([]SlwNode, error) { | |||||
| } | } | ||||
| type GetOneResourceDataReq struct { | type GetOneResourceDataReq struct { | ||||
| SlwNodeID schsdk.SlwNodeID `json:"nodeId"` | |||||
| SlwNodeID SlwNodeID `json:"nodeId"` | |||||
| } | } | ||||
| func (c *Client) GetCPUData(node GetOneResourceDataReq) (*CPUResourceData, error) { | func (c *Client) GetCPUData(node GetOneResourceDataReq) (*CPUResourceData, error) { | ||||