diff --git a/README.md b/README.md index f481367..03e0f4e 100644 --- a/README.md +++ b/README.md @@ -3,16 +3,19 @@ Go client for the Proxmox VE REST API (https://pve.proxmox.com/wiki/Proxmox_VE_API) ## Overview -A Go package containing a client for [Proxmox VE](https://www.proxmox.com/). The client implements [/api2/json](https://pve.proxmox.com/pve-docs/api-viewer/index.html) and aims to provide better sdk solution for especially [cluster-api-provider-proxmox](https://github.com/sp-yduck/cluster-api-provider-proxmox) and [cloud-provider-proxmox](https://github.com/sp-yduck/cloud-provider-proxmox) project. + +A Go package containing a client for [Proxmox VE](https://www.proxmox.com/). The client implements [/api2/json](https://pve.proxmox.com/pve-docs/api-viewer/index.html) and aims to provide better sdk solution for especially [cluster-api-provider-proxmox](https://github.com/k8s-proxmox/cluster-api-provider-proxmox) and [cloud-provider-proxmox](https://github.com/k8s-proxmox/cloud-provider-proxmox) project. ## Developing ### Unit Testing + ```sh go test ./... -v -skip ^TestSuiteIntegration ``` ### Integration Testing + ```sh export PROXMOX_URL='http://localhost:8006/api2/json' # tokenid & secret @@ -23,4 +26,4 @@ export PROXMOX_SECRET='aaaaaaaaa-bbb-cccc-dddd-ef0123456789' # export PROXMOX_PASSWORD='password' go test ./... -v -run ^TestSuiteIntegration -``` \ No newline at end of file +``` diff --git a/go.mod b/go.mod index 8337794..38d468f 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/sp-yduck/proxmox-go +module github.com/k8s-proxmox/proxmox-go go 1.20 diff --git a/proxmox/cluster.go b/proxmox/cluster.go index 3265a82..32ca283 100644 --- a/proxmox/cluster.go +++ b/proxmox/cluster.go @@ -3,7 +3,7 @@ package proxmox import ( "context" - "github.com/sp-yduck/proxmox-go/api" + "github.com/k8s-proxmox/proxmox-go/api" ) func (s *Service) NextID(ctx context.Context) (int, error) { diff --git a/proxmox/node.go b/proxmox/node.go index 4967827..1e7f4f7 100644 --- a/proxmox/node.go +++ b/proxmox/node.go @@ -3,7 +3,7 @@ package proxmox import ( "context" - "github.com/sp-yduck/proxmox-go/api" + "github.com/k8s-proxmox/proxmox-go/api" ) func (s *Service) Nodes(ctx context.Context) ([]*api.Node, error) { diff --git a/proxmox/pool.go b/proxmox/pool.go index 00413e8..062bf62 100644 --- a/proxmox/pool.go +++ b/proxmox/pool.go @@ -5,7 +5,7 @@ import ( "fmt" "strings" - "github.com/sp-yduck/proxmox-go/api" + "github.com/k8s-proxmox/proxmox-go/api" ) type Pool struct { diff --git a/proxmox/qemu.go b/proxmox/qemu.go index 4f85fd7..0e5bdda 100644 --- a/proxmox/qemu.go +++ b/proxmox/qemu.go @@ -7,8 +7,8 @@ import ( "regexp" "strings" - "github.com/sp-yduck/proxmox-go/api" - "github.com/sp-yduck/proxmox-go/rest" + "github.com/k8s-proxmox/proxmox-go/api" + "github.com/k8s-proxmox/proxmox-go/rest" ) type VirtualMachine struct { diff --git a/proxmox/qemu_test.go b/proxmox/qemu_test.go index 8a6581e..4107d4d 100644 --- a/proxmox/qemu_test.go +++ b/proxmox/qemu_test.go @@ -3,7 +3,7 @@ package proxmox import ( "context" - "github.com/sp-yduck/proxmox-go/api" + "github.com/k8s-proxmox/proxmox-go/api" ) func (s *TestSuite) TestVirtualMachine() { diff --git a/proxmox/service.go b/proxmox/service.go index 7a085b2..5f0ee91 100644 --- a/proxmox/service.go +++ b/proxmox/service.go @@ -8,7 +8,7 @@ import ( "net/http" "sync" - "github.com/sp-yduck/proxmox-go/rest" + "github.com/k8s-proxmox/proxmox-go/rest" ) var ( diff --git a/proxmox/storage.go b/proxmox/storage.go index 7c43158..d0b7729 100644 --- a/proxmox/storage.go +++ b/proxmox/storage.go @@ -5,8 +5,8 @@ import ( "errors" "fmt" - "github.com/sp-yduck/proxmox-go/api" - "github.com/sp-yduck/proxmox-go/rest" + "github.com/k8s-proxmox/proxmox-go/api" + "github.com/k8s-proxmox/proxmox-go/rest" ) type Storage struct { diff --git a/proxmox/storage_test.go b/proxmox/storage_test.go index 51ef685..fd3919e 100644 --- a/proxmox/storage_test.go +++ b/proxmox/storage_test.go @@ -3,7 +3,7 @@ package proxmox import ( "context" - "github.com/sp-yduck/proxmox-go/api" + "github.com/k8s-proxmox/proxmox-go/api" ) func (s *TestSuite) TestDownloadFromURL() { diff --git a/proxmox/task.go b/proxmox/task.go index ec2ccd2..6676546 100644 --- a/proxmox/task.go +++ b/proxmox/task.go @@ -5,8 +5,8 @@ import ( "errors" "time" - "github.com/sp-yduck/proxmox-go/api" - "github.com/sp-yduck/proxmox-go/rest" + "github.com/k8s-proxmox/proxmox-go/api" + "github.com/k8s-proxmox/proxmox-go/rest" ) const ( diff --git a/proxmox/task_test.go b/proxmox/task_test.go index 160c74d..f5c3822 100644 --- a/proxmox/task_test.go +++ b/proxmox/task_test.go @@ -3,7 +3,7 @@ package proxmox import ( "context" - "github.com/sp-yduck/proxmox-go/api" + "github.com/k8s-proxmox/proxmox-go/api" ) func (s *TestSuite) TestMustGetTask() { diff --git a/proxmox/websocket.go b/proxmox/websocket.go index 30902f2..5c8d635 100644 --- a/proxmox/websocket.go +++ b/proxmox/websocket.go @@ -12,7 +12,7 @@ import ( "github.com/pkg/errors" "github.com/gorilla/websocket" - "github.com/sp-yduck/proxmox-go/api" + "github.com/k8s-proxmox/proxmox-go/api" ) const ( diff --git a/rest/access.go b/rest/access.go index 0bb4afa..e0fda37 100644 --- a/rest/access.go +++ b/rest/access.go @@ -3,7 +3,7 @@ package rest import ( "context" - "github.com/sp-yduck/proxmox-go/api" + "github.com/k8s-proxmox/proxmox-go/api" ) func (c *RESTClient) PostTicket(ctx context.Context, req TicketRequest) (*api.Session, error) { diff --git a/rest/authentication.go b/rest/authentication.go index 7fe3d2f..208c141 100644 --- a/rest/authentication.go +++ b/rest/authentication.go @@ -9,7 +9,7 @@ import ( "sync" "time" - "github.com/sp-yduck/proxmox-go/api" + "github.com/k8s-proxmox/proxmox-go/api" ) // implementation of http.RoundTripper diff --git a/rest/client.go b/rest/client.go index 5645207..934ab1a 100644 --- a/rest/client.go +++ b/rest/client.go @@ -15,7 +15,7 @@ import ( ) const ( - defaultUserAgent = "sp-yduck/proxmox-go" + defaultUserAgent = "k8s-proxmox/proxmox-go" defaultQPS = 20 ) diff --git a/rest/cluster.go b/rest/cluster.go index 01878e4..371ad15 100644 --- a/rest/cluster.go +++ b/rest/cluster.go @@ -4,7 +4,7 @@ import ( "context" "encoding/json" - "github.com/sp-yduck/proxmox-go/api" + "github.com/k8s-proxmox/proxmox-go/api" ) func (c *RESTClient) GetNextID(ctx context.Context) (int, error) { diff --git a/rest/errors.go b/rest/errors.go index cdbd799..4ea783a 100644 --- a/rest/errors.go +++ b/rest/errors.go @@ -10,7 +10,7 @@ const ( ) var ( - NotFoundErr = NewError(http.StatusNotFound, NotFound, []byte("from sp-yduck/proxmox-go")) + NotFoundErr = NewError(http.StatusNotFound, NotFound, []byte("from k8s-proxmox/proxmox-go")) ) func NewError(code int, status string, body []byte) *Error { diff --git a/rest/node.go b/rest/node.go index 4f47d74..06f7a24 100644 --- a/rest/node.go +++ b/rest/node.go @@ -5,7 +5,7 @@ import ( "fmt" "net/url" - "github.com/sp-yduck/proxmox-go/api" + "github.com/k8s-proxmox/proxmox-go/api" ) func (c *RESTClient) GetNodes(ctx context.Context) ([]*api.Node, error) { diff --git a/rest/nodes_test.go b/rest/nodes_test.go index 4d85142..6577cb3 100644 --- a/rest/nodes_test.go +++ b/rest/nodes_test.go @@ -3,7 +3,7 @@ package rest import ( "context" - "github.com/sp-yduck/proxmox-go/api" + "github.com/k8s-proxmox/proxmox-go/api" ) func (s *TestSuite) TestCreateTermProxy() { diff --git a/rest/pool.go b/rest/pool.go index 32d69c1..6a9b450 100644 --- a/rest/pool.go +++ b/rest/pool.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/sp-yduck/proxmox-go/api" + "github.com/k8s-proxmox/proxmox-go/api" ) func (c *RESTClient) GetResourcePools(ctx context.Context) ([]*api.ResourcePool, error) { diff --git a/rest/pool_test.go b/rest/pool_test.go index 41f6fc0..78f3175 100644 --- a/rest/pool_test.go +++ b/rest/pool_test.go @@ -3,7 +3,7 @@ package rest import ( "context" - "github.com/sp-yduck/proxmox-go/api" + "github.com/k8s-proxmox/proxmox-go/api" ) func (s *TestSuite) TestGetResourcePools() { diff --git a/rest/qemu.go b/rest/qemu.go index ce64aae..6291103 100644 --- a/rest/qemu.go +++ b/rest/qemu.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/sp-yduck/proxmox-go/api" + "github.com/k8s-proxmox/proxmox-go/api" ) func (c *RESTClient) GetVirtualMachines(ctx context.Context, node string) ([]*api.VirtualMachine, error) { diff --git a/rest/qemu_test.go b/rest/qemu_test.go index a676016..bca00d6 100644 --- a/rest/qemu_test.go +++ b/rest/qemu_test.go @@ -3,7 +3,7 @@ package rest import ( "context" - "github.com/sp-yduck/proxmox-go/api" + "github.com/k8s-proxmox/proxmox-go/api" ) func (s *TestSuite) TestGetVirtualMachines() { diff --git a/rest/storage.go b/rest/storage.go index 18b29d9..9217cf7 100644 --- a/rest/storage.go +++ b/rest/storage.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/sp-yduck/proxmox-go/api" + "github.com/k8s-proxmox/proxmox-go/api" ) func (c *RESTClient) GetStorages(ctx context.Context) ([]*api.Storage, error) { diff --git a/rest/storage_test.go b/rest/storage_test.go index d2eafd0..ca4358b 100644 --- a/rest/storage_test.go +++ b/rest/storage_test.go @@ -4,7 +4,7 @@ import ( "context" "time" - "github.com/sp-yduck/proxmox-go/api" + "github.com/k8s-proxmox/proxmox-go/api" ) func (s *TestSuite) TestGetStorages() { diff --git a/rest/task.go b/rest/task.go index d20d8b2..01c7973 100644 --- a/rest/task.go +++ b/rest/task.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/sp-yduck/proxmox-go/api" + "github.com/k8s-proxmox/proxmox-go/api" ) func (c *RESTClient) GetTasks(ctx context.Context, node string) ([]*api.Task, error) { diff --git a/rest/task_test.go b/rest/task_test.go index 6732745..db69515 100644 --- a/rest/task_test.go +++ b/rest/task_test.go @@ -3,7 +3,7 @@ package rest import ( "context" - "github.com/sp-yduck/proxmox-go/api" + "github.com/k8s-proxmox/proxmox-go/api" ) func (s *TestSuite) GetTestNode() *api.Node { diff --git a/rest/version.go b/rest/version.go index 3375688..0ba6e7a 100644 --- a/rest/version.go +++ b/rest/version.go @@ -3,7 +3,7 @@ package rest import ( "context" - "github.com/sp-yduck/proxmox-go/api" + "github.com/k8s-proxmox/proxmox-go/api" ) func (c *RESTClient) GetVersion(ctx context.Context) (*api.Version, error) { diff --git a/rest/websocket.go b/rest/websocket.go index e3b2788..84f7c79 100644 --- a/rest/websocket.go +++ b/rest/websocket.go @@ -12,7 +12,7 @@ import ( "github.com/gorilla/websocket" "github.com/pkg/errors" - "github.com/sp-yduck/proxmox-go/api" + "github.com/k8s-proxmox/proxmox-go/api" ) func (c *RESTClient) DialNodeVNCWebSocket(ctx context.Context, nodeName string, vnc api.TermProxy) (*websocket.Conn, error) { diff --git a/rest/websocket_test.go b/rest/websocket_test.go index c9c25a1..b12623d 100644 --- a/rest/websocket_test.go +++ b/rest/websocket_test.go @@ -3,7 +3,7 @@ package rest import ( "context" - "github.com/sp-yduck/proxmox-go/api" + "github.com/k8s-proxmox/proxmox-go/api" ) func (s *TestSuite) TestDialNodeVNCWebSocket() {