Documentation
¶
Index ¶
- Constants
- Variables
- func ListImages(c *golangsdk.ServiceClient, opts ListImageOpts) (*pagination.Pager, error)
- func ListSwitchableFlavors(c *golangsdk.ServiceClient, id string) (*flavorResp, error)
- type AscendInfo
- type BillingInfo
- type CreateOpts
- type Endpoints
- type EndpointsReq
- type Flavor
- type GPUInfo
- type Image
- type ImageDetail
- type ImagePage
- type ImagesResp
- type JobProgress
- type Lease
- type ListImageOpts
- type ListNotebooks
- type ListOpts
- type ModelartsError
- type MountStorage
- type MountStorageListResp
- type MountStorageOpts
- type Notebook
- func Create(c *golangsdk.ServiceClient, opts CreateOpts) (*Notebook, error)
- func Delete(c *golangsdk.ServiceClient, id string) (*Notebook, error)
- func Get(c *golangsdk.ServiceClient, id string) (*Notebook, error)
- func Start(c *golangsdk.ServiceClient, id string, duration int) (*Notebook, error)
- func Stop(c *golangsdk.ServiceClient, id string) (*Notebook, error)
- func Update(c *golangsdk.ServiceClient, id string, opts UpdateOpts) (*Notebook, error)
- type PoolRes
- type UpdateOpts
- type VolumeReq
- type VolumeRes
Constants ¶
View Source
const ( StatusInit = "INIT" StatusCreating = "CREATING" StatusStarting = "STARTING" StatusStopping = "STOPPING" StatusDeleting = "DELETING" StatusRunning = "RUNNING" StatusStopped = "STOPPED" StatusSnapshotting = "SNAPSHOTTING" StatusCreateFailed = "CREATE_FAILED" StatusStartFailed = "START_FAILED" StatusDeleteFailed = "DELETE_FAILED" StatusError = "ERROR" StatusDeleted = "DELETED" StatusFrozen = "FROZEN" )
Variables ¶
View Source
var RequestOpts = golangsdk.RequestOpts{ MoreHeaders: map[string]string{"Content-Type": "application/json", "X-Language": "en-us"}, }
Functions ¶
func ListImages ¶
func ListImages(c *golangsdk.ServiceClient, opts ListImageOpts) (*pagination.Pager, error)
func ListSwitchableFlavors ¶
func ListSwitchableFlavors(c *golangsdk.ServiceClient, id string) (*flavorResp, error)
Types ¶
type AscendInfo ¶
type BillingInfo ¶
type CreateOpts ¶
type CreateOpts struct {
Name string `json:"name" required:"true"`
Flavor string `json:"flavor" required:"true"`
ImageId string `json:"image_id" required:"true"`
Volume VolumeReq `json:"volume" required:"true"`
Description string `json:"description,omitempty"`
Duration *int `json:"duration,omitempty"`
Endpoints []EndpointsReq `json:"endpoints,omitempty"`
Feature string `json:"feature,omitempty"`
PoolId string `json:"pool_id,omitempty"`
WorkspaceId string `json:"workspace_id,omitempty"`
}
type EndpointsReq ¶
type Flavor ¶
type Flavor struct {
Arch string `json:"arch"`
Ascend AscendInfo `json:"ascend"`
Billing BillingInfo `json:"billing"`
Category string `json:"category"`
Description string `json:"description"`
Feature string `json:"feature"`
Free bool `json:"free"`
Gpu GPUInfo `json:"gpu"`
Id string `json:"id"`
Memory int `json:"memory"`
Name string `json:"name"`
SoldOut bool `json:"sold_out"`
Storages []string `json:"storages"`
Vcpus int `json:"vcpus"`
}
type ImageDetail ¶
type ImageDetail struct {
Id string `json:"id"`
Name string `json:"name"`
SwrPath string `json:"swr_path"`
Type string `json:"type"`
Description string `json:"description"`
Arch string `json:"arch"`
}
func ExtractImages ¶
func ExtractImages(r pagination.Page) ([]ImageDetail, error)
type ImagePage ¶
type ImagePage struct {
pagination.OffsetPageBase
}
func (ImagePage) NextPageURL ¶
NextPageURL generates the URL for the page of results after this one.
type ImagesResp ¶
type ImagesResp struct {
Current int `json:"current"`
Data []ImageDetail `json:"data"`
Pages int `json:"pages"`
Size int `json:"size"`
Total int `json:"total"`
}
type JobProgress ¶
type Lease ¶
type Lease struct {
CreateAt int `json:"create_at"`
Duration int `json:"duration"`
Enable bool `json:"enable"`
UpdateAt int `json:"update_at"`
}
func UpdateLease ¶
type ListImageOpts ¶
type ListImageOpts struct {
Limit int `q:"limit,omitempty"`
Name string `q:"name,omitempty"`
Namespace string `q:"namespace,omitempty"`
Offset int `q:"offset,omitempty"`
SortDir string `q:"sort_dir,omitempty"`
SortKey string `q:"sort_key,omitempty"`
Type string `q:"type,omitempty"`
WorkspaceId string `q:"workspace_id,omitempty"`
}
type ListNotebooks ¶
type ListNotebooks struct {
Current int `json:"current"`
Data []Notebook `json:"data"`
Pages int `json:"pages"`
Size int `json:"size"`
Total int `json:"total"`
}
func List ¶
func List(c *golangsdk.ServiceClient, opts ListOpts) (*ListNotebooks, error)
type ListOpts ¶
type ListOpts struct {
Feature string `q:"feature,omitempty"`
Limit int `q:"limit,omitempty"`
Name string `q:"name,omitempty"`
Offset int `q:"offset,omitempty"`
Owner string `q:"owner,omitempty"`
SortDir string `q:"sort_dir,omitempty"`
SortKey string `q:"sort_key,omitempty"`
Status string `q:"status,omitempty"`
WorkspaceId string `q:"workspaceId,omitempty"`
}
type ModelartsError ¶
type MountStorage ¶
type MountStorage struct {
Category string `json:"category"`
Id string `json:"id"`
MountPath string `json:"mount_path"`
Status string `json:"status"`
Uri string `json:"uri"`
}
func DeleteMount ¶
func DeleteMount(c *golangsdk.ServiceClient, id, storageId string) (*MountStorage, error)
func GetMount ¶
func GetMount(c *golangsdk.ServiceClient, id, storageId string) (*MountStorage, error)
func Mount ¶
func Mount(c *golangsdk.ServiceClient, id string, opts MountStorageOpts) (*MountStorage, error)
type MountStorageListResp ¶
type MountStorageListResp struct {
Current int `json:"current"`
Data []MountStorage `json:"data"`
Pages int `json:"pages"`
Size int `json:"size"`
Total int `json:"total"`
}
func ListMounts ¶
func ListMounts(c *golangsdk.ServiceClient, id string) (*MountStorageListResp, error)
type MountStorageOpts ¶
type Notebook ¶
type Notebook struct {
ActionProgress []JobProgress `json:"action_progress"`
Description string `json:"description"`
Endpoints []Endpoints `json:"endpoints"`
FailReason string `json:"fail_reason"`
Feature string `json:"feature"`
Flavor string `json:"flavor"`
Id string `json:"id"`
Image Image `json:"image"`
Lease Lease `json:"lease"`
Name string `json:"name"`
Pool PoolRes `json:"pool"`
Status string `json:"status"`
Token string `json:"token"`
Url string `json:"url"`
Volume VolumeRes `json:"volume"`
WorkspaceId string `json:"workspace_id"`
CreateAt int `json:"create_at"`
UpdateAt int `json:"update_at"`
}
func Create ¶
func Create(c *golangsdk.ServiceClient, opts CreateOpts) (*Notebook, error)
func Update ¶
func Update(c *golangsdk.ServiceClient, id string, opts UpdateOpts) (*Notebook, error)
type UpdateOpts ¶
type UpdateOpts struct {
Description *string `json:"description,omitempty"`
Endpoints []EndpointsReq `json:"endpoints,omitempty"`
Flavor string `json:"flavor,omitempty"`
ImageId string `json:"image_id,omitempty"`
Name string `json:"name,omitempty"`
StorageNewSize *int `json:"storage_new_size,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.