1
0
mirror of https://github.com/vmware/vsphere-automation-sdk-python.git synced 2024-11-23 01:49:59 -05:00
vsphere-automation-sdk-python/samples/vmc/helpers/sample_cli.py
Kunal Singh 8ec4076f9c Libraries and Samples for VMC M9 release
Signed-off-by: Kunal Singh<singhk@vmware.com>
2020-01-27 15:32:36 +05:30

49 lines
1.4 KiB
Python

"""
* *******************************************************
* Copyright (c) VMware, Inc. 2019. All Rights Reserved.
* SPDX-License-Identifier: MIT
* *******************************************************
*
* DISCLAIMER. THIS PROGRAM IS PROVIDED TO YOU "AS IS" WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, WHETHER ORAL OR WRITTEN,
* EXPRESS OR IMPLIED. THE AUTHOR SPECIFICALLY DISCLAIMS ANY IMPLIED
* WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY,
* NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
"""
__author__ = 'VMware, Inc.'
__copyright__ = 'Copyright 2019 VMware, Inc. All rights reserved.'
import argparse
"""
Builds a standard argument parser with required and optional argument groups
Most of the VMC samples require these three standard required arguments.
If any of these arguments are not required, then build your own parser
--refresh_token
--org_id
--sddc_id
"""
parser = argparse.ArgumentParser()
required_args = parser.add_argument_group(
'required arguments')
optional_args = parser.add_argument_group(
'optional arguments')
required_args.add_argument(
'--refresh-token',
required=True,
help='Refresh token obtained from CSP')
required_args.add_argument(
'--org-id',
required=True,
help='Orgization ID')
required_args.add_argument(
'--sddc-id',
required=True,
help='SDDC ID')