datapacket

package module
v0.1.1-0...-7026e82 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2026 License: MIT Imports: 9 Imported by: 0

README

Unofficial DataPacket Go SDK

Go Reference

Go client for the DataPacket API.

Installation

go get github.com/sliplane/datapacket-go

Usage

client := datapacket.New("your-api-key")
ctx := context.Background()

// Get account info
account, err := client.Account(ctx)

// List all servers
for server, err := range client.ServerIterator(ctx, nil) {
    fmt.Printf("%s (%s)\n", server.Name, server.Location.Name)
}

// Error handling
server, err := client.Server(ctx, datapacket.ServerInput{Name: ptr("DP-99999")})
if apiErr, ok := err.(datapacket.APIError); ok && apiErr.IsNotFound() {
    // handle not found
}

License

MIT

Documentation

Index

Constants

View Source
const (
	DefaultEndpoint = "https://api.datapacket.com/v0/graphql"
	DefaultTimeout  = 30 * time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type APIError

type APIError struct {
	Errors []GraphQLError `json:"errors"`
}

func (APIError) Error

func (e APIError) Error() string

func (APIError) HasCode

func (e APIError) HasCode(code ErrorCode) bool

func (APIError) IsInsufficientCredit

func (e APIError) IsInsufficientCredit() bool

func (APIError) IsNotAuthorized

func (e APIError) IsNotAuthorized() bool

func (APIError) IsNotFound

func (e APIError) IsNotFound() bool

func (APIError) IsOutOfStock

func (e APIError) IsOutOfStock() bool

func (APIError) IsQuotaExceeded

func (e APIError) IsQuotaExceeded() bool

func (APIError) IsValidationFailed

func (e APIError) IsValidationFailed() bool

type Account

type Account struct {
	Name      *string   `json:"name"`
	Email     string    `json:"email"`
	Hostname  *string   `json:"hostname"`
	CreatedAt time.Time `json:"createdAt"`
}

type AggregatedTraffic

type AggregatedTraffic struct {
	StatisticsIn  *TrafficStatistics `json:"statisticsIn,omitempty"`
	StatisticsOut *TrafficStatistics `json:"statisticsOut,omitempty"`
}

type Billing

type Billing struct {
	SubscriptionItem SubscriptionItem `json:"subscriptionItem"`
}

type BillingCycle

type BillingCycle struct {
	Unit     BillingIntervalUnit `json:"unit"`
	Quantity int                 `json:"quantity"`
	Start    int                 `json:"start"`
}

type BillingIntervalUnit

type BillingIntervalUnit string
const (
	BillingIntervalUnitMonth BillingIntervalUnit = "MONTH"
	BillingIntervalUnitYear  BillingIntervalUnit = "YEAR"
	BillingIntervalUnitDay   BillingIntervalUnit = "DAY"
)

type BootDevice

type BootDevice string
const (
	BootDeviceDisk       BootDevice = "DISK"
	BootDevicePXE        BootDevice = "PXE"
	BootDeviceSafeMode   BootDevice = "SAFE_MODE"
	BootDeviceDiagnostic BootDevice = "DIAGNOSTIC"
	BootDeviceBIOS       BootDevice = "BIOS"
)

type ChangeIpmiPasswordInput

type ChangeIpmiPasswordInput struct {
	Server   ServerInput `json:"server"`
	Password string      `json:"password"`
}

type ChangeServerIpmiPasswordResponse

type ChangeServerIpmiPasswordResponse struct {
	Server Server `json:"server"`
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(apiKey string, opts ...Option) *Client

func (*Client) Account

func (c *Client) Account(ctx context.Context) (*Account, error)

func (*Client) AllInvoices

func (c *Client) AllInvoices(ctx context.Context, filter *InvoicesInput) ([]Invoice, error)

func (*Client) AllPostInstallScripts

func (c *Client) AllPostInstallScripts(ctx context.Context, filter *PostInstallScriptsInput) ([]PostInstallScript, error)

func (*Client) AllServers

func (c *Client) AllServers(ctx context.Context, filter *ServersInput) ([]Server, error)

func (*Client) AllSubscriptions

func (c *Client) AllSubscriptions(ctx context.Context, filter *SubscriptionsInput) ([]Subscription, error)

func (*Client) ChangeServerIpmiPassword

func (c *Client) ChangeServerIpmiPassword(ctx context.Context, input ChangeIpmiPasswordInput) (*Server, error)
func (c *Client) ConfigureServerLinks(ctx context.Context, input ConfigureServerLinksInput) (*ServerLinksConfigurationTask, error)

func (*Client) CreatePostInstallScript

func (c *Client) CreatePostInstallScript(ctx context.Context, input CreatePostInstallScriptInput) (*PostInstallScript, error)

func (*Client) CreateSupportRequest

func (c *Client) CreateSupportRequest(ctx context.Context, input CreateSupportRequestInput) (bool, error)

func (*Client) DeletePostInstallScript

func (c *Client) DeletePostInstallScript(ctx context.Context, input DeletePostInstallScriptInput) (bool, error)

func (*Client) ErrorCodes

func (c *Client) ErrorCodes(ctx context.Context) ([]ErrorCode, error)

func (*Client) Invoice

func (c *Client) Invoice(ctx context.Context, input InvoiceInput) (*Invoice, error)

func (*Client) InvoiceIterator

func (c *Client) InvoiceIterator(ctx context.Context, filter *InvoicesInput) iter.Seq2[Invoice, error]

func (*Client) Invoices

func (*Client) Locations

func (c *Client) Locations(ctx context.Context) ([]Location, error)

func (*Client) OperatingSystems

func (c *Client) OperatingSystems(ctx context.Context) ([]OperatingSystem, error)

func (*Client) PerformServerPowerAction

func (c *Client) PerformServerPowerAction(ctx context.Context, input PerformServerPowerActionInput) (*Server, error)

func (*Client) PostInstallScriptIterator

func (c *Client) PostInstallScriptIterator(ctx context.Context, filter *PostInstallScriptsInput) iter.Seq2[PostInstallScript, error]

func (*Client) ProvisionServer

func (c *Client) ProvisionServer(ctx context.Context, input ProvisionServerInput) (*Server, error)

func (*Client) ProvisioningConfigurations

func (c *Client) ProvisioningConfigurations(ctx context.Context, input *ProvisioningConfigurationsInput) ([]ProvisioningConfiguration, error)

func (*Client) ReverseDnsRecord

func (c *Client) ReverseDnsRecord(ctx context.Context, input ReverseDnsRecordInput) (*ReverseDnsRecordResponse, error)

func (*Client) Server

func (c *Client) Server(ctx context.Context, input ServerInput) (*Server, error)

func (*Client) ServerIterator

func (c *Client) ServerIterator(ctx context.Context, filter *ServersInput) iter.Seq2[Server, error]

func (*Client) ServerLinksConfigurationTask

func (c *Client) ServerLinksConfigurationTask(ctx context.Context, input ServerLinksConfigurationTaskInput) (*ServerLinksConfigurationTask, error)

func (*Client) Servers

func (*Client) SetDefaultTrafficPlan

func (c *Client) SetDefaultTrafficPlan(ctx context.Context, input SetDefaultTrafficPlanInput) (bool, error)

func (*Client) SetReverseDnsRecord

func (c *Client) SetReverseDnsRecord(ctx context.Context, input SetReverseDnsRecordInput) (*IpAddress, error)

func (*Client) SetServerAlias

func (c *Client) SetServerAlias(ctx context.Context, input SetServerAliasInput) (*Server, error)

func (*Client) SetServerBootDevice

func (c *Client) SetServerBootDevice(ctx context.Context, input SetServerBootDeviceInput) (*Server, error)

func (*Client) SetServerPrimaryIp

func (c *Client) SetServerPrimaryIp(ctx context.Context, input SetServerPrimaryIpInput) (*Server, error)

func (*Client) SetServerTag

func (c *Client) SetServerTag(ctx context.Context, input SetServerTagInput) (bool, error)

func (*Client) SetServerTags

func (c *Client) SetServerTags(ctx context.Context, input SetServerTagsInput) (bool, error)

func (*Client) Subscription

func (c *Client) Subscription(ctx context.Context, input SubscriptionInput) (*Subscription, error)

func (*Client) SubscriptionIterator

func (c *Client) SubscriptionIterator(ctx context.Context, filter *SubscriptionsInput) iter.Seq2[Subscription, error]

func (*Client) Subscriptions

func (*Client) SupportRequest

func (c *Client) SupportRequest(ctx context.Context, input SupportRequestInput) (*SupportRequest, error)

func (*Client) SupportRequestReply

func (c *Client) SupportRequestReply(ctx context.Context, input SupportRequestReplyInput) (bool, error)

func (*Client) SupportRequests

func (c *Client) SupportRequests(ctx context.Context, input *PaginatedSupportRequestsInput) ([]SupportRequest, error)

func (*Client) Traffic

func (c *Client) Traffic(ctx context.Context, input TrafficInput) (*Traffic, error)

func (*Client) UpdatePostInstallScript

func (c *Client) UpdatePostInstallScript(ctx context.Context, input UpdatePostInstallScriptInput) (*PostInstallScript, error)

type ConfigureServerLinksInput

type ConfigureServerLinksInput struct {
	Server          ServerInput `json:"server"`
	LinkAggregation bool        `json:"linkAggregation"`
}

type Cpu

type Cpu struct {
	Name    string `json:"name"`
	Cores   int    `json:"cores"`
	Threads int    `json:"threads"`
}

type CreatePostInstallScriptInput

type CreatePostInstallScriptInput struct {
	Name           string `json:"name"`
	Content        string `json:"content"`
	IsAutoSelected *bool  `json:"isAutoSelected,omitempty"`
}

type CreateSupportRequestInput

type CreateSupportRequestInput struct {
	Message      string                 `json:"message"`
	Subject      SupportRequestSubject  `json:"subject"`
	Priority     SupportRequestPriority `json:"priority"`
	Servers      []string               `json:"servers,omitempty"`
	Sources      []string               `json:"sources,omitempty"`
	Destinations []string               `json:"destinations,omitempty"`
}

type Currency

type Currency string
const (
	CurrencyUSD Currency = "USD"
	CurrencyGBP Currency = "GBP"
	CurrencyEUR Currency = "EUR"
)

type DateTime

type DateTime time.Time

type DdosShieldLevel

type DdosShieldLevel string
const (
	DdosShieldLevelVolumetric DdosShieldLevel = "VOLUMETRIC"
	DdosShieldLevelFull       DdosShieldLevel = "FULL"
	DdosShieldLevelOff        DdosShieldLevel = "OFF"
)

type Decimal

type Decimal string

type DecimalRange

type DecimalRange struct {
	Min *Decimal `json:"min,omitempty"`
	Max *Decimal `json:"max,omitempty"`
}

type DefaultTrafficPlanType

type DefaultTrafficPlanType string
const (
	DefaultTrafficPlanTypeP95           DefaultTrafficPlanType = "P95"
	DefaultTrafficPlanTypePeakUnmetered DefaultTrafficPlanType = "PEAK_UNMETERED"
)

type DeletePostInstallScriptInput

type DeletePostInstallScriptInput struct {
	ID string `json:"id"`
}

type ErrorCode

type ErrorCode string
const (
	ErrorCodeBadRequest                     ErrorCode = "BAD_REQUEST"
	ErrorCodeGraphQLValidationFailed        ErrorCode = "GRAPHQL_VALIDATION_FAILED"
	ErrorCodeNotAuthorized                  ErrorCode = "NOT_AUTHORIZED"
	ErrorCodeValidationFailed               ErrorCode = "VALIDATION_FAILED"
	ErrorCodeNotFound                       ErrorCode = "NOT_FOUND"
	ErrorCodeInternalServerError            ErrorCode = "INTERNAL_SERVER_ERROR"
	ErrorCodeReverseDNSAPINotAvailable      ErrorCode = "REVERSE_DNS_API_NOT_AVAILABLE"
	ErrorCodeInsufficientCreditBalance      ErrorCode = "INSUFFICIENT_CREDIT_BALANCE"
	ErrorCodeOutOfStock                     ErrorCode = "OUT_OF_STOCK"
	ErrorCodeDailyProvisioningQuotaExceeded ErrorCode = "DAILY_PROVISIONING_QUOTA_EXCEEDED"
)

type Gpu

type Gpu struct {
	Name   string `json:"name"`
	Memory int    `json:"memory"`
}

type GraphQLError

type GraphQLError struct {
	Message    string         `json:"message"`
	Path       []any          `json:"path,omitempty"`
	Extensions map[string]any `json:"extensions,omitempty"`
}

func (GraphQLError) Code

func (e GraphQLError) Code() ErrorCode

func (GraphQLError) Error

func (e GraphQLError) Error() string

type Hardware

type Hardware struct {
	Cpus    []Cpu     `json:"cpus"`
	Storage []Storage `json:"storage"`
	Rams    []Ram     `json:"rams"`
}

type IntRange

type IntRange struct {
	Min *int `json:"min,omitempty"`
	Max *int `json:"max,omitempty"`
}

type Invoice

type Invoice struct {
	InvoiceNumber string        `json:"invoiceNumber"`
	Subscription  *Subscription `json:"subscription,omitempty"`
	Period        Period        `json:"period"`
	Payment       *Payment      `json:"payment,omitempty"`
	InvoiceItems  []InvoiceItem `json:"invoiceItems"`
	Subtotal      float64       `json:"subtotal"`
	Total         float64       `json:"total"`
	TotalVat      float64       `json:"totalVat"`
	Currency      Currency      `json:"currency"`
	CreatedAt     time.Time     `json:"createdAt"`
	DueDate       time.Time     `json:"dueDate"`
	InvoiceType   *InvoiceType  `json:"invoiceType,omitempty"`
}

type InvoiceInput

type InvoiceInput struct {
	InvoiceNumber string `json:"invoiceNumber"`
}

type InvoiceItem

type InvoiceItem struct {
	Description string           `json:"description"`
	Quantity    float64          `json:"quantity"`
	UnitPrice   float64          `json:"unitPrice"`
	Amount      float64          `json:"amount"`
	VatPercent  float64          `json:"vatPercent"`
	Currency    Currency         `json:"currency"`
	Type        *InvoiceItemType `json:"type,omitempty"`
}

type InvoiceItemType

type InvoiceItemType string
const (
	InvoiceItemTypeServer         InvoiceItemType = "SERVER"
	InvoiceItemTypeIP             InvoiceItemType = "IP"
	InvoiceItemTypeFee            InvoiceItemType = "FEE"
	InvoiceItemTypeDiscount       InvoiceItemType = "DISCOUNT"
	InvoiceItemTypeDDoS           InvoiceItemType = "DDOS"
	InvoiceItemTypeBGP            InvoiceItemType = "BGP"
	InvoiceItemTypeCredit         InvoiceItemType = "CREDIT"
	InvoiceItemTypeTraffic        InvoiceItemType = "TRAFFIC"
	InvoiceItemTypeTrafficOverage InvoiceItemType = "TRAFFIC_OVERAGE"
	InvoiceItemTypeOther          InvoiceItemType = "OTHER"
)

type InvoiceType

type InvoiceType string
const (
	InvoiceTypeDraft InvoiceType = "DRAFT"
	InvoiceTypeTax   InvoiceType = "TAX"
)

type InvoicesInput

type InvoicesInput struct {
	InvoiceNumberIn []string        `json:"invoiceNumber_in,omitempty"`
	CurrencyIn      []Currency      `json:"currency_in,omitempty"`
	PaymentStatusIn []PaymentStatus `json:"paymentStatus_in,omitempty"`
}

type IpAddress

type IpAddress struct {
	IsPrimary   bool          `json:"isPrimary"`
	IsBgpPrefix bool          `json:"isBgpPrefix"`
	Type        IpAddressType `json:"type"`
	NetMask     *string       `json:"netMask,omitempty"`
	Gateway     *string       `json:"gateway,omitempty"`
	Network     *string       `json:"network,omitempty"`
	Broadcast   *string       `json:"broadcast,omitempty"`
	IP          string        `json:"ip"`
	CIDR        string        `json:"cidr"`
}

type IpAddressType

type IpAddressType string
const (
	IpAddressTypeIPv4 IpAddressType = "IPV4"
	IpAddressTypeIPv6 IpAddressType = "IPV6"
)

type Ipmi

type Ipmi struct {
	IP       *string `json:"ip,omitempty"`
	Username *string `json:"username,omitempty"`
}

type Location

type Location struct {
	Name       string             `json:"name"`
	Region     Region             `json:"region"`
	Short      string             `json:"short"`
	Identifier LocationIdentifier `json:"identifier"`
}

type LocationIdentifier

type LocationIdentifier string
const (
	LocationAmsterdam    LocationIdentifier = "AMSTERDAM"
	LocationAshburn      LocationIdentifier = "ASHBURN"
	LocationAthens       LocationIdentifier = "ATHENS"
	LocationAtlanta      LocationIdentifier = "ATLANTA"
	LocationAuckland     LocationIdentifier = "AUCKLAND"
	LocationBerlin       LocationIdentifier = "BERLIN"
	LocationBogota       LocationIdentifier = "BOGOTA"
	LocationBordeaux     LocationIdentifier = "BORDEAUX"
	LocationBoston       LocationIdentifier = "BOSTON"
	LocationBratislava   LocationIdentifier = "BRATISLAVA"
	LocationBrussels     LocationIdentifier = "BRUSSELS"
	LocationBucharest    LocationIdentifier = "BUCHAREST"
	LocationBudapest     LocationIdentifier = "BUDAPEST"
	LocationBuenosAires  LocationIdentifier = "BUENOS_AIRES"
	LocationChicago      LocationIdentifier = "CHICAGO"
	LocationCopenhagen   LocationIdentifier = "COPENHAGEN"
	LocationDallas       LocationIdentifier = "DALLAS"
	LocationDenver       LocationIdentifier = "DENVER"
	LocationDublin       LocationIdentifier = "DUBLIN"
	LocationFrankfurt    LocationIdentifier = "FRANKFURT"
	LocationFujairah     LocationIdentifier = "FUJAIRAH"
	LocationHongKong     LocationIdentifier = "HONG_KONG"
	LocationHouston      LocationIdentifier = "HOUSTON"
	LocationIstanbul     LocationIdentifier = "ISTANBUL"
	LocationJohannesburg LocationIdentifier = "JOHANNESBURG"
	LocationKualaLumpur  LocationIdentifier = "KUALA_LUMPUR"
	LocationKyiv         LocationIdentifier = "KYIV"
	LocationLagos        LocationIdentifier = "LAGOS"
	LocationLima         LocationIdentifier = "LIMA"
	LocationLisbon       LocationIdentifier = "LISBON"
	LocationLondon       LocationIdentifier = "LONDON"
	LocationLosAngeles   LocationIdentifier = "LOS_ANGELES"
	LocationMadrid       LocationIdentifier = "MADRID"
	LocationManchester   LocationIdentifier = "MANCHESTER"
	LocationMarseille    LocationIdentifier = "MARSEILLE"
	LocationMcAllen      LocationIdentifier = "MCALLEN"
	LocationMelbourne    LocationIdentifier = "MELBOURNE"
	LocationMiami        LocationIdentifier = "MIAMI"
	LocationMilan        LocationIdentifier = "MILAN"
	LocationMontreal     LocationIdentifier = "MONTREAL"
	LocationNewYork      LocationIdentifier = "NEW_YORK"
	LocationOslo         LocationIdentifier = "OSLO"
	LocationPalermo      LocationIdentifier = "PALERMO"
	LocationParis        LocationIdentifier = "PARIS"
	LocationPrague       LocationIdentifier = "PRAGUE"
	LocationQueretaro    LocationIdentifier = "QUERETARO"
	LocationSanJose      LocationIdentifier = "SAN_JOSE"
	LocationSantiago     LocationIdentifier = "SANTIAGO"
	LocationSaoPaulo     LocationIdentifier = "SAO_PAULO"
	LocationSeattle      LocationIdentifier = "SEATTLE"
	LocationSeoul        LocationIdentifier = "SEOUL"
	LocationSingapore    LocationIdentifier = "SINGAPORE"
	LocationSofia        LocationIdentifier = "SOFIA"
	LocationStockholm    LocationIdentifier = "STOCKHOLM"
	LocationSydney       LocationIdentifier = "SYDNEY"
	LocationTelAviv      LocationIdentifier = "TEL_AVIV"
	LocationTokyo        LocationIdentifier = "TOKYO"
	LocationToronto      LocationIdentifier = "TORONTO"
	LocationVancouver    LocationIdentifier = "VANCOUVER"
	LocationVienna       LocationIdentifier = "VIENNA"
	LocationWarsaw       LocationIdentifier = "WARSAW"
	LocationZagreb       LocationIdentifier = "ZAGREB"
	LocationZurich       LocationIdentifier = "ZURICH"
)

type Money

type Money struct {
	Amount   Decimal  `json:"amount"`
	Currency Currency `json:"currency"`
}

type Network

type Network struct {
	IpAddresses        []IpAddress     `json:"ipAddresses"`
	DdosShieldLevel    DdosShieldLevel `json:"ddosShieldLevel"`
	Ipmi               Ipmi            `json:"ipmi"`
	HasBgp             *bool           `json:"hasBgp,omitempty"`
	UplinkCapacity     int             `json:"uplinkCapacity"`
	HasLinkAggregation bool            `json:"hasLinkAggregation"`
}

type OperatingSystem

type OperatingSystem struct {
	OsImageID string `json:"osImageId"`
	Name      string `json:"name"`
}

type Option

type Option func(*Client)

func WithEndpoint

func WithEndpoint(endpoint string) Option

func WithHTTPClient

func WithHTTPClient(httpClient *http.Client) Option

func WithTimeout

func WithTimeout(timeout time.Duration) Option

type PaginatedInvoiceResponse

type PaginatedInvoiceResponse struct {
	EntriesTotalCount int       `json:"entriesTotalCount"`
	PageCount         int       `json:"pageCount"`
	CurrentPageIndex  int       `json:"currentPageIndex"`
	PageSize          int       `json:"pageSize"`
	NextPageIndex     *int      `json:"nextPageIndex,omitempty"`
	PreviousPageIndex *int      `json:"previousPageIndex,omitempty"`
	IsLastPage        bool      `json:"isLastPage"`
	IsFirstPage       bool      `json:"isFirstPage"`
	Entries           []Invoice `json:"entries"`
}

type PaginatedInvoicesInput

type PaginatedInvoicesInput struct {
	PageIndex int            `json:"pageIndex,omitempty"`
	PageSize  int            `json:"pageSize,omitempty"`
	Filter    *InvoicesInput `json:"filter,omitempty"`
}

type PaginatedPostInstallScriptResponse

type PaginatedPostInstallScriptResponse struct {
	EntriesTotalCount int                 `json:"entriesTotalCount"`
	PageCount         int                 `json:"pageCount"`
	CurrentPageIndex  int                 `json:"currentPageIndex"`
	PageSize          int                 `json:"pageSize"`
	NextPageIndex     *int                `json:"nextPageIndex,omitempty"`
	PreviousPageIndex *int                `json:"previousPageIndex,omitempty"`
	IsLastPage        bool                `json:"isLastPage"`
	IsFirstPage       bool                `json:"isFirstPage"`
	Entries           []PostInstallScript `json:"entries"`
}

type PaginatedPostInstallScriptsInput

type PaginatedPostInstallScriptsInput struct {
	PageIndex int                      `json:"pageIndex,omitempty"`
	PageSize  int                      `json:"pageSize,omitempty"`
	Filter    *PostInstallScriptsInput `json:"filter,omitempty"`
}

type PaginatedServerResponse

type PaginatedServerResponse struct {
	EntriesTotalCount int      `json:"entriesTotalCount"`
	PageCount         int      `json:"pageCount"`
	CurrentPageIndex  int      `json:"currentPageIndex"`
	PageSize          int      `json:"pageSize"`
	NextPageIndex     *int     `json:"nextPageIndex,omitempty"`
	PreviousPageIndex *int     `json:"previousPageIndex,omitempty"`
	IsLastPage        bool     `json:"isLastPage"`
	IsFirstPage       bool     `json:"isFirstPage"`
	Entries           []Server `json:"entries"`
}

type PaginatedServersInput

type PaginatedServersInput struct {
	PageIndex int           `json:"pageIndex,omitempty"`
	PageSize  int           `json:"pageSize,omitempty"`
	Filter    *ServersInput `json:"filter,omitempty"`
}

type PaginatedSubscriptionResponse

type PaginatedSubscriptionResponse struct {
	EntriesTotalCount int            `json:"entriesTotalCount"`
	PageCount         int            `json:"pageCount"`
	CurrentPageIndex  int            `json:"currentPageIndex"`
	PageSize          int            `json:"pageSize"`
	NextPageIndex     *int           `json:"nextPageIndex,omitempty"`
	PreviousPageIndex *int           `json:"previousPageIndex,omitempty"`
	IsLastPage        bool           `json:"isLastPage"`
	IsFirstPage       bool           `json:"isFirstPage"`
	Entries           []Subscription `json:"entries"`
}

type PaginatedSubscriptionsInput

type PaginatedSubscriptionsInput struct {
	PageIndex int                 `json:"pageIndex,omitempty"`
	PageSize  int                 `json:"pageSize,omitempty"`
	Filter    *SubscriptionsInput `json:"filter,omitempty"`
}

type PaginatedSupportRequestsInput

type PaginatedSupportRequestsInput struct {
	PageIndex int                   `json:"pageIndex,omitempty"`
	PageSize  int                   `json:"pageSize,omitempty"`
	Filter    *SupportRequestsInput `json:"filter,omitempty"`
}

type Payment

type Payment struct {
	Status PaymentStatus  `json:"status"`
	PaidOn *time.Time     `json:"paidOn,omitempty"`
	Method *PaymentMethod `json:"method,omitempty"`
}

type PaymentMethod

type PaymentMethod string
const (
	PaymentMethodBankTransfer PaymentMethod = "BANK_TRANSFER"
	PaymentMethodCard         PaymentMethod = "CARD"
	PaymentMethodDPBalance    PaymentMethod = "DP_BALANCE"
	PaymentMethodPayPal       PaymentMethod = "PAYPAL"
	PaymentMethodCreditNote   PaymentMethod = "CREDIT_NOTE"
)

type PaymentStatus

type PaymentStatus string
const (
	PaymentStatusPaid    PaymentStatus = "PAID"
	PaymentStatusNotPaid PaymentStatus = "NOT_PAID"
	PaymentStatusPastDue PaymentStatus = "PAST_DUE"
)

type PerServerTraffic

type PerServerTraffic struct {
	Server  Server            `json:"server"`
	Traffic AggregatedTraffic `json:"traffic"`
}

type PerformServerPowerActionInput

type PerformServerPowerActionInput struct {
	Action PowerAction `json:"action"`
	Server ServerInput `json:"server"`
}

type PerformServerPowerActionResponse

type PerformServerPowerActionResponse struct {
	Server Server `json:"server"`
}

type Period

type Period struct {
	From time.Time `json:"from"`
	To   time.Time `json:"to"`
}

type Port

type Port struct {
	Capacity float64 `json:"capacity"`
}

type Post

type Post struct {
	ID        int                  `json:"id"`
	Contents  string               `json:"contents"`
	CreatedAt time.Time            `json:"createdAt"`
	Email     string               `json:"email"`
	FullName  string               `json:"fullName"`
	PostBy    SupportRequestPostBy `json:"postBy"`
}

type PostInstallScript

type PostInstallScript struct {
	ID             string    `json:"id"`
	Name           string    `json:"name"`
	CreatedAt      time.Time `json:"createdAt"`
	UpdatedAt      time.Time `json:"updatedAt"`
	Content        string    `json:"content"`
	IsAutoSelected bool      `json:"isAutoSelected"`
}

type PostInstallScriptsInput

type PostInstallScriptsInput struct {
	NameIn []string `json:"name_in,omitempty"`
}

type PowerAction

type PowerAction string
const (
	PowerActionOn    PowerAction = "ON"
	PowerActionOff   PowerAction = "OFF"
	PowerActionReset PowerAction = "RESET"
	PowerActionSoft  PowerAction = "SOFT"
	PowerActionCycle PowerAction = "CYCLE"
)

type PowerStatus

type PowerStatus string
const (
	PowerStatusOn      PowerStatus = "ON"
	PowerStatusOff     PowerStatus = "OFF"
	PowerStatusUnknown PowerStatus = "UNKNOWN"
)

type ProvisionServerInput

type ProvisionServerInput struct {
	ConfigurationID        string                    `json:"configurationId"`
	BillingPeriod          ProvisioningBillingPeriod `json:"billingPeriod"`
	OsImageID              string                    `json:"osImageId"`
	SSHKeyNames            []string                  `json:"sshKeyNames,omitempty"`
	DisableLinkAggregation *bool                     `json:"disableLinkAggregation,omitempty"`
	PostInstallScriptName  *string                   `json:"postInstallScriptName,omitempty"`
}

type ProvisionServerResponse

type ProvisionServerResponse struct {
	Server Server `json:"server"`
}

type ProvisioningBillingPeriod

type ProvisioningBillingPeriod string
const (
	ProvisioningBillingPeriodDaily   ProvisioningBillingPeriod = "DAILY"
	ProvisioningBillingPeriodMonthly ProvisioningBillingPeriod = "MONTHLY"
)

type ProvisioningConfiguration

type ProvisioningConfiguration struct {
	ConfigurationID   string    `json:"configurationId"`
	Memory            int       `json:"memory"`
	Storage           []Storage `json:"storage"`
	Cpus              []Cpu     `json:"cpus"`
	CpuBenchmarkScore *int      `json:"cpuBenchmarkScore,omitempty"`
	Gpus              []Gpu     `json:"gpus"`
	Uplink            Uplink    `json:"uplink"`
	MonthlyHwPrice    Money     `json:"monthlyHwPrice"`
	DailyHwPrice      Money     `json:"dailyHwPrice"`
	Location          Location  `json:"location"`
	StockCount        int       `json:"stockCount"`
}

type ProvisioningConfigurationsInput

type ProvisioningConfigurationsInput struct {
	CpuNameIn            []string                              `json:"cpuName_in,omitempty"`
	CpuCount             *IntRange                             `json:"cpuCount,omitempty"`
	CpuCores             *IntRange                             `json:"cpuCores,omitempty"`
	CpuThreads           *IntRange                             `json:"cpuThreads,omitempty"`
	CpuBenchmarkScore    *IntRange                             `json:"cpuBenchmarkScore,omitempty"`
	Memory               *IntRange                             `json:"memory,omitempty"`
	GpuCount             *IntRange                             `json:"gpuCount,omitempty"`
	GpuMemory            *IntRange                             `json:"gpuMemory,omitempty"`
	StorageRequirements  []ProvisioningStorageRequirementInput `json:"storageRequirements,omitempty"`
	UplinkTotalCapacity  *IntRange                             `json:"uplinkTotalCapacity,omitempty"`
	MonthlyHwPriceAmount *DecimalRange                         `json:"monthlyHwPriceAmount,omitempty"`
	DailyHwPriceAmount   *DecimalRange                         `json:"dailyHwPriceAmount,omitempty"`
	LocationIdentifierIn []LocationIdentifier                  `json:"locationIdentifier_in,omitempty"`
	RegionIn             []Region                              `json:"region_in,omitempty"`
	StockCount           *IntRange                             `json:"stockCount,omitempty"`
}

type ProvisioningStorageRequirementInput

type ProvisioningStorageRequirementInput struct {
	TypeIn    []StorageInputType `json:"type_in,omitempty"`
	TotalSize *IntRange          `json:"totalSize,omitempty"`
	Count     *IntRange          `json:"count,omitempty"`
}

type Raid

type Raid string
const (
	RaidOther  Raid = "OTHER"
	RaidNone   Raid = "NONE"
	RaidCustom Raid = "CUSTOM"
	Raid0      Raid = "RAID_0"
	Raid1      Raid = "RAID_1"
	Raid5      Raid = "RAID_5"
	Raid6      Raid = "RAID_6"
	Raid10     Raid = "RAID_10"
)

type Ram

type Ram struct {
	Size int `json:"size"`
}

type Region

type Region string
const (
	RegionMEA Region = "MEA"
	RegionLA  Region = "LA"
	RegionAP  Region = "AP"
	RegionNA  Region = "NA"
	RegionEU  Region = "EU"
)

type ReverseDnsRecordInput

type ReverseDnsRecordInput struct {
	IP string `json:"ip"`
}

type ReverseDnsRecordResponse

type ReverseDnsRecordResponse struct {
	IP       IpAddress `json:"ip"`
	Hostname *string   `json:"hostname,omitempty"`
}

type Server

type Server struct {
	Name        string         `json:"name"`
	Alias       *string        `json:"alias,omitempty"`
	Hostname    *string        `json:"hostname,omitempty"`
	Location    Location       `json:"location"`
	Uptime      int            `json:"uptime"`
	PowerStatus PowerStatus    `json:"powerStatus"`
	StatusV2    ServerStatusV2 `json:"statusV2"`
	Network     Network        `json:"network"`
	Hardware    Hardware       `json:"hardware"`
	System      System         `json:"system"`
	TrafficPlan TrafficPlan    `json:"trafficPlan"`
	Tags        []ServerTag    `json:"tags"`
	Billing     Billing        `json:"billing"`
}

type ServerInput

type ServerInput struct {
	Name   *string         `json:"name,omitempty"`
	Alias  *string         `json:"alias,omitempty"`
	IP     *string         `json:"ip,omitempty"`
	IpmiIP *string         `json:"ipmiIp,omitempty"`
	Tag    *ServerTagInput `json:"tag,omitempty"`
}

type ServerLinksConfigurationStatus

type ServerLinksConfigurationStatus string
const (
	ServerLinksConfigurationStatusPending    ServerLinksConfigurationStatus = "PENDING"
	ServerLinksConfigurationStatusInProgress ServerLinksConfigurationStatus = "IN_PROGRESS"
	ServerLinksConfigurationStatusSuccess    ServerLinksConfigurationStatus = "SUCCESS"
	ServerLinksConfigurationStatusFailed     ServerLinksConfigurationStatus = "FAILED"
)

type ServerLinksConfigurationTask

type ServerLinksConfigurationTask struct {
	TaskID string                         `json:"taskId"`
	Status ServerLinksConfigurationStatus `json:"status"`
}

type ServerLinksConfigurationTaskInput

type ServerLinksConfigurationTaskInput struct {
	TaskID string `json:"taskId"`
}

type ServerStatusV2

type ServerStatusV2 string
const (
	ServerStatusV2Waiting      ServerStatusV2 = "WAITING"
	ServerStatusV2Provisioning ServerStatusV2 = "PROVISIONING"
	ServerStatusV2Maintenance  ServerStatusV2 = "MAINTENANCE"
	ServerStatusV2Unreachable  ServerStatusV2 = "UNREACHABLE"
	ServerStatusV2Active       ServerStatusV2 = "ACTIVE"
)

type ServerTag

type ServerTag struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type ServerTagInput

type ServerTagInput struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type ServersInput

type ServersInput struct {
	NameIn           []string         `json:"name_in,omitempty"`
	AliasIn          []string         `json:"alias_in,omitempty"`
	LocationIn       []string         `json:"location_in,omitempty"`
	RegionIn         []string         `json:"region_in,omitempty"`
	ServerStatusV2In []ServerStatusV2 `json:"serverStatusV2_in,omitempty"`
	PowerStatusIn    []PowerStatus    `json:"powerStatus_in,omitempty"`
	IPIn             []string         `json:"ip_in,omitempty"`
	IpmiIPIn         []string         `json:"ipmiIp_in,omitempty"`
	TagsIn           []ServerTagInput `json:"tags_in,omitempty"`
	TagKey           []string         `json:"tag_key,omitempty"`
	TagValue         []ServerTagInput `json:"tag_value,omitempty"`
}

type SetDefaultTrafficPlanInput

type SetDefaultTrafficPlanInput struct {
	Type      DefaultTrafficPlanType `json:"type"`
	Bandwidth float64                `json:"bandwidth"`
}

type SetReverseDnsRecordInput

type SetReverseDnsRecordInput struct {
	IP       string  `json:"ip"`
	Hostname *string `json:"hostname,omitempty"`
}

type SetReverseDnsRecordResponse

type SetReverseDnsRecordResponse struct {
	IP IpAddress `json:"ip"`
}

type SetServerAliasInput

type SetServerAliasInput struct {
	Alias  *string     `json:"alias,omitempty"`
	Server ServerInput `json:"server"`
}

type SetServerAliasResponse

type SetServerAliasResponse struct {
	Server Server `json:"server"`
}

type SetServerBootDeviceInput

type SetServerBootDeviceInput struct {
	BootDevice BootDevice  `json:"bootDevice"`
	Server     ServerInput `json:"server"`
}

type SetServerBootDeviceResponse

type SetServerBootDeviceResponse struct {
	Server Server `json:"server"`
}

type SetServerPrimaryIpInput

type SetServerPrimaryIpInput struct {
	IP     string      `json:"ip"`
	Server ServerInput `json:"server"`
}

type SetServerPrimaryIpResponse

type SetServerPrimaryIpResponse struct {
	Server Server `json:"server"`
}

type SetServerTagInput

type SetServerTagInput struct {
	Server ServerInput `json:"server"`
	Key    string      `json:"key"`
	Value  *string     `json:"value,omitempty"`
}

type SetServerTagsInput

type SetServerTagsInput struct {
	Server ServerInput      `json:"server"`
	Tags   []ServerTagInput `json:"tags"`
}

type Storage

type Storage struct {
	Size int         `json:"size"`
	Type StorageType `json:"type"`
}

type StorageInputType

type StorageInputType string
const (
	StorageInputTypeHDD     StorageInputType = "HDD"
	StorageInputTypeSATASSD StorageInputType = "SATA_SSD"
	StorageInputTypeNVMe    StorageInputType = "NVME"
)

type StorageType

type StorageType string
const (
	StorageTypeSATASSD StorageType = "SATA_SSD"
	StorageTypeHDD     StorageType = "HDD"
	StorageTypeNVMe    StorageType = "NVME"
	StorageTypeSATADOM StorageType = "SATADOM"
	StorageTypeEMMC    StorageType = "EMMC"
)

type Subscription

type Subscription struct {
	Name              string             `json:"name"`
	Type              SubscriptionType   `json:"type"`
	Subtotal          float64            `json:"subtotal"`
	Currency          Currency           `json:"currency"`
	BillingCycle      *BillingCycle      `json:"billingCycle,omitempty"`
	CreatedAt         time.Time          `json:"createdAt"`
	SubscriptionItems []SubscriptionItem `json:"subscriptionItems"`
	Invoices          []Invoice          `json:"invoices"`
}

type SubscriptionInput

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

type SubscriptionItem

type SubscriptionItem struct {
	Description            *string                `json:"description"`
	Price                  float64                `json:"price"`
	Currency               Currency               `json:"currency"`
	Type                   SubscriptionItemType   `json:"type"`
	SubscriptionItemDetail SubscriptionItemDetail `json:"subscriptionItemDetail"`
}

type SubscriptionItemDetail

type SubscriptionItemDetail struct {
	Server      *Server      `json:"server,omitempty"`
	TrafficPlan *TrafficPlan `json:"trafficPlan,omitempty"`
}

type SubscriptionItemType

type SubscriptionItemType string
const (
	SubscriptionItemTypeServer  SubscriptionItemType = "SERVER"
	SubscriptionItemTypeIP      SubscriptionItemType = "IP"
	SubscriptionItemTypeFee     SubscriptionItemType = "FEE"
	SubscriptionItemTypeDDoS    SubscriptionItemType = "DDOS"
	SubscriptionItemTypeTraffic SubscriptionItemType = "TRAFFIC"
	SubscriptionItemTypeOther   SubscriptionItemType = "OTHER"
)

type SubscriptionType

type SubscriptionType string
const (
	SubscriptionTypePrepaid  SubscriptionType = "PREPAID"
	SubscriptionTypePostpaid SubscriptionType = "POSTPAID"
	SubscriptionTypeTrial    SubscriptionType = "TRIAL"
)

type SubscriptionsInput

type SubscriptionsInput struct {
	NameIn     []string           `json:"name_in,omitempty"`
	CurrencyIn []Currency         `json:"currency_in,omitempty"`
	TypeIn     []SubscriptionType `json:"type_in,omitempty"`
}

type SupportRequest

type SupportRequest struct {
	ID              int                     `json:"id"`
	Subject         string                  `json:"subject"`
	Status          SupportRequestStatus    `json:"status"`
	CreatedAt       time.Time               `json:"createdAt"`
	UpdatedAt       time.Time               `json:"updatedAt"`
	NumberOfReplies int                     `json:"numberOfReplies"`
	LastReplyAt     time.Time               `json:"lastReplyAt"`
	FullName        string                  `json:"fullName"`
	Email           string                  `json:"email"`
	Category        *SupportRequestCategory `json:"category,omitempty"`
	Posts           []Post                  `json:"posts,omitempty"`
}

type SupportRequestCategory

type SupportRequestCategory string
const (
	SupportRequestCategoryNew            SupportRequestCategory = "NEW"
	SupportRequestCategorySalesInquiry   SupportRequestCategory = "SALES_INQUIRY"
	SupportRequestCategoryNetworkIssue   SupportRequestCategory = "NETWORK_ISSUE"
	SupportRequestCategoryTechnicalIssue SupportRequestCategory = "TECHNICAL_ISSUE"
	SupportRequestCategoryAbuseReport    SupportRequestCategory = "ABUSE_REPORT"
)

type SupportRequestInput

type SupportRequestInput struct {
	ID int `json:"id"`
}

type SupportRequestPostBy

type SupportRequestPostBy string
const (
	SupportRequestPostByUser  SupportRequestPostBy = "USER"
	SupportRequestPostByStaff SupportRequestPostBy = "STAFF"
)

type SupportRequestPriority

type SupportRequestPriority string
const (
	SupportRequestPriorityNormal SupportRequestPriority = "NORMAL"
	SupportRequestPriorityHigh   SupportRequestPriority = "HIGH"
	SupportRequestPriorityUrgent SupportRequestPriority = "URGENT"
)

type SupportRequestReplyInput

type SupportRequestReplyInput struct {
	ID      int    `json:"id"`
	Message string `json:"message"`
}

type SupportRequestStatus

type SupportRequestStatus string
const (
	SupportRequestStatusOpen   SupportRequestStatus = "OPEN"
	SupportRequestStatusClosed SupportRequestStatus = "CLOSED"
)

type SupportRequestSubject

type SupportRequestSubject string
const (
	SupportRequestSubjectHardwareIssue        SupportRequestSubject = "HARDWARE_ISSUE"
	SupportRequestSubjectHardwareOther        SupportRequestSubject = "HARDWARE_OTHER"
	SupportRequestSubjectNetworkRouting       SupportRequestSubject = "NETWORK_ROUTING"
	SupportRequestSubjectNetworkBGP           SupportRequestSubject = "NETWORK_BGP"
	SupportRequestSubjectNetworkAdditionalIPs SupportRequestSubject = "NETWORK_ADDITIONAL_IPS"
	SupportRequestSubjectNetworkOther         SupportRequestSubject = "NETWORK_OTHER"
	SupportRequestSubjectSalesServerOrder     SupportRequestSubject = "SALES_SERVER_ORDER"
	SupportRequestSubjectSalesPricing         SupportRequestSubject = "SALES_PRICING"
	SupportRequestSubjectSalesBandwidthPlan   SupportRequestSubject = "SALES_BANDWIDTH_PLAN"
	SupportRequestSubjectSalesOther           SupportRequestSubject = "SALES_OTHER"
	SupportRequestSubjectSalesCancellation    SupportRequestSubject = "SALES_CANCELLATION"
	SupportRequestSubjectSalesServerUpgrade   SupportRequestSubject = "SALES_SERVER_UPGRADE"
)

type SupportRequestsInput

type SupportRequestsInput struct {
	Status       *SupportRequestStatus    `json:"status,omitempty"`
	CategoriesIn []SupportRequestCategory `json:"categories_in,omitempty"`
}

type System

type System struct {
	Raid            Raid            `json:"raid"`
	OperatingSystem OperatingSystem `json:"operatingSystem"`
}

type Traffic

type Traffic struct {
	Aggregated AggregatedTraffic  `json:"aggregated"`
	PerServer  []PerServerTraffic `json:"perServer"`
}

type TrafficInput

type TrafficInput struct {
	From   time.Time            `json:"from"`
	To     time.Time            `json:"to"`
	Filter *TrafficServersInput `json:"filter,omitempty"`
}

type TrafficPlan

type TrafficPlan struct {
	Name      string           `json:"name"`
	Type      TrafficPlanType  `json:"type"`
	Scope     TrafficPlanScope `json:"scope"`
	Bandwidth *float64         `json:"bandwidth,omitempty"`
}

type TrafficPlanScope

type TrafficPlanScope string
const (
	TrafficPlanScopePooled TrafficPlanScope = "POOLED"
	TrafficPlanScopeServer TrafficPlanScope = "SERVER"
)

type TrafficPlanType

type TrafficPlanType string
const (
	TrafficPlanTypeP95           TrafficPlanType = "P95"
	TrafficPlanTypeMetered       TrafficPlanType = "METERED"
	TrafficPlanTypePeakUnmetered TrafficPlanType = "PEAK_UNMETERED"
	TrafficPlanTypePeakMetered   TrafficPlanType = "PEAK_METERED"
)

type TrafficServersInput

type TrafficServersInput struct {
	NameIn     []string `json:"name_in,omitempty"`
	AliasIn    []string `json:"alias_in,omitempty"`
	LocationIn []string `json:"location_in,omitempty"`
	RegionIn   []string `json:"region_in,omitempty"`
	IPIn       []string `json:"ip_in,omitempty"`
	IpmiIPIn   []string `json:"ipmiIp_in,omitempty"`
}

type TrafficStatistics

type TrafficStatistics struct {
	Average float64 `json:"average"`
	Last    float64 `json:"last"`
	P95     float64 `json:"p95"`
	Sum     float64 `json:"sum"`
	Maximum float64 `json:"maximum"`
}

type UpdatePostInstallScriptInput

type UpdatePostInstallScriptInput struct {
	ID             string  `json:"id"`
	Name           *string `json:"name,omitempty"`
	Content        *string `json:"content,omitempty"`
	IsAutoSelected *bool   `json:"isAutoSelected,omitempty"`
}
type Uplink struct {
	Ports []Port `json:"ports"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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