Skip to content

Commit

Permalink
transfre repo from sp-yduck to k8s-proxmox
Browse files Browse the repository at this point in the history
  • Loading branch information
sp-yduck committed Dec 6, 2023
1 parent 65b652c commit e27bc03
Show file tree
Hide file tree
Showing 31 changed files with 38 additions and 35 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -23,4 +26,4 @@ export PROXMOX_SECRET='aaaaaaaaa-bbb-cccc-dddd-ef0123456789'
# export PROXMOX_PASSWORD='password'

go test ./... -v -run ^TestSuiteIntegration
```
```
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/sp-yduck/proxmox-go
module github.com/k8s-proxmox/proxmox-go

go 1.20

Expand Down
2 changes: 1 addition & 1 deletion proxmox/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion proxmox/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion proxmox/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"strings"

"github.com/sp-yduck/proxmox-go/api"
"github.com/k8s-proxmox/proxmox-go/api"
)

type Pool struct {
Expand Down
4 changes: 2 additions & 2 deletions proxmox/qemu.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion proxmox/qemu_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion proxmox/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"net/http"
"sync"

"github.com/sp-yduck/proxmox-go/rest"
"github.com/k8s-proxmox/proxmox-go/rest"
)

var (
Expand Down
4 changes: 2 additions & 2 deletions proxmox/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion proxmox/storage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
4 changes: 2 additions & 2 deletions proxmox/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
2 changes: 1 addition & 1 deletion proxmox/task_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion proxmox/websocket.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
2 changes: 1 addition & 1 deletion rest/access.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion rest/authentication.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion rest/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
)

const (
defaultUserAgent = "sp-yduck/proxmox-go"
defaultUserAgent = "k8s-proxmox/proxmox-go"
defaultQPS = 20
)

Expand Down
2 changes: 1 addition & 1 deletion rest/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion rest/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion rest/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion rest/nodes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion rest/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion rest/pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion rest/qemu.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion rest/qemu_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion rest/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion rest/storage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion rest/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion rest/task_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion rest/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion rest/websocket.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion rest/websocket_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit e27bc03

Please sign in to comment.