dapi

package module
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2021 License: MIT Imports: 13 Imported by: 1

README

go-dremio-api-client

Golang Client for interacting with Dremio Api

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AggregationReflection

type AggregationReflection struct {
	Reflection
	DimensionFields []ReflectionFieldWithGranularity `json:"dimensionFields,omitempty"`
	MeasureFields   []ReflectionMeasureField         `json:"measureFields,omitempty"`
}

type AggregationReflectionSpec

type AggregationReflectionSpec struct {
	Name                          string
	Enabled                       bool
	DimensionFields               []ReflectionFieldWithGranularity
	MeasureFields                 []ReflectionMeasureField
	DistributionFields            []ReflectionField
	PartitionFields               []ReflectionField
	SortFields                    []ReflectionField
	PartitionDistributionStrategy string
}

type CatalogChild added in v0.1.2

type CatalogChild struct {
	Id            string   `json:"id,omitempty"`
	Path          []string `json:"path,omitempty"`
	Tag           string   `json:"tag,omitempty"`
	Name          string   `json:"name,omitempty"`
	Type          string   `json:"type,omitempty"`
	DatasetType   string   `json:"datasetType,omitempty"`
	ContainerType string   `json:"containerType,omitempty"`
}

func (*CatalogChild) EnrichFields added in v0.1.2

func (ce *CatalogChild) EnrichFields()

type CatalogEntity

type CatalogEntity struct {
	EntityType string         `json:"entityType,omitempty"`
	Id         string         `json:"id,omitempty"`
	Tag        string         `json:"tag,omitempty"`
	Path       []string       `json:"path,omitempty"`
	Name       string         `json:"name,omitempty"`
	Children   []CatalogChild `json:"children,omitempty"`
}

func (*CatalogEntity) EnrichFields added in v0.1.2

func (ce *CatalogEntity) EnrichFields()

type CatalogEntitySummary

type CatalogEntitySummary struct {
	Id            string   `json:"id,omitempty"`
	Tag           string   `json:"tag,omitempty"`
	Path          []string `json:"path,omitempty"`
	Type          string   `json:"type,omitempty"`
	DatasetType   string   `json:"datasetType,omitempty"`
	ContainerType string   `json:"containerType,omitempty"`
}

type Client

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

func NewClient added in v0.1.1

func NewClient(baseUrl string, cfg Config) (*Client, error)

New creates a new Dremio client.

func (*Client) DeleteCatalogItem

func (c *Client) DeleteCatalogItem(id string) error

func (*Client) DeleteReflection

func (c *Client) DeleteReflection(id string) error

func (*Client) GetAggregationReflection

func (c *Client) GetAggregationReflection(id string) (*AggregationReflection, error)

func (*Client) GetCatalogEntityById added in v0.1.2

func (c *Client) GetCatalogEntityById(id string) (*CatalogEntity, error)

func (*Client) GetCatalogEntityByPath added in v0.1.2

func (c *Client) GetCatalogEntityByPath(path []string) (*CatalogEntity, error)

func (*Client) GetDataset

func (c *Client) GetDataset(id string) (*Dataset, error)

func (*Client) GetEntityTags added in v0.1.5

func (c *Client) GetEntityTags(id string) (TagsBody, error)

func (*Client) GetEntityWiki added in v0.1.5

func (c *Client) GetEntityWiki(id string) (WikiBody, error)

func (*Client) GetFolder

func (c *Client) GetFolder(id string) (*Folder, error)

func (*Client) GetPhysicalDataset

func (c *Client) GetPhysicalDataset(id string) (*PhysicalDataset, error)

func (*Client) GetRawReflection

func (c *Client) GetRawReflection(id string) (*RawReflection, error)

func (*Client) GetRootCatalogSummary

func (c *Client) GetRootCatalogSummary() ([]CatalogEntitySummary, error)

func (*Client) GetSource

func (c *Client) GetSource(id string) (*Source, error)

func (*Client) GetSpace

func (c *Client) GetSpace(id string) (*Space, error)

func (*Client) GetVirtualDataset

func (c *Client) GetVirtualDataset(id string) (*VirtualDataset, error)

func (*Client) NewAggregationReflection

func (c *Client) NewAggregationReflection(datasetId string, spec *AggregationReflectionSpec) (*AggregationReflection, error)

func (*Client) NewFolder

func (c *Client) NewFolder(spec *NewFolderSpec) (*Folder, error)

func (*Client) NewPhysicalDataset added in v0.1.2

func (c *Client) NewPhysicalDataset(fileId string, spec *NewPhysicalDatasetSpec) (*PhysicalDataset, error)

func (*Client) NewRawReflection

func (c *Client) NewRawReflection(datasetId string, spec *RawReflectionSpec) (*RawReflection, error)

func (*Client) NewSource

func (c *Client) NewSource(spec *NewSourceSpec) (*Source, error)

func (*Client) NewSpace

func (c *Client) NewSpace(spec *NewSpaceSpec) (*Space, error)

func (*Client) NewVirtualDataset

func (c *Client) NewVirtualDataset(spec *NewVirtualDatasetSpec) (*VirtualDataset, error)

func (*Client) SetEntityTags added in v0.1.5

func (c *Client) SetEntityTags(id string, tags []string, version string) error

func (*Client) SetEntityWiki added in v0.1.5

func (c *Client) SetEntityWiki(id string, text string, version int) error

func (*Client) UpdateAggregationReflection

func (c *Client) UpdateAggregationReflection(id string, spec *AggregationReflectionSpec) (*AggregationReflection, error)

func (*Client) UpdatePhysicalDataset added in v0.1.2

func (c *Client) UpdatePhysicalDataset(id string, spec *UpdatePhysicalDatasetSpec) (*PhysicalDataset, error)

func (*Client) UpdateRawReflection

func (c *Client) UpdateRawReflection(id string, spec *RawReflectionSpec) (*RawReflection, error)

func (*Client) UpdateSource

func (c *Client) UpdateSource(id string, spec *UpdateSourceSpec) (*Source, error)

func (*Client) UpdateVirtualDataset

func (c *Client) UpdateVirtualDataset(id string, spec *UpdateVirtualDatasetSpec) (*VirtualDataset, error)

type Config

type Config struct {
	ApiKey   string
	Username string
	Password string
	Client   *http.Client
}

type Dataset

type Dataset struct {
	CatalogEntity
	Type   string         `json:"type,omitempty"`
	Fields []DatasetField `json:"fields,omitempty"`
}

type DatasetAccelerationRefreshPolicy added in v0.1.3

type DatasetAccelerationRefreshPolicy struct {
	RefreshPeriodMs int    `json:"refreshPeriodMs,omitempty"`
	GracePeriodMs   int    `json:"gracePeriodMs,omitempty"`
	Method          string `json:"method,omitempty"`
	RefreshField    string `json:"refreshField,omitempty"`
	NeverExpire     bool   `json:"neverExpire,omitempty"`
	NeverRefresh    bool   `json:"neverRefresh,omitempty"`
}

type DatasetField

type DatasetField struct {
	Name string           `json:"name,omitempty"`
	Type DatasetFieldType `json:"type,omitempty"`
}

type DatasetFieldType

type DatasetFieldType struct {
	Name      string         `json:"name,omitempty"`
	SubSchema []DatasetField `json:"subSchema,omitempty"`
	Precision int            `json:"precision,omitempty"`
	Scale     int            `json:"scale,omitempty"`
}

type Folder

type Folder struct {
	CatalogEntity
	Children []CatalogEntitySummary `json:"children,omitempty"`
}

type GetCatalogResponse

type GetCatalogResponse struct {
	Data []CatalogEntitySummary `json:"data"`
}

type NewFolderSpec

type NewFolderSpec struct {
	Path []string
}

type NewPhysicalDatasetSpec added in v0.1.2

type NewPhysicalDatasetSpec struct {
	Path                      []string
	Format                    *PhysicalDatasetFormat
	AccelerationRefreshPolicy *DatasetAccelerationRefreshPolicy
}

type NewSourceSpec

type NewSourceSpec struct {
	Name                        string
	Description                 string
	Type                        string
	Config                      interface{}
	MetadataPolicy              *SourceMetadataPolicy
	AccelerationRefreshPeriodMs int
	AccelerationGracePeriodMs   int
	AccelerationNeverExpire     bool
	AccelerationNeverRefresh    bool
}

type NewSpaceSpec

type NewSpaceSpec struct {
	Name string
}

type NewVirtualDatasetSpec

type NewVirtualDatasetSpec struct {
	Path       []string
	Sql        string
	SqlContext []string
}

type PhysicalDataset

type PhysicalDataset struct {
	Dataset
	Format                    *PhysicalDatasetFormat            `json:"format,omitempty"`
	AccelerationRefreshPolicy *DatasetAccelerationRefreshPolicy `json:"accelerationRefreshPolicy,omitempty"`
}

type PhysicalDatasetFormat

type PhysicalDatasetFormat struct {
	Type                    string `json:"type,omitempty"`
	FieldDelimiter          string `json:"fieldDelimiter,omitempty"`
	LineDelimiter           string `json:"lineDelimiter,omitempty"`
	Quote                   string `json:"quote,omitempty"`
	Comment                 string `json:"comment,omitempty"`
	Escape                  string `json:"escape,omitempty"`
	SkipFirstLine           bool   `json:"skipFirstLine,omitempty"`
	ExtractHeader           bool   `json:"extractHeader,omitempty"`
	TrimHeader              bool   `json:"trimHeader,omitempty"`
	AutoGenerateColumnNames bool   `json:"autoGenerateColumnNames,omitempty"`
	SheetName               string `json:"sheetName,omitempty"`
	HasMergedCells          bool   `json:"hasMergedCells,omitempty"`
}

type RawReflection

type RawReflection struct {
	Reflection
	DisplayFields []ReflectionField `json:"displayFields,omitempty"`
}

type RawReflectionSpec

type RawReflectionSpec struct {
	Name                          string
	Enabled                       bool
	DisplayFields                 []ReflectionField
	DistributionFields            []ReflectionField
	PartitionFields               []ReflectionField
	SortFields                    []ReflectionField
	PartitionDistributionStrategy string
}

type Reflection

type Reflection struct {
	EntityType                    string            `json:"entityType,omitempty"`
	Id                            string            `json:"id,omitempty"`
	Tag                           string            `json:"tag,omitempty"`
	Name                          string            `json:"name,omitempty"`
	Enabled                       bool              `json:"enabled,omitempty"`
	CreatedAt                     string            `json:"createdAt,omitempty"`
	UpdatedAt                     string            `json:"updatedAt,omitempty"`
	Type                          string            `json:"type,omitempty"`
	DatasetId                     string            `json:"datasetId,omitempty"`
	CurrentSizeBytes              int               `json:"currentSizeBytes,omitempty"`
	TotalSizeBytes                int               `json:"totalSizeBytes,omitempty"`
	Status                        ReflectionStatus  `json:"status,omitempty"`
	DistributionFields            []ReflectionField `json:"distributionFields,omitempty"`
	PartitionFields               []ReflectionField `json:"partitionFields,omitempty"`
	SortFields                    []ReflectionField `json:"sortFields,omitempty"`
	PartitionDistributionStrategy string            `json:"partitionDistributionStrategy,omitempty"`
}

type ReflectionField

type ReflectionField struct {
	Name string `json:"name,omitempty"`
}

type ReflectionFieldWithGranularity

type ReflectionFieldWithGranularity struct {
	ReflectionField
	Granularity string `json:"granularity,omitempty"`
}

type ReflectionMeasureField

type ReflectionMeasureField struct {
	ReflectionField
	MeasureTypeList []string `json:"measureTypeList,omitempty"`
}

type ReflectionStatus

type ReflectionStatus struct {
	Config       string `json:"config,omitempty"`
	Refresh      string `json:"refresh,omitempty"`
	Availability string `json:"availability,omitempty"`
	FailureCount int    `json:"failureCount,omitempty"`
	LastRefresh  string `json:"lastRefresh,omitempty"`
	ExpiresAt    string `json:"expiresAt,omitempty"`
}

type Source

type Source struct {
	CatalogEntity
	Description                 string                `json:"description,omitempty"`
	Type                        string                `json:"type,omitempty"`
	Config                      interface{}           `json:"config,omitempty"`
	CreatedAt                   string                `json:"createdAt,omitempty"`
	MetadataPolicy              *SourceMetadataPolicy `json:"metadataPolicy,omitempty"`
	AccelerationRefreshPeriodMs int                   `json:"accelerationRefreshPeriodMs,omitempty"`
	AccelerationGracePeriodMs   int                   `json:"accelerationGracePeriodMs,omitempty"`
	AccelerationNeverExpire     bool                  `json:"accelerationNeverExpire,omitempty"`
	AccelerationNeverRefresh    bool                  `json:"accelerationNeverRefresh,omitempty"`
}

type SourceMetadataPolicy added in v0.1.3

type SourceMetadataPolicy struct {
	AuthTTLMs             int    `json:"authTTLMs,omitempty"`
	DatasetRefreshAfterMs int    `json:"datasetRefreshAfterMs,omitempty"`
	DatasetExpireAfterMs  int    `json:"datasetExpireAfterMs,omitempty"`
	NamesRefreshMs        int    `json:"namesRefreshMs,omitempty"`
	DatasetUpdateMode     string `json:"datasetUpdateMode,omitempty"`
}

type Space

type Space struct {
	CatalogEntity
	CreatedAt string                 `json:"createdAt,omitempty"`
	Children  []CatalogEntitySummary `json:"children,omitempty"`
}

type TagsBody added in v0.1.5

type TagsBody struct {
	Tags    []string `json:"tags"`
	Version string   `json:"version"`
}

type UpdatePhysicalDatasetSpec added in v0.1.2

type UpdatePhysicalDatasetSpec struct {
	Format                    *PhysicalDatasetFormat
	AccelerationRefreshPolicy *DatasetAccelerationRefreshPolicy
}

type UpdateSourceSpec

type UpdateSourceSpec struct {
	Description                 string
	Config                      interface{}
	MetadataPolicy              *SourceMetadataPolicy
	AccelerationRefreshPeriodMs int
	AccelerationGracePeriodMs   int
	AccelerationNeverExpire     bool
	AccelerationNeverRefresh    bool
}

type UpdateVirtualDatasetSpec

type UpdateVirtualDatasetSpec struct {
	Sql        string
	SqlContext []string
}

type VirtualDataset

type VirtualDataset struct {
	Dataset
	Sql        string   `json:"sql,omitempty"`
	SqlContext []string `json:"sqlContext,omitempty"`
}

type WikiBody added in v0.1.5

type WikiBody struct {
	Text    string `json:"text"`
	Version int    `json:"version"`
}

Jump to

Keyboard shortcuts

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