0
0
mirror of https://github.com/bpg/terraform-provider-proxmox.git synced 2025-07-06 14:03:58 +00:00
terraform-provider-proxmox/proxmox/cluster/client.go
MacherelR 48bb57f0c7 fix(sdn): resolve linter warnings and apply gofumpt formatting
Signed-off-by: MacherelR <64424331+MacherelR@users.noreply.github.com>
2025-06-24 08:32:48 +02:00

75 lines
2.4 KiB
Go

/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package cluster
import (
"fmt"
"github.com/bpg/terraform-provider-proxmox/proxmox/api"
"github.com/bpg/terraform-provider-proxmox/proxmox/cluster/acme"
clusterfirewall "github.com/bpg/terraform-provider-proxmox/proxmox/cluster/firewall"
"github.com/bpg/terraform-provider-proxmox/proxmox/cluster/ha"
"github.com/bpg/terraform-provider-proxmox/proxmox/cluster/mapping"
"github.com/bpg/terraform-provider-proxmox/proxmox/cluster/metrics"
"github.com/bpg/terraform-provider-proxmox/proxmox/cluster/sdn/subnets"
"github.com/bpg/terraform-provider-proxmox/proxmox/cluster/sdn/vnets"
"github.com/bpg/terraform-provider-proxmox/proxmox/cluster/sdn/zones"
"github.com/bpg/terraform-provider-proxmox/proxmox/firewall"
)
// Client is an interface for accessing the Proxmox cluster API.
type Client struct {
api.Client
}
// ExpandPath expands a relative path to a full cluster API path.
func (c *Client) ExpandPath(path string) string {
return fmt.Sprintf("cluster/%s", path)
}
// Firewall returns a client for managing the cluster firewall.
func (c *Client) Firewall() clusterfirewall.API {
return &clusterfirewall.Client{
Client: firewall.Client{Client: c},
}
}
// HA returns a client for managing the cluster's High Availability features.
func (c *Client) HA() *ha.Client {
return &ha.Client{Client: c}
}
// HardwareMapping returns a client for managing the cluster's hardware mapping features.
func (c *Client) HardwareMapping() *mapping.Client {
return &mapping.Client{Client: c}
}
// ACME returns a client for managing the cluster's ACME features.
func (c *Client) ACME() *acme.Client {
return &acme.Client{Client: c}
}
// Metrics returns a client for managing the cluster's metrics features.
func (c *Client) Metrics() *metrics.Client {
return &metrics.Client{Client: c}
}
// SDNZones returns a client for managing the cluster's SDN zones.
func (c *Client) SDNZones() *zones.Client {
return &zones.Client{Client: c}
}
// SDNVnets returns a client for managing the cluster's SDN Vnets.
func (c *Client) SDNVnets() *vnets.Client {
return &vnets.Client{Client: c}
}
// SDNSubnets returns a client for managing the cluster's SDN Subnets.
func (c *Client) SDNSubnets() *subnets.Client {
return &subnets.Client{Client: c}
}