package
1.0.0
Repository: https://github.com/sdslabs/gctl.git
Documentation: pkg.go.dev

# Packages

No description provided by the author

# 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

ClassMethodHTTP requestDescription
AppsAPICreateAppPost /apps/{language}Create an application
AppsAPIDeleteAppByUserDelete /apps/{app}Delete an application owned by a user
AppsAPIFetchAppByUserGet /apps/{app}Fetch a single application owned by a user
AppsAPIFetchAppsByUserGet /appsFetch all applications owned by a user
AppsAPIFetchLogsByUserGet /apps/{app}/logsFetch logs of an application
AppsAPIFetchMetricsByUserGet /apps/{app}/metricsFetch metrics of an application
AppsAPIRebuildAppByUserPatch /apps/{app}/rebuildRebuild an application
AppsAPIUpdateAppByUserPut /apps/{app}Update an application owned by a user
AuthAPIRefreshGet /auth/refreshRefresh JWT token using existing token
DbsAPICreateDBPost /dbs/{databaseType}Create a database
DbsAPIDeleteDbByUserDelete /dbs/{db}Delete a single database owned by a user
DbsAPIFetchDbByUserGet /dbs/{db}Fetch a single database owned by a user
DbsAPIFetchDbsByUserGet /dbsFetch all databases owned by a user
InstancesAPIFetchIntancesByUserGet /instancesFetch all instances owned by a user

Documentation For Models

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)

Author

[email protected]