Filtering
Some checks are pending
gl/check check status: pending (3e3e86ceca03ea7c1284bbd033f2a35422b6d99d)
Some checks are pending
gl/check check status: pending (3e3e86ceca03ea7c1284bbd033f2a35422b6d99d)
This commit is contained in:
parent
2ed3bc4bf5
commit
3e3e86ceca
@ -22,6 +22,11 @@ def parse_args():
|
||||
help='Option deletes old index with the same name and creates new '
|
||||
'one.'
|
||||
)
|
||||
parser.add_argument(
|
||||
'--all-doc-types',
|
||||
action='store_true',
|
||||
help='Upload all doc-types instead of only umn, api-ref and dev'
|
||||
)
|
||||
parser.add_argument(
|
||||
'--hosts',
|
||||
metavar='<host:port>',
|
||||
@ -62,7 +67,8 @@ def main():
|
||||
|
||||
logging.debug("Obtaining data from otc_metadata")
|
||||
data = getData(
|
||||
environment=args.target_environment
|
||||
environment=args.target_environment,
|
||||
all_doc_types=args.all_doc_types
|
||||
)
|
||||
|
||||
logging.debug("Indexing data into OpenSearch")
|
||||
@ -76,10 +82,16 @@ def main():
|
||||
)
|
||||
|
||||
|
||||
def getData(environment):
|
||||
return metadata.service_types_with_doc_types(
|
||||
def getData(environment, all_doc_types):
|
||||
metadatadata = metadata.service_types_with_doc_types(
|
||||
environment=environment
|
||||
)
|
||||
if not all_doc_types:
|
||||
for i, doc in enumerate(metadatadata["docs"], 0):
|
||||
if doc["type"] not in ["umn", "api-ref", "dev"]:
|
||||
metadatadata["docs"].pop(i)
|
||||
|
||||
return metadatadata
|
||||
|
||||
|
||||
def indexData(deleteIndex, hosts, index, username, password, data):
|
||||
|
Loading…
x
Reference in New Issue
Block a user