# README
Go API client for openapi
Handles authentication, creation/management of applications, databases, users and also provides a superuser API.
Only a superuser can avail the superuser API. A superuser can grant/revoke superuser privileges to other users. A default superuser is created every time a Gasper instance is launched whose credentials are defined in the admin
section of config.toml
, the main configuration file. A sample configuration file is available here.
Note:- Normally the applications and databases can only be managed by their owners but the superuser can bypass that check.
PS:- If you want to programmatically generate a client for this API, you can find the corresponding OpenAPI specifications here. We recommend using OpenAPI-Generator for generating clients.
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.0
- Package version: 1.0.0
- Build package: org.openapitools.codegen.languages.GoClientCodegen For more information, please visit https://chat.sdslabs.co
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 "./openapi"
Documentation for API Endpoints
All URIs are relative to http://localhost:3000
Class | Method | HTTP request | Description |
---|---|---|---|
AppsAPI | CreateApp | Post /apps/{language} | Create an application |
AppsAPI | DeleteAppByUser | Delete /apps/{app} | Delete an application owned by a user |
AppsAPI | FetchAppByUser | Get /apps/{app} | Fetch a single application owned by a user |
AppsAPI | FetchAppsByUser | Get /apps | Fetch all applications owned by a user |
AppsAPI | FetchLogsByUser | Get /apps/{app}/logs | Fetch logs of an application |
AppsAPI | FetchMetricsByUser | Get /apps/{app}/metrics | Fetch metrics of an application |
AppsAPI | RebuildAppByUser | Patch /apps/{app}/rebuild | Rebuild an application |
AppsAPI | UpdateAppByUser | Put /apps/{app} | Update an application owned by a user |
AuthAPI | Refresh | Get /auth/refresh | Refresh JWT token using existing token |
DbsAPI | CreateDB | Post /dbs/{databaseType} | Create a database |
DbsAPI | DeleteDbByUser | Delete /dbs/{db} | Delete a single database owned by a user |
DbsAPI | FetchDbByUser | Get /dbs/{db} | Fetch a single database owned by a user |
DbsAPI | FetchDbsByUser | Get /dbs | Fetch all databases owned by a user |
InstancesAPI | FetchIntancesByUser | Get /instances | Fetch all instances owned by a user |
Documentation For Models
- Application
- ApplicationResources
- Context
- CreatedApplication
- CreatedDatabase
- Database
- Git
- InlineObject
- InlineResponse2001
- InlineResponse2002
- InlineResponse2003
- InlineResponse2005
- InlineResponse2006
- InlineResponse2007
- InlineResponse400
- InlineResponse401
- InlineResponse500
- Instances
- LoginResponse
- Metrics
Documentation For Authorization
bearerAuth
- 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)