Documentation
¶
Index ¶
- Variables
- type APIBackend
- type APIToken
- type Backend
- type Client
- func (c Client) CreateCluster(params ClusterCreateParams) (Cluster, error)
- func (c Client) GetCluster(ID string) (Cluster, error)
- func (c Client) GetClusters(p ...ClusterListParams) ([]Cluster, error)
- func (c *Client) Request(method, url string, params, result interface{}) (*http.Response, error)
- func (c Client) UpdateCluster(id string, p ClusterUpdateParams) (Cluster, error)
- type Cluster
- type ClusterCreateParams
- type ClusterListParams
- type ClusterPlatformType
- type ClusterUpdateAttributeParams
- type ClusterUpdateParams
- type ClusterUpdateRegistryParams
- type ClusterUpdateS3Params
- type PaperspaceError
- type PaperspaceErrorResponse
- type S3Credential
Constants ¶
This section is empty.
Variables ¶
View Source
var ClusterAWSRegions = []string{
"us-east-1",
"us-east-2",
"us-west-2",
"ca-central-1",
"sa-east-1",
"eu-west-1",
"eu-west-2",
"eu-west-3",
"eu-central-1",
"eu-north-1",
"me-south-1",
"ap-east-1",
"ap-northeast-1",
"ap-northeast-2",
"ap-southeast-1",
"ap-southeast-2",
"ap-south-1",
}
View Source
var ClusterPlatforms = []ClusterPlatformType{ClusterPlatformAWS, ClusterPlatformMetal}
View Source
var DefaultBaseURL = "https://api.paperspace.io"
View Source
var DefaultClusterType = 3
Functions ¶
This section is empty.
Types ¶
type APIBackend ¶
type APIBackend struct { BaseURL string Debug bool DebugBody bool HTTPClient *http.Client RetryCount int }
func NewAPIBackend ¶
func NewAPIBackend() *APIBackend
type Client ¶
func NewClientWithBackend ¶
func (Client) CreateCluster ¶
func (c Client) CreateCluster(params ClusterCreateParams) (Cluster, error)
func (Client) GetClusters ¶
func (c Client) GetClusters(p ...ClusterListParams) ([]Cluster, error)
func (Client) UpdateCluster ¶
func (c Client) UpdateCluster(id string, p ClusterUpdateParams) (Cluster, error)
type Cluster ¶
type Cluster struct { APIToken APIToken `json:"apiToken"` Domain string `json:"fqdn"` Platform ClusterPlatformType `json:"cloud"` Name string `json:"name"` ID string `json:"id"` Region string `json:"region,omitempty"` S3Credential S3Credential `json:"s3Credential"` TeamID string `json:"teamId"` Type string `json:"type,omitempty"` }
type ClusterCreateParams ¶
type ClusterCreateParams struct { ArtifactsAccessKeyID string `json:"accessKey,omitempty" yaml:"artifactsAccessKeyId,omitempty"` ArtifactsBucketPath string `json:"bucketPath,omitempty" yaml:"artifactsBucketPath,omitempty"` ArtifactsSecretAccessKey string `json:"secretKey,omitempty" yaml:"artifactsSecretAccessKey,omitempty"` Domain string `json:"fqdn" yaml:"domain"` IsDefault bool `json:"isDefault,omitempty" yaml"isDefault,omitempty"` Name string `json:"name" yaml:"name"` Platform string `json:"cloud,omitempty" yaml:"platform,omitempty"` Region string `json:"region,omitempty, yaml:"region,omitempty"` Type int `json:"type,omitempty" yaml:"type,omitempty"` }
type ClusterListParams ¶
func NewClusterListParams ¶
func NewClusterListParams() *ClusterListParams
type ClusterPlatformType ¶
type ClusterPlatformType string
const ( ClusterPlatformAWS ClusterPlatformType = "aws" ClusterPlatformMetal ClusterPlatformType = "metal" )
type ClusterUpdateParams ¶
type ClusterUpdateParams struct { Attributes ClusterUpdateAttributeParams `json:"attributes,omitempty"` CreateNewToken bool `json:"createNewToken,omitempty"` RegistryAttributes ClusterUpdateRegistryParams `json:"registryAttributes,omitempty"` ID string `json:"id"` RetryWorkflow bool `json:"retryWorkflow,omitempty"` S3Attributes ClusterUpdateS3Params `json:"s3Attributes,omitempty"` }
type ClusterUpdateS3Params ¶
type PaperspaceError ¶
type PaperspaceError struct { Name string `json:"name"` Message string `json:"message"` Status int `json:"status"` }
func (PaperspaceError) Error ¶
func (e PaperspaceError) Error() string
type PaperspaceErrorResponse ¶
type PaperspaceErrorResponse struct {
Error *PaperspaceError `json:"error"`
}
type S3Credential ¶
Click to show internal directories.
Click to hide internal directories.