Exemple #1
0
class System(VapiInterface):
    """
    ``System`` class provides methods Get overall health of system.
    """


    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, _SystemStub)

    class HealthLevel(Enum):
        """
        ``System.HealthLevel`` class Defines health levels

        .. note::
            This class represents an enumerated type in the interface language
            definition. The class contains class attributes which represent the
            values in the current version of the enumerated type. Newer versions of
            the enumerated type may contain new values. To use new values of the
            enumerated type in communication with a server that supports the newer
            version of the API, you instantiate this class. See :ref:`enumerated
            type description page <enumeration_description>`.
        """
        orange = None
        """
        The service health is degraded. The service might have serious problems

        """
        gray = None
        """
        No health data is available for this service.

        """
        green = None
        """
        Service is healthy.

        """
        red = None
        """
        The service is unavaiable and is not functioning properly or will stop
        functioning soon.

        """
        yellow = None
        """
        The service is healthy state, but experiencing some levels of problems.

        """

        def __init__(self, string):
            """
            :type  string: :class:`str`
            :param string: String value for the :class:`HealthLevel` instance.
            """
            Enum.__init__(string)

    HealthLevel._set_values([
        HealthLevel('orange'),
        HealthLevel('gray'),
        HealthLevel('green'),
        HealthLevel('red'),
        HealthLevel('yellow'),
    ])
    HealthLevel._set_binding_type(type.EnumType(
        'com.vmware.appliance.health.system.health_level',
        HealthLevel))



    def lastcheck(self):
        """
        Get last check timestamp of the health of the system.


        :rtype: :class:`datetime.datetime`
        :return: System health last check timestamp.
        :raise: :class:`com.vmware.vapi.std.errors_client.Error` 
            Generic error
        """
        return self._invoke('lastcheck', None)

    def get(self):
        """
        Get overall health of system.


        :rtype: :class:`System.HealthLevel`
        :return: System health.
        :raise: :class:`com.vmware.vapi.std.errors_client.Error` 
            Generic error
        """
        return self._invoke('get', None)
    def __init__(self, string):
        """
        :type  string: :class:`str`
        :param string: String value for the :class:`WarningType` instance.
        """
        Enum.__init__(string)


WarningType._set_values([
    WarningType('SELF_SIGNED_CERTIFICATE'),
    WarningType('EXPIRED_CERTIFICATE'),
    WarningType('NOT_YET_VALID_CERTIFICATE'),
    WarningType('UNTRUSTED_CERTIFICATE'),
])
WarningType._set_binding_type(
    type.EnumType('com.vmware.content.library.item.updatesession.warning_type',
                  WarningType))


class CertificateInfo(VapiStruct):
    """
    The ``CertificateInfo`` class contains information about the public key
    certificate used to sign the content. This class was added in vSphere API
    6.8.

    .. tip::
        The arguments are used to initialize data attributes with the same
        names.
    """
    def __init__(
        self,
        issuer=None,
class File(VapiInterface):
    """
    The ``File`` class provides methods for accessing files within an update
    session. 
    
    After an update session is created against a library item, the ``File``
    class can be used to make changes to the underlying library item metadata
    as well as the content of the files. The following changes can be made: 
    
    * deleting an existing file within the library item. This deletes both the
      metadata and the content.
    * updating an existing file with new content.
    * adding a new file to the library item.
    
     
    
    The above changes are not applied or visible until the session is
    completed. See
    :class:`com.vmware.content.library.item_client.UpdateSession`.
    """

    _VAPI_SERVICE_ID = 'com.vmware.content.library.item.updatesession.file'
    """
    Identifier of the service in canonical form.
    """
    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, _FileStub)

    class SourceType(Enum):
        """
        The ``File.SourceType`` class defines how the file content is retrieved.

        .. note::
            This class represents an enumerated type in the interface language
            definition. The class contains class attributes which represent the
            values in the current version of the enumerated type. Newer versions of
            the enumerated type may contain new values. To use new values of the
            enumerated type in communication with a server that supports the newer
            version of the API, you instantiate this class. See :ref:`enumerated
            type description page <enumeration_description>`.
        """
        NONE = None
        """
        No source type has been requested.

        """
        PUSH = None
        """
        The client is uploading content using HTTP(S) PUT requests.

        """
        PULL = None
        """
        The server is pulling content from a URL. The URL scheme can be ``http``,
        ``https``, ``file``, or ``ds``.

        """
        def __init__(self, string):
            """
            :type  string: :class:`str`
            :param string: String value for the :class:`SourceType` instance.
            """
            Enum.__init__(string)

    SourceType._set_values([
        SourceType('NONE'),
        SourceType('PUSH'),
        SourceType('PULL'),
    ])
    SourceType._set_binding_type(
        type.EnumType(
            'com.vmware.content.library.item.updatesession.file.source_type',
            SourceType))

    class AddSpec(VapiStruct):
        """
        The ``File.AddSpec`` class describes the properties of the file to be
        uploaded.

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

        _validator_list = [
            UnionValidator('source_type', {
                'PULL': [('source_endpoint', True)],
                'NONE': [],
                'PUSH': [],
            }),
        ]

        def __init__(
            self,
            name=None,
            source_type=None,
            source_endpoint=None,
            size=None,
            checksum_info=None,
        ):
            """
            :type  name: :class:`str`
            :param name: The name of the file being uploaded.
            :type  source_type: :class:`File.SourceType`
            :param source_type: The source type (NONE, PUSH, PULL) from which the file content will
                be retrieved.
            :type  source_endpoint: :class:`com.vmware.content.library.item_client.TransferEndpoint`
            :param source_endpoint: Location from which the Content Library Service will fetch the
                file, rather than requiring a client to upload the file.
                This attribute is optional and it is only relevant when the value
                of ``sourceType`` is :attr:`File.SourceType.PULL`.
            :type  size: :class:`long` or ``None``
            :param size: The file size, in bytes.
                If None, the server will not verify it received the correct size.
            :type  checksum_info: :class:`com.vmware.content.library.item_client.File.ChecksumInfo` or ``None``
            :param checksum_info: The checksum of the file. If specified, the server will verify the
                checksum once the file is received. If there is a mismatch, the
                upload will fail. For ova files, this value should not be set.
                If None, the server will not verify the checksum.
            """
            self.name = name
            self.source_type = source_type
            self.source_endpoint = source_endpoint
            self.size = size
            self.checksum_info = checksum_info
            VapiStruct.__init__(self)

    AddSpec._set_binding_type(
        type.StructType(
            'com.vmware.content.library.item.updatesession.file.add_spec', {
                'name':
                type.StringType(),
                'source_type':
                type.ReferenceType(__name__, 'File.SourceType'),
                'source_endpoint':
                type.OptionalType(
                    type.ReferenceType(
                        'com.vmware.content.library.item_client',
                        'TransferEndpoint')),
                'size':
                type.OptionalType(type.IntegerType()),
                'checksum_info':
                type.OptionalType(
                    type.ReferenceType(
                        'com.vmware.content.library.item_client',
                        'File.ChecksumInfo')),
            }, AddSpec, False, None))

    class Info(VapiStruct):
        """
        The ``File.Info`` class defines the uploaded file.

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

        _validator_list = [
            UnionValidator(
                'source_type', {
                    'PULL': [('source_endpoint', True)],
                    'PUSH': [('upload_endpoint', True)],
                    'NONE': [],
                }),
        ]

        def __init__(
            self,
            name=None,
            source_type=None,
            size=None,
            checksum_info=None,
            source_endpoint=None,
            upload_endpoint=None,
            bytes_transferred=None,
            status=None,
            error_message=None,
            keep_in_storage=None,
        ):
            """
            :type  name: :class:`str`
            :param name: The name of the file.
            :type  source_type: :class:`File.SourceType`
            :param source_type: The source type (NONE, PUSH, PULL) from which the file is being
                retrieved. This may be :attr:`File.SourceType.NONE` if the file is
                not being changed.
            :type  size: :class:`long` or ``None``
            :param size: The file size, in bytes as received by the server. This attribute
                is guaranteed to be set when the server has completely received the
                file.
                This attribute won't be set until the file status is
                :attr:`com.vmware.content.library.item_client.TransferStatus.READY`.
            :type  checksum_info: :class:`com.vmware.content.library.item_client.File.ChecksumInfo` or ``None``
            :param checksum_info: The checksum information of the file received by the server.
                If None, the server does not verify the checksum.
            :type  source_endpoint: :class:`com.vmware.content.library.item_client.TransferEndpoint`
            :param source_endpoint: A source endpoint from which to retrieve the file.
                This attribute is optional and it is only relevant when the value
                of ``sourceType`` is :attr:`File.SourceType.PULL`.
            :type  upload_endpoint: :class:`com.vmware.content.library.item_client.TransferEndpoint`
            :param upload_endpoint: An upload endpoint to which the client can push the content.
                This attribute is optional and it is only relevant when the value
                of ``sourceType`` is :attr:`File.SourceType.PUSH`.
            :type  bytes_transferred: :class:`long`
            :param bytes_transferred: The number of bytes of this file that have been received by the
                server.
            :type  status: :class:`com.vmware.content.library.item_client.TransferStatus`
            :param status: The transfer status (WAITING_FOR_TRANSFER, TRANSFERRING, READY,
                VALIDATING, ERROR) of this file.
            :type  error_message: :class:`com.vmware.vapi.std_client.LocalizableMessage` or ``None``
            :param error_message: Details about the transfer error.
                An error message is set if the status is
                :attr:`com.vmware.content.library.item_client.TransferStatus.ERROR`.
            :type  keep_in_storage: :class:`bool` or ``None``
            :param keep_in_storage: Whether or not the file will be kept in storage upon update session
                completion. The flag is true for most files, and false for metadata
                files such as manifest and certificate file of update session with
                library item type OVF. Any file with
                :attr:`File.Info.keep_in_storage` set to false will not show up in
                the list of files returned from
                :func:`com.vmware.content.library.item_client.File.list` upon
                update session completion. This attribute was added in vSphere API
                6.8.
                If None, the file will be kept in storage upon update session
                completion.
            """
            self.name = name
            self.source_type = source_type
            self.size = size
            self.checksum_info = checksum_info
            self.source_endpoint = source_endpoint
            self.upload_endpoint = upload_endpoint
            self.bytes_transferred = bytes_transferred
            self.status = status
            self.error_message = error_message
            self.keep_in_storage = keep_in_storage
            VapiStruct.__init__(self)

    Info._set_binding_type(
        type.StructType(
            'com.vmware.content.library.item.updatesession.file.info', {
                'name':
                type.StringType(),
                'source_type':
                type.ReferenceType(__name__, 'File.SourceType'),
                'size':
                type.OptionalType(type.IntegerType()),
                'checksum_info':
                type.OptionalType(
                    type.ReferenceType(
                        'com.vmware.content.library.item_client',
                        'File.ChecksumInfo')),
                'source_endpoint':
                type.OptionalType(
                    type.ReferenceType(
                        'com.vmware.content.library.item_client',
                        'TransferEndpoint')),
                'upload_endpoint':
                type.OptionalType(
                    type.ReferenceType(
                        'com.vmware.content.library.item_client',
                        'TransferEndpoint')),
                'bytes_transferred':
                type.IntegerType(),
                'status':
                type.ReferenceType('com.vmware.content.library.item_client',
                                   'TransferStatus'),
                'error_message':
                type.OptionalType(
                    type.ReferenceType('com.vmware.vapi.std_client',
                                       'LocalizableMessage')),
                'keep_in_storage':
                type.OptionalType(type.BooleanType()),
            }, Info, False, None))

    class ValidationError(VapiStruct):
        """
        The ``File.ValidationError`` class defines the validation error of a file
        in the session.

        .. tip::
            The arguments are used to initialize data attributes with the same
            names.
        """
        def __init__(
            self,
            name=None,
            error_message=None,
        ):
            """
            :type  name: :class:`str`
            :param name: The name of the file.
            :type  error_message: :class:`com.vmware.vapi.std_client.LocalizableMessage`
            :param error_message: A message indicating why the file was considered invalid.
            """
            self.name = name
            self.error_message = error_message
            VapiStruct.__init__(self)

    ValidationError._set_binding_type(
        type.StructType(
            'com.vmware.content.library.item.updatesession.file.validation_error',
            {
                'name':
                type.StringType(),
                'error_message':
                type.ReferenceType('com.vmware.vapi.std_client',
                                   'LocalizableMessage'),
            }, ValidationError, False, None))

    class ValidationResult(VapiStruct):
        """
        The ``File.ValidationResult`` class defines the result of validating the
        files in the session.

        .. tip::
            The arguments are used to initialize data attributes with the same
            names.
        """
        def __init__(
            self,
            has_errors=None,
            missing_files=None,
            invalid_files=None,
        ):
            """
            :type  has_errors: :class:`bool`
            :param has_errors: Whether the validation was succesful or not. In case of errors, the
                :attr:`File.ValidationResult.missing_files` and
                :attr:`File.ValidationResult.invalid_files` will contain at least
                one entry.
            :type  missing_files: :class:`set` of :class:`str`
            :param missing_files: A :class:`set` containing the names of the files that are required
                but the client hasn't added.
            :type  invalid_files: :class:`list` of :class:`File.ValidationError`
            :param invalid_files: A :class:`list` containing the files that have been identified as
                invalid and details about the error.
            """
            self.has_errors = has_errors
            self.missing_files = missing_files
            self.invalid_files = invalid_files
            VapiStruct.__init__(self)

    ValidationResult._set_binding_type(
        type.StructType(
            'com.vmware.content.library.item.updatesession.file.validation_result',
            {
                'has_errors':
                type.BooleanType(),
                'missing_files':
                type.SetType(type.StringType()),
                'invalid_files':
                type.ListType(
                    type.ReferenceType(__name__, 'File.ValidationError')),
            }, ValidationResult, False, None))

    def validate(
        self,
        update_session_id,
    ):
        """
        Validates the files in the update session with the referenced
        identifier and ensures all necessary files are received. In the case
        where a file is missing, this method will return its name in the
        :attr:`File.ValidationResult.missing_files` set. The user can add the
        missing files and try re-validating. For other type of errors,
        :attr:`File.ValidationResult.invalid_files` will contain the list of
        invalid files.

        :type  update_session_id: :class:`str`
        :param update_session_id:  Identifier of the update session to validate.
            The parameter must be an identifier for the resource type:
            ``com.vmware.content.library.item.UpdateSession``.
        :rtype: :class:`File.ValidationResult`
        :return: A validation result containing missing files or invalid files and
            the reason why they are invalid.
        :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` 
             if no update session with the given identifier exists.
        :raise: :class:`com.vmware.vapi.std.errors_client.NotAllowedInCurrentState` 
            if the update session is not in the
            :attr:`com.vmware.content.library.item_client.UpdateSessionModel.State.ACTIVE`
            state, or if some of the files that will be uploaded by the client
            aren't received correctly.
        :raise: :class:`com.vmware.vapi.std.errors_client.Unauthorized`
            if you do not have all of the privileges described as follows: 
            
            * Method execution requires ``System.Anonymous``.
        """
        return self._invoke('validate', {
            'update_session_id': update_session_id,
        })

    def add(
        self,
        update_session_id,
        file_spec,
    ):
        """
        Requests file content to be changed (either created, or updated).
        Depending on the source type of the file, this method will either
        return an upload endpoint where the client can push the content, or the
        server will pull from the provided source endpoint. If a file with the
        same name already exists in this session, this method will be used to
        update the content of the existing file. 
        
        When importing a file directly from storage, where the source endpoint
        is a file or datastore URI, you will need to have the
        ContentLibrary.ReadStorage privilege on the library item. If the file
        is located in the same directory as the library storage backing folder,
        the server will move the file instead of copying it, thereby allowing
        instantaneous import of files for efficient backup and restore
        scenarios. In all other cases, a copy is performed rather than a move.

        :type  update_session_id: :class:`str`
        :param update_session_id:  Identifier of the update session to be modified.
            The parameter must be an identifier for the resource type:
            ``com.vmware.content.library.item.UpdateSession``.
        :type  file_spec: :class:`File.AddSpec`
        :param file_spec: Specification for the file that needs to be added or updated. This
            includes whether the client wants to push the content or have the
            server pull it.
        :rtype: :class:`File.Info`
        :return: An :class:`File.Info` class containing upload links as well as
            server side state tracking the transfer of the file.
        :raise: :class:`com.vmware.vapi.std.errors_client.InvalidArgument` 
             if the ``file_spec`` is invalid.
        :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` 
             if the update session doesn't exist.
        :raise: :class:`com.vmware.vapi.std.errors_client.Unauthorized` 
            if the caller doesn't have ContentLibrary.ReadStorage privilege on
            the library item of the update session and source type
            :attr:`File.SourceType.PULL` is requested for a file or datastore
            source endpoint (that is, not HTTP or HTTPs based endpoint).
        :raise: :class:`com.vmware.vapi.std.errors_client.NotAllowedInCurrentState` 
            if the content of the library item associated with the update
            session has been deleted from the storage backings (see null)
            associated with it.
        :raise: :class:`com.vmware.vapi.std.errors_client.NotAllowedInCurrentState` 
            if metadata files such as manifest and certificate file are added
            after the OVF descriptor file. This is applicable to update
            sessions with library item type OVF only. This error was added in
            vSphere 6.8.0.
        :raise: :class:`com.vmware.vapi.std.errors_client.Unauthorized`
            if you do not have all of the privileges described as follows: 
            
            * Method execution requires ``System.Anonymous``.
        """
        return self._invoke('add', {
            'update_session_id': update_session_id,
            'file_spec': file_spec,
        })

    def remove(
        self,
        update_session_id,
        file_name,
    ):
        """
        Requests a file to be removed. The file will only be effectively
        removed when the update session is completed.

        :type  update_session_id: :class:`str`
        :param update_session_id:  Identifier of the update session.
            The parameter must be an identifier for the resource type:
            ``com.vmware.content.library.item.UpdateSession``.
        :type  file_name: :class:`str`
        :param file_name:  Name of the file to be removed.
        :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` 
             if the update session doesn't exist.
        :raise: :class:`com.vmware.vapi.std.errors_client.InvalidArgument` 
            if the file doesn't exist in the library item associated with the
            update session.
        :raise: :class:`com.vmware.vapi.std.errors_client.Unauthorized`
            if you do not have all of the privileges described as follows: 
            
            * Method execution requires ``System.Anonymous``.
        """
        return self._invoke('remove', {
            'update_session_id': update_session_id,
            'file_name': file_name,
        })

    def list(
        self,
        update_session_id,
    ):
        """
        Lists all files in the library item associated with the update session.

        :type  update_session_id: :class:`str`
        :param update_session_id:  Identifier of the update session.
            The parameter must be an identifier for the resource type:
            ``com.vmware.content.library.item.UpdateSession``.
        :rtype: :class:`list` of :class:`File.Info`
        :return: The :class:`list` of the files in the library item associated with
            the update session. This :class:`list` may be empty if the caller
            has removed all the files as part of this session (in which case
            completing the update session will result in an empty library
            item).
        :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` 
             if the update session doesn't exist.
        :raise: :class:`com.vmware.vapi.std.errors_client.Unauthorized`
            if you do not have all of the privileges described as follows: 
            
            * Method execution requires ``System.Anonymous``.
        """
        return self._invoke('list', {
            'update_session_id': update_session_id,
        })

    def get(
        self,
        update_session_id,
        file_name,
    ):
        """
        Retrieves information about a specific file in the snapshot of the
        library item at the time when the update session was created.

        :type  update_session_id: :class:`str`
        :param update_session_id:  Identifier of the update session.
            The parameter must be an identifier for the resource type:
            ``com.vmware.content.library.item.UpdateSession``.
        :type  file_name: :class:`str`
        :param file_name:  Name of the file.
        :rtype: :class:`File.Info`
        :return: Information about the file.
        :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` 
             if the update session doesn't exist.
        :raise: :class:`com.vmware.vapi.std.errors_client.InvalidArgument` 
            if the file doesn't exist in the library item associated with the
            update session.
        :raise: :class:`com.vmware.vapi.std.errors_client.Unauthorized`
            if you do not have all of the privileges described as follows: 
            
            * Method execution requires ``System.Anonymous``.
        """
        return self._invoke('get', {
            'update_session_id': update_session_id,
            'file_name': file_name,
        })
Exemple #4
0
class Pending(VapiInterface):
    """
    The ``Pending`` class provides method for listing pending minor or major
    updates of vCenter Server.
    """
    RESOURCE_TYPE = "com.vmware.vcenter.lcm.update.pending"
    """
    Resource type for pending update

    """

    _VAPI_SERVICE_ID = 'com.vmware.vcenter.lcm.update.pending'
    """
    Identifier of the service in canonical form.
    """
    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, _PendingStub)
        self._VAPI_OPERATION_IDS = {}

    class SeverityType(Enum):
        """
        Level of severity for applying a given patch or update.

        .. note::
            This class represents an enumerated type in the interface language
            definition. The class contains class attributes which represent the
            values in the current version of the enumerated type. Newer versions of
            the enumerated type may contain new values. To use new values of the
            enumerated type in communication with a server that supports the newer
            version of the API, you instantiate this class. See :ref:`enumerated
            type description page <enumeration_description>`.
        """
        CRITICAL = None
        """
        Vulnerabilities that can be exploited by an unauthenticated attacker from
        the Internet or those that break the guest/host Operating System isolation.

        """
        IMPORTANT = None
        """
        Vulnerabilities that are not rated critical but whose exploitation results
        in the complete compromise of confidentiality and/or integrity of user data
        and/or processing resources through user assistance or by authenticated
        attackers.

        """
        MODERATE = None
        """
        Vulnerabilities where the ability to exploit is mitigated to a significant
        degree by configuration or difficulty of exploitation, but in certain
        deployment scenarios could still lead to the compromise of confidentiality,
        integrity, or availability of user data and/or processing resources.

        """
        LOW = None
        """
        All other issues that may or maynot have a security impact. Vulnerabilities
        where exploitation is believed to be extremely difficult, or where
        successful exploitation would have minimal impact.

        """
        def __init__(self, string):
            """
            :type  string: :class:`str`
            :param string: String value for the :class:`SeverityType` instance.
            """
            Enum.__init__(string)

    SeverityType._set_values([
        SeverityType('CRITICAL'),
        SeverityType('IMPORTANT'),
        SeverityType('MODERATE'),
        SeverityType('LOW'),
    ])
    SeverityType._set_binding_type(
        type.EnumType('com.vmware.vcenter.lcm.update.pending.severity_type',
                      SeverityType))

    class Category(Enum):
        """
        The ``Pending.Category`` class defines the type of payload this release has
        on top of previous release

        .. note::
            This class represents an enumerated type in the interface language
            definition. The class contains class attributes which represent the
            values in the current version of the enumerated type. Newer versions of
            the enumerated type may contain new values. To use new values of the
            enumerated type in communication with a server that supports the newer
            version of the API, you instantiate this class. See :ref:`enumerated
            type description page <enumeration_description>`.
        """
        SECURITY = None
        """
        Fixes vulnerabilities, doesn't change functionality

        """
        FIX = None
        """
        Fixes bugs/vulnerabilities, doesn't change functionality

        """
        UPDATE = None
        """
        Changes product functionality

        """
        UPGRADE = None
        """
        Introduces new features, significantly changes product functionality

        """
        def __init__(self, string):
            """
            :type  string: :class:`str`
            :param string: String value for the :class:`Category` instance.
            """
            Enum.__init__(string)

    Category._set_values([
        Category('SECURITY'),
        Category('FIX'),
        Category('UPDATE'),
        Category('UPGRADE'),
    ])
    Category._set_binding_type(
        type.EnumType('com.vmware.vcenter.lcm.update.pending.category',
                      Category))

    class UpdateType(Enum):
        """
        The ``Pending.UpdateType`` class defines update type

        .. note::
            This class represents an enumerated type in the interface language
            definition. The class contains class attributes which represent the
            values in the current version of the enumerated type. Newer versions of
            the enumerated type may contain new values. To use new values of the
            enumerated type in communication with a server that supports the newer
            version of the API, you instantiate this class. See :ref:`enumerated
            type description page <enumeration_description>`.
        """
        PATCH = None
        """
        Fixes bugs/vulnerabilities, doesn't change functionality

        """
        UPDATE = None
        """
        Changes product functionality

        """
        UPGRADE = None
        """
        Introduces new features, significantly changes product functionality

        """
        def __init__(self, string):
            """
            :type  string: :class:`str`
            :param string: String value for the :class:`UpdateType` instance.
            """
            Enum.__init__(string)

    UpdateType._set_values([
        UpdateType('PATCH'),
        UpdateType('UPDATE'),
        UpdateType('UPGRADE'),
    ])
    UpdateType._set_binding_type(
        type.EnumType('com.vmware.vcenter.lcm.update.pending.update_type',
                      UpdateType))

    class Summary(VapiStruct):
        """
        The ``Pending.Summary`` class contains basic information about the vCenter
        patch/update/upgrade

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

        _canonical_to_pep_names = {
            'execute_URL': 'execute_url',
        }

        def __init__(
            self,
            pending_update=None,
            version=None,
            release_date=None,
            severity=None,
            build=None,
            update_type=None,
            category=None,
            reboot_required=None,
            execute_url=None,
            release_notes=None,
        ):
            """
            :type  pending_update: :class:`str`
            :param pending_update: Identifier of the given vSphere update
                When clients pass a value of this class as a parameter, the
                attribute must be an identifier for the resource type:
                ``com.vmware.vcenter.lcm.update.pending``. When methods return a
                value of this class as a return value, the attribute will be an
                identifier for the resource type:
                ``com.vmware.vcenter.lcm.update.pending``.
            :type  version: :class:`str`
            :param version: Version of the vSphere update or patch
            :type  release_date: :class:`datetime.datetime`
            :param release_date: Release date of the vSphere update or patch
            :type  severity: :class:`Pending.SeverityType`
            :param severity: Severity of the issues fixed in the vSphere update or patch
            :type  build: :class:`str`
            :param build: Build number of the vCenter Release
            :type  update_type: :class:`Pending.UpdateType`
            :param update_type: Type of the Release based on the current vCenter version
            :type  category: :class:`Pending.Category`
            :param category: Category of the release based on features bundled on top of
                previous release
            :type  reboot_required: :class:`bool`
            :param reboot_required: Flag to suggest a reboot after the release is applied
            :type  execute_url: :class:`str`
            :param execute_url: VAMI or ISO URL for update or upgrade execute phase redirection
            :type  release_notes: :class:`list` of :class:`str`
            :param release_notes: List of URI pointing to patch or update release notes
            """
            self.pending_update = pending_update
            self.version = version
            self.release_date = release_date
            self.severity = severity
            self.build = build
            self.update_type = update_type
            self.category = category
            self.reboot_required = reboot_required
            self.execute_url = execute_url
            self.release_notes = release_notes
            VapiStruct.__init__(self)

    Summary._set_binding_type(
        type.StructType(
            'com.vmware.vcenter.lcm.update.pending.summary', {
                'pending_update':
                type.IdType(
                    resource_types='com.vmware.vcenter.lcm.update.pending'),
                'version':
                type.StringType(),
                'release_date':
                type.DateTimeType(),
                'severity':
                type.ReferenceType(__name__, 'Pending.SeverityType'),
                'build':
                type.StringType(),
                'update_type':
                type.ReferenceType(__name__, 'Pending.UpdateType'),
                'category':
                type.ReferenceType(__name__, 'Pending.Category'),
                'reboot_required':
                type.BooleanType(),
                'execute_URL':
                type.URIType(),
                'release_notes':
                type.ListType(type.URIType()),
            }, Summary, False, None))

    class ListResult(VapiStruct):
        """
        The ``Pending.ListResult`` class contains information about the pending
        patch/updates for the given vCenter server.

        .. tip::
            The arguments are used to initialize data attributes with the same
            names.
        """
        def __init__(
            self,
            last_check_time=None,
            update_count=None,
            upgrade_count=None,
            updates=None,
            issues=None,
        ):
            """
            :type  last_check_time: :class:`datetime.datetime`
            :param last_check_time: Time when the software depo was last checked.
            :type  update_count: :class:`long` or ``None``
            :param update_count: Number of pending updates
                Only :class:`set` if there are available updates
            :type  upgrade_count: :class:`long` or ``None``
            :param upgrade_count: Number of pending upgrades
                Only :class:`set` if there are available upgrades
            :type  updates: :class:`list` of :class:`Pending.Summary`
            :param updates: List of pending update details
            :type  issues: :class:`com.vmware.vcenter.lcm_client.Notifications` or ``None``
            :param issues: Lists of issues encountered during pending updates retrieval.
                :class:`set` if any issues encountered.
            """
            self.last_check_time = last_check_time
            self.update_count = update_count
            self.upgrade_count = upgrade_count
            self.updates = updates
            self.issues = issues
            VapiStruct.__init__(self)

    ListResult._set_binding_type(
        type.StructType(
            'com.vmware.vcenter.lcm.update.pending.list_result', {
                'last_check_time':
                type.DateTimeType(),
                'update_count':
                type.OptionalType(type.IntegerType()),
                'upgrade_count':
                type.OptionalType(type.IntegerType()),
                'updates':
                type.ListType(type.ReferenceType(__name__, 'Pending.Summary')),
                'issues':
                type.OptionalType(
                    type.ReferenceType('com.vmware.vcenter.lcm_client',
                                       'Notifications')),
            }, ListResult, False, None))

    class Info(VapiStruct):
        """
        The ``Pending.Info`` class contains detailed information about the vCenter
        patch/update.

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

        _canonical_to_pep_names = {
            'execute_URL': 'execute_url',
        }

        def __init__(
            self,
            description=None,
            pending_update=None,
            version=None,
            release_date=None,
            severity=None,
            build=None,
            update_type=None,
            category=None,
            reboot_required=None,
            execute_url=None,
            release_notes=None,
        ):
            """
            :type  description: :class:`str`
            :param description: Description of the vSphere update
            :type  pending_update: :class:`str`
            :param pending_update: Identifier of the given vSphere update
                When clients pass a value of this class as a parameter, the
                attribute must be an identifier for the resource type:
                ``com.vmware.vcenter.lcm.update.pending``. When methods return a
                value of this class as a return value, the attribute will be an
                identifier for the resource type:
                ``com.vmware.vcenter.lcm.update.pending``.
            :type  version: :class:`str`
            :param version: Version of the vSphere update or patch
            :type  release_date: :class:`datetime.datetime`
            :param release_date: Release date of the vSphere update or patch
            :type  severity: :class:`Pending.SeverityType`
            :param severity: Severity of the issues fixed in the vSphere update or patch
            :type  build: :class:`str`
            :param build: Build number of the vCenter Release
            :type  update_type: :class:`Pending.UpdateType`
            :param update_type: Type of the Release based on the current vCenter version
            :type  category: :class:`Pending.Category`
            :param category: Category of the release based on features bundled on top of
                previous release
            :type  reboot_required: :class:`bool`
            :param reboot_required: Flag to suggest a reboot after the release is applied
            :type  execute_url: :class:`str`
            :param execute_url: VAMI or ISO URL for update or upgrade execute phase redirection
            :type  release_notes: :class:`list` of :class:`str`
            :param release_notes: List of URI pointing to patch or update release notes
            """
            self.description = description
            self.pending_update = pending_update
            self.version = version
            self.release_date = release_date
            self.severity = severity
            self.build = build
            self.update_type = update_type
            self.category = category
            self.reboot_required = reboot_required
            self.execute_url = execute_url
            self.release_notes = release_notes
            VapiStruct.__init__(self)

    Info._set_binding_type(
        type.StructType(
            'com.vmware.vcenter.lcm.update.pending.info', {
                'description':
                type.StringType(),
                'pending_update':
                type.IdType(
                    resource_types='com.vmware.vcenter.lcm.update.pending'),
                'version':
                type.StringType(),
                'release_date':
                type.DateTimeType(),
                'severity':
                type.ReferenceType(__name__, 'Pending.SeverityType'),
                'build':
                type.StringType(),
                'update_type':
                type.ReferenceType(__name__, 'Pending.UpdateType'),
                'category':
                type.ReferenceType(__name__, 'Pending.Category'),
                'reboot_required':
                type.BooleanType(),
                'execute_URL':
                type.URIType(),
                'release_notes':
                type.ListType(type.URIType()),
            }, Info, False, None))

    def list(self):
        """
        Lists all available minor and major updates.


        :rtype: :class:`Pending.ListResult`
        :return: Information about the pending patch/updates for the given vCenter
            server
        :raise: :class:`com.vmware.vapi.std.errors_client.Unauthenticated` 
            if the user can not be authenticated.
        :raise: :class:`com.vmware.vapi.std.errors_client.Error` 
            if there is some unknown internal error. The accompanying error
            message will give more details about the error.
        """
        return self._invoke('list', None)

    def get(
        self,
        version,
    ):
        """
        Gets detailed update information.

        :type  version: :class:`str`
        :param version: A version identified the update
            The parameter must be an identifier for the resource type:
            ``com.vmware.vcenter.lcm.update.pending``.
        :rtype: :class:`Pending.Info`
        :return: A detailed information about the particular vCenter patch/update
        :raise: :class:`com.vmware.vapi.std.errors_client.Unauthenticated` 
            if the user can not be authenticated.
        :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` 
            if there is no pending update assosiated with the ``version`` in
            the system.
        :raise: :class:`com.vmware.vapi.std.errors_client.Error` 
            if there is some unknown internal error. The accompanying error
            message will give more details about the error.
        """
        return self._invoke('get', {
            'version': version,
        })
Exemple #5
0
    class ConnectionStatus(VapiStruct):
        """


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

        _validator_list = [
            UnionValidator(
                'state',
                {
                    'DOWN' : [('message', False)],
                    'UP' : [],
                    'UNKNOWN' : [],
                }
            ),
        ]



        def __init__(self,
                     hostname=None,
                     state=None,
                     message=None,
                    ):
            """
            :type  hostname: :class:`str`
            :param hostname: FQDN or IP address of the configured remote logging servers. This
                attribute was added in vSphere API 6.7.
            :type  state: :class:`Forwarding.ConnectionStatus.State`
            :param state: State of the configured remote logging server. This attribute was
                added in vSphere API 6.7.
            :type  message: :class:`com.vmware.vapi.std_client.LocalizableMessage` or ``None``
            :param message: Message associated with the state of the configured remote logging
                server. This attribute was added in vSphere API 6.7.
                If None, there is no message to be shown.
            """
            self.hostname = hostname
            self.state = state
            self.message = message
            VapiStruct.__init__(self)


        class State(Enum):
            """
            The ``Forwarding.ConnectionStatus.State`` class defines the state values
            that a remote logging server can be in. This enumeration was added in
            vSphere API 6.7.

            .. note::
                This class represents an enumerated type in the interface language
                definition. The class contains class attributes which represent the
                values in the current version of the enumerated type. Newer versions of
                the enumerated type may contain new values. To use new values of the
                enumerated type in communication with a server that supports the newer
                version of the API, you instantiate this class. See :ref:`enumerated
                type description page <enumeration_description>`.
            """
            UP = None
            """
            The remote logging server is reachable. This class attribute was added in
            vSphere API 6.7.

            """
            DOWN = None
            """
            The remote logging server is not reachable. This class attribute was added
            in vSphere API 6.7.

            """
            UNKNOWN = None
            """
            The status of remote logging server is unknown. This class attribute was
            added in vSphere API 6.7.

            """

            def __init__(self, string):
                """
                :type  string: :class:`str`
                :param string: String value for the :class:`State` instance.
                """
                Enum.__init__(string)

        State._set_values([
            State('UP'),
            State('DOWN'),
            State('UNKNOWN'),
        ])
        State._set_binding_type(type.EnumType(
            'com.vmware.appliance.logging.forwarding.connection_status.state',
            State))
Exemple #6
0
class Status(VapiStruct):
    """
    The ``Status`` class describes the current status of a compute policy.
    **Warning:** This class is available as technical preview. It may be
    changed in a future release.

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




    def __init__(self,
                 status=None,
                ):
        """
        :type  status: :class:`Status.Compliance`
        :param status: The compliance status of the policy on a specified object.
            **Warning:** This attribute is available as technical preview. It
            may be changed in a future release.
        """
        self.status = status
        VapiStruct.__init__(self)


    class Compliance(Enum):
        """
        The ``Status.Compliance`` class defines the compliance states a policy can
        be in on a particular object. **Warning:** This enumeration is available as
        technical preview. It may be changed in a future release.

        .. note::
            This class represents an enumerated type in the interface language
            definition. The class contains class attributes which represent the
            values in the current version of the enumerated type. Newer versions of
            the enumerated type may contain new values. To use new values of the
            enumerated type in communication with a server that supports the newer
            version of the API, you instantiate this class. See :ref:`enumerated
            type description page <enumeration_description>`.
        """
        NOT_APPLICABLE = None
        """
        The object is in a state for which the policy does not apply. **Warning:**
        This class attribute is available as technical preview. It may be changed
        in a future release.

        """
        COMPLIANT = None
        """
        The policy is in compliance on the object. **Warning:** This class
        attribute is available as technical preview. It may be changed in a future
        release.

        """
        NOT_COMPLIANT = None
        """
        The policy is not in compliance on the object. **Warning:** This class
        attribute is available as technical preview. It may be changed in a future
        release.

        """

        def __init__(self, string):
            """
            :type  string: :class:`str`
            :param string: String value for the :class:`Compliance` instance.
            """
            Enum.__init__(string)

    Compliance._set_values([
        Compliance('NOT_APPLICABLE'),
        Compliance('COMPLIANT'),
        Compliance('NOT_COMPLIANT'),
    ])
    Compliance._set_binding_type(type.EnumType(
        'com.vmware.vcenter.compute.policies.status.compliance',
        Compliance))
class Backup(VapiInterface):
    """
    ``Backup`` class provides methods Performs backup restore operations
    """

    _VAPI_SERVICE_ID = 'com.vmware.appliance.recovery.backup'
    """
    Identifier of the service in canonical form.
    """
    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, _BackupStub)

    class ReturnStatus(Enum):
        """
        ``Backup.ReturnStatus`` class Defines the state of precheck

        .. note::
            This class represents an enumerated type in the interface language
            definition. The class contains class attributes which represent the
            values in the current version of the enumerated type. Newer versions of
            the enumerated type may contain new values. To use new values of the
            enumerated type in communication with a server that supports the newer
            version of the API, you instantiate this class. See :ref:`enumerated
            type description page <enumeration_description>`.
        """
        FAIL = None
        """
        Check failed

        """
        WARNING = None
        """
        Passed with warnings

        """
        OK = None
        """
        Check passed

        """
        def __init__(self, string):
            """
            :type  string: :class:`str`
            :param string: String value for the :class:`ReturnStatus` instance.
            """
            Enum.__init__(string)

    ReturnStatus._set_values([
        ReturnStatus('FAIL'),
        ReturnStatus('WARNING'),
        ReturnStatus('OK'),
    ])
    ReturnStatus._set_binding_type(
        type.EnumType('com.vmware.appliance.recovery.backup.return_status',
                      ReturnStatus))

    class LocationType(Enum):
        """
        ``Backup.LocationType`` class Defines type of all locations for
        backup/restore

        .. note::
            This class represents an enumerated type in the interface language
            definition. The class contains class attributes which represent the
            values in the current version of the enumerated type. Newer versions of
            the enumerated type may contain new values. To use new values of the
            enumerated type in communication with a server that supports the newer
            version of the API, you instantiate this class. See :ref:`enumerated
            type description page <enumeration_description>`.
        """
        FTP = None
        """
        Destination is FTP server

        """
        HTTP = None
        """
        Destination is HTTP server

        """
        FTPS = None
        """
        Destination is FTPS server

        """
        HTTPS = None
        """
        Destination is HTTPS server

        """
        SCP = None
        """
        Destination is SSH server

        """
        SFTP = None
        """
        Destination is SFTP server

        """
        NFS = None
        """
        Destination is NFS server. This class attribute was added in vSphere API
        6.7.2.

        """
        SMB = None
        """
        Destination is SMB server. This class attribute was added in vSphere API
        6.7.2.

        """
        def __init__(self, string):
            """
            :type  string: :class:`str`
            :param string: String value for the :class:`LocationType` instance.
            """
            Enum.__init__(string)

    LocationType._set_values([
        LocationType('FTP'),
        LocationType('HTTP'),
        LocationType('FTPS'),
        LocationType('HTTPS'),
        LocationType('SCP'),
        LocationType('SFTP'),
        LocationType('NFS'),
        LocationType('SMB'),
    ])
    LocationType._set_binding_type(
        type.EnumType('com.vmware.appliance.recovery.backup.location_type',
                      LocationType))

    class LocalizableMessage(VapiStruct):
        """
        ``Backup.LocalizableMessage`` class Structure representing message

        .. tip::
            The arguments are used to initialize data attributes with the same
            names.
        """
        def __init__(
            self,
            id=None,
            default_message=None,
            args=None,
        ):
            """
            :type  id: :class:`str`
            :param id: id in message bundle
            :type  default_message: :class:`str`
            :param default_message: text in english
            :type  args: :class:`list` of :class:`str`
            :param args: nested data
            """
            self.id = id
            self.default_message = default_message
            self.args = args
            VapiStruct.__init__(self)

    LocalizableMessage._set_binding_type(
        type.StructType(
            'com.vmware.appliance.recovery.backup.localizable_message', {
                'id': type.StringType(),
                'default_message': type.StringType(),
                'args': type.ListType(type.StringType()),
            }, LocalizableMessage, False, None))

    class ReturnResult(VapiStruct):
        """
        ``Backup.ReturnResult`` class Structure representing precheck result

        .. tip::
            The arguments are used to initialize data attributes with the same
            names.
        """
        def __init__(
            self,
            status=None,
            messages=None,
        ):
            """
            :type  status: :class:`Backup.ReturnStatus`
            :param status: Check status
            :type  messages: :class:`list` of :class:`Backup.LocalizableMessage`
            :param messages: List of messages
            """
            self.status = status
            self.messages = messages
            VapiStruct.__init__(self)

    ReturnResult._set_binding_type(
        type.StructType(
            'com.vmware.appliance.recovery.backup.return_result', {
                'status':
                type.ReferenceType(__name__, 'Backup.ReturnStatus'),
                'messages':
                type.ListType(
                    type.ReferenceType(__name__, 'Backup.LocalizableMessage')),
            }, ReturnResult, False, None))

    class BackupRequest(VapiStruct):
        """
        ``Backup.BackupRequest`` class Structure representing requested backup
        piece

        .. tip::
            The arguments are used to initialize data attributes with the same
            names.
        """
        def __init__(
            self,
            parts=None,
            backup_password=None,
            location_type=None,
            location=None,
            location_user=None,
            location_password=None,
            comment=None,
        ):
            """
            :type  parts: :class:`list` of :class:`str`
            :param parts: a list of optional parts. Run backup parts APIs to get list of
                optional parts and description
            :type  backup_password: :class:`str` or ``None``
            :param backup_password: a password for a backup piece The backupPassword must adhere to the
                following password requirements: At least 8 characters, cannot be
                more than 20 characters in length. At least 1 uppercase letter. At
                least 1 lowercase letter. At least 1 numeric digit. At least 1
                special character (i.e. any character not in [0-9,a-z,A-Z]). Only
                visible ASCII characters (for example, no space).
                backupPassword If no password then the piece will not be encrypted
            :type  location_type: :class:`Backup.LocationType`
            :param location_type: a type of location
            :type  location: :class:`str`
            :param location: path or url
            :type  location_user: :class:`str` or ``None``
            :param location_user: username for location
                locationUser User name for this location if login is required.
            :type  location_password: :class:`str` or ``None``
            :param location_password: password for location
                locationPassword Password for the specified user if login is
                required at this location.
            :type  comment: :class:`str` or ``None``
            :param comment: Custom comment
                comment an optional comment
            """
            self.parts = parts
            self.backup_password = backup_password
            self.location_type = location_type
            self.location = location
            self.location_user = location_user
            self.location_password = location_password
            self.comment = comment
            VapiStruct.__init__(self)

    BackupRequest._set_binding_type(
        type.StructType(
            'com.vmware.appliance.recovery.backup.backup_request', {
                'parts':
                type.ListType(type.StringType()),
                'backup_password':
                type.OptionalType(type.SecretType()),
                'location_type':
                type.ReferenceType(__name__, 'Backup.LocationType'),
                'location':
                type.StringType(),
                'location_user':
                type.OptionalType(type.StringType()),
                'location_password':
                type.OptionalType(type.SecretType()),
                'comment':
                type.OptionalType(type.StringType()),
            }, BackupRequest, False, None))

    def validate(
        self,
        piece,
    ):
        """
        Check for backup errors without starting backup.

        :type  piece: :class:`Backup.BackupRequest`
        :param piece: BackupRequest Structure
        :rtype: :class:`Backup.ReturnResult`
        :return: ReturnResult Structure
        :raise: :class:`com.vmware.vapi.std.errors_client.FeatureInUse` 
            A backup or restore is already in progress
        :raise: :class:`com.vmware.vapi.std.errors_client.Error` 
            Generic error
        """
        return self._invoke('validate', {
            'piece': piece,
        })
class InvocationResult(VapiStruct):
    """
    Information about the result from an interposed operation invocation. All
    POST interposers will receive an instance of this structure.

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

    _validator_list = [
        UnionValidator(
            'result_type',
            {
                'NORMAL_RESULT' : [('output', True)],
                'ERROR_RESULT' : [('error', True)],
            }
        ),
    ]



    def __init__(self,
                 result_type=None,
                 output=None,
                 error=None,
                ):
        """
        :type  result_type: :class:`InvocationResult.ResultType`
        :param result_type: Type of the invocation result.
        :type  output: :class:`DataValue`
        :param output: Normal result value.
            This attribute is optional and it is only relevant when the value
            of ``resultType`` is
            :attr:`InvocationResult.ResultType.NORMAL_RESULT`.
        :type  error: :class:`vmware.vapi.struct.VapiStruct`
        :param error: Error result value.
            This attribute is optional and it is only relevant when the value
            of ``resultType`` is
            :attr:`InvocationResult.ResultType.ERROR_RESULT`.
        """
        self.result_type = result_type
        self.output = output
        self.error = error
        VapiStruct.__init__(self)


    class ResultType(Enum):
        """
        Type of the invocation result.

        .. note::
            This class represents an enumerated type in the interface language
            definition. The class contains class attributes which represent the
            values in the current version of the enumerated type. Newer versions of
            the enumerated type may contain new values. To use new values of the
            enumerated type in communication with a server that supports the newer
            version of the API, you instantiate this class. See :ref:`enumerated
            type description page <enumeration_description>`.
        """
        NORMAL_RESULT = None
        """
        Normal invocation result.

        """
        ERROR_RESULT = None
        """
        Error invocation result.

        """

        def __init__(self, string):
            """
            :type  string: :class:`str`
            :param string: String value for the :class:`ResultType` instance.
            """
            Enum.__init__(string)

    ResultType._set_values([
        ResultType('NORMAL_RESULT'),
        ResultType('ERROR_RESULT'),
    ])
    ResultType._set_binding_type(type.EnumType(
        'com.vmware.vapi.std.interposition.invocation_result.result_type',
        ResultType))
Exemple #9
0
class Clusters(VapiInterface):
    """
    The ``Clusters`` class provides methods to upgrade the vSphere clusters.
    """

    _VAPI_SERVICE_ID = 'com.vmware.vcenter.namespace_management.software.clusters'
    """
    Identifier of the service in canonical form.
    """
    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, _ClustersStub)
        self._VAPI_OPERATION_IDS = {}

    class State(Enum):
        """
        The ``Clusters.State`` class describes the state of the upgrade.

        .. note::
            This class represents an enumerated type in the interface language
            definition. The class contains class attributes which represent the
            values in the current version of the enumerated type. Newer versions of
            the enumerated type may contain new values. To use new values of the
            enumerated type in communication with a server that supports the newer
            version of the API, you instantiate this class. See :ref:`enumerated
            type description page <enumeration_description>`.
        """
        PENDING = None
        """
        Upgrade is in progress.

        """
        READY = None
        """
        Cluster is ready when there is no upgrade or upgrade is completed.

        """
        ERROR = None
        """
        Upgrade failed and need user intervention.

        """
        def __init__(self, string):
            """
            :type  string: :class:`str`
            :param string: String value for the :class:`State` instance.
            """
            Enum.__init__(string)

    State._set_values([
        State('PENDING'),
        State('READY'),
        State('ERROR'),
    ])
    State._set_binding_type(
        type.EnumType(
            'com.vmware.vcenter.namespace_management.software.clusters.state',
            State))

    class Result(VapiStruct):
        """
        The ``Clusters.Result`` class contains the result of batch upgrade method.

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

        _validator_list = [
            UnionValidator('res', {
                'REJECTED': [('exception', True)],
                'STARTED': [],
            }),
        ]

        def __init__(
            self,
            res=None,
            exception=None,
        ):
            """
            :type  res: :class:`Clusters.Result.Res`
            :param res: The result of batch upgrade method.
            :type  exception: :class:`Exception`
            :param exception: Exception when cluster pre-check failed during upgrade invocation.
                This attribute is optional and it is only relevant when the value
                of ``res`` is :attr:`Clusters.Result.Res.REJECTED`.
            """
            self.res = res
            self.exception = exception
            VapiStruct.__init__(self)

        class Res(Enum):
            """
            The ``Clusters.Result.Res`` class represents the upgrade invocation result
            for each cluster.

            .. note::
                This class represents an enumerated type in the interface language
                definition. The class contains class attributes which represent the
                values in the current version of the enumerated type. Newer versions of
                the enumerated type may contain new values. To use new values of the
                enumerated type in communication with a server that supports the newer
                version of the API, you instantiate this class. See :ref:`enumerated
                type description page <enumeration_description>`.
            """
            STARTED = None
            """
            Upgrade is started.

            """
            REJECTED = None
            """
            Upgrade is rejected. This implies pre-check failed when invoking upgrade of
            the cluster.

            """
            def __init__(self, string):
                """
                :type  string: :class:`str`
                :param string: String value for the :class:`Res` instance.
                """
                Enum.__init__(string)

        Res._set_values([
            Res('STARTED'),
            Res('REJECTED'),
        ])
        Res._set_binding_type(
            type.EnumType(
                'com.vmware.vcenter.namespace_management.software.clusters.result.res',
                Res))

    Result._set_binding_type(
        type.StructType(
            'com.vmware.vcenter.namespace_management.software.clusters.result',
            {
                'res': type.ReferenceType(__name__, 'Clusters.Result.Res'),
                'exception': type.OptionalType(type.AnyErrorType()),
            }, Result, False, None))

    class UpgradeSpec(VapiStruct):
        """
        The ``Clusters.UpgradeSpec`` class contains the specification required to
        upgrade a cluster.

        .. tip::
            The arguments are used to initialize data attributes with the same
            names.
        """
        def __init__(
            self,
            desired_version=None,
            ignore_precheck_warnings=None,
        ):
            """
            :type  desired_version: :class:`str`
            :param desired_version: Version number the cluster is going to be upgraded to.
            :type  ignore_precheck_warnings: :class:`bool` or ``None``
            :param ignore_precheck_warnings: If true, the upgrade workflow will ignore any pre-check warnings
                and proceed with the upgrade.
                If None, the upgrade workflow will not ignore pre-check warnings
                and fail the upgrade. It is equivalent to setting the value to
                false. The workflow adopts a conservative approach of failing the
                upgrade if None to solely let the user decide whether to force the
                upgrade despite the warnings.
            """
            self.desired_version = desired_version
            self.ignore_precheck_warnings = ignore_precheck_warnings
            VapiStruct.__init__(self)

    UpgradeSpec._set_binding_type(
        type.StructType(
            'com.vmware.vcenter.namespace_management.software.clusters.upgrade_spec',
            {
                'desired_version': type.StringType(),
                'ignore_precheck_warnings': type.OptionalType(
                    type.BooleanType()),
            }, UpgradeSpec, False, None))

    class Summary(VapiStruct):
        """
        The ``Clusters.Summary`` class contains basic information about the cluster
        upgrade related information.

        .. tip::
            The arguments are used to initialize data attributes with the same
            names.
        """
        def __init__(
            self,
            cluster=None,
            cluster_name=None,
            current_version=None,
            available_versions=None,
            last_upgraded_date=None,
            desired_version=None,
            state=None,
        ):
            """
            :type  cluster: :class:`str`
            :param cluster: Identifier for the cluster.
                When clients pass a value of this class as a parameter, the
                attribute must be an identifier for the resource type:
                ``ClusterComputeResource``. When methods return a value of this
                class as a return value, the attribute will be an identifier for
                the resource type: ``ClusterComputeResource``.
            :type  cluster_name: :class:`str`
            :param cluster_name: Name of the cluster.
                When clients pass a value of this class as a parameter, the
                attribute must be an identifier for the resource type:
                ``ClusterComputeResource.name``. When methods return a value of
                this class as a return value, the attribute will be an identifier
                for the resource type: ``ClusterComputeResource.name``.
            :type  current_version: :class:`str`
            :param current_version: Current version of the cluster.
            :type  available_versions: :class:`list` of :class:`str`
            :param available_versions: Set of versions available for upgrade.
            :type  last_upgraded_date: :class:`datetime.datetime` or ``None``
            :param last_upgraded_date: Date of last successful upgrade.
                If None, the cluster has not yet been upgraded.
            :type  desired_version: :class:`str` or ``None``
            :param desired_version: Desired version the cluster will be upgraded to.
                If None, the cluster upgrade is not in progress.
            :type  state: :class:`Clusters.State`
            :param state: Current state of the upgrade.
            """
            self.cluster = cluster
            self.cluster_name = cluster_name
            self.current_version = current_version
            self.available_versions = available_versions
            self.last_upgraded_date = last_upgraded_date
            self.desired_version = desired_version
            self.state = state
            VapiStruct.__init__(self)

    Summary._set_binding_type(
        type.StructType(
            'com.vmware.vcenter.namespace_management.software.clusters.summary',
            {
                'cluster':
                type.IdType(resource_types='ClusterComputeResource'),
                'cluster_name':
                type.IdType(resource_types='ClusterComputeResource.name'),
                'current_version':
                type.StringType(),
                'available_versions':
                type.ListType(type.StringType()),
                'last_upgraded_date':
                type.OptionalType(type.DateTimeType()),
                'desired_version':
                type.OptionalType(type.StringType()),
                'state':
                type.ReferenceType(__name__, 'Clusters.State'),
            }, Summary, False, None))

    class Info(VapiStruct):
        """
        The ``Clusters.Info`` class contains detailed information about the cluster
        upgrade status and related information.

        .. tip::
            The arguments are used to initialize data attributes with the same
            names.
        """
        def __init__(
            self,
            current_version=None,
            available_versions=None,
            last_upgraded_date=None,
            messages=None,
            state=None,
            upgrade_status=None,
        ):
            """
            :type  current_version: :class:`str`
            :param current_version: Current version of the cluster.
            :type  available_versions: :class:`list` of :class:`str`
            :param available_versions: Set of available versions can be upgraded to.
            :type  last_upgraded_date: :class:`datetime.datetime` or ``None``
            :param last_upgraded_date: Date of last successful upgrade.
                If None, the cluster has not yet been upgraded.
            :type  messages: :class:`list` of :class:`Clusters.Message`
            :param messages: Current set of messages associated with the cluster version.
            :type  state: :class:`Clusters.State`
            :param state: Current state of the upgrade.
            :type  upgrade_status: :class:`Clusters.UpgradeStatus` or ``None``
            :param upgrade_status: Information about upgrade in progress.
                If None, the cluster upgrade is not in progress.
            """
            self.current_version = current_version
            self.available_versions = available_versions
            self.last_upgraded_date = last_upgraded_date
            self.messages = messages
            self.state = state
            self.upgrade_status = upgrade_status
            VapiStruct.__init__(self)

    Info._set_binding_type(
        type.StructType(
            'com.vmware.vcenter.namespace_management.software.clusters.info', {
                'current_version':
                type.StringType(),
                'available_versions':
                type.ListType(type.StringType()),
                'last_upgraded_date':
                type.OptionalType(type.DateTimeType()),
                'messages':
                type.ListType(type.ReferenceType(__name__,
                                                 'Clusters.Message')),
                'state':
                type.ReferenceType(__name__, 'Clusters.State'),
                'upgrade_status':
                type.OptionalType(
                    type.ReferenceType(__name__, 'Clusters.UpgradeStatus')),
            }, Info, False, None))

    class UpgradeStatus(VapiStruct):
        """
        The ``Clusters.UpgradeStatus`` class contains detailed information about
        the cluster when upgraded is in progress.

        .. tip::
            The arguments are used to initialize data attributes with the same
            names.
        """
        def __init__(
            self,
            desired_version=None,
            messages=None,
            progress=None,
        ):
            """
            :type  desired_version: :class:`str` or ``None``
            :param desired_version: Desired version the cluster will be upgraded to.
                If None, the cluster upgrade is not in progress.
            :type  messages: :class:`list` of :class:`Clusters.Message`
            :param messages: Current set of messages associated with the upgrade state.
            :type  progress: :class:`Clusters.UpgradeProgress` or ``None``
            :param progress: Information about upgrade progess.
                If None, the cluster upgrade is not in progress.
            """
            self.desired_version = desired_version
            self.messages = messages
            self.progress = progress
            VapiStruct.__init__(self)

    UpgradeStatus._set_binding_type(
        type.StructType(
            'com.vmware.vcenter.namespace_management.software.clusters.upgrade_status',
            {
                'desired_version':
                type.OptionalType(type.StringType()),
                'messages':
                type.ListType(type.ReferenceType(__name__,
                                                 'Clusters.Message')),
                'progress':
                type.OptionalType(
                    type.ReferenceType(__name__, 'Clusters.UpgradeProgress')),
            }, UpgradeStatus, False, None))

    class UpgradeProgress(VapiStruct):
        """
        The ``Clusters.UpgradeProgress`` class contains detailed information about
        the cluster upgrade progess.

        .. tip::
            The arguments are used to initialize data attributes with the same
            names.
        """
        def __init__(
            self,
            total=None,
            completed=None,
            message=None,
        ):
            """
            :type  total: :class:`long`
            :param total: Total amount of the work for the operation. The work here
                represents the number of master nodes in the cluster need to be
                upgraded.
            :type  completed: :class:`long`
            :param completed: The amount of work completed for the operation. The value can only
                be incremented. The number or master nodes which upgrade completed.
            :type  message: :class:`com.vmware.vapi.std_client.LocalizableMessage`
            :param message: Message about the work progress.
            """
            self.total = total
            self.completed = completed
            self.message = message
            VapiStruct.__init__(self)

    UpgradeProgress._set_binding_type(
        type.StructType(
            'com.vmware.vcenter.namespace_management.software.clusters.upgrade_progress',
            {
                'total':
                type.IntegerType(),
                'completed':
                type.IntegerType(),
                'message':
                type.ReferenceType('com.vmware.vapi.std_client',
                                   'LocalizableMessage'),
            }, UpgradeProgress, False, None))

    class Message(VapiStruct):
        """
        The ``Clusters.Message`` class contains the information about the object
        configuration.

        .. tip::
            The arguments are used to initialize data attributes with the same
            names.
        """
        def __init__(
            self,
            severity=None,
            details=None,
        ):
            """
            :type  severity: :class:`Clusters.Message.Severity`
            :param severity: Type of the message.
            :type  details: :class:`com.vmware.vapi.std_client.LocalizableMessage`
            :param details: Details about the message.
            """
            self.severity = severity
            self.details = details
            VapiStruct.__init__(self)

        class Severity(Enum):
            """
            The ``Clusters.Message.Severity`` class represents the severity of the
            message.

            .. note::
                This class represents an enumerated type in the interface language
                definition. The class contains class attributes which represent the
                values in the current version of the enumerated type. Newer versions of
                the enumerated type may contain new values. To use new values of the
                enumerated type in communication with a server that supports the newer
                version of the API, you instantiate this class. See :ref:`enumerated
                type description page <enumeration_description>`.
            """
            INFO = None
            """
            Informational message. This may be accompanied by vCenter event.

            """
            WARNING = None
            """
            Warning message. This may be accompanied by vCenter event.

            """
            ERROR = None
            """
            Error message. This is accompanied by vCenter event and/or alarm.

            """
            def __init__(self, string):
                """
                :type  string: :class:`str`
                :param string: String value for the :class:`Severity` instance.
                """
                Enum.__init__(string)

        Severity._set_values([
            Severity('INFO'),
            Severity('WARNING'),
            Severity('ERROR'),
        ])
        Severity._set_binding_type(
            type.EnumType(
                'com.vmware.vcenter.namespace_management.software.clusters.message.severity',
                Severity))

    Message._set_binding_type(
        type.StructType(
            'com.vmware.vcenter.namespace_management.software.clusters.message',
            {
                'severity':
                type.ReferenceType(__name__, 'Clusters.Message.Severity'),
                'details':
                type.ReferenceType('com.vmware.vapi.std_client',
                                   'LocalizableMessage'),
            }, Message, False, None))

    def upgrade(
        self,
        cluster,
        spec,
    ):
        """
        Upgrade the cluster to a specific version. This operation upgrades the
        components on control plane VMs and worker plane hosts based on the
        selected version. Before upgrading, this operation performs pre-checks
        and sets the evaluation response in Info.UpgradeStatus.messages with
        various Message.Severity levels. Depending on the severity, the upgrade
        may or may not proceed beyond prechecks. Here is a list of severities
        and corresponding behavior: - ERROR: Upgrade does not proceed beyond
        precheck operation - WARNING: Upgrade proceeds beyond precheck
        operation only if UpgradeSpec.ignorePrecheckWarnings is set to true -
        INFO: Upgrade proceeds beyond precheck operation uninterrupted

        :type  cluster: :class:`str`
        :param cluster: Identifier for the cluster which will be upgraded.
            The parameter must be an identifier for the resource type:
            ``ClusterComputeResource``.
        :type  spec: :class:`Clusters.UpgradeSpec`
        :param spec: Specification for upgrading the cluster.
        :raise: :class:`com.vmware.vapi.std.errors_client.Error` 
            if the system reports an error while responding to the request.
        :raise: :class:`com.vmware.vapi.std.errors_client.Unsupported` 
            if pre-check failed of the cluster.
        :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` 
            if cluster could not be located.
        :raise: :class:`com.vmware.vapi.std.errors_client.Unauthenticated` 
            if the user can not be authenticated.
        :raise: :class:`com.vmware.vapi.std.errors_client.Unauthorized` 
            if the user does not have Namespaces.Manage privilege.
        """
        return self._invoke('upgrade', {
            'cluster': cluster,
            'spec': spec,
        })

    def upgrade_multiple(
        self,
        specs,
    ):
        """
        Upgrade a set of clusters to its corresponding specific version.

        :type  specs: :class:`dict` of :class:`str` and :class:`Clusters.UpgradeSpec`
        :param specs: Specifications for upgrading selected clusters.
            The key in the parameter :class:`dict` must be an identifier for
            the resource type: ``ClusterComputeResource``.
        :rtype: :class:`dict` of :class:`str` and :class:`Clusters.Result`
        :return: Pre-check result when invoking upgrade for each cluster.
            The key in the return value :class:`dict` will be an identifier for
            the resource type: ``ClusterComputeResource``.
        :raise: :class:`com.vmware.vapi.std.errors_client.Error` 
            if the system reports an error while responding to the request.
        :raise: :class:`com.vmware.vapi.std.errors_client.Unauthenticated` 
            if the user can not be authenticated.
        :raise: :class:`com.vmware.vapi.std.errors_client.Unauthorized` 
            if the user does not have Namespaces.Manage privilege on all
            specified clusters.
        """
        return self._invoke('upgrade_multiple', {
            'specs': specs,
        })

    def get(
        self,
        cluster,
    ):
        """
        Returns upgrade related information of a specific cluster.

        :type  cluster: :class:`str`
        :param cluster: Identifier for the cluster which will be upgraded.
            The parameter must be an identifier for the resource type:
            ``ClusterComputeResource``.
        :rtype: :class:`Clusters.Info`
        :return: Information about the upgrade of the specified WCP enabled cluster.
        :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` 
            if cluster could not be located.
        :raise: :class:`com.vmware.vapi.std.errors_client.Error` 
            if the system reports an error while responding to the request.
        :raise: :class:`com.vmware.vapi.std.errors_client.Unauthenticated` 
            if the user can not be authenticated.
        :raise: :class:`com.vmware.vapi.std.errors_client.Unauthorized` 
            if the user does not have System.Read privilege.
        """
        return self._invoke('get', {
            'cluster': cluster,
        })

    def list(self):
        """
        Returns upgrade related information about all WCP enabled clusters.


        :rtype: :class:`list` of :class:`Clusters.Summary`
        :return: List of upgrade summary of all WCP enabled clusters.
        :raise: :class:`com.vmware.vapi.std.errors_client.Error` 
            if the system reports an error while responding to the request.
        :raise: :class:`com.vmware.vapi.std.errors_client.Unauthenticated` 
            if the user can not be authenticated.
        :raise: :class:`com.vmware.vapi.std.errors_client.Unauthorized` 
            if the user does not have System.Read privilege.
        """
        return self._invoke('list', None)
    class SessionInfo(VapiStruct):
        """
        The ``Providers.SessionInfo`` class contains sync session information.
        **Warning:** This class is available as Technology Preview. These are early
        access APIs provided to test, automate and provide feedback on the feature.
        Since this can change based on feedback, VMware does not guarantee
        backwards compatibility and recommends against using them in production
        environments. Some Technology Preview APIs might only be applicable to
        specific environments.

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

        _validator_list = [
            UnionValidator(
                'stage',
                {
                    'FAILED' : [('completion_time', True), ('exception', True)],
                    'COMPLETED' : [('completion_time', True)],
                    'CHANGE_DETECTION' : [],
                    'CHANGE_ENUMERATION' : [],
                    'CHANGE_APPLICATION' : [],
                    'WAITING' : [],
                }
            ),
        ]



        def __init__(self,
                     stage=None,
                     completed_work=None,
                     total_work=None,
                     completion_time=None,
                     start_time=None,
                     exception=None,
                    ):
            """
            :type  stage: :class:`Providers.SessionInfo.Stage`
            :param stage: Sync stage for the session. **Warning:** This attribute is
                available as Technology Preview. These are early access APIs
                provided to test, automate and provide feedback on the feature.
                Since this can change based on feedback, VMware does not guarantee
                backwards compatibility and recommends against using them in
                production environments. Some Technology Preview APIs might only be
                applicable to specific environments.
            :type  completed_work: :class:`long`
            :param completed_work: Completed work for the session. **Warning:** This attribute is
                available as Technology Preview. These are early access APIs
                provided to test, automate and provide feedback on the feature.
                Since this can change based on feedback, VMware does not guarantee
                backwards compatibility and recommends against using them in
                production environments. Some Technology Preview APIs might only be
                applicable to specific environments.
            :type  total_work: :class:`long`
            :param total_work: Total work for the session. **Warning:** This attribute is
                available as Technology Preview. These are early access APIs
                provided to test, automate and provide feedback on the feature.
                Since this can change based on feedback, VMware does not guarantee
                backwards compatibility and recommends against using them in
                production environments. Some Technology Preview APIs might only be
                applicable to specific environments.
            :type  completion_time: :class:`datetime.datetime`
            :param completion_time: Time at which forced sync session was completed. **Warning:** This
                attribute is available as Technology Preview. These are early
                access APIs provided to test, automate and provide feedback on the
                feature. Since this can change based on feedback, VMware does not
                guarantee backwards compatibility and recommends against using them
                in production environments. Some Technology Preview APIs might only
                be applicable to specific environments.
                If None there is an ongoing sync that has not completed
            :type  start_time: :class:`datetime.datetime`
            :param start_time: Time at which force sync was initiated. **Warning:** This attribute
                is available as Technology Preview. These are early access APIs
                provided to test, automate and provide feedback on the feature.
                Since this can change based on feedback, VMware does not guarantee
                backwards compatibility and recommends against using them in
                production environments. Some Technology Preview APIs might only be
                applicable to specific environments.
            :type  exception: :class:`com.vmware.vapi.std_client.LocalizableMessage`
            :param exception: Exception message if there is a sync failure on forced sync.
                **Warning:** This attribute is available as Technology Preview.
                These are early access APIs provided to test, automate and provide
                feedback on the feature. Since this can change based on feedback,
                VMware does not guarantee backwards compatibility and recommends
                against using them in production environments. Some Technology
                Preview APIs might only be applicable to specific environments.
                This attribute is optional and it is only relevant when the value
                of ``stage`` is :attr:`Providers.SessionInfo.Stage.FAILED`.
            """
            self.stage = stage
            self.completed_work = completed_work
            self.total_work = total_work
            self.completion_time = completion_time
            self.start_time = start_time
            self.exception = exception
            VapiStruct.__init__(self)


        class Stage(Enum):
            """
            The ``Providers.SessionInfo.Stage`` class defines the different stages of
            Sync. **Warning:** This enumeration is available as Technology Preview.
            These are early access APIs provided to test, automate and provide feedback
            on the feature. Since this can change based on feedback, VMware does not
            guarantee backwards compatibility and recommends against using them in
            production environments. Some Technology Preview APIs might only be
            applicable to specific environments.

            .. note::
                This class represents an enumerated type in the interface language
                definition. The class contains class attributes which represent the
                values in the current version of the enumerated type. Newer versions of
                the enumerated type may contain new values. To use new values of the
                enumerated type in communication with a server that supports the newer
                version of the API, you instantiate this class. See :ref:`enumerated
                type description page <enumeration_description>`.
            """
            CHANGE_DETECTION = None
            """
            Changes are being detected on the source replica. **Warning:** This class
            attribute is available as Technology Preview. These are early access APIs
            provided to test, automate and provide feedback on the feature. Since this
            can change based on feedback, VMware does not guarantee backwards
            compatibility and recommends against using them in production environments.
            Some Technology Preview APIs might only be applicable to specific
            environments.

            """
            CHANGE_ENUMERATION = None
            """
            Changes from the source replica are being enumerated. **Warning:** This
            class attribute is available as Technology Preview. These are early access
            APIs provided to test, automate and provide feedback on the feature. Since
            this can change based on feedback, VMware does not guarantee backwards
            compatibility and recommends against using them in production environments.
            Some Technology Preview APIs might only be applicable to specific
            environments.

            """
            CHANGE_APPLICATION = None
            """
            Changes are being applied to the destination replica. **Warning:** This
            class attribute is available as Technology Preview. These are early access
            APIs provided to test, automate and provide feedback on the feature. Since
            this can change based on feedback, VMware does not guarantee backwards
            compatibility and recommends against using them in production environments.
            Some Technology Preview APIs might only be applicable to specific
            environments.

            """
            COMPLETED = None
            """
            Sync has completed. **Warning:** This class attribute is available as
            Technology Preview. These are early access APIs provided to test, automate
            and provide feedback on the feature. Since this can change based on
            feedback, VMware does not guarantee backwards compatibility and recommends
            against using them in production environments. Some Technology Preview APIs
            might only be applicable to specific environments.

            """
            FAILED = None
            """
            Sync failed. **Warning:** This class attribute is available as Technology
            Preview. These are early access APIs provided to test, automate and provide
            feedback on the feature. Since this can change based on feedback, VMware
            does not guarantee backwards compatibility and recommends against using
            them in production environments. Some Technology Preview APIs might only be
            applicable to specific environments.

            """
            WAITING = None
            """
            Session is waiting for progress to be set. **Warning:** This class
            attribute is available as Technology Preview. These are early access APIs
            provided to test, automate and provide feedback on the feature. Since this
            can change based on feedback, VMware does not guarantee backwards
            compatibility and recommends against using them in production environments.
            Some Technology Preview APIs might only be applicable to specific
            environments.

            """

            def __init__(self, string):
                """
                :type  string: :class:`str`
                :param string: String value for the :class:`Stage` instance.
                """
                Enum.__init__(string)

        Stage._set_values([
            Stage('CHANGE_DETECTION'),
            Stage('CHANGE_ENUMERATION'),
            Stage('CHANGE_APPLICATION'),
            Stage('COMPLETED'),
            Stage('FAILED'),
            Stage('WAITING'),
        ])
        Stage._set_binding_type(type.EnumType(
            'com.vmware.vcenter.hvc.links.sync.providers.session_info.stage',
            Stage))
class Providers(VapiInterface):
    """
    The ``Providers`` class provides methods to create a sync session, get
    information on Sync. Usage beyond VMware Cloud on AWS is not supported.
    **Warning:** This class is available as Technology Preview. These are early
    access APIs provided to test, automate and provide feedback on the feature.
    Since this can change based on feedback, VMware does not guarantee
    backwards compatibility and recommends against using them in production
    environments. Some Technology Preview APIs might only be applicable to
    specific environments.
    """
    RESOURCE_TYPE = "com.vmware.vcenter.hvc.links.sync.Providers"
    """
    Resource type for Sync Providers. **Warning:** This class attribute is
    available as Technology Preview. These are early access APIs provided to test,
    automate and provide feedback on the feature. Since this can change based on
    feedback, VMware does not guarantee backwards compatibility and recommends
    against using them in production environments. Some Technology Preview APIs
    might only be applicable to specific environments.

    """

    _VAPI_SERVICE_ID = 'com.vmware.vcenter.hvc.links.sync.providers'
    """
    Identifier of the service in canonical form.
    """
    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, _ProvidersStub)
        self._VAPI_OPERATION_IDS = {}

    class Status(Enum):
        """
        The ``Providers.Status`` class defines valid sync status. **Warning:** This
        enumeration is available as Technology Preview. These are early access APIs
        provided to test, automate and provide feedback on the feature. Since this
        can change based on feedback, VMware does not guarantee backwards
        compatibility and recommends against using them in production environments.
        Some Technology Preview APIs might only be applicable to specific
        environments.

        .. note::
            This class represents an enumerated type in the interface language
            definition. The class contains class attributes which represent the
            values in the current version of the enumerated type. Newer versions of
            the enumerated type may contain new values. To use new values of the
            enumerated type in communication with a server that supports the newer
            version of the API, you instantiate this class. See :ref:`enumerated
            type description page <enumeration_description>`.
        """
        SUCCEEDED = None
        """
        If Sync was successful. **Warning:** This class attribute is available as
        Technology Preview. These are early access APIs provided to test, automate
        and provide feedback on the feature. Since this can change based on
        feedback, VMware does not guarantee backwards compatibility and recommends
        against using them in production environments. Some Technology Preview APIs
        might only be applicable to specific environments.

        """
        FAILED = None
        """
        If Sync failed. **Warning:** This class attribute is available as
        Technology Preview. These are early access APIs provided to test, automate
        and provide feedback on the feature. Since this can change based on
        feedback, VMware does not guarantee backwards compatibility and recommends
        against using them in production environments. Some Technology Preview APIs
        might only be applicable to specific environments.

        """
        NO_SYNC_FOUND = None
        """
        If Sync has not been triggered. **Warning:** This class attribute is
        available as Technology Preview. These are early access APIs provided to
        test, automate and provide feedback on the feature. Since this can change
        based on feedback, VMware does not guarantee backwards compatibility and
        recommends against using them in production environments. Some Technology
        Preview APIs might only be applicable to specific environments.

        """

        def __init__(self, string):
            """
            :type  string: :class:`str`
            :param string: String value for the :class:`Status` instance.
            """
            Enum.__init__(string)

    Status._set_values([
        Status('SUCCEEDED'),
        Status('FAILED'),
        Status('NO_SYNC_FOUND'),
    ])
    Status._set_binding_type(type.EnumType(
        'com.vmware.vcenter.hvc.links.sync.providers.status',
        Status))


    class Info(VapiStruct):
        """
        The ``Providers.Info`` class contains information about sync for a
        provider. **Warning:** This class is available as Technology Preview. These
        are early access APIs provided to test, automate and provide feedback on
        the feature. Since this can change based on feedback, VMware does not
        guarantee backwards compatibility and recommends against using them in
        production environments. Some Technology Preview APIs might only be
        applicable to specific environments.

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

        _validator_list = [
            UnionValidator(
                'status',
                {
                    'FAILED' : [('status_message', True)],
                    'SUCCEEDED' : [],
                    'NO_SYNC_FOUND' : [],
                }
            ),
        ]



        def __init__(self,
                     last_sync_time=None,
                     status=None,
                     polling_interval_in_seconds=None,
                     current_session_info=None,
                     status_message=None,
                    ):
            """
            :type  last_sync_time: :class:`datetime.datetime` or ``None``
            :param last_sync_time: Last sync time for the provider. This indicates the last time that
                either a background sync or a force sync was started for the
                provider. **Warning:** This attribute is available as Technology
                Preview. These are early access APIs provided to test, automate and
                provide feedback on the feature. Since this can change based on
                feedback, VMware does not guarantee backwards compatibility and
                recommends against using them in production environments. Some
                Technology Preview APIs might only be applicable to specific
                environments.
                If None no sync was found for the provider.
            :type  status: :class:`Providers.Status`
            :param status: Last Sync status for the provider. **Warning:** This attribute is
                available as Technology Preview. These are early access APIs
                provided to test, automate and provide feedback on the feature.
                Since this can change based on feedback, VMware does not guarantee
                backwards compatibility and recommends against using them in
                production environments. Some Technology Preview APIs might only be
                applicable to specific environments.
            :type  polling_interval_in_seconds: :class:`long`
            :param polling_interval_in_seconds: Sync Polling interval between local and remote replicas for the
                provider. **Warning:** This attribute is available as Technology
                Preview. These are early access APIs provided to test, automate and
                provide feedback on the feature. Since this can change based on
                feedback, VMware does not guarantee backwards compatibility and
                recommends against using them in production environments. Some
                Technology Preview APIs might only be applicable to specific
                environments.
            :type  current_session_info: :class:`Providers.SessionInfo` or ``None``
            :param current_session_info: Returns information on the forced sync for the provider.
                **Warning:** This attribute is available as Technology Preview.
                These are early access APIs provided to test, automate and provide
                feedback on the feature. Since this can change based on feedback,
                VMware does not guarantee backwards compatibility and recommends
                against using them in production environments. Some Technology
                Preview APIs might only be applicable to specific environments.
                If None there is no outstanding sync session created for this
                provider
            :type  status_message: :class:`com.vmware.vapi.std_client.LocalizableMessage`
            :param status_message: Localizable messages associated with sync status. **Warning:** This
                attribute is available as Technology Preview. These are early
                access APIs provided to test, automate and provide feedback on the
                feature. Since this can change based on feedback, VMware does not
                guarantee backwards compatibility and recommends against using them
                in production environments. Some Technology Preview APIs might only
                be applicable to specific environments.
                This attribute is optional and it is only relevant when the value
                of ``status`` is :attr:`Providers.Status.FAILED`.
            """
            self.last_sync_time = last_sync_time
            self.status = status
            self.polling_interval_in_seconds = polling_interval_in_seconds
            self.current_session_info = current_session_info
            self.status_message = status_message
            VapiStruct.__init__(self)


    Info._set_binding_type(type.StructType(
        'com.vmware.vcenter.hvc.links.sync.providers.info', {
            'last_sync_time': type.OptionalType(type.DateTimeType()),
            'status': type.ReferenceType(__name__, 'Providers.Status'),
            'polling_interval_in_seconds': type.IntegerType(),
            'current_session_info': type.OptionalType(type.ReferenceType(__name__, 'Providers.SessionInfo')),
            'status_message': type.OptionalType(type.ReferenceType('com.vmware.vapi.std_client', 'LocalizableMessage')),
        },
        Info,
        False,
        None))


    class SessionInfo(VapiStruct):
        """
        The ``Providers.SessionInfo`` class contains sync session information.
        **Warning:** This class is available as Technology Preview. These are early
        access APIs provided to test, automate and provide feedback on the feature.
        Since this can change based on feedback, VMware does not guarantee
        backwards compatibility and recommends against using them in production
        environments. Some Technology Preview APIs might only be applicable to
        specific environments.

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

        _validator_list = [
            UnionValidator(
                'stage',
                {
                    'FAILED' : [('completion_time', True), ('exception', True)],
                    'COMPLETED' : [('completion_time', True)],
                    'CHANGE_DETECTION' : [],
                    'CHANGE_ENUMERATION' : [],
                    'CHANGE_APPLICATION' : [],
                    'WAITING' : [],
                }
            ),
        ]



        def __init__(self,
                     stage=None,
                     completed_work=None,
                     total_work=None,
                     completion_time=None,
                     start_time=None,
                     exception=None,
                    ):
            """
            :type  stage: :class:`Providers.SessionInfo.Stage`
            :param stage: Sync stage for the session. **Warning:** This attribute is
                available as Technology Preview. These are early access APIs
                provided to test, automate and provide feedback on the feature.
                Since this can change based on feedback, VMware does not guarantee
                backwards compatibility and recommends against using them in
                production environments. Some Technology Preview APIs might only be
                applicable to specific environments.
            :type  completed_work: :class:`long`
            :param completed_work: Completed work for the session. **Warning:** This attribute is
                available as Technology Preview. These are early access APIs
                provided to test, automate and provide feedback on the feature.
                Since this can change based on feedback, VMware does not guarantee
                backwards compatibility and recommends against using them in
                production environments. Some Technology Preview APIs might only be
                applicable to specific environments.
            :type  total_work: :class:`long`
            :param total_work: Total work for the session. **Warning:** This attribute is
                available as Technology Preview. These are early access APIs
                provided to test, automate and provide feedback on the feature.
                Since this can change based on feedback, VMware does not guarantee
                backwards compatibility and recommends against using them in
                production environments. Some Technology Preview APIs might only be
                applicable to specific environments.
            :type  completion_time: :class:`datetime.datetime`
            :param completion_time: Time at which forced sync session was completed. **Warning:** This
                attribute is available as Technology Preview. These are early
                access APIs provided to test, automate and provide feedback on the
                feature. Since this can change based on feedback, VMware does not
                guarantee backwards compatibility and recommends against using them
                in production environments. Some Technology Preview APIs might only
                be applicable to specific environments.
                If None there is an ongoing sync that has not completed
            :type  start_time: :class:`datetime.datetime`
            :param start_time: Time at which force sync was initiated. **Warning:** This attribute
                is available as Technology Preview. These are early access APIs
                provided to test, automate and provide feedback on the feature.
                Since this can change based on feedback, VMware does not guarantee
                backwards compatibility and recommends against using them in
                production environments. Some Technology Preview APIs might only be
                applicable to specific environments.
            :type  exception: :class:`com.vmware.vapi.std_client.LocalizableMessage`
            :param exception: Exception message if there is a sync failure on forced sync.
                **Warning:** This attribute is available as Technology Preview.
                These are early access APIs provided to test, automate and provide
                feedback on the feature. Since this can change based on feedback,
                VMware does not guarantee backwards compatibility and recommends
                against using them in production environments. Some Technology
                Preview APIs might only be applicable to specific environments.
                This attribute is optional and it is only relevant when the value
                of ``stage`` is :attr:`Providers.SessionInfo.Stage.FAILED`.
            """
            self.stage = stage
            self.completed_work = completed_work
            self.total_work = total_work
            self.completion_time = completion_time
            self.start_time = start_time
            self.exception = exception
            VapiStruct.__init__(self)


        class Stage(Enum):
            """
            The ``Providers.SessionInfo.Stage`` class defines the different stages of
            Sync. **Warning:** This enumeration is available as Technology Preview.
            These are early access APIs provided to test, automate and provide feedback
            on the feature. Since this can change based on feedback, VMware does not
            guarantee backwards compatibility and recommends against using them in
            production environments. Some Technology Preview APIs might only be
            applicable to specific environments.

            .. note::
                This class represents an enumerated type in the interface language
                definition. The class contains class attributes which represent the
                values in the current version of the enumerated type. Newer versions of
                the enumerated type may contain new values. To use new values of the
                enumerated type in communication with a server that supports the newer
                version of the API, you instantiate this class. See :ref:`enumerated
                type description page <enumeration_description>`.
            """
            CHANGE_DETECTION = None
            """
            Changes are being detected on the source replica. **Warning:** This class
            attribute is available as Technology Preview. These are early access APIs
            provided to test, automate and provide feedback on the feature. Since this
            can change based on feedback, VMware does not guarantee backwards
            compatibility and recommends against using them in production environments.
            Some Technology Preview APIs might only be applicable to specific
            environments.

            """
            CHANGE_ENUMERATION = None
            """
            Changes from the source replica are being enumerated. **Warning:** This
            class attribute is available as Technology Preview. These are early access
            APIs provided to test, automate and provide feedback on the feature. Since
            this can change based on feedback, VMware does not guarantee backwards
            compatibility and recommends against using them in production environments.
            Some Technology Preview APIs might only be applicable to specific
            environments.

            """
            CHANGE_APPLICATION = None
            """
            Changes are being applied to the destination replica. **Warning:** This
            class attribute is available as Technology Preview. These are early access
            APIs provided to test, automate and provide feedback on the feature. Since
            this can change based on feedback, VMware does not guarantee backwards
            compatibility and recommends against using them in production environments.
            Some Technology Preview APIs might only be applicable to specific
            environments.

            """
            COMPLETED = None
            """
            Sync has completed. **Warning:** This class attribute is available as
            Technology Preview. These are early access APIs provided to test, automate
            and provide feedback on the feature. Since this can change based on
            feedback, VMware does not guarantee backwards compatibility and recommends
            against using them in production environments. Some Technology Preview APIs
            might only be applicable to specific environments.

            """
            FAILED = None
            """
            Sync failed. **Warning:** This class attribute is available as Technology
            Preview. These are early access APIs provided to test, automate and provide
            feedback on the feature. Since this can change based on feedback, VMware
            does not guarantee backwards compatibility and recommends against using
            them in production environments. Some Technology Preview APIs might only be
            applicable to specific environments.

            """
            WAITING = None
            """
            Session is waiting for progress to be set. **Warning:** This class
            attribute is available as Technology Preview. These are early access APIs
            provided to test, automate and provide feedback on the feature. Since this
            can change based on feedback, VMware does not guarantee backwards
            compatibility and recommends against using them in production environments.
            Some Technology Preview APIs might only be applicable to specific
            environments.

            """

            def __init__(self, string):
                """
                :type  string: :class:`str`
                :param string: String value for the :class:`Stage` instance.
                """
                Enum.__init__(string)

        Stage._set_values([
            Stage('CHANGE_DETECTION'),
            Stage('CHANGE_ENUMERATION'),
            Stage('CHANGE_APPLICATION'),
            Stage('COMPLETED'),
            Stage('FAILED'),
            Stage('WAITING'),
        ])
        Stage._set_binding_type(type.EnumType(
            'com.vmware.vcenter.hvc.links.sync.providers.session_info.stage',
            Stage))

    SessionInfo._set_binding_type(type.StructType(
        'com.vmware.vcenter.hvc.links.sync.providers.session_info', {
            'stage': type.ReferenceType(__name__, 'Providers.SessionInfo.Stage'),
            'completed_work': type.IntegerType(),
            'total_work': type.IntegerType(),
            'completion_time': type.OptionalType(type.DateTimeType()),
            'start_time': type.DateTimeType(),
            'exception': type.OptionalType(type.ReferenceType('com.vmware.vapi.std_client', 'LocalizableMessage')),
        },
        SessionInfo,
        False,
        None))


    class Summary(VapiStruct):
        """
        The ``Providers.Summary`` class contains information about a provider.
        **Warning:** This class is available as Technology Preview. These are early
        access APIs provided to test, automate and provide feedback on the feature.
        Since this can change based on feedback, VMware does not guarantee
        backwards compatibility and recommends against using them in production
        environments. Some Technology Preview APIs might only be applicable to
        specific environments.

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




        def __init__(self,
                     provider=None,
                    ):
            """
            :type  provider: :class:`str`
            :param provider: Sync provider id. **Warning:** This attribute is available as
                Technology Preview. These are early access APIs provided to test,
                automate and provide feedback on the feature. Since this can change
                based on feedback, VMware does not guarantee backwards
                compatibility and recommends against using them in production
                environments. Some Technology Preview APIs might only be applicable
                to specific environments.
                When clients pass a value of this class as a parameter, the
                attribute must be an identifier for the resource type:
                ``com.vmware.vcenter.hvc.links.sync.Providers``. When methods
                return a value of this class as a return value, the attribute will
                be an identifier for the resource type:
                ``com.vmware.vcenter.hvc.links.sync.Providers``.
            """
            self.provider = provider
            VapiStruct.__init__(self)


    Summary._set_binding_type(type.StructType(
        'com.vmware.vcenter.hvc.links.sync.providers.summary', {
            'provider': type.IdType(resource_types='com.vmware.vcenter.hvc.links.sync.Providers'),
        },
        Summary,
        False,
        None))


    class Credentials(VapiStruct):
        """
        The ``Providers.Credentials`` class specifies user credentials to make a
        successful connection to remote endpoint. **Warning:** This class is
        available as Technology Preview. These are early access APIs provided to
        test, automate and provide feedback on the feature. Since this can change
        based on feedback, VMware does not guarantee backwards compatibility and
        recommends against using them in production environments. Some Technology
        Preview APIs might only be applicable to specific environments.

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




        def __init__(self,
                     user_name=None,
                     password=None,
                    ):
            """
            :type  user_name: :class:`str`
            :param user_name: Name of the user to authenticate. **Warning:** This attribute is
                available as Technology Preview. These are early access APIs
                provided to test, automate and provide feedback on the feature.
                Since this can change based on feedback, VMware does not guarantee
                backwards compatibility and recommends against using them in
                production environments. Some Technology Preview APIs might only be
                applicable to specific environments.
            :type  password: :class:`str`
            :param password: Password for the user. **Warning:** This attribute is available as
                Technology Preview. These are early access APIs provided to test,
                automate and provide feedback on the feature. Since this can change
                based on feedback, VMware does not guarantee backwards
                compatibility and recommends against using them in production
                environments. Some Technology Preview APIs might only be applicable
                to specific environments.
            """
            self.user_name = user_name
            self.password = password
            VapiStruct.__init__(self)


    Credentials._set_binding_type(type.StructType(
        'com.vmware.vcenter.hvc.links.sync.providers.credentials', {
            'user_name': type.StringType(),
            'password': type.SecretType(),
        },
        Credentials,
        False,
        None))



    def list(self,
             link,
             ):
        """
        Enumerates the sync providers. Usage beyond VMware Cloud on AWS is not
        supported. **Warning:** This method is available as Technology Preview.
        These are early access APIs provided to test, automate and provide
        feedback on the feature. Since this can change based on feedback,
        VMware does not guarantee backwards compatibility and recommends
        against using them in production environments. Some Technology Preview
        APIs might only be applicable to specific environments.

        :type  link: :class:`str`
        :param link: Unique identifier of the link
            The parameter must be an identifier for the resource type:
            ``com.vmware.vcenter.hvc.Links``.
        :rtype: :class:`list` of :class:`Providers.Summary`
        :return: The :class:`list` of sync provider information.
        :raise: :class:`com.vmware.vapi.std.errors_client.Error` 
            If list fails.
        :raise: :class:`com.vmware.vapi.std.errors_client.Unauthorized` 
            If the user is not authorized to perform this operation.
        """
        return self._invoke('list',
                            {
                            'link': link,
                            })

    def get(self,
            link,
            provider,
            ):
        """
        Gets Sync information for a sync provider. Usage beyond VMware Cloud on
        AWS is not supported. **Warning:** This method is available as
        Technology Preview. These are early access APIs provided to test,
        automate and provide feedback on the feature. Since this can change
        based on feedback, VMware does not guarantee backwards compatibility
        and recommends against using them in production environments. Some
        Technology Preview APIs might only be applicable to specific
        environments.

        :type  link: :class:`str`
        :param link: Unique identifier of the link
            The parameter must be an identifier for the resource type:
            ``com.vmware.vcenter.hvc.Links``.
        :type  provider: :class:`str`
        :param provider: Unique identifier of the sync provider.
            The parameter must be an identifier for the resource type:
            ``com.vmware.vcenter.hvc.sync.Providers``.
        :rtype: :class:`Providers.Info`
        :return: The Info of sync information for the provider.
        :raise: :class:`com.vmware.vapi.std.errors_client.Error` 
            if the system reports an error while responding to the request.
        :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` 
            if the sync provider associated with ``provider`` does not exist.
        :raise: :class:`com.vmware.vapi.std.errors_client.Unauthorized` 
            if the user is not authorized to perform this operation.
        """
        return self._invoke('get',
                            {
                            'link': link,
                            'provider': provider,
                            })

    def start(self,
              link,
              provider,
              ):
        """
        Initiates synchronization between the local and remote replicas for the
        sync provider. Usage beyond VMware Cloud on AWS is not supported.
        **Warning:** This method is available as Technology Preview. These are
        early access APIs provided to test, automate and provide feedback on
        the feature. Since this can change based on feedback, VMware does not
        guarantee backwards compatibility and recommends against using them in
        production environments. Some Technology Preview APIs might only be
        applicable to specific environments.

        :type  link: :class:`str`
        :param link: Unique identifier of the link
            The parameter must be an identifier for the resource type:
            ``com.vmware.vcenter.hvc.Links``.
        :type  provider: :class:`str`
        :param provider: Unique identifier representing the sync provider
            The parameter must be an identifier for the resource type:
            ``com.vmware.vcenter.hvc.sync.Providers``.
        :raise: :class:`com.vmware.vapi.std.errors_client.Error` 
            if the system reports an error while responding to the request.
        :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` 
            if the link associated with ``link`` does not exist if the provider
            associated with ``provider`` is not registered for sync
        :raise: :class:`com.vmware.vapi.std.errors_client.Unauthorized` 
            if the user is not authorized to perform this operation.
        :raise: :class:`com.vmware.vapi.std.errors_client.ResourceBusy` 
            if a sync is already running.
        """
        return self._invoke('start',
                            {
                            'link': link,
                            'provider': provider,
                            })
Exemple #12
0
class Databasestorage(VapiInterface):
    """
    ``Databasestorage`` class provides methods Get database storage health.
    """

    _VAPI_SERVICE_ID = 'com.vmware.appliance.health.databasestorage'
    """
    Identifier of the service in canonical form.
    """
    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, _DatabasestorageStub)
        self._VAPI_OPERATION_IDS = {}

    class HealthLevel(Enum):
        """
        ``Databasestorage.HealthLevel`` class Defines service health levels.

        .. note::
            This class represents an enumerated type in the interface language
            definition. The class contains class attributes which represent the
            values in the current version of the enumerated type. Newer versions of
            the enumerated type may contain new values. To use new values of the
            enumerated type in communication with a server that supports the newer
            version of the API, you instantiate this class. See :ref:`enumerated
            type description page <enumeration_description>`.
        """
        orange = None
        """
        The service health is degraded. The service might have serious problems.

        """
        gray = None
        """
        No health data is available for this service.

        """
        green = None
        """
        The service is healthy.

        """
        red = None
        """
        The service is unavaiable, not functioning properly, or will stop
        functioning soon.

        """
        yellow = None
        """
        The service is healthy but experiencing some problems.

        """
        def __init__(self, string):
            """
            :type  string: :class:`str`
            :param string: String value for the :class:`HealthLevel` instance.
            """
            Enum.__init__(string)

    HealthLevel._set_values([
        HealthLevel('orange'),
        HealthLevel('gray'),
        HealthLevel('green'),
        HealthLevel('red'),
        HealthLevel('yellow'),
    ])
    HealthLevel._set_binding_type(
        type.EnumType(
            'com.vmware.appliance.health.databasestorage.health_level',
            HealthLevel))

    def get(self):
        """
        Get database storage health.


        :rtype: :class:`Databasestorage.HealthLevel`
        :return: Database storage health
        :raise: :class:`com.vmware.vapi.std.errors_client.Error` 
            Generic error
        """
        return self._invoke('get', None)
Exemple #13
0
class Job(VapiInterface):
    """
    ``Job`` class provides methods Performs backup restore operations
    """
    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, _JobStub)

    class ReturnStatus(Enum):
        """
        ``Job.ReturnStatus`` class Defines the state of precheck

        .. note::
            This class represents an enumerated type in the interface language
            definition. The class contains class attributes which represent the
            values in the current version of the enumerated type. Newer versions of
            the enumerated type may contain new values. To use new values of the
            enumerated type in communication with a server that supports the newer
            version of the API, you instantiate this class. See :ref:`enumerated
            type description page <enumeration_description>`.
        """
        FAIL = None
        """
        Check failed

        """
        WARNING = None
        """
        Passed with warnings

        """
        OK = None
        """
        Check passed

        """
        def __init__(self, string):
            """
            :type  string: :class:`str`
            :param string: String value for the :class:`ReturnStatus` instance.
            """
            Enum.__init__(string)

    ReturnStatus._set_values([
        ReturnStatus('FAIL'),
        ReturnStatus('WARNING'),
        ReturnStatus('OK'),
    ])
    ReturnStatus._set_binding_type(
        type.EnumType('com.vmware.appliance.recovery.backup.job.return_status',
                      ReturnStatus))

    class LocationType(Enum):
        """
        ``Job.LocationType`` class Defines type of all locations for backup/restore

        .. note::
            This class represents an enumerated type in the interface language
            definition. The class contains class attributes which represent the
            values in the current version of the enumerated type. Newer versions of
            the enumerated type may contain new values. To use new values of the
            enumerated type in communication with a server that supports the newer
            version of the API, you instantiate this class. See :ref:`enumerated
            type description page <enumeration_description>`.
        """
        FTPS = None
        """
        Destination is FTPS server

        """
        HTTP = None
        """
        Destination is HTTP server

        """
        SCP = None
        """
        Destination is SSH server

        """
        HTTPS = None
        """
        Destination is HTTPS server

        """
        FTP = None
        """
        Destination is FTP server

        """
        def __init__(self, string):
            """
            :type  string: :class:`str`
            :param string: String value for the :class:`LocationType` instance.
            """
            Enum.__init__(string)

    LocationType._set_values([
        LocationType('FTPS'),
        LocationType('HTTP'),
        LocationType('SCP'),
        LocationType('HTTPS'),
        LocationType('FTP'),
    ])
    LocationType._set_binding_type(
        type.EnumType('com.vmware.appliance.recovery.backup.job.location_type',
                      LocationType))

    class BackupRestoreProcessState(Enum):
        """
        ``Job.BackupRestoreProcessState`` class Defines state of backup/restore
        process

        .. note::
            This class represents an enumerated type in the interface language
            definition. The class contains class attributes which represent the
            values in the current version of the enumerated type. Newer versions of
            the enumerated type may contain new values. To use new values of the
            enumerated type in communication with a server that supports the newer
            version of the API, you instantiate this class. See :ref:`enumerated
            type description page <enumeration_description>`.
        """
        FAILED = None
        """
        Failed

        """
        INPROGRESS = None
        """
        In progress

        """
        NONE = None
        """
        Not started

        """
        SUCCEEDED = None
        """
        Completed successfully

        """
        def __init__(self, string):
            """
            :type  string: :class:`str`
            :param string: String value for the :class:`BackupRestoreProcessState` instance.
            """
            Enum.__init__(string)

    BackupRestoreProcessState._set_values([
        BackupRestoreProcessState('FAILED'),
        BackupRestoreProcessState('INPROGRESS'),
        BackupRestoreProcessState('NONE'),
        BackupRestoreProcessState('SUCCEEDED'),
    ])
    BackupRestoreProcessState._set_binding_type(
        type.EnumType(
            'com.vmware.appliance.recovery.backup.job.backup_restore_process_state',
            BackupRestoreProcessState))

    class LocalizableMessage(VapiStruct):
        """
        ``Job.LocalizableMessage`` class Structure representing message

        .. tip::
            The arguments are used to initialize data attributes with the same
            names.
        """
        def __init__(
            self,
            id=None,
            default_message=None,
            args=None,
        ):
            """
            :type  id: :class:`str`
            :param id: id in message bundle
            :type  default_message: :class:`str`
            :param default_message: text in english
            :type  args: :class:`list` of :class:`str`
            :param args: nested data
            """
            self.id = id
            self.default_message = default_message
            self.args = args
            VapiStruct.__init__(self)

    LocalizableMessage._set_binding_type(
        type.StructType(
            'com.vmware.appliance.recovery.backup.job.localizable_message', {
                'id': type.StringType(),
                'default_message': type.StringType(),
                'args': type.ListType(type.StringType()),
            }, LocalizableMessage, False, None))

    class ReturnResult(VapiStruct):
        """
        ``Job.ReturnResult`` class Structure representing precheck result

        .. tip::
            The arguments are used to initialize data attributes with the same
            names.
        """
        def __init__(
            self,
            status=None,
            messages=None,
        ):
            """
            :type  status: :class:`Job.ReturnStatus`
            :param status: Check status
            :type  messages: :class:`list` of :class:`Job.LocalizableMessage`
            :param messages: List of messages
            """
            self.status = status
            self.messages = messages
            VapiStruct.__init__(self)

    ReturnResult._set_binding_type(
        type.StructType(
            'com.vmware.appliance.recovery.backup.job.return_result', {
                'status':
                type.ReferenceType(sys.modules[__name__], 'Job.ReturnStatus'),
                'messages':
                type.ListType(
                    type.ReferenceType(sys.modules[__name__],
                                       'Job.LocalizableMessage')),
            }, ReturnResult, False, None))

    class BackupRequest(VapiStruct):
        """
        ``Job.BackupRequest`` class Structure representing requested backup piece

        .. tip::
            The arguments are used to initialize data attributes with the same
            names.
        """
        def __init__(
            self,
            parts=None,
            backup_password=None,
            location_type=None,
            location=None,
            location_user=None,
            location_password=None,
            comment=None,
        ):
            """
            :type  parts: :class:`list` of :class:`str`
            :param parts: a list of optional parts. Run backup parts APIs to get list of
                optional parts and description
            :type  backup_password: :class:`str` or ``None``
            :param backup_password: a password for a backup piece The backupPassword must adhere to the
                following password requirements: At least 8 characters, cannot be
                more than 20 characters in length. At least 1 uppercase letter. At
                least 1 lowercase letter. At least 1 numeric digit. At least 1
                special character (i.e. any character not in [0-9,a-z,A-Z]). Only
                visible ASCII characters (for example, no space).
                backupPassword If no password then the piece will not be encrypted
            :type  location_type: :class:`Job.LocationType`
            :param location_type: a type of location
            :type  location: :class:`str`
            :param location: path or url
            :type  location_user: :class:`str` or ``None``
            :param location_user: username for location
                locationUser User name for this location if login is required.
            :type  location_password: :class:`str` or ``None``
            :param location_password: password for location
                locationPassword Password for the specified user if login is
                required at this location.
            :type  comment: :class:`str` or ``None``
            :param comment: Custom comment
                comment an optional comment
            """
            self.parts = parts
            self.backup_password = backup_password
            self.location_type = location_type
            self.location = location
            self.location_user = location_user
            self.location_password = location_password
            self.comment = comment
            VapiStruct.__init__(self)

    BackupRequest._set_binding_type(
        type.StructType(
            'com.vmware.appliance.recovery.backup.job.backup_request', {
                'parts':
                type.ListType(type.StringType()),
                'backup_password':
                type.OptionalType(type.SecretType()),
                'location_type':
                type.ReferenceType(sys.modules[__name__], 'Job.LocationType'),
                'location':
                type.StringType(),
                'location_user':
                type.OptionalType(type.StringType()),
                'location_password':
                type.OptionalType(type.SecretType()),
                'comment':
                type.OptionalType(type.StringType()),
            }, BackupRequest, False, None))

    class BackupJobStatus(VapiStruct):
        """
        ``Job.BackupJobStatus`` class Structure representing backup restore status

        .. tip::
            The arguments are used to initialize data attributes with the same
            names.
        """
        def __init__(
            self,
            id=None,
            state=None,
            messages=None,
            progress=None,
            start_time=None,
            end_time=None,
        ):
            """
            :type  id: :class:`str`
            :param id: TimeStamp based ID
            :type  state: :class:`Job.BackupRestoreProcessState`
            :param state: process state
            :type  messages: :class:`list` of :class:`Job.LocalizableMessage`
            :param messages: list of messages
            :type  progress: :class:`long`
            :param progress: percentage complete
            :type  start_time: :class:`datetime.datetime`
            :param start_time: Time when this backup was started.
            :type  end_time: :class:`datetime.datetime` or ``None``
            :param end_time: Time when this backup was finished.
                endTime End time is None till backup is finished.
            """
            self.id = id
            self.state = state
            self.messages = messages
            self.progress = progress
            self.start_time = start_time
            self.end_time = end_time
            VapiStruct.__init__(self)

    BackupJobStatus._set_binding_type(
        type.StructType(
            'com.vmware.appliance.recovery.backup.job.backup_job_status', {
                'id':
                type.StringType(),
                'state':
                type.ReferenceType(sys.modules[__name__],
                                   'Job.BackupRestoreProcessState'),
                'messages':
                type.ListType(
                    type.ReferenceType(sys.modules[__name__],
                                       'Job.LocalizableMessage')),
                'progress':
                type.IntegerType(),
                'start_time':
                type.DateTimeType(),
                'end_time':
                type.OptionalType(type.DateTimeType()),
            }, BackupJobStatus, False, None))

    def cancel(
        self,
        id,
    ):
        """
        Cancel the backup job

        :type  id: :class:`str`
        :param id: ID (ID of job)
            The parameter must be an identifier for the resource type:
            ``com.vmware.appliance.recovery.backup.job``.
        :rtype: :class:`Job.ReturnResult`
        :return: BackupJobStatus Structure
        :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` 
            ID is not found
        :raise: :class:`com.vmware.vapi.std.errors_client.Error` 
            Generic error
        """
        return self._invoke('cancel', {
            'id': id,
        })

    def create(
        self,
        piece,
    ):
        """
        Initiate backup.

        :type  piece: :class:`Job.BackupRequest`
        :param piece: BackupRequest Structure
        :rtype: :class:`Job.BackupJobStatus`
        :return: BackupJobStatus Structure
        :raise: :class:`com.vmware.vapi.std.errors_client.FeatureInUse` 
            A backup or restore is already in progress
        :raise: :class:`com.vmware.vapi.std.errors_client.Error` 
            Generic error
        """
        return self._invoke('create', {
            'piece': piece,
        })

    def list(self):
        """
        Get list of backup jobs


        :rtype: :class:`list` of :class:`str`
        :return: list of BackupJob IDs
            The return value will contain identifiers for the resource type:
            ``com.vmware.appliance.recovery.backup.job``.
        :raise: :class:`com.vmware.vapi.std.errors_client.Error` 
            Generic error
        """
        return self._invoke('list', None)

    def get(
        self,
        id,
    ):
        """
        See backup job progress/result.

        :type  id: :class:`str`
        :param id: ID (ID of job)
            The parameter must be an identifier for the resource type:
            ``com.vmware.appliance.recovery.backup.job``.
        :rtype: :class:`Job.BackupJobStatus`
        :return: BackupJobStatus Structure
        :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` 
            ID is not found
        :raise: :class:`com.vmware.vapi.std.errors_client.Error` 
            Generic error
        """
        return self._invoke('get', {
            'id': id,
        })
class Nodes(VapiInterface):
    """
    The ``Nodes`` interface provides methods to retrieve vCenter and Platform
    Services Controller nodes information in the topology. This class was added
    in vSphere API 6.7.2.
    """

    _VAPI_SERVICE_ID = 'com.vmware.vcenter.topology.nodes'
    """
    Identifier of the service in canonical form.
    """
    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, _NodesStub)

    class ApplianceType(Enum):
        """
        The ``Nodes.ApplianceType`` class defines values for valid appliance types
        for the vCenter and Platform Services Controller node. See
        :class:`Nodes.Info`. This enumeration was added in vSphere API 6.7.2.

        .. note::
            This class represents an enumerated type in the interface language
            definition. The class contains class attributes which represent the
            values in the current version of the enumerated type. Newer versions of
            the enumerated type may contain new values. To use new values of the
            enumerated type in communication with a server that supports the newer
            version of the API, you instantiate this class. See :ref:`enumerated
            type description page <enumeration_description>`.
        """
        VCSA_EMBEDDED = None
        """
        vCenter Server Appliance with an embedded Platform Services Controller.
        This class attribute was added in vSphere API 6.7.2.

        """
        VCSA_EXTERNAL = None
        """
        vCenter Server Appliance with an external Platform Services Controller.
        This class attribute was added in vSphere API 6.7.2.

        """
        PSC_EXTERNAL = None
        """
        An external Platform Services Controller. This class attribute was added in
        vSphere API 6.7.2.

        """
        def __init__(self, string):
            """
            :type  string: :class:`str`
            :param string: String value for the :class:`ApplianceType` instance.
            """
            Enum.__init__(string)

    ApplianceType._set_values([
        ApplianceType('VCSA_EMBEDDED'),
        ApplianceType('VCSA_EXTERNAL'),
        ApplianceType('PSC_EXTERNAL'),
    ])
    ApplianceType._set_binding_type(
        type.EnumType('com.vmware.vcenter.topology.nodes.appliance_type',
                      ApplianceType))

    class Info(VapiStruct):
        """
        The ``Nodes.Info`` class contains vCenter or Platform Services Controller
        node details. This class was added in vSphere API 6.7.2.

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

        _validator_list = [
            UnionValidator(
                'type', {
                    'VCSA_EMBEDDED': [('replication_partners', True)],
                    'PSC_EXTERNAL': [('replication_partners', True)],
                    'VCSA_EXTERNAL': [('client_affinity', True)],
                }),
        ]

        def __init__(
            self,
            domain=None,
            type=None,
            replication_partners=None,
            client_affinity=None,
        ):
            """
            :type  domain: :class:`str`
            :param domain: Domain name of the node. This attribute was added in vSphere API
                6.7.2.
            :type  type: :class:`Nodes.ApplianceType`
            :param type: Appliance type of the node. This attribute was added in vSphere API
                6.7.2.
            :type  replication_partners: :class:`list` of :class:`str`
            :param replication_partners: List of replication partners' node identifiers. Identifiers can be
                either IP address or DNS resolvable name of the partner node. This
                attribute was added in vSphere API 6.7.2.
                When clients pass a value of this class as a parameter, the
                attribute must contain identifiers for the resource type:
                ``com.vmware.vcenter.VCenter.name``. When methods return a value of
                this class as a return value, the attribute will contain
                identifiers for the resource type:
                ``com.vmware.vcenter.VCenter.name``.
                This attribute is optional and it is only relevant when the value
                of ``type`` is one of :attr:`Nodes.ApplianceType.VCSA_EMBEDDED` or
                :attr:`Nodes.ApplianceType.PSC_EXTERNAL`.
            :type  client_affinity: :class:`str`
            :param client_affinity: Identifier of the affinitized Platform Services Controller node.
                Identifier can be either IP address or DNS resolvable name of the
                affinitized node. This attribute was added in vSphere API 6.7.2.
                When clients pass a value of this class as a parameter, the
                attribute must be an identifier for the resource type:
                ``com.vmware.vcenter.VCenter.name``. When methods return a value of
                this class as a return value, the attribute will be an identifier
                for the resource type: ``com.vmware.vcenter.VCenter.name``.
                This attribute is optional and it is only relevant when the value
                of ``type`` is :attr:`Nodes.ApplianceType.VCSA_EXTERNAL`.
            """
            self.domain = domain
            self.type = type
            self.replication_partners = replication_partners
            self.client_affinity = client_affinity
            VapiStruct.__init__(self)

    Info._set_binding_type(
        type.StructType(
            'com.vmware.vcenter.topology.nodes.info', {
                'domain':
                type.StringType(),
                'type':
                type.ReferenceType(__name__, 'Nodes.ApplianceType'),
                'replication_partners':
                type.OptionalType(type.ListType(type.IdType())),
                'client_affinity':
                type.OptionalType(type.IdType()),
            }, Info, False, None))

    class Summary(VapiStruct):
        """
        The ``Nodes.Summary`` class contains commonly used information of vCenter
        or Platform Services Controller node. This class was added in vSphere API
        6.7.2.

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

        _validator_list = [
            UnionValidator(
                'type', {
                    'VCSA_EMBEDDED': [('replication_partners', True)],
                    'PSC_EXTERNAL': [('replication_partners', True)],
                    'VCSA_EXTERNAL': [('client_affinity', True)],
                }),
        ]

        def __init__(
            self,
            node=None,
            type=None,
            replication_partners=None,
            client_affinity=None,
        ):
            """
            :type  node: :class:`str`
            :param node: Identifier for the vCenter or Platform Services Controller node.
                Identifier can be either IP address or DNS resolvable name of the
                node. This attribute was added in vSphere API 6.7.2.
                When clients pass a value of this class as a parameter, the
                attribute must be an identifier for the resource type:
                ``com.vmware.vcenter.VCenter.name``. When methods return a value of
                this class as a return value, the attribute will be an identifier
                for the resource type: ``com.vmware.vcenter.VCenter.name``.
            :type  type: :class:`Nodes.ApplianceType`
            :param type: Appliance type of the node. This attribute was added in vSphere API
                6.7.2.
            :type  replication_partners: :class:`list` of :class:`str`
            :param replication_partners: List of replication partners' node identifiers. Identifiers can be
                either IP address or DNS resolvable name of the partner node. This
                attribute was added in vSphere API 6.7.2.
                When clients pass a value of this class as a parameter, the
                attribute must contain identifiers for the resource type:
                ``com.vmware.vcenter.VCenter.name``. When methods return a value of
                this class as a return value, the attribute will contain
                identifiers for the resource type:
                ``com.vmware.vcenter.VCenter.name``.
                This attribute is optional and it is only relevant when the value
                of ``type`` is one of :attr:`Nodes.ApplianceType.VCSA_EMBEDDED` or
                :attr:`Nodes.ApplianceType.PSC_EXTERNAL`.
            :type  client_affinity: :class:`str`
            :param client_affinity: Identifier of the affinitized Platform Services Controller node.
                Identifier can be either IP address or DNS resolvable name of the
                affinitized node. This attribute was added in vSphere API 6.7.2.
                When clients pass a value of this class as a parameter, the
                attribute must be an identifier for the resource type:
                ``com.vmware.vcenter.VCenter.name``. When methods return a value of
                this class as a return value, the attribute will be an identifier
                for the resource type: ``com.vmware.vcenter.VCenter.name``.
                This attribute is optional and it is only relevant when the value
                of ``type`` is :attr:`Nodes.ApplianceType.VCSA_EXTERNAL`.
            """
            self.node = node
            self.type = type
            self.replication_partners = replication_partners
            self.client_affinity = client_affinity
            VapiStruct.__init__(self)

    Summary._set_binding_type(
        type.StructType(
            'com.vmware.vcenter.topology.nodes.summary', {
                'node':
                type.IdType(resource_types='com.vmware.vcenter.VCenter.name'),
                'type':
                type.ReferenceType(__name__, 'Nodes.ApplianceType'),
                'replication_partners':
                type.OptionalType(type.ListType(type.IdType())),
                'client_affinity':
                type.OptionalType(type.IdType()),
            }, Summary, False, None))

    class FilterSpec(VapiStruct):
        """
        The ``Nodes.FilterSpec`` class contains attribute used to filter the
        results when listing vCenter and Platform Services Controller nodes (see
        :func:`Nodes.list`). This class was added in vSphere API 6.7.2.

        .. tip::
            The arguments are used to initialize data attributes with the same
            names.
        """
        def __init__(
            self,
            types=None,
        ):
            """
            :type  types: :class:`set` of :class:`Nodes.ApplianceType` or ``None``
            :param types: Types of the appliance that a vCenter and Platform Services
                Controller node must be to match the filter (see
                :class:`Nodes.ApplianceType`. This attribute was added in vSphere
                API 6.7.2.
                If None or empty, node of any ApplianceType match the filter.
            """
            self.types = types
            VapiStruct.__init__(self)

    FilterSpec._set_binding_type(
        type.StructType(
            'com.vmware.vcenter.topology.nodes.filter_spec', {
                'types':
                type.OptionalType(
                    type.SetType(
                        type.ReferenceType(__name__, 'Nodes.ApplianceType'))),
            }, FilterSpec, False, None))

    def list(
        self,
        filter=None,
    ):
        """
        Returns information about all vCenter and Platform Services Controller
        nodes matching the :class:`Nodes.FilterSpec`. This method was added in
        vSphere API 6.7.2.

        :type  filter: :class:`Nodes.FilterSpec` or ``None``
        :param filter: Specification of matching vCenter and Platform Services Controller
            nodes for which information should be returned.
            If None, the behavior is equivalent to a :class:`Nodes.FilterSpec`
            with all attributes None which means all nodes match the filter.
        :rtype: :class:`list` of :class:`Nodes.Summary`
        :return: commonly used information for all vCenter and Platform Services
            Controller nodes matching the :class:`Nodes.FilterSpec`.
        :raise: :class:`com.vmware.vapi.std.errors_client.Unauthenticated` 
             if the user can not be authenticated.
        :raise: :class:`com.vmware.vapi.std.errors_client.Unauthorized` 
             if the user doesn't have the required privileges.
        :raise: :class:`com.vmware.vapi.std.errors_client.InvalidArgument` 
            if the :attr:`Nodes.FilterSpec.types` attribute contains a value
            that is not supported.
        """
        return self._invoke('list', {
            'filter': filter,
        })

    def get(
        self,
        node,
    ):
        """
        Retrieve details for a given identifier of the vCenter or Platform
        Services Controller node. This method was added in vSphere API 6.7.2.

        :type  node: :class:`str`
        :param node: Identifier of the vCenter or Platform Services Controller node.
            Identifier can be either IP address or DNS resolvable name of the
            node.
            The parameter must be an identifier for the resource type:
            ``com.vmware.vcenter.VCenter.name``.
        :rtype: :class:`Nodes.Info`
        :return: vCenter or Platform Services Controller node details with
            replication partners and client affinity information as applicable.
            See :class:`Nodes.Info`.
        :raise: :class:`com.vmware.vapi.std.errors_client.Unauthenticated` 
             if the user can not be authenticated.
        :raise: :class:`com.vmware.vapi.std.errors_client.Unauthorized` 
             if the user doesn't have the required privileges.
        :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` 
             if a node doesn't exist for given node identifier.
        """
        return self._invoke('get', {
            'node': node,
        })
Exemple #15
0
class Job(VapiInterface):
    """
    The ``Job`` class provides methods to create and get the status of
    reconciliation job. This class was added in vSphere API 6.7
    """
    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, _JobStub)

    class Status(Enum):
        """
        The ``Job.Status`` class defines the status values that can be reported for
        an operation. This enumeration was added in vSphere API 6.7

        .. note::
            This class represents an enumerated type in the interface language
            definition. The class contains class attributes which represent the
            values in the current version of the enumerated type. Newer versions of
            the enumerated type may contain new values. To use new values of the
            enumerated type in communication with a server that supports the newer
            version of the API, you instantiate this class. See :ref:`enumerated
            type description page <enumeration_description>`.
        """
        NONE = None
        """
        The operation is not running. This class attribute was added in vSphere API
        6.7

        """
        RUNNING = None
        """
        The operation is in progress. This class attribute was added in vSphere API
        6.7

        """
        SUCCEEDED = None
        """
        The operation completed successfully. This class attribute was added in
        vSphere API 6.7

        """
        FAILED = None
        """
        The operation failed. This class attribute was added in vSphere API 6.7

        """
        def __init__(self, string):
            """
            :type  string: :class:`str`
            :param string: String value for the :class:`Status` instance.
            """
            Enum.__init__(string)

    Status._set_values([
        Status('NONE'),
        Status('RUNNING'),
        Status('SUCCEEDED'),
        Status('FAILED'),
    ])
    Status._set_binding_type(
        type.EnumType(
            'com.vmware.appliance.recovery.reconciliation.job.status', Status))

    class CreateSpec(VapiStruct):
        """
        The ``Job.CreateSpec`` class has the fields to request the start of
        reconciliation job. This class was added in vSphere API 6.7

        .. tip::
            The arguments are used to initialize data attributes with the same
            names.
        """
        def __init__(
            self,
            sso_admin_user_name=None,
            sso_admin_user_password=None,
            ignore_warnings=None,
        ):
            """
            :type  sso_admin_user_name: :class:`str` or ``None``
            :param sso_admin_user_name: Administrators username for SSO. This attribute was added in
                vSphere API 6.7
                If None SSO authentication will not be used. If the vCenter Server
                is a management node or an embedded node, authentication is
                required.
            :type  sso_admin_user_password: :class:`str` or ``None``
            :param sso_admin_user_password: Password for SSO admin user. This attribute was added in vSphere
                API 6.7
                If None SSO authentication will not be used. If the vCenter Server
                is a management node or an embedded node, authentication is
                required.
            :type  ignore_warnings: :class:`bool` or ``None``
            :param ignore_warnings: Flag indicating whether warnings should be ignored during
                reconciliation. This attribute was added in vSphere API 6.7
                If None, validation warnings will fail the reconciliation
                operation.
            """
            self.sso_admin_user_name = sso_admin_user_name
            self.sso_admin_user_password = sso_admin_user_password
            self.ignore_warnings = ignore_warnings
            VapiStruct.__init__(self)

    CreateSpec._set_binding_type(
        type.StructType(
            'com.vmware.appliance.recovery.reconciliation.job.create_spec', {
                'sso_admin_user_name': type.OptionalType(type.StringType()),
                'sso_admin_user_password': type.OptionalType(
                    type.SecretType()),
                'ignore_warnings': type.OptionalType(type.BooleanType()),
            }, CreateSpec, False, None))

    class Info(VapiStruct):
        """
        The ``Job.Info`` class represents the reconciliation job information. It
        contains information related to current Status, any associated messages and
        progress as percentage. This class was added in vSphere API 6.7

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

        _validator_list = [
            UnionValidator(
                'status', {
                    'FAILED': [('error', False), ('start_time', True),
                               ('end_time', True)],
                    'RUNNING': [('start_time', True)],
                    'SUCCEEDED': [('start_time', True), ('end_time', True)],
                    'NONE': [],
                }),
        ]

        def __init__(
            self,
            description=None,
            service=None,
            operation=None,
            parent=None,
            target=None,
            status=None,
            cancelable=None,
            error=None,
            start_time=None,
            end_time=None,
            messages=None,
            progress=None,
        ):
            """
            :type  description: :class:`com.vmware.vapi.std_client.LocalizableMessage`
            :param description: Description of the operation associated with the task. This
                attribute was added in vSphere API 6.7
            :type  service: :class:`str`
            :param service: Name of the service containing the operation. This attribute was
                added in vSphere API 6.7
                When clients pass a value of this class as a parameter, the
                attribute must be an identifier for the resource type:
                ``com.vmware.appliance.recovery.reconciliation.job``. When methods
                return a value of this class as a return value, the attribute will
                be an identifier for the resource type:
                ``com.vmware.appliance.recovery.reconciliation.job``.
            :type  operation: :class:`str`
            :param operation: Name of the operation associated with the task. This attribute was
                added in vSphere API 6.7
            :type  parent: :class:`str` or ``None``
            :param parent: Parent of the current task. This attribute was added in vSphere API
                6.7
                When clients pass a value of this class as a parameter, the
                attribute must be an identifier for the resource type:
                ``com.vmware.appliance.recovery.reconciliation.job``. When methods
                return a value of this class as a return value, the attribute will
                be an identifier for the resource type:
                ``com.vmware.appliance.recovery.reconciliation.job``.
                This attribute will be None if the task has no parent.
            :type  target: :class:`com.vmware.vapi.std_client.DynamicID` or ``None``
            :param target: Identifier of the target resource the operation modifies. This
                attribute was added in vSphere API 6.7
                This attribute will be None if the task has multiple targets or no
                target.
            :type  status: :class:`Job.Status`
            :param status: Status of the operation associated with the task. This attribute
                was added in vSphere API 6.7
            :type  cancelable: :class:`bool` or ``None``
            :param cancelable: Flag to indicate whether or not the operation can be cancelled. The
                value may change as the operation progresses. This attribute was
                added in vSphere API 6.7
                If None, the operation cannot be canceled.
            :type  error: :class:`Exception` or ``None``
            :param error: Description of the error if the operation status is "FAILED". This
                attribute was added in vSphere API 6.7
                If None the description of why the operation failed will be
                included in the result of the operation (see null).
            :type  start_time: :class:`datetime.datetime`
            :param start_time: Time when the operation is started. This attribute was added in
                vSphere API 6.7
                This attribute is optional and it is only relevant when the value
                of ``status`` is one of :attr:`Job.Status.RUNNING`,
                :attr:`Job.Status.SUCCEEDED`, or :attr:`Job.Status.FAILED`.
            :type  end_time: :class:`datetime.datetime`
            :param end_time: Time when the operation is completed. This attribute was added in
                vSphere API 6.7
                This attribute is optional and it is only relevant when the value
                of ``status`` is one of :attr:`Job.Status.SUCCEEDED` or
                :attr:`Job.Status.FAILED`.
            :type  messages: :class:`list` of :class:`com.vmware.vapi.std_client.LocalizableMessage`
            :param messages: A list of localized messages. This attribute was added in vSphere
                API 6.7
            :type  progress: :class:`long`
            :param progress: The progress of the job as a percentage. This attribute was added
                in vSphere API 6.7
            """
            self.description = description
            self.service = service
            self.operation = operation
            self.parent = parent
            self.target = target
            self.status = status
            self.cancelable = cancelable
            self.error = error
            self.start_time = start_time
            self.end_time = end_time
            self.messages = messages
            self.progress = progress
            VapiStruct.__init__(self)

    Info._set_binding_type(
        type.StructType(
            'com.vmware.appliance.recovery.reconciliation.job.info', {
                'description':
                type.ReferenceType('com.vmware.vapi.std_client',
                                   'LocalizableMessage'),
                'service':
                type.IdType(
                    resource_types=
                    'com.vmware.appliance.recovery.reconciliation.job'),
                'operation':
                type.StringType(),
                'parent':
                type.OptionalType(type.IdType()),
                'target':
                type.OptionalType(
                    type.ReferenceType('com.vmware.vapi.std_client',
                                       'DynamicID')),
                'status':
                type.ReferenceType(__name__, 'Job.Status'),
                'cancelable':
                type.OptionalType(type.BooleanType()),
                'error':
                type.OptionalType(type.AnyErrorType()),
                'start_time':
                type.OptionalType(type.DateTimeType()),
                'end_time':
                type.OptionalType(type.DateTimeType()),
                'messages':
                type.ListType(
                    type.ReferenceType('com.vmware.vapi.std_client',
                                       'LocalizableMessage')),
                'progress':
                type.IntegerType(),
            }, Info, False, None))

    def create(
        self,
        spec,
    ):
        """
        Initiate reconciliation. This method was added in vSphere API 6.7

        :type  spec: :class:`Job.CreateSpec`
        :param spec: CreateSpec Structure
        :rtype: :class:`Job.Info`
        :return: Info Structure
        :raise: :class:`com.vmware.vapi.std.errors_client.FeatureInUse` 
            A backup or restore is already in progress.
        :raise: :class:`com.vmware.vapi.std.errors_client.NotAllowedInCurrentState` 
            Reconciliation is allowed only after restore has finished
            successfully.
        :raise: :class:`com.vmware.vapi.std.errors_client.Error` 
            if any error occurs during the execution of the operation.
        """
        return self._invoke('create', {
            'spec': spec,
        })

    def get(self):
        """
        Get reconciliation job progress/result. This method was added in
        vSphere API 6.7


        :rtype: :class:`Job.Info`
        :return: Info Structure
        :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` 
            if there is no running reconciliation job.
        :raise: :class:`com.vmware.vapi.std.errors_client.Error` 
            if any error occurs during the execution of the operation.
        """
        return self._invoke('get', None)
Exemple #16
0
    class Message(VapiStruct):
        """
        The ``Clusters.Message`` class contains the information about the object
        configuration.

        .. tip::
            The arguments are used to initialize data attributes with the same
            names.
        """
        def __init__(
            self,
            severity=None,
            details=None,
        ):
            """
            :type  severity: :class:`Clusters.Message.Severity`
            :param severity: Type of the message.
            :type  details: :class:`com.vmware.vapi.std_client.LocalizableMessage`
            :param details: Details about the message.
            """
            self.severity = severity
            self.details = details
            VapiStruct.__init__(self)

        class Severity(Enum):
            """
            The ``Clusters.Message.Severity`` class represents the severity of the
            message.

            .. note::
                This class represents an enumerated type in the interface language
                definition. The class contains class attributes which represent the
                values in the current version of the enumerated type. Newer versions of
                the enumerated type may contain new values. To use new values of the
                enumerated type in communication with a server that supports the newer
                version of the API, you instantiate this class. See :ref:`enumerated
                type description page <enumeration_description>`.
            """
            INFO = None
            """
            Informational message. This may be accompanied by vCenter event.

            """
            WARNING = None
            """
            Warning message. This may be accompanied by vCenter event.

            """
            ERROR = None
            """
            Error message. This is accompanied by vCenter event and/or alarm.

            """
            def __init__(self, string):
                """
                :type  string: :class:`str`
                :param string: String value for the :class:`Severity` instance.
                """
                Enum.__init__(string)

        Severity._set_values([
            Severity('INFO'),
            Severity('WARNING'),
            Severity('ERROR'),
        ])
        Severity._set_binding_type(
            type.EnumType(
                'com.vmware.vcenter.namespace_management.software.clusters.message.severity',
                Severity))
Exemple #17
0
    class DataDefinition(VapiStruct):
        """
        The :class:`Operation.DataDefinition` structure describes a vAPI data type.

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

        _validator_list = [
            UnionValidator(
                'type', {
                    'OPTIONAL': [('element_definition', True)],
                    'LIST': [('element_definition', True)],
                    'STRUCTURE': [('name', True), ('fields', True)],
                    'STRUCTURE_REF': [('name', True)],
                    'ERROR': [('name', True), ('fields', True)],
                    'BINARY': [],
                    'BOOLEAN': [],
                    'DOUBLE': [],
                    'DYNAMIC_STRUCTURE': [],
                    'ANY_ERROR': [],
                    'LONG': [],
                    'OPAQUE': [],
                    'SECRET': [],
                    'STRING': [],
                    'VOID': [],
                }),
        ]

        def __init__(
            self,
            type=None,
            element_definition=None,
            name=None,
            fields=None,
        ):
            """
            :type  type: :class:`Operation.DataDefinition.DataType`
            :param type: Data type of the value.
            :type  element_definition: :class:`Operation.DataDefinition`
            :param element_definition: Contains the element definition for generic data types like List
                and Optional.
                This attribute is optional and it is only relevant when the value
                of ``type`` is one of
                :attr:`Operation.DataDefinition.DataType.OPTIONAL` or
                :attr:`Operation.DataDefinition.DataType.LIST`.
            :type  name: :class:`str`
            :param name: Fully qualified name of the structure.
                This attribute is optional and it is only relevant when the value
                of ``type`` is one of
                :attr:`Operation.DataDefinition.DataType.STRUCTURE`,
                :attr:`Operation.DataDefinition.DataType.STRUCTURE_REF`, or
                :attr:`Operation.DataDefinition.DataType.ERROR`.
            :type  fields: :class:`dict` of :class:`str` and :class:`Operation.DataDefinition`
            :param fields: Fields of the structure type. The key of the map is the canonical
                name of the field and the value is the
                :class:`Operation.DataDefinition` for the field. The order of the
                structure fields defined in IDL is not maintained by the
                :class:`Operation` service.
                This attribute is optional and it is only relevant when the value
                of ``type`` is one of
                :attr:`Operation.DataDefinition.DataType.STRUCTURE` or
                :attr:`Operation.DataDefinition.DataType.ERROR`.
            """
            self.type = type
            self.element_definition = element_definition
            self.name = name
            self.fields = fields
            VapiStruct.__init__(self)

        class DataType(Enum):
            """
            The :class:`Operation.DataDefinition.DataType` enumeration provides values
            representing the data types supported by the vAPI infrastructure.

            .. note::
                This class represents an enumerated type in the interface language
                definition. The class contains class attributes which represent the
                values in the current version of the enumerated type. Newer versions of
                the enumerated type may contain new values. To use new values of the
                enumerated type in communication with a server that supports the newer
                version of the API, you instantiate this class. See :ref:`enumerated
                type description page <enumeration_description>`.
            """
            BINARY = None
            """
            Indicates the value is a binary type.

            """
            BOOLEAN = None
            """
            Indicates the value is a boolean type. The possible values are True and
            False equivalent of the language used to invoke this operation.

            """
            DOUBLE = None
            """
            Indicates the value is a double type. It is a 64 bit floating point number.

            """
            DYNAMIC_STRUCTURE = None
            """
            Indicates the value is a dynamic structure. This means, any data of type
            :attr:`Operation.DataDefinition.DataType.STRUCTURE` can be used.

            """
            ERROR = None
            """
            Indicates the value is a specific error type.

            """
            ANY_ERROR = None
            """
            Indicates the value is arbitrary error type. This means, any data of type
            :attr:`Operation.DataDefinition.DataType.ERROR` can be used.

            """
            LIST = None
            """
            Indicates the value is a list data type. Any value of this type can have
            zero or more elements in the list.

            """
            LONG = None
            """
            Indicates the value is a long data type. It is a 64 bit signed integer
            number.

            """
            OPAQUE = None
            """
            Indicates the value is an opaque type. This means, data of any
            :class:`Operation.DataDefinition.DataType` can be used.

            """
            OPTIONAL = None
            """
            Indicates the value is an optional data type. Any value of this type can be
            null.

            """
            SECRET = None
            """
            Indicates the value is a secret data type. This is used for sensitive
            information. The server will not log any data of this type and if possible
            wipe the data from the memory after usage.

            """
            STRING = None
            """
            Indicates the value is a string data type. This is a unicode string.

            """
            STRUCTURE = None
            """
            Indicates the value is a structure data type. A structure has string
            identifier and a set of fields with corresponding values.

            """
            STRUCTURE_REF = None
            """
            Indicates the value is a structure reference. This is used to break
            circular dependencies in the type references. This just has a string
            identifier of the structure. Clients have to maintain a list of structures
            already visited and use that to resolve this reference.

            """
            VOID = None
            """
            Indicates the value is a void data type.

            """
            def __init__(self, string):
                """
                :type  string: :class:`str`
                :param string: String value for the :class:`DataType` instance.
                """
                Enum.__init__(string)

        DataType._set_values([
            DataType('BINARY'),
            DataType('BOOLEAN'),
            DataType('DOUBLE'),
            DataType('DYNAMIC_STRUCTURE'),
            DataType('ERROR'),
            DataType('ANY_ERROR'),
            DataType('LIST'),
            DataType('LONG'),
            DataType('OPAQUE'),
            DataType('OPTIONAL'),
            DataType('SECRET'),
            DataType('STRING'),
            DataType('STRUCTURE'),
            DataType('STRUCTURE_REF'),
            DataType('VOID'),
        ])
        DataType._set_binding_type(
            type.EnumType(
                'com.vmware.vapi.std.introspection.operation.data_definition.data_type',
                DataType))
Exemple #18
0
    class Result(VapiStruct):
        """
        The ``Clusters.Result`` class contains the result of batch upgrade method.

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

        _validator_list = [
            UnionValidator('res', {
                'REJECTED': [('exception', True)],
                'STARTED': [],
            }),
        ]

        def __init__(
            self,
            res=None,
            exception=None,
        ):
            """
            :type  res: :class:`Clusters.Result.Res`
            :param res: The result of batch upgrade method.
            :type  exception: :class:`Exception`
            :param exception: Exception when cluster pre-check failed during upgrade invocation.
                This attribute is optional and it is only relevant when the value
                of ``res`` is :attr:`Clusters.Result.Res.REJECTED`.
            """
            self.res = res
            self.exception = exception
            VapiStruct.__init__(self)

        class Res(Enum):
            """
            The ``Clusters.Result.Res`` class represents the upgrade invocation result
            for each cluster.

            .. note::
                This class represents an enumerated type in the interface language
                definition. The class contains class attributes which represent the
                values in the current version of the enumerated type. Newer versions of
                the enumerated type may contain new values. To use new values of the
                enumerated type in communication with a server that supports the newer
                version of the API, you instantiate this class. See :ref:`enumerated
                type description page <enumeration_description>`.
            """
            STARTED = None
            """
            Upgrade is started.

            """
            REJECTED = None
            """
            Upgrade is rejected. This implies pre-check failed when invoking upgrade of
            the cluster.

            """
            def __init__(self, string):
                """
                :type  string: :class:`str`
                :param string: String value for the :class:`Res` instance.
                """
                Enum.__init__(string)

        Res._set_values([
            Res('STARTED'),
            Res('REJECTED'),
        ])
        Res._set_binding_type(
            type.EnumType(
                'com.vmware.vcenter.namespace_management.software.clusters.result.res',
                Res))
class Restore(VapiInterface):
    """
    ``Restore`` class provides methods Performs restore operations
    """

    _VAPI_SERVICE_ID = 'com.vmware.appliance.recovery.restore'
    """
    Identifier of the service in canonical form.
    """
    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, _RestoreStub)

    class LocationType(Enum):
        """
        ``Restore.LocationType`` class Defines type of all locations for
        backup/restore

        .. note::
            This class represents an enumerated type in the interface language
            definition. The class contains class attributes which represent the
            values in the current version of the enumerated type. Newer versions of
            the enumerated type may contain new values. To use new values of the
            enumerated type in communication with a server that supports the newer
            version of the API, you instantiate this class. See :ref:`enumerated
            type description page <enumeration_description>`.
        """
        FTP = None
        """
        Destination is FTP server

        """
        HTTP = None
        """
        Destination is HTTP server

        """
        FTPS = None
        """
        Destination is FTPS server

        """
        HTTPS = None
        """
        Destination is HTTPS server

        """
        SCP = None
        """
        Destination is SSH server

        """
        SFTP = None
        """
        Destination is SFTP server

        """
        NFS = None
        """
        Destination is NFS server. This class attribute was added in vSphere API
        6.7.2.

        """
        SMB = None
        """
        Destination is SMB server. This class attribute was added in vSphere API
        6.7.2.

        """
        def __init__(self, string):
            """
            :type  string: :class:`str`
            :param string: String value for the :class:`LocationType` instance.
            """
            Enum.__init__(string)

    LocationType._set_values([
        LocationType('FTP'),
        LocationType('HTTP'),
        LocationType('FTPS'),
        LocationType('HTTPS'),
        LocationType('SCP'),
        LocationType('SFTP'),
        LocationType('NFS'),
        LocationType('SMB'),
    ])
    LocationType._set_binding_type(
        type.EnumType('com.vmware.appliance.recovery.restore.location_type',
                      LocationType))

    class RestoreRequest(VapiStruct):
        """
        ``Restore.RestoreRequest`` class Structure representing requested restore
        piece

        .. tip::
            The arguments are used to initialize data attributes with the same
            names.
        """
        def __init__(
            self,
            backup_password=None,
            location_type=None,
            location=None,
            location_user=None,
            location_password=None,
            sso_admin_user_name=None,
            sso_admin_user_password=None,
        ):
            """
            :type  backup_password: :class:`str` or ``None``
            :param backup_password: a password for a backup piece
                backupPassword If no password then the piece will not be decrypted
            :type  location_type: :class:`Restore.LocationType`
            :param location_type: a type of location
            :type  location: :class:`str`
            :param location: path or url
            :type  location_user: :class:`str` or ``None``
            :param location_user: username for location
                locationUser User name for this location if login is required.
            :type  location_password: :class:`str` or ``None``
            :param location_password: password for location
                locationPassword Password for the specified user if login is
                required at this location.
            :type  sso_admin_user_name: :class:`str` or ``None``
            :param sso_admin_user_name: Administrators username for SSO. This attribute was added in
                vSphere API 6.7.
                If None SSO authentication will not be used. If the vCenter Server
                is a management node or an embedded node, authentication is
                required.
            :type  sso_admin_user_password: :class:`str` or ``None``
            :param sso_admin_user_password: The password for SSO admin user. This attribute was added in
                vSphere API 6.7.
                If None SSO authentication will not be used. If the vCenter Server
                is a management node or an embedded node, authentication is
                required.
            """
            self.backup_password = backup_password
            self.location_type = location_type
            self.location = location
            self.location_user = location_user
            self.location_password = location_password
            self.sso_admin_user_name = sso_admin_user_name
            self.sso_admin_user_password = sso_admin_user_password
            VapiStruct.__init__(self)

    RestoreRequest._set_binding_type(
        type.StructType(
            'com.vmware.appliance.recovery.restore.restore_request', {
                'backup_password':
                type.OptionalType(type.SecretType()),
                'location_type':
                type.ReferenceType(__name__, 'Restore.LocationType'),
                'location':
                type.StringType(),
                'location_user':
                type.OptionalType(type.StringType()),
                'location_password':
                type.OptionalType(type.SecretType()),
                'sso_admin_user_name':
                type.OptionalType(type.StringType()),
                'sso_admin_user_password':
                type.OptionalType(type.SecretType()),
            }, RestoreRequest, False, None))

    class LocalizableMessage(VapiStruct):
        """
        ``Restore.LocalizableMessage`` class Structure representing message

        .. tip::
            The arguments are used to initialize data attributes with the same
            names.
        """
        def __init__(
            self,
            id=None,
            default_message=None,
            args=None,
        ):
            """
            :type  id: :class:`str`
            :param id: id in message bundle
            :type  default_message: :class:`str`
            :param default_message: text in english
            :type  args: :class:`list` of :class:`str`
            :param args: nested data
            """
            self.id = id
            self.default_message = default_message
            self.args = args
            VapiStruct.__init__(self)

    LocalizableMessage._set_binding_type(
        type.StructType(
            'com.vmware.appliance.recovery.restore.localizable_message', {
                'id': type.StringType(),
                'default_message': type.StringType(),
                'args': type.ListType(type.StringType()),
            }, LocalizableMessage, False, None))

    class Metadata(VapiStruct):
        """
        ``Restore.Metadata`` class Structure representing metadata

        .. tip::
            The arguments are used to initialize data attributes with the same
            names.
        """
        def __init__(
            self,
            timestamp=None,
            parts=None,
            version=None,
            boxname=None,
            sso_login_required=None,
            comment=None,
            applicable=None,
            messages=None,
        ):
            """
            :type  timestamp: :class:`datetime.datetime`
            :param timestamp: Time when this backup was completed.
            :type  parts: :class:`list` of :class:`str`
            :param parts: List of parts included in the backup.
            :type  version: :class:`str`
            :param version: VCSA version
            :type  boxname: :class:`str`
            :param boxname: Box name is PNID/ FQDN etc
            :type  sso_login_required: :class:`bool`
            :param sso_login_required: Is SSO login required for the vCenter server. This attribute was
                added in vSphere API 6.7.
                This attribute is optional because it was added in a newer version
                than its parent node.
            :type  comment: :class:`str`
            :param comment: Custom comment
            :type  applicable: :class:`bool`
            :param applicable: Does the VCSA match the deployment type, network properties and
                version of backed up VC
            :type  messages: :class:`list` of :class:`Restore.LocalizableMessage`
            :param messages: Any messages if the backup is not aplicable
            """
            self.timestamp = timestamp
            self.parts = parts
            self.version = version
            self.boxname = boxname
            self.sso_login_required = sso_login_required
            self.comment = comment
            self.applicable = applicable
            self.messages = messages
            VapiStruct.__init__(self)

    Metadata._set_binding_type(
        type.StructType(
            'com.vmware.appliance.recovery.restore.metadata', {
                'timestamp':
                type.DateTimeType(),
                'parts':
                type.ListType(type.StringType()),
                'version':
                type.StringType(),
                'boxname':
                type.StringType(),
                'sso_login_required':
                type.OptionalType(type.BooleanType()),
                'comment':
                type.StringType(),
                'applicable':
                type.BooleanType(),
                'messages':
                type.ListType(
                    type.ReferenceType(__name__,
                                       'Restore.LocalizableMessage')),
            }, Metadata, False, None))

    def validate(
        self,
        piece,
    ):
        """
        Get metadata before restore

        :type  piece: :class:`Restore.RestoreRequest`
        :param piece: RestoreRequest Structure
        :rtype: :class:`Restore.Metadata`
        :return: Metadata Structure
        :raise: :class:`com.vmware.vapi.std.errors_client.Error` 
            Generic error
        """
        return self._invoke('validate', {
            'piece': piece,
        })
    """
    def __init__(self, string):
        """
        :type  string: :class:`str`
        :param string: String value for the :class:`ScaleSharesBehavior` instance.
        """
        Enum.__init__(string)


ScaleSharesBehavior._set_values([
    ScaleSharesBehavior('DISABLED'),
    ScaleSharesBehavior('SCALE_CPU_AND_MEMORY_SHARES'),
])
ScaleSharesBehavior._set_binding_type(
    type.EnumType(
        'com.vmware.appliance.vcenter.settings.v1.config.components.inventory.cluster.drs.scale_shares_behavior',
        ScaleSharesBehavior))


class DrsBehaviorInfo(Enum):
    """
    The ``DrsBehaviorInfo`` class defines the automation levels that can be set
    on a DRS cluster.

    .. note::
        This class represents an enumerated type in the interface language
        definition. The class contains class attributes which represent the
        values in the current version of the enumerated type. Newer versions of
        the enumerated type may contain new values. To use new values of the
        enumerated type in communication with a server that supports the newer
        version of the API, you instantiate this class. See :ref:`enumerated
Exemple #21
0
class Inbound(VapiInterface):
    """
    The ``Inbound`` class provides methods to manage inbound firewall rules.
    This class was added in vSphere API 6.7.1.
    """

    _VAPI_SERVICE_ID = 'com.vmware.appliance.networking.firewall.inbound'
    """
    Identifier of the service in canonical form.
    """
    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, _InboundStub)

    class Policy(Enum):
        """
        ``Inbound.Policy`` class Defines firewall rule policies. This enumeration
        was added in vSphere API 6.7.1.

        .. note::
            This class represents an enumerated type in the interface language
            definition. The class contains class attributes which represent the
            values in the current version of the enumerated type. Newer versions of
            the enumerated type may contain new values. To use new values of the
            enumerated type in communication with a server that supports the newer
            version of the API, you instantiate this class. See :ref:`enumerated
            type description page <enumeration_description>`.
        """
        IGNORE = None
        """
        Drop packet with correpsonding address. This class attribute was added in
        vSphere API 6.7.1.

        """
        ACCEPT = None
        """
        Allow packet with corresponding address. This class attribute was added in
        vSphere API 6.7.1.

        """
        REJECT = None
        """
        Drop packet with corresponding address sending destination is not
        reachable. This class attribute was added in vSphere API 6.7.1.

        """
        RETURN = None
        """
        Apply default or port-specific rules to packet with corresponding address.
        This class attribute was added in vSphere API 6.7.1.

        """

        def __init__(self, string):
            """
            :type  string: :class:`str`
            :param string: String value for the :class:`Policy` instance.
            """
            Enum.__init__(string)

    Policy._set_values([
        Policy('IGNORE'),
        Policy('ACCEPT'),
        Policy('REJECT'),
        Policy('RETURN'),
    ])
    Policy._set_binding_type(type.EnumType(
        'com.vmware.appliance.networking.firewall.inbound.policy',
        Policy))


    class Rule(VapiStruct):
        """
        ``Inbound.Rule`` class Structure that defines a single address-based
        firewall rule. This class was added in vSphere API 6.7.1.

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




        def __init__(self,
                     address=None,
                     prefix=None,
                     policy=None,
                     interface_name=None,
                    ):
            """
            :type  address: :class:`str`
            :param address: IPv4 or IPv6 address. This attribute was added in vSphere API
                6.7.1.
            :type  prefix: :class:`long`
            :param prefix: CIDR prefix used to mask address. For example, an IPv4 prefix of 24
                ignores the low-order 8 bits of address. This attribute was added
                in vSphere API 6.7.1.
            :type  policy: :class:`Inbound.Policy`
            :param policy: The allow or deny policy of this rule. This attribute was added in
                vSphere API 6.7.1.
            :type  interface_name: :class:`str` or ``None``
            :param interface_name: The interface to which this rule applies. An empty string indicates
                that the rule applies to all interfaces. This attribute was added
                in vSphere API 6.7.1.
            """
            self.address = address
            self.prefix = prefix
            self.policy = policy
            self.interface_name = interface_name
            VapiStruct.__init__(self)


    Rule._set_binding_type(type.StructType(
        'com.vmware.appliance.networking.firewall.inbound.rule', {
            'address': type.StringType(),
            'prefix': type.IntegerType(),
            'policy': type.ReferenceType(__name__, 'Inbound.Policy'),
            'interface_name': type.OptionalType(type.StringType()),
        },
        Rule,
        False,
        None))



    def set(self,
            rules,
            ):
        """
        Set the ordered list of firewall rules to allow or deny traffic from
        one or more incoming IP addresses. This overwrites the existing
        firewall rules and creates a new rule list. Within the list of traffic
        rules, rules are processed in order of appearance, from top to bottom.
        For example, the list of rules can be as follows: 
        
        +------------+--------+----------------+--------+
        | Address    | Prefix | Interface Name | Policy |
        +============+========+================+========+
        | 10.112.0.1 | 0      | \*             | REJECT |
        +------------+--------+----------------+--------+
        | 10.112.0.1 | 0      | nic0           | ACCEPT |
        +------------+--------+----------------+--------+
        In the above example, the first rule drops all packets originating from
        10.112.0.1 and
        the second rule accepts all packets originating from 10.112.0.1 only on
        nic0. In effect, the second rule is always ignored which is not
        desired, hence the order has to be swapped. When a connection matches a
        firewall rule, further processing for the connection stops, and the
        appliance ignores any additional firewall rules you have set. This
        method was added in vSphere API 6.7.1.

        :type  rules: :class:`list` of :class:`Inbound.Rule`
        :param rules: List of address-based firewall rules.
        :raise: :class:`com.vmware.vapi.std.errors_client.Error` 
            Generic error
        """
        return self._invoke('set',
                            {
                            'rules': rules,
                            })

    def get(self):
        """
        Get the ordered list of firewall rules. Within the list of traffic
        rules, rules are processed in order of appearance, from top to bottom.
        When a connection matches a firewall rule, further processing for the
        connection stops, and the appliance ignores any additional firewall
        rules you have set. This method was added in vSphere API 6.7.1.


        :rtype: :class:`list` of :class:`Inbound.Rule`
        :return: List of address-based firewall rules.
        :raise: :class:`com.vmware.vapi.std.errors_client.Error` 
            Generic error
        """
        return self._invoke('get', None)
class ProactiveHAConfig(VapiStruct):
    """
    The ``ProactiveHAConfig`` class defines the Configuration of the vSphere
    InfraUpdateHA service on a cluster.

    .. tip::
        The arguments are used to initialize data attributes with the same
        names.
    """
    def __init__(
        self,
        enabled=None,
        automation_level=None,
        remediation=None,
        providers=None,
    ):
        """
        :type  enabled: :class:`bool` or ``None``
        :param enabled: Flag indicating whether or not the service is enabled.
            InfraUpdateHA will not be active, unless DRS is enabled as well.
            If None or empty, the value is skipped.
        :type  automation_level: :class:`ProactiveHAConfig.BehaviorType` or ``None``
        :param automation_level: Configured behavior. Values are of type
            InfraUpdateHaConfig.BehaviorType.
            If None or empty, the value is skipped.
        :type  remediation: :class:`ProactiveHAConfig.RemediationType` or ``None``
        :param remediation: Configured remediation for moderately degraded hosts. Values are of
            type InfraUpdateHaConfig.RemediationType.
            If None or empty, the value is skipped.
        :type  providers: :class:`list` of :class:`str` or ``None``
        :param providers: The list of health update providers configured for this cluster.
            Providers are identified by their id. If the provider list is
            empty, InfraUpdateHA will not be active.
            If None or empty, the value is skipped.
        """
        self.enabled = enabled
        self.automation_level = automation_level
        self.remediation = remediation
        self.providers = providers
        VapiStruct.__init__(self)

    class BehaviorType(Enum):
        """
        The ``ProactiveHAConfig.BehaviorType`` class defines the behavior for
        executing the proposed DRS recommendations.

        .. note::
            This class represents an enumerated type in the interface language
            definition. The class contains class attributes which represent the
            values in the current version of the enumerated type. Newer versions of
            the enumerated type may contain new values. To use new values of the
            enumerated type in communication with a server that supports the newer
            version of the API, you instantiate this class. See :ref:`enumerated
            type description page <enumeration_description>`.
        """
        MANUAL = None
        """
        With this behavior configured, the proposed DRS recommendations require
        manual approval before they are executed.

        """
        AUTOMATED = None
        """
        With this behavior configured, the proposed DRS recommendations are
        executed immediately.

        """
        def __init__(self, string):
            """
            :type  string: :class:`str`
            :param string: String value for the :class:`BehaviorType` instance.
            """
            Enum.__init__(string)

    BehaviorType._set_values([
        BehaviorType('MANUAL'),
        BehaviorType('AUTOMATED'),
    ])
    BehaviorType._set_binding_type(
        type.EnumType(
            'com.vmware.appliance.vcenter.settings.v1.config.components.inventory.cluster.drs.proactive_HA_config.behavior_type',
            BehaviorType))

    class RemediationType(Enum):
        """
        The ``ProactiveHAConfig.RemediationType`` class defines the types of
        remediation behaviours that can be configured.

        .. note::
            This class represents an enumerated type in the interface language
            definition. The class contains class attributes which represent the
            values in the current version of the enumerated type. Newer versions of
            the enumerated type may contain new values. To use new values of the
            enumerated type in communication with a server that supports the newer
            version of the API, you instantiate this class. See :ref:`enumerated
            type description page <enumeration_description>`.
        """
        QUARANTINE_MODE = None
        """
        With this behavior configured, a degraded host will be recommended to be
        placed in Quarantine Mode.

        """
        MAINTENANCE_MODE = None
        """
        With this behavior configured, a degraded host will be recommended to be
        placed in Maintenance Mode.

        """
        def __init__(self, string):
            """
            :type  string: :class:`str`
            :param string: String value for the :class:`RemediationType` instance.
            """
            Enum.__init__(string)

    RemediationType._set_values([
        RemediationType('QUARANTINE_MODE'),
        RemediationType('MAINTENANCE_MODE'),
    ])
    RemediationType._set_binding_type(
        type.EnumType(
            'com.vmware.appliance.vcenter.settings.v1.config.components.inventory.cluster.drs.proactive_HA_config.remediation_type',
            RemediationType))
class Service(VapiInterface):
    """
    The ``Service`` class provides methods to manage a single/set of services
    that are managed by vMon.
    """

    _VAPI_SERVICE_ID = 'com.vmware.appliance.vmon.service'
    """
    Identifier of the service in canonical form.
    """
    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, _ServiceStub)

    class StartupType(Enum):
        """
        The ``Service.StartupType`` class defines valid Startup Type for services
        managed by vMon.

        .. note::
            This class represents an enumerated type in the interface language
            definition. The class contains class attributes which represent the
            values in the current version of the enumerated type. Newer versions of
            the enumerated type may contain new values. To use new values of the
            enumerated type in communication with a server that supports the newer
            version of the API, you instantiate this class. See :ref:`enumerated
            type description page <enumeration_description>`.
        """
        MANUAL = None
        """
        Service Startup type is Manual, thus issuing an explicit start on the
        service will start it.

        """
        AUTOMATIC = None
        """
        Service Startup type is Automatic, thus during starting all services or
        issuing explicit start on the service will start it.

        """
        DISABLED = None
        """
        Service Startup type is Disabled, thus it will not start unless the startup
        type changes to manual or automatic.

        """

        def __init__(self, string):
            """
            :type  string: :class:`str`
            :param string: String value for the :class:`StartupType` instance.
            """
            Enum.__init__(string)

    StartupType._set_values([
        StartupType('MANUAL'),
        StartupType('AUTOMATIC'),
        StartupType('DISABLED'),
    ])
    StartupType._set_binding_type(type.EnumType(
        'com.vmware.appliance.vmon.service.startup_type',
        StartupType))


    class State(Enum):
        """
        The ``Service.State`` class defines valid Run State for services.

        .. note::
            This class represents an enumerated type in the interface language
            definition. The class contains class attributes which represent the
            values in the current version of the enumerated type. Newer versions of
            the enumerated type may contain new values. To use new values of the
            enumerated type in communication with a server that supports the newer
            version of the API, you instantiate this class. See :ref:`enumerated
            type description page <enumeration_description>`.
        """
        STARTING = None
        """
        Service Run State is Starting, it is still not functional

        """
        STOPPING = None
        """
        Service Run State is Stopping, it is not functional

        """
        STARTED = None
        """
        Service Run State is Started, it is fully functional

        """
        STOPPED = None
        """
        Service Run State is Stopped

        """

        def __init__(self, string):
            """
            :type  string: :class:`str`
            :param string: String value for the :class:`State` instance.
            """
            Enum.__init__(string)

    State._set_values([
        State('STARTING'),
        State('STOPPING'),
        State('STARTED'),
        State('STOPPED'),
    ])
    State._set_binding_type(type.EnumType(
        'com.vmware.appliance.vmon.service.state',
        State))


    class Health(Enum):
        """
        The ``Service.Health`` class defines the possible values for health of a
        service.

        .. note::
            This class represents an enumerated type in the interface language
            definition. The class contains class attributes which represent the
            values in the current version of the enumerated type. Newer versions of
            the enumerated type may contain new values. To use new values of the
            enumerated type in communication with a server that supports the newer
            version of the API, you instantiate this class. See :ref:`enumerated
            type description page <enumeration_description>`.
        """
        DEGRADED = None
        """
        Service is in degraded state, it is not functional.

        """
        HEALTHY = None
        """
        Service is in a healthy state and is fully functional.

        """
        HEALTHY_WITH_WARNINGS = None
        """
        Service is healthy with warnings.

        """

        def __init__(self, string):
            """
            :type  string: :class:`str`
            :param string: String value for the :class:`Health` instance.
            """
            Enum.__init__(string)

    Health._set_values([
        Health('DEGRADED'),
        Health('HEALTHY'),
        Health('HEALTHY_WITH_WARNINGS'),
    ])
    Health._set_binding_type(type.EnumType(
        'com.vmware.appliance.vmon.service.health',
        Health))


    class Info(VapiStruct):
        """
        The ``Service.Info`` class contains information about a service.

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

        _validator_list = [
            UnionValidator(
                'state',
                {
                    'STARTED' : [('health', True), ('health_messages', True)],
                    'STARTING' : [],
                    'STOPPING' : [],
                    'STOPPED' : [],
                }
            ),
        ]



        def __init__(self,
                     name_key=None,
                     description_key=None,
                     startup_type=None,
                     state=None,
                     health=None,
                     health_messages=None,
                    ):
            """
            :type  name_key: :class:`str`
            :param name_key: Service name key. Can be used to lookup resource bundle
            :type  description_key: :class:`str`
            :param description_key: Service description key. Can be used to lookup resource bundle
            :type  startup_type: :class:`Service.StartupType`
            :param startup_type: Startup Type.
            :type  state: :class:`Service.State`
            :param state: Running State.
            :type  health: :class:`Service.Health`
            :param health: Health of service.
                This attribute is optional and it is only relevant when the value
                of ``state`` is :attr:`Service.State.STARTED`.
            :type  health_messages: :class:`list` of :class:`com.vmware.vapi.std_client.LocalizableMessage`
            :param health_messages: Localizable messages associated with the health of the service
                This attribute is optional and it is only relevant when the value
                of ``state`` is :attr:`Service.State.STARTED`.
            """
            self.name_key = name_key
            self.description_key = description_key
            self.startup_type = startup_type
            self.state = state
            self.health = health
            self.health_messages = health_messages
            VapiStruct.__init__(self)


    Info._set_binding_type(type.StructType(
        'com.vmware.appliance.vmon.service.info', {
            'name_key': type.StringType(),
            'description_key': type.StringType(),
            'startup_type': type.ReferenceType(__name__, 'Service.StartupType'),
            'state': type.ReferenceType(__name__, 'Service.State'),
            'health': type.OptionalType(type.ReferenceType(__name__, 'Service.Health')),
            'health_messages': type.OptionalType(type.ListType(type.ReferenceType('com.vmware.vapi.std_client', 'LocalizableMessage'))),
        },
        Info,
        False,
        None))


    class UpdateSpec(VapiStruct):
        """
        The ``Service.UpdateSpec`` class describes the changes to be made to the
        configuration of the service.

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




        def __init__(self,
                     startup_type=None,
                    ):
            """
            :type  startup_type: :class:`Service.StartupType` or ``None``
            :param startup_type: Startup Type
                If unspecified, leaves value unchanged.
            """
            self.startup_type = startup_type
            VapiStruct.__init__(self)


    UpdateSpec._set_binding_type(type.StructType(
        'com.vmware.appliance.vmon.service.update_spec', {
            'startup_type': type.OptionalType(type.ReferenceType(__name__, 'Service.StartupType')),
        },
        UpdateSpec,
        False,
        None))



    def start(self,
              service,
              ):
        """
        Starts a service

        :type  service: :class:`str`
        :param service: identifier of the service to start
            The parameter must be an identifier for the resource type:
            ``com.vmware.appliance.vmon.Service``.
        :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` 
            if the service associated with ``service`` does not exist.
        :raise: :class:`com.vmware.vapi.std.errors_client.NotAllowedInCurrentState` 
            if the operation is denied in the current state of the service. If
            a stop or restart operation is in progress, the start operation
            will not be allowed.
        :raise: :class:`com.vmware.vapi.std.errors_client.NotAllowedInCurrentState` 
            if start operation is issued on a service which has startup type
            :attr:`Service.StartupType.DISABLED`.
        :raise: :class:`com.vmware.vapi.std.errors_client.TimedOut` 
            if any timeout occurs during the execution of the start operation.
            Timeout occurs when the service takes longer than StartTimeout to
            start.
        :raise: :class:`com.vmware.vapi.std.errors_client.Error` 
            if any other error occurs during the execution of the operation.
        """
        return self._invoke('start',
                            {
                            'service': service,
                            })

    def stop(self,
             service,
             ):
        """
        Stops a service

        :type  service: :class:`str`
        :param service: identifier of the service to stop
            The parameter must be an identifier for the resource type:
            ``com.vmware.appliance.vmon.Service``.
        :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` 
            if the service associated with ``service`` does not exist.
        :raise: :class:`com.vmware.vapi.std.errors_client.Error` 
            if any other error occurs during the execution of the operation.
        :raise: :class:`com.vmware.vapi.std.errors_client.NotAllowedInCurrentState` 
            if the operation is denied in the current state of the service. If
            a stop operation is in progress, issuing another stop operation
            will lead to this error.
        """
        return self._invoke('stop',
                            {
                            'service': service,
                            })

    def restart(self,
                service,
                ):
        """
        Restarts a service

        :type  service: :class:`str`
        :param service: identifier of the service to restart
            The parameter must be an identifier for the resource type:
            ``com.vmware.appliance.vmon.Service``.
        :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` 
            if the service associated with ``service`` does not exist.
        :raise: :class:`com.vmware.vapi.std.errors_client.TimedOut` 
            if any timeout occurs during the execution of the restart
            operation.
        :raise: :class:`com.vmware.vapi.std.errors_client.NotAllowedInCurrentState` 
            if the operation is denied in the current state of the service. If
            a stop or start operation is in progress, issuing a restart
            operation will lead to this error.
        :raise: :class:`com.vmware.vapi.std.errors_client.NotAllowedInCurrentState` 
            if a restart operation is issued on a service which has startup
            type :attr:`Service.StartupType.DISABLED`
        :raise: :class:`com.vmware.vapi.std.errors_client.Error` 
            if any other error occurs during the execution of the operation.
        """
        return self._invoke('restart',
                            {
                            'service': service,
                            })

    def get(self,
            service,
            ):
        """
        Returns the state of a service.

        :type  service: :class:`str`
        :param service: identifier of the service whose state is being queried.
            The parameter must be an identifier for the resource type:
            ``com.vmware.appliance.vmon.Service``.
        :rtype: :class:`Service.Info`
        :return: Service Info structure.
        :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` 
            if the service associated with ``service`` does not exist.
        :raise: :class:`com.vmware.vapi.std.errors_client.Error` 
            if any other error occurs during the execution of the operation.
        """
        return self._invoke('get',
                            {
                            'service': service,
                            })

    def update(self,
               service,
               spec,
               ):
        """
        Updates the properties of a service.

        :type  service: :class:`str`
        :param service: identifier of the service whose properties are being updated.
            The parameter must be an identifier for the resource type:
            ``com.vmware.appliance.vmon.Service``.
        :type  spec: :class:`Service.UpdateSpec`
        :param spec: Service Update specification.
        :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` 
            if the service associated with ``service`` does not exist.
        :raise: :class:`com.vmware.vapi.std.errors_client.Error` 
            if any other error occurs during the execution of the operation.
        :raise: :class:`com.vmware.vapi.std.errors_client.NotAllowedInCurrentState` 
            if the operation is denied in the current state of the service. If
            a start, stop or restart operation is in progress, update operation
            will fail with this error.
        :raise: :class:`com.vmware.vapi.std.errors_client.NotAllowedInCurrentState` 
            if a request to set the :attr:`Service.UpdateSpec.startup_type`
            attribute of ``spec`` to :attr:`Service.StartupType.DISABLED` comes
            in for a service that is not in :attr:`Service.State.STOPPED`
            state.
        """
        return self._invoke('update',
                            {
                            'service': service,
                            'spec': spec,
                            })

    def list_details(self):
        """
        Lists details of services managed by vMon.


        :rtype: :class:`dict` of :class:`str` and :class:`Service.Info`
        :return: Map of service identifiers to service Info structures.
            The key in the return value :class:`dict` will be an identifier for
            the resource type: ``com.vmware.appliance.vmon.Service``.
        :raise: :class:`com.vmware.vapi.std.errors_client.Error` 
            if any error occurs during the execution of the operation.
        """
        return self._invoke('list_details', None)
Exemple #24
0
class Compliance(VapiInterface):
    """
    The Compliance class provides methods related to all the associated
    entities of given compliance statuses. This class was added in vSphere API
    6.7.
    """

    _VAPI_SERVICE_ID = 'com.vmware.vcenter.storage.policies.compliance'
    """
    Identifier of the service in canonical form.
    """
    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, _ComplianceStub)
        self._VAPI_OPERATION_IDS = {}

    class Status(Enum):
        """
        This enumeration defines the set of status values for a compliance
        operation. This enumeration was added in vSphere API 6.7.

        .. note::
            This class represents an enumerated type in the interface language
            definition. The class contains class attributes which represent the
            values in the current version of the enumerated type. Newer versions of
            the enumerated type may contain new values. To use new values of the
            enumerated type in communication with a server that supports the newer
            version of the API, you instantiate this class. See :ref:`enumerated
            type description page <enumeration_description>`.
        """
        COMPLIANT = None
        """
        Entity is in compliance. This class attribute was added in vSphere API 6.7.

        """
        NON_COMPLIANT = None
        """
        Entity is out of compliance. This class attribute was added in vSphere API
        6.7.

        """
        UNKNOWN = None
        """
        Compliance status of the entity is not known. This class attribute was
        added in vSphere API 6.7.

        """
        NOT_APPLICABLE = None
        """
        Compliance computation is not applicable for this entity because it does
        not have any storage requirement that apply to the object-based datastore
        on which the entity is placed. This class attribute was added in vSphere
        API 6.7.

        """
        OUT_OF_DATE = None
        """
        Compliance status becomes out of date when the profile associated with the
        entity is edited and not applied. The compliance status will remain out of
        date until the latest policy is applied to the entity. This class attribute
        was added in vSphere API 6.7.

        """
        def __init__(self, string):
            """
            :type  string: :class:`str`
            :param string: String value for the :class:`Status` instance.
            """
            Enum.__init__(string)

    Status._set_values([
        Status('COMPLIANT'),
        Status('NON_COMPLIANT'),
        Status('UNKNOWN'),
        Status('NOT_APPLICABLE'),
        Status('OUT_OF_DATE'),
    ])
    Status._set_binding_type(
        type.EnumType('com.vmware.vcenter.storage.policies.compliance.status',
                      Status))

    class Summary(VapiStruct):
        """
        Provides the details of a virtual machine and its associated entities which
        match the given compliance statuses. This class was added in vSphere API
        6.7.

        .. tip::
            The arguments are used to initialize data attributes with the same
            names.
        """
        def __init__(
            self,
            vm=None,
            vm_home=None,
            disks=None,
        ):
            """
            :type  vm: :class:`str`
            :param vm: Identifier of virtual machine. This attribute was added in vSphere
                API 6.7.
                When clients pass a value of this class as a parameter, the
                attribute must be an identifier for the resource type:
                ``VirtualMachine``. When methods return a value of this class as a
                return value, the attribute will be an identifier for the resource
                type: ``VirtualMachine``.
            :type  vm_home: :class:`Compliance.Status` or ``None``
            :param vm_home: Compliance status of the virtual machine home. This attribute was
                added in vSphere API 6.7.
                If None or empty, vmHome is not associated with a storage policy.
            :type  disks: (:class:`dict` of :class:`str` and :class:`Compliance.Status`) or ``None``
            :param disks: List of the virtual hard disk. This attribute was added in vSphere
                API 6.7.
                When clients pass a value of this class as a parameter, the key in
                the attribute :class:`dict` must be an identifier for the resource
                type: ``com.vmware.vcenter.vm.hardware.Disk``. When methods return
                a value of this class as a return value, the key in the attribute
                :class:`dict` will be an identifier for the resource type:
                ``com.vmware.vcenter.vm.hardware.Disk``.
                If None or empty, virtual machine entity does not have any disks or
                its disks are not associated with a storage policy.
            """
            self.vm = vm
            self.vm_home = vm_home
            self.disks = disks
            VapiStruct.__init__(self)

    Summary._set_binding_type(
        type.StructType(
            'com.vmware.vcenter.storage.policies.compliance.summary', {
                'vm':
                type.IdType(resource_types='VirtualMachine'),
                'vm_home':
                type.OptionalType(
                    type.ReferenceType(__name__, 'Compliance.Status')),
                'disks':
                type.OptionalType(
                    type.MapType(
                        type.IdType(),
                        type.ReferenceType(__name__, 'Compliance.Status'))),
            }, Summary, False, None))

    class FilterSpec(VapiStruct):
        """
        The ``Compliance.FilterSpec`` class contains complianceStatus used to
        filter the results when listing entities (see :func:`Compliance.list`).
        This class was added in vSphere API 6.7.

        .. tip::
            The arguments are used to initialize data attributes with the same
            names.
        """
        def __init__(
            self,
            status=None,
        ):
            """
            :type  status: :class:`set` of :class:`Compliance.Status`
            :param status: Compliance Status that a virtual machine must have to match the
                filter. This attribute was added in vSphere API 6.7.
            """
            self.status = status
            VapiStruct.__init__(self)

    FilterSpec._set_binding_type(
        type.StructType(
            'com.vmware.vcenter.storage.policies.compliance.filter_spec', {
                'status':
                type.SetType(type.ReferenceType(__name__,
                                                'Compliance.Status')),
            }, FilterSpec, False, None))

    def list(
        self,
        filter,
    ):
        """
        Returns compliance information about entities matching the filter
        :class:`Compliance.FilterSpec`. Entities without storage policy
        association are not returned. This method was added in vSphere API 6.7.

        :type  filter: :class:`Compliance.FilterSpec`
        :param filter: compliance status of matching entities for which information should
            be returned.
        :rtype: :class:`list` of :class:`Compliance.Summary`
        :return: compliance information about entities matching the filter
            :class:`Compliance.FilterSpec`.
        :raise: :class:`com.vmware.vapi.std.errors_client.Error` 
            if the system reports an error while responding to the request.
        :raise: :class:`com.vmware.vapi.std.errors_client.InvalidArgument` 
            if the :attr:`Compliance.FilterSpec.status` attribute contains a
            value that is not supported by the server.
        :raise: :class:`com.vmware.vapi.std.errors_client.ServiceUnavailable` 
            if the system is unable to communicate with a service to complete
            the request.
        :raise: :class:`com.vmware.vapi.std.errors_client.Unauthenticated` 
            if the user can not be authenticated.
        :raise: :class:`com.vmware.vapi.std.errors_client.Unauthorized` 
            if the user doesn't have the required privileges.
        """
        return self._invoke('list', {
            'filter': filter,
        })
Exemple #25
0
class Forwarding(VapiInterface):
    """
    The ``Forwarding`` class provides methods to manage forwarding of log
    messages to remote logging servers. This class was added in vSphere API
    6.7.
    """

    _VAPI_SERVICE_ID = 'com.vmware.appliance.logging.forwarding'
    """
    Identifier of the service in canonical form.
    """
    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, _ForwardingStub)
        self._VAPI_OPERATION_IDS = {}

    class Protocol(Enum):
        """
        The ``Forwarding.Protocol`` class defines transport protocols for outbound
        log messages. This enumeration was added in vSphere API 6.7.

        .. note::
            This class represents an enumerated type in the interface language
            definition. The class contains class attributes which represent the
            values in the current version of the enumerated type. Newer versions of
            the enumerated type may contain new values. To use new values of the
            enumerated type in communication with a server that supports the newer
            version of the API, you instantiate this class. See :ref:`enumerated
            type description page <enumeration_description>`.
        """
        TLS = None
        """
        Log messages will be forwarded to the remote host by using the TLS
        protocol. This class attribute was added in vSphere API 6.7.

        """
        UDP = None
        """
        Log messages will be forwarded to the remote host using the UDP protocol.
        This class attribute was added in vSphere API 6.7.

        """
        TCP = None
        """
        Log messages will be forwarded to the remote host using the TCP protocol.
        This class attribute was added in vSphere API 6.7.

        """

        def __init__(self, string):
            """
            :type  string: :class:`str`
            :param string: String value for the :class:`Protocol` instance.
            """
            Enum.__init__(string)

    Protocol._set_values([
        Protocol('TLS'),
        Protocol('UDP'),
        Protocol('TCP'),
    ])
    Protocol._set_binding_type(type.EnumType(
        'com.vmware.appliance.logging.forwarding.protocol',
        Protocol))


    class Config(VapiStruct):
        """
        The ``Forwarding.Config`` class defines the configuration for log message
        forwarding to remote logging servers. This class was added in vSphere API
        6.7.

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




        def __init__(self,
                     hostname=None,
                     port=None,
                     protocol=None,
                    ):
            """
            :type  hostname: :class:`str`
            :param hostname: FQDN or IP address of the logging server to which messages are
                forwarded. This attribute was added in vSphere API 6.7.
            :type  port: :class:`long`
            :param port: The port on which the remote logging server is listening for
                forwarded log messages. This attribute was added in vSphere API
                6.7.
            :type  protocol: :class:`Forwarding.Protocol`
            :param protocol: Transport protocol used to forward log messages. This attribute was
                added in vSphere API 6.7.
            """
            self.hostname = hostname
            self.port = port
            self.protocol = protocol
            VapiStruct.__init__(self)


    Config._set_binding_type(type.StructType(
        'com.vmware.appliance.logging.forwarding.config', {
            'hostname': type.StringType(),
            'port': type.IntegerType(),
            'protocol': type.ReferenceType(__name__, 'Forwarding.Protocol'),
        },
        Config,
        False,
        None))


    class ConnectionStatus(VapiStruct):
        """


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

        _validator_list = [
            UnionValidator(
                'state',
                {
                    'DOWN' : [('message', False)],
                    'UP' : [],
                    'UNKNOWN' : [],
                }
            ),
        ]



        def __init__(self,
                     hostname=None,
                     state=None,
                     message=None,
                    ):
            """
            :type  hostname: :class:`str`
            :param hostname: FQDN or IP address of the configured remote logging servers. This
                attribute was added in vSphere API 6.7.
            :type  state: :class:`Forwarding.ConnectionStatus.State`
            :param state: State of the configured remote logging server. This attribute was
                added in vSphere API 6.7.
            :type  message: :class:`com.vmware.vapi.std_client.LocalizableMessage` or ``None``
            :param message: Message associated with the state of the configured remote logging
                server. This attribute was added in vSphere API 6.7.
                If None, there is no message to be shown.
            """
            self.hostname = hostname
            self.state = state
            self.message = message
            VapiStruct.__init__(self)


        class State(Enum):
            """
            The ``Forwarding.ConnectionStatus.State`` class defines the state values
            that a remote logging server can be in. This enumeration was added in
            vSphere API 6.7.

            .. note::
                This class represents an enumerated type in the interface language
                definition. The class contains class attributes which represent the
                values in the current version of the enumerated type. Newer versions of
                the enumerated type may contain new values. To use new values of the
                enumerated type in communication with a server that supports the newer
                version of the API, you instantiate this class. See :ref:`enumerated
                type description page <enumeration_description>`.
            """
            UP = None
            """
            The remote logging server is reachable. This class attribute was added in
            vSphere API 6.7.

            """
            DOWN = None
            """
            The remote logging server is not reachable. This class attribute was added
            in vSphere API 6.7.

            """
            UNKNOWN = None
            """
            The status of remote logging server is unknown. This class attribute was
            added in vSphere API 6.7.

            """

            def __init__(self, string):
                """
                :type  string: :class:`str`
                :param string: String value for the :class:`State` instance.
                """
                Enum.__init__(string)

        State._set_values([
            State('UP'),
            State('DOWN'),
            State('UNKNOWN'),
        ])
        State._set_binding_type(type.EnumType(
            'com.vmware.appliance.logging.forwarding.connection_status.state',
            State))

    ConnectionStatus._set_binding_type(type.StructType(
        'com.vmware.appliance.logging.forwarding.connection_status', {
            'hostname': type.StringType(),
            'state': type.ReferenceType(__name__, 'Forwarding.ConnectionStatus.State'),
            'message': type.OptionalType(type.ReferenceType('com.vmware.vapi.std_client', 'LocalizableMessage')),
        },
        ConnectionStatus,
        False,
        None))



    def test(self,
             send_test_message=None,
             ):
        """
        Validates the current log forwarding configuration by checking the
        liveness of the remote machine and optionally sending a test diagnostic
        log message from the appliance to all configured logging servers to
        allow manual end-to-end validation. The message that is sent is: "This
        is a diagnostic log test message from vCenter Server.". This method was
        added in vSphere API 6.7.

        :type  send_test_message: :class:`bool` or ``None``
        :param send_test_message: Flag specifying whether a default test message should be sent to
            the configured logging servers.
            If None, no test message will be sent to the configured remote
            logging servers.
        :rtype: :class:`list` of :class:`Forwarding.ConnectionStatus`
        :return: Information about the status of the connection to each of the
            remote logging servers.
        """
        return self._invoke('test',
                            {
                            'send_test_message': send_test_message,
                            })

    def set(self,
            cfg_list,
            ):
        """
        Sets the configuration for forwarding log messages to remote log
        servers. This method was added in vSphere API 6.7.

        :type  cfg_list: :class:`list` of :class:`Forwarding.Config`
        :param cfg_list: The cfgList is a list of Config structure that contains the log
            message forwarding rules in terms of the host, port, protocol of
            the log message.
        :raise: :class:`com.vmware.vapi.std.errors_client.InvalidArgument` 
            if an invalid configuration is provided.
        :raise: :class:`com.vmware.vapi.std.errors_client.UnableToAllocateResource` 
            if the number of configurations exceeds the maximum number of
            supported configurations.
        :raise: :class:`com.vmware.vapi.std.errors_client.Error` 
            if there is any internal error during the execution of the
            operation.
        """
        return self._invoke('set',
                            {
                            'cfg_list': cfg_list,
                            })

    def get(self):
        """
        Returns the configuration for forwarding log messages to remote logging
        servers. This method was added in vSphere API 6.7.


        :rtype: :class:`list` of :class:`Forwarding.Config`
        :return: Information about the configuration for forwarding log messages to
            remote logging servers.
        """
        return self._invoke('get', None)
class Shares(VapiStruct):
    """
    The ``Shares`` class provides specification of shares. 
    
    Shares are used to determine relative allocation between resource
    consumers. In general, a consumer with more shares gets proportionally more
    of the resource, subject to certain other constraints.

    .. tip::
        The arguments are used to initialize data attributes with the same
        names.
    """
    def __init__(
        self,
        level=None,
        shares=None,
    ):
        """
        :type  level: :class:`Shares.Level`
        :param level: The allocation level. It maps to a pre-determined set of numeric
            values for shares. If the shares value does not map to a predefined
            size, then the level is set as CUSTOM.
        :type  shares: :class:`long`
        :param shares: When :attr:`Shares.level` is set to CUSTOM, it is the number of
            shares allocated. Otherwise, this value is ignored. 
            
            There is no unit for this value. It is a relative measure based on
            the settings for other resource pools.
        """
        self.level = level
        self.shares = shares
        VapiStruct.__init__(self)

    class Level(Enum):
        """
        The ``Shares.Level`` class defines the possible values for the allocation
        level.

        .. note::
            This class represents an enumerated type in the interface language
            definition. The class contains class attributes which represent the
            values in the current version of the enumerated type. Newer versions of
            the enumerated type may contain new values. To use new values of the
            enumerated type in communication with a server that supports the newer
            version of the API, you instantiate this class. See :ref:`enumerated
            type description page <enumeration_description>`.
        """
        LOW = None
        """
        For CPU: Shares = 500 \* number of virtual CPUs.
         For Memory: Shares = 5 \* virtual machine memory size in MB.

        """
        NORMAL = None
        """
        For CPU: Shares = 1000 \* number of virtual CPUs.
         For Memory: Shares = 10 \* virtual machine memory size in MB.

        """
        HIGH = None
        """
        For CPU: Shares = 2000 \* nmumber of virtual CPUs.
         For Memory: Shares = 20 \* virtual machine memory size in MB.

        """
        CUSTOM = None
        """
        If :class:`set`, in case there is resource contention the server uses the
        shares value to determine the resource allocation.

        """
        def __init__(self, string):
            """
            :type  string: :class:`str`
            :param string: String value for the :class:`Level` instance.
            """
            Enum.__init__(string)

    Level._set_values([
        Level('LOW'),
        Level('NORMAL'),
        Level('HIGH'),
        Level('CUSTOM'),
    ])
    Level._set_binding_type(
        type.EnumType(
            'com.vmware.appliance.vcenter.settings.v1.config.components.inventory.resourcepool.shares.level',
            Level))
class PreviewInfo(VapiStruct):
    """
    The ``PreviewInfo`` class contains information about the files being
    uploaded in the update session. This class was added in vSphere API 6.8.

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

    _validator_list = [
        UnionValidator(
            'state', {
                'AVAILABLE': [('certificate_info', False), ('warnings', True)],
                'UNAVAILABLE': [],
                'NOT_APPLICABLE': [],
                'PREPARING': [],
            }),
    ]

    def __init__(
        self,
        state=None,
        certificate_info=None,
        warnings=None,
    ):
        """
        :type  state: :class:`PreviewInfo.State`
        :param state: Indicates the state of the preview of the update session. This
            attribute was added in vSphere API 6.8.
        :type  certificate_info: :class:`CertificateInfo` or ``None``
        :param certificate_info: The certificate information of the signed update session content.
            This attribute was added in vSphere API 6.8.
            This attribute is None if the update session content is not signed.
        :type  warnings: :class:`list` of :class:`PreviewWarningInfo`
        :param warnings: The list of warnings raised for this update session. Any warning
            which is not ignored by the client will, by default, fail the
            update session during session complete operation. This attribute
            was added in vSphere API 6.8.
            This attribute is optional and it is only relevant when the value
            of ``state`` is :attr:`PreviewInfo.State.AVAILABLE`.
        """
        self.state = state
        self.certificate_info = certificate_info
        self.warnings = warnings
        VapiStruct.__init__(self)

    class State(Enum):
        """
        The ``PreviewInfo.State`` class defines the state of the update session's
        preview. This enumeration was added in vSphere API 6.8.

        .. note::
            This class represents an enumerated type in the interface language
            definition. The class contains class attributes which represent the
            values in the current version of the enumerated type. Newer versions of
            the enumerated type may contain new values. To use new values of the
            enumerated type in communication with a server that supports the newer
            version of the API, you instantiate this class. See :ref:`enumerated
            type description page <enumeration_description>`.
        """
        UNAVAILABLE = None
        """
        There are no files in the update session OR a preview is not possible for
        the files currently in the update session. However, preview may be possible
        after metadata files such as OVF descriptor are added to the session. In
        this case the state will transition to ``PREPARING``. This class attribute
        was added in vSphere API 6.8.

        """
        NOT_APPLICABLE = None
        """
        Preview is not possible for this update session. This state is reached when
        there are no metadata files in the update session and user invokes a
        session complete operation. This class attribute was added in vSphere API
        6.8.

        """
        PREPARING = None
        """
        A preview is being prepared for the files currently in the update session.
        This state is reached when the applicable metadata files are added to the
        update session but their content is not fully uploaded yet. For OVF item
        type, this state indicates that the OVF descriptor file is currently being
        uploaded. This class attribute was added in vSphere API 6.8.

        """
        AVAILABLE = None
        """
        Preview is available for this update session. It is possible to review
        certificate details and warnings, if any. This state is reached when the
        applicable metadata files in the session have been fully uploaded. This
        class attribute was added in vSphere API 6.8.

        """
        def __init__(self, string):
            """
            :type  string: :class:`str`
            :param string: String value for the :class:`State` instance.
            """
            Enum.__init__(string)

    State._set_values([
        State('UNAVAILABLE'),
        State('NOT_APPLICABLE'),
        State('PREPARING'),
        State('AVAILABLE'),
    ])
    State._set_binding_type(
        type.EnumType(
            'com.vmware.content.library.item.updatesession.preview_info.state',
            State))
Exemple #28
0
    def __init__(self, string):
        """
        :type  string: :class:`str`
        :param string: String value for the :class:`MaintenanceModeState` instance.
        """
        Enum.__init__(string)


MaintenanceModeState._set_values([
    MaintenanceModeState('NORMAL'),
    MaintenanceModeState('ENTERING_MAINTENANCE'),
    MaintenanceModeState('IN_MAINTENANCE'),
])
MaintenanceModeState._set_binding_type(
    type.EnumType(
        'com.vmware.appliance.vcenter.settings.v1.config.components.inventory.datastore.maintenance_mode_state',
        MaintenanceModeState))


class Datastore(VapiStruct):
    """
    ``Datastore`` class defines the spec for datastore configurations in
    vCenter Server.

    .. tip::
        The arguments are used to initialize data attributes with the same
        names.
    """
    def __init__(
        self,
        name=None,
    def __init__(self, string):
        """
        :type  string: :class:`str`
        :param string: String value for the :class:`Status` instance.
        """
        Enum.__init__(string)

Status._set_values([
    Status('PENDING'),
    Status('RUNNING'),
    Status('BLOCKED'),
    Status('SUCCEEDED'),
    Status('FAILED'),
])
Status._set_binding_type(type.EnumType(
    'com.vmware.cis.task.status',
    Status))




class Progress(VapiStruct):
    """
    The ``Progress`` class contains information describe the progress of an
    operation.

    .. tip::
        The arguments are used to initialize data attributes with the same
        names.
    """
Exemple #30
0
class Power(VapiInterface):
    """
    The ``Power`` class provides methods for managing the guest operating
    system power state of a virtual machine. This class was added in vSphere
    API 6.7.
    """

    _VAPI_SERVICE_ID = 'com.vmware.vcenter.vm.guest.power'
    """
    Identifier of the service in canonical form.
    """
    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, _PowerStub)
        self._VAPI_OPERATION_IDS = {}

    class State(Enum):
        """
        Possible guest power states. This enumeration was added in vSphere API 6.7.

        .. note::
            This class represents an enumerated type in the interface language
            definition. The class contains class attributes which represent the
            values in the current version of the enumerated type. Newer versions of
            the enumerated type may contain new values. To use new values of the
            enumerated type in communication with a server that supports the newer
            version of the API, you instantiate this class. See :ref:`enumerated
            type description page <enumeration_description>`.
        """
        RUNNING = None
        """
        The guest OS is running. This class attribute was added in vSphere API 6.7.

        """
        SHUTTING_DOWN = None
        """
        The guest OS is shutting down. This class attribute was added in vSphere
        API 6.7.

        """
        RESETTING = None
        """
        The guest OS is resetting. This class attribute was added in vSphere API
        6.7.

        """
        STANDBY = None
        """
        The guest OS is in standby. This class attribute was added in vSphere API
        6.7.

        """
        NOT_RUNNING = None
        """
        The guest OS is not running. This class attribute was added in vSphere API
        6.7.

        """
        UNAVAILABLE = None
        """
        The guest OS power state is unknown. This class attribute was added in
        vSphere API 6.7.

        """
        def __init__(self, string):
            """
            :type  string: :class:`str`
            :param string: String value for the :class:`State` instance.
            """
            Enum.__init__(string)

    State._set_values([
        State('RUNNING'),
        State('SHUTTING_DOWN'),
        State('RESETTING'),
        State('STANDBY'),
        State('NOT_RUNNING'),
        State('UNAVAILABLE'),
    ])
    State._set_binding_type(
        type.EnumType('com.vmware.vcenter.vm.guest.power.state', State))

    class Info(VapiStruct):
        """
        Information about the guest operating system power state. This class was
        added in vSphere API 6.7.

        .. tip::
            The arguments are used to initialize data attributes with the same
            names.
        """
        def __init__(
            self,
            state=None,
            operations_ready=None,
        ):
            """
            :type  state: :class:`Power.State`
            :param state: The power state of the guest operating system. This attribute was
                added in vSphere API 6.7.
            :type  operations_ready: :class:`bool`
            :param operations_ready: Flag indicating if the virtual machine is ready to process soft
                power operations. This attribute was added in vSphere API 6.7.
            """
            self.state = state
            self.operations_ready = operations_ready
            VapiStruct.__init__(self)

    Info._set_binding_type(
        type.StructType(
            'com.vmware.vcenter.vm.guest.power.info', {
                'state': type.ReferenceType(__name__, 'Power.State'),
                'operations_ready': type.BooleanType(),
            }, Info, False, None))

    def get(
        self,
        vm,
    ):
        """
        Returns information about the guest operating system power state. This
        method was added in vSphere API 6.7.

        :type  vm: :class:`str`
        :param vm: Identifier of the virtual machine.
            The parameter must be an identifier for the resource type:
            ``VirtualMachine``.
        :rtype: :class:`Power.Info`
        :return: Guest OS powerstate information.
        :raise: :class:`com.vmware.vapi.std.errors_client.Error` 
            if the system reports an error while responding to the request.
        :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` 
            if the virtual machine is not found.
        """
        return self._invoke('get', {
            'vm': vm,
        })

    def shutdown(
        self,
        vm,
    ):
        """
        Issues a request to the guest operating system asking it to perform a
        clean shutdown of all services. This request returns immediately and
        does not wait for the guest operating system to complete the operation.
        This method was added in vSphere API 6.7.

        :type  vm: :class:`str`
        :param vm: Identifier of the virtual machine.
            The parameter must be an identifier for the resource type:
            ``VirtualMachine``.
        :raise: :class:`com.vmware.vapi.std.errors_client.Error` 
            if the system reports an error while responding to the request.
        :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` 
            if the virtual machine is not found.
        :raise: :class:`com.vmware.vapi.std.errors_client.AlreadyInDesiredState` 
            if the virtual machine is not powered on.
        :raise: :class:`com.vmware.vapi.std.errors_client.ServiceUnavailable` 
            if VMware Tools is not running.
        :raise: :class:`com.vmware.vapi.std.errors_client.NotAllowedInCurrentState` 
            if the virtual machine is suspended.
        :raise: :class:`com.vmware.vapi.std.errors_client.ResourceBusy` 
            if the virtual machine is performing another operation.
        :raise: :class:`com.vmware.vapi.std.errors_client.Unsupported` 
            if the virtual machine does not support being powered on (e.g.
            marked as a template, serving as a fault-tolerance secondary
            virtual machine).
        """
        return self._invoke('shutdown', {
            'vm': vm,
        })

    def reboot(
        self,
        vm,
    ):
        """
        Issues a request to the guest operating system asking it to perform a
        reboot. This request returns immediately and does not wait for the
        guest operating system to complete the operation. This method was added
        in vSphere API 6.7.

        :type  vm: :class:`str`
        :param vm: Identifier of the virtual machine.
            The parameter must be an identifier for the resource type:
            ``VirtualMachine``.
        :raise: :class:`com.vmware.vapi.std.errors_client.Error` 
            if the system reports an error while responding to the request.
        :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` 
            if the virtual machine is not found.
        :raise: :class:`com.vmware.vapi.std.errors_client.NotAllowedInCurrentState` 
            if the virtual machine is not powered on.
        :raise: :class:`com.vmware.vapi.std.errors_client.ServiceUnavailable` 
            if VMware Tools is not running.
        :raise: :class:`com.vmware.vapi.std.errors_client.ResourceBusy` 
            if the virtual machine is performing another operation.
        :raise: :class:`com.vmware.vapi.std.errors_client.Unsupported` 
            if the virtual machine does not support being powered on (e.g.
            marked as a template, serving as a fault-tolerance secondary
            virtual machine).
        """
        return self._invoke('reboot', {
            'vm': vm,
        })

    def standby(
        self,
        vm,
    ):
        """
        Issues a request to the guest operating system asking it to perform a
        suspend operation. This method was added in vSphere API 6.7.

        :type  vm: :class:`str`
        :param vm: Identifier of the virtual machine.
            The parameter must be an identifier for the resource type:
            ``VirtualMachine``.
        :raise: :class:`com.vmware.vapi.std.errors_client.Error` 
            if the system reports an error while responding to the request.
        :raise: :class:`com.vmware.vapi.std.errors_client.AlreadyInDesiredState` 
            if the virtual machine is suspended.
        :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` 
            if the virtual machine is not found.
        :raise: :class:`com.vmware.vapi.std.errors_client.ServiceUnavailable` 
            if VMware Tools is not running.
        :raise: :class:`com.vmware.vapi.std.errors_client.NotAllowedInCurrentState` 
            if the virtual machine is not powered on.
        :raise: :class:`com.vmware.vapi.std.errors_client.ResourceBusy` 
            if the virtual machine is performing another operation.
        :raise: :class:`com.vmware.vapi.std.errors_client.Unsupported` 
            if the virtual machine does not support being powered on (e.g.
            marked as a template, serving as a fault-tolerance secondary
            virtual machine).
        """
        return self._invoke('standby', {
            'vm': vm,
        })