Skip to content

entrywan/api-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go API client for openapi

Manage Entrywan resources programmatically using the API.

All API requests are authenticated using IAM tokens. Tokens can be generated and retrieved from the portal. The portal itself is an API client that uses an unrestricted token to access resources for an account.

This documentation is generated using an OpenAPI 3.1.0 specification. More information about OpenAPI can be found on its site. The current version of Entrywan's API spec is also available for inspection.

On the left of this page are links to the Endpoints grouped by tag and Schemas the API exposes. Endpoints are URLs that can be accessed with any HTTP client or device. Schemas are machine-readable data models that represent resources.

To learn more, have a look at the documentation. If you have any questions, contact support or your account representative.

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: v1beta
  • Package version: 1.0.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/net/context

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

import openapi "github.com/entrywan/api-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 openapi.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 openapi.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 openapi.ContextOperationServerIndices and openapi.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.entrywan.com/v1beta

Class Method HTTP request Description
ClusterAPI ClusterGet Get /cluster List kubernetes clusters
ClusterAPI ClusterIdDelete Delete /cluster/{id} Delete cluster
ClusterAPI ClusterIdGet Get /cluster/{id} Get a kubernetes cluster
ClusterAPI ClusterIdKubeconfigGet Get /cluster/{id}/kubeconfig Fetch the kubeconfig file for a cluster
ClusterAPI ClusterIdRotatePatch Patch /cluster/{id}/rotate Rotate credentials
ClusterAPI ClusterIdScalePut Put /cluster/{id}/scale Scale a cluster up or down
ClusterAPI ClusterPost Post /cluster Create a kubernetes cluster
FirewallAPI FirewallGet Get /firewall List firewalls
FirewallAPI FirewallIdDelete Delete /firewall/{id} Delete a firewall
FirewallAPI FirewallPost Post /firewall Add a firewall
FirewallAPI InstanceIdFirewallPut Put /instance/{id}/firewall Apply firewall to instance
InstanceAPI InstanceGet Get /instance List instances
InstanceAPI InstanceIdDelete Delete /instance/{id} Delete an instance
InstanceAPI InstanceIdGet Get /instance/{id} Get instance by ID
InstanceAPI InstanceIdRebootPatch Patch /instance/{id}/reboot Reboot an instance
InstanceAPI InstanceIdSnapshotGet Get /instance/{id}/snapshot List instance snapshots
InstanceAPI InstanceIdSnapshotNameDelete Delete /instance/{id}/snapshot/{name} Delete a snapshot
InstanceAPI InstanceIdSnapshotNamePut Put /instance/{id}/snapshot/{name} Revert to snapshot
InstanceAPI InstanceIdSnapshotPut Put /instance/{id}/snapshot Snapshot an instance
InstanceAPI InstanceIdStartPatch Patch /instance/{id}/start Start an instance
InstanceAPI InstanceIdStopPatch Patch /instance/{id}/stop Stop an instance
InstanceAPI InstancePost Post /instance Add a new instance
LoadBalancerAPI LoadbalancerGet Get /loadbalancer List load balancers
LoadBalancerAPI LoadbalancerIdDelete Delete /loadbalancer/{id} Delete load balancer
LoadBalancerAPI LoadbalancerIdPut Put /loadbalancer/{id} Update load balancer targets
LoadBalancerAPI LoadbalancerPost Post /loadbalancer Create a load balancer
SshkeyAPI SshkeyGet Get /sshkey List SSH keys
SshkeyAPI SshkeyIdDelete Delete /sshkey/{id} Delete SSH key
SshkeyAPI SshkeyPost Post /sshkey Create SSH key
TagAPI TagIdGet Get /tag/{id} Get tags for a resource ID
TagAPI TagIdPatch Patch /tag/{id} Removes tags for a resource ID
TagAPI TagIdPut Put /tag/{id} Set tags for a resource ID
VPCAPI VpcGet Get /vpc List VPC
VPCAPI VpcIdDelete Delete /vpc/{id} Delete VPC
VPCAPI VpcIdPatch Patch /vpc/{id} Remove member from VPC
VPCAPI VpcIdPost Post /vpc/{id} Create a VPC
VPCAPI VpcIdPut Put /vpc/{id} Add member to VPC

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

bearerAuth

  • Type: HTTP Bearer token authentication

Example

auth := context.WithValue(context.Background(), openapi.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

Go client for the Entrywan API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages