def __init__(self, config):
        # 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_value_validator_list = []
        get_output_validator_list = []
        get_rest_metadata = OperationRestMetadata(
            http_method='GET',
            url_template='/appliance/system/uptime',
            path_variables={},
            query_parameters={})

        operations = {
            'get': {
                'input_type': get_input_type,
                'output_type': type.DoubleType(),
                '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.appliance.system.uptime',
            config=config,
            operations=operations,
            rest_metadata=rest_metadata,
            is_vapi_rest=True)
예제 #2
0
    def __init__(self, config):
        # 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 = {
            'get': {
                'input_type': get_input_type,
                'output_type': type.DoubleType(),
                '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.system.uptime',
            config=config,
            operations=operations)
예제 #3
0
class Time(VapiInterface):
    """
    ``Time`` class provides methods Gets system time.
    """
    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, _TimeStub)

    class SystemTimeStruct(VapiStruct):
        """
        ``Time.SystemTimeStruct`` class Structure representing the system time.

        .. tip::
            The arguments are used to initialize data attributes with the same
            names.
        """
        def __init__(
            self,
            seconds_since_epoch=None,
            date=None,
            time=None,
            timezone=None,
        ):
            """
            :type  seconds_since_epoch: :class:`float`
            :param seconds_since_epoch: seconds since the epoch
            :type  date: :class:`str`
            :param date: date format: Thu 07-31-2014
            :type  time: :class:`str`
            :param time: time format: 18:18:32
            :type  timezone: :class:`str`
            :param timezone: timezone
            """
            self.seconds_since_epoch = seconds_since_epoch
            self.date = date
            self.time = time
            self.timezone = timezone
            VapiStruct.__init__(self)

    SystemTimeStruct._set_binding_type(
        type.StructType(
            'com.vmware.appliance.system.time.system_time_struct', {
                'seconds_since_epoch': type.DoubleType(),
                'date': type.StringType(),
                'time': type.StringType(),
                'timezone': type.StringType(),
            }, SystemTimeStruct, False, None))

    def get(self):
        """
        Get system time.


        :rtype: :class:`Time.SystemTimeStruct`
        :return: System time
        :raise: :class:`com.vmware.vapi.std.errors_client.Error` 
            Generic error
        """
        return self._invoke('get', None)
예제 #4
0
        type.EnumType(
            'com.vmware.vapi.std.localization_param.date_time_format',
            DateTimeFormat))


LocalizationParam._set_binding_type(
    type.StructType(
        'com.vmware.vapi.std.localization_param', {
            's':
            type.OptionalType(type.StringType()),
            'dt':
            type.OptionalType(type.DateTimeType()),
            'i':
            type.OptionalType(type.IntegerType()),
            'd':
            type.OptionalType(type.DoubleType()),
            'l':
            type.OptionalType(
                type.ReferenceType(__name__, 'NestedLocalizableMessage')),
            'format':
            type.OptionalType(
                type.ReferenceType(__name__,
                                   'LocalizationParam.DateTimeFormat')),
            'precision':
            type.OptionalType(type.IntegerType()),
        }, LocalizationParam, False, None))


class NestedLocalizableMessage(VapiStruct):
    """
    The ``NestedLocalizableMessage`` class represents a nested within a
        """
        :type  host_value: :class:`float` or ``None``
        :param host_value: Double value on ESXi host.
        :type  desired_value: :class:`float` or ``None``
        :param desired_value: Double value in desired document.
        """
        self.host_value = host_value
        self.desired_value = desired_value
        VapiStruct.__init__(self)


DoubleComplianceValue._set_binding_type(
    type.StructType(
        'com.vmware.esx.settings.clusters.configuration.double_compliance_value',
        {
            'host_value': type.OptionalType(type.DoubleType()),
            'desired_value': type.OptionalType(type.DoubleType()),
        }, DoubleComplianceValue, False, None))


class StringComplianceValue(VapiStruct):
    """
    The ``StringComplianceValue`` class contains attributes that describe a
    string value in drift. This struture captures the desired value and the
    host value for the drift.

    .. tip::
        The arguments are used to initialize data attributes with the same
        names.
    """
    def __init__(