Skip to content

LTD-Beget/openapi-vps-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go API client for begetOpenapiVps

No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

Overview

This API client was generated by the OpenAPI Generator project. By using the OpenAPI-spec from a remote server, you can easily generate an API client.

  • API version: v1.6.0
  • Package version: v1.6.0
  • Build package: org.openapitools.codegen.languages.GoClientCodegen

Installation

Install the following dependencies:

go get github.com/stretchr/testify/assert
go get golang.org/x/oauth2
go get golang.org/x/net/context

Put the package under your project folder and add the following in import:

import begetOpenapiVps "github.com/LTD-Beget/openapi-vps-go"

To use a proxy, set the environment variable HTTP_PROXY:

os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")

Configuration of Server URL

Default configuration comes with Servers field that contains server objects as defined in the OpenAPI specification.

Select Server Configuration

For using other server than the one defined on index 0 set context value sw.ContextServerIndex of type int.

ctx := context.WithValue(context.Background(), begetOpenapiVps.ContextServerIndex, 1)

Templated Server URL

Templated server URL is formatted using default variables from configuration or from context value sw.ContextServerVariables of type map[string]string.

ctx := context.WithValue(context.Background(), begetOpenapiVps.ContextServerVariables, map[string]string{
	"basePath": "v2",
})

Note, enum values are always validated and all unused variables are silently ignored.

URLs Configuration per Operation

Each operation can use different server URL defined using OperationServers map in the Configuration. An operation is uniquely identified by "{classname}Service.{nickname}" string. Similar rules for overriding default operation server index and variables applies by using sw.ContextOperationServerIndices and sw.ContextOperationServerVariables context maps.

ctx := context.WithValue(context.Background(), begetOpenapiVps.ContextOperationServerIndices, map[string]int{
	"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), begetOpenapiVps.ContextOperationServerVariables, map[string]map[string]string{
	"{classname}Service.{nickname}": {
		"port": "8443",
	},
})

Documentation for API Endpoints

All URIs are relative to https://api.beget.com

Class Method HTTP request Description
BackupServiceApi BackupServiceGetAvailableCopies Get /v1/vps/backup
BackupServiceApi BackupServiceGetBackupFileList Get /v1/vps/{id}/backup/{copy_id}
BackupServiceApi BackupServiceGetOrders Get /v1/vps/backup/orders
BackupServiceApi BackupServiceRestoreFile Post /v1/vps/{id}/backup/{copy_id}/file
BackupServiceApi BackupServiceRestoreServer Post /v1/vps/{id}/backup/{copy_id}/server
ConfiguratorServiceApi ConfiguratorServiceGetCalculation Get /v1/vps/configurator/calculation
ConfiguratorServiceApi ConfiguratorServiceGetConfiguratorInfo Get /v1/vps/configurator/info
ManageServiceApi ManageServiceAttachIpAddress Post /v1/vps/{id}/network/{ip_address}
ManageServiceApi ManageServiceAttachSshKey Post /v1/vps/{id}/sshKey/{ssh_key_id}
ManageServiceApi ManageServiceAttachToPrivateNetwork Post /v1/vps/{id}/private-network/{network_id}
ManageServiceApi ManageServiceChangeConfiguration Put /v1/vps/server/{id}/configuration
ManageServiceApi ManageServiceChangeSshAccess Put /v1/vps/{id}/ssh/access
ManageServiceApi ManageServiceCheckSoftwareRequirements Post /v1/vps/software/requirements
ManageServiceApi ManageServiceCreateVps Post /v1/vps/server
ManageServiceApi ManageServiceDetachFromPrivateNetwork Delete /v1/vps/{id}/private-network/{network_id}
ManageServiceApi ManageServiceDetachIpAddress Delete /v1/vps/network/detach/{ip_address}
ManageServiceApi ManageServiceDetachSshKey Delete /v1/vps/{id}/sshKey/{ssh_key_id}
ManageServiceApi ManageServiceDisablePostInstallAlert Delete /v1/vps/{id}/software/post-install-alert
ManageServiceApi ManageServiceGetAvailableConfiguration Get /v1/vps/configuration
ManageServiceApi ManageServiceGetFileManagerSettings Post /v1/vps/{id}/fm
ManageServiceApi ManageServiceGetHistory Get /v1/vps/{id}/history
ManageServiceApi ManageServiceGetInfo Get /v1/vps/server/{id}
ManageServiceApi ManageServiceGetInstalledSoftware Get /v1/vps/{id}/software
ManageServiceApi ManageServiceGetList Get /v1/vps/server/list
ManageServiceApi ManageServiceGetRegionList Get /v1/vps/region
ManageServiceApi ManageServiceGetStatuses Get /v1/vps/server/statuses
ManageServiceApi ManageServiceRebootVps Post /v1/vps/server/{id}/reboot
ManageServiceApi ManageServiceReinstall Post /v1/vps/server/{id}/reinstall
ManageServiceApi ManageServiceRemoveVps Post /v1/vps/server/{id}/remove
ManageServiceApi ManageServiceReserveVpsSubdomain Get /v1/vps/subdomain/reserve
ManageServiceApi ManageServiceResetPassword Put /v1/vps/{id}/password
ManageServiceApi ManageServiceResetVps Post /v1/vps/server/{id}/reset
ManageServiceApi ManageServiceStartRescue Post /v1/vps/server/{id}/rescue
ManageServiceApi ManageServiceStartVps Post /v1/vps/server/{id}/start
ManageServiceApi ManageServiceStopRescue Delete /v1/vps/server/{id}/rescue
ManageServiceApi ManageServiceStopVps Post /v1/vps/server/{id}/stop
ManageServiceApi ManageServiceUnarchive Delete /v1/vps/archive/{id}
ManageServiceApi ManageServiceUpdateInfo Put /v1/vps/server/{id}/info
MarketplaceServiceApi MarketplaceServiceGetSoftwareInfo Get /v1/vps/marketplace/software/{name}/{version}
MarketplaceServiceApi MarketplaceServiceGetSoftwareList Get /v1/vps/marketplace/software/list
NetworkServiceApi NetworkServiceCreatePrivateNetwork Post /v1/vps/private-network
NetworkServiceApi NetworkServiceGetNetworkInfo Get /v1/vps/network
NetworkServiceApi NetworkServiceOrderIpAddress Post /v1/vps/network
NetworkServiceApi NetworkServiceRemoveIpAddress Delete /v1/vps/network/{ip_address}
NetworkServiceApi NetworkServiceSuggestPrivateAddress Post /v1/vps/private-network/{network_id}/suggested-address
SnapshotServiceApi SnapshotServiceCreate Post /v1/vps/snapshot
SnapshotServiceApi SnapshotServiceCreateCalculator Post /v1/vps/snapshot/calculator
SnapshotServiceApi SnapshotServiceEdit Put /v1/vps/snapshot/{id}
SnapshotServiceApi SnapshotServiceGetAll Get /v1/vps/snapshot
SnapshotServiceApi SnapshotServiceGetAllRestores Get /v1/vps/snapshot/restore
SnapshotServiceApi SnapshotServiceRemove Delete /v1/vps/snapshot/{id}
SnapshotServiceApi SnapshotServiceRestore Post /v1/vps/snapshot/{id}/restore
SoftwareLicenseServiceApi SoftwareLicenseServiceChangeLicensePlan Patch /v1/vps/software/license/{vps_id}
SoftwareLicenseServiceApi SoftwareLicenseServiceGetLicenseInfo Get /v1/vps/software/license
SshKeyServiceApi SshKeyServiceAdd Post /v1/vps/sshKey
SshKeyServiceApi SshKeyServiceGetAll Get /v1/vps/sshKey
SshKeyServiceApi SshKeyServiceRemove Delete /v1/vps/sshKey/{id}
StatisticServiceApi StatisticServiceGetCpu Get /v1/vps/statistic/cpu/{id}
StatisticServiceApi StatisticServiceGetCpuDetails Get /v1/vps/statistic/cpu-details/{id}
StatisticServiceApi StatisticServiceGetDisk Get /v1/vps/statistic/disk/{id}
StatisticServiceApi StatisticServiceGetDiskUsage Get /v1/vps/statistic/disk-usage/{id}
StatisticServiceApi StatisticServiceGetLoadAverage Get /v1/vps/statistic/load-average/{id}
StatisticServiceApi StatisticServiceGetMemory Get /v1/vps/statistic/memory/{id}
StatisticServiceApi StatisticServiceGetNetwork Get /v1/vps/statistic/network/{id}
StatisticServiceApi StatisticServiceGetProcessList Get /v1/vps/statistic/processes/{id}

Documentation For Models

Documentation For Authorization

bearerAuth

  • Type: HTTP Bearer token authentication

Example

auth := context.WithValue(context.Background(), sw.ContextAccessToken, "BEARER_TOKEN_STRING")
r, err := client.Service.Operation(auth, args)

Documentation for Utility Methods

Due to the fact that model structure members are all pointers, this package contains a number of utility functions to easily obtain pointers to values of basic types. Each of these functions takes a value of the given basic type and returns a pointer to it:

  • PtrBool
  • PtrInt
  • PtrInt32
  • PtrInt64
  • PtrFloat
  • PtrFloat32
  • PtrFloat64
  • PtrString
  • PtrTime

Author

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages