Is there a sample yaml file for domain ingestion? ...
# ingestion
n
Is there a sample yaml file for domain ingestion? I would like to ingest a list of domains through a file using ingestions framework, any samples would be a great start
Looks like domain addition is supported thru UI and GraphQL API only not based on file.
o
Yep! We do have an example under the Kafka source for file-based if that is how you'd prefer to add them though: https://datahubproject.io/docs/generated/ingestion/sources/kafka#connecting-to-confluent-cloud
n
@orange-night-91387 I understand this example helps to tie an existing domain to a dataset in the ingestion process. I am just looking to create a list of domains
o
Ah okay, domains themselves are primarily managed through the UI/GraphQL like you found 🙂
n
Created a python script to create domains based on domains in a file. Sharing the script here so that it might be useful for someone else.
Copy code
from graphqlclient import GraphQLClient


def read_domain():
    f = open("domains.txt", "r")
    for domain in f:
        create_domain(domain)


def create_domain(domain):
    client = GraphQLClient(dev_url)

    print("Domain Name:", domain)

    query = """mutation createDomain($input: CreateDomainInput!) {
        createDomain(input: $input)
        }"""

    variables = {
        "input": {
            "name": domain
        }
    }

    result = client.execute(query, variables)
    print(result)


if __name__ == '__main__':
    read_domain()
g
what is the format of the domain file?
n
Its just a text input.