Skip to content

Instantly share code, notes, and snippets.

@smitmartijn
Last active June 23, 2019 09:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smitmartijn/812465dce02487149d978196410bc879 to your computer and use it in GitHub Desktop.
Save smitmartijn/812465dce02487149d978196410bc879 to your computer and use it in GitHub Desktop.
import swagger_client
from swagger_client.rest import ApiException
api_client = swagger_client.ApiClient(host="https://{}/api/ni".format("my-vrni-platform-fdqn-or-ip"))
user_creds = swagger_client.UserCredential(username="admin@local", password="VMware1!", domain=dict(domain_type="LOCAL"))
auth_api = swagger_client.AuthenticationApi(api_client=api_client)
auth_token = auth_api.create(user_creds)
print(auth_token)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment