# -*- coding: utf-8 -*-
#---------------------------------------------------------------------------
# Copyright 2016 VMware, Inc. All rights reserved.
# AUTO GENERATED FILE -- DO NOT MODIFY!
#
# vAPI stub file for package com.vmware.appliance.access.
#---------------------------------------------------------------------------
"""
"""
__author__ = 'VMware, Inc.'
__docformat__ = 'restructuredtext en'
import sys
from vmware.vapi.bindings import type
from vmware.vapi.bindings.converter import TypeConverter
from vmware.vapi.bindings.enum import Enum
from vmware.vapi.bindings.error import VapiError
from vmware.vapi.bindings.struct import VapiStruct
from vmware.vapi.bindings.stub import VapiInterface, ApiInterfaceStub
from vmware.vapi.bindings.common import raise_core_exception
from vmware.vapi.data.validator import UnionValidator, HasFieldsOfValidator
from vmware.vapi.exception import CoreException
import com.vmware.vapi.std.errors_client
[docs]class Consolecli(VapiInterface):
"""
``Consolecli`` class provides methods Get/Set enabled state of CLI.
"""
def __init__(self, config):
"""
:type config: :class:`vmware.vapi.bindings.stub.StubConfiguration`
:param config: Configuration to be used for creating the stub.
"""
VapiInterface.__init__(self, config, _ConsolecliStub)
[docs] def set(self,
enabled,
):
"""
Set enabled state of the console-based controlled CLI (TTY1).
:type enabled: :class:`bool`
:param enabled: Console-based controlled CLI is enabled.
:raise: :class:`com.vmware.vapi.std.errors_client.Error`
Generic error
"""
return self._invoke('set',
{
'enabled': enabled,
})
[docs] def get(self):
"""
Get enabled state of the console-based controlled CLI (TTY1).
:rtype: :class:`bool`
:return: Console-based controlled CLI is enabled.
:raise: :class:`com.vmware.vapi.std.errors_client.Error`
Generic error
"""
return self._invoke('get', None)
[docs]class Dcui(VapiInterface):
"""
``Dcui`` class provides methods Get/Set enabled state of DCUI.
"""
def __init__(self, config):
"""
:type config: :class:`vmware.vapi.bindings.stub.StubConfiguration`
:param config: Configuration to be used for creating the stub.
"""
VapiInterface.__init__(self, config, _DcuiStub)
[docs] def set(self,
enabled,
):
"""
Set enabled state of Direct Console User Interface (DCUI TTY2).
:type enabled: :class:`bool`
:param enabled: DCUI is enabled.
:raise: :class:`com.vmware.vapi.std.errors_client.Error`
Generic error
"""
return self._invoke('set',
{
'enabled': enabled,
})
[docs] def get(self):
"""
Get enabled state of Direct Console User Interface (DCUI TTY2).
:rtype: :class:`bool`
:return: DCUI is enabled.
:raise: :class:`com.vmware.vapi.std.errors_client.Error`
Generic error
"""
return self._invoke('get', None)
[docs]class Shell(VapiInterface):
"""
``Shell`` class provides methods Get/Set enabled state of BASH.
"""
def __init__(self, config):
"""
:type config: :class:`vmware.vapi.bindings.stub.StubConfiguration`
:param config: Configuration to be used for creating the stub.
"""
VapiInterface.__init__(self, config, _ShellStub)
[docs] class ShellConfig(VapiStruct):
"""
``Shell.ShellConfig`` class Structure that defines shell configuration.
.. tip::
The arguments are used to initialize data attributes with the same
names.
"""
def __init__(self,
enabled=None,
timeout=None,
):
"""
:type enabled: :class:`bool`
:param enabled: Enabled can be set to true or false
:type timeout: :class:`long`
:param timeout: The timeout (in seconds) specifies how long you enable the Shell
access. The maximum timeout is 86400 seconds(1 day).
"""
self.enabled = enabled
self.timeout = timeout
VapiStruct.__init__(self)
ShellConfig._set_binding_type(type.StructType(
'com.vmware.appliance.access.shell.shell_config', {
'enabled': type.BooleanType(),
'timeout': type.IntegerType(),
},
ShellConfig,
False,
None))
[docs] def set(self,
config,
):
"""
Set enabled state of BASH, that is, access to BASH from within the
controlled CLI.
:type config: :class:`Shell.ShellConfig`
:param config: Shell configuration
:raise: :class:`com.vmware.vapi.std.errors_client.Error`
Generic error
"""
return self._invoke('set',
{
'config': config,
})
[docs] def get(self):
"""
Get enabled state of BASH, that is, access to BASH from within the
controlled CLI.
:rtype: :class:`Shell.ShellConfig`
:return: Current shell configuration.
:raise: :class:`com.vmware.vapi.std.errors_client.Error`
Generic error
"""
return self._invoke('get', None)
[docs]class Ssh(VapiInterface):
"""
``Ssh`` class provides methods Get/Set enabled state of SSH-based
controlled CLI.
"""
def __init__(self, config):
"""
:type config: :class:`vmware.vapi.bindings.stub.StubConfiguration`
:param config: Configuration to be used for creating the stub.
"""
VapiInterface.__init__(self, config, _SshStub)
[docs] def set(self,
enabled,
):
"""
Set enabled state of the SSH-based controlled CLI.
:type enabled: :class:`bool`
:param enabled: SSH-based controlled CLI is enabled.
:raise: :class:`com.vmware.vapi.std.errors_client.Error`
Generic error
"""
return self._invoke('set',
{
'enabled': enabled,
})
[docs] def get(self):
"""
Get enabled state of the SSH-based controlled CLI.
:rtype: :class:`bool`
:return: SSH-based controlled CLI is enabled.
:raise: :class:`com.vmware.vapi.std.errors_client.Error`
Generic error
"""
return self._invoke('get', None)
class _ConsolecliStub(ApiInterfaceStub):
def __init__(self, config):
# properties for set operation
set_input_type = type.StructType('operation-input', {
'enabled': type.BooleanType(),
})
set_error_dict = {
'com.vmware.vapi.std.errors.error':
type.ReferenceType(com.vmware.vapi.std.errors_client, 'Error'),
}
set_input_validator_list = [
]
set_output_validator_list = [
]
# properties for get operation
get_input_type = type.StructType('operation-input', {})
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 = {
'set': {
'input_type': set_input_type,
'output_type': type.VoidType(),
'errors': set_error_dict,
'input_validator_list': set_input_validator_list,
'output_validator_list': set_output_validator_list,
},
'get': {
'input_type': get_input_type,
'output_type': type.BooleanType(),
'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.access.consolecli',
config=config,
operations=operations)
class _DcuiStub(ApiInterfaceStub):
def __init__(self, config):
# properties for set operation
set_input_type = type.StructType('operation-input', {
'enabled': type.BooleanType(),
})
set_error_dict = {
'com.vmware.vapi.std.errors.error':
type.ReferenceType(com.vmware.vapi.std.errors_client, 'Error'),
}
set_input_validator_list = [
]
set_output_validator_list = [
]
# properties for get operation
get_input_type = type.StructType('operation-input', {})
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 = {
'set': {
'input_type': set_input_type,
'output_type': type.VoidType(),
'errors': set_error_dict,
'input_validator_list': set_input_validator_list,
'output_validator_list': set_output_validator_list,
},
'get': {
'input_type': get_input_type,
'output_type': type.BooleanType(),
'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.access.dcui',
config=config,
operations=operations)
class _ShellStub(ApiInterfaceStub):
def __init__(self, config):
# properties for set operation
set_input_type = type.StructType('operation-input', {
'config': type.ReferenceType(sys.modules[__name__], 'Shell.ShellConfig'),
})
set_error_dict = {
'com.vmware.vapi.std.errors.error':
type.ReferenceType(com.vmware.vapi.std.errors_client, 'Error'),
}
set_input_validator_list = [
]
set_output_validator_list = [
]
# properties for get operation
get_input_type = type.StructType('operation-input', {})
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 = {
'set': {
'input_type': set_input_type,
'output_type': type.VoidType(),
'errors': set_error_dict,
'input_validator_list': set_input_validator_list,
'output_validator_list': set_output_validator_list,
},
'get': {
'input_type': get_input_type,
'output_type': type.ReferenceType(sys.modules[__name__], 'Shell.ShellConfig'),
'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.access.shell',
config=config,
operations=operations)
class _SshStub(ApiInterfaceStub):
def __init__(self, config):
# properties for set operation
set_input_type = type.StructType('operation-input', {
'enabled': type.BooleanType(),
})
set_error_dict = {
'com.vmware.vapi.std.errors.error':
type.ReferenceType(com.vmware.vapi.std.errors_client, 'Error'),
}
set_input_validator_list = [
]
set_output_validator_list = [
]
# properties for get operation
get_input_type = type.StructType('operation-input', {})
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 = {
'set': {
'input_type': set_input_type,
'output_type': type.VoidType(),
'errors': set_error_dict,
'input_validator_list': set_input_validator_list,
'output_validator_list': set_output_validator_list,
},
'get': {
'input_type': get_input_type,
'output_type': type.BooleanType(),
'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.access.ssh',
config=config,
operations=operations)