# README

Go API client for v1

REST API for managing connectors

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.

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

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 identified 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.confluent.cloud

ClassMethodHTTP requestDescription
ConnectorsConnectV1ApiCreateConnectv1ConnectorPost /connect/v1/environments/{environment_id}/clusters/{kafka_cluster_id}/connectorsCreate a Connector
ConnectorsConnectV1ApiCreateOrUpdateConnectv1ConnectorConfigPut /connect/v1/environments/{environment_id}/clusters/{kafka_cluster_id}/connectors/{connector_name}/configCreate or Update a Connector Configuration
ConnectorsConnectV1ApiDeleteConnectv1ConnectorDelete /connect/v1/environments/{environment_id}/clusters/{kafka_cluster_id}/connectors/{connector_name}Delete a Connector
ConnectorsConnectV1ApiGetConnectv1ConnectorConfigGet /connect/v1/environments/{environment_id}/clusters/{kafka_cluster_id}/connectors/{connector_name}/configRead a Connector Configuration
ConnectorsConnectV1ApiListConnectv1ConnectorsGet /connect/v1/environments/{environment_id}/clusters/{kafka_cluster_id}/connectorsList of Connectors
ConnectorsConnectV1ApiListConnectv1ConnectorsWithExpansionsGet /connect/v1/environments/{environment_id}/clusters/{kafka_cluster_id}/connectors?expand=info,status,idList of Connectors with Expansions
ConnectorsConnectV1ApiReadConnectv1ConnectorGet /connect/v1/environments/{environment_id}/clusters/{kafka_cluster_id}/connectors/{connector_name}Read a Connector
LifecycleConnectV1ApiPauseConnectv1ConnectorPut /connect/v1/environments/{environment_id}/clusters/{kafka_cluster_id}/connectors/{connector_name}/pausePause a Connector
LifecycleConnectV1ApiResumeConnectv1ConnectorPut /connect/v1/environments/{environment_id}/clusters/{kafka_cluster_id}/connectors/{connector_name}/resumeResume a Connector
ManagedConnectorPluginsConnectV1ApiListConnectv1ConnectorPluginsGet /connect/v1/environments/{environment_id}/clusters/{kafka_cluster_id}/connector-pluginsList of Managed Connector plugins
ManagedConnectorPluginsConnectV1ApiValidateConnectv1ConnectorPluginPut /connect/v1/environments/{environment_id}/clusters/{kafka_cluster_id}/connector-plugins/{plugin_name}/config/validateValidate a Managed Connector Plugin
OffsetsConnectV1ApiAlterConnectv1ConnectorOffsetsRequestPost /connect/v1/environments/{environment_id}/clusters/{kafka_cluster_id}/connectors/{connector_name}/offsets/requestRequest to Alter the Connector Offsets
OffsetsConnectV1ApiGetConnectv1ConnectorOffsetsGet /connect/v1/environments/{environment_id}/clusters/{kafka_cluster_id}/connectors/{connector_name}/offsetsGet a Connector Offsets
OffsetsConnectV1ApiGetConnectv1ConnectorOffsetsRequestStatusGet /connect/v1/environments/{environment_id}/clusters/{kafka_cluster_id}/connectors/{connector_name}/offsets/request/statusGet the Status of Altered Offset Request
StatusConnectV1ApiListConnectv1ConnectorTasksGet /connect/v1/environments/{environment_id}/clusters/{kafka_cluster_id}/connectors/{connector_name}/tasksList of Connector Tasks
StatusConnectV1ApiReadConnectv1ConnectorStatusGet /connect/v1/environments/{environment_id}/clusters/{kafka_cluster_id}/connectors/{connector_name}/statusRead a Connector Status

Documentation For Models

Documentation For Authorization

cloud-api-key

  • 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)

confluent-sts-access-token

  • Type: OAuth
  • Flow: application
  • Authorization URL:
  • Scopes: N/A

Example

auth := context.WithValue(context.Background(), sw.ContextAccessToken, "ACCESSTOKENSTRING")
r, err := client.Service.Operation(auth, args)

Or via OAuth2 module to automatically refresh tokens and perform user authentication.

import "golang.org/x/oauth2"

/* Perform OAuth2 round trip request and obtain a token */

tokenSource := oauth2cfg.TokenSource(createContext(httpClient), &token)
auth := context.WithValue(oauth2.NoContext, sw.ContextOAuth2, tokenSource)
r, err := client.Service.Operation(auth, args)

Documentation for Utility Methods

Due to the fact that model structure members are all pointers, this package contains a number of utility functions to easily obtain pointers to values of basic types. Each of these functions takes a value of the given basic type and returns a pointer to it:

  • PtrBool
  • PtrInt
  • PtrInt32
  • PtrInt64
  • PtrFloat
  • PtrFloat32
  • PtrFloat64
  • PtrString
  • PtrTime

Author

[email protected]

# Packages

No description provided by the author
No description provided by the author

# Functions

CacheExpires helper function to determine remaining time before repeating a request.
NewAPIClient creates a new API client.
NewAPIResponse returns a new APIResponse object.
NewAPIResponseWithError returns a new APIResponse object with the provided error message.
NewConfiguration returns a new Configuration object.
NewConnectV1AlterOffsetRequest instantiates a new ConnectV1AlterOffsetRequest object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewConnectV1AlterOffsetRequestInfo instantiates a new ConnectV1AlterOffsetRequestInfo object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewConnectV1AlterOffsetRequestInfoWithDefaults instantiates a new ConnectV1AlterOffsetRequestInfo object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewConnectV1AlterOffsetRequestTypeFromValue returns a pointer to a valid ConnectV1AlterOffsetRequestType for the value passed as argument, or an error if the value passed is not allowed by the enum.
NewConnectV1AlterOffsetRequestWithDefaults instantiates a new ConnectV1AlterOffsetRequest object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewConnectV1AlterOffsetStatus instantiates a new ConnectV1AlterOffsetStatus object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewConnectV1AlterOffsetStatusStatus instantiates a new ConnectV1AlterOffsetStatusStatus object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewConnectV1AlterOffsetStatusStatusWithDefaults instantiates a new ConnectV1AlterOffsetStatusStatus object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewConnectV1AlterOffsetStatusWithDefaults instantiates a new ConnectV1AlterOffsetStatus object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewConnectV1Connector instantiates a new ConnectV1Connector object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewConnectV1ConnectorError instantiates a new ConnectV1ConnectorError object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewConnectV1ConnectorErrorError instantiates a new ConnectV1ConnectorErrorError object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewConnectV1ConnectorErrorErrorWithDefaults instantiates a new ConnectV1ConnectorErrorError object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewConnectV1ConnectorErrorWithDefaults instantiates a new ConnectV1ConnectorError object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewConnectV1ConnectorExpansion instantiates a new ConnectV1ConnectorExpansion object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewConnectV1ConnectorExpansionId instantiates a new ConnectV1ConnectorExpansionId object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewConnectV1ConnectorExpansionIdWithDefaults instantiates a new ConnectV1ConnectorExpansionId object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewConnectV1ConnectorExpansionInfo instantiates a new ConnectV1ConnectorExpansionInfo object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewConnectV1ConnectorExpansionInfoWithDefaults instantiates a new ConnectV1ConnectorExpansionInfo object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewConnectV1ConnectorExpansionStatus instantiates a new ConnectV1ConnectorExpansionStatus object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewConnectV1ConnectorExpansionStatusConnector instantiates a new ConnectV1ConnectorExpansionStatusConnector object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewConnectV1ConnectorExpansionStatusConnectorWithDefaults instantiates a new ConnectV1ConnectorExpansionStatusConnector object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewConnectV1ConnectorExpansionStatusWithDefaults instantiates a new ConnectV1ConnectorExpansionStatus object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewConnectV1ConnectorExpansionWithDefaults instantiates a new ConnectV1ConnectorExpansion object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewConnectV1ConnectorOffsets instantiates a new ConnectV1ConnectorOffsets object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewConnectV1ConnectorOffsetsMetadata instantiates a new ConnectV1ConnectorOffsetsMetadata object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewConnectV1ConnectorOffsetsMetadataWithDefaults instantiates a new ConnectV1ConnectorOffsetsMetadata object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewConnectV1ConnectorOffsetsWithDefaults instantiates a new ConnectV1ConnectorOffsets object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewConnectV1ConnectorTasks instantiates a new ConnectV1ConnectorTasks object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewConnectV1ConnectorTasksWithDefaults instantiates a new ConnectV1ConnectorTasks object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewConnectV1ConnectorWithDefaults instantiates a new ConnectV1Connector object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewConnectV1ConnectorWithOffsets instantiates a new ConnectV1ConnectorWithOffsets object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewConnectV1ConnectorWithOffsetsWithDefaults instantiates a new ConnectV1ConnectorWithOffsets object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewInlineObject instantiates a new InlineObject object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewInlineObjectWithDefaults instantiates a new InlineObject object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewInlineResponse200 instantiates a new InlineResponse200 object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewInlineResponse2001 instantiates a new InlineResponse2001 object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewInlineResponse2001Connector instantiates a new InlineResponse2001Connector object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewInlineResponse2001ConnectorWithDefaults instantiates a new InlineResponse2001Connector object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewInlineResponse2001Tasks instantiates a new InlineResponse2001Tasks object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewInlineResponse2001TasksWithDefaults instantiates a new InlineResponse2001Tasks object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewInlineResponse2001WithDefaults instantiates a new InlineResponse2001 object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewInlineResponse2002 instantiates a new InlineResponse2002 object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewInlineResponse2002WithDefaults instantiates a new InlineResponse2002 object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewInlineResponse2003 instantiates a new InlineResponse2003 object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewInlineResponse2003Configs instantiates a new InlineResponse2003Configs object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewInlineResponse2003ConfigsWithDefaults instantiates a new InlineResponse2003Configs object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewInlineResponse2003Definition instantiates a new InlineResponse2003Definition object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewInlineResponse2003DefinitionWithDefaults instantiates a new InlineResponse2003Definition object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewInlineResponse2003Value instantiates a new InlineResponse2003Value object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewInlineResponse2003ValueWithDefaults instantiates a new InlineResponse2003Value object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewInlineResponse2003WithDefaults instantiates a new InlineResponse2003 object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewInlineResponse200WithDefaults instantiates a new InlineResponse200 object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewInlineResponse400 instantiates a new InlineResponse400 object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewInlineResponse400WithDefaults instantiates a new InlineResponse400 object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewInlineResponse500 instantiates a new InlineResponse500 object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewInlineResponse500WithDefaults instantiates a new InlineResponse500 object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
PtrBool is a helper routine that returns a pointer to given boolean value.
PtrFloat32 is a helper routine that returns a pointer to given float value.
PtrFloat64 is a helper routine that returns a pointer to given float value.
PtrInt is a helper routine that returns a pointer to given integer value.
PtrInt32 is a helper routine that returns a pointer to given integer value.
PtrInt64 is a helper routine that returns a pointer to given integer value.
PtrString is a helper routine that returns a pointer to given string value.
PtrTime is helper routine that returns a pointer to given Time value.

# Constants

List of connect.v1.AlterOffsetRequestType.
List of connect.v1.AlterOffsetRequestType.

# Variables

ContextAccessToken takes a string oauth2 access token as authentication for the request.
ContextAPIKeys takes a string apikey as authentication for the request.
ContextBasicAuth takes BasicAuth as authentication for the request.
ContextHttpSignatureAuth takes HttpSignatureAuth as authentication for the request.
ContextOAuth2 takes an oauth2.TokenSource as authentication for the request.
ContextOperationServerIndices uses a server configuration from the index mapping.
ContextOperationServerVariables overrides a server configuration variables using operation specific values.
ContextServerIndex uses a server configuration from the index.
ContextServerVariables overrides a server configuration variables.

# Structs

No description provided by the author
APIClient manages communication with the Kafka Connect APIs API v1.0 In most cases there should be only one, shared, APIClient.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
APIKey provides API key based authentication to a request passed via context using ContextAPIKey.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
APIResponse stores the API response returned by the server.
No description provided by the author
No description provided by the author
BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth.
Configuration stores the configuration of the API client.
ConnectV1AlterOffsetRequest Request to alter the offset of a connector.
ConnectV1AlterOffsetRequestInfo The request made to alter offsets.
ConnectV1AlterOffsetStatus Status of the alter offset operation.
ConnectV1AlterOffsetStatusStatus The response of the alter offsets operation.
ConnectV1Connector struct for ConnectV1Connector.
ConnectV1ConnectorError struct for ConnectV1ConnectorError.
ConnectV1ConnectorErrorError Connector Error with error code and message.
ConnectV1ConnectorExpansion Name of connector.
ConnectV1ConnectorExpansionId The ID of connector.
ConnectV1ConnectorExpansionInfo Metadata of the connector.
ConnectV1ConnectorExpansionStatus Status of the connector and its tasks.
ConnectV1ConnectorExpansionStatusConnector A map containing connector status.
ConnectV1ConnectorOffsets Offsets for a connector.
ConnectV1ConnectorOffsetsMetadata Metadata of the connector offset.
ConnectV1ConnectorTasks struct for ConnectV1ConnectorTasks.
ConnectV1ConnectorWithOffsets struct for ConnectV1ConnectorWithOffsets.
GenericOpenAPIError Provides access to the body, error and model on returned errors.
InlineObject struct for InlineObject.
InlineResponse200 struct for InlineResponse200.
InlineResponse2001 struct for InlineResponse2001.
InlineResponse2001Connector The map containing connector status.
InlineResponse2001Tasks struct for InlineResponse2001Tasks.
InlineResponse2002 struct for InlineResponse2002.
InlineResponse2003 struct for InlineResponse2003.
InlineResponse2003Configs struct for InlineResponse2003Configs.
InlineResponse2003Definition The definition for a config in the connector plugin, which includes the name, type, importance, etc.
InlineResponse2003Value The current value for a config, which includes the name, value, recommended values, etc.
InlineResponse400 struct for InlineResponse400.
InlineResponse500 struct for InlineResponse500.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ServerConfiguration stores the information about a server.
ServerVariable stores the information about a server variable.

# Interfaces

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Type aliases

ConnectorsConnectV1ApiService ConnectorsConnectV1Api service.
ConnectV1AlterOffsetRequestType The type of alter operation.
LifecycleConnectV1ApiService LifecycleConnectV1Api service.
ManagedConnectorPluginsConnectV1ApiService ManagedConnectorPluginsConnectV1Api service.
OffsetsConnectV1ApiService OffsetsConnectV1Api service.
ServerConfigurations stores multiple ServerConfiguration items.
StatusConnectV1ApiService StatusConnectV1Api service.