# README
Go API client for webspaced
API for managing next-gen webspaces.
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.2.0
- 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/oauth2
go get golang.org/x/net/context
go get github.com/antihax/optional
Put the package under your project folder and add the following in import:
import "./webspaced"
Documentation for API Endpoints
All URIs are relative to https://webspaced.netsoc.ie/v1
Class | Method | HTTP request | Description |
---|---|---|---|
ConfigApi | Create | Post /webspace/{username} | Initialize webspace |
ConfigApi | Delete | Delete /webspace/{username} | Destroy webspace |
ConfigApi | Get | Get /webspace/{username} | Retrieve all webspace information |
ConfigApi | GetConfig | Get /webspace/{username}/config | Retrieve webspace configuration |
ConfigApi | UpdateConfig | Patch /webspace/{username}/config | Change webspace config options |
ConsoleApi | ClearLog | Delete /webspace/{username}/log | Clear webspace console log |
ConsoleApi | Console | Get /webspace/{username}/console | Attach to webspace console |
ConsoleApi | Exec | Post /webspace/{username}/exec | Execute command non-interactively |
ConsoleApi | ExecInteractive | Get /webspace/{username}/exec | Execute a command interactively |
ConsoleApi | GetLog | Get /webspace/{username}/log | Retrieve webspace console log |
DomainsApi | AddDomain | Post /webspace/{username}/domains/{domain} | Add custom domain |
DomainsApi | GetDomains | Get /webspace/{username}/domains | Retrieve webspace domains |
DomainsApi | RemoveDomain | Delete /webspace/{username}/domains/{domain} | Delete custom domain |
ImagesApi | GetImages | Get /images | List images |
PortsApi | AddPort | Post /webspace/{username}/ports/{ePort}/{iPort} | Add port forward |
PortsApi | AddRandomPort | Post /webspace/{username}/ports/{iPort} | Add random port forward |
PortsApi | GetPorts | Get /webspace/{username}/ports | Retrieve webspace port forwards |
PortsApi | RemovePort | Delete /webspace/{username}/ports/{ePort} | Delete port forward |
StateApi | GetState | Get /webspace/{username}/state | Retrieve webspace state |
StateApi | Reboot | Put /webspace/{username}/state | Reboot webspace container |
StateApi | Shutdown | Delete /webspace/{username}/state | Shut down webspace container |
StateApi | Start | Post /webspace/{username}/state | Start webspace container |
StateApi | Sync | Patch /webspace/{username}/state | Re-generate webspace backend config |
Documentation For Models
- AddRandomPortResponse
- Config
- Error
- ExecInteractiveControl
- ExecInteractiveRequest
- ExecRequest
- ExecResponse
- Image
- ImageAlias
- InitRequest
- InterfaceAddress
- InterfaceCounters
- NetworkInterface
- ResizeRequest
- State
- Usage
- Webspace
Documentation For Authorization
jwt
- Type: HTTP basic authentication
Example
auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{
UserName: "username",
Password: "password",
})
r, err := client.Service.Operation(auth, args)
jwt_admin
- Type: HTTP basic authentication
Example
auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{
UserName: "username",
Password: "password",
})
r, err := client.Service.Operation(auth, args)
Author
# Functions
CacheExpires helper function to determine remaining time before repeating a request.
NewAPIClient creates a new API client.
NewAPIResponse returns a new APIResonse object.
NewAPIResponseWithError returns a new APIResponse object with the provided error message.
NewConfiguration returns a new Configuration object.
# Variables
ContextAccessToken takes a string oauth2 access token as authentication for the request.
ContextAPIKey takes an APIKey as authentication for the request.
ContextBasicAuth takes BasicAuth as authentication for the request.
ContextOAuth2 takes an oauth2.TokenSource as authentication for the request.
# Structs
AddRandomPortResponse struct for AddRandomPortResponse.
APIClient manages communication with the Netsoc webspaced API v1.2.0 In most cases there should be only one, shared, APIClient.
APIKey provides API key based authentication to a request passed via context using ContextAPIKey.
APIResponse stores the API response returned by the server.
BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth.
Config Webspace configuration.
Configuration stores the configuration of the API client.
Error struct for Error.
ExecInteractiveControl struct for ExecInteractiveControl.
ExecInteractiveRequest struct for ExecInteractiveRequest.
ExecRequest struct for ExecRequest.
ExecResponse struct for ExecResponse.
GenericOpenAPIError Provides access to the body, error and model on returned errors.
Image LXD image (summarised version of https://linuxcontainers.org/lxd/docs/master/rest-api#10imagesfingerprint) .
ImageAlias LXD image alias.
InitRequest struct for InitRequest.
InterfaceAddress Network interface address.
InterfaceCounters Counters for a network interface.
NetworkInterface Webspace network interface status.
ResizeRequest struct for ResizeRequest.
ServerConfiguration stores the information about a server.
ServerVariable stores the information about a server variable.
State Webspace state.
Usage Website resource usage.
Webspace Netsoc webspace object.
# Type aliases
ConfigApiService ConfigApi service.
ConsoleApiService ConsoleApi service.
DomainsApiService DomainsApi service.
ImagesApiService ImagesApi service.
PortsApiService PortsApi service.
StateApiService StateApi service.