Skip to content

mohi-kalantari/ubicloud-go-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go API client for openapi

API for managing resources on Ubicloud

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: 0.1.0
  • Package version: 1.0.0
  • Build package: org.openapitools.codegen.languages.GoClientCodegen For more information, please visit https://www.ubicloud.com/

Installation

Install the following dependencies:

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

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

import openapi "github.com/mohi-kalantari/ubicloud-go-client"

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(), openapi.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(), openapi.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(), openapi.ContextOperationServerIndices, map[string]int{
	"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), openapi.ContextOperationServerVariables, map[string]map[string]string{
	"{classname}Service.{nickname}": {
		"port": "8443",
	},
})

Documentation for API Endpoints

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

Class Method HTTP request Description
FirewallApi ActionLocationFirewallAttachSubnet Post /project/{project_id}/location/{location}/firewall/_{firewall_id}/attach-subnet Attach a subnet to firewall
FirewallApi ActionLocationFirewallDetachSubnet Post /project/{project_id}/location/{location}/firewall/_{firewall_id}/detach-subnet Detach a subnet from firewall
FirewallApi CreateFirewall Post /project/{project_id}/firewall Create a new firewall
FirewallApi CreateLocationFirewall Post /project/{project_id}/location/{location}/firewall/{firewall_name} Create a new firewall
FirewallApi DeleteFirewall Delete /project/{project_id}/firewall/{firewall_name} Delete a specific firewall
FirewallApi DeleteLocationFirewall Delete /project/{project_id}/location/{location}/firewall/{firewall_name} Delete a specific firewall
FirewallApi DeleteLocationFirewallWithId Delete /project/{project_id}/location/{location}/firewall/id/{firewall_id} Delete a specific firewall
FirewallApi GetFirewall Get /project/{project_id}/firewall Return the list of firewalls in the project
FirewallApi GetFirewallDetails Get /project/{project_id}/firewall/{firewall_name} Get details of a specific firewall
FirewallApi GetLocationFirewall Get /project/{project_id}/location/{location}/firewall Return the list of firewalls in the project and location
FirewallApi GetLocationFirewallDetails Get /project/{project_id}/location/{location}/firewall/{firewall_name} Get details of a specific firewall
FirewallApi GetLocationFirewallDetailsWithId Get /project/{project_id}/location/{location}/firewall/id/{firewall_id} Get details of a specific firewall
FirewallRuleApi CreateFirewallRule Post /project/{project_id}/firewall/{firewall_name}/firewall-rule Create a new firewall rule
FirewallRuleApi CreateLocationFirewallFirewallRule Post /project/{project_id}/location/{location}/firewall/{firewall_name}/firewall-rule/{firewall_rule_id} Create a new firewall rule
FirewallRuleApi CreateLocationFirewallFirewallRuleWithId Post /project/{project_id}/location/{location}/firewall/id/{firewall_name}/firewall-rule/{firewall_rule_id} Create a new firewall rule
FirewallRuleApi CreateLocationFirewallRule Post /project/{project_id}/location/{location}/firewall/{firewall_name}/firewall-rule Create a new firewall rule
FirewallRuleApi CreateLocationFirewallRuleWithId Post /project/{project_id}/location/{location}/firewall/id/{firewall_name}/firewall-rule Create a new firewall rule
FirewallRuleApi DeleteFirewallRule Delete /project/{project_id}/firewall/{firewall_name}/firewall-rule/{firewall_rule_id} Delete a specific firewall rule
FirewallRuleApi DeleteLocationFirewallFirewallRule Delete /project/{project_id}/location/{location}/firewall/{firewall_name}/firewall-rule/{firewall_rule_id} Delete a specific firewall rule
FirewallRuleApi DeleteLocationFirewallFirewallRuleWithId Delete /project/{project_id}/location/{location}/firewall/id/{firewall_name}/firewall-rule/{firewall_rule_id} Delete a specific firewall rule
FirewallRuleApi DeleteLocationPostgresFirewallRule Delete /project/{project_id}/location/{location}/postgres/{postgres_database_name}/firewall-rule/{firewall_rule_id} Delete a specific firewall rule
FirewallRuleApi DeleteLocationPostgresFirewallRuleWithId Delete /project/{project_id}/location/{location}/postgres/id/{postgres_database_id}/firewall-rule/{firewall_rule_id} Delete a specific Postgres firewall rule
FirewallRuleApi GetFirewallRuleDetails Get /project/{project_id}/firewall/{firewall_name}/firewall-rule/{firewall_rule_id} Get details of a firewall rule
FirewallRuleApi GetLocationFirewallFirewallRuleDetails Get /project/{project_id}/location/{location}/firewall/{firewall_name}/firewall-rule/{firewall_rule_id} Get details of a firewall rule
FirewallRuleApi GetLocationFirewallFirewallRuleDetailsWithId Get /project/{project_id}/location/{location}/firewall/id/{firewall_name}/firewall-rule/{firewall_rule_id} Get details of a firewall rule
KubernetesClusterApi CreateKubernetesCluster Post /project/{project_id}/kubernetes-cluster Create a new kubernetes cluster
KubernetesClusterApi CreateLocationKubernetesCluster Post /project/{project_id}/location/{location}/kubernetes-cluster/{kubernetes_cluster_name} Create Kubernetes Cluster in a specific location of a project
KubernetesClusterApi GetKubernetesCluster Get /project/{project_id}/kubernetes-cluster Return the list of kubernetes clusters in the project
KubernetesClusterApi GetKubernetesClusterDetails Get /project/{project_id}/location/{location}/kubernetes-cluster/{kubernetes_cluster_name} Get details of a specific Kubernetes Cluster in a location
KubernetesClusterApi ListLocationKubernetesClusters Get /project/{project_id}/location/{location}/kubernetes-cluster List kubernetes clusters in a specific location of a project
KubernetesVMApi CreateLocationKubernetesVM Post /project/{project_id}/location/{location}/kubernetes-vm/{kubernetes_vm_name} Create Kubernetes VM in a specific location of a project
KubernetesVMApi DeleteLocationKubernetesVMWithName Delete /project/{project_id}/location/{location}/kubernetes-vm/{kubernetes_vm_name} Delete a specific Kubernetes VM with name
KubernetesVMApi GetLocationKubernetesVMDetails Get /project/{project_id}/location/{location}/kubernetes-vm/{kubernetes_vm_name} Get details of a specific Kubernetes VM in a location
KubernetesVMApi ListLocationKubernetesVMs Get /project/{project_id}/location/{location}/kubernetes-vm List Kubernetes VMs in a specific location of a project
LoadBalancerApi AttachVmLocationLoadBalancer Post /project/{project_id}/location/{location}/load-balancer/{load_balancer_name}/attach-vm Attach a VM to a Load Balancer in a specific location of a project
LoadBalancerApi CreateLoadBalancer Post /project/{project_id}/load-balancer/{load_balancer_name} Create a new Load Balancer in a project
LoadBalancerApi CreateLocationLoadBalancer Post /project/{project_id}/location/{location}/load-balancer/{load_balancer_name} Create a new Load Balancer in a specific location of a project
LoadBalancerApi DeleteLoadBalancer Delete /project/{project_id}/location/{location}/load-balancer/{load_balancer_name} Delete a specific Load Balancer
LoadBalancerApi DeleteLoadBalancerWithID Delete /project/{project_id}/location/{location}/load-balancer/id/{load_balancer_id} Delete a specific Load Balancer with ID
LoadBalancerApi DetachVmLocationLoadBalancer Post /project/{project_id}/location/{location}/load-balancer/{load_balancer_name}/detach-vm Detach a VM from a Load Balancer in a specific location of a project
LoadBalancerApi GetLoadBalancer Get /project/{project_id}/load-balancer/{load_balancer_name} Get details of a specific Load Balancer
LoadBalancerApi GetLoadBalancerDetails Get /project/{project_id}/location/{location}/load-balancer/{load_balancer_name} Get details of a specific Load Balancer in a location
LoadBalancerApi GetLoadBalancerDetailsWithId Get /project/{project_id}/location/{location}/load-balancer/id/{load_balancer_id} Get details of a specific Load Balancer in a location with ID
LoadBalancerApi ListLoadBalancers Get /project/{project_id}/load-balancer List Load Balancers in a specific project
LoadBalancerApi ListLocationLoadBalancers Get /project/{project_id}/location/{location}/load-balancer List Load Balancers in a specific location of a project
LoadBalancerApi PatchLocationLoadBalancer Patch /project/{project_id}/location/{location}/load-balancer/{load_balancer_name} Update a Load Balancer in a specific location of a project
LoginApi Login Post /login Login with user information
PostgresApi CreatePostgresDatabase Post /project/{project_id}/location/{location}/postgres/{postgres_database_name} Create a new Postgres database in a specific location of a project
PostgresApi DeletePostgresDatabase Delete /project/{project_id}/location/{location}/postgres/{postgres_database_name} Delete a specific Postgres database
PostgresApi DeletePostgresDatabaseWithID Delete /project/{project_id}/location/{location}/postgres/id/{postgres_database_id} Delete a specific Postgres database with ID
PostgresApi FailoverPostgresDatabaseWithID Post /project/{project_id}/location/{location}/postgres/_{postgres_database_id}/failover Failover a specific Postgres database with ID
PostgresApi GetPostgresDatabaseDetails Get /project/{project_id}/location/{location}/postgres/{postgres_database_name} Get details of a specific Postgres database in a location
PostgresApi GetPostgresDetailsWithId Get /project/{project_id}/location/{location}/postgres/id/{postgres_database_id} Get details of a specific Postgres database in a location with ID
PostgresApi ListLocationPostgresDatabases Get /project/{project_id}/location/{location}/postgres List Postgres databases in a specific location of a project
PostgresApi ListPostgresDatabases Get /project/{project_id}/postgres List visible Postgres databases
PostgresApi ResetSuperuserPassword Post /project/{project_id}/location/{location}/postgres/{postgres_database_name}/reset-superuser-password Reset superuser password of the Postgres database
PostgresApi ResetSuperuserPasswordWithID Post /project/{project_id}/location/{location}/postgres/id/{postgres_database_id}/reset-superuser-password Reset super-user password of the Postgres database
PostgresApi RestorePostgresDatabase Post /project/{project_id}/location/{location}/postgres/{postgres_database_name}/restore Restore a new Postgres database in a specific location of a project
PostgresApi RestorePostgresDatabaseWithID Post /project/{project_id}/location/{location}/postgres/id/{postgres_database_id}/restore Restore a new Postgres database in a specific location of a project with ID
PostgresFirewallRuleApi CreateLocationPostgresFirewallRule Post /project/{project_id}/location/{location}/postgres/{postgres_database_name}/firewall-rule Create a new postgres firewall rule
PostgresFirewallRuleApi CreateLocationPostgresFirewallRuleWithId Post /project/{project_id}/location/{location}/postgres/_{postgres_database_id}/firewall-rule Create a new Postgres firewall rule
PostgresFirewallRuleApi CreateLocationPostgresFirewallRuleWithIdWithId Post /project/{project_id}/location/{location}/postgres/id/{postgres_database_id}/firewall-rule/{firewall_rule_id} Create a new Postgres firewall rule
PostgresFirewallRuleApi GetLocationPostgresFirewallRuleDetailsWithId Get /project/{project_id}/location/{location}/postgres/id/{postgres_database_id}/firewall-rule/{firewall_rule_id} Get details of a Postgres firewall rule
PostgresFirewallRuleApi ListLocationPostgresFirewallRules Get /project/{project_id}/location/{location}/postgres/_{postgres_database_id}/firewall-rule List location Postgres firewall rules
PostgresMetricDestinationApi CreateLocationPostgresMetricDestination Post /project/{project_id}/location/{location}/postgres/{postgres_database_name}/metric-destination Create a new Postgres Metric Destination
PostgresMetricDestinationApi DeleteLocationPostgresMetricDestination Delete /project/{project_id}/location/{location}/postgres/{postgres_database_name}/metric-destination/{metric_destination_id} Delete a specific Metric Destination
PrivateSubnetApi CreatePrivateSubnet Post /project/{project_id}/location/{location}/private-subnet/{private_subnet_name} Create a new Private Subnet in a specific location of a project
PrivateSubnetApi DeletePSWithId Delete /project/{project_id}/location/{location}/private-subnet/id/{private_subnet_id} Delete a specific Private Subnet with ID
PrivateSubnetApi DeletePrivateSubnet Delete /project/{project_id}/location/{location}/private-subnet/{private_subnet_name} Delete a specific Private Subnet
PrivateSubnetApi GetPSDetailsWithId Get /project/{project_id}/location/{location}/private-subnet/id/{private_subnet_id} Get details of a specific Private Subnet in a location with ID
PrivateSubnetApi GetPrivateSubnetDetails Get /project/{project_id}/location/{location}/private-subnet/{private_subnet_name} Get details of a specific Private Subnet in a location
PrivateSubnetApi ListLocationPrivateSubnets Get /project/{project_id}/location/{location}/private-subnet List Private Subnets in a specific location of a project
PrivateSubnetApi ListPSs Get /project/{project_id}/private-subnet List visible Private Subnets
ProjectApi CreateProject Post /project Create a new project
ProjectApi DeleteProject Delete /project/{project_id} Delete a project
ProjectApi GetProject Get /project/{project_id} Retrieve a project
ProjectApi ListProjects Get /project List all projects visible to the logged in user.
VirtualMachineApi CreateVM Post /project/{project_id}/location/{location}/vm/{vm_name} Create a new VM in a specific location of a project
VirtualMachineApi DeleteVM Delete /project/{project_id}/location/{location}/vm/{vm_name} Delete a specific VM
VirtualMachineApi DeleteVMWithId Delete /project/{project_id}/location/{location}/vm/id/{vm_id} Delete a specific VM with ID
VirtualMachineApi GetVMDetails Get /project/{project_id}/location/{location}/vm/{vm_name} Get details of a specific VM in a location
VirtualMachineApi GetVMDetailsWithId Get /project/{project_id}/location/{location}/vm/id/{vm_id} Get details of a specific VM in a location with ID
VirtualMachineApi ListLocationVMs Get /project/{project_id}/location/{location}/vm List VMs in a specific location of a project
VirtualMachineApi ListProjectVMs Get /project/{project_id}/vm List all VMs created under the given project ID and visible to logged in user

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

[email protected]

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages