v1

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2024 License: Apache-2.0 Imports: 23 Imported by: 3

README

Go API client for v1

Apache Flink job lifecycle management component for Confluent 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.0
  • Package version: 1.0.0
  • Build package: org.openapitools.codegen.languages.GoDeprecatedClientCodegen

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 "./v1"

Documentation for API Endpoints

All URIs are relative to http://localhost:8080/cmf/api/v1

Class Method HTTP request Description
DefaultApi CreateOrUpdateApplication Post /environments/{envName}/applications Creates a new Flink Application or updates an existing one in the given Environment.
DefaultApi CreateOrUpdateEnvironment Post /environments Create or update an Environment
DefaultApi DeleteApplication Delete /environments/{envName}/applications/{appName} Deletes an Application of the given name in the given Environment.
DefaultApi DeleteEnvironment Delete /environments/{envName}
DefaultApi GetApplication Get /environments/{envName}/applications/{appName} Retrieve an Application of the given name in the given Environment.
DefaultApi GetApplications Get /environments/{envName}/applications Retrieve a paginated list of all applications in the given Environment.
DefaultApi GetEnvironment Get /environments/{envName} Get/Describe an environment with the given name.
DefaultApi GetEnvironments Get /environments Retrieve a paginated list of all environments.
DefaultApi StartApplication Post /environments/{envName}/applications/{appName}/start Starts an earlier submitted Flink Application
DefaultApi SuspendApplication Post /environments/{envName}/applications/{appName}/suspend Suspends an earlier started Flink Application

Documentation For Models

Documentation For Authorization

Endpoints do not require authorization.

Author

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ContextOAuth2 takes an oauth2.TokenSource as authentication for the request.
	ContextOAuth2 = contextKey("token")

	// ContextBasicAuth takes BasicAuth as authentication for the request.
	ContextBasicAuth = contextKey("basic")

	// ContextAccessToken takes a string oauth2 access token as authentication for the request.
	ContextAccessToken = contextKey("accesstoken")

	// ContextAPIKey takes an APIKey as authentication for the request
	ContextAPIKey = contextKey("apikey")
)

Functions

func CacheExpires

func CacheExpires(r *http.Response) time.Time

CacheExpires helper function to determine remaining time before repeating a request.

Types

type APIClient

type APIClient struct {
	DefaultApi DefaultApi
	// contains filtered or unexported fields
}

APIClient manages communication with the Confluent Manager for Apache Flink / CMF API v1.0 In most cases there should be only one, shared, APIClient.

func NewAPIClient

func NewAPIClient(cfg *Configuration) *APIClient

NewAPIClient creates a new API client. Requires a userAgent string describing your application. optionally a custom http.Client to allow for advanced features such as caching.

func (*APIClient) ChangeBasePath

func (c *APIClient) ChangeBasePath(path string)

ChangeBasePath changes base path to allow switching to mocks

func (*APIClient) GetConfig

func (c *APIClient) GetConfig() *Configuration

Allow modification of underlying config for alternate implementations and testing Caution: modifying the configuration while live can cause data races and potentially unwanted behavior

type APIKey

type APIKey struct {
	Key    string
	Prefix string
}

APIKey provides API key based authentication to a request passed via context using ContextAPIKey

type APIResponse

type APIResponse struct {
	*http.Response `json:"-"`
	Message        string `json:"message,omitempty"`
	// Operation is the name of the OpenAPI operation.
	Operation string `json:"operation,omitempty"`
	// RequestURL is the request URL. This value is always available, even if the
	// embedded *http.Response is nil.
	RequestURL string `json:"url,omitempty"`
	// Method is the HTTP method used for the request.  This value is always
	// available, even if the embedded *http.Response is nil.
	Method string `json:"method,omitempty"`
	// Payload holds the contents of the response body (which may be nil or empty).
	// This is provided here as the raw response.Body() reader will have already
	// been drained.
	Payload []byte `json:"-"`
}

APIResponse stores the API response returned by the server.

func NewAPIResponse

func NewAPIResponse(r *http.Response) *APIResponse

NewAPIResponse returns a new APIResonse object.

func NewAPIResponseWithError

func NewAPIResponseWithError(errorMessage string) *APIResponse

NewAPIResponseWithError returns a new APIResponse object with the provided error message.

type Application

type Application struct {
	ApiVersion string                 `json:"apiVersion"`
	Kind       string                 `json:"kind"`
	Metadata   map[string]interface{} `json:"metadata"`
	Spec       map[string]interface{} `json:"spec"`
	Status     map[string]interface{} `json:"status,omitempty"`
}

Application Represents a Flink Application submitted by the user

type ApplicationPageMetadata

type ApplicationPageMetadata struct {
	Size int64 `json:"size,omitempty"`
}

ApplicationPageMetadata struct for ApplicationPageMetadata

type ApplicationsPage

type ApplicationsPage struct {
	Pageable Pageable                `json:"pageable,omitempty"`
	Metadata ApplicationPageMetadata `json:"metadata,omitempty"`
	Items    []Application           `json:"items,omitempty"`
}

ApplicationsPage struct for ApplicationsPage

type ApplicationsPageAllOf

type ApplicationsPageAllOf struct {
	Metadata ApplicationPageMetadata `json:"metadata,omitempty"`
	Items    []Application           `json:"items,omitempty"`
}

ApplicationsPageAllOf struct for ApplicationsPageAllOf

type BasicAuth

type BasicAuth struct {
	UserName string `json:"userName,omitempty"`
	Password string `json:"password,omitempty"`
}

BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth

type Configuration

type Configuration struct {
	BasePath      string            `json:"basePath,omitempty"`
	Host          string            `json:"host,omitempty"`
	Scheme        string            `json:"scheme,omitempty"`
	DefaultHeader map[string]string `json:"defaultHeader,omitempty"`
	UserAgent     string            `json:"userAgent,omitempty"`
	Debug         bool              `json:"debug,omitempty"`
	Servers       []ServerConfiguration
	HTTPClient    *http.Client
}

Configuration stores the configuration of the API client

func NewConfiguration

func NewConfiguration() *Configuration

NewConfiguration returns a new Configuration object

func (*Configuration) AddDefaultHeader

func (c *Configuration) AddDefaultHeader(key string, value string)

AddDefaultHeader adds a new HTTP header to the default header in the request

func (*Configuration) ServerUrl

func (c *Configuration) ServerUrl(index int, variables map[string]string) (string, error)

ServerUrl returns URL based on server settings

type DefaultApi

type DefaultApi interface {

	/*
	 * CreateOrUpdateApplication Creates a new Flink Application or updates an existing one in the given Environment.
	 *
	 * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
	 * @param envName Name of the Environment
	 * @param application
	 * @return Application
	 */
	CreateOrUpdateApplication(ctx _context.Context, envName string, application Application) (Application, *_nethttp.Response, error)

	/*
	 * CreateOrUpdateEnvironment Create or update an Environment
	 *
	 * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
	 * @param postEnvironment
	 * @return Environment
	 */
	CreateOrUpdateEnvironment(ctx _context.Context, postEnvironment PostEnvironment) (Environment, *_nethttp.Response, error)

	/*
	 * DeleteApplication Deletes an Application of the given name in the given Environment.
	 *
	 * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
	 * @param envName Name of the Environment
	 * @param appName Name of the Application
	 */
	DeleteApplication(ctx _context.Context, envName string, appName string) (*_nethttp.Response, error)

	/*
	 * DeleteEnvironment Method for DeleteEnvironment
	 *
	 * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
	 * @param envName Name of the Environment to be deleted.
	 */
	DeleteEnvironment(ctx _context.Context, envName string) (*_nethttp.Response, error)

	/*
	 * GetApplication Retrieve an Application of the given name in the given Environment.
	 *
	 * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
	 * @param envName Name of the Environment
	 * @param appName Name of the Application
	 * @return Application
	 */
	GetApplication(ctx _context.Context, envName string, appName string) (Application, *_nethttp.Response, error)

	/*
	 * GetApplications Retrieve a paginated list of all applications in the given Environment.
	 *
	 * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
	 * @param envName Name of the Environment
	 * @param optional nil or *GetApplicationsOpts - Optional Parameters:
	 * @param "Page" (optional.Int32) -  Zero-based page index (0..N)
	 * @param "Size" (optional.Int32) -  The size of the page to be returned
	 * @param "Sort" (optional.Interface of []string) -  Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
	 * @return ApplicationsPage
	 */
	GetApplications(ctx _context.Context, envName string, localVarOptionals *GetApplicationsOpts) (ApplicationsPage, *_nethttp.Response, error)

	/*
	 * GetEnvironment Get/Describe an environment with the given name.
	 *
	 * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
	 * @param envName Name of the Environment to be retrieved.
	 * @return Environment
	 */
	GetEnvironment(ctx _context.Context, envName string) (Environment, *_nethttp.Response, error)

	/*
	 * GetEnvironments Retrieve a paginated list of all environments.
	 *
	 * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
	 * @param optional nil or *GetEnvironmentsOpts - Optional Parameters:
	 * @param "Page" (optional.Int32) -  Zero-based page index (0..N)
	 * @param "Size" (optional.Int32) -  The size of the page to be returned
	 * @param "Sort" (optional.Interface of []string) -  Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
	 * @return EnvironmentsPage
	 */
	GetEnvironments(ctx _context.Context, localVarOptionals *GetEnvironmentsOpts) (EnvironmentsPage, *_nethttp.Response, error)

	/*
	 * StartApplication Starts an earlier submitted Flink Application
	 *
	 * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
	 * @param envName Name of the Environment
	 * @param appName Name of the Application
	 * @return Application
	 */
	StartApplication(ctx _context.Context, envName string, appName string) (Application, *_nethttp.Response, error)

	/*
	 * SuspendApplication Suspends an earlier started Flink Application
	 *
	 * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
	 * @param envName Name of the Environment
	 * @param appName Name of the Application
	 * @return Application
	 */
	SuspendApplication(ctx _context.Context, envName string, appName string) (Application, *_nethttp.Response, error)
}

type DefaultApiService

type DefaultApiService service

DefaultApiService DefaultApi service

func (*DefaultApiService) CreateOrUpdateApplication

func (a *DefaultApiService) CreateOrUpdateApplication(ctx _context.Context, envName string, application Application) (Application, *_nethttp.Response, error)

* CreateOrUpdateApplication Creates a new Flink Application or updates an existing one in the given Environment. * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param envName Name of the Environment * @param application * @return Application

func (*DefaultApiService) CreateOrUpdateEnvironment

func (a *DefaultApiService) CreateOrUpdateEnvironment(ctx _context.Context, postEnvironment PostEnvironment) (Environment, *_nethttp.Response, error)

* CreateOrUpdateEnvironment Create or update an Environment * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param postEnvironment * @return Environment

func (*DefaultApiService) DeleteApplication

func (a *DefaultApiService) DeleteApplication(ctx _context.Context, envName string, appName string) (*_nethttp.Response, error)

* DeleteApplication Deletes an Application of the given name in the given Environment. * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param envName Name of the Environment * @param appName Name of the Application

func (*DefaultApiService) DeleteEnvironment

func (a *DefaultApiService) DeleteEnvironment(ctx _context.Context, envName string) (*_nethttp.Response, error)

* DeleteEnvironment Method for DeleteEnvironment * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param envName Name of the Environment to be deleted.

func (*DefaultApiService) GetApplication

func (a *DefaultApiService) GetApplication(ctx _context.Context, envName string, appName string) (Application, *_nethttp.Response, error)

* GetApplication Retrieve an Application of the given name in the given Environment. * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param envName Name of the Environment * @param appName Name of the Application * @return Application

func (*DefaultApiService) GetApplications

func (a *DefaultApiService) GetApplications(ctx _context.Context, envName string, localVarOptionals *GetApplicationsOpts) (ApplicationsPage, *_nethttp.Response, error)

* GetApplications Retrieve a paginated list of all applications in the given Environment. * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param envName Name of the Environment * @param optional nil or *GetApplicationsOpts - Optional Parameters: * @param "Page" (optional.Int32) - Zero-based page index (0..N) * @param "Size" (optional.Int32) - The size of the page to be returned * @param "Sort" (optional.Interface of []string) - Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported. * @return ApplicationsPage

func (*DefaultApiService) GetEnvironment

func (a *DefaultApiService) GetEnvironment(ctx _context.Context, envName string) (Environment, *_nethttp.Response, error)

* GetEnvironment Get/Describe an environment with the given name. * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param envName Name of the Environment to be retrieved. * @return Environment

func (*DefaultApiService) GetEnvironments

func (a *DefaultApiService) GetEnvironments(ctx _context.Context, localVarOptionals *GetEnvironmentsOpts) (EnvironmentsPage, *_nethttp.Response, error)

* GetEnvironments Retrieve a paginated list of all environments. * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param optional nil or *GetEnvironmentsOpts - Optional Parameters: * @param "Page" (optional.Int32) - Zero-based page index (0..N) * @param "Size" (optional.Int32) - The size of the page to be returned * @param "Sort" (optional.Interface of []string) - Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported. * @return EnvironmentsPage

func (*DefaultApiService) StartApplication

func (a *DefaultApiService) StartApplication(ctx _context.Context, envName string, appName string) (Application, *_nethttp.Response, error)

* StartApplication Starts an earlier submitted Flink Application * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param envName Name of the Environment * @param appName Name of the Application * @return Application

func (*DefaultApiService) SuspendApplication

func (a *DefaultApiService) SuspendApplication(ctx _context.Context, envName string, appName string) (Application, *_nethttp.Response, error)

* SuspendApplication Suspends an earlier started Flink Application * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param envName Name of the Environment * @param appName Name of the Application * @return Application

type Environment

type Environment struct {
	// A unique name for the resource.
	Name                     string                 `json:"name"`
	CreatedTime              time.Time              `json:"created_time,omitempty"`
	UpdatedTime              time.Time              `json:"updated_time,omitempty"`
	FlinkApplicationDefaults map[string]interface{} `json:"flinkApplicationDefaults,omitempty"`
	KubernetesNamespace      string                 `json:"kubernetesNamespace"`
}

Environment Environment

type EnvironmentsPage

type EnvironmentsPage struct {
	Pageable Pageable                 `json:"pageable,omitempty"`
	Metadata EnvironmentsPageMetadata `json:"metadata,omitempty"`
	Items    []Environment            `json:"items,omitempty"`
}

EnvironmentsPage struct for EnvironmentsPage

type EnvironmentsPageAllOf

type EnvironmentsPageAllOf struct {
	Metadata EnvironmentsPageMetadata `json:"metadata,omitempty"`
	Items    []Environment            `json:"items,omitempty"`
}

EnvironmentsPageAllOf struct for EnvironmentsPageAllOf

type EnvironmentsPageMetadata

type EnvironmentsPageMetadata struct {
	Size int64 `json:"size,omitempty"`
}

EnvironmentsPageMetadata struct for EnvironmentsPageMetadata

type GenericOpenAPIError

type GenericOpenAPIError struct {
	// contains filtered or unexported fields
}

GenericOpenAPIError Provides access to the body, error and model on returned errors.

func (GenericOpenAPIError) Body

func (e GenericOpenAPIError) Body() []byte

Body returns the raw bytes of the response

func (GenericOpenAPIError) Error

func (e GenericOpenAPIError) Error() string

Error returns non-empty string if there was an error.

func (GenericOpenAPIError) Model

func (e GenericOpenAPIError) Model() interface{}

Model returns the unpacked model of the error

type GetApplicationsOpts

type GetApplicationsOpts struct {
	Page optional.Int32
	Size optional.Int32
	Sort optional.Interface
}

GetApplicationsOpts Optional parameters for the method 'GetApplications'

type GetEnvironmentsOpts

type GetEnvironmentsOpts struct {
	Page optional.Int32
	Size optional.Int32
	Sort optional.Interface
}

GetEnvironmentsOpts Optional parameters for the method 'GetEnvironments'

type GetResourceBase

type GetResourceBase struct {
	CreatedTime time.Time `json:"created_time,omitempty"`
	UpdatedTime time.Time `json:"updated_time,omitempty"`
}

GetResourceBase struct for GetResourceBase

type KubernetesNamespace

type KubernetesNamespace struct {
	KubernetesNamespace string `json:"kubernetesNamespace,omitempty"`
}

KubernetesNamespace struct for KubernetesNamespace

type ModelError

type ModelError struct {
	// An error message
	Message string `json:"message,omitempty"`
}

ModelError An error

type Pageable

type Pageable struct {
	Page int32 `json:"page,omitempty"`
	// The number of items in a page.
	Size int32 `json:"size,omitempty"`
	Sort Sort  `json:"sort,omitempty"`
}

Pageable struct for Pageable

type PaginationResponse

type PaginationResponse struct {
	Pageable Pageable `json:"pageable,omitempty"`
}

PaginationResponse struct for PaginationResponse

type PostEnvironment

type PostEnvironment struct {
	// A unique name for the resource.
	Name                     string                 `json:"name"`
	FlinkApplicationDefaults map[string]interface{} `json:"flinkApplicationDefaults,omitempty"`
	KubernetesNamespace      string                 `json:"kubernetesNamespace,omitempty"`
}

PostEnvironment Environment

type PostResourceBase

type PostResourceBase struct {
	// A unique name for the resource.
	Name string `json:"name,omitempty"`
}

PostResourceBase struct for PostResourceBase

type ResourceWithFlinkApplicationDefaults

type ResourceWithFlinkApplicationDefaults struct {
	FlinkApplicationDefaults map[string]interface{} `json:"flinkApplicationDefaults,omitempty"`
}

ResourceWithFlinkApplicationDefaults struct for ResourceWithFlinkApplicationDefaults

type RestError

type RestError struct {
	// List of all errors
	Errors []ModelError `json:"errors,omitempty"`
}

RestError The schema for all error responses.

type ServerConfiguration

type ServerConfiguration struct {
	Url         string
	Description string
	Variables   map[string]ServerVariable
}

ServerConfiguration stores the information about a server

type ServerVariable

type ServerVariable struct {
	Description  string
	DefaultValue string
	EnumValues   []string
}

ServerVariable stores the information about a server variable

type Sort

type Sort struct {
	// Whether the results are sorted.
	Sorted bool `json:"sorted,omitempty"`
	// Whether the results are unsorted.
	Unsorted bool `json:"unsorted,omitempty"`
	Empty    bool `json:"empty,omitempty"`
}

Sort struct for Sort

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL