goPinotAPI

package module
v0.7.7 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2025 License: MIT Imports: 12 Imported by: 0

README

Contributors Forks Stargazers Issues MIT License LinkedIn API Coverage Codacy Badge Codacy Badge Go Report Card


go-pinot-api

A Go Library for interacting with the Apache Pinot Controller
Explore the docs »

Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgments

About The Project

A library for interacting with Apache Pinot Controllers via the Controller REST API.

(back to top)

Built With

  • Go

(back to top)

Getting Started

Installation

go get github.com/azaurus1/go-pinot-api

(back to top)

Usage

Creating a user:

user := pinotModel.User{
  Username:  "user",
  Password:  "password",
  Component: "BROKER",
  Role:      "admin",
}

userBytes, err := json.Marshal(user)
if err != nil {
  log.Panic(err)
}

// Create User
createResp, err := client.CreateUser(userBytes)
if err != nil {
  log.Panic(err)
}

Creating a schema:

f, err := os.Open(schemaFilePath)
if err != nil {
  log.Panic(err)
}

defer f.Close()

var schema pinotModel.Schema
err = json.NewDecoder(f).Decode(schema)
if err != nil {
  log.Panic(err)
}

_, err = client.CreateSchema(schema)
if err != nil {
	log.Panic(err)
}

For more examples, please refer to the Documentation

(back to top)

Roadmap

  • User Management
  • Schema Management
  • Table Management
  • Segment Management
  • Tenant Management
  • Cluster Management
  • Instance Management
  • Task Management

See the open issues for a full list of proposed features (and known issues).

(back to top)

Contributing

See the Contributing Guide

(back to top)

License

Distributed under the MIT License. See LICENSE for more information.

(back to top)

Contact

Liam Aikin - liamaikin@gmail.com

Project Link: https://github.com/azaurus1/go-pinot-api

(back to top)

Acknowledgments:

Many thanks to:

(back to top)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Opt

type Opt interface {
	Type() string
	// contains filtered or unexported methods
}

func AuthToken

func AuthToken(token string) Opt

func AuthType

func AuthType(authType string) Opt

func ControllerUrl

func ControllerUrl(pinotControllerUrl string) Opt

func Logger

func Logger(logger *slog.Logger) Opt

type PinotAPIClient

type PinotAPIClient struct {
	Host string
	// contains filtered or unexported fields
}

func NewPinotAPIClient

func NewPinotAPIClient(opts ...Opt) *PinotAPIClient

func (*PinotAPIClient) ChangeTableState

func (c *PinotAPIClient) ChangeTableState(tableName string, tableType string, state string) (*model.UserActionResponse, error)

func (*PinotAPIClient) CheckPinotControllerAdminHealth

func (c *PinotAPIClient) CheckPinotControllerAdminHealth() (*model.PlainTextAPIResponse, error)

func (*PinotAPIClient) CheckPinotControllerHealth

func (c *PinotAPIClient) CheckPinotControllerHealth() (*model.PlainTextAPIResponse, error)

func (*PinotAPIClient) CreateFormDataObject

func (c *PinotAPIClient) CreateFormDataObject(endpoint string, body []byte, result any) error

func (*PinotAPIClient) CreateInstance

func (c *PinotAPIClient) CreateInstance(body []byte) (*model.UserActionResponse, error)

func (*PinotAPIClient) CreateObject

func (c *PinotAPIClient) CreateObject(endpoint string, body []byte, result any) error

func (*PinotAPIClient) CreateSchema

func (c *PinotAPIClient) CreateSchema(schema model.Schema) (*model.UserActionResponse, error)

CreateSchema creates a new schema. if it already exists, it will nothing will happen

func (*PinotAPIClient) CreateSchemaFromBytes

func (c *PinotAPIClient) CreateSchemaFromBytes(schemaBytes []byte) (*model.CreateSchemaResponse, error)

func (*PinotAPIClient) CreateSchemaFromFile

func (c *PinotAPIClient) CreateSchemaFromFile(schemaFilePath string) (*model.UserActionResponse, error)

CreateSchemaFromFile creates a new schema from a file and uses CreateSchema

func (*PinotAPIClient) CreateTable

func (c *PinotAPIClient) CreateTable(body []byte) (*model.CreateTablesResponse, error)

func (*PinotAPIClient) CreateTableFromFile

func (c *PinotAPIClient) CreateTableFromFile(tableConfigFile string) (*model.CreateTablesResponse, error)

func (*PinotAPIClient) CreateTenant

func (c *PinotAPIClient) CreateTenant(body []byte) (*model.UserActionResponse, error)

func (*PinotAPIClient) CreateUser

func (c *PinotAPIClient) CreateUser(body []byte) (*model.UserActionResponse, error)

func (*PinotAPIClient) DeleteClusterConfig

func (c *PinotAPIClient) DeleteClusterConfig(configName string) (*model.UserActionResponse, error)

func (*PinotAPIClient) DeleteInstance

func (c *PinotAPIClient) DeleteInstance(instanceName string) (*model.UserActionResponse, error)

func (*PinotAPIClient) DeleteObject

func (c *PinotAPIClient) DeleteObject(endpoint string, queryParams map[string]string, result any) error

func (*PinotAPIClient) DeleteSchema

func (c *PinotAPIClient) DeleteSchema(schemaName string) (*model.UserActionResponse, error)

func (*PinotAPIClient) DeleteTable

func (c *PinotAPIClient) DeleteTable(tableName string) (*model.UserActionResponse, error)

func (*PinotAPIClient) DeleteTenant

func (c *PinotAPIClient) DeleteTenant(tenantName string, tenantType string) (*model.UserActionResponse, error)

func (*PinotAPIClient) DeleteUser

func (c *PinotAPIClient) DeleteUser(username string, component string) (*model.UserActionResponse, error)

func (*PinotAPIClient) FetchData

func (c *PinotAPIClient) FetchData(endpoint string, result any) error

func (*PinotAPIClient) FetchPlainText

func (c *PinotAPIClient) FetchPlainText(endpoint string, result *model.PlainTextAPIResponse) error

func (*PinotAPIClient) GetAllTableLiveBrokers

func (c *PinotAPIClient) GetAllTableLiveBrokers() (*model.GetLiveBrokersResponse, error)

func (*PinotAPIClient) GetClusterConfigs

func (c *PinotAPIClient) GetClusterConfigs() (*model.GetClusterConfigResponse, error)

func (*PinotAPIClient) GetClusterInfo

func (c *PinotAPIClient) GetClusterInfo() (*model.GetClusterResponse, error)

func (*PinotAPIClient) GetInstance

func (c *PinotAPIClient) GetInstance(instanceName string) (*model.GetInstanceResponse, error)

func (*PinotAPIClient) GetInstances

func (c *PinotAPIClient) GetInstances() (*model.GetInstancesResponse, error)

Instances

func (*PinotAPIClient) GetSchema

func (c *PinotAPIClient) GetSchema(schemaName string) (*model.Schema, error)

GetSchema returns a schema

func (*PinotAPIClient) GetSchemaFieldSpecs

func (c *PinotAPIClient) GetSchemaFieldSpecs() (*model.GetSchemaFieldSpecsResponse, error)

func (*PinotAPIClient) GetSchemas

func (c *PinotAPIClient) GetSchemas() (*model.GetSchemaResponse, error)

GetSchemas returns a list of schemas

func (*PinotAPIClient) GetSegmentCRC

func (c *PinotAPIClient) GetSegmentCRC(tableName string) (*model.GetSegmentCRCResponse, error)

func (*PinotAPIClient) GetSegmentMetadata

func (c *PinotAPIClient) GetSegmentMetadata(tableName string) (*model.GetSegmentMetadataResponse, error)

func (*PinotAPIClient) GetSegmentTiers

func (c *PinotAPIClient) GetSegmentTiers(tableName string, tableType string) (*model.GetSegmentTiersResponse, error)

func (*PinotAPIClient) GetSegmentZKMetadata

func (c *PinotAPIClient) GetSegmentZKMetadata(tableName string) (*model.GetSegmentZKMetadataResponse, error)

func (*PinotAPIClient) GetSegments

func (c *PinotAPIClient) GetSegments(tableName string) (model.GetSegmentsResponse, error)

func (*PinotAPIClient) GetTable

func (c *PinotAPIClient) GetTable(tableName string) (*model.GetTableResponse, error)

func (*PinotAPIClient) GetTableExternalView

func (c *PinotAPIClient) GetTableExternalView(tableName string) (*model.GetTableExternalViewResponse, error)

func (*PinotAPIClient) GetTableIdealState

func (c *PinotAPIClient) GetTableIdealState(tableName string) (*model.GetTableIdealStateResponse, error)

func (*PinotAPIClient) GetTableIndexes

func (c *PinotAPIClient) GetTableIndexes(tableName string) (*model.GetTableIndexesResponse, error)

func (*PinotAPIClient) GetTableInstances

func (c *PinotAPIClient) GetTableInstances(tableName string) (*model.GetTableInstancesResponse, error)

func (*PinotAPIClient) GetTableLiveBrokers

func (c *PinotAPIClient) GetTableLiveBrokers(tableName string) (*[]string, error)

func (*PinotAPIClient) GetTableMetadata

func (c *PinotAPIClient) GetTableMetadata(tableName string) (*model.GetTableMetadataResponse, error)

func (*PinotAPIClient) GetTableSchema

func (c *PinotAPIClient) GetTableSchema(tableName string) (*model.Schema, error)

func (*PinotAPIClient) GetTableSize

func (c *PinotAPIClient) GetTableSize(tableName string) (*model.GetTableSizeResponse, error)

func (*PinotAPIClient) GetTableState

func (c *PinotAPIClient) GetTableState(tableName string, tableType string) (*model.GetTableStateResponse, error)

func (*PinotAPIClient) GetTableStats

func (c *PinotAPIClient) GetTableStats(tableName string) (*model.GetTableStatsResponse, error)

func (*PinotAPIClient) GetTables

func (c *PinotAPIClient) GetTables() (*model.GetTablesResponse, error)

func (*PinotAPIClient) GetTenantInstances

func (c *PinotAPIClient) GetTenantInstances(tenantName string) (*model.GetTenantResponse, error)

func (*PinotAPIClient) GetTenantMetadata

func (c *PinotAPIClient) GetTenantMetadata(tenantName string) (*model.GetTenantMetadataResponse, error)

func (*PinotAPIClient) GetTenantTables

func (c *PinotAPIClient) GetTenantTables(tenantName string) (*model.GetTablesResponse, error)

func (*PinotAPIClient) GetTenants

func (c *PinotAPIClient) GetTenants() (*model.GetTenantsResponse, error)

func (*PinotAPIClient) GetUser

func (c *PinotAPIClient) GetUser(username string, component string) (*model.User, error)

func (*PinotAPIClient) GetUsers

func (c *PinotAPIClient) GetUsers() (*model.GetUsersResponse, error)

func (*PinotAPIClient) RebalanceTenant

func (c *PinotAPIClient) RebalanceTenant(tenantName string) (*model.UserActionResponse, error)

func (*PinotAPIClient) RebuildBrokerResourceFromHelixTags

func (c *PinotAPIClient) RebuildBrokerResourceFromHelixTags(tableName string) (*model.UserActionResponse, error)

func (*PinotAPIClient) ReloadSegment

func (c *PinotAPIClient) ReloadSegment(tableName string, segmentName string) (*model.UserActionResponse, error)

func (*PinotAPIClient) ReloadTableSegments

func (c *PinotAPIClient) ReloadTableSegments(tableName string) (*model.UserActionResponse, error)

func (*PinotAPIClient) ResetTableSegment

func (c *PinotAPIClient) ResetTableSegment(tableName string, segmentName string) (*model.UserActionResponse, error)

func (*PinotAPIClient) ResetTableSegments

func (c *PinotAPIClient) ResetTableSegments(tableNameWithType string) (*model.UserActionResponse, error)

func (*PinotAPIClient) UpdateClusterConfigs

func (c *PinotAPIClient) UpdateClusterConfigs(body []byte) (*model.UserActionResponse, error)

func (*PinotAPIClient) UpdateInstance

func (c *PinotAPIClient) UpdateInstance(instanceName string, body []byte) (*model.UserActionResponse, error)

func (*PinotAPIClient) UpdateObject

func (c *PinotAPIClient) UpdateObject(endpoint string, queryParams map[string]string, body []byte, result any) error

func (*PinotAPIClient) UpdateSchema

func (c *PinotAPIClient) UpdateSchema(schema model.Schema) (*model.UserActionResponse, error)

func (*PinotAPIClient) UpdateSchemaFromBytes

func (c *PinotAPIClient) UpdateSchemaFromBytes(schemaBytes []byte) (*model.UserActionResponse, error)

func (*PinotAPIClient) UpdateSegmentZKTimeInterval

func (c *PinotAPIClient) UpdateSegmentZKTimeInterval(tableNameWithType string) (*model.UserActionResponse, error)

func (*PinotAPIClient) UpdateTable

func (c *PinotAPIClient) UpdateTable(tableName string, body []byte) (*model.UserActionResponse, error)

func (*PinotAPIClient) UpdateTenant

func (c *PinotAPIClient) UpdateTenant(body []byte) (*model.UserActionResponse, error)

func (*PinotAPIClient) UpdateUser

func (c *PinotAPIClient) UpdateUser(username string, component string, passwordChanged bool, body []byte) (*model.UserActionResponse, error)

func (*PinotAPIClient) ValidateSchema

func (c *PinotAPIClient) ValidateSchema(schema model.Schema) (*model.ValidateSchemaResponse, error)

ValidateSchema validates a schema

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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