provider

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2023 License: ISC Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MachineDeleteNotFoundError = "Error on DeleteMachine: machine not found"
View Source
var MachineNotFoundError = "Error on GetMachine: machine not found"
View Source
var RegionMap = map[string]int{
	"East Coast (NY2)": 1,
	"West Coast (CA1)": 2,
	"Europe (AMS1)":    3,
}

Functions

func ErrNotFound

func ErrNotFound(err error) bool

func LogHttpResponse

func LogHttpResponse(reqDesc string, reqURL *url.URL, resp *http.Response, body interface{}, err error)

LogHttpResponse logs http response fields

func Provider

func Provider() *schema.Provider

func SetResData

func SetResData(d *schema.ResourceData, m map[string]interface{}, n string)

func SetResDataFrom

func SetResDataFrom(d *schema.ResourceData, m map[string]interface{}, dn, n string)

Types

type ClientConfig

type ClientConfig struct {
	APIKey  string
	APIHost string
	Region  string
}

func (*ClientConfig) Client

func (c *ClientConfig) Client() (paperspaceClient PaperspaceClient)

type CreateTeamNamedNetworkParams

type CreateTeamNamedNetworkParams struct {
	Name     string `json:"name"`
	RegionId int    `json:"regionId"`
}

type JobStorage

type JobStorage struct {
	Handle string           `json:"handle"`
	TeamID int              `json:"teamId"`
	Server JobStorageServer `json:"jobStorageServer"`
}

type JobStorageServer

type JobStorageServer struct {
	IP            string        `json:"ipAddress"`
	StorageRegion StorageRegion `json:"storageRegion"`
}

type MapIf

type MapIf map[string]interface{}

func (*MapIf) Append

func (m *MapIf) Append(d *schema.ResourceData, k string)

func (*MapIf) AppendAs

func (m *MapIf) AppendAs(d *schema.ResourceData, k, nk string)

func (*MapIf) AppendAsIfSet

func (m *MapIf) AppendAsIfSet(d *schema.ResourceData, k, nk string)

func (*MapIf) AppendIfSet

func (m *MapIf) AppendIfSet(d *schema.ResourceData, k string)

func (*MapIf) AppendV

func (m *MapIf) AppendV(d *schema.ResourceData, k, v string)

type NamedNetwork

type NamedNetwork struct {
	Name    string  `json:"name"`
	Network Network `json:"network"`
}

type Network

type Network struct {
	ID      int    `json:"id"`
	Handle  string `json:"handle"`
	IsTaken bool   `json:"isTaken"`
	Network string `json:"network"`
	Netmask string `json:"netmask"`
	VlanID  int    `json:"vlanId"`
}

type PaperspaceClient

type PaperspaceClient struct {
	APIKey     string
	APIHost    string
	Region     string
	HttpClient *http.Client
}

func (*PaperspaceClient) CreateMachine

func (paperspaceClient *PaperspaceClient) CreateMachine(data []byte) (id string, err error)

func (*PaperspaceClient) CreateTeamNamedNetwork

func (paperspaceClient *PaperspaceClient) CreateTeamNamedNetwork(teamID int, createNamedNetworkParams CreateTeamNamedNetworkParams) error

func (*PaperspaceClient) DeleteMachine

func (paperspaceClient *PaperspaceClient) DeleteMachine(id string) (err error)

func (*PaperspaceClient) GetJobStorageByRegion

func (paperspaceClient *PaperspaceClient) GetJobStorageByRegion(teamID int, region string) (JobStorage, error)

func (*PaperspaceClient) GetMachine

func (paperspaceClient *PaperspaceClient) GetMachine(id string) (body map[string]interface{}, err error)

func (*PaperspaceClient) GetTeamNamedNetwork

func (paperspaceClient *PaperspaceClient) GetTeamNamedNetwork(teamID int, name string) (*NamedNetwork, error)

func (*PaperspaceClient) GetTeamNamedNetworkById

func (paperspaceClient *PaperspaceClient) GetTeamNamedNetworkById(teamID int, id string) (*NamedNetwork, error)

func (*PaperspaceClient) GetTeamNamedNetworks

func (paperspaceClient *PaperspaceClient) GetTeamNamedNetworks(teamID int) ([]NamedNetwork, error)

func (*PaperspaceClient) NewHttpRequest

func (paperspaceClient *PaperspaceClient) NewHttpRequest(method, url string, buf io.Reader) (*http.Request, error)

func (*PaperspaceClient) Request

func (paperspaceClient *PaperspaceClient) Request(method string, url string, data []byte) (body map[string]interface{}, statusCode int, err error)

func (*PaperspaceClient) RequestInterface

func (paperspaceClient *PaperspaceClient) RequestInterface(method string, url string, params, result interface{}) (res *http.Response, err error)

type StorageRegion

type StorageRegion struct {
	Name string `json:"name"`
}

Jump to

Keyboard shortcuts

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