goPinotAPI

package module
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2024 License: MIT Imports: 12 Imported by: 1

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

(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 added in v0.2.0

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 added in v0.5.0

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

func (*PinotAPIClient) CheckPinotControllerAdminHealth added in v0.5.0

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

func (*PinotAPIClient) CheckPinotControllerHealth added in v0.5.0

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

func (*PinotAPIClient) CreateFormDataObject

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

func (*PinotAPIClient) CreateInstance added in v0.1.5

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 added in v0.2.0

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 added in v0.1.5

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

func (*PinotAPIClient) CreateUser

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

func (*PinotAPIClient) DeleteClusterConfig added in v0.1.5

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

func (*PinotAPIClient) DeleteInstance added in v0.1.5

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 added in v0.1.5

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 added in v0.5.0

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

func (*PinotAPIClient) GetAllTableLiveBrokers added in v0.5.0

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

func (*PinotAPIClient) GetClusterConfigs added in v0.1.5

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

func (*PinotAPIClient) GetClusterInfo added in v0.1.5

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

func (*PinotAPIClient) GetInstance added in v0.1.5

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

func (*PinotAPIClient) GetInstances added in v0.1.5

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 added in v0.5.0

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 added in v0.6.0

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

func (*PinotAPIClient) GetSegmentMetadata added in v0.6.0

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

func (*PinotAPIClient) GetSegmentTiers added in v0.6.0

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

func (*PinotAPIClient) GetSegmentZKMetadata added in v0.6.0

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

func (*PinotAPIClient) GetSegments added in v0.1.5

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

func (*PinotAPIClient) GetTable

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

func (*PinotAPIClient) GetTableExternalView added in v0.5.0

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

func (*PinotAPIClient) GetTableIdealState added in v0.5.0

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

func (*PinotAPIClient) GetTableIndexes added in v0.5.0

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

func (*PinotAPIClient) GetTableInstances added in v0.5.0

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

func (*PinotAPIClient) GetTableLiveBrokers added in v0.5.0

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

func (*PinotAPIClient) GetTableMetadata added in v0.5.0

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

func (*PinotAPIClient) GetTableSchema added in v0.5.0

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

func (*PinotAPIClient) GetTableSize added in v0.5.0

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

func (*PinotAPIClient) GetTableState added in v0.5.0

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

func (*PinotAPIClient) GetTableStats added in v0.5.0

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

func (*PinotAPIClient) GetTables

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

func (*PinotAPIClient) GetTenantInstances added in v0.1.5

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

func (*PinotAPIClient) GetTenantMetadata added in v0.1.5

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

func (*PinotAPIClient) GetTenantTables added in v0.1.5

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 added in v0.1.5

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

func (*PinotAPIClient) RebuildBrokerResourceFromHelixTags added in v0.5.0

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 added in v0.6.0

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

func (*PinotAPIClient) ResetTableSegments added in v0.6.0

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

func (*PinotAPIClient) UpdateClusterConfigs added in v0.1.5

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

func (*PinotAPIClient) UpdateInstance added in v0.1.5

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 added in v0.2.0

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

func (*PinotAPIClient) UpdateSegmentZKTimeInterval added in v0.6.2

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 added in v0.1.5

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
tools
coverage Module

Jump to

Keyboard shortcuts

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