Ejemplo n.º 1
0
def getRelationshipdef(config, args):
    typeDefKey = 'guid' if args['--name'] is None else 'name'
    typeDefVal = args['--guid'][0] if args['--name'] is None else args['--name']
    endpoint = '/api/atlas/v2/types/relationshipdef/%s/%s' % (typeDefKey,
                                                              typeDefVal)
    data = http_get('catalog', 'GET', endpoint, None, None, config)
    return data
Ejemplo n.º 2
0
def getEntityBulkHeaders(config, args):
    endpoint = '/api/atlas/v2/entity/bulk/headers'
    params = None if args['--tagUpdateStartTime'] is None else {
        'tagUpdateStartTime': args['--tagUpdateStartTime']
    }
    data = http_get('catalog', 'GET', endpoint, params, None, config)
    return data
Ejemplo n.º 3
0
def getEntityGuid(config, args):
    endpoint = '/api/atlas/v2/entity/guid/%s' % args['--guid'][0]
    params = {
        'ignoreRelationships': args['--ignoreRelationships'],
        'minExtInfo': args['--minExtInfo']
    }
    data = http_get('catalog', 'GET', endpoint, params, None, config)
    return data
Ejemplo n.º 4
0
def getTopFileTypesBySize(config, args):
    endpoint = '/mapanddiscover/reports/asset2/topFileTypesBySize'
    payload = {
        "dataSource": args['--datasource'] or '',
        "registeredSourceGroup": args['--registeredSourceGroup'] or ''
    }
    data = http_get('guardian', 'POST', endpoint, None, payload, config)
    return data
Ejemplo n.º 5
0
def getEntityAudit(config, args):
    endpoint = '/api/atlas/v2/entity/%s/audit' % args['--guid'][0]
    params = {'count': args['--count']}
    if args['--auditAction']:
        params['auditAction'] = args['--auditAction']
    if args['--startKey']:
        params['startKey'] = args['--startKey']
    data = http_get('catalog', 'GET', endpoint, params, None, config)
    return data
Ejemplo n.º 6
0
def getAssetDistributionByDataSource(config, args):
    endpoint = '/mapanddiscover/reports/asset2/assetDistributionByDataSource'
    payload = {
        "registeredSourceGroup": args['--registeredSourceGroup'] or '',
        "classificationCategory": args['--classificationCategory'] or '',
        "classificationName": args['--classificationName'] or ''
    }
    data = http_get('guardian', 'POST', endpoint, None, payload, config)
    return data
Ejemplo n.º 7
0
def getGlossaryTermsRelated(config, args):
    endpoint = '/api/atlas/v2/glossary/terms/%s/related' % args['--termGuid']
    params = {
        'limit': args['--limit'],
        'offset': args['--offset'],
        'sort': args['--sort']
    }
    data = http_get('catalog', 'GET', endpoint, params, None, config)
    return data
Ejemplo n.º 8
0
def getGlossaryCategories(config, args):
    endpoint = '/api/atlas/v2/glossary/%s/categories' % args['--glossaryGuid']
    params = {
        'limit': args['--limit'],
        'offset': args['--offset'],
        'sort': args['--sort']
    }
    data = http_get('catalog', 'GET', endpoint, params, None, config)
    return data
Ejemplo n.º 9
0
def getEntityBulkUniqueAttributeType(config, args):
    endpoint = '/api/atlas/v2/entity/bulk/uniqueAttribute/type/%s' % args[
        '--typeName']
    params = {
        'ignoreRelationships': args['--ignoreRelationships'],
        'minExtInfo': args['--minExtInfo']
    }
    data = http_get('catalog', 'GET', endpoint, params, None, config)
    return data
Ejemplo n.º 10
0
def getFileTypeSizeTrendByDataSource(config, args):
    endpoint = '/mapanddiscover/reports/asset2/fileTypeSizeTrendByDataSource'
    payload = {
        "dataSource": args['--datasource'] or '',
        "fileType": args['--fileType'] or '',
        "registeredSourceGroup": args['--registeredSourceGroup'] or '',
        "window": args['--window'] or ''
    }
    data = http_get('guardian', 'POST', endpoint, None, payload, config)
    return data
Ejemplo n.º 11
0
def getGlossary(config, args):
    glossaryGuid = '' if args['--glossaryGuid'] is None else args[
        '--glossaryGuid']
    endpoint = '/api/atlas/v2/glossary/%s' % glossaryGuid
    params = {
        'limit': args['--limit'],
        'offset': args['--offset'],
        'sort': args['--sort']
    }
    data = http_get('catalog', 'GET', endpoint, params, None, config)
    return data
Ejemplo n.º 12
0
def runScan(config, args):
    endpoint = '/datasources/%s/scans/%s/run' % (args['--datasource'],
                                                 args['--scanName'])

    if args['--scanLevel']:
        payload = {'scanLevel': args['--scanLevel']}
    else:
        payload = None

    data = http_get('scan', 'POST', endpoint, None, payload, config)
    return data
Ejemplo n.º 13
0
def getLineage(config, args):
    endpoint = '/api/atlas/v2/lineage/%s' % args['--guid'][0]
    params = {
        'depth': args['--depth'],
        'width': args['--width'],
        'direction': args['--direction'],
        'forceNewApi': args['--forceNewApi'],
        'includeParent': args['--includeParent'],
        'getDerivedLineage': args['--getDerivedLineage']
    }
    data = http_get('catalog', 'GET', endpoint, params, None, config)
    return data
Ejemplo n.º 14
0
def newGlossaryTerm(config, args):
    glossary = getGlossary(config, args)
    glossary_guid = json.loads(glossary)[0]['guid']
    endpoint = '/api/atlas/v2/glossary/term'
    payload = {
        "name": args['--termName'],
        "anchor": {
            "glossaryGuid": glossary_guid
        },
        "status": args['--termStatus'],
        "longDescription": args['--termDescription'],
        "abbreviation": args['--termAcronym'],
        "synonyms": [],
        "seeAlso": [],
        "attributes": {}
    }
    for termGuid in args['--synonym']:
        payload['synonyms'].append({'termGuid': termGuid})

    for termGuid in args['--related']:
        payload['seeAlso'].append({'termGuid': termGuid})

    data = http_get('catalog', 'POST', endpoint, None, payload, config)
    return data


# {
#     "name":"Another Term",
#     "anchor":{"glossaryGuid":"505674a3-d8fc-4234-9038-e313829a7216"},
#     "status":"Alert",
#     "longDescription":"This is the term definition.",
#     "abbreviation":"acro1, acro2, acro3",
#     "resources":[{"displayName":"resource1","url":"https://google.com"}],
#     "synonyms":[{"termGuid":"a6bf5214-91d8-4c04-bdfc-d171bfee6eaa"},{"termGuid":"f87e4915-470a-43ac-a801-db245aa65212"}],
#     "seeAlso":[{"termGuid":"6cbfe86d-bbac-4823-a9df-d354528c99ad"}],
#     "contacts":{"Expert":[{"id":"095354ff-cae8-44ff-8120-22ec5a941b40","info":"Information here."}],"Steward":[{"id":"095354ff-cae8-44ff-8120-22ec5a941b40","info":"More information."}]},
#     "attributes":{"New Term Template":{"Employee ID":"1234"}}}
Ejemplo n.º 15
0
def getTypedefsHeaders(config, args):
    endpoint = '/api/atlas/v2/types/typedefs/headers'
    data = http_get('catalog', 'GET', endpoint, None, None, config)
    return data
Ejemplo n.º 16
0
def getRegisteredSourceGroupsWithAssets(config, args):
    endpoint = '/mapanddiscover/reports/asset2/registeredSourceGroupsWithAssets'
    data = http_get('guardian', 'GET', endpoint, None, None, config)
    return data
Ejemplo n.º 17
0
def getEntityUniqueAttributeTypeHeader(config, args):
    endpoint = '/api/atlas/v2/entity/uniqueAttribute/type/%s/header' % args[
        '--typeName']
    params = {'attr:' + args['--attrKey']: args['--attrVal']}
    data = http_get('catalog', 'GET', endpoint, params, None, config)
    return data
Ejemplo n.º 18
0
def getGlossaryTerms(config, args):
    endpoint = '/api/atlas/v2/glossary/%s/terms' % args['--glossaryGuid']
    data = http_get('catalog', 'GET', endpoint, None, None, config)
    return data
Ejemplo n.º 19
0
def getEntityBusinessmetadataImportTemplate(config, args):
    endpoint = '/api/atlas/v2/entity/businessmetadata/import/template'
    data = http_get('catalog', 'GET', endpoint, None, None, config)
    return data
Ejemplo n.º 20
0
def getDatasources(config, args):
    endpoint = '/datasources'
    data = http_get('scan', 'GET', endpoint, None, None, config)
    return data
Ejemplo n.º 21
0
def getLineageUniqueAttributeType(config, args):
    endpoint = '/api/atlas/v2/lineage/uniqueAttribute/type/%s' % args[
        '--typeName']
    params = {'depth': args['--depth'], 'direction': args['--direction']}
    data = http_get('catalog', 'GET', endpoint, params, None, config)
    return data
Ejemplo n.º 22
0
def getDatasource(config, args):
    endpoint = '/datasources/%s' % args['--datasource']
    data = http_get('scan', 'GET', endpoint, None, None, config)
    return data
Ejemplo n.º 23
0
def getSystemScanRulesetsSettings(config, args):
    endpoint = '/systemScanRulesets/settings'
    data = http_get('scan', 'GET', endpoint, None, None, config)
    return data
Ejemplo n.º 24
0
def getScanRulesets(config, args):
    endpoint = '/scanrulesets'
    data = http_get('scan', 'GET', endpoint, None, None, config)
    return data
Ejemplo n.º 25
0
def getScanHistory(config, args):
    endpoint = '/datasources/%s/scans/%s/listHistory' % (args['--datasource'],
                                                         args['--scanName'])
    data = http_get('scan', 'GET', endpoint, None, None, config)
    return data
Ejemplo n.º 26
0
def getEntityGuidClassifications(config, args):
    endpoint = '/api/atlas/v2/entity/guid/%s/classifications' % args['--guid'][
        0]
    data = http_get('catalog', 'GET', endpoint, None, None, config)
    return data
Ejemplo n.º 27
0
def getGlossaryCategory(config, args):
    endpoint = '/api/atlas/v2/glossary/category/%s' % args['--categoryGuid']
    data = http_get('catalog', 'GET', endpoint, None, None, config)
    return data
Ejemplo n.º 28
0
def getEntityGuidHeader(config, args):
    endpoint = '/api/atlas/v2/entity/guid/%s/header' % args['--guid'][0]
    data = http_get('catalog', 'GET', endpoint, None, None, config)
    return data
Ejemplo n.º 29
0
def getRelationshipGuid(config, args):
    endpoint = '/api/atlas/v2/relationship/guid/%s' % args['--guid'][0]
    params = {'extendedInfo': args['--extendedInfo']}
    data = http_get('catalog', 'GET', endpoint, params, None, config)
    return data
Ejemplo n.º 30
0
def getScanFilters(config, args):
    endpoint = '/datasources/%s/scans/%s/filters' % (args['--datasource'],
                                                     args['--scanName'])
    data = http_get('scan', 'GET', endpoint, None, None, config)
    return data