Categorygithub.com/mistio/mist-sdk-go
repositorypackage
0.1.0
Repository: https://github.com/mistio/mist-sdk-go.git
Documentation: pkg.go.dev

# README

Go API client for mist_sdk

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: 2.0.0
  • Package version: 0.0.1
  • 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 sw "./mist_sdk"

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

Documentation for API Endpoints

All URIs are relative to https://mist.io

ClassMethodHTTP requestDescription
CloudsApiAddCloudPost /api/v2/cloudsAdd cloud
CloudsApiGetCloudGet /api/v2/clouds/{cloud}Get cloud
CloudsApiListCloudsGet /api/v2/cloudsList clouds
CloudsApiRemoveCloudDelete /api/v2/clouds/{cloud}Remove cloud
ClustersApiCreateClusterPost /api/v2/clustersCreate cluster
ClustersApiDestroyClusterDelete /api/v2/clusters/{cluster}Destroy cluster
ClustersApiGetClusterGet /api/v2/clusters/{cluster}Get cluster
ClustersApiListClustersGet /api/v2/clustersList clusters
DatapointsApiGetDatapointsGet /api/v2/datapointsGet datapoints
ImagesApiGetImageGet /api/v2/images/{image}Get image
ImagesApiListImagesGet /api/v2/imagesList images
JobsApiGetJobGet /api/v2/jobs/{job_id}Get job
KeysApiAddKeyPost /api/v2/keysAdd key
KeysApiDeleteKeyDelete /api/v2/keys/{key}Delete key
KeysApiEditKeyPut /api/v2/keys/{key}Edit key
KeysApiGetKeyGet /api/v2/keys/{key}Get key
KeysApiListKeysGet /api/v2/keysList keys
LocationsApiGetLocationGet /api/v2/locations/{location}Get location
LocationsApiListLocationsGet /api/v2/locationsList locations
MachinesApiAssociateKeyPut /api/v2/machines/{machine}/actions/associate-keyAssociate a key with a machine
MachinesApiCloneMachinePost /api/v2/machines/{machine}/actions/cloneClone machine
MachinesApiConsolePost /api/v2/machines/{machine}/actions/consoleOpen console
MachinesApiDestroyMachinePost /api/v2/machines/{machine}/actions/destroyDestroy machine
MachinesApiDisassociateKeyDelete /api/v2/machines/{machine}/actions/disassociate-keyDisassociate a key from a machine
MachinesApiEditMachinePut /api/v2/machines/{machine}Edit machine
MachinesApiGetMachineGet /api/v2/machines/{machine}Get machine
MachinesApiListMachinesGet /api/v2/machinesList machines
MachinesApiRebootMachinePost /api/v2/machines/{machine}/actions/rebootReboot machine
MachinesApiRenameMachinePost /api/v2/machines/{machine}/actions/renameRename machine
MachinesApiResizeMachinePost /api/v2/machines/{machine}/actions/resizeResize machine
MachinesApiResumeMachinePost /api/v2/machines/{machine}/actions/resumeResume machine
MachinesApiSshPost /api/v2/machines/{machine}/actions/sshOpen secure shell
MachinesApiStartMachinePost /api/v2/machines/{machine}/actions/startStart machine
MachinesApiStopMachinePost /api/v2/machines/{machine}/actions/stopStop machine
MachinesApiSuspendMachinePost /api/v2/machines/{machine}/actions/suspendSuspend machine
MachinesApiUndefineMachinePost /api/v2/machines/{machine}/actions/undefineUndefine machine
NetworksApiCreateNetworkPost /api/v2/networksCreate network
NetworksApiDeleteNetworkDelete /api/v2/networks/{network}Delete network
NetworksApiEditNetworkPut /api/v2/networks/{network}Edit network
NetworksApiGetNetworkGet /api/v2/networks/{network}Get network
NetworksApiListNetworksGet /api/v2/networksList networks
OrgsApiGetMemberGet /api/v2/orgs/{org}/members/{member}Get Org
OrgsApiGetOrgGet /api/v2/orgs/{org}Get Org
OrgsApiListOrgMembersGet /api/v2/orgs/{org}/membersList org members
OrgsApiListOrgTeamsGet /api/v2/orgs/{org}/teamsList org teams
OrgsApiListOrgsGet /api/v2/orgsList orgs
RulesApiAddRulePost /api/v2/rulesAdd rule
RulesApiDeleteRuleDelete /api/v2/rules/{rule}Delete rule
RulesApiEditRulePost /api/v2/rules/{rule}Update rule
RulesApiGetRuleGet /api/v2/rules/{rule}Get rule
RulesApiListRulesGet /api/v2/rulesList rules
RulesApiRenameRulePatch /api/v2/rules/{rule}Rename rule
RulesApiToggleRulePut /api/v2/rules/{rule}Toggle rule
ScriptsApiAddScriptPost /api/v2/scriptsAdd script
ScriptsApiDeleteScriptDelete /api/v2/scripts/{script}Delete script
ScriptsApiDownloadScriptGet /api/v2/scripts/{script}/fileDownload script
ScriptsApiEditScriptPut /api/v2/scripts/{script}Edit script
ScriptsApiGenerateScriptUrlGet /api/v2/scripts/{script}/urlGenerate script url
ScriptsApiGetScriptGet /api/v2/scripts/{script}Get script
ScriptsApiListScriptsGet /api/v2/scriptsList scripts
ScriptsApiRunScriptPost /api/v2/scripts/{script}Run script
SizesApiGetSizeGet /api/v2/sizes/{size}Get size
SizesApiListSizesGet /api/v2/sizesList sizes
SnapshotsApiCreateSnapshotPost /api/v2/machines/{machine}/snapshotsCreate snapshot
SnapshotsApiListSnapshotsGet /api/v2/machines/{machine}/snapshotsList machine snapshots
SnapshotsApiRemoveSnapshotDelete /api/v2/machines/{machine}/snapshots/{snapshot}Remove snapshot
SnapshotsApiRevertToSnapshotPost /api/v2/machines/{machine}/snapshots/{snapshot}Revert to snapshot
UsersApiListUsersGet /api/v2/usersList users
VolumesApiCreateVolumePost /api/v2/volumesCreate volume
VolumesApiDeleteVolumeDelete /api/v2/volumes/{volume}Delete volume
VolumesApiEditVolumePut /api/v2/volumes/{volume}Edit volume
VolumesApiGetVolumeGet /api/v2/volumes/{volume}Get volume
VolumesApiListVolumesGet /api/v2/volumesList volumes
ZonesApiCreateZonePost /api/v2/zonesCreate zone
ZonesApiDeleteZoneDelete /api/v2/zones/{zone}Delete zone
ZonesApiEditZonePut /api/v2/zones/{zone}Edit zone
ZonesApiGetZoneGet /api/v2/zones/{zone}Get zone
ZonesApiListZonesGet /api/v2/zonesList zones

Documentation For Models

Documentation For Authorization

ApiKeyAuth

  • Type: API key
  • API key parameter name: Authorization
  • Location: HTTP header

Note, each API key must be added to a map of map[string]APIKey where the key is: Authorization and passed in as the auth context for each request.

CookieAuth

  • Type: API key
  • API key parameter name: session.id
  • Location:

Note, each API key must be added to a map of map[string]APIKey where the key is: session.id and passed in as the auth context for each request.

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]