/
catalog.clj
60 lines (50 loc) · 1.89 KB
/
catalog.clj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
(ns happygapi.datacatalog.catalog
"Google Cloud Data Catalog API: catalog.
A fully managed and highly scalable data discovery and metadata management service.
See: https://cloud.google.com/data-catalog/docs/api/reference/rest/v1beta1/catalog"
(:require [cheshire.core :as json]
[clj-http.client :as http]
[happy.util :as util]))
(defn search$
"https://cloud.google.com/data-catalog/docs/api/reference/rest/v1beta1/catalog/search
Required parameters: none
Optional parameters: none
Body:
{:scope {:includeGcpPublicDatasets boolean,
:includeProjectIds [string],
:includeOrgIds [string]},
:pageToken string,
:orderBy string,
:pageSize integer,
:query string}
Searches Data Catalog for multiple resources like entries, tags that
match a query.
This is a custom method
(https://cloud.google.com/apis/design/custom_methods) and does not return
the complete resource, only the resource identifier and high level
fields. Clients can subsequentally call `Get` methods.
Note that Data Catalog search queries do not guarantee full recall. Query
results that match your query may not be returned, even in subsequent
result pages. Also note that results returned (and not returned) can vary
across repeated search queries.
See [Data Catalog Search
Syntax](/data-catalog/docs/how-to/search-reference) for more information."
{:scopes ["https://www.googleapis.com/auth/cloud-platform"]}
[auth parameters body]
{:pre [(util/has-keys? parameters #{})]}
(util/get-response
(http/post
(util/get-url
"https://datacatalog.googleapis.com/"
"v1beta1/catalog:search"
#{}
parameters)
(merge-with
merge
{:content-type :json,
:body (json/generate-string body),
:throw-exceptions false,
:query-params parameters,
:accept :json,
:as :json}
auth))))