2 # Copyright 2019 VMware Inc.
3 # This file is part of ETSI OSM
6 # Licensed under the Apache License, Version 2.0 (the "License"); you may
7 # not use this file except in compliance with the License. You may obtain
8 # a copy of the License at
10 # http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 # License for the specific language governing permissions and limitations
18 # For those usages not covered by the Apache License, Version 2.0 please
19 # contact: osslegalrouting@vmware.com
23 from uploader
import OVFUploader
, get_version
29 Method to parse CLI arguments and execute commands accordingly
33 parser
= argparse
.ArgumentParser(description
='Utility to upload an OVF package to vCD')
35 parser
.add_argument("-v", "--version", action
="version", version
=str(get_version()),
36 help="shows version of vCD Uploader tool")
38 parser
.add_argument("ovf_file", action
="store",
39 help="filename of OVF file to upload to vCD")
41 parser
.add_argument("-l", "--vcd_url", action
="store",
43 help="URL for vCD login (ie: https://vcd.local/")
45 parser
.add_argument("-u", "--username", action
="store",
47 help="Username for vCD login")
49 parser
.add_argument("-p", "--password", action
="store",
51 help="Password for vCD login")
53 parser
.add_argument("-o", "--orgname", action
="store",
55 help="Organization name for vCD login")
57 args
= parser
.parse_args()
61 uploader
= OVFUploader(args
.ovf_file
,
63 username
=args
.username
,
64 password
=args
.password
,
66 uploader
.make_catalog()
68 uploader
.wait_for_task_completion()
69 except Exception as exp
:
74 if __name__
== "__main__":