Esempio n. 1
0
    def test_default_config_with_mode(self):
        config = default_config(mode="prod")
        auth = auth_from_config(config)
        self.assertEqual(config["url"], default_url(mode="prod"))
        self.assertEqual(auth, None)

        client = client_from_config(config)
        self.assertEqual(client.http_client.auth_strategy, None)
        self.assertEqual(client.url, default_url(mode="prod"))
Esempio n. 2
0
    def test_default_config_with_mode(self):
        config = default_config(mode="prod")
        auth = auth_from_config(config)
        self.assertEqual(config["url"], default_url(mode="prod"))
        self.assertEqual(auth, None)

        client = client_from_config(config)
        self.assertEqual(client.http_client.auth_strategy, None)
        self.assertEqual(client.url, default_url(mode="prod"))
Esempio n. 3
0
#!/usr/bin/python
"""
Make sure you have your environment setup!
1. You need Python requests >= 2.3.0
2. You need the datacat module directory in your path.
"""

from datacat import client_from_config
from datacat.config import default_config

import pprint

client = client_from_config(default_config("exo", "prod"))

# Path example
print("\nPath Example:")

path = '/EXO/Data/Raw/cxd/run00006220-0000.cxd'

try:
    dataset = client.path(path)
    pprint.pprint(dataset.__dict__)
except Exception as e:
    print("Error processing request:" + str(e))

# Children example

print("\nChildren Example:")
path = '/EXO/Data/Raw'

try:
Esempio n. 4
0
import os, sys
from datacat import client_from_config, config_from_file
from datacat.model import Metadata

# datacat
config_file ='./config_srs.ini'
config = config_from_file(config_file)
client = client_from_config(config)

# file/datacatalog path
file_path = os.path.abspath("../../../test/data/")


def main():

    # Will generate 2 datasets, in this case we are only using 1 of the generated 2
    created_datasets = create_datasets()
    dataset001 = created_datasets[0]

    # *****************************************************
    # *****************************************************
    # ******* GROUP DEPENDENCY CREATION BEGINS HERE *******
    # *****************************************************
    # *****************************************************

    # adding the datasets with their dependentType to a groups metadata (predecessor)
    metadata = Metadata()
    dep_metadataPredecessor = {
        "dependents": str(dataset001.versionPk),
        "dependentType": "predecessor"
    }
Esempio n. 5
0
#!/usr/bin/python

"""
Make sure you have your environment setup!
1. You need Python requests >= 2.3.0
2. You need the datacat module directory in your path.
"""

from datacat import client_from_config
from datacat.config import default_config

import pprint

client = client_from_config(default_config("exo", "prod"))

# Path example
print("\nPath Example:")

path = '/EXO/Data/Raw/cxd/run00006220-0000.cxd'

try:
    dataset = client.path(path)
    pprint.pprint(dataset.__dict__)
except Exception as e:
    print("Error processing request:" + str(e))

# Children example

print("\nChildren Example:")
path = '/EXO/Data/Raw'