{"id":22960,"library":"vmware-vapi-common-client","title":"VMware vAPI Common Services Client Bindings","description":"Python bindings for VMware vAPI Common Services, providing client libraries to interact with VMware Cloud Foundation (VCF) APIs. Current version 2.61.2 (older stable). The VCF SDK Python releases (up to 9.0.0.0) have replaced this package with the vcf-sdk-python namespace.","status":"maintenance","version":"2.61.2","language":"python","source_language":"en","source_url":"https://github.com/vmware/vcf-sdk-python","tags":["vmware","vapi","cloud-foundation","sdk"],"install":[{"cmd":"pip install vmware-vapi-common-client==2.61.2","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"StubConfiguration is in vmware.vapi.bindings.stub, not common_client.","wrong":"from vmware.vapi.common_client import StubConfiguration","symbol":"StubConfiguration","correct":"from vmware.vapi.bindings.stub import StubConfiguration"},{"note":"VapiClient is in core module, not a separate client module.","wrong":"from vmware.vapi.client import VapiClient","symbol":"VapiClient","correct":"from vmware.vapi.core import VapiClient"}],"quickstart":{"code":"from vmware.vapi.bindings.stub import StubConfiguration\nfrom vmware.vapi.core import VapiClient\nfrom vmware.vapi.security.client_security import create_user_security_context\n\n# Example of creating a StubConfiguration\nstub_config = StubConfiguration()\n\n# For authentication, use environment variables\nusername = os.environ.get('VCF_USERNAME', '')\npassword = os.environ.get('VCF_PASSWORD', '')\nif username and password:\n    security_ctx = create_user_security_context(username, password)\n    stub_config.security_context = security_ctx\n\nprint(\"vAPI client configuration ready\")","lang":"python","description":"Basic setup of StubConfiguration with optional user security context."},"warnings":[{"fix":"Use 'pip install vcf-sdk-python' and update imports: from vcf.platform import Vcenter etc.","message":"This library is superseded by vcf-sdk-python (namespace vcf). New projects should use 'pip install vcf-sdk-python' and import from vcf.*","severity":"deprecated","affected_versions":">=2.0.0"},{"fix":"For VCF SDK 9+, install vcf-sdk-python and use: from vcf.bindings.stub import StubConfiguration.","message":"Version 2.61.2 is the last PyPI release from the old vapi-common-client series. The new VCF SDK (9.0.0.0) changed module structure: StubConfiguration is now in vcf.bindings.stub.","severity":"breaking","affected_versions":"9.0.0.0+"},{"fix":"Always set VCF_USERNAME and VCF_PASSWORD before creating the client.","message":"Authentication via environment variables (VCF_USERNAME, VCF_PASSWORD) is required for most API calls. If not set, security_context is None and calls may fail with authentication errors.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Install with 'pip install vmware-vapi-common-client==2.61.2' and ensure import is 'from vmware.vapi.bindings.stub import StubConfiguration'.","cause":"The vmware-vapi-common-client package is not installed or is installed but the import path is incorrect.","error":"ImportError: No module named vmware.vapi"},{"fix":"Before using the stub config, set security_context: stub_config.security_context = create_user_security_context(username, password).","cause":"StubConfiguration created without setting security_context, often due to missing authentication.","error":"AttributeError: 'NoneType' object has no attribute 'security_context'"},{"fix":"Create StubConfiguration first, then assign stub_config.security_context = create_user_security_context(...).","cause":"Trying to pass security_context as a constructor argument to StubConfiguration, which is not supported.","error":"TypeError: __init__() got an unexpected keyword argument 'security_context'"},{"fix":"Use 'from vmware.vapi.core import VapiClient'.","cause":"Importing VapiClient from an incorrect submodule (vmware.vapi.client does not exist).","error":"ModuleNotFoundError: No module named 'vmware.vapi.client'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}