Skip to content

LTD-Beget/openapi-cloud-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go API client for begetOpenapiCloud

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.4.0
  • Package version: v1.4.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 begetOpenapiCloud "github.com/LTD-Beget/openapi-cloud-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(), begetOpenapiCloud.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(), begetOpenapiCloud.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(), begetOpenapiCloud.ContextOperationServerIndices, map[string]int{
	"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), begetOpenapiCloud.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
CloudServiceApi CloudServiceChangeConfiguration Patch /v1/cloud/{service_id}/configuration
CloudServiceApi CloudServiceCreate Post /v1/cloud
CloudServiceApi CloudServiceGet Get /v1/cloud/{service_id}
CloudServiceApi CloudServiceGetConfigurationList Get /v1/cloud/configuration
CloudServiceApi CloudServiceGetList Get /v1/cloud
CloudServiceApi CloudServiceRemove Delete /v1/cloud/{service_id}
CloudServiceApi CloudServiceUpdate Patch /v1/cloud/{service_id}
MysqlBackupServiceApi MysqlBackupServiceGetList Get /v1/cloud/mysql/backup
MysqlBackupServiceApi MysqlBackupServiceGetOrders Get /v1/cloud/mysql/backup/orders
MysqlBackupServiceApi MysqlBackupServiceRestore Post /v1/cloud/mysql/backup/{copy_id}
MysqlServiceApi MysqlServiceChangeAccessPassword Patch /v1/cloud/mysql/{service_id}/db/{db_name}/access/{host}
MysqlServiceApi MysqlServiceCreateAccess Post /v1/cloud/mysql/{service_id}/db/{db_name}/access
MysqlServiceApi MysqlServiceCreateDb Post /v1/cloud/mysql/{service_id}/db
MysqlServiceApi MysqlServiceGetConfig Get /v1/cloud/mysql/{service_id}/config
MysqlServiceApi MysqlServiceGetDbList Get /v1/cloud/mysql/{service_id}/db
MysqlServiceApi MysqlServiceRemoveAccess Delete /v1/cloud/mysql/{service_id}/db/{db_name}/access/{host}
MysqlServiceApi MysqlServiceRemoveDb Delete /v1/cloud/mysql/{service_id}/db/{db_name}
MysqlServiceApi MysqlServiceSetConfig Put /v1/cloud/mysql/{service_id}/config
MysqlServiceApi MysqlServiceUpdateDb Patch /v1/cloud/mysql/{service_id}/db/{db_name}
MysqlStatisticServiceApi MysqlStatisticServiceGetCpu Get /v1/cloud/mysql/{service_id}/statistic/cpu
MysqlStatisticServiceApi MysqlStatisticServiceGetCpuDetails Get /v1/cloud/mysql/{service_id}/statistic/cpu-details
MysqlStatisticServiceApi MysqlStatisticServiceGetDisk Get /v1/cloud/mysql/{service_id}/statistic/disk
MysqlStatisticServiceApi MysqlStatisticServiceGetDiskUsage Get /v1/cloud/mysql/{service_id}/statistic/disk-usage
MysqlStatisticServiceApi MysqlStatisticServiceGetLoadAverage Get /v1/cloud/mysql/{service_id}/statistic/load-average
MysqlStatisticServiceApi MysqlStatisticServiceGetMemory Get /v1/cloud/mysql/{service_id}/statistic/memory
MysqlStatisticServiceApi MysqlStatisticServiceGetNetwork Get /v1/cloud/mysql/{service_id}/statistic/network
PostgresqlBackupServiceApi PostgresqlBackupServiceGetList Get /v1/cloud/postgresql/backup
PostgresqlBackupServiceApi PostgresqlBackupServiceGetOrders Get /v1/cloud/postgresql/backup/orders
PostgresqlBackupServiceApi PostgresqlBackupServiceRestore Post /v1/cloud/postgresql/backup/{copy_id}
PostgresqlServiceApi PostgresqlServiceCreateDb Post /v1/cloud/postgresql/{service_id}/db
PostgresqlServiceApi PostgresqlServiceCreateRole Post /v1/cloud/postgresql/{service_id}/role
PostgresqlServiceApi PostgresqlServiceGetConfig Get /v1/cloud/postgresql/{service_id}/config
PostgresqlServiceApi PostgresqlServiceGetDbList Get /v1/cloud/postgresql/{service_id}/db
PostgresqlServiceApi PostgresqlServiceGetRemoteAccess Get /v1/cloud/postgresql/{service_id}/remote-access
PostgresqlServiceApi PostgresqlServiceGetRoleList Get /v1/cloud/postgresql/{service_id}/role
PostgresqlServiceApi PostgresqlServiceRemoveDb Delete /v1/cloud/postgresql/{service_id}/db/{db_name}
PostgresqlServiceApi PostgresqlServiceRemoveRole Delete /v1/cloud/postgresql/{service_id}/role/{role_name}
PostgresqlServiceApi PostgresqlServiceSetConfig Put /v1/cloud/postgresql/{service_id}/config
PostgresqlServiceApi PostgresqlServiceUpdateDb Patch /v1/cloud/postgresql/{service_id}/db/{db_name}
PostgresqlServiceApi PostgresqlServiceUpdateRemoteAccess Put /v1/cloud/postgresql/{service_id}/remote-access
PostgresqlServiceApi PostgresqlServiceUpdateRole Patch /v1/cloud/postgresql/{service_id}/role/{role_name}
PostgresqlStatisticServiceApi PostgresqlStatisticServiceGetCpu Get /v1/cloud/postgresql/{service_id}/statistic/cpu
PostgresqlStatisticServiceApi PostgresqlStatisticServiceGetCpuDetails Get /v1/cloud/postgresql/{service_id}/statistic/cpu-details
PostgresqlStatisticServiceApi PostgresqlStatisticServiceGetDisk Get /v1/cloud/postgresql/{service_id}/statistic/disk
PostgresqlStatisticServiceApi PostgresqlStatisticServiceGetDiskUsage Get /v1/cloud/postgresql/{service_id}/statistic/disk-usage
PostgresqlStatisticServiceApi PostgresqlStatisticServiceGetLoadAverage Get /v1/cloud/postgresql/{service_id}/statistic/load-average
PostgresqlStatisticServiceApi PostgresqlStatisticServiceGetMemory Get /v1/cloud/postgresql/{service_id}/statistic/memory
PostgresqlStatisticServiceApi PostgresqlStatisticServiceGetNetwork Get /v1/cloud/postgresql/{service_id}/statistic/network
S3ServiceApi S3ServiceChangeAccessKey Patch /v1/cloud/s3/{service_id}/access-key
S3ServiceApi S3ServiceChangeCors Patch /v1/cloud/s3/{service_id}/cors
S3ServiceApi S3ServiceChangeDomain Patch /v1/cloud/s3/{service_id}/domain
S3ServiceApi S3ServiceChangePublic Patch /v1/cloud/s3/{service_id}/public
S3ServiceApi S3ServiceGetPrefix Get /v1/cloud/s3/prefix
S3ServiceApi S3ServiceGetPrice Get /v1/cloud/s3/price
S3ServiceApi S3ServiceGetQuota Get /v1/cloud/s3/quota

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