http

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	HttpClient *http.Client
	Token      string
	BaseURL    string
}

func NewClient

func NewClient(token string) *Client

func (*Client) AddUserSSHKey

func (client *Client) AddUserSSHKey(sshKeyName string, sshkey string) (*responses.AddUserSSHKeyResponse, error)

AddUserSSHKey adds a new SSH key for the user. Pass body as JSON: {"name":"My SSH Key","ssh_key":"ssh-rsa ..."}

func (*Client) AssignLoadBalancerRule

func (client *Client) AssignLoadBalancerRule(zoneId, networkId, ruleId string, instanceNetworkIds []string) (*responses.SuccessResponse, error)

func (*Client) AssociateNetworkPublicIp

func (client *Client) AssociateNetworkPublicIp(zoneId, networkId string) (*responses.NetworkPublicIpActionResponse, error)

Public IP: Associate

func (*Client) AttachInstanceVolume

func (client *Client) AttachInstanceVolume(zoneId, volumeId, instanceId string) (*responses.InstanceVolumeActionResponse, error)

Volume Attach

func (*Client) ConnectInstanceToNetwork

func (client *Client) ConnectInstanceToNetwork(zoneId, networkId, instanceId string) (*responses.InstanceNetworkActionResponse, error)

func (*Client) CreateDomain

func (client *Client) CreateDomain(domain string) (*responses.DnsMessage, error)

func (*Client) CreateIPv4FirewallRule

func (client *Client) CreateIPv4FirewallRule(zoneId, networkId string, body map[string]interface{}) (*responses.IPv4FirewallRuleActionResponse, error)

Create IPv4 Firewall Rule

func (*Client) CreateIPv6FirewallRule

func (client *Client) CreateIPv6FirewallRule(zoneId, networkId string, body map[string]interface{}) (*responses.IPv6FirewallRuleActionResponse, error)

Create IPv6 Firewall Rule

func (*Client) CreateInstance

func (client *Client) CreateInstance(zoneId, serviceOfferingId, vmImageId string, networkIds []string, name string) (*responses.InstanceCreateResponse, error)

func (*Client) CreateInstanceSnapshot

func (client *Client) CreateInstanceSnapshot(zoneId, instanceId, name string) (*responses.InstanceSnapshotCreateResponse, error)

Snapshot Create

func (*Client) CreateInstanceVolume

func (client *Client) CreateInstanceVolume(zoneId, serviceOfferingId string, size int, name string) (*responses.InstanceVolumeCreateResponse, error)

Volume Create

func (*Client) CreateKubernetesCluster

func (client *Client) CreateKubernetesCluster(zoneID, name, versionID, offeringID, sshKey, networkID string, ha bool, size int, description string, privateRegistryUsername, privateRegistryPassword, privateRegistryURL string, haControllerNodes int, haExternalLBIP string) (*responses.KubernetesMessage, error)

func (*Client) CreateL2Network

func (client *Client) CreateL2Network(zoneId, networkOfferingId, name string) (*responses.NetworkCreateResponse, error)

func (*Client) CreateL3Network

func (client *Client) CreateL3Network(zoneId, networkOfferingId, name, gateway, netmask string) (*responses.NetworkCreateResponse, error)

func (*Client) CreateLoadBalancerRule

func (client *Client) CreateLoadBalancerRule(zoneId, networkId, publicIpId, name, algorithm string, publicPort, privatePort int) (*responses.SuccessResponse, error)

func (*Client) CreateObjectStorageBucket

func (client *Client) CreateObjectStorageBucket(zoneId string, name string, policy string) (*responses.ObjectStorageBucketCreationResponse, error)

func (*Client) CreatePortForward added in v1.0.3

func (client *Client) CreatePortForward(zoneId string, request map[string]interface{}) (*responses.PortForwardActionResponse, error)

Create Port Forwarding Rule

func (*Client) CreateRecord

func (client *Client) CreateRecord(domain, record, recordType, content string, ttl, priority, weight, port, flags int, tag string, license, choicer, match int) (*responses.DnsMessage, error)

func (*Client) DeassignLoadBalancerRule

func (client *Client) DeassignLoadBalancerRule(zoneId, networkId, ruleId, instanceNetworkId string) (*responses.SuccessResponse, error)

func (*Client) DeleteDomain

func (client *Client) DeleteDomain(domain string) (*responses.DnsMessage, error)

func (*Client) DeleteIPv4FirewallRule

func (client *Client) DeleteIPv4FirewallRule(zoneId, networkId, ruleId string) (*responses.IPv4FirewallRuleActionResponse, error)

Delete IPv4 Firewall Rule

func (*Client) DeleteIPv6FirewallRule

func (client *Client) DeleteIPv6FirewallRule(zoneId, networkId, ruleId string) (*responses.IPv6FirewallRuleActionResponse, error)

Delete IPv6 Firewall Rule

func (*Client) DeleteInstance

func (client *Client) DeleteInstance(zoneId, instanceId, name string) (*responses.InstanceCreateResponse, error)

func (*Client) DeleteInstanceSnapshot

func (client *Client) DeleteInstanceSnapshot(zoneId, instanceId, snapshotId string) (*responses.InstanceSnapshotActionResponse, error)

Snapshot Delete

func (*Client) DeleteInstanceVolume

func (client *Client) DeleteInstanceVolume(zoneId, volumeId string) (*responses.InstanceVolumeActionResponse, error)

Volume Delete

func (*Client) DeleteKubernetesCluster

func (client *Client) DeleteKubernetesCluster(zoneID string, clusterID string) (*responses.KubernetesMessage, error)

func (*Client) DeleteLoadBalancerRule

func (client *Client) DeleteLoadBalancerRule(zoneId, networkId, ruleId string) (*responses.SuccessResponse, error)

func (*Client) DeleteNetwork

func (client *Client) DeleteNetwork(zoneId, networkId string) (*responses.NetworkDeleteResponse, error)

func (*Client) DeleteObjectStorageBucket

func (client *Client) DeleteObjectStorageBucket(zoneId, bucketId string) error

func (*Client) DeletePortForward added in v1.0.3

func (client *Client) DeletePortForward(zoneId, ruleId string) (*responses.PortForwardActionResponse, error)

Delete Port Forwarding Rule

func (*Client) DeleteRecord

func (client *Client) DeleteRecord(domain, record, recordType, contentId string) (*responses.DnsMessage, error)

func (*Client) DeleteUserSSHKey

func (client *Client) DeleteUserSSHKey(sshKeyId string) (*responses.DeleteUserSSHKeyResponse, error)

DeleteUserSSHKey deletes a user's SSH key by its ID.

func (*Client) DetachInstanceVolume

func (client *Client) DetachInstanceVolume(zoneId, volumeId, instanceId string) (*responses.InstanceVolumeActionResponse, error)

Volume Detach

func (*Client) DisableNetworkPublicIpStaticNat

func (client *Client) DisableNetworkPublicIpStaticNat(zoneId, networkId, networkPublicIpId string) (*responses.NetworkPublicIpActionResponse, error)

Public IP: Disable Static NAT

func (*Client) DisableNetworkVpn

func (client *Client) DisableNetworkVpn(zoneId, networkId string) (*responses.NetworkVpnSuccessResponse, error)

func (*Client) DisassociateNetworkPublicIp

func (client *Client) DisassociateNetworkPublicIp(zoneId, networkId, networkPublicIpId string) (*responses.NetworkPublicIpActionResponse, error)

Public IP: Disassociate

func (*Client) DisconnectInstanceFromNetwork

func (client *Client) DisconnectInstanceFromNetwork(zoneId, networkId, instanceId, instanceNetworkId string) (*responses.InstanceNetworkActionResponse, error)

func (*Client) EnableNetworkPublicIpStaticNat

func (client *Client) EnableNetworkPublicIpStaticNat(zoneId, networkId, networkPublicIpId, instanceId string) (*responses.NetworkPublicIpActionResponse, error)

Public IP: Enable Static NAT

func (*Client) EnableNetworkVpn

func (client *Client) EnableNetworkVpn(zoneId, networkId string) (*responses.NetworkVpnSuccessResponse, error)

func (*Client) GetCostDocumentsYearly

func (client *Client) GetCostDocumentsYearly(year int) (*responses.CostDocumentsYearlyResponse, error)

GetCostDocumentsYearly fetches yearly cost documents. Pass body as JSON: {"year":1402}

func (*Client) GetDNSEvents

func (client *Client) GetDNSEvents() (*responses.DNSEventsResponse, error)

func (*Client) GetDomain

func (client *Client) GetDomain(domain string) (*responses.DomainShow, error)

func (*Client) GetDomains

func (client *Client) GetDomains() (*responses.DomainList, error)

func (*Client) GetHaproxyLive

func (client *Client) GetHaproxyLive(zoneId, networkId string) (*responses.HaproxyLiveResponse, error)

func (*Client) GetHaproxyLog

func (client *Client) GetHaproxyLog(zoneId, networkId string) (*responses.HaproxyLogResponse, error)

func (*Client) GetInstanceConsole added in v1.0.3

func (client *Client) GetInstanceConsole(zoneId, instanceId string) (*responses.InstanceConsoleResponse, error)

Get Instance Console

func (*Client) GetInstanceMetrics

func (client *Client) GetInstanceMetrics(zoneId, instanceId string, metrics []string, time int, aggregator string) (*responses.InstanceMetricsResponse, error)

Instance Metrics

func (*Client) GetKubernetesCluster

func (client *Client) GetKubernetesCluster(zoneID string, clusterID string) (*responses.KubernetesClusterResponse, error)

func (*Client) GetKubernetesClusterEvents

func (client *Client) GetKubernetesClusterEvents(zoneID string, clusterID string) (*responses.KubernetesEventsListResponse, error)

func (*Client) GetKubernetesClusters

func (client *Client) GetKubernetesClusters(zoneID string) (*responses.KubernetesClusterListResponse, error)

func (*Client) GetKubernetesServiceEvents

func (client *Client) GetKubernetesServiceEvents(zoneID string) (*responses.KubernetesEventsListResponse, error)

func (*Client) GetKubernetesServiceOfferings

func (client *Client) GetKubernetesServiceOfferings(zoneID string) (*responses.KubernetesServiceOfferingsListResponse, error)

func (*Client) GetKubernetesVersions

func (client *Client) GetKubernetesVersions(zoneID string) (*responses.KubernetesVersionsListResponse, error)

func (*Client) GetL2NetworkServiceOfferings added in v1.0.1

func (client *Client) GetL2NetworkServiceOfferings(zoneId string) (*responses.NetworkServiceOfferingListResponse, error)

func (*Client) GetL3NetworkServiceOfferings added in v1.0.1

func (client *Client) GetL3NetworkServiceOfferings(zoneId string) (*responses.NetworkServiceOfferingListResponse, error)

func (*Client) GetNetworkVpnDetails

func (client *Client) GetNetworkVpnDetails(zoneId, networkId string) (*responses.NetworkVpnDetailResponse, error)

func (*Client) GetObjectStorageBucket

func (client *Client) GetObjectStorageBucket(zoneId string, bucketId string) (*responses.ObjectStorageBucketResponse, error)

func (*Client) GetObjectStorageBucketEvents

func (client *Client) GetObjectStorageBucketEvents(zoneId string, bucketId string) (*responses.ObjectStorageEventsResponse, error)

func (*Client) GetObjectStorageBuckets

func (client *Client) GetObjectStorageBuckets(zoneId string) (*responses.ObjectStorageBucketsResponse, error)

func (*Client) GetObjectStorageEvents

func (client *Client) GetObjectStorageEvents(zoneId string) (*responses.ObjectStorageEventsResponse, error)

func (*Client) GetPaymentList

func (client *Client) GetPaymentList() (*responses.PaymentListResponse, error)

GetPaymentList fetches the user's payment list.

func (*Client) GetRecords

func (client *Client) GetRecords(domain string) (*responses.RecordList, error)

func (*Client) GetTokenAbilities

func (client *Client) GetTokenAbilities() (*responses.UserTokenAbilitiesResponse, error)

func (*Client) GetUserProfile added in v1.0.3

func (client *Client) GetUserProfile() (*responses.UserProfileResponse, error)

GetUserProfile fetches the user's profile information.

func (*Client) GetUserTokenAbilities

func (client *Client) GetUserTokenAbilities() (*responses.UserTokenAbilitiesResponse, error)

GetUserTokenAbilities fetches the abilities associated with the user's token.

func (*Client) GetWallet added in v1.0.3

func (client *Client) GetWallet() (*responses.WalletsBalanceResponse, error)

GetWallet fetches the user's wallet balance.

func (*Client) GetWalletsBalance

func (client *Client) GetWalletsBalance() (*responses.WalletsBalanceResponse, error)

GetWalletsBalance fetches the user's wallet balance.

func (*Client) GetZoneActiveServices

func (client *Client) GetZoneActiveServices(zoneID string) (*responses.ZoneActiveServicesResponse, error)

GetZoneActiveServices fetches the active services for a specific zone.

func (*Client) GetZoneCustomerResource

func (client *Client) GetZoneCustomerResource(zoneID string) (*responses.CustomerResourceResponse, error)

GetZoneCustomerResource fetches the customer resource for a specific zone.

func (*Client) GetZoneList

func (client *Client) GetZoneList() (*responses.DataCenter, error)

GetZoneList fetches the list of zones and returns a ZoneListResponse struct.

func (*Client) GetZoneNetworks

func (client *Client) GetZoneNetworks(zoneID string) (*responses.ZoneNetworksResponse, error)

GetZoneNetworks fetches the networks for a specific zone.

func (*Client) ListDocuments added in v1.0.3

func (client *Client) ListDocuments(year int) (*responses.CostDocumentsYearlyResponse, error)

ListDocuments fetches cost documents for a specific year.

func (*Client) ListDocumentsGET added in v1.0.3

func (client *Client) ListDocumentsGET(year int) (*responses.CostDocumentsYearlyResponse, error)

ListDocumentsGET fetches cost documents for a specific year using GET method.

func (*Client) ListExpenses added in v1.0.3

func (client *Client) ListExpenses(filters map[string]string) (*responses.ExpensesListResponse, error)

ListExpenses fetches the user's expenses with optional filtering.

func (*Client) ListExpensesWithRequiredParams added in v1.0.3

func (client *Client) ListExpensesWithRequiredParams(productType, productID string, filters map[string]string) (*responses.ExpensesListResponse, error)

ListExpensesWithRequiredParams fetches the user's expenses with required parameters.

func (*Client) ListIPv4FirewallRules

func (client *Client) ListIPv4FirewallRules(zoneId, networkId string) (*responses.IPv4FirewallRuleListResponse, error)

List IPv4 Firewall Rules

func (*Client) ListIPv6FirewallRules

func (client *Client) ListIPv6FirewallRules(zoneId, networkId string) (*responses.IPv6FirewallRuleListResponse, error)

List IPv6 Firewall Rules

func (*Client) ListInstanceServiceOfferings

func (client *Client) ListInstanceServiceOfferings(zoneId string) (*responses.InstanceServiceOfferingListResponse, error)

func (*Client) ListInstanceVMImages

func (client *Client) ListInstanceVMImages(zoneId string) (*responses.InstanceVMImageListResponse, error)

func (*Client) ListInstanceVolumeServiceOfferings

func (client *Client) ListInstanceVolumeServiceOfferings(zoneId string) (*responses.InstanceVolumeServiceOfferingListResponse, error)

Volume Service Offering List

func (*Client) ListInstanceVolumes

func (client *Client) ListInstanceVolumes(zoneId string) (*responses.InstanceVolumeListResponse, error)

Volume List

func (*Client) ListInstances

func (client *Client) ListInstances(zoneId string) (*responses.InstanceListResponse, error)

func (*Client) ListLoadBalancerRules

func (client *Client) ListLoadBalancerRules(zoneId, networkId string) (*responses.LoadBalancerRuleListResponse, error)

func (*Client) ListNetworkInstances

func (client *Client) ListNetworkInstances(zoneId, networkId string, instanceId string) (*responses.InstanceNetworkListResponse, error)

func (*Client) ListNetworkPublicIps

func (client *Client) ListNetworkPublicIps(zoneId, networkId string) (*responses.NetworkPublicIpListResponse, error)

Public IP: List

func (*Client) ListNetworkServiceOfferings

func (client *Client) ListNetworkServiceOfferings(zoneId string) (*responses.NetworkServiceOfferingListResponse, error)

func (*Client) ListNetworks

func (client *Client) ListNetworks(zoneId string) (*responses.NetworkListResponse, error)

func (*Client) ListPayments added in v1.0.3

func (client *Client) ListPayments() (*responses.PaymentListResponse, error)

ListPayments fetches the user's payment history.

func (*Client) ListPortForwards added in v1.0.3

func (client *Client) ListPortForwards(zoneId, networkId string) (*responses.PortForwardListResponse, error)

List Port Forwarding Rules

func (*Client) ListUserSSHKeys

func (client *Client) ListUserSSHKeys() (*responses.UserSSHKeyListResponse, error)

ListUserSSHKeys fetches the list of user's SSH keys.

func (*Client) RebootInstance

func (client *Client) RebootInstance(zoneId, instanceId string) (*responses.InstanceCreateResponse, error)

func (*Client) RebuildInstance

func (client *Client) RebuildInstance(zoneId, instanceId, vmImageId string) (*responses.InstanceCreateResponse, error)

func (*Client) Request

func (client *Client) Request(method, url string, body []byte) ([]byte, error)

func (*Client) RevertInstanceSnapshot

func (client *Client) RevertInstanceSnapshot(zoneId, instanceId, snapshotId string) (*responses.InstanceSnapshotActionResponse, error)

Snapshot Revert

func (*Client) ScaleKubernetesCluster

func (client *Client) ScaleKubernetesCluster(zoneID string, clusterID string, autoScaling bool, clusterSize int, minClusterSize int, maxClusterSize int) (*responses.KubernetesClusterResponse, error)

func (*Client) ShowInstance

func (client *Client) ShowInstance(zoneId, instanceId string) (*responses.InstanceShowResponse, error)

Show Instance

func (*Client) ShowNetwork

func (client *Client) ShowNetwork(zoneId, networkId string) (*responses.NetworkShowResponse, error)

func (*Client) StartInstance

func (client *Client) StartInstance(zoneId, instanceId string) (*responses.InstanceCreateResponse, error)

func (*Client) StartKubernetesCluster

func (client *Client) StartKubernetesCluster(zoneID string, clusterID string) (*responses.KubernetesClusterResponse, error)

func (*Client) StopInstance

func (client *Client) StopInstance(zoneId, instanceId string, forced bool) (*responses.InstanceCreateResponse, error)

func (*Client) StopKubernetesCluster

func (client *Client) StopKubernetesCluster(zoneID string, clusterID string) (*responses.KubernetesClusterResponse, error)

func (*Client) UpdateKubernetesClusterDetails

func (client *Client) UpdateKubernetesClusterDetails(zoneID string, clusterID string, name string, description string) (*responses.KubernetesClusterResponse, error)

func (*Client) UpdateNetworkVpnCredentials

func (client *Client) UpdateNetworkVpnCredentials(zoneId, networkId string) (*responses.NetworkVpnSuccessResponse, error)

func (*Client) UpdateObjectStorageBucket

func (client *Client) UpdateObjectStorageBucket(zoneId string, bucketId string, policy string) (*responses.ObjectStorageBucketResponse, error)

func (*Client) UpdateRecord

func (client *Client) UpdateRecord(domain, record, recordType, contentId, newContent string, newTTL, priority, weight, port, flags int, tag string, license, choicer, match int) (*responses.DnsMessage, error)

func (*Client) ValidateUserToken

func (client *Client) ValidateUserToken() error

ValidateUserToken checks if the user's token is valid (204 No Content on success).

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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