Skip to content

bunnyshellosi/go-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

86 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go API client for sdk

Interact with Bunnyshell Platform

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: 1.1.0
  • Package version: 0.1.0
  • Build package: org.openapitools.codegen.languages.GoClientCodegen For more information, please visit https://www.bunnyshell.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 sdk "bunnyshell.com/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(), sdk.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(), sdk.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(), sdk.ContextOperationServerIndices, map[string]int{
	"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), sdk.ContextOperationServerVariables, map[string]map[string]string{
	"{classname}Service.{nickname}": {
		"port": "8443",
	},
})

Documentation for API Endpoints

All URIs are relative to https://api.environments.bunnyshell.com

Class Method HTTP request Description
AiSandboxAPI AiSandboxConvertDockerCompose Post /v1/convert/docker-compose Convert docker compose to bunnyshell.yaml.
ComponentAPI ComponentList Get /v1/components List service components matching any selected filters
ComponentAPI ComponentRemoteDevConfig Get /v1/components/{id}/remotedev/config Get remote dev config
ComponentAPI ComponentRemoteDevProfile Post /v1/components/{id}/remotedev/profile Parse, validate and interpolate the provided remoteDevProfile
ComponentAPI ComponentResources Get /v1/components/{id}/resources Get kubernetes resources
ComponentAPI ComponentSshCredentials Get /v1/components/{id}/ssh/credentials Get SSH credentials
ComponentAPI ComponentSshManageKeys Post /v1/components/{id}/ssh/manage-keys Manage SSH keys
ComponentAPI ComponentView Get /v1/components/{id} View a specific service component
ComponentEndpointAPI ComponentEndpointList Get /v1/components/endpoint List endpoints for service components matching any selected filters
ComponentEndpointAPI ComponentEndpointView Get /v1/components/{id}/endpoint View endpoints for a specific service component
ComponentGitAPI ComponentGitList Get /v1/components/gitinfo List git info for service components matching any selected filters
ComponentGitAPI ComponentGitView Get /v1/components/{id}/gitinfo View git info for a specific service component
EnvironItemAPI EnvironItemCreate Post /v1/environ_items Create a specific environment variable.
EnvironItemAPI EnvironItemDelete Delete /v1/environ_items/{id} Delete a specific environment variable.
EnvironItemAPI EnvironItemEdit Patch /v1/environ_items/{id} Edit a specific environment variable.
EnvironItemAPI EnvironItemList Get /v1/environ_items List environment variables matching any selected filters.
EnvironItemAPI EnvironItemView Get /v1/environ_items/{id} View a specific environment variable.
EnvironmentAPI EnvironmentClone Post /v1/environments/{id}/clone Clone an environment.
EnvironmentAPI EnvironmentCreate Post /v1/environments Creates a new environment.
EnvironmentAPI EnvironmentDefinition Get /v1/environments/{id}/definition View the bunnyshell manifest for the environment
EnvironmentAPI EnvironmentDelete Post /v1/environments/{id}/delete Delete a specific environment.
EnvironmentAPI EnvironmentDeploy Post /v1/environments/{id}/deploy Deploy an environment.
EnvironmentAPI EnvironmentEditBuildSettings Patch /v1/environments/{id}/build-settings Edit the build settings of an environment.
EnvironmentAPI EnvironmentEditComponents Put /v1/environments/{id}/components Edit the components of an environment.
EnvironmentAPI EnvironmentEditConfiguration Put /v1/environments/{id}/configuration Edit an environment.
EnvironmentAPI EnvironmentEditDrunnerSettings Patch /v1/environments/{id}/deployment-runner-settings Edit the deployment runner settings of an environment.
EnvironmentAPI EnvironmentEditSettings Put /v1/environments/{id}/settings Edit an environment.
EnvironmentAPI EnvironmentKubeConfig Get /v1/environments/{id}/kube-config Download Kubernetes Config File
EnvironmentAPI EnvironmentList Get /v1/environments List environments matching any selected filters.
EnvironmentAPI EnvironmentStart Post /v1/environments/{id}/start Start an environment.
EnvironmentAPI EnvironmentStop Post /v1/environments/{id}/stop Stop an environment.
EnvironmentAPI EnvironmentView Get /v1/environments/{id} View a specific environment.
EnvironmentVariableAPI EnvironmentVariableCreate Post /v1/environment_variables Create a specific environment variable.
EnvironmentVariableAPI EnvironmentVariableDelete Delete /v1/environment_variables/{id} Delete a specific environment variable.
EnvironmentVariableAPI EnvironmentVariableEdit Patch /v1/environment_variables/{id} Edit a specific environment variable.
EnvironmentVariableAPI EnvironmentVariableList Get /v1/environment_variables List environment variables matching any selected filters.
EnvironmentVariableAPI EnvironmentVariableView Get /v1/environment_variables/{id} View a specific environment variable.
EventAPI EventList Get /v1/events List events matching any selected filters.
EventAPI EventView Get /v1/events/{id} View a specific event.
KubernetesIntegrationAPI KubernetesIntegrationList Get /v1/kubernetes_integrations List Kubernetes integrations matching any selected filters.
KubernetesIntegrationAPI KubernetesIntegrationView Get /v1/kubernetes_integrations/{id} View a specific Kubernetes integration.
OrganizationAPI OrganizationList Get /v1/organizations List organization matching any selected filters.
OrganizationAPI OrganizationView Get /v1/organizations/{id} View a specific organization.
PipelineAPI PipelineList Get /v1/pipelines List pipelines matching any selected filters.
PipelineAPI PipelineView Get /v1/pipelines/{id} View a specific Pipeline.
ProjectAPI ProjectCreate Post /v1/projects Creates new project.
ProjectAPI ProjectDelete Delete /v1/projects/{id} Delete a specific project.
ProjectAPI ProjectEditBuildSettings Patch /v1/projects/{id}/build-settings Edit the build settings of a project.
ProjectAPI ProjectEditDrunnerSettings Patch /v1/projects/{id}/deployment-runner-settings Edit the deploymentRunner settings of a project.
ProjectAPI ProjectEditSettings Patch /v1/projects/{id}/settings Edit a project.
ProjectAPI ProjectList Get /v1/projects List projects matching any selected filters.
ProjectAPI ProjectView Get /v1/projects/{id} View a specific project.
ProjectVariableAPI ProjectVariableCreate Post /v1/project_variables Create a specific project variable.
ProjectVariableAPI ProjectVariableDelete Delete /v1/project_variables/{id} Delete a specific project variable.
ProjectVariableAPI ProjectVariableEdit Patch /v1/project_variables/{id} Edit a specific project variable.
ProjectVariableAPI ProjectVariableList Get /v1/project_variables List project variables matching any selected filters.
ProjectVariableAPI ProjectVariableView Get /v1/project_variables/{id} View a specific project variable.
RegistryIntegrationAPI RegistryIntegrationList Get /v1/registry_integrations List Registry integrations matching any selected filters.
RegistryIntegrationAPI RegistryIntegrationView Get /v1/registry_integrations/{id} View a specific Registry integration.
SecretAPI SecretDecrypt Post /v1/secrets/decrypt Decrypt a cipher text.
SecretAPI SecretEncrypt Post /v1/secrets/encrypt Encrypt a plain text.
SecretAPI SecretTranscryptConfiguration Post /v1/secrets/transcrypt-configuration Encrypt or decrypt secrets from an environment configuration.
ServiceComponentVariableAPI ServiceComponentVariableCreate Post /v1/service_component_variables Create a specific component variable.
ServiceComponentVariableAPI ServiceComponentVariableDelete Delete /v1/service_component_variables/{id} Delete a specific component variable.
ServiceComponentVariableAPI ServiceComponentVariableEdit Patch /v1/service_component_variables/{id} Edit a specific component variable.
ServiceComponentVariableAPI ServiceComponentVariableList Get /v1/service_component_variables List component variables matching any selected filters.
ServiceComponentVariableAPI ServiceComponentVariableView Get /v1/service_component_variables/{id} View a specific component variable.
SshAPI SshConfig Post /v1/ssh/credentials Get SSH config for given SSH domain.
TemplateAPI TemplateDefinition Get /v1/templates/{id}/definition View the environment definition.
TemplateAPI TemplateList Get /v1/templates List templates matching any selected filters.
TemplateAPI TemplateValidate Post /v1/templates/validate Validates a given template from an external source.
TemplateAPI TemplateView Get /v1/templates/{id} View a specific template.
TemplatesRepositoryAPI TemplatesRepositoryList Get /v1/templates_repositories List templates repositories matching any selected filters.
TemplatesRepositoryAPI TemplatesRepositoryView Get /v1/templates_repositories/{id} View a specific templates repository.
WorkflowAPI WorkflowList Get /v1/workflows List workflows matching any selected filters.
WorkflowAPI WorkflowView Get /v1/workflows/{id} View a specific Workflow.

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

ApiKeyAuth

  • Type: API key
  • API key parameter name: X-Auth-Token
  • Location: HTTP header

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

Example

auth := context.WithValue(
		context.Background(),
		sw.ContextAPIKeys,
		map[string]sw.APIKey{
			"X-Auth-Token": {Key: "API_KEY_STRING"},
		},
	)
r, err := client.Service.Operation(auth, args)

JWT

  • 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.

Example

auth := context.WithValue(
		context.Background(),
		sw.ContextAPIKeys,
		map[string]sw.APIKey{
			"Authorization": {Key: "API_KEY_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

osi+support@bunnyshell.com

About

The official GO SDK for the Bunnyshell API.

Topics

Resources

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •  

Languages