gravitino.api.authorization.securable_objects.SecurableObjects¶
- class gravitino.api.authorization.securable_objects.SecurableObjects¶
Bases:
objectThe helper class for SecurableObject.
- __init__()¶
Methods
__init__()of(type_, names, privileges)Create the SecurableObject with the given names.
of_catalog(catalog, privileges)Create the catalog SecurableObject with the given catalog name and privileges.
of_fileset(schema, fileset, privileges)Create the model SecurableObject with the given securable schema object, fileset name and
of_job_template(job_template, privileges)Create the job template SecurableObject with the given job template name and privileges.
of_metalake(metalake, privileges)Create the metalake SecurableObject with the given metalake name and privileges.
of_model(schema, model, privileges)Create the model SecurableObject with the given securable schema object, model name and
of_policy(policy, privileges)Create the policy SecurableObject with the given policy name and privileges.
of_schema(catalog, schema, privileges)Create the schema SecurableObject with the given securable catalog object, schema name and privileges.
of_table(schema, table, privileges)Create the table SecurableObject with the given securable schema object, table name and privileges.
of_tag(tag_name, privileges)Create the tag SecurableObject with the given tag name and privileges.
of_topic(schema, topic, privileges)Create the topic SecurableObject with the given securable schema object ,topic name and privileges.
parse(full_name, type_, privileges)Create a SecurableObject from the given full name.
- class SecurableObjectImpl(parent: str, name: str, type_: Type, privileges: list[gravitino.api.authorization.privileges.Privilege])¶
Bases:
MetadataObjectImpl,SecurableObject- class Type(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
EnumThe type of object in the Gravitino system. Every type will map one kind of the entity of the underlying system.
- CATALOG = 'catalog'¶
A catalog is a collection of metadata from a specific metadata source, like Apache Hive catalog, Apache Iceberg catalog, JDBC catalog, etc.
- COLUMN = 'column'¶
A column is a sub-collection of the table that represents a group of same type data.
- FILESET = 'fileset'¶
A fileset is mapped to a directory on a file system like HDFS, S3, ADLS, GCS, etc.
- JOB = 'job'¶
A job represents a data processing task in Gravitino.
- JOB_TEMPLATE = 'job_template'¶
A job template represents a reusable template for creating jobs in Gravitino.
- METALAKE = 'metalake'¶
A metalake is a concept of tenant. It means an organization. A metalake contains many data sources.
- MODEL = 'model'¶
A model is mapped to the model artifact in ML.
- POLICY = 'policy'¶
A policy can be associated with a metadata object for data governance and similar purposes.
- ROLE = 'role'¶
A role is an object contains specific securable objects with privileges.
- SCHEMA = 'schema'¶
“A schema is a sub collection of the catalog. The schema can contain filesets, tables, topics, etc.
- TABLE = 'table'¶
A table is mapped the table of relational data sources like Apache Hive, MySQL, etc.
- TAG = 'tag'¶
A tag is used to help manage other metadata object.
- TOPIC = 'topic'¶
A topic is mapped the topic of messaging data sources like Apache Kafka, Apache Pulsar, etc.
- full_name() → str¶
The full name of the object.
Full name will be separated by “.” to represent a string identifier of the object, like catalog, catalog.table, etc.
- Returns:
str: The name of the object.
- name() → str¶
The name of the object.
- Returns:
str: The name of the object.
- parent() → str | None¶
The parent full name of the object.
If the object doesn’t have parent, this method will return None.
- Returns:
Optional[str]: The parent full name of the object.
- privileges() → list[gravitino.api.authorization.privileges.Privilege]¶
The privileges of the securable object. For example: If the securable object is a table, the privileges could be READ TABLE, WRITE TABLE, etc. If a schema has the privilege of LOAD TABLE. It means the role can load all tables of the schema.
- returns:
The privileges of the securable object.
- static of(type_: Type, names: list[str], privileges: list[gravitino.api.authorization.privileges.Privilege]) → SecurableObject¶
Create the SecurableObject with the given names.
- Args:
type_ (MetadataObject.Type): The securable object type. names (list[str]): The names of the securable object. privileges (list[Privilege]): The securable object privileges.
- Returns:
SecurableObject: he created SecurableObject
- static of_catalog(catalog: str, privileges: list[Privilege]) → SecurableObjectImpl¶
Create the catalog SecurableObject with the given catalog name and privileges.
- Args:
catalog (str): The catalog name privileges (list[Privilege]): The privileges of the catalog.
- Returns:
SecurableObjectImpl: The created catalog SecurableObject.
- static of_fileset(schema: SecurableObject, fileset: str, privileges: list[Privilege]) → SecurableObjectImpl¶
Create the model SecurableObject with the given securable schema object, fileset name and
- Args:
schema (SecurableObject): The schema securable object fileset (str): The fileset name privileges (list[Privilege]): The privileges of the fileset
- Returns:
SecurableObjectImpl: The created fileset SecurableObject.
- static of_job_template(job_template: str, privileges: list[Privilege]) → SecurableObjectImpl¶
Create the job template SecurableObject with the given job template name and privileges.
- Args:
job_template (str): The job template name privileges (list[Privilege]): The privileges of the job template
- Returns:
SecurableObjectImpl: The created job template SecurableObject.
- static of_metalake(metalake: str, privileges: list[Privilege]) → SecurableObjectImpl¶
Create the metalake SecurableObject with the given metalake name and privileges.
- Args:
metalake (str): The metalake name. privileges (list[Privilege]): The privileges of the metalake.
- Returns:
SecurableObjectImpl: The created metalake SecurableObject.
- static of_model(schema: SecurableObject, model: str, privileges: list[Privilege]) → SecurableObjectImpl¶
Create the model SecurableObject with the given securable schema object, model name and
- Args:
schema (SecurableObject): The schema securable object. model (str): The model name. privileges (list[Privilege]): The privileges of the fileset.
- Returns:
SecurableObjectImpl: The created model SecurableObject.
- static of_policy(policy: str, privileges: list[Privilege]) → SecurableObjectImpl¶
Create the policy SecurableObject with the given policy name and privileges.
- Args:
policy (str): The policy name privileges (list[Privilege]): The privileges of the policy
- Returns:
SecurableObjectImpl: _descriThe created policy SecurableObject.
- static of_schema(catalog: SecurableObject, schema: str, privileges: list[Privilege]) → SecurableObjectImpl¶
Create the schema SecurableObject with the given securable catalog object, schema name and privileges.
- Args:
catalog (SecurableObject): The catalog securable object. schema (str): The schema name. privileges (list[Privilege]): The privileges of the schema.
- Returns:
SecurableObjectImpl: The created schema SecurableObject.
- static of_table(schema: SecurableObject, table: str, privileges: list[Privilege]) → SecurableObjectImpl¶
Create the table SecurableObject with the given securable schema object, table name and privileges.
- Args:
schema (SecurableObject): The schema securable object. table (str): The table name. privileges (list[Privilege]): The privileges of the table.
- Returns:
SecurableObjectImpl: The created table SecurableObject.
- static of_tag(tag_name: str, privileges: list[Privilege]) → SecurableObjectImpl¶
Create the tag SecurableObject with the given tag name and privileges.
- Args:
tag_name (str): The tag name privileges (list[Privilege]): The privileges of the tag
- Returns:
SecurableObjectImpl: The created tag SecurableObject.
- static of_topic(schema: SecurableObject, topic: str, privileges: list[Privilege]) → SecurableObjectImpl¶
Create the topic SecurableObject with the given securable schema object ,topic name and privileges.
- Args:
schema (SecurableObject): The schema securable object topic (str): The topic name privileges (list[Privilege]): The privileges of the topic
- Returns:
SecurableObjectImpl: The created topic SecurableObject
- static parse(full_name: str, type_: Type, privileges: list[gravitino.api.authorization.privileges.Privilege]) → SecurableObject¶
Create a SecurableObject from the given full name.
- Args:
full_name (str): The full name of securable object. type_ (MetadataObject.Type): The securable object type. privileges (list[Privilege]): The securable object privileges.
- Returns:
SecurableObject: The created SecurableObject.