openapi

package module
v0.12.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 25, 2021 License: Apache-2.0 Imports: 22 Imported by: 3

README ΒΆ

Go API client for openapi

Rockset's REST API allows for creating and managing all resources in Rockset. Each supported endpoint is documented below.

All requests must be authorized with a Rockset API key, which can be created in the Rockset console. The API key must be provided as ApiKey <api_key> in the Authorization request header. For example:

Authorization: ApiKey aB35kDjg93J5nsf4GjwMeErAVd832F7ad4vhsW1S02kfZiab42sTsfW5Sxt25asT

All endpoints are only accessible via https.

Build something awesome!

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: v1
  • Package version: 0.11.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

Put the package under your project folder and add the following in import:

import sw "./openapi"

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://api.rs2.usw2.rockset.com

Class Method HTTP request Description
APIKeysApi CreateApiKey Post /v1/orgs/self/users/self/apikeys Create API Key
APIKeysApi DeleteApiKey Delete /v1/orgs/self/users/self/apikeys/{name} Delete API Key
APIKeysApi DeleteApiKeyAdmin Delete /v1/orgs/self/users/{user}/apikeys/{name} Delete API Key (any user)
APIKeysApi GetApiKey Get /v1/orgs/self/users/self/apikeys/{name} Get API Key
APIKeysApi GetApiKeyAdmin Get /v1/orgs/self/users/{user}/apikeys/{name} Get any API Key
APIKeysApi ListApiKeys Get /v1/orgs/self/users/self/apikeys List API Keys
APIKeysApi ListApiKeysAdmin Get /v1/orgs/self/users/{user}/apikeys List API Keys (any user)
AliasesApi CreateAlias Post /v1/orgs/self/ws/{workspace}/aliases Create Alias
AliasesApi DeleteAlias Delete /v1/orgs/self/ws/{workspace}/aliases/{alias} Delete Alias
AliasesApi GetAlias Get /v1/orgs/self/ws/{workspace}/aliases/{alias} Get Alias
AliasesApi ListAliases Get /v1/orgs/self/aliases List Aliases
AliasesApi ListQueryLambdasWithAlias Get /v1/orgs/self/ws/{workspace}/aliases/{alias}/lambdas Get Query Lambdas with Alias
AliasesApi UpdateAlias Post /v1/orgs/self/ws/{workspace}/aliases/{alias} Update Alias
AliasesApi WorkspaceAliases Get /v1/orgs/self/ws/{workspace}/aliases List Aliases for Workspace
CollectionsApi CreateCollection Post /v1/orgs/self/ws/{workspace}/collections Create Collection
CollectionsApi DeleteCollection Delete /v1/orgs/self/ws/{workspace}/collections/{collection} Delete Collection
CollectionsApi GetCollection Get /v1/orgs/self/ws/{workspace}/collections/{collection} Get Collection
CollectionsApi ListAliasesForCollection Get /v1/orgs/self/ws/{workspace}/collections/{collection}/aliases Get Aliases for Collection
CollectionsApi ListCollections Get /v1/orgs/self/collections List Collections
CollectionsApi ListQueryLambdasInCollection Get /v1/orgs/self/ws/{workspace}/collections/{collection}/lambdas Get Query Lambdas for Collection
CollectionsApi WorkspaceCollections Get /v1/orgs/self/ws/{workspace}/collections List Collections for Workspace
DocumentsApi AddDocuments Post /v1/orgs/self/ws/{workspace}/collections/{collection}/docs Add Documents
DocumentsApi DeleteDocuments Delete /v1/orgs/self/ws/{workspace}/collections/{collection}/docs Delete Documents
DocumentsApi PatchDocuments Patch /v1/orgs/self/ws/{workspace}/collections/{collection}/docs Patch Documents
IPAllowlistApi CreateAllowlistIp Post /v1/orgs/self/ip/allowlist Create IP Allowlist Network Policy
IPAllowlistApi DeleteAllowlistIp Delete /v1/orgs/self/ip/allowlist/{name} Delete IP Allowlist Network Policy
IPAllowlistApi GetAllowlistIp Get /v1/orgs/self/ip/allowlist/{name} Get IP Allowlist Network Policy
IPAllowlistApi ListAllowlistIps Get /v1/orgs/self/ip/allowlist List IP Allowlist Entries
IntegrationsApi CreateIntegration Post /v1/orgs/self/integrations Create Integration
IntegrationsApi DeleteIntegration Delete /v1/orgs/self/integrations/{integration} Delete Integration
IntegrationsApi GetIntegration Get /v1/orgs/self/integrations/{integration} Get Integration
IntegrationsApi ListIntegrations Get /v1/orgs/self/integrations List Integrations
OrganizationsApi GetOrganization Get /v1/orgs/self Get Organization
QueriesApi Query Post /v1/orgs/self/queries Query
QueriesApi Validate Post /v1/orgs/self/queries/validations Validate Query
QueryLambdasApi CreateQueryLambda Post /v1/orgs/self/ws/{workspace}/lambdas Create Query Lambda
QueryLambdasApi CreateQueryLambdaTag Post /v1/orgs/self/ws/{workspace}/lambdas/{queryLambda}/tags Create Query Lambda Tag
QueryLambdasApi DeleteQueryLambda Delete /v1/orgs/self/ws/{workspace}/lambdas/{queryLambda} Delete Query Lambda
QueryLambdasApi DeleteQueryLambdaTag Delete /v1/orgs/self/ws/{workspace}/lambdas/{queryLambda}/tags/{tag} Delete Query Lambda Tag Version
QueryLambdasApi DeleteQueryLambdaVersion Delete /v1/orgs/self/ws/{workspace}/lambdas/{queryLambda}/version/{version} Delete Query Lambda Version
QueryLambdasApi ExecuteQueryLambda Post /v1/orgs/self/ws/{workspace}/lambdas/{queryLambda}/versions/{version} Execute Query Lambda
QueryLambdasApi ExecuteQueryLambdaByTag Post /v1/orgs/self/ws/{workspace}/lambdas/{queryLambda}/tags/{tag} Execute Query Lambda By Tag
QueryLambdasApi GetQueryLambdaTagVersion Get /v1/orgs/self/ws/{workspace}/lambdas/{queryLambda}/tags/{tag} Get Query Lambda Tag
QueryLambdasApi GetQueryLambdaVersion Get /v1/orgs/self/ws/{workspace}/lambdas/{queryLambda}/versions/{version} Get Query Lambda Version
QueryLambdasApi ListAllQueryLambdas Get /v1/orgs/self/lambdas List Query Lambdas
QueryLambdasApi ListOrganizationTags Get /v1/orgs/self/lambdas/tags List All Query Lambda Tags
QueryLambdasApi ListQueryLambdaTagVersions Get /v1/orgs/self/lambdas/tags/{tag} List Query Lambda Tag Versions
QueryLambdasApi ListQueryLambdaTags Get /v1/orgs/self/ws/{workspace}/lambdas/{queryLambda}/tags List Query Lambda Tags
QueryLambdasApi ListQueryLambdaVersions Get /v1/orgs/self/ws/{workspace}/lambdas/{queryLambda}/versions List Query Lambda Versions
QueryLambdasApi ListQueryLambdasInWorkspace Get /v1/orgs/self/ws/{workspace}/lambdas List Query Lambdas in Workspace
QueryLambdasApi UpdateQueryLambda Post /v1/orgs/self/ws/{workspace}/lambdas/{queryLambda}/versions Update Query Lambda
UsersApi CreateUser Post /v1/orgs/self/users Create User
UsersApi DeleteUser Delete /v1/orgs/self/users/{user} Delete User
UsersApi GetCurrentUser Get /v1/orgs/self/users/self Get Current User
UsersApi ListUsers Get /v1/orgs/self/users List Users
VirtualInstancesApi GetVirtualInstance Get /v1/orgs/self/virtualinstances/{virtualInstanceId} Get Virtual Instance
VirtualInstancesApi ListVirtualInstances Get /v1/orgs/self/virtualinstances List Virtual Instances
VirtualInstancesApi SetVirtualInstance Post /v1/orgs/self/virtualinstances/{virtualInstanceId} Update Virtual Instance
WorkspacesApi ChildWorkspaces Get /v1/orgs/self/ws/{workspace}/ws List Workspaces in Workspace
WorkspacesApi CreateWorkspace Post /v1/orgs/self/ws Create Workspace
WorkspacesApi DeleteWorkspace Delete /v1/orgs/self/ws/{workspace} Delete Workspace
WorkspacesApi GetWorkspace Get /v1/orgs/self/ws/{workspace} Get Workspace
WorkspacesApi ListWorkspaces Get /v1/orgs/self/ws List Workspaces

Documentation For Models