client

package
v0.0.0-...-13a75f2 Latest Latest
Warning

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

Go to latest
Published: May 4, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Types API
	TYPES_API            = "types/"
	TYPEDEFS_API         = TYPES_API + "typedefs/"
	TYPEDEF_BY_NAME      = TYPES_API + "typedef/name/"
	TYPEDEF_BY_GUID      = TYPES_API + "typedef/guid/"
	GET_BY_NAME_TEMPLATE = TYPES_API + "{path_type}/name/{name}"
	GET_BY_GUID_TEMPLATE = TYPES_API + "{path_type}/guid/{guid}"

	// Entities API
	ENTITY_API      = "entity/"
	ENTITY_BULK_API = "entity/bulk/"
)
View Source
const (
	// TermAttributes Constants
	CONNECTOR_NAME           = "connectorName"
	CATEGORIES               = "__categories"
	CREATE_TIME_AS_TIMESTAMP = "__timestamp"
	CREATED_BY               = "__createdBy"
	GLOSSARY                 = "__glossary"
	GUID                     = "__guid"
	HAS_LINEAGE              = "__hasLineage"
	MEANINGS                 = "__meanings"
	MODIFIED_BY              = "__modifiedBy"
	NAME                     = "name.keyword"
	OWNER_GROUPS             = "ownerGroups"
	OWNER_USERS              = "ownerUsers"
	PARENT_CATEGORY          = "__parentCategory"
	POPULARITY_SCORE         = "popularityScore"
	QUALIFIED_NAME           = "qualifiedName"
	STATE                    = "__state"
	SUPER_TYPE_NAMES         = "__superTypeNames.keyword"
	TYPE_NAME                = "__typeName.keyword"
	UPDATE_TIME_AS_TIMESTAMP = "__modificationTimestamp"
	CERTIFICATE_STATUS       = "certificateStatus"

	// TextAttributes Constants
	CLASSIFICATION_NAMES            = "__classificationNames"
	CLASSIFICATIONS_TEXT            = "__classificationsText"
	CREATE_TIME_AS_DATE             = "__timestamp.date"
	DESCRIPTION                     = "description"
	MEANINGS_TEXT                   = "__meaningsText"
	NAME_TEXT                       = "name"
	QUALIFIED_NAME_TEXT             = "qualifiedName.text"
	PROPAGATED_CLASSIFICATION_NAMES = "__propagatedClassificationNames"
	PROPAGATED_TRAIT_NAMES          = "__propagatedTraitNames"
	SUPER_TYPE_NAMES_TEXT           = "__superTypeNames"
	TRAIT_NAMES                     = "__traitNames"
	UPDATE_TIME_AS_DATE             = "__modificationTimestamp.date"
	USER_DESCRIPTION                = "userDescription"
)

Constants for the Atlas search DSL

View Source
const (
	MaxRetries    = 5
	RetryInterval = time.Second * 5
)

Variables

View Source
var (
	GET_TYPEDEF_BY_NAME = API{
		Path:     TYPEDEF_BY_NAME,
		Method:   http.MethodGet,
		Status:   http.StatusOK,
		Endpoint: AtlasEndpoint,
	}

	GET_TYPEDEF_BY_GUID = API{
		Path:     TYPEDEF_BY_GUID,
		Method:   http.MethodGet,
		Status:   http.StatusOK,
		Endpoint: AtlasEndpoint,
	}

	GET_ALL_TYPE_DEFS = API{
		Path:     TYPEDEFS_API,
		Method:   http.MethodGet,
		Status:   http.StatusOK,
		Endpoint: AtlasEndpoint,
	}

	GET_ALL_TYPE_DEF_HEADERS = API{
		Path:     TYPEDEFS_API + "headers",
		Method:   http.MethodGet,
		Status:   http.StatusOK,
		Endpoint: AtlasEndpoint,
	}

	UPDATE_TYPE_DEFS = API{
		Path:     TYPEDEFS_API,
		Method:   http.MethodPut,
		Status:   http.StatusOK,
		Endpoint: AtlasEndpoint,
	}

	CREATE_TYPE_DEFS = API{
		Path:     TYPEDEFS_API,
		Method:   http.MethodPut,
		Status:   http.StatusOK,
		Endpoint: AtlasEndpoint,
	}

	DELETE_TYPE_DEFS = API{
		Path:     TYPEDEFS_API,
		Method:   http.MethodDelete,
		Status:   http.StatusNoContent,
		Endpoint: AtlasEndpoint,
	}

	DELETE_TYPE_DEF_BY_NAME = API{
		Path:     TYPEDEF_BY_NAME,
		Method:   http.MethodDelete,
		Status:   http.StatusNoContent,
		Endpoint: AtlasEndpoint,
	}

	GET_ENTITY_BY_GUID = API{
		Path:     ENTITY_API + "guid/",
		Method:   http.MethodGet,
		Status:   http.StatusOK,
		Endpoint: AtlasEndpoint,
	}

	INDEX_SEARCH = API{
		Path:     "search/indexsearch/",
		Method:   http.MethodPost,
		Status:   http.StatusOK,
		Endpoint: AtlasEndpoint,
	}

	CREATE_ENTITY = API{
		Path:     ENTITY_API,
		Method:   http.MethodPost,
		Status:   http.StatusOK,
		Endpoint: AtlasEndpoint,
	}

	CREATE_ENTITIES = API{
		Path:     ENTITY_BULK_API,
		Method:   http.MethodPost,
		Status:   http.StatusOK,
		Endpoint: AtlasEndpoint,
	}

	DELETE_ENTITIES_BY_GUIDS = API{
		Path:     ENTITY_BULK_API,
		Method:   http.MethodDelete,
		Status:   http.StatusOK,
		Endpoint: AtlasEndpoint,
	}
)

API calls for Atlas

View Source
var AtlasEndpoint = Endpoint{
	Atlas: "/api/meta/",
}
View Source
var LoggingEnabled = true

Functions

func DeleteByGuid

func DeleteByGuid(guids []string) (*model.AssetMutationResponse, error)

DeleteByGuid SOFT deletes assets by their GUIDs.

func FindCategoryByName

func FindCategoryByName(categoryName string, glossaryQualifiedName string) (*model.IndexSearchResponse, error)

FindCategoryByName searches for a category by name.

func FindGlossaryByName

func FindGlossaryByName(glossaryName string) (*model.IndexSearchResponse, error)

FindGlossaryByName searches for a glossary by name.

func Get

func Get(typeCategory atlan.AtlanTypeCategory) (*model.TypeDefResponse, error)

Get retrieves a TypeDefResponse object that contains a list of the specified category type definitions in Atlan.

func GetAll

func GetAll() (*model.TypeDefResponse, error)

func GetAtlanTagIDForName

func GetAtlanTagIDForName(name string) (string, error)

func GetAtlanTagNameForID

func GetAtlanTagNameForID(idstr string) (string, error)

func GetAttributeDef

func GetAttributeDef(attrID string) model.AttributeDef

func GetCustomMetadataIDforName

func GetCustomMetadataIDforName(name string) (string, error)

func GetGlossaryByGuid

func GetGlossaryByGuid(glossaryGuid string) (*assets.AtlasGlossary, error)

GetGlossaryByGuid retrieves a glossary by its GUID.

func GetGlossaryTermByGuid

func GetGlossaryTermByGuid(glossaryGuid string) (*assets.AtlasGlossaryTerm, error)

GetGlossaryTermByGuid retrieves a glossary term by its GUID.

func Init

func Init() error

Init initializes the default AtlanClient.

func NewTypeDefResponse

func NewTypeDefResponse(rawJSON []byte) (*model.TypeDefResponse, error)

func PurgeByGuid

func PurgeByGuid(guids []string) (*model.AssetMutationResponse, error)

PurgeByGuid HARD deletes assets by their GUIDs.

func RefreshCache

func RefreshCache()

func RefreshCaches

func RefreshCaches(typedef model.TypeDef) error

func RefreshCustomMetadataCache

func RefreshCustomMetadataCache()

func RetrieveMinimal

func RetrieveMinimal(guid string) (*Assets2.Asset, error)

RetrieveMinimal retrieves an asset by its GUID, without any of its relationships.

func Save

func Save(assets ...AtlanObject) (*model.AssetMutationResponse, error)

Save saves the assets in memory to the Atlas server.

Call the search API

func WaitTillDeleted

func WaitTillDeleted(guid string) error

WaitTillDeleted waits for an asset to be deleted.

func WithActiveCategory

func WithActiveCategory(name string, glossaryqualifiedname string) (*model.BoolQuery, error)

WithActiveCategory returns a query for an active category by name.

func WithActiveGlossary

func WithActiveGlossary(name string) (*model.BoolQuery, error)

WithActiveGlossary returns a query for an active glossary by name.

func WithGlossary

func WithGlossary(value string) *model.TermQuery

WithGlossary returns a query for an entity with a specific glossary.

func WithName

func WithName(value string) *model.TermQuery

WithName returns a query for an entity with a specific name.

func WithState

func WithState(value string) (*model.TermQuery, error)

WithState returns a query for an entity with a specific state.

func WithTypeName

func WithTypeName(value string) *model.TermQuery

WithTypeName returns a query for an entity with a specific type name.

Types

type API

type API struct {
	Path     string
	Method   string
	Status   int
	Endpoint Endpoint
}

API defines the structure of an API call.

type Aggregation

type Aggregation struct {
}

type ApiConnectionError

type ApiConnectionError struct{ AtlanError }

type ApiError

type ApiError struct{ AtlanError }

type AssetFields

type AssetFields struct {
	AttributesFields
	NAME                       *KeywordTextStemmedField
	DISPLAY_NAME               *KeywordTextField
	DESCRIPTION                *KeywordTextField
	USER_DESCRIPTION           *KeywordTextField
	TENET_ID                   *KeywordField
	CERTIFICATE_STATUS         *KeywordTextField
	CERTIFICATE_STATUS_MESSAGE *KeywordField
	CERTIFICATE_UPDATED_BY     *NumericField
	ANNOUNCEMENT_TITLE         *KeywordField
	ANNOUNCEMENT_MESSAGE       *KeywordTextField
	ANNOUNCEMENT_TYPE          *KeywordField
	ANNOUNCEMENT_UPDATED_AT    *NumericField
	ANNOUNCEMENT_UPDATED_BY    *KeywordField
	OWNER_USERS                *KeywordTextField
	ADMIN_USERS                *KeywordField
	VIEWER_USERS               *KeywordField
	VIEWER_GROUPS              *KeywordField
	CONNECTOR_NAME             *KeywordTextField
	CONNECTION_NAME            *KeywordTextField
}

type AtlanClient

type AtlanClient struct {
	Session *http.Client

	ApiKey string

	SearchAssets
	// contains filtered or unexported fields
}

AtlanClient defines the Atlan API client structure.

var DefaultAtlanClient *AtlanClient

func Context

func Context(apiKey, baseURL string) (*AtlanClient, error)

func NewContext

func NewContext() *AtlanClient

func (*AtlanClient) CallAPI

func (ac *AtlanClient) CallAPI(api *API, queryParams map[string]string, requestObj interface{}) ([]byte, error)

CallAPI makes a generic API call.

type AtlanError

type AtlanError struct {
	ErrorCode     ErrorInfo
	Args          []interface{}
	OriginalError string // Error received from Atlan API

}

func (AtlanError) Error

func (e AtlanError) Error() string

type AtlanField

type AtlanField interface {
	GetAtlanFieldName() string
}

Interface for all AtlanField queries

type AtlanObject

type AtlanObject interface {
	MarshalJSON() ([]byte, error)
}

type AtlanTagCache

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

AtlanTagCache represents a cache for translating between Atlan-internal ID strings and human-readable names for Atlan tags.

var DefaultAtlanTagCache *AtlanTagCache

func GetAtlanTagCache

func GetAtlanTagCache() *AtlanTagCache

GetCache returns the AtlanTagCache for the default AtlanClient.

func NewAtlanTagCache

func NewAtlanTagCache(atlanClient *AtlanClient) *AtlanTagCache

NewAtlanTagCache creates a new AtlanTagCache instance.

func (*AtlanTagCache) GetIDForName

func (c *AtlanTagCache) GetIDForName(name string) (string, error)

GetIDForName translates the provided human-readable Atlan tag name to its Atlan-internal ID string.

func (*AtlanTagCache) GetNameForID

func (c *AtlanTagCache) GetNameForID(idstr string) (string, error)

GetNameForID translates the provided Atlan-internal classification ID string to the human-readable Atlan tag name.

func (*AtlanTagCache) RefreshCache

func (c *AtlanTagCache) RefreshCache() error

RefreshCache ref reshes the cache of Atlan tags by requesting the full set of Atlan tags from Atlan. RefreshCache updates the AtlanTagCache with the latest data from Atlan.

type AtlasGlossary

type AtlasGlossary assets.AtlasGlossary

func (*AtlasGlossary) Creator

func (g *AtlasGlossary) Creator(name string, icon atlan.AtlanIcon)

Creator is used to create a new glossary asset in memory.

func (*AtlasGlossary) MarshalJSON

func (g *AtlasGlossary) MarshalJSON() ([]byte, error)

MarshalJSON filters out entities to only include those with non-empty attributes.

func (*AtlasGlossary) Updater

func (g *AtlasGlossary) Updater(name string, qualifiedName string, glossary_guid string) error

Updater is used to modify a glossary asset in memory.

type AtlasGlossaryFields

type AtlasGlossaryFields struct {
	AssetFields
	AtlanObject
}

AtlasGlossary represents the AtlasGlossary asset

func NewSearchGlossary

func NewSearchGlossary() *AtlasGlossaryFields

NewSearchGlossary returns a new AtlasGlossary object for Searching

type AtlasTableFields

type AtlasTableFields struct {
	SQLFields
	COLUMN_COUNT             *NumericField
	ROW_COUNT                *NumericField
	SIZE_BYTES               *NumericField
	ALIAS                    *KeywordField
	ISTEMPORARY              *BooleanField
	IS_QUERY_PREVIEW         *BooleanField
	QUERY_PREVIEW_CONFIG     *KeywordField
	EXTERNAL_LOCATION        *KeywordField
	EXTERNAL_LOCATION_REGION *KeywordField
	EXTERNAL_LOCATION_FORMAT *KeywordField
	IS_PARTITIONED           *BooleanField
	PARTITION_STRATEGY       *KeywordField
	PARTITION_COUNT          *NumericField
	PARTITION_LIST           *KeywordField
	PARTITIONS               *RelationField
	COLUMNS                  *RelationField
	QUERIES                  *RelationField
	ATLAN_SCHEMA             *RelationField
	DIMENSIONS               *RelationField
}

func NewSearchTable

func NewSearchTable() *AtlasTableFields

NewSearchTable returns a new AtlasTable object for Searching

type AttributesFields

type AttributesFields struct {
	TYPENAME              *KeywordTextField
	GUID                  *KeywordField
	CREATED_BY            *KeywordField
	UPDATED_BY            *KeywordField
	STATUS                *KeywordField
	ATLAN_TAGS            *KeywordTextField
	PROPOGATED_ATLAN_TAGS *KeywordTextField
	ASSIGNED_TERMS        *KeywordTextField
	SUPERTYPE_NAMES       *KeywordTextField
	CREATE_TIME           *NumericField
	UPDATE_TIME           *NumericField
	QUALIFIED_NAME        *KeywordTextField
}

type AuthenticationError

type AuthenticationError struct{ AtlanError }

type BooleanField

type BooleanField struct {
	*SearchableField
	BooleanFieldName string
}

BooleanField Represents any field in Atlan that can be searched only by truthiness.

func NewBooleanField

func NewBooleanField(atlanFieldName, booleanFieldName string) *BooleanField

NewBooleanField Returns a query that will match all assets whose field has a value that exactly equals the provided boolean value.

func (*BooleanField) Eq

func (bf *BooleanField) Eq(value bool) model.Query

func (*BooleanField) GetBooleanFieldName

func (bf *BooleanField) GetBooleanFieldName() string

type CatalogFields

type CatalogFields struct {
	AssetFields
	INPUT_TO_PROCESSES        *RelationField
	OUTPUT_FROM_AIRFLOW_TASKS *RelationField
	INPUT_TO_AIRFLOW_TASKS    *RelationField
	OUTPUT_FROM_PROCESSES     *RelationField
}

type ColumnFields

type ColumnFields struct {
	SQLFields
	DATA_TYPE                          *KeywordTextField
	SUB_DATA_TYPE                      *KeywordField
	RAW_DATA_TYPE_DEFINITION           *KeywordField
	ORDER                              *NumericField
	NESTED_COLUMN_COUNT                *NumericField
	IS_PARTITION                       *BooleanField
	PARTITION_ORDER                    *NumericField
	IS_CLUSTERED                       *BooleanField
	IS_PRIMARY                         *BooleanField
	IS_FOREIGN                         *BooleanField
	IS_INDEXED                         *BooleanField
	IS_SORT                            *BooleanField
	IS_DIST                            *BooleanField
	IS_PINNED                          *BooleanField
	PINNED_BY                          *KeywordField
	PINNED_AT                          *NumericField
	PRECISION                          *NumericField
	DEFAULT_VALUE                      *KeywordField
	IS_NULLABLE                        *BooleanField
	NUMERIC_SCALE                      *NumericField
	MAX_LENGTH                         *NumericField
	VALIDATIONS                        *KeywordField
	PARENT_COLUMN_QUALIFIED_NAME       *KeywordTextField
	PARENT_COLUMN_NAME                 *KeywordTextField
	COLUMN_DISTINCT_VALUES_COUNT       *NumericField
	COLUMN_DISTINCT_VALUES_COUNT_LONG  *NumericField
	COLUMN_HISTOGRAM                   *KeywordField
	COLUMN_MAX                         *NumericField
	COLUMN_MIN                         *NumericField
	COLUMN_MEAN                        *NumericField
	COLUMN_SUM                         *NumericField
	COLUMN_MEDIAN                      *NumericField
	COLUMN_STANDARD_DEVIATION          *NumericField
	COLUMN_UNIQUE_VALUES_COUNT         *NumericField
	COLUMN_UNIQUE_VALUES_COUNT_LONG    *NumericField
	COLUMN_AVERAGE                     *NumericField
	COLUMN_AVERAGE_LENGTH              *NumericField
	COLUMN_DUPLICATE_VALUES_COUNT      *NumericField
	COLUMN_DUPLICATE_VALUES_COUNT_LONG *NumericField
	COLUMN_MAXIMUM_STRING_LENGTH       *NumericField
	COLUMN_MAXS                        *KeywordField
	COLUMN_MINIMUM_STRING_LENGTH       *NumericField
	COLUMN_MINS                        *KeywordField
	COLUMN_MISSING_VALUES_COUNT        *NumericField
	COLUMN_MISSING_VALUES_COUNT_LONG   *NumericField
	COLUMN_MISSING_VALUES_PERCENTAGE   *NumericField
	COLUMN_UNIQUENESS_PERCENTAGE       *NumericField
	COLUMN_VARIANCE                    *NumericField
	COLUMN_TOP_VALUES                  *KeywordField
	COLUMN_DEPTH_LEVEL                 *NumericField
	SNOWFLAKE_DYNAMIC_TABLE            *RelationField
	VIEW                               *RelationField
	NESTED_COLUMNS                     *RelationField
	DATA_QUALITY_METRIC_DIMENSIONS     *RelationField
	DBT_MODEL_COLUMNS                  *RelationField
	TABLE                              *RelationField
	COLUMN_DBT_MODEL_COLUMNS           *RelationField
	MATERIALIZED_VIEW                  *RelationField
	PARENT_COLUMN                      *RelationField
	QUERIES                            *RelationField
	METRIC_TIMESTAMPS                  *RelationField
	FOREIGN_KEY_TO                     *RelationField
	FOREIGN_KEY_FROM                   *RelationField
	DBT_METRICS                        *RelationField
	TABLE_PARTITION                    *RelationField
}

func NewSearchColumn

func NewSearchColumn() *ColumnFields

type ConflictError

type ConflictError struct{ AtlanError }

type ConnectionFields

type ConnectionFields struct {
	AssetFields
	CATEGORY                        *KeywordField
	SUB_CATEGORY                    *KeywordField
	HOST                            *KeywordField
	PORT                            *NumericField
	ALLOW_QUERY                     *BooleanField
	ALLOW_QUERY_PREVIEW             *BooleanField
	QUERY_PREVIEW_CONFIG            *KeywordField
	QUERY_CONFIG                    *KeywordField
	CREDENTIAL_STRATEGY             *KeywordField
	PREVIEW_CREDENTIAL_STRATEGY     *KeywordField
	POLICY_STRATEGY                 *KeywordField
	QUERY_USERNAME_STRATEGY         *KeywordField
	ROW_LIMIT                       *NumericField
	QUERY_TIMEOUT                   *NumericField
	DEFAULT_CREDENTIAL_GUID         *KeywordField
	CONNECTOR_ICON                  *KeywordField
	CONNECTOR_IMAGE                 *KeywordField
	IS_SAMPLE_DATA_PREVIEW_ENABLED  *BooleanField
	POPULARITY_INSIGHTS_TIMEFRAME   *NumericField
	HAS_POPULARITY_INSIGHTS         *BooleanField
	CONNECTION_DBT_ENVIRONMENTS     *KeywordField
	CONNECTION_SSO_CREDENTIAL_GUID  *KeywordField
	USE_OBJECT_STORAGE              *BooleanField
	OBJECT_STORAGE_UPLOAD_THRESHOLD *NumericField
	VECTOR_EMBEDDINGS_ENABLED       *BooleanField
	VECTOR_EMBEDDINGS_UPDATED_AT    *NumericField
}

func NewSearchConnection

func NewSearchConnection() *ConnectionFields

type CustomMetadataCache

type CustomMetadataCache struct {
	AtlanClient     *AtlanClient
	CacheByID       map[string]model.CustomMetadataDef
	AttrCacheByID   map[string]model.AttributeDef
	MapIDToName     map[string]string
	MapNameToID     map[string]string
	MapAttrIDToName map[string]map[string]string
	MapAttrNameToID map[string]map[string]string
	// contains filtered or unexported fields
}

func GetCustomMetadataCache

func GetCustomMetadataCache() *CustomMetadataCache

GetCustomMetadataCache returns the CustomMetadataCache for the default AtlanClient.

func NewCustomMetadataCache

func NewCustomMetadataCache(atlanClient *AtlanClient) *CustomMetadataCache

NewCustomMetadataCache creates a new CustomMetadataCache instance.

func (*CustomMetadataCache) GetAllCustomAttributes

func (c *CustomMetadataCache) GetAllCustomAttributes(includeDeleted, forceRefresh bool) (map[string][]model.AttributeDef, error)

GetAllCustomAttributes Retrieve all the custom metadata attributes. The dict will be keyed by custom metadata set name, and the value will be a listing of all the attributes within that set (with all the details of each of those attributes).

:param includeDeleted: if True, include the archived (deleted) custom attributes; otherwise only include active custom attributes

:param forceRefresh: if True, will refresh the custom metadata cache; if False, will only refresh the cache if it is empty

:returns: a dict from custom metadata set name to all details about its attributes

:raises NotFoundError: if the custom metadata cannot be found

func (*CustomMetadataCache) GetAttrIDForName

func (c *CustomMetadataCache) GetAttrIDForName(setName, attrName string) (string, error)

GetAttrIDForName Translate the provided human-readable custom metadata set and attribute names to the Atlan-internal ID string for the attribute.

:param setName: human-readable name of the custom metadata set

:param attrName: human-readable name of the attribute

:returns: Atlan-internal ID string for the attribute

:raises NotFoundError: if the custom metadata attribute cannot be found

func (*CustomMetadataCache) GetAttrNameForID

func (c *CustomMetadataCache) GetAttrNameForID(setID, attrID string) (string, error)

GetAttrNameForID Given the Atlan-internal ID string for the set and the Atlan-internal ID for the attribute return the human-readable custom metadata name for the attribute.

:param setId: Atlan-internal ID string for the custom metadata set :param attrId: Atlan-internal ID string for the attribute :returns: human-readable name of the attribute :raises NotFoundError: if the custom metadata attribute cannot be found

func (*CustomMetadataCache) GetAttributeDef

func (c *CustomMetadataCache) GetAttributeDef(attrID string) (model.AttributeDef, error)

GetAttributeDef Retrieve a specific custom metadata attribute definition by its unique Atlan-internal ID string.

:param attr_id: Atlan-internal ID string for the custom metadata attribute

:returns: attribute definition for the custom metadata attribute

:raises InvalidRequestError: if no attribute ID was provided

:raises NotFoundError: if the custom metadata attribute cannot be found

func (*CustomMetadataCache) GetAttributeForSearchResults

func (c *CustomMetadataCache) GetAttributeForSearchResults(setID, attrName string) string

GetAttributeForSearchResults Retrieve a single custom attribute name to include on search results.

:param set_name: human-readable name of the custom metadata set for which to retrieve the custom metadata attribute name

:param attr_name: human-readable name of the attribute

:returns: the attribute name, strictly useful for inclusion in search results

func (*CustomMetadataCache) GetAttributesForSearchResults

func (c *CustomMetadataCache) GetAttributesForSearchResults(setID string) []string

func (*CustomMetadataCache) GetAttributesForSearchResultsByName

func (c *CustomMetadataCache) GetAttributesForSearchResultsByName(setName string) []string

GetAttributesForSearchResultsByName Retrieve the full set of custom attributes to include on search results.

:param set_name: human-readable name of the custom metadata set for which to retrieve attribute names

:returns: a list of the attribute names, strictly useful for inclusion in search results

func (*CustomMetadataCache) GetCustomMetadataDef

func (c *CustomMetadataCache) GetCustomMetadataDef(name string) (model.CustomMetadataDef, error)

GetCustomMetadataDef Retrieve the full custom metadata structure definition.

:param name: human-readable name of the custom metadata set

:returns: the full custom metadata structure definition for that set

:raises InvalidRequestError: if no name was provided

:raises NotFoundError: if the custom metadata cannot be found

func (*CustomMetadataCache) GetIDForName

func (c *CustomMetadataCache) GetIDForName(name string) (string, error)

GetIDForName Translate the provided human-readable custom metadata set name to its Atlan-internal ID string.

:param name: human-readable name of the custom metadata set

:returns: Atlan-internal ID string of the custom metadata set

:raises InvalidRequestError: if no name was provided

:raises NotFoundError: if the custom metadata cannot be found

func (*CustomMetadataCache) GetNameForID

func (c *CustomMetadataCache) GetNameForID(idstr string) (string, error)

GetNameForID Translate the provided Atlan-internal custom metadata ID string to the human-readable custom metadata set name.

:param idstr: Atlan-internal ID string of the custom metadata set

:returns: human-readable name of the custom metadata set

:raises InvalidRequestError: if no ID was provided

:raises NotFoundError: if the custom metadata cannot be found

func (*CustomMetadataCache) RefreshCache

func (c *CustomMetadataCache) RefreshCache() error

RefreshCache refreshes the cache of custom metadata structures by requesting the full set of custom metadata structures from Atlan.

:raises LogicError: if duplicate custom attributes are detected

type CustomMetadataField

type CustomMetadataField struct {
	*SearchableField
	SetName       string
	AttributeName string
	AttributeDef  model.AttributeDef
}

CustomMetadataField Utility class to simplify searching for values on custom metadata attributes.

func NewCustomMetadataField

func NewCustomMetadataField(setName, attributeName, elasticFieldName string) *CustomMetadataField

func (*CustomMetadataField) Between

func (cmf *CustomMetadataField) Between(minimum, maximum *float64) model.Query

func (*CustomMetadataField) Eq

func (cmf *CustomMetadataField) Eq(value string) model.Query

func (*CustomMetadataField) Gt

func (cmf *CustomMetadataField) Gt(value *float64) model.Query

func (*CustomMetadataField) Gte

func (cmf *CustomMetadataField) Gte(value *float64) model.Query

func (*CustomMetadataField) Lt

func (cmf *CustomMetadataField) Lt(value *float64) model.Query

func (*CustomMetadataField) Lte

func (cmf *CustomMetadataField) Lte(value *float64) model.Query

func (*CustomMetadataField) Match

func (cmf *CustomMetadataField) Match(value string) model.Query

func (*CustomMetadataField) StartsWith

func (cmf *CustomMetadataField) StartsWith(value string, caseInsensitive *bool) model.Query

func (*CustomMetadataField) Within

func (cmf *CustomMetadataField) Within(values []string) model.Query

type Endpoint

type Endpoint struct {
	Atlas string
}

type ErrorCode

type ErrorCode int
const (
	CONNECTION_ERROR ErrorCode = iota
	INVALID_REQUEST_PASSTHROUGH
	MISSING_GROUP_ID
	MISSING_USER_ID
	MISSING_TERM_GUID
	MISSING_ROLE_NAME
	MISSING_ROLE_ID
	MISSING_ATLAN_TAG_NAME
	MISSING_ATLAN_TAG_ID
	MISSING_CM_NAME
	MISSING_CM_ID
	MISSING_CM_ATTR_NAME
	MISSING_CM_ATTR_ID
	MISSING_ENUM_NAME
	NO_GRAPH_WITH_PROCESS
	UNABLE_TO_TRANSLATE_FILTERS
	UNABLE_TO_CREATE_TYPEDEF_CATEGORY
	UNABLE_TO_UPDATE_TYPEDEF_CATEGORY
	MISSING_GUID_FOR_DELETE
	MISSING_REQUIRED_UPDATE_PARAM
	JSON_ERROR
	NOTHING_TO_ENCODE
	MISSING_REQUIRED_QUERY_PARAM
	NO_CONNECTION_ADMIN
	MISSING_PERSONA_ID
	MISSING_PURPOSE_ID
	NO_ATLAN_TAG_FOR_PURPOSE
	NO_USERS_FOR_POLICY
	MISSING_GROUP_NAME
	MISSING_USER_NAME
	MISSING_USER_EMAIL
	MISSING_GROUP_ALIAS
	NOT_AGGREGATION_METRIC
	MISSING_TOKEN_ID
	MISSING_TOKEN_NAME
	INVALID_LINEAGE_DIRECTION
	INVALID_URL
	INACCESSIBLE_URL
	NO_ATLAN_CLIENT
	MISSING_REQUIRED_RELATIONSHIP_PARAM
	INVALID_QUERY
	MISSING_CREDENTIALS
	FULL_UPDATE_ONLY
	CATEGORIES_CANNOT_BE_ARCHIVED
	AUTHENTICATION_PASSTHROUGH
	NO_API_TOKEN
	EMPTY_API_TOKEN
	INVALID_API_TOKEN
	EXPIRED_API_TOKEN
	PERMISSION_PASSTHROUGH
	UNABLE_TO_IMPERSONATE
	UNABLE_TO_ESCALATE
	NOT_FOUND_PASSTHROUGH
	ASSET_NOT_FOUND_BY_GUID
	ASSET_NOT_TYPE_REQUESTED
	ASSET_NOT_FOUND_BY_QN
	ROLE_NOT_FOUND_BY_NAME
	ROLE_NOT_FOUND_BY_ID
	ATLAN_TAG_NOT_FOUND_BY_NAME
	ATLAN_TAG_NOT_FOUND_BY_ID
	CM_NOT_FOUND_BY_NAME
	CM_NOT_FOUND_BY_ID
	CM_NO_ATTRIBUTES
	CM_ATTR_NOT_FOUND_BY_NAME
	CM_ATTR_NOT_FOUND_BY_ID
	ENUM_NOT_FOUND
	ASSET_NOT_FOUND_BY_NAME
	NO_CATEGORIES
	CONNECTION_NOT_FOUND_BY_NAME
	GROUP_NOT_FOUND_BY_NAME
	GROUP_NOT_FOUND_BY_ID
	USER_NOT_FOUND_BY_NAME
	USER_NOT_FOUND_BY_ID
	USER_NOT_FOUND_BY_EMAIL
	GROUP_NOT_FOUND_BY_ALIAS
	PERSONA_NOT_FOUND_BY_NAME
	PURPOSE_NOT_FOUND_BY_NAME
	COLLECTION_NOT_FOUND_BY_NAME
	QUERY_NOT_FOUND_BY_NAME
	CONFLICT_PASSTHROUGH
	RESERVED_SERVICE_TYPE
	RATE_LIMIT_PASSTHROUGH
	ERROR_PASSTHROUGH
	DUPLICATE_CUSTOM_ATTRIBUTES
	UNABLE_TO_DESERIALIZE
	UNABLE_TO_PARSE_ORIGINAL_QUERY
	FOUND_UNEXPECTED_ASSET_TYPE
	RETRIES_INTERRUPTED
	RETRY_OVERRUN
	TYPEDEF_NOT_FOUND_BY_NAME
)

type ErrorInfo

type ErrorInfo struct {
	HTTPErrorCode int
	ErrorID       string
	ErrorMessage  string
	UserAction    string
}

type FluentSearch

type FluentSearch struct {
	Wheres              []model.Query
	WhereNots           []model.Query
	WhereSomes          []model.Query
	MinSomes            *int
	Sorts               []model.SortItem
	PageSize            int
	Aggregations        map[string]interface{}
	IncludesOnResults   []string
	IncludesOnRelations []string
}

FluentSearch is a struct that represents a fluent search query.

func NewFluentSearch

func NewFluentSearch() *FluentSearch

func (*FluentSearch) ActiveAssets

func (fs *FluentSearch) ActiveAssets() *FluentSearch

ActiveAssets Returns a query that will only match assets that are active in Atlan.

func (*FluentSearch) Aggregate

func (fs *FluentSearch) Aggregate(name string, aggregation map[string]interface{}) *FluentSearch

Aggregate adds an aggregation to the Aggregations map.

func (*FluentSearch) ArchivedAssets

func (fs *FluentSearch) ArchivedAssets() *FluentSearch

ArchivedAssets Returns a query that will only match assets that are archived (soft-deleted) in Atlan.

func (*FluentSearch) AssetType

func (fs *FluentSearch) AssetType(of string) *FluentSearch

AssetType Returns a query that will only match assets of the type provided.

func (*FluentSearch) AssetTypes

func (fs *FluentSearch) AssetTypes(oneOf []string) *FluentSearch

AssetTypes Returns a query that will only match assets that are one of the types provided.

func (*FluentSearch) Execute

func (fs *FluentSearch) Execute() ([]*model.IndexSearchResponse, error)

Execute performs the search and returns the results.

func (*FluentSearch) IncludeOnRelations

func (fs *FluentSearch) IncludeOnRelations(fields ...string) *FluentSearch

IncludeOnRelations adds fields to the IncludesOnRelations slice.

func (*FluentSearch) IncludeOnResults

func (fs *FluentSearch) IncludeOnResults(fields ...string) *FluentSearch

IncludeOnResults adds fields to the IncludesOnResults slice.

func (*FluentSearch) MinSome

func (fs *FluentSearch) MinSome(minSomes int) *FluentSearch

MinSome sets the MinSomes field.

func (*FluentSearch) PageSizes

func (fs *FluentSearch) PageSizes(size int) *FluentSearch

PageSize sets the PageSize field.

func (*FluentSearch) Sort

func (fs *FluentSearch) Sort(field string, order atlan.SortOrder) *FluentSearch

Sort adds a SortItem to the Sorts slice.

func (*FluentSearch) SortByGuidDefault

func (fs *FluentSearch) SortByGuidDefault() *FluentSearch

Sort by GUID by default only if not already specified by the developer

func (*FluentSearch) ToRequest

func (fs *FluentSearch) ToRequest() *model.IndexSearchRequest

ToRequest converts FluentSearch to IndexSearchRequest.

func (*FluentSearch) Where

func (fs *FluentSearch) Where(queries ...model.Query) *FluentSearch

Where adds a TermQuery to the Wheres slice.

func (*FluentSearch) WhereNot

func (fs *FluentSearch) WhereNot(queries ...model.Query) *FluentSearch

WhereNot adds a BoolQuery with MustNot clause to the WhereNots slice.

func (*FluentSearch) WhereSome

func (fs *FluentSearch) WhereSome(queries ...model.Query) *FluentSearch

WhereSome adds a BoolQuery with Should clause to the WhereSomes slice.

type GlossaryClient

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

GlossaryClient defines the client for interacting with the model API.

func NewGlossaryClient

func NewGlossaryClient(ac *AtlanClient) *GlossaryClient

NewGlossaryClient creates a new GlossaryClient instance.

type IndexSearchIterator

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

func NewIndexSearchIterator

func NewIndexSearchIterator(pageSize int, initialRequest model.IndexSearchRequest) *IndexSearchIterator

func (*IndexSearchIterator) CurrentPage

func (it *IndexSearchIterator) CurrentPage() int

CurrentPage returns the current page number.

func (*IndexSearchIterator) HasMoreResults

func (it *IndexSearchIterator) HasMoreResults() bool

HasMoreResults returns whether there are more results available.

func (*IndexSearchIterator) IteratePages

func (it *IndexSearchIterator) IteratePages() ([]*model.IndexSearchResponse, error)

IteratePages returns all pages of search results.

func (*IndexSearchIterator) NextPage

NextPage returns the next page of search results.

type InternalKeywordTextField

type InternalKeywordTextField struct {
	*KeywordTextField
	InternalFieldName string
}

InternalKeywordTextField Represents any field in Atlan that can be searched by keyword or text-based search operations, and can also be searched against a special internal field directly within Atlan

func NewInternalKeywordTextField

func NewInternalKeywordTextField(atlanFieldName, keywordFieldName, textFieldName, internalFieldName string) *InternalKeywordTextField

type InvalidRequestError

type InvalidRequestError struct{ AtlanError }

type KeywordField

type KeywordField struct {
	*SearchableField
	KeywordFieldName string
}

KeywordField Represents any field in Atlan that can be searched only by keyword (no text-analyzed fuzziness).

func NewKeywordField

func NewKeywordField(atlanFieldName, keywordFieldName string) *KeywordField

func (*KeywordField) Eq

func (kf *KeywordField) Eq(value string) model.Query

func (*KeywordField) GetKeywordFieldName

func (kf *KeywordField) GetKeywordFieldName() string

func (*KeywordField) Within

func (kf *KeywordField) Within(values []string) model.Query

Within Returns a query that will match all assets whose field has a value that exactly matches at least one of the provided string values.

type KeywordTextField

type KeywordTextField struct {
	*SearchableField
	KeywordFieldName string
	TextFieldName    string
}

KeywordTextField Represents any field in Atlan that can be searched by keyword or text-based search operations.

func NewKeywordTextField

func NewKeywordTextField(atlanFieldName, keywordFieldName string, textfieldname string) *KeywordTextField

func (*KeywordTextField) Eq

func (kf *KeywordTextField) Eq(value string) model.Query

Eq Returns a query that will match all assets whose field has a value that exactly matches the provided string value.

func (*KeywordTextField) StartsWith

func (kf *KeywordTextField) StartsWith(value string, caseInsensitive *bool) model.Query

StartsWith Returns a query that will match all assets whose field has a value that starts with the provided value. Note that this can also be a case-insensitive match.

type KeywordTextStemmedField

type KeywordTextStemmedField struct {
	*KeywordTextField
	StemmedFieldName string
}

KeywordTextStemmedField Represents any field in Atlan that can be searched by keyword or text-based search operations, including a stemmed variation of the text analyzers.

func NewKeywordTextStemmedField

func NewKeywordTextStemmedField(atlanFieldName, keywordFieldName, textFieldName, stemmedFieldName string) *KeywordTextStemmedField

func (*KeywordTextStemmedField) MatchStemmed

func (ktsf *KeywordTextStemmedField) MatchStemmed(value string) model.Query

MatchStemmed Returns a query that will textually match the provided value against the field. This analyzes the provided value according to the same analysis carried out on the field

type LogicError

type LogicError struct{ AtlanError }

type MaterialisedViewFields

type MaterialisedViewFields struct {
	SQLFields
	REFRESH_MODE         *KeywordField
	REFRESH_METHOD       *KeywordField
	STALENESS            *KeywordField
	STALE_SINCE_DATE     *NumericField
	COLUMN_COUNT         *NumericField
	ROW_COUNT            *NumericField
	SIZE_BYTES           *NumericField
	IS_QUERY_PREVIEW     *BooleanField
	QUERY_PREVIEW_CONFIG *KeywordField
	ALIAS                *KeywordField
	IS_TEMPORARY         *BooleanField
	DEFINITION           *KeywordField
	COLUMNS              *RelationField
	ATLAN_SCHEMA         *RelationField
}

func NewSearchMaterialisedView

func NewSearchMaterialisedView() *MaterialisedViewFields

type NotFoundError

type NotFoundError struct{ AtlanError }

type NumericField

type NumericField struct {
	*SearchableField
	NumericFieldName string
}

NumericField Represents any field in Atlan that can be searched using only numeric search operations.

func NewNumericField

func NewNumericField(atlanFieldName, numericFieldName string) *NumericField

func (*NumericField) Between

func (nf *NumericField) Between(minimum, maximum *float64) model.Query

Between Returns a query that will match all assets whose field has a value between the minimum and maximum specified values, inclusive.

func (*NumericField) Eq

func (nf *NumericField) Eq(value interface{}) model.Query

Eq Returns a query that will match all assets whose field has a value that exactly matches the provided numeric value.

func (*NumericField) GetNumericFieldName

func (nf *NumericField) GetNumericFieldName() string

GetNumericFieldName Returns the name of the numeric field index for this attribute in Elastic.

func (*NumericField) Gt

func (nf *NumericField) Gt(value *float64) model.Query

Gt Returns a query that will match all assets whose field has a value that is strictly greater than the provided numeric value.

func (*NumericField) Gte

func (nf *NumericField) Gte(value *float64) model.Query

Gte Returns a query that will match all assets whose field has a value that is greater than or equal to the provided numeric value.

func (*NumericField) Lt

func (nf *NumericField) Lt(value *float64) model.Query

Lt Returns a query that will match all assets whose field has a value that is strictly less than the provided numeric value.

func (*NumericField) Lte

func (nf *NumericField) Lte(value *float64) model.Query

Lte Returns a query that will match all assets whose field has a value that is less than or equal to the provided numeric value.

type PermissionError

type PermissionError struct{ AtlanError }

type RateLimitError

type RateLimitError struct{ AtlanError }

type RelationField

type RelationField struct {
	AtlanFieldName string
}

func NewRelationField

func NewRelationField(atlanFieldName string) *RelationField

func (*RelationField) GetAtlanFieldName

func (rf *RelationField) GetAtlanFieldName() string

type SQLFields

type SQLFields struct {
	CatalogFields
	QUERY_COUNT             *NumericField
	QUERY_USER_COUNT        *NumericField
	QUERY_USER_MAP          *KeywordField
	QUERY_COUNT_UPDATED_AT  *NumericField
	DATABASE_NAME           *KeywordTextField
	DATABASE_QUALIFIED_NAME *KeywordField
	SCHEMA_NAME             *KeywordTextField
	SCHEMA_QUALIFIED_NAME   *KeywordField
	TABLE_NAME              *KeywordTextField
	TABLE_QUALIFIED_NAME    *KeywordField
	VIEW_NAME               *KeywordTextField
	VIEW_QUALIFIED_NAME     *KeywordField
	IS_PROFILED             *BooleanField
	LAST_PROFILED_AT        *NumericField
	DBT_SOURCES             *RelationField
	SQL_DBT_MODELS          *RelationField
	SQL_DBT_SOURCES         *RelationField
	DBT_MODELS              *RelationField
	DBT_TESTS               *RelationField
}

type SaveRequest

type SaveRequest struct {
	Entities []AtlanObject `json:"entities"`
}

type SearchAssets

type SearchAssets struct {
	Glossary         *AtlasGlossaryFields
	Table            *AtlasTableFields
	Column           *ColumnFields
	Connection       *ConnectionFields
	MaterialisedView *MaterialisedViewFields
	View             *ViewFields
}

SearchAssets Struct to represent assets for searching

type SearchableField

type SearchableField struct {
	AtlanFieldName    string
	ElasticFieldName  string
	InternalFieldName string
}

SearchableField represents a field that can be searched on depending upon the type of search

func NewSearchableField

func NewSearchableField(atlanFieldName, elasticFieldName string) *SearchableField

func (*SearchableField) GetAtlanFieldName

func (sf *SearchableField) GetAtlanFieldName() string

func (*SearchableField) GetElasticFieldName

func (sf *SearchableField) GetElasticFieldName() string

func (*SearchableField) GetInternalFieldName

func (sf *SearchableField) GetInternalFieldName() string

func (*SearchableField) HasAnyValue

func (sf *SearchableField) HasAnyValue() model.Query

HasAnyValue Returns a query that will only match assets that have some non-null, non-empty value (no matter what actual value) for the field.

func (*SearchableField) Order

func (sf *SearchableField) Order(order atlan.SortOrder) model.SortItem

Order Returns a condition to sort results by the field, in the specified order.

type TextField

type TextField struct {
	*SearchableField
	TextFieldName string
}

TextField Represents any field in Atlan that can only be searched using text-related search operations.

func NewTextField

func NewTextField(atlanFieldName, textFieldName string) *TextField

func (*TextField) GetTextFieldName

func (tf *TextField) GetTextFieldName() string

GetTextFieldName Returns the name of the text field index for this attribute in Elastic.

func (*TextField) Match

func (tf *TextField) Match(value string) model.Query

Match Returns a query that will textually match the provided value against the field. This analyzes the provided value according to the same analysis carried out on the field (for example, tokenization, stemming, and so on).

type TypeDefClient

type TypeDefClient struct {
	Client *AtlanClient
}

func NewTypeDefClient

func NewTypeDefClient(client *AtlanClient) *TypeDefClient

NewTypeDefClient creates a new instance of TypeDefClient.

func (*TypeDefClient) Create

func (c *TypeDefClient) Create(typedef model.TypeDef) (*model.TypeDefResponse, error)

func (*TypeDefClient) Purge

func (c *TypeDefClient) Purge(name string, typedefType model.TypeDef) error

func (*TypeDefClient) Update

func (c *TypeDefClient) Update(typedef model.TypeDef) (*model.TypeDefResponse, error)

type ViewFields

type ViewFields struct {
	SQLFields
	COLUMN_COUNT         *NumericField
	ROW_COUNT            *NumericField
	SIZE_BYTES           *NumericField
	IS_QUERY_PREVIEW     *BooleanField
	QUERY_PREVIEW_CONFIG *KeywordField
	ALIAS                *KeywordField
	IS_TEMPORARY         *BooleanField
	DEFINITION           *KeywordField
	COLUMNS              *RelationField
	QUERIES              *RelationField
	ATLAN_SCHEMA         *RelationField
}

func NewSearchView

func NewSearchView() *ViewFields

Jump to

Keyboard shortcuts

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