vraapiclient/helpers.py
def authenticate(host, user, password, tenant):
    """
	Function that will authenticate a user and build.

	Parameters:
		host = vRA Appliance fqdn.
		user = user account with access to the vRA portal.
		passowrd = valid password for above user.
		tenant = tenant for the user.
	"""

    headers = {
        'Content-Type': 'application/json',
        'Accept': 'application/json'
    }
    payload = {"username": user, "password": password, "tenant": tenant}
    url = 'https://' + host + '/identity/api/tokens'
    r = requests.post(url=url,
                      data=json.dumps(payload),
                      headers=headers,
                      verify=False)
    checkResponse(r)
    response = r.json()

    usr_token = 'Bearer ' + response['id']

    return usr_token

	Function that will authenticate a user and build.

	Parameters:
		host = vRA Appliance fqdn.
		user = user account with access to the vRA portal.
		passowrd = valid password for above user.
		tenant = tenant for the user.
	
Function that will authenticate a user and build.
Parameters:
host = vRA Appliance fqdn.
user = user account with access to the vRA portal.
passowrd = valid password for above user.
tenant = tenant for the user.
Function that will authenticate a user and build . Parameters : host = vRA Appliance fqdn . user = user account with access to the vRA portal . passowrd = valid password for above user . tenant = tenant for the user .
def authenticate(host, user, password, tenant):
    headers = {
        'Content-Type': 'application/json',
        'Accept': 'application/json'
    }
    payload = {"username": user, "password": password, "tenant": tenant}
    url = 'https://' + host + '/identity/api/tokens'
    r = requests.post(url=url,
                      data=json.dumps(payload),
                      headers=headers,
                      verify=False)
    checkResponse(r)
    response = r.json()
    usr_token = 'Bearer ' + response['id']
    return usr_token
def authenticate ( host , user , password , tenant ) : headers = { 'Content-Type' : 'application/json' , 'Accept' : 'application/json' } payload = { "username" : user , "password" : password , "tenant" : tenant } url = 'https://' + host + '/identity/api/tokens' r = requests . post ( url = url , data = json . dumps ( payload ) , headers = headers , verify = False ) checkResponse ( r ) response = r . json ( ) usr_token = 'Bearer ' + response [ 'id' ] return usr_token
Function that will authenticate a user and build.
Function that will authenticate a user and build .
"""
	Function that will authenticate a user and build.

	Parameters:
		host = vRA Appliance fqdn.
		user = user account with access to the vRA portal.
		passowrd = valid password for above user.
		tenant = tenant for the user.
	"""
host
user
password
tenant