def __init__(self, config): # properties for list operation list_input_type = type.StructType( 'operation-input', { 'resource_id': type.IdType(resource_types='com.vmware.vapi.resource'), }) list_error_dict = { 'com.vmware.vapi.std.errors.not_found': type.ReferenceType(com.vmware.vapi.std.errors_client, 'NotFound'), } list_input_validator_list = [] list_output_validator_list = [] operations = { 'list': { 'input_type': list_input_type, 'output_type': type.SetType(type.IdType()), 'errors': list_error_dict, 'input_validator_list': list_input_validator_list, 'output_validator_list': list_output_validator_list, }, } ApiInterfaceStub.__init__( self, iface_name='com.vmware.vapi.metadata.metamodel.resource.model', config=config, operations=operations)
def __init__(self, config): # properties for find operation find_input_type = type.StructType('operation-input', { 'networks': type.ListType(type.IdType()), }) find_error_dict = { 'com.vmware.vapi.std.errors.not_found': type.ReferenceType(com.vmware.vapi.std.errors_client, 'NotFound'), } find_input_validator_list = [ ] find_output_validator_list = [ ] operations = { 'find': { 'input_type': find_input_type, 'output_type': type.MapType(type.IdType(), type.OptionalType(type.ReferenceType(sys.modules[__name__], 'Network.Info'))), 'errors': find_error_dict, 'input_validator_list': find_input_validator_list, 'output_validator_list': find_output_validator_list, }, } ApiInterfaceStub.__init__(self, iface_name='com.vmware.vcenter.inventory.network', config=config, operations=operations)
def __init__(self, config): # properties for mount operation mount_input_type = type.StructType('operation-input', { 'library_item': type.IdType(resource_types='com.vmware.content.library.Item'), 'vm': type.IdType(resource_types='VirtualMachine'), }) mount_error_dict = { 'com.vmware.vapi.std.errors.not_found': type.ReferenceType(com.vmware.vapi.std.errors_client, 'NotFound'), 'com.vmware.vapi.std.errors.invalid_argument': type.ReferenceType(com.vmware.vapi.std.errors_client, 'InvalidArgument'), 'com.vmware.vapi.std.errors.not_allowed_in_current_state': type.ReferenceType(com.vmware.vapi.std.errors_client, 'NotAllowedInCurrentState'), 'com.vmware.vapi.std.errors.resource_inaccessible': type.ReferenceType(com.vmware.vapi.std.errors_client, 'ResourceInaccessible'), } mount_input_validator_list = [ ] mount_output_validator_list = [ ] # properties for unmount operation unmount_input_type = type.StructType('operation-input', { 'vm': type.IdType(resource_types='VirtualMachine'), 'cdrom': type.IdType(resource_types='com.vmware.vcenter.vm.hardware.Cdrom'), }) unmount_error_dict = { 'com.vmware.vapi.std.errors.not_found': type.ReferenceType(com.vmware.vapi.std.errors_client, 'NotFound'), 'com.vmware.vapi.std.errors.not_allowed_in_current_state': type.ReferenceType(com.vmware.vapi.std.errors_client, 'NotAllowedInCurrentState'), } unmount_input_validator_list = [ ] unmount_output_validator_list = [ ] operations = { 'mount': { 'input_type': mount_input_type, 'output_type': type.IdType(resource_types='com.vmware.vcenter.vm.hardware.Cdrom'), 'errors': mount_error_dict, 'input_validator_list': mount_input_validator_list, 'output_validator_list': mount_output_validator_list, }, 'unmount': { 'input_type': unmount_input_type, 'output_type': type.VoidType(), 'errors': unmount_error_dict, 'input_validator_list': unmount_input_validator_list, 'output_validator_list': unmount_output_validator_list, }, } ApiInterfaceStub.__init__(self, iface_name='com.vmware.vcenter.iso.image', config=config, operations=operations)
def __init__(self, config): # properties for scan operation scan_input_type = type.StructType( 'operation-input', { 'host': type.IdType(resource_types='HostSystem'), }) scan_error_dict = { 'com.vmware.vapi.std.errors.error': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Error'), 'com.vmware.vapi.std.errors.not_found': type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'), 'com.vmware.vapi.std.errors.service_unavailable': type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'), 'com.vmware.vapi.std.errors.unauthenticated': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthenticated'), 'com.vmware.vapi.std.errors.unsupported': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unsupported'), } scan_input_value_validator_list = [] scan_output_validator_list = [] scan_rest_metadata = OperationRestMetadata( http_method='POST', url_template='/esx/settings/hosts/{host}/software', path_variables={ 'host': 'host', }, query_parameters={}, dispatch_parameters={ 'action': 'scan', }, header_parameters={}, dispatch_header_parameters={}) operations = { 'scan$task': { 'input_type': scan_input_type, 'output_type': type.IdType(resource_types='com.vmware.cis.TASK'), 'errors': scan_error_dict, 'input_value_validator_list': scan_input_value_validator_list, 'output_validator_list': [], 'task_type': TaskType.TASK_ONLY, }, } rest_metadata = { 'scan': scan_rest_metadata, } ApiInterfaceStub.__init__( self, iface_name='com.vmware.esx.settings.hosts.software', config=config, operations=operations, rest_metadata=rest_metadata, is_vapi_rest=True)
def __init__(self, config): # properties for list operation list_input_type = type.StructType('operation-input', { 'service_id': type.IdType(resource_types='com.vmware.vapi.service'), }) list_error_dict = { 'com.vmware.vapi.std.errors.not_found': type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'), } list_input_value_validator_list = [ ] list_output_validator_list = [ ] list_rest_metadata = None # properties for get operation get_input_type = type.StructType('operation-input', { 'service_id': type.IdType(resource_types='com.vmware.vapi.service'), 'operation_id': type.IdType(resource_types='com.vmware.vapi.operation'), }) get_error_dict = { 'com.vmware.vapi.std.errors.not_found': type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'), } get_input_value_validator_list = [ ] get_output_validator_list = [ ] get_rest_metadata = None operations = { 'list': { 'input_type': list_input_type, 'output_type': type.ListType(type.IdType()), 'errors': list_error_dict, 'input_value_validator_list': list_input_value_validator_list, 'output_validator_list': list_output_validator_list, 'task_type': TaskType.NONE, }, 'get': { 'input_type': get_input_type, 'output_type': type.ReferenceType('com.vmware.vapi.metadata.routing_client', 'OperationInfo'), 'errors': get_error_dict, 'input_value_validator_list': get_input_value_validator_list, 'output_validator_list': get_output_validator_list, 'task_type': TaskType.NONE, }, } rest_metadata = { 'list': list_rest_metadata, 'get': get_rest_metadata, } ApiInterfaceStub.__init__( self, iface_name='com.vmware.vapi.metadata.routing.service.operation', config=config, operations=operations, rest_metadata=rest_metadata, is_vapi_rest=True)
def __init__(self, config): # properties for create operation create_input_type = type.StructType( 'operation-input', { 'version': type.IdType( resource_types='com.vmware.vcenter.lcm.update.pending'), }) create_error_dict = { 'com.vmware.vapi.std.errors.unauthenticated': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthenticated'), 'com.vmware.vapi.std.errors.not_found': type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'), 'com.vmware.vapi.std.errors.not_allowed_in_current_state': type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotAllowedInCurrentState'), 'com.vmware.vapi.std.errors.error': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Error'), } create_input_value_validator_list = [] create_output_validator_list = [] create_rest_metadata = OperationRestMetadata( http_method='POST', url_template= '/vcenter/lcm/update/pending/{version}/precheck-report', path_variables={ 'version': 'version', }, query_parameters={}, dispatch_parameters={}, header_parameters={}, dispatch_header_parameters={}) operations = { 'create$task': { 'input_type': create_input_type, 'output_type': type.IdType(resource_types='com.vmware.cis.TASK'), 'errors': create_error_dict, 'input_value_validator_list': create_input_value_validator_list, 'output_validator_list': [], 'task_type': TaskType.TASK_ONLY, }, } rest_metadata = { 'create': create_rest_metadata, } ApiInterfaceStub.__init__( self, iface_name='com.vmware.vcenter.lcm.update.precheck_report', config=config, operations=operations, rest_metadata=rest_metadata, is_vapi_rest=True)
def __init__(self, config): # properties for list operation list_input_type = type.StructType('operation-input', { 'service_id': type.IdType(resource_types='com.vmware.vapi.service'), }) list_error_dict = { 'com.vmware.vapi.std.errors.not_found': type.ReferenceType(com.vmware.vapi.std.errors_client, 'NotFound'), } list_input_validator_list = [] list_output_validator_list = [] # properties for get operation get_input_type = type.StructType( 'operation-input', { 'service_id': type.IdType(resource_types='com.vmware.vapi.service'), 'operation_id': type.IdType(resource_types='com.vmware.vapi.operation'), }) get_error_dict = { 'com.vmware.vapi.std.errors.not_found': type.ReferenceType(com.vmware.vapi.std.errors_client, 'NotFound'), } get_input_validator_list = [] get_output_validator_list = [] operations = { 'list': { 'input_type': list_input_type, 'output_type': type.ListType(type.IdType()), 'errors': list_error_dict, 'input_validator_list': list_input_validator_list, 'output_validator_list': list_output_validator_list, }, 'get': { 'input_type': get_input_type, 'output_type': type.ReferenceType(com.vmware.vapi.metadata.privilege_client, 'OperationInfo'), 'errors': get_error_dict, 'input_validator_list': get_input_validator_list, 'output_validator_list': get_output_validator_list, }, } ApiInterfaceStub.__init__( self, iface_name='com.vmware.vapi.metadata.privilege.service.operation', config=config, operations=operations)
def __init__(self, config): # properties for get operation get_input_type = type.StructType('operation-input', { 'cluster': type.IdType(resource_types='ClusterComputeResource'), }) get_error_dict = { 'com.vmware.vapi.std.errors.error': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Error'), 'com.vmware.vapi.std.errors.invalid_argument': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidArgument'), 'com.vmware.vapi.std.errors.not_found': type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'), 'com.vmware.vapi.std.errors.unauthenticated': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthenticated'), } get_input_value_validator_list = [] get_output_validator_list = [] get_rest_metadata = OperationRestMetadata( http_method='GET', url_template= '/vcenter/trusted-infrastructure/trust-authority-clusters/{cluster}/attestation/service-status', path_variables={ 'cluster': 'cluster', }, query_parameters={}, dispatch_parameters={}, header_parameters={}, dispatch_header_parameters={}) operations = { 'get$task': { 'input_type': get_input_type, 'output_type': type.IdType(resource_types='com.vmware.cis.TASK'), 'errors': get_error_dict, 'input_value_validator_list': get_input_value_validator_list, 'output_validator_list': [], 'task_type': TaskType.TASK_ONLY, }, } rest_metadata = { 'get': get_rest_metadata, } ApiInterfaceStub.__init__( self, iface_name= 'com.vmware.vcenter.trusted_infrastructure.trust_authority_clusters.attestation.service_status', config=config, operations=operations, rest_metadata=rest_metadata, is_vapi_rest=True)
def __init__(self, config): # properties for get operation get_input_type = type.StructType( 'operation-input', { 'datastore': type.IdType(resource_types='Datastore'), }) get_error_dict = { 'com.vmware.vapi.std.errors.error': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Error'), 'com.vmware.vapi.std.errors.not_found': type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'), 'com.vmware.vapi.std.errors.service_unavailable': type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'), 'com.vmware.vapi.std.errors.unauthenticated': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthenticated'), 'com.vmware.vapi.std.errors.unauthorized': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'), } get_input_value_validator_list = [] get_output_validator_list = [] get_rest_metadata = OperationRestMetadata( http_method='GET', url_template='/vcenter/datastore/{datastore}/default-policy', path_variables={ 'datastore': 'datastore', }, query_parameters={}) operations = { 'get': { 'input_type': get_input_type, 'output_type': type.OptionalType(type.IdType()), 'errors': get_error_dict, 'input_value_validator_list': get_input_value_validator_list, 'output_validator_list': get_output_validator_list, 'task_type': TaskType.NONE, }, } rest_metadata = { 'get': get_rest_metadata, } ApiInterfaceStub.__init__( self, iface_name='com.vmware.vcenter.datastore.default_policy', config=config, operations=operations, rest_metadata=rest_metadata, is_vapi_rest=True)
def __init__(self, config): # properties for get operation get_input_type = type.StructType( 'operation-input', { 'vm': type.IdType(resource_types='VirtualMachine'), 'policy': type.IdType( resource_types= 'com.vmware.vcenter.compute.Resources.COMPUTE_POLICY'), }) get_error_dict = { 'com.vmware.vapi.std.errors.not_found': type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'), 'com.vmware.vapi.std.errors.unauthorized': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'), } get_input_value_validator_list = [] get_output_validator_list = [] get_rest_metadata = OperationRestMetadata( http_method='GET', url_template='/vcenter/vm/{vm}/compute/policies/{policy}', path_variables={ 'vm': 'vm', 'policy': 'policy', }, query_parameters={}) operations = { 'get': { 'input_type': get_input_type, 'output_type': type.ReferenceType(__name__, 'Policies.Info'), 'errors': get_error_dict, 'input_value_validator_list': get_input_value_validator_list, 'output_validator_list': get_output_validator_list, 'task_type': TaskType.NONE, }, } rest_metadata = { 'get': get_rest_metadata, } ApiInterfaceStub.__init__( self, iface_name='com.vmware.vcenter.vm.compute.policies', config=config, operations=operations, rest_metadata=rest_metadata, is_vapi_rest=True)
def __init__(self, config): # properties for list operation list_input_type = type.StructType('operation-input', {}) list_error_dict = {} list_input_value_validator_list = [] list_output_validator_list = [] list_rest_metadata = None operations = { 'list': { 'input_type': list_input_type, 'output_type': type.ListType(type.IdType()), 'errors': list_error_dict, 'input_value_validator_list': list_input_value_validator_list, 'output_validator_list': list_output_validator_list, 'task_type': TaskType.NONE, }, } rest_metadata = { 'list': list_rest_metadata, } ApiInterfaceStub.__init__( self, iface_name='com.vmware.vapi.metadata.metamodel.service.hidden', config=config, operations=operations, rest_metadata=rest_metadata, is_vapi_rest=True)
def __init__(self, config): # properties for get operation get_input_type = type.StructType('operation-input', { 'cluster': type.IdType(resource_types='ClusterComputeResource'), }) get_error_dict = { 'com.vmware.vapi.std.errors.error': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Error'), 'com.vmware.vapi.std.errors.not_found': type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'), 'com.vmware.vapi.std.errors.service_unavailable': type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'), 'com.vmware.vapi.std.errors.unauthenticated': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthenticated'), } get_input_value_validator_list = [] get_output_validator_list = [] get_rest_metadata = OperationRestMetadata( http_method='GET', url_template= '/esx/settings/clusters/{cluster}/policies/apply/effective', path_variables={ 'cluster': 'cluster', }, query_parameters={}, dispatch_parameters={}, header_parameters={}, dispatch_header_parameters={}) operations = { 'get': { 'input_type': get_input_type, 'output_type': type.ReferenceType(__name__, 'Effective.EffectivePolicySpec'), 'errors': get_error_dict, 'input_value_validator_list': get_input_value_validator_list, 'output_validator_list': get_output_validator_list, 'task_type': TaskType.NONE, }, } rest_metadata = { 'get': get_rest_metadata, } ApiInterfaceStub.__init__( self, iface_name= 'com.vmware.esx.settings.clusters.policies.apply.effective', config=config, operations=operations, rest_metadata=rest_metadata, is_vapi_rest=True)
def __init__(self, config): # properties for find operation find_input_type = type.StructType('operation-input', { 'networks': type.ListType(type.IdType()), }) find_error_dict = { 'com.vmware.vapi.std.errors.not_found': type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'), } find_input_value_validator_list = [ ] find_output_validator_list = [ ] find_rest_metadata = OperationRestMetadata( http_method='GET', url_template='/vcenter/inventory/network', path_variables={ }, query_parameters={ 'networks': 'networks', }, dispatch_parameters={ }, header_parameters={ }, dispatch_header_parameters={ } ) operations = { 'find': { 'input_type': find_input_type, 'output_type': type.MapType(type.IdType(), type.OptionalType(type.ReferenceType(__name__, 'Network.Info'))), 'errors': find_error_dict, 'input_value_validator_list': find_input_value_validator_list, 'output_validator_list': find_output_validator_list, 'task_type': TaskType.NONE, }, } rest_metadata = { 'find': find_rest_metadata, } ApiInterfaceStub.__init__( self, iface_name='com.vmware.vcenter.inventory.network', config=config, operations=operations, rest_metadata=rest_metadata, is_vapi_rest=True)
def __init__(self, config): # properties for list operation list_input_type = type.StructType('operation-input', { 'host': type.IdType(resource_types='HostSystem'), }) list_error_dict = { 'com.vmware.vapi.std.errors.internal_server_error': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InternalServerError'), 'com.vmware.vapi.std.errors.not_allowed_in_current_state': type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotAllowedInCurrentState'), 'com.vmware.vapi.std.errors.not_found': type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'), 'com.vmware.vapi.std.errors.unauthenticated': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthenticated'), 'com.vmware.vapi.std.errors.unsupported': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unsupported'), 'com.vmware.vapi.std.errors.resource_inaccessible': type.ReferenceType('com.vmware.vapi.std.errors_client', 'ResourceInaccessible'), 'com.vmware.vapi.std.errors.error': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Error'), } list_input_value_validator_list = [ ] list_output_validator_list = [ ] list_rest_metadata = OperationRestMetadata( http_method='GET', url_template='/esx/hcl/hosts/{host}/compatibility-releases', path_variables={ 'host': 'host', }, query_parameters={ }, dispatch_parameters={ }, header_parameters={ }, dispatch_header_parameters={ } ) operations = { 'list': { 'input_type': list_input_type, 'output_type': type.ReferenceType(__name__, 'CompatibilityReleases.EsxiCompatibilityReleases'), 'errors': list_error_dict, 'input_value_validator_list': list_input_value_validator_list, 'output_validator_list': list_output_validator_list, 'task_type': TaskType.NONE, }, } rest_metadata = { 'list': list_rest_metadata, } ApiInterfaceStub.__init__( self, iface_name='com.vmware.esx.hcl.hosts.compatibility_releases', config=config, operations=operations, rest_metadata=rest_metadata, is_vapi_rest=True)
def __init__(self, config): # properties for list operation list_input_type = type.StructType('operation-input', {}) list_error_dict = {} list_input_validator_list = [] list_output_validator_list = [] # properties for get operation get_input_type = type.StructType( 'operation-input', { 'id': type.IdType(resource_types='com.vmware.vapi.service'), }) get_error_dict = { 'com.vmware.vapi.std.errors.not_found': type.ReferenceType(com.vmware.vapi.std.errors_client, 'NotFound'), } get_input_validator_list = [] get_output_validator_list = [] operations = { 'list': { 'input_type': list_input_type, 'output_type': type.SetType(type.IdType()), 'errors': list_error_dict, 'input_validator_list': list_input_validator_list, 'output_validator_list': list_output_validator_list, }, 'get': { 'input_type': get_input_type, 'output_type': type.ReferenceType(sys.modules[__name__], 'Service.Info'), 'errors': get_error_dict, 'input_validator_list': get_input_validator_list, 'output_validator_list': get_output_validator_list, }, } ApiInterfaceStub.__init__( self, iface_name='com.vmware.vapi.std.introspection.service', config=config, operations=operations)
def __init__(self, config): # properties for list operation list_input_type = type.StructType( 'operation-input', { 'resource_id': type.IdType(resource_types='com.vmware.vapi.resource'), }) list_error_dict = { 'com.vmware.vapi.std.errors.not_found': type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'), } list_input_value_validator_list = [] list_output_validator_list = [] list_rest_metadata = OperationRestMetadata( http_method='GET', url_template='/vapi/metadata/metamodel/resource/{resourceId}/model', path_variables={ 'resourceId': 'resourceId', }, query_parameters={}, dispatch_parameters={}, header_parameters={}, dispatch_header_parameters={}) operations = { 'list': { 'input_type': list_input_type, 'output_type': type.SetType(type.IdType()), 'errors': list_error_dict, 'input_value_validator_list': list_input_value_validator_list, 'output_validator_list': list_output_validator_list, 'task_type': TaskType.NONE, }, } rest_metadata = { 'list': list_rest_metadata, } ApiInterfaceStub.__init__( self, iface_name='com.vmware.vapi.metadata.metamodel.resource.model', config=config, operations=operations, rest_metadata=rest_metadata, is_vapi_rest=True)
def __init__(self, config): # properties for get operation get_input_type = type.StructType( 'operation-input', { 'name': type.IdType(resource_types='com.vmware.esx.settings.add_on'), 'version': type.StringType(), }) get_error_dict = { 'com.vmware.vapi.std.errors.error': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Error'), 'com.vmware.vapi.std.errors.not_found': type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'), 'com.vmware.vapi.std.errors.service_unavailable': type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'), 'com.vmware.vapi.std.errors.unauthenticated': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthenticated'), } get_input_value_validator_list = [] get_output_validator_list = [] get_rest_metadata = OperationRestMetadata( http_method='GET', url_template= '/esx/settings/depot-content/add-ons/{name}/versions/{version}', path_variables={ 'name': 'name', 'version': 'version', }, query_parameters={}, dispatch_parameters={}, header_parameters={}, dispatch_header_parameters={}) operations = { 'get': { 'input_type': get_input_type, 'output_type': type.ReferenceType(__name__, 'Versions.Info'), 'errors': get_error_dict, 'input_value_validator_list': get_input_value_validator_list, 'output_validator_list': get_output_validator_list, 'task_type': TaskType.NONE, }, } rest_metadata = { 'get': get_rest_metadata, } ApiInterfaceStub.__init__( self, iface_name='com.vmware.esx.settings.depot_content.add_ons.versions', config=config, operations=operations, rest_metadata=rest_metadata, is_vapi_rest=True)
def __init__(self, config): # properties for set operation set_input_type = type.StructType( 'operation-input', { 'vm': type.IdType(resource_types='VirtualMachine'), 'spec': type.ReferenceType(__name__, 'Customization.SetSpec'), }) set_error_dict = { 'com.vmware.vapi.std.errors.invalid_argument': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidArgument'), 'com.vmware.vapi.std.errors.not_allowed_in_current_state': type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotAllowedInCurrentState'), 'com.vmware.vapi.std.errors.not_found': type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'), 'com.vmware.vapi.std.errors.service_unavailable': type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'), 'com.vmware.vapi.std.errors.unauthenticated': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthenticated'), 'com.vmware.vapi.std.errors.unauthorized': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'), } set_input_value_validator_list = [] set_output_validator_list = [] set_rest_metadata = OperationRestMetadata( http_method='PUT', url_template='/vcenter/vm/{vm}/guest/customization', path_variables={ 'vm': 'vm', }, query_parameters={}) operations = { 'set': { 'input_type': set_input_type, 'output_type': type.VoidType(), 'errors': set_error_dict, 'input_value_validator_list': set_input_value_validator_list, 'output_validator_list': set_output_validator_list, 'task_type': TaskType.NONE, }, } rest_metadata = { 'set': set_rest_metadata, } ApiInterfaceStub.__init__( self, iface_name='com.vmware.vcenter.vm.guest.customization', config=config, operations=operations, rest_metadata=rest_metadata, is_vapi_rest=True)
def __init__(self, config): # properties for find operation find_input_type = type.StructType( 'operation-input', { 'networks': type.ListType(type.IdType()), }) find_error_dict = { 'com.vmware.vapi.std.errors.not_found': type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'), } find_input_value_validator_list = [] find_output_validator_list = [] find_rest_metadata = None operations = { 'find': { 'input_type': find_input_type, 'output_type': type.MapType( type.IdType(), type.OptionalType( type.ReferenceType(__name__, 'Network.Info'))), 'errors': find_error_dict, 'input_value_validator_list': find_input_value_validator_list, 'output_validator_list': find_output_validator_list, 'task_type': TaskType.NONE, }, } rest_metadata = { 'find': find_rest_metadata, } ApiInterfaceStub.__init__( self, iface_name='com.vmware.vcenter.inventory.network', config=config, operations=operations, rest_metadata=rest_metadata, is_vapi_rest=True)
def __init__(self, config): # properties for create operation create_input_type = type.StructType('operation-input', { 'vm': type.IdType(resource_types='VirtualMachine'), 'spec': type.ReferenceType(__name__, 'Tickets.CreateSpec'), }) create_error_dict = { 'com.vmware.vapi.std.errors.error': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Error'), 'com.vmware.vapi.std.errors.invalid_argument': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidArgument'), 'com.vmware.vapi.std.errors.not_allowed_in_current_state': type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotAllowedInCurrentState'), 'com.vmware.vapi.std.errors.not_found': type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'), 'com.vmware.vapi.std.errors.resource_inaccessible': type.ReferenceType('com.vmware.vapi.std.errors_client', 'ResourceInaccessible'), 'com.vmware.vapi.std.errors.service_unavailable': type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'), 'com.vmware.vapi.std.errors.unauthenticated': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthenticated'), 'com.vmware.vapi.std.errors.unauthorized': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'), } create_input_value_validator_list = [ ] create_output_validator_list = [ ] create_rest_metadata = OperationRestMetadata( http_method='POST', url_template='/vcenter/vm/{vm}/console/tickets', path_variables={ 'vm': 'vm', }, query_parameters={ } ) operations = { 'create': { 'input_type': create_input_type, 'output_type': type.ReferenceType(__name__, 'Tickets.Summary'), 'errors': create_error_dict, 'input_value_validator_list': create_input_value_validator_list, 'output_validator_list': create_output_validator_list, 'task_type': TaskType.NONE, }, } rest_metadata = { 'create': create_rest_metadata, } ApiInterfaceStub.__init__( self, iface_name='com.vmware.vcenter.vm.console.tickets', config=config, operations=operations, rest_metadata=rest_metadata, is_vapi_rest=True)
def __init__(self, config): # properties for get operation get_input_type = type.StructType( 'operation-input', { 'report': type.IdType( resource_types= 'com.vmware.esx.hcl.resources.CompatibilityReport'), }) get_error_dict = { 'com.vmware.vapi.std.errors.not_found': type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'), 'com.vmware.vapi.std.errors.unauthenticated': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthenticated'), 'com.vmware.vapi.std.errors.resource_inaccessible': type.ReferenceType('com.vmware.vapi.std.errors_client', 'ResourceInaccessible'), 'com.vmware.vapi.std.errors.error': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Error'), } get_input_value_validator_list = [] get_output_validator_list = [] get_rest_metadata = OperationRestMetadata( http_method='GET', url_template='/esx/hcl/reports/{report}', path_variables={ 'report': 'report', }, query_parameters={}, dispatch_parameters={}, header_parameters={}, dispatch_header_parameters={}) operations = { 'get': { 'input_type': get_input_type, 'output_type': type.ReferenceType(__name__, 'Reports.Location'), 'errors': get_error_dict, 'input_value_validator_list': get_input_value_validator_list, 'output_validator_list': get_output_validator_list, 'task_type': TaskType.NONE, }, } rest_metadata = { 'get': get_rest_metadata, } ApiInterfaceStub.__init__(self, iface_name='com.vmware.esx.hcl.reports', config=config, operations=operations, rest_metadata=rest_metadata, is_vapi_rest=True)
def __init__(self, config): # properties for get operation get_input_type = type.StructType( 'operation-input', { 'vm': type.IdType(resource_types='VirtualMachine'), }) get_error_dict = { 'com.vmware.vapi.std.errors.error': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Error'), 'com.vmware.vapi.std.errors.not_found': type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'), 'com.vmware.vapi.std.errors.service_unavailable': type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'), } get_input_value_validator_list = [] get_output_validator_list = [] get_rest_metadata = OperationRestMetadata( http_method='GET', url_template='/vcenter/vm/{vm}/guest/local-filesystem', path_variables={ 'vm': 'vm', }, query_parameters={}) operations = { 'get': { 'input_type': get_input_type, 'output_type': type.MapType( type.StringType(), type.ReferenceType(__name__, 'LocalFilesystem.Info')), 'errors': get_error_dict, 'input_value_validator_list': get_input_value_validator_list, 'output_validator_list': get_output_validator_list, 'task_type': TaskType.NONE, }, } rest_metadata = { 'get': get_rest_metadata, } ApiInterfaceStub.__init__( self, iface_name='com.vmware.vcenter.vm.guest.local_filesystem', config=config, operations=operations, rest_metadata=rest_metadata, is_vapi_rest=True)
def __init__(self, config): # properties for list operation list_input_type = type.StructType('operation-input', {}) list_error_dict = { 'com.vmware.vapi.std.errors.error': type.ReferenceType(com.vmware.vapi.std.errors_client, 'Error'), } list_input_validator_list = [] list_output_validator_list = [] # properties for get operation get_input_type = type.StructType( 'operation-input', { 'id': type.IdType( resource_types='com.vmware.appliance.recovery.backup.parts' ), }) get_error_dict = { 'com.vmware.vapi.std.errors.error': type.ReferenceType(com.vmware.vapi.std.errors_client, 'Error'), } get_input_validator_list = [] get_output_validator_list = [] operations = { 'list': { 'input_type': list_input_type, 'output_type': type.ListType( type.ReferenceType(sys.modules[__name__], 'Parts.Part')), 'errors': list_error_dict, 'input_validator_list': list_input_validator_list, 'output_validator_list': list_output_validator_list, }, 'get': { 'input_type': get_input_type, 'output_type': type.IntegerType(), 'errors': get_error_dict, 'input_validator_list': get_input_validator_list, 'output_validator_list': get_output_validator_list, }, } ApiInterfaceStub.__init__( self, iface_name='com.vmware.appliance.recovery.backup.parts', config=config, operations=operations)
def __init__(self, config): # properties for list operation list_input_type = type.StructType('operation-input', { 'filter': type.ReferenceType(__name__, 'VM.FilterSpec'), }) list_error_dict = { 'com.vmware.vapi.std.errors.error': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Error'), 'com.vmware.vapi.std.errors.invalid_argument': type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidArgument'), 'com.vmware.vapi.std.errors.service_unavailable': type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'), 'com.vmware.vapi.std.errors.unauthenticated': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthenticated'), 'com.vmware.vapi.std.errors.unauthorized': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'), 'com.vmware.vapi.std.errors.unsupported': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unsupported'), 'com.vmware.vapi.std.errors.unable_to_allocate_resource': type.ReferenceType('com.vmware.vapi.std.errors_client', 'UnableToAllocateResource'), } list_input_value_validator_list = [ ] list_output_validator_list = [ ] list_rest_metadata = OperationRestMetadata( http_method='GET', url_template='/vcenter/storage/policies/compliance/vm', path_variables={ }, query_parameters={ } ) operations = { 'list': { 'input_type': list_input_type, 'output_type': type.MapType(type.IdType(), type.ReferenceType(__name__, 'VM.Info')), 'errors': list_error_dict, 'input_value_validator_list': list_input_value_validator_list, 'output_validator_list': list_output_validator_list, 'task_type': TaskType.NONE, }, } rest_metadata = { 'list': list_rest_metadata, } ApiInterfaceStub.__init__( self, iface_name='com.vmware.vcenter.storage.policies.compliance.VM', config=config, operations=operations, rest_metadata=rest_metadata, is_vapi_rest=True)
def __init__(self, config): # properties for get operation get_input_type = type.StructType( 'operation-input', { 'registry': type.IdType( resource_types='com.vmware.vcenter.content.Registry'), }) get_error_dict = { 'com.vmware.vapi.std.errors.error': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Error'), 'com.vmware.vapi.std.errors.not_found': type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'), 'com.vmware.vapi.std.errors.unauthenticated': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthenticated'), 'com.vmware.vapi.std.errors.unauthorized': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'), } get_input_value_validator_list = [] get_output_validator_list = [] get_rest_metadata = OperationRestMetadata( http_method='GET', url_template='/vcenter/content/registries/{registry}/health', path_variables={ 'registry': 'registry', }, query_parameters={}) operations = { 'get': { 'input_type': get_input_type, 'output_type': type.ReferenceType(__name__, 'Health.Info'), 'errors': get_error_dict, 'input_value_validator_list': get_input_value_validator_list, 'output_validator_list': get_output_validator_list, 'task_type': TaskType.NONE, }, } rest_metadata = { 'get': get_rest_metadata, } ApiInterfaceStub.__init__( self, iface_name='com.vmware.vcenter.content.registries.health', config=config, operations=operations, rest_metadata=rest_metadata, is_vapi_rest=True)
def __init__(self, config): # properties for create operation create_input_type = type.StructType( 'operation-input', { 'spec': type.OptionalType( type.ReferenceType(__name__, 'InteropReport.Spec')), }) create_error_dict = { 'com.vmware.vapi.std.errors.unauthenticated': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthenticated'), 'com.vmware.vapi.std.errors.error': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Error'), } create_input_value_validator_list = [] create_output_validator_list = [] create_rest_metadata = OperationRestMetadata( http_method='POST', url_template='/vcenter/lcm/discovery/interop-report', request_body_parameter='spec', path_variables={}, query_parameters={}, dispatch_parameters={}, header_parameters={}, dispatch_header_parameters={}) operations = { 'create$task': { 'input_type': create_input_type, 'output_type': type.IdType(resource_types='com.vmware.cis.TASK'), 'errors': create_error_dict, 'input_value_validator_list': create_input_value_validator_list, 'output_validator_list': [], 'task_type': TaskType.TASK_ONLY, }, } rest_metadata = { 'create': create_rest_metadata, } ApiInterfaceStub.__init__( self, iface_name='com.vmware.vcenter.lcm.discovery.interop_report', config=config, operations=operations, rest_metadata=rest_metadata, is_vapi_rest=True)
def __init__(self, config): # properties for list operation list_input_type = type.StructType( 'operation-input', { 'filter': type.OptionalType( type.ReferenceType(__name__, 'Details.FilterSpec')), }) list_error_dict = { 'com.vmware.vapi.std.errors.error': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Error'), } list_input_value_validator_list = [] list_output_validator_list = [] list_rest_metadata = OperationRestMetadata( http_method='GET', url_template='/appliance/recovery/backup/job/details', path_variables={}, query_parameters={}) operations = { 'list': { 'input_type': list_input_type, 'output_type': type.MapType(type.IdType(), type.ReferenceType(__name__, 'Details.Info')), 'errors': list_error_dict, 'input_value_validator_list': list_input_value_validator_list, 'output_validator_list': list_output_validator_list, 'task_type': TaskType.NONE, }, } rest_metadata = { 'list': list_rest_metadata, } ApiInterfaceStub.__init__( self, iface_name='com.vmware.appliance.recovery.backup.job.details', config=config, operations=operations, rest_metadata=rest_metadata, is_vapi_rest=True)
def __init__(self, config): # properties for reset operation reset_input_type = type.StructType('operation-input', { 'link': type.IdType(resource_types='com.vmware.vcenter.hvc.Links'), }) reset_error_dict = { 'com.vmware.vapi.std.errors.error': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Error'), 'com.vmware.vapi.std.errors.not_found': type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'), 'com.vmware.vapi.std.errors.unauthorized': type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'), } reset_input_value_validator_list = [] reset_output_validator_list = [] reset_rest_metadata = OperationRestMetadata( http_method='POST', url_template='/hvc/links/{link_id}/sync?action=reset', path_variables={ 'link': 'link_id', }, query_parameters={}) operations = { 'reset': { 'input_type': reset_input_type, 'output_type': type.VoidType(), 'errors': reset_error_dict, 'input_value_validator_list': reset_input_value_validator_list, 'output_validator_list': reset_output_validator_list, 'task_type': TaskType.NONE, }, } rest_metadata = { 'reset': reset_rest_metadata, } ApiInterfaceStub.__init__( self, iface_name='com.vmware.vcenter.hvc.links.sync', config=config, operations=operations, rest_metadata=rest_metadata, is_vapi_rest=True)
def import_from_imgdb_task( self, cluster, imgdb, ): """ Import ESX metadata as a new trusted base image to each host in the cluster. Import a boot_imgdb.tgz file which contains metadata that describes a trusted ESX base image. A boot_imgdb.tgz file can be downloaded from a representative host.. This method was added in vSphere API 7.0.0. :type cluster: :class:`str` :param cluster: The id of the cluster on which the operation will be executed. The parameter must be an identifier for the resource type: ``ClusterComputeResource``. :type imgdb: :class:`str` :param imgdb: ESX metadata on a cluster level. :rtype: :class: `vmware.vapi.stdlib.client.task.Task` :return: Task instance :raise: :class:`com.vmware.vapi.std.errors_client.AlreadyExists` if ESX metadata for the same version has already been added. :raise: :class:`com.vmware.vapi.std.errors_client.Error` if there is a generic error. :raise: :class:`com.vmware.vapi.std.errors_client.InvalidArgument` if the imgdb is invalid or cluster id is empty. :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` if the cluster is not found. :raise: :class:`com.vmware.vapi.std.errors_client.Unauthenticated` if the caller is not authenticated. """ task_id = self._invoke('import_from_imgdb$task', { 'cluster': cluster, 'imgdb': imgdb, }) task_svc = Tasks(self._config) task_instance = Task( task_id, task_svc, type.IdType( resource_types= 'com.vmware.vcenter.trusted_infrastructure.trust_authority_clusters.attestation.os.esx.BaseImage' )) return task_instance
def create_task( self, cluster, spec, ): """ Configures the cluster to use a the given registered Attestation Service. This method was added in vSphere API 7.0.0. :type cluster: :class:`str` :param cluster: The ID of the cluster. The parameter must be an identifier for the resource type: ``ClusterComputeResource``. :type spec: :class:`Services.CreateSpec` :param spec: Describes the registered instance of the Attestation Service :rtype: :class: `vmware.vapi.stdlib.client.task.Task` :return: Task instance :raise: :class:`com.vmware.vapi.std.errors_client.AlreadyExists` if the Attestation Service is already configured for this cluster :raise: :class:`com.vmware.vapi.std.errors_client.Error` for any other error. :raise: :class:`com.vmware.vapi.std.errors_client.InvalidArgument` if the CreateSpec is not valid. :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` if the cluster ID is not valid. :raise: :class:`com.vmware.vapi.std.errors_client.UnableToAllocateResource` if all the hosts in the cluster do not have VMware vSphere Trust Authority enabled license. :raise: :class:`com.vmware.vapi.std.errors_client.Unauthenticated` if the user can not be authenticated. """ task_id = self._invoke('create$task', { 'cluster': cluster, 'spec': spec, }) task_svc = Tasks(self._config) task_instance = Task( task_id, task_svc, type.IdType( resource_types= 'com.vmware.vcenter.trusted_infrastructure.attestation.Service' )) return task_instance