コード例 #1
0
class Versions(VapiInterface):
    """
    The ``Versions`` class provides methods to get versions of base-images from
    the sync'ed and imported depots.
    """

    _VAPI_SERVICE_ID = 'com.vmware.esx.settings.depot_content.base_images.versions'
    """
    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, _VersionsStub)
        self._VAPI_OPERATION_IDS = {}

    class CategoryType(Enum):
        """
        The ``Versions.CategoryType`` class defines possible values of categories
        for a base-image.

        .. 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
        """
        Security

        """
        ENHANCEMENT = None
        """
        Enhancement

        """
        BUGFIX = None
        """
        Bugfix

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

    CategoryType._set_values([
        CategoryType('SECURITY'),
        CategoryType('ENHANCEMENT'),
        CategoryType('BUGFIX'),
    ])
    CategoryType._set_binding_type(
        type.EnumType(
            'com.vmware.esx.settings.depot_content.base_images.versions.category_type',
            CategoryType))

    class ComponentVersionInfo(VapiStruct):
        """
        The ``Versions.ComponentVersionInfo`` class defines the information
        regarding a component present inbase-image.

        .. tip::
            The arguments are used to initialize data attributes with the same
            names.
        """
        def __init__(
            self,
            name=None,
            display_name=None,
            version=None,
            display_version=None,
        ):
            """
            :type  name: :class:`str`
            :param name: Identifier of the component.
                When clients pass a value of this class as a parameter, the
                attribute must be an identifier for the resource type:
                ``com.vmware.esx.settings.component``. When methods return a value
                of this class as a return value, the attribute will be an
                identifier for the resource type:
                ``com.vmware.esx.settings.component``.
            :type  display_name: :class:`str`
            :param display_name: Display name of the component.
            :type  version: :class:`str`
            :param version: Version of the component.
            :type  display_version: :class:`str`
            :param display_version: Human readable version of the base-image.
            """
            self.name = name
            self.display_name = display_name
            self.version = version
            self.display_version = display_version
            VapiStruct.__init__(self)

    ComponentVersionInfo._set_binding_type(
        type.StructType(
            'com.vmware.esx.settings.depot_content.base_images.versions.component_version_info',
            {
                'name':
                type.IdType(
                    resource_types='com.vmware.esx.settings.component'),
                'display_name':
                type.StringType(),
                'version':
                type.StringType(),
                'display_version':
                type.StringType(),
            }, ComponentVersionInfo, False, None))

    class Info(VapiStruct):
        """
        The ``Versions.Info`` class defines the information regarding a base-image.

        .. tip::
            The arguments are used to initialize data attributes with the same
            names.
        """
        def __init__(
            self,
            display_name=None,
            version=None,
            display_version=None,
            summary=None,
            description=None,
            category=None,
            kb=None,
            release_date=None,
            components=None,
        ):
            """
            :type  display_name: :class:`str`
            :param display_name: Display name of the base-image.
            :type  version: :class:`str`
            :param version: Version of the base-image.
                When clients pass a value of this class as a parameter, the
                attribute must be an identifier for the resource type:
                ``com.vmware.esx.settings.base_image``. When methods return a value
                of this class as a return value, the attribute will be an
                identifier for the resource type:
                ``com.vmware.esx.settings.base_image``.
            :type  display_version: :class:`str`
            :param display_version: Human readable version of the base-image.
            :type  summary: :class:`str`
            :param summary: Summary of the base-image.
            :type  description: :class:`str`
            :param description: Discription of the base-image.
            :type  category: :class:`Versions.CategoryType`
            :param category: Category of the base-image.
            :type  kb: :class:`str`
            :param kb: Link to kb article related to this the base-image.
            :type  release_date: :class:`datetime.datetime`
            :param release_date: Release date of the base-image.
            :type  components: :class:`list` of :class:`Versions.ComponentVersionInfo`
            :param components: List of components in this base-image.
            """
            self.display_name = display_name
            self.version = version
            self.display_version = display_version
            self.summary = summary
            self.description = description
            self.category = category
            self.kb = kb
            self.release_date = release_date
            self.components = components
            VapiStruct.__init__(self)

    Info._set_binding_type(
        type.StructType(
            'com.vmware.esx.settings.depot_content.base_images.versions.info',
            {
                'display_name':
                type.StringType(),
                'version':
                type.IdType(
                    resource_types='com.vmware.esx.settings.base_image'),
                'display_version':
                type.StringType(),
                'summary':
                type.StringType(),
                'description':
                type.StringType(),
                'category':
                type.ReferenceType(__name__, 'Versions.CategoryType'),
                'kb':
                type.URIType(),
                'release_date':
                type.DateTimeType(),
                'components':
                type.ListType(
                    type.ReferenceType(__name__,
                                       'Versions.ComponentVersionInfo')),
            }, Info, False, None))

    def get(
        self,
        version,
    ):
        """
        Returns information about a given base-image version in the depot.

        :type  version: :class:`str`
        :param version: Version of the base-image
        :rtype: :class:`Versions.Info`
        :return: Information about the given base-image
        :raise: :class:`com.vmware.vapi.std.errors_client.Error` 
            If there is unknown internal error. The accompanying error message
            will give more details about the failure.
        :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` 
            if base-image with given version is not found.
        :raise: :class:`com.vmware.vapi.std.errors_client.ServiceUnavailable` 
            If the service is not available.
        :raise: :class:`com.vmware.vapi.std.errors_client.Unauthenticated` 
            if the caller is not authenticated.
        :raise: :class:`com.vmware.vapi.std.errors_client.Unauthorized`
            if you do not have all of the privileges described as follows: 
            
            * Method execution requires ``VcIntegrity.lifecycleSettings.Read``.
        """
        return self._invoke('get', {
            'version': version,
        })
コード例 #2
0
class Details(VapiInterface):
    """
    The ``Details`` class provides methods to get the details about backup
    jobs. This class was added in vSphere API 6.7.
    """

    _VAPI_SERVICE_ID = 'com.vmware.appliance.recovery.backup.job.details'
    """
    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, _DetailsStub)

    class Type(Enum):
        """
        The ``Details.Type`` class defines the type of backup job. 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>`.
        """
        SCHEDULED = None
        """
        Job type is Scheduled. This class attribute was added in vSphere API 6.7.

        """
        MANUAL = None
        """
        Job type is Manual. 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:`Type` instance.
            """
            Enum.__init__(string)

    Type._set_values([
        Type('SCHEDULED'),
        Type('MANUAL'),
    ])
    Type._set_binding_type(
        type.EnumType('com.vmware.appliance.recovery.backup.job.details.type',
                      Type))

    class Info(VapiStruct):
        """
        The ``Details.Info`` class contains information about a backup job. 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', {
                    'SUCCEEDED': [('duration', True), ('size', True),
                                  ('progress', True), ('start_time', True),
                                  ('end_time', True)],
                    'FAILED': [('duration', True), ('size', True),
                               ('progress', True), ('error', False),
                               ('start_time', True), ('end_time', True)],
                    'RUNNING': [('duration', True), ('size', True),
                                ('progress', True), ('start_time', True)],
                    'BLOCKED': [('start_time', True)],
                    'PENDING': [],
                }),
        ]

        def __init__(
            self,
            location=None,
            duration=None,
            size=None,
            progress=None,
            location_user=None,
            type=None,
            messages=None,
            build=None,
            description=None,
            service=None,
            operation=None,
            parent=None,
            target=None,
            status=None,
            cancelable=None,
            error=None,
            start_time=None,
            end_time=None,
            user=None,
        ):
            """
            :type  location: :class:`str`
            :param location: URL of the backup location. This attribute was added in vSphere API
                6.7.
            :type  duration: :class:`long`
            :param duration: Time in seconds since the backup job was started or the time it
                took to complete the backup job. 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:`com.vmware.cis.task_client.Status.SUCCEEDED`,
                :attr:`com.vmware.cis.task_client.Status.FAILED`, or
                :attr:`com.vmware.cis.task_client.Status.RUNNING`.
            :type  size: :class:`long`
            :param size: Size of the backup data transferred to remote location. 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:`com.vmware.cis.task_client.Status.SUCCEEDED`,
                :attr:`com.vmware.cis.task_client.Status.FAILED`, or
                :attr:`com.vmware.cis.task_client.Status.RUNNING`.
            :type  progress: :class:`com.vmware.cis.task_client.Progress`
            :param progress: Progress of the job. 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:`com.vmware.cis.task_client.Status.SUCCEEDED`,
                :attr:`com.vmware.cis.task_client.Status.FAILED`, or
                :attr:`com.vmware.cis.task_client.Status.RUNNING`.
            :type  location_user: :class:`str`
            :param location_user: The username for the remote backup location. This attribute was
                added in vSphere API 6.7.
            :type  type: :class:`Details.Type`
            :param type: Type of the backup job. Indicates whether the backup was started
                manually or as a scheduled backup. This attribute was added in
                vSphere API 6.7.
            :type  messages: :class:`list` of :class:`com.vmware.vapi.std_client.LocalizableMessage`
            :param messages: List of any info/warning/error messages returned by the backup job.
                This attribute was added in vSphere API 6.7.
            :type  build: :class:`Details.BuildInfo`
            :param build: Information about the build of the appliance. This attribute was
                added in vSphere API 6.7.2.
                This attribute is optional because it was added in a newer version
                than its parent node.
            :type  description: :class:`com.vmware.vapi.std_client.LocalizableMessage`
            :param description: Description of the operation associated with the task.
            :type  service: :class:`str`
            :param service: Identifier of the service containing the operation.
                When clients pass a value of this class as a parameter, the
                attribute must be an identifier for the resource type:
                ``com.vmware.vapi.service``. When methods return a value of this
                class as a return value, the attribute will be an identifier for
                the resource type: ``com.vmware.vapi.service``.
            :type  operation: :class:`str`
            :param operation: Identifier of the operation associated with the task.
                When clients pass a value of this class as a parameter, the
                attribute must be an identifier for the resource type:
                ``com.vmware.vapi.operation``. When methods return a value of this
                class as a return value, the attribute will be an identifier for
                the resource type: ``com.vmware.vapi.operation``.
            :type  parent: :class:`str` or ``None``
            :param parent: Parent of the current task.
                When clients pass a value of this class as a parameter, the
                attribute must be an identifier for the resource type:
                ``com.vmware.cis.task``. When methods return a value of this class
                as a return value, the attribute will be an identifier for the
                resource type: ``com.vmware.cis.task``.
                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 created by the operation or an existing
                one the operation performed on.
                This attribute will be None if the operation has no target or
                multiple targets.
            :type  status: :class:`com.vmware.cis.task_client.Status`
            :param status: Status of the operation associated with the task.
            :type  cancelable: :class:`bool`
            :param cancelable: Flag to indicate whether or not the operation can be cancelled. The
                value may change as the operation progresses.
            :type  error: :class:`Exception` or ``None``
            :param error: Description of the error if the operation status is "FAILED".
                If None the description of why the operation failed will be
                included in the result of the operation (see
                :attr:`com.vmware.cis.task_client.Info.result`).
            :type  start_time: :class:`datetime.datetime`
            :param start_time: Time when the operation is started.
                This attribute is optional and it is only relevant when the value
                of ``status`` is one of
                :attr:`com.vmware.cis.task_client.Status.RUNNING`,
                :attr:`com.vmware.cis.task_client.Status.BLOCKED`,
                :attr:`com.vmware.cis.task_client.Status.SUCCEEDED`, or
                :attr:`com.vmware.cis.task_client.Status.FAILED`.
            :type  end_time: :class:`datetime.datetime`
            :param end_time: Time when the operation is completed.
                This attribute is optional and it is only relevant when the value
                of ``status`` is one of
                :attr:`com.vmware.cis.task_client.Status.SUCCEEDED` or
                :attr:`com.vmware.cis.task_client.Status.FAILED`.
            :type  user: :class:`str` or ``None``
            :param user: Name of the user who performed the operation.
                This attribute will be None if the operation is performed by the
                system.
            """
            self.location = location
            self.duration = duration
            self.size = size
            self.progress = progress
            self.location_user = location_user
            self.type = type
            self.messages = messages
            self.build = build
            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.user = user
            VapiStruct.__init__(self)

    Info._set_binding_type(
        type.StructType(
            'com.vmware.appliance.recovery.backup.job.details.info', {
                'location':
                type.URIType(),
                'duration':
                type.OptionalType(type.IntegerType()),
                'size':
                type.OptionalType(type.IntegerType()),
                'progress':
                type.OptionalType(
                    type.ReferenceType('com.vmware.cis.task_client',
                                       'Progress')),
                'location_user':
                type.StringType(),
                'type':
                type.ReferenceType(__name__, 'Details.Type'),
                'messages':
                type.ListType(
                    type.ReferenceType('com.vmware.vapi.std_client',
                                       'LocalizableMessage')),
                'build':
                type.OptionalType(
                    type.ReferenceType(__name__, 'Details.BuildInfo')),
                'description':
                type.ReferenceType('com.vmware.vapi.std_client',
                                   'LocalizableMessage'),
                'service':
                type.IdType(resource_types='com.vmware.vapi.service'),
                'operation':
                type.IdType(resource_types='com.vmware.vapi.operation'),
                'parent':
                type.OptionalType(type.IdType()),
                'target':
                type.OptionalType(
                    type.ReferenceType('com.vmware.vapi.std_client',
                                       'DynamicID')),
                'status':
                type.ReferenceType('com.vmware.cis.task_client', 'Status'),
                'cancelable':
                type.BooleanType(),
                'error':
                type.OptionalType(type.AnyErrorType()),
                'start_time':
                type.OptionalType(type.DateTimeType()),
                'end_time':
                type.OptionalType(type.DateTimeType()),
                'user':
                type.OptionalType(type.StringType()),
            }, Info, False, None))

    class FilterSpec(VapiStruct):
        """
        The ``Details.FilterSpec`` class contains attributes used to filter the
        results when listing backup jobs details (see :func:`Details.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,
            jobs=None,
        ):
            """
            :type  jobs: :class:`set` of :class:`str` or ``None``
            :param jobs: Identifiers of backup jobs that can match the filter. This
                attribute was added in vSphere API 6.7.
                When clients pass a value of this class as a parameter, the
                attribute must contain identifiers for the resource type:
                ``com.vmware.appliance.recovery.backup.job``. When methods return a
                value of this class as a return value, the attribute will contain
                identifiers for the resource type:
                ``com.vmware.appliance.recovery.backup.job``.
                If None the filter will match all the backup jobs.
            """
            self.jobs = jobs
            VapiStruct.__init__(self)

    FilterSpec._set_binding_type(
        type.StructType(
            'com.vmware.appliance.recovery.backup.job.details.filter_spec', {
                'jobs': type.OptionalType(type.SetType(type.IdType())),
            }, FilterSpec, False, None))

    class BuildInfo(VapiStruct):
        """
        The ``Details.BuildInfo`` class contains information about the build of the
        appliance. 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,
            version_name=None,
            version=None,
            build_number=None,
        ):
            """
            :type  version_name: :class:`str`
            :param version_name: Appliance product type, for example 6.8.2 GA. This attribute was
                added in vSphere API 6.7.2.
            :type  version: :class:`str`
            :param version: Appliance version, for example 6.8.2.10000. This attribute was
                added in vSphere API 6.7.2.
            :type  build_number: :class:`str`
            :param build_number: Build Number of the appliance. This attribute was added in vSphere
                API 6.7.2.
            """
            self.version_name = version_name
            self.version = version
            self.build_number = build_number
            VapiStruct.__init__(self)

    BuildInfo._set_binding_type(
        type.StructType(
            'com.vmware.appliance.recovery.backup.job.details.build_info', {
                'version_name': type.StringType(),
                'version': type.StringType(),
                'build_number': type.StringType(),
            }, BuildInfo, False, None))

    def list(
        self,
        filter=None,
    ):
        """
        Returns detailed information about the current and historical backup
        jobs. This method was added in vSphere API 6.7.

        :type  filter: :class:`Details.FilterSpec` or ``None``
        :param filter: Specification of matching backup jobs for which information should
            be returned.
            If None, the behavior is equivalent to :class:`Details.FilterSpec`
            with all attributes None which means all the backup jobs match the
            filter.
        :rtype: :class:`dict` of :class:`str` and :class:`Details.Info`
        :return: Map of backup job identifier to Info Structure.
            The key in the return value :class:`dict` will be an identifier for
            the resource type: ``com.vmware.appliance.recovery.backup.job``.
        :raise: :class:`com.vmware.vapi.std.errors_client.Error` 
            if any error occurs during the execution of the operation.
        """
        return self._invoke('list', {
            'filter': filter,
        })
コード例 #3
0
class Reports(VapiInterface):
    """
    This class provides methods to download information generated from the
    hardware compatibility feature residing on the vCenter Appliance.
    """

    _VAPI_SERVICE_ID = 'com.vmware.esx.hcl.reports'
    """
    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, _ReportsStub)
        self._VAPI_OPERATION_IDS = {}

    class Token(VapiStruct):
        """
        The ``Reports.Token`` class contains information about the token required
        to be passed in the HTTP header in the HTTP GET request to generate the
        report.

        .. tip::
            The arguments are used to initialize data attributes with the same
            names.
        """
        def __init__(
            self,
            token=None,
            expiry=None,
        ):
            """
            :type  token: :class:`str`
            :param token: A one-time, short-lived token required in the HTTP header of the
                request to the url. This token needs to be passed in as a header
                with the name "session-id".
            :type  expiry: :class:`datetime.datetime`
            :param expiry: Expiry time of the token
            """
            self.token = token
            self.expiry = expiry
            VapiStruct.__init__(self)

    Token._set_binding_type(
        type.StructType('com.vmware.esx.hcl.reports.token', {
            'token': type.SecretType(),
            'expiry': type.DateTimeType(),
        }, Token, False, None))

    class Location(VapiStruct):
        """
        The ``Reports.Location`` class contains the URI location to download
        generated compatibility report, as well as a token required (as a header on
        the HTTP GET request) to get the report. The validity of the token is 5
        minutes. After the token expires, any attempt to call the URI with said
        token will fail.

        .. tip::
            The arguments are used to initialize data attributes with the same
            names.
        """
        def __init__(
            self,
            url=None,
            report_token=None,
        ):
            """
            :type  url: :class:`str`
            :param url: Compatibility report download URL.
            :type  report_token: :class:`Reports.Token`
            :param report_token: Information about the token required in the HTTP GET request to
                download the compatibility report.
            """
            self.url = url
            self.report_token = report_token
            VapiStruct.__init__(self)

    Location._set_binding_type(
        type.StructType(
            'com.vmware.esx.hcl.reports.location', {
                'url': type.URIType(),
                'report_token': type.ReferenceType(__name__, 'Reports.Token'),
            }, Location, False, None))

    def get(
        self,
        report,
    ):
        """
        Returns the location :class:`Reports.Location` information for
        downloading a compatibility report.

        :type  report: :class:`str`
        :param report: identifier of hardware compatiblity report to be downloaded.
            The parameter must be an identifier for the resource type:
            ``com.vmware.esx.hcl.resources.CompatibilityReport``.
        :rtype: :class:`Reports.Location`
        :return: ``Reports.Location`` class which includes the URI to file, short
            lived token and expiry of the token in the
            :class:`Reports.Location` object.
        :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` 
            if there is no report for the given id.
        :raise: :class:`com.vmware.vapi.std.errors_client.Unauthenticated` 
            if the caller is not authenticated.
        :raise: :class:`com.vmware.vapi.std.errors_client.ResourceInaccessible` 
            if the vCenter this API is executed on is not part of the Customer
            Experience Improvement Program (CEIP).
        :raise: :class:`com.vmware.vapi.std.errors_client.Error` 
            If there is some unknown error. The accompanying error message will
            give more details about the failure.
        :raise: :class:`com.vmware.vapi.std.errors_client.Unauthorized`
            if you do not have all of the privileges described as follows: 
            
            * Method execution requires
              ``VcIntegrity.HardwareCompatibility.Read``.
        """
        return self._invoke('get', {
            'report': report,
        })
コード例 #4
0
class Tickets(VapiInterface):
    """
    The ``Tickets`` class provides methods for managing the virtual machine
    console tickets. This class was added in vSphere API 7.0.0.2.
    """

    _VAPI_SERVICE_ID = 'com.vmware.vcenter.vm.console.tickets'
    """
    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, _TicketsStub)
        self._VAPI_OPERATION_IDS = {}

    class Type(Enum):
        """
        The ``Tickets.Type`` class defines the types of console tickets. This
        enumeration was added in vSphere API 7.0.0.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>`.
        """
        VMRC = None
        """
        Virtual machine remote console ticket. This class attribute was added in
        vSphere API 7.0.0.2.

        """
        WEBMKS = None
        """
        Web socket console ticket. This class attribute was added in vSphere API
        7.0.0.2.

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

    Type._set_values([
        Type('VMRC'),
        Type('WEBMKS'),
    ])
    Type._set_binding_type(
        type.EnumType('com.vmware.vcenter.vm.console.tickets.type', Type))

    class CreateSpec(VapiStruct):
        """
        The ``Tickets.CreateSpec`` class defines the information used to create the
        virtual machine console ticket. This class was added in vSphere API
        7.0.0.2.

        .. tip::
            The arguments are used to initialize data attributes with the same
            names.
        """
        def __init__(
            self,
            type=None,
        ):
            """
            :type  type: :class:`Tickets.Type`
            :param type: The type of virtual machine console ticket. This attribute was
                added in vSphere API 7.0.0.2.
            """
            self.type = type
            VapiStruct.__init__(self)

    CreateSpec._set_binding_type(
        type.StructType('com.vmware.vcenter.vm.console.tickets.create_spec', {
            'type': type.ReferenceType(__name__, 'Tickets.Type'),
        }, CreateSpec, False, None))

    class Summary(VapiStruct):
        """
        The ``Tickets.Summary`` class contains commonly used information about the
        virtual machine console ticket. This class was added in vSphere API
        7.0.0.2.

        .. tip::
            The arguments are used to initialize data attributes with the same
            names.
        """
        def __init__(
            self,
            ticket=None,
        ):
            """
            :type  ticket: :class:`str`
            :param ticket: Console ticket URI. This attribute was added in vSphere API
                7.0.0.2.
            """
            self.ticket = ticket
            VapiStruct.__init__(self)

    Summary._set_binding_type(
        type.StructType('com.vmware.vcenter.vm.console.tickets.summary', {
            'ticket': type.URIType(),
        }, Summary, False, None))

    def create(
        self,
        vm,
        spec,
    ):
        """
        Creates a virtual machine console ticket of a given ticket type. The
        created ticket is a one time use URI. The validity of the ticket is 30
        minutes, if not used with in the time frame the ticket expires. 
        
        The :attr:`Tickets.Type.VMRC` ticket contains the IP address or the DNS
        resolvable name of the vCenter server. This ticket requires
        installation of VMware Workstation, VMware Fusion or VMRC to be
        installed on the machine where the ticket has to be opened. This ticket
        can be acquired even when the VM is turned off. 
        
        The :attr:`Tickets.Type.WEBMKS` ticket contains the IP address of the
        DNS resolvable name of the ESX server. This ticket requires user to
        embed this ticket in a HTML page using VMware HTML Console SDK -
        https://www.vmware.com/support/developer/html-console This ticket can
        be acquired only when the VM is turned on.. This method was added in
        vSphere API 7.0.0.2.

        :type  vm: :class:`str`
        :param vm: Virtual machine identifier.
            The parameter must be an identifier for the resource type:
            ``VirtualMachine``.
        :type  spec: :class:`Tickets.CreateSpec`
        :param spec: Specification for the console ticket to be created.
        :rtype: :class:`Tickets.Summary`
        :return: Commonly used information about the virtual machine console ticket.
        :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 {\\\\@link CreateSpec#type) attribute contains a value that
            is not supported by the server.
        :raise: :class:`com.vmware.vapi.std.errors_client.NotAllowedInCurrentState` 
            if the virtual machine is powered off and requested ticket type is
            :attr:`Tickets.Type.WEBMKS`
        :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` 
            if the virtual machine is not found.
        :raise: :class:`com.vmware.vapi.std.errors_client.ResourceInaccessible` 
            if the virtual machine's configuration or execution state cannot be
            accessed.
        :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('create', {
            'vm': vm,
            'spec': spec,
        })
コード例 #5
0
class InteropReport(VapiInterface):
    """
    The ``InteropReport`` interface provides methods to report the
    interoperability between a vCenter Server release version and the other
    installed VMware products registered in the vCenter Server instance.
    """

    _VAPI_SERVICE_ID = 'com.vmware.vcenter.lcm.discovery.interop_report'
    """
    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, _InteropReportStub)
        self._VAPI_OPERATION_IDS = {}
        self._VAPI_OPERATION_IDS.update({'create_task': 'create$task'})

    class ReleaseInfo(VapiStruct):
        """
        The ``InteropReport.ReleaseInfo`` class contains a product release
        information.

        .. tip::
            The arguments are used to initialize data attributes with the same
            names.
        """
        def __init__(
            self,
            version=None,
            note=None,
        ):
            """
            :type  version: :class:`str`
            :param version: The version of the release.
            :type  note: :class:`str` or ``None``
            :param note: A link to the release notes of the release.
                None if the release notes are not available.
            """
            self.version = version
            self.note = note
            VapiStruct.__init__(self)

    ReleaseInfo._set_binding_type(
        type.StructType(
            'com.vmware.vcenter.lcm.discovery.interop_report.release_info', {
                'version': type.StringType(),
                'note': type.OptionalType(type.URIType()),
            }, ReleaseInfo, False, None))

    class ReportRow(VapiStruct):
        """
        The ``InteropReport.ReportRow`` class contains the interoperability between
        a given product and the target product.

        .. tip::
            The arguments are used to initialize data attributes with the same
            names.
        """
        def __init__(
            self,
            product=None,
            compatible=None,
            compatible_releases=None,
        ):
            """
            :type  product: :class:`Product`
            :param product: The product to compare to the target product.
            :type  compatible: :class:`bool`
            :param compatible: Defines whether the product is compatible against the target
                product.
            :type  compatible_releases: :class:`list` of :class:`InteropReport.ReleaseInfo`
            :param compatible_releases: A list of compatible releases of the product with the target
                product.
            """
            self.product = product
            self.compatible = compatible
            self.compatible_releases = compatible_releases
            VapiStruct.__init__(self)

    ReportRow._set_binding_type(
        type.StructType(
            'com.vmware.vcenter.lcm.discovery.interop_report.report_row', {
                'product':
                type.ReferenceType(__name__, 'Product'),
                'compatible':
                type.BooleanType(),
                'compatible_releases':
                type.ListType(
                    type.ReferenceType(__name__, 'InteropReport.ReleaseInfo')),
            }, ReportRow, False, None))

    class ReportSummary(VapiStruct):
        """
        The ``InteropReport.ReportSummary`` class contains a summary of the
        :attr:`InteropReport.Report.products`. It consists of the count of
        compatible and incompatible products to the target product.

        .. tip::
            The arguments are used to initialize data attributes with the same
            names.
        """
        def __init__(
            self,
            compatible_count=None,
            incompatible_count=None,
        ):
            """
            :type  compatible_count: :class:`long`
            :param compatible_count: Number of compatible products.
            :type  incompatible_count: :class:`long`
            :param incompatible_count: Number of incompatible products.
            """
            self.compatible_count = compatible_count
            self.incompatible_count = incompatible_count
            VapiStruct.__init__(self)

    ReportSummary._set_binding_type(
        type.StructType(
            'com.vmware.vcenter.lcm.discovery.interop_report.report_summary', {
                'compatible_count': type.IntegerType(),
                'incompatible_count': type.IntegerType(),
            }, ReportSummary, False, None))

    class Report(VapiStruct):
        """
        The ``InteropReport.Report`` class contains the interoperability report
        between the target product and the other registered products in the vCenter
        Server instance.

        .. tip::
            The arguments are used to initialize data attributes with the same
            names.
        """
        def __init__(
            self,
            date_created=None,
            target_product=None,
            products=None,
            issues=None,
            summary=None,
        ):
            """
            :type  date_created: :class:`datetime.datetime`
            :param date_created: Time when the report is created.
            :type  target_product: :class:`Product`
            :param target_product: A product against the other products are compared to. Only vCenter
                Server is supported.
            :type  products: :class:`list` of :class:`InteropReport.ReportRow`
            :param products: Interoperability matrix for the supplied target product and the
                other registered products.
            :type  issues: :class:`com.vmware.vcenter.lcm_client.Notifications` or ``None``
            :param issues: Lists of issues encountered during report creation.
                :class:`set` if any issues encountered.
            :type  summary: :class:`InteropReport.ReportSummary`
            :param summary: A summary of the interoperability matrix.
            """
            self.date_created = date_created
            self.target_product = target_product
            self.products = products
            self.issues = issues
            self.summary = summary
            VapiStruct.__init__(self)

    Report._set_binding_type(
        type.StructType(
            'com.vmware.vcenter.lcm.discovery.interop_report.report', {
                'date_created':
                type.DateTimeType(),
                'target_product':
                type.ReferenceType(__name__, 'Product'),
                'products':
                type.ListType(
                    type.ReferenceType(__name__, 'InteropReport.ReportRow')),
                'issues':
                type.OptionalType(
                    type.ReferenceType('com.vmware.vcenter.lcm_client',
                                       'Notifications')),
                'summary':
                type.ReferenceType(__name__, 'InteropReport.ReportSummary'),
            }, Report, False, None))

    class Result(VapiStruct):
        """
        The ``InteropReport.Result`` class contains the result of interoperability
        report creation operation.

        .. tip::
            The arguments are used to initialize data attributes with the same
            names.
        """
        def __init__(
            self,
            report=None,
            csv_report=None,
        ):
            """
            :type  report: :class:`InteropReport.Report`
            :param report: The interoperability report.
            :type  csv_report: :class:`str` or ``None``
            :param csv_report: The identifier of CSV formatted interopability report. 
                
                com.vmware.vcenter.lcm.report.Report#get provides location where
                the CSV report can be downloaded from based on the ``csvReport``.
                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.report``. 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.report``.
                None in case of ``errors`` reported in
                :attr:`InteropReport.Report.issues`.
            """
            self.report = report
            self.csv_report = csv_report
            VapiStruct.__init__(self)

    Result._set_binding_type(
        type.StructType(
            'com.vmware.vcenter.lcm.discovery.interop_report.result', {
                'report': type.ReferenceType(__name__, 'InteropReport.Report'),
                'csv_report': type.OptionalType(type.IdType()),
            }, Result, False, None))

    class Spec(VapiStruct):
        """
        Configuration of report generation.

        .. tip::
            The arguments are used to initialize data attributes with the same
            names.
        """
        def __init__(
            self,
            target_version=None,
        ):
            """
            :type  target_version: :class:`str`
            :param target_version: The vCenter Server version. 
                
                It is used for checking against the other products registered with
                that instance of vCenter Server.
            """
            self.target_version = target_version
            VapiStruct.__init__(self)

    Spec._set_binding_type(
        type.StructType('com.vmware.vcenter.lcm.discovery.interop_report.spec',
                        {
                            'target_version': type.StringType(),
                        }, Spec, False, None))

    def create_task(
        self,
        spec=None,
    ):
        """
        Creates interoperability report between a vCenter Server release
        version and all registered products with the vCenter Server instance. 
        
        The result of this operation can be queried by calling the
        com.vmware.cis.Tasks#get method where ``task`` is the response of this
        operation.

        :type  spec: :class:`InteropReport.Spec` or ``None``
        :param spec: 
            Specifies the target version against this interoperability check
            report will be generated. If None the report will be generated for
            the currently installed version of the vCenter server.
        :rtype: :class:  `vmware.vapi.stdlib.client.task.Task`
        :return: Task instance
        :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 failure.
        """
        task_id = self._invoke('create$task', {
            'spec': spec,
        })
        task_svc = Tasks(self._config)
        task_instance = Task(
            task_id, task_svc,
            type.ReferenceType(__name__, 'InteropReport.Result'))
        return task_instance
コード例 #6
0
        :param hash_algorithm: The hash algorithm (SHA256, SHA512) used to calculate the checksum.
            If not specified the default checksum algorithm is
            :attr:`HashAlgorithm.SHA256`.
        """
        self.location = location
        self.ssl_verify = ssl_verify
        self.ssl_hash = ssl_hash
        self.hash_algorithm = hash_algorithm
        VapiStruct.__init__(self)


OvaInfo._set_binding_type(
    type.StructType(
        'com.vmware.vcenter.lcm.common.ova_info', {
            'location':
            type.URIType(),
            'ssl_verify':
            type.OptionalType(type.BooleanType()),
            'ssl_hash':
            type.OptionalType(type.StringType()),
            'hash_algorithm':
            type.OptionalType(type.ReferenceType(__name__, 'HashAlgorithm')),
        }, OvaInfo, False, None))


class ApplianceDeployment(VapiStruct):
    """
    The ``ApplianceDeployment`` class describes the new appliance deployment
    configuration.

    .. tip::
コード例 #7
0
class Versions(VapiInterface):
    """
    The ``Versions`` class provides methods to get component versions from the
    sync'ed and imported depots.
    """

    _VAPI_SERVICE_ID = 'com.vmware.esx.settings.depot_content.components.versions'
    """
    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, _VersionsStub)
        self._VAPI_OPERATION_IDS = {}

    class CategoryType(Enum):
        """
        The ``Versions.CategoryType`` class defines possible values of categories
        for a component.

        .. 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
        """
        Security

        """
        ENHANCEMENT = None
        """
        Enhancement

        """
        BUGFIX = None
        """
        Bugfix

        """
        RECALL = None
        """
        Recall

        """
        RECALL_FIX = None
        """
        Recall-fix

        """
        INFO = None
        """
        Info

        """
        MISC = None
        """
        Misc

        """
        GENERAL = None
        """
        General

        """

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

    CategoryType._set_values([
        CategoryType('SECURITY'),
        CategoryType('ENHANCEMENT'),
        CategoryType('BUGFIX'),
        CategoryType('RECALL'),
        CategoryType('RECALL_FIX'),
        CategoryType('INFO'),
        CategoryType('MISC'),
        CategoryType('GENERAL'),
    ])
    CategoryType._set_binding_type(type.EnumType(
        'com.vmware.esx.settings.depot_content.components.versions.category_type',
        CategoryType))


    class UrgencyType(Enum):
        """
        The ``Versions.UrgencyType`` class defines possible values of urgencies for
        a component.

        .. 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
        """
        Critical

        """
        IMPORTANT = None
        """
        Important

        """
        MODERATE = None
        """
        Moderate

        """
        LOW = None
        """
        Low

        """
        GENERAL = None
        """
        General

        """

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

    UrgencyType._set_values([
        UrgencyType('CRITICAL'),
        UrgencyType('IMPORTANT'),
        UrgencyType('MODERATE'),
        UrgencyType('LOW'),
        UrgencyType('GENERAL'),
    ])
    UrgencyType._set_binding_type(type.EnumType(
        'com.vmware.esx.settings.depot_content.components.versions.urgency_type',
        UrgencyType))


    class Info(VapiStruct):
        """
        The ``Versions.Info`` class defines the information regarding a component
        version.

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




        def __init__(self,
                     display_name=None,
                     vendor=None,
                     display_version=None,
                     summary=None,
                     description=None,
                     category=None,
                     urgency=None,
                     kb=None,
                     contact=None,
                     release_date=None,
                    ):
            """
            :type  display_name: :class:`str`
            :param display_name: Display name of the component.
            :type  vendor: :class:`str`
            :param vendor: Vendor of the component.
            :type  display_version: :class:`str`
            :param display_version: Human readable version of the component.
            :type  summary: :class:`str`
            :param summary: Summary of the component version.
            :type  description: :class:`str`
            :param description: Discription of the component version.
            :type  category: :class:`Versions.CategoryType`
            :param category: Category of the component version.
            :type  urgency: :class:`Versions.UrgencyType`
            :param urgency: Urgency of the component version.
            :type  kb: :class:`str`
            :param kb: Link to kb article related to this the component version.
            :type  contact: :class:`str`
            :param contact: Contact email for the component version.
            :type  release_date: :class:`datetime.datetime`
            :param release_date: Release date of the component version.
            """
            self.display_name = display_name
            self.vendor = vendor
            self.display_version = display_version
            self.summary = summary
            self.description = description
            self.category = category
            self.urgency = urgency
            self.kb = kb
            self.contact = contact
            self.release_date = release_date
            VapiStruct.__init__(self)


    Info._set_binding_type(type.StructType(
        'com.vmware.esx.settings.depot_content.components.versions.info', {
            'display_name': type.StringType(),
            'vendor': type.StringType(),
            'display_version': type.StringType(),
            'summary': type.StringType(),
            'description': type.StringType(),
            'category': type.ReferenceType(__name__, 'Versions.CategoryType'),
            'urgency': type.ReferenceType(__name__, 'Versions.UrgencyType'),
            'kb': type.URIType(),
            'contact': type.StringType(),
            'release_date': type.DateTimeType(),
        },
        Info,
        False,
        None))



    def get(self,
            name,
            version,
            ):
        """
        Returns information about a given component version in the depot.

        :type  name: :class:`str`
        :param name: Name of the component
            The parameter must be an identifier for the resource type:
            ``com.vmware.esx.settings.component``.
        :type  version: :class:`str`
        :param version: Version of the component
        :rtype: :class:`Versions.Info`
        :return: Information about the given component
        :raise: :class:`com.vmware.vapi.std.errors_client.Error` 
            If there is unknown internal error. The accompanying error message
            will give more details about the failure.
        :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` 
            if component with given version is not found.
        :raise: :class:`com.vmware.vapi.std.errors_client.Unauthenticated` 
            if the caller is not authenticated.
        :raise: :class:`com.vmware.vapi.std.errors_client.ServiceUnavailable` 
            If the service is not available.
        :raise: :class:`com.vmware.vapi.std.errors_client.Unauthorized`
            if you do not have all of the privileges described as follows: 
            
            * Method execution requires ``VcIntegrity.lifecycleSettings.Read``.
        """
        return self._invoke('get',
                            {
                            'name': name,
                            'version': version,
                            })
コード例 #8
0
class Source(VapiInterface):
    """
    Operations to manage the metadata sources for routing information
    **Note:** This class is restricted for **VMware internal use only**.
    """
    RESOURCE_TYPE = "com.vmware.vapi.metadata.source"
    """
    Resource type for vAPI metadata source.

    """

    _VAPI_SERVICE_ID = 'com.vmware.vapi.metadata.routing.source'
    """
    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, _SourceStub)
        self._VAPI_OPERATION_IDS = {}

    class Info(VapiStruct):
        """
        Metadata source info.
        **Note:** This class is restricted for **VMware internal use only**.

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

        _validator_list = [
            UnionValidator('type', {
                'FILE': [('filepath', True)],
                'REMOTE': [('address', True)],
            }),
        ]

        def __init__(
            self,
            description=None,
            type=None,
            filepath=None,
            address=None,
        ):
            """
            :type  description: :class:`str`
            :param description: Description of the source.
            :type  type: :class:`com.vmware.vapi.metadata_client.SourceType`
            :param type: Type of the metadata source.
            :type  filepath: :class:`str`
            :param filepath: Absolute file path of the file that has the metadata information.
                This attribute is optional and it is only relevant when the value
                of ``type`` is
                :attr:`com.vmware.vapi.metadata_client.SourceType.FILE`.
            :type  address: :class:`str`
            :param address: URI of the remote vAPI endpoint. This should be of the format
                http(s):IP:port/namespace.
                This attribute is optional and it is only relevant when the value
                of ``type`` is
                :attr:`com.vmware.vapi.metadata_client.SourceType.REMOTE`.
            """
            self.description = description
            self.type = type
            self.filepath = filepath
            self.address = address
            VapiStruct.__init__(self)

    Info._set_binding_type(
        type.StructType(
            'com.vmware.vapi.metadata.routing.source.info', {
                'description':
                type.StringType(),
                'type':
                type.ReferenceType('com.vmware.vapi.metadata_client',
                                   'SourceType'),
                'filepath':
                type.OptionalType(type.StringType()),
                'address':
                type.OptionalType(type.URIType()),
            }, Info, False, None))

    class CreateSpec(VapiStruct):
        """
        Metadata source create spec.
        **Note:** This class is restricted for **VMware internal use only**.

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

        _validator_list = [
            UnionValidator('type', {
                'FILE': [('filepath', True)],
                'REMOTE': [('address', True)],
            }),
        ]

        def __init__(
            self,
            description=None,
            type=None,
            filepath=None,
            address=None,
        ):
            """
            :type  description: :class:`str`
            :param description: English language human readable description of the source.
            :type  type: :class:`com.vmware.vapi.metadata_client.SourceType`
            :param type: Type of the metadata source.
            :type  filepath: :class:`str`
            :param filepath: Absolute file path of the metamodel metadata file that has the
                metamodel information about one component element.
                This attribute is optional and it is only relevant when the value
                of ``type`` is
                :attr:`com.vmware.vapi.metadata_client.SourceType.FILE`.
            :type  address: :class:`str`
            :param address: Connection information of the remote server. This should be of the
                format http(s)://IP:port/namespace. 
                
                The remote server should contain the classes in
                :mod:`com.vmware.vapi.metadata.metamodel_client` module. It could
                expose metamodel information of one or more components.
                This attribute is optional and it is only relevant when the value
                of ``type`` is
                :attr:`com.vmware.vapi.metadata_client.SourceType.REMOTE`.
            """
            self.description = description
            self.type = type
            self.filepath = filepath
            self.address = address
            VapiStruct.__init__(self)

    CreateSpec._set_binding_type(
        type.StructType(
            'com.vmware.vapi.metadata.routing.source.create_spec', {
                'description':
                type.StringType(),
                'type':
                type.ReferenceType('com.vmware.vapi.metadata_client',
                                   'SourceType'),
                'filepath':
                type.OptionalType(type.StringType()),
                'address':
                type.OptionalType(type.URIType()),
            }, CreateSpec, False, None))

    def create(
        self,
        source_id,
        spec,
    ):
        """
        Create a new metadata source.

        :type  source_id: :class:`str`
        :param source_id:  metadata source identifier.
            The parameter must be an identifier for the resource type:
            ``com.vmware.vapi.metadata.source``.
        :type  spec: :class:`Source.CreateSpec`
        :param spec:  create specification.
        :raise: :class:`com.vmware.vapi.std.errors_client.AlreadyExists` 
             If the metadata source identifier is already present.
        :raise: :class:`com.vmware.vapi.std.errors_client.InvalidArgument` 
            If type of the source specified in \\\\@{link CreateSpec#type} is
            invalid.
        :raise: :class:`com.vmware.vapi.std.errors_client.InvalidArgument` 
            If the file specified in \\\\@{link CreateSpec#filepath} is not a
            valid json file.
        :raise: :class:`com.vmware.vapi.std.errors_client.InvalidArgument` 
            If the URI specified in \\\\@{link CreateSpec#address} is
            unreachable or not a vAPI compatible server.
        :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` 
            If the file specified in \\\\@{link CreateSpec#filepath} does not
            exist.
        """
        return self._invoke('create', {
            'source_id': source_id,
            'spec': spec,
        })

    def delete(
        self,
        source_id,
    ):
        """
        Delete a metadata source.

        :type  source_id: :class:`str`
        :param source_id:  Metadata source identifier.
            The parameter must be an identifier for the resource type:
            ``com.vmware.vapi.metadata.source``.
        :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` 
             If the metadata source identifier is not found.
        """
        return self._invoke('delete', {
            'source_id': source_id,
        })

    def get(
        self,
        source_id,
    ):
        """
        Get the details about a metadata source.

        :type  source_id: :class:`str`
        :param source_id:  Metadata source identifier.
            The parameter must be an identifier for the resource type:
            ``com.vmware.vapi.metadata.source``.
        :rtype: :class:`Source.Info`
        :return: Metadata source info.
        :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` 
             If the metadata source identifier is not found.
        """
        return self._invoke('get', {
            'source_id': source_id,
        })

    def list(self):
        """
        List all the metadata sources.


        :rtype: :class:`list` of :class:`str`
        :return: List of all metadata sources.
            The return value will contain identifiers for the resource type:
            ``com.vmware.vapi.metadata.source``.
        """
        return self._invoke('list', None)

    def reload(
        self,
        source_id=None,
    ):
        """
        Reload metadata from all the sources or of a particular source.

        :type  source_id: :class:`str` or ``None``
        :param source_id:  Metadata source identifier.
            The parameter must be an identifier for the resource type:
            ``com.vmware.vapi.metadata.source``.
             If unspecified, all the sources are reloaded
        :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` 
             If the metadata source identifier is not found.
        """
        return self._invoke('reload', {
            'source_id': source_id,
        })

    def fingerprint(
        self,
        source_id=None,
    ):
        """
        Returns the fingerprint of all the sources or of a particular source.

        :type  source_id: :class:`str` or ``None``
        :param source_id:  Metadata source identifier.
            The parameter must be an identifier for the resource type:
            ``com.vmware.vapi.metadata.source``.
             If unspecified, fingerprint of all the sources is returned
        :rtype: :class:`str`
        :return: fingerprint of all the sources or of a particular source.
        :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` 
             If the metadata source identifier is not found.
        """
        return self._invoke('fingerprint', {
            'source_id': source_id,
        })
コード例 #9
0
class BaseImages(VapiInterface):
    """
    The ``BaseImages`` class provides methods to get base-images from the
    sync'ed and imported depots.
    """
    RESOURCE_TYPE = "com.vmware.esx.settings.base_image"
    """
    Resource type for add-on resource

    """

    _VAPI_SERVICE_ID = 'com.vmware.esx.settings.depot_content.base_images'
    """
    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, _BaseImagesStub)
        self._VAPI_OPERATION_IDS = {}

    class CategoryType(Enum):
        """
        The ``BaseImages.CategoryType`` class defines possible values of categories
        for a base-image.

        .. 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
        """
        Security

        """
        ENHANCEMENT = None
        """
        Enhancement

        """
        BUGFIX = None
        """
        Bugfix

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

    CategoryType._set_values([
        CategoryType('SECURITY'),
        CategoryType('ENHANCEMENT'),
        CategoryType('BUGFIX'),
    ])
    CategoryType._set_binding_type(
        type.EnumType(
            'com.vmware.esx.settings.depot_content.base_images.category_type',
            CategoryType))

    class Summary(VapiStruct):
        """
        The ``BaseImages.Summary`` class defines the summary information regarding
        a base-image.

        .. tip::
            The arguments are used to initialize data attributes with the same
            names.
        """
        def __init__(
            self,
            display_name=None,
            version=None,
            display_version=None,
            summary=None,
            category=None,
            kb=None,
            release_date=None,
        ):
            """
            :type  display_name: :class:`str`
            :param display_name: Display name of the base-image.
            :type  version: :class:`str`
            :param version: Version of the base-image.
                When clients pass a value of this class as a parameter, the
                attribute must be an identifier for the resource type:
                ``com.vmware.esx.settings.base_image``. When methods return a value
                of this class as a return value, the attribute will be an
                identifier for the resource type:
                ``com.vmware.esx.settings.base_image``.
            :type  display_version: :class:`str`
            :param display_version: Human readable version of the base-image.
            :type  summary: :class:`str`
            :param summary: Summary of the base-image.
            :type  category: :class:`BaseImages.CategoryType`
            :param category: Category of the base-image.
            :type  kb: :class:`str`
            :param kb: Link to kb article related to this the base-image.
            :type  release_date: :class:`datetime.datetime`
            :param release_date: Release date of the base-image.
            """
            self.display_name = display_name
            self.version = version
            self.display_version = display_version
            self.summary = summary
            self.category = category
            self.kb = kb
            self.release_date = release_date
            VapiStruct.__init__(self)

    Summary._set_binding_type(
        type.StructType(
            'com.vmware.esx.settings.depot_content.base_images.summary', {
                'display_name':
                type.StringType(),
                'version':
                type.IdType(
                    resource_types='com.vmware.esx.settings.base_image'),
                'display_version':
                type.StringType(),
                'summary':
                type.StringType(),
                'category':
                type.ReferenceType(__name__, 'BaseImages.CategoryType'),
                'kb':
                type.URIType(),
                'release_date':
                type.DateTimeType(),
            }, Summary, False, None))

    class FilterSpec(VapiStruct):
        """
        The ``BaseImages.FilterSpec`` class contains attributes used to filter the
        results when listing base-images, see :func:`BaseImages.list`).

        .. tip::
            The arguments are used to initialize data attributes with the same
            names.
        """
        def __init__(
            self,
            min_version=None,
        ):
            """
            :type  min_version: :class:`str` or ``None``
            :param min_version: Minimum version of a base-image that can match the filter.
                If :class:`set`, only base-images with version greater than or
                equal to this version will be returned.
            """
            self.min_version = min_version
            VapiStruct.__init__(self)

    FilterSpec._set_binding_type(
        type.StructType(
            'com.vmware.esx.settings.depot_content.base_images.filter_spec', {
                'min_version': type.OptionalType(type.StringType()),
            }, FilterSpec, False, None))

    def list(
        self,
        filter=None,
    ):
        """
        Returns a list of currently available base-images in the depot.

        :type  filter: :class:`BaseImages.FilterSpec` or ``None``
        :param filter: The specification of matching base-images.
            If None, the behavior is equivalent to a
            :class:`BaseImages.FilterSpec` with all attributes None, which
            means all base-images match the filter.
        :rtype: :class:`list` of :class:`BaseImages.Summary`
        :return: List of base-images in the depot. These will be sorted by the
            version of the base-image.
        :raise: :class:`com.vmware.vapi.std.errors_client.Error` 
            If there is unknown internal error. The accompanying error message
            will give more details about the failure.
        :raise: :class:`com.vmware.vapi.std.errors_client.ServiceUnavailable` 
            If the service is not available.
        :raise: :class:`com.vmware.vapi.std.errors_client.Unauthenticated` 
            if the caller is not authenticated.
        :raise: :class:`com.vmware.vapi.std.errors_client.Unauthorized`
            if you do not have all of the privileges described as follows: 
            
            * Method execution requires ``VcIntegrity.lifecycleSettings.Read``.
        """
        return self._invoke('list', {
            'filter': filter,
        })
コード例 #10
0
class Components(VapiInterface):
    """
    The ``Components`` class provides methods to get Components from the
    sync'ed and imported depots.
    """
    RESOURCE_TYPE = "com.vmware.esx.settings.component"
    """
    Resource type for add-on resource

    """

    _VAPI_SERVICE_ID = 'com.vmware.esx.settings.depot_content.components'
    """
    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, _ComponentsStub)
        self._VAPI_OPERATION_IDS = {}

    class CategoryType(Enum):
        """
        The ``Components.CategoryType`` class defines possible values of categories
        for a component.

        .. 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
        """
        Security

        """
        ENHANCEMENT = None
        """
        Enhancement

        """
        BUGFIX = None
        """
        Bugfix

        """
        RECALL = None
        """
        Recall

        """
        RECALL_FIX = None
        """
        Recall-fix

        """
        INFO = None
        """
        Info

        """
        MISC = None
        """
        Misc

        """
        GENERAL = None
        """
        General

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

    CategoryType._set_values([
        CategoryType('SECURITY'),
        CategoryType('ENHANCEMENT'),
        CategoryType('BUGFIX'),
        CategoryType('RECALL'),
        CategoryType('RECALL_FIX'),
        CategoryType('INFO'),
        CategoryType('MISC'),
        CategoryType('GENERAL'),
    ])
    CategoryType._set_binding_type(
        type.EnumType(
            'com.vmware.esx.settings.depot_content.components.category_type',
            CategoryType))

    class UrgencyType(Enum):
        """
        The ``Components.UrgencyType`` class defines possible values of urgencies
        for a component.

        .. 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
        """
        Critical

        """
        IMPORTANT = None
        """
        Important

        """
        MODERATE = None
        """
        Moderate

        """
        LOW = None
        """
        Low

        """
        GENERAL = None
        """
        General

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

    UrgencyType._set_values([
        UrgencyType('CRITICAL'),
        UrgencyType('IMPORTANT'),
        UrgencyType('MODERATE'),
        UrgencyType('LOW'),
        UrgencyType('GENERAL'),
    ])
    UrgencyType._set_binding_type(
        type.EnumType(
            'com.vmware.esx.settings.depot_content.components.urgency_type',
            UrgencyType))

    class ComponentBundleType(Enum):
        """
        The ``Components.ComponentBundleType`` class defines possible ways
        components are bundled.

        .. 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>`.
        """
        INDEPENDENT = None
        """
        Components not bundled in base-images or add-ons

        """
        BASE_IMAGE = None
        """
        Components bundled in base-images

        """
        ADD_ON = None
        """
        Components bundled in add-ons

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

    ComponentBundleType._set_values([
        ComponentBundleType('INDEPENDENT'),
        ComponentBundleType('BASE_IMAGE'),
        ComponentBundleType('ADD_ON'),
    ])
    ComponentBundleType._set_binding_type(
        type.EnumType(
            'com.vmware.esx.settings.depot_content.components.component_bundle_type',
            ComponentBundleType))

    class Summary(VapiStruct):
        """
        The ``Components.Summary`` class defines the summary information regarding
        a component.

        .. tip::
            The arguments are used to initialize data attributes with the same
            names.
        """
        def __init__(
            self,
            name=None,
            display_name=None,
            vendor=None,
            versions=None,
        ):
            """
            :type  name: :class:`str`
            :param name: Name of the Component.
                When clients pass a value of this class as a parameter, the
                attribute must be an identifier for the resource type:
                ``com.vmware.esx.settings.component``. When methods return a value
                of this class as a return value, the attribute will be an
                identifier for the resource type:
                ``com.vmware.esx.settings.component``.
            :type  display_name: :class:`str`
            :param display_name: Display name of the component.
            :type  vendor: :class:`str`
            :param vendor: Vendor of the component.
            :type  versions: :class:`list` of :class:`Components.ComponentVersionSummary`
            :param versions: Summary information about the versions of this component. These are
                sorted by the version.
            """
            self.name = name
            self.display_name = display_name
            self.vendor = vendor
            self.versions = versions
            VapiStruct.__init__(self)

    Summary._set_binding_type(
        type.StructType(
            'com.vmware.esx.settings.depot_content.components.summary', {
                'name':
                type.IdType(
                    resource_types='com.vmware.esx.settings.component'),
                'display_name':
                type.StringType(),
                'vendor':
                type.StringType(),
                'versions':
                type.ListType(
                    type.ReferenceType(__name__,
                                       'Components.ComponentVersionSummary')),
            }, Summary, False, None))

    class ComponentVersionSummary(VapiStruct):
        """
        The ``Components.ComponentVersionSummary`` class defines the summary
        information regarding a version of a component.

        .. tip::
            The arguments are used to initialize data attributes with the same
            names.
        """
        def __init__(
            self,
            version=None,
            display_version=None,
            summary=None,
            category=None,
            urgency=None,
            kb=None,
            release_date=None,
        ):
            """
            :type  version: :class:`str`
            :param version: Version of the component.
            :type  display_version: :class:`str`
            :param display_version: Human readable version of the component.
            :type  summary: :class:`str`
            :param summary: Summary of the component version.
            :type  category: :class:`Components.CategoryType`
            :param category: Category of the component version.
            :type  urgency: :class:`Components.UrgencyType`
            :param urgency: Urgency of the component version.
            :type  kb: :class:`str`
            :param kb: Link to kb article related to this the component version.
            :type  release_date: :class:`datetime.datetime`
            :param release_date: Release date of the component version.
            """
            self.version = version
            self.display_version = display_version
            self.summary = summary
            self.category = category
            self.urgency = urgency
            self.kb = kb
            self.release_date = release_date
            VapiStruct.__init__(self)

    ComponentVersionSummary._set_binding_type(
        type.StructType(
            'com.vmware.esx.settings.depot_content.components.component_version_summary',
            {
                'version': type.StringType(),
                'display_version': type.StringType(),
                'summary': type.StringType(),
                'category': type.ReferenceType(__name__,
                                               'Components.CategoryType'),
                'urgency': type.ReferenceType(__name__,
                                              'Components.UrgencyType'),
                'kb': type.URIType(),
                'release_date': type.DateTimeType(),
            }, ComponentVersionSummary, False, None))

    class FilterSpec(VapiStruct):
        """
        The ``Components.FilterSpec`` class contains attributes used to filter the
        results when listing components, see :func:`Components.list`).

        .. tip::
            The arguments are used to initialize data attributes with the same
            names.
        """
        def __init__(
            self,
            vendors=None,
            names=None,
            versions=None,
            min_version=None,
            bundle_types=None,
        ):
            """
            :type  vendors: :class:`set` of :class:`str` or ``None``
            :param vendors: Vendors that a component must have to match the filter.
                If None or empty, components with any vendor name match the filter.
            :type  names: :class:`set` of :class:`str` or ``None``
            :param names: Names that a component must have to match the filter.
                When clients pass a value of this class as a parameter, the
                attribute must contain identifiers for the resource type:
                ``com.vmware.esx.settings.component``. When methods return a value
                of this class as a return value, the attribute will contain
                identifiers for the resource type:
                ``com.vmware.esx.settings.component``.
                If None or empty, components with any name will match the filter.
            :type  versions: :class:`set` of :class:`str` or ``None``
            :param versions: Versions that a component must have to match the filter.
                If None or empty, components with any version will match the
                filter.
            :type  min_version: :class:`str` or ``None``
            :param min_version: Minimum version of the component that can match the filter.
                If :class:`set`, only components with version greater than or equal
                to the given version match the filter.
            :type  bundle_types: :class:`set` of :class:`Components.ComponentBundleType` or ``None``
            :param bundle_types: Component bundle types that a component must have to match the
                filter.
                If None or empty, all components will match the filter.
            """
            self.vendors = vendors
            self.names = names
            self.versions = versions
            self.min_version = min_version
            self.bundle_types = bundle_types
            VapiStruct.__init__(self)

    FilterSpec._set_binding_type(
        type.StructType(
            'com.vmware.esx.settings.depot_content.components.filter_spec', {
                'vendors':
                type.OptionalType(type.SetType(type.StringType())),
                'names':
                type.OptionalType(type.SetType(type.IdType())),
                'versions':
                type.OptionalType(type.SetType(type.StringType())),
                'min_version':
                type.OptionalType(type.StringType()),
                'bundle_types':
                type.OptionalType(
                    type.SetType(
                        type.ReferenceType(__name__,
                                           'Components.ComponentBundleType'))),
            }, FilterSpec, False, None))

    def list(
        self,
        filter=None,
    ):
        """
        Returns a list of currently available components in the depot.

        :type  filter: :class:`Components.FilterSpec` or ``None``
        :param filter: The specification of matching components.
            If None, the behavior is equivalent to a
            :class:`Components.FilterSpec` with all attributes None, which
            means ALL components match the filter.
        :rtype: :class:`list` of :class:`Components.Summary`
        :return: List of components in the depot.
        :raise: :class:`com.vmware.vapi.std.errors_client.Error` 
            If there is unknown internal error. The accompanying error message
            will give more details about the failure.
        :raise: :class:`com.vmware.vapi.std.errors_client.ServiceUnavailable` 
            If the service is not available.
        :raise: :class:`com.vmware.vapi.std.errors_client.Unauthenticated` 
            if the caller is not authenticated.
        :raise: :class:`com.vmware.vapi.std.errors_client.Unauthorized`
            if you do not have all of the privileges described as follows: 
            
            * Method execution requires ``VcIntegrity.lifecycleSettings.Read``.
        """
        return self._invoke('list', {
            'filter': filter,
        })
コード例 #11
0
class Harbor(VapiInterface):
    """
    The ``Harbor`` class provides methods to manage the lifecycle of an
    integrated Harbor container registry in vCenter.
    """

    _VAPI_SERVICE_ID = 'com.vmware.vcenter.content.registries.harbor'
    """
    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, _HarborStub)
        self._VAPI_OPERATION_IDS = {}

    class StorageSpec(VapiStruct):
        """
        The ``Harbor.StorageSpec`` class contains the specification required to
        configure storage associated with a Harbor registry. In this version,
        Harbor registry is created in Kubernetes environment, information in this
        class will result in storage quotas on a Kubernetes namespace.

        .. tip::
            The arguments are used to initialize data attributes with the same
            names.
        """
        def __init__(
            self,
            policy=None,
            limit=None,
        ):
            """
            :type  policy: :class:`str`
            :param policy: Identifier of the storage policy.
                When clients pass a value of this class as a parameter, the
                attribute must be an identifier for the resource type:
                ``SpsStorageProfile``. When methods return a value of this class as
                a return value, the attribute will be an identifier for the
                resource type: ``SpsStorageProfile``.
            :type  limit: :class:`long` or ``None``
            :param limit: The maximum amount of storage (in mebibytes) which can be utilized
                by the registry for this specification.
                If None, a default limit of 204800 mebibytes will be set as the
                registry's storage capacity.
            """
            self.policy = policy
            self.limit = limit
            VapiStruct.__init__(self)

    StorageSpec._set_binding_type(
        type.StructType(
            'com.vmware.vcenter.content.registries.harbor.storage_spec', {
                'policy': type.IdType(resource_types='SpsStorageProfile'),
                'limit': type.OptionalType(type.IntegerType()),
            }, StorageSpec, False, None))

    class StorageInfo(VapiStruct):
        """
        The ``Harbor.StorageInfo`` class contains the detailed information about
        storage used by the Harbor registry.

        .. tip::
            The arguments are used to initialize data attributes with the same
            names.
        """
        def __init__(
            self,
            policy=None,
            capacity=None,
            used=None,
        ):
            """
            :type  policy: :class:`str`
            :param policy: Identifier of the storage policy.
                When clients pass a value of this class as a parameter, the
                attribute must be an identifier for the resource type:
                ``SpsStorageProfile``. When methods return a value of this class as
                a return value, the attribute will be an identifier for the
                resource type: ``SpsStorageProfile``.
            :type  capacity: :class:`long`
            :param capacity: Total capacity for the registry storage (in mebibytes). This is the
                storage limit set on the Harbor registry. If a storage limit was
                not set on the registry, the default registry capacity - 204800
                mebibytes is used.
            :type  used: :class:`long`
            :param used: Overall storage used by the registry (in mebibytes). This is the
                sum of used storage associated with storage policies configured for
                the registry.
            """
            self.policy = policy
            self.capacity = capacity
            self.used = used
            VapiStruct.__init__(self)

    StorageInfo._set_binding_type(
        type.StructType(
            'com.vmware.vcenter.content.registries.harbor.storage_info', {
                'policy': type.IdType(resource_types='SpsStorageProfile'),
                'capacity': type.IntegerType(),
                'used': type.IntegerType(),
            }, StorageInfo, False, None))

    class GarbageCollection(VapiStruct):
        """
        The ``Harbor.GarbageCollection`` class contains garbage collection
        configuration for the Harbor registry.

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

        _validator_list = [
            UnionValidator(
                'type', {
                    'WEEKLY': [('day_of_week', True), ('hour', True),
                               ('minute', True)],
                    'DAILY': [('hour', True), ('minute', True)],
                    'NONE': [],
                }),
        ]

        def __init__(
            self,
            type=None,
            day_of_week=None,
            hour=None,
            minute=None,
        ):
            """
            :type  type: :class:`Recurrence`
            :param type: Frequency of garbage collection.
            :type  day_of_week: :class:`DayOfWeek`
            :param day_of_week: Day of the week when garbage collection should run.
                This attribute is optional and it is only relevant when the value
                of ``type`` is :attr:`Recurrence.WEEKLY`.
            :type  hour: :class:`long`
            :param hour: Hour at which garbage collection should run.
                This attribute is optional and it is only relevant when the value
                of ``type`` is one of :attr:`Recurrence.DAILY` or
                :attr:`Recurrence.WEEKLY`.
            :type  minute: :class:`long`
            :param minute: Minute at which garbage collection should run.
                This attribute is optional and it is only relevant when the value
                of ``type`` is one of :attr:`Recurrence.DAILY` or
                :attr:`Recurrence.WEEKLY`.
            """
            self.type = type
            self.day_of_week = day_of_week
            self.hour = hour
            self.minute = minute
            VapiStruct.__init__(self)

    GarbageCollection._set_binding_type(
        type.StructType(
            'com.vmware.vcenter.content.registries.harbor.garbage_collection',
            {
                'type':
                type.ReferenceType(__name__, 'Recurrence'),
                'day_of_week':
                type.OptionalType(type.ReferenceType(__name__, 'DayOfWeek')),
                'hour':
                type.OptionalType(type.IntegerType()),
                'minute':
                type.OptionalType(type.IntegerType()),
            }, GarbageCollection, False, None))

    class CreateSpec(VapiStruct):
        """
        The ``Harbor.CreateSpec`` class contains the specification required to
        create a Harbor registry.

        .. tip::
            The arguments are used to initialize data attributes with the same
            names.
        """
        def __init__(
            self,
            cluster=None,
            garbage_collection=None,
            storage=None,
        ):
            """
            :type  cluster: :class:`str` or ``None``
            :param cluster: Identifier of the cluster hosting the registry.
                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``.
                If None, registry will not be created on a specified cluster. This
                is required in current version, since Harbor can only be created on
                a cluster with Kubernetes enabled.
            :type  garbage_collection: :class:`Harbor.GarbageCollection` or ``None``
            :param garbage_collection: Garbage collection configuration for the Harbor registry.
                If None, a default configuration is set, Recurrence#WEEKLY,
                DayOfWeek#SATURDAY, GarbageCollection#hour is 2,
                GarbageCollection#minute is 0.
            :type  storage: :class:`list` of :class:`Harbor.StorageSpec`
            :param storage: Storage associated with the Harbor registry. The list contains only
                one storage backing in this version.
            """
            self.cluster = cluster
            self.garbage_collection = garbage_collection
            self.storage = storage
            VapiStruct.__init__(self)

    CreateSpec._set_binding_type(
        type.StructType(
            'com.vmware.vcenter.content.registries.harbor.create_spec', {
                'cluster':
                type.OptionalType(type.IdType()),
                'garbage_collection':
                type.OptionalType(
                    type.ReferenceType(__name__, 'Harbor.GarbageCollection')),
                'storage':
                type.ListType(
                    type.ReferenceType(__name__, 'Harbor.StorageSpec')),
            }, CreateSpec, False, None))

    class Summary(VapiStruct):
        """
        The ``Harbor.Summary`` class contains basic information about a running
        Harbor registry.

        .. tip::
            The arguments are used to initialize data attributes with the same
            names.
        """
        def __init__(
            self,
            cluster=None,
            registry=None,
            version=None,
            ui_access_url=None,
        ):
            """
            :type  cluster: :class:`str` or ``None``
            :param cluster: Identifier 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``. When methods return a value of this
                class as a return value, the attribute will be an identifier for
                the resource type: ``ClusterComputeResource``.
                If None, container registry is not created on the cluster specified
                by :attr:`Harbor.CreateSpec.cluster`.
            :type  registry: :class:`str`
            :param registry: Identifier of the registry.
                When clients pass a value of this class as a parameter, the
                attribute must be an identifier for the resource type:
                ``com.vmware.vcenter.content.Registry``. 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.content.Registry``.
            :type  version: :class:`str`
            :param version: Version of the registry.
            :type  ui_access_url: :class:`str`
            :param ui_access_url: URL to access the UI of the registry.
            """
            self.cluster = cluster
            self.registry = registry
            self.version = version
            self.ui_access_url = ui_access_url
            VapiStruct.__init__(self)

    Summary._set_binding_type(
        type.StructType(
            'com.vmware.vcenter.content.registries.harbor.summary', {
                'cluster':
                type.OptionalType(type.IdType()),
                'registry':
                type.IdType(
                    resource_types='com.vmware.vcenter.content.Registry'),
                'version':
                type.StringType(),
                'ui_access_url':
                type.URIType(),
            }, Summary, False, None))

    class Info(VapiStruct):
        """
        The ``Harbor.Info`` class contains detailed information about a running
        Harbor registry.

        .. tip::
            The arguments are used to initialize data attributes with the same
            names.
        """
        def __init__(
            self,
            cluster=None,
            namespace=None,
            version=None,
            creation_time=None,
            ui_access_url=None,
            cert_chain=None,
            garbage_collection=None,
            storage=None,
            health=None,
        ):
            """
            :type  cluster: :class:`str` or ``None``
            :param cluster: Identifier 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``. When methods return a value of this
                class as a return value, the attribute will be an identifier for
                the resource type: ``ClusterComputeResource``.
                If None, container registry is not created on the cluster specified
                by :attr:`Harbor.CreateSpec.cluster`.
            :type  namespace: :class:`str` or ``None``
            :param namespace: Identifier of the Harbor namespace in case it is created in a
                Kubernetes environment.
                When clients pass a value of this class as a parameter, the
                attribute must be an identifier for the resource type:
                ``NamespaceInstance``. When methods return a value of this class as
                a return value, the attribute will be an identifier for the
                resource type: ``NamespaceInstance``.
                If None, no Kubernetes namespace is created for the Harbor.
            :type  version: :class:`str`
            :param version: Version of the registry.
            :type  creation_time: :class:`datetime.datetime`
            :param creation_time: The date and time when the harbor registry was created.
            :type  ui_access_url: :class:`str`
            :param ui_access_url: URL to access the UI of the registry.
            :type  cert_chain: :class:`list` of :class:`str`
            :param cert_chain: Harbor certificate chain in base64 format.
            :type  garbage_collection: :class:`Harbor.GarbageCollection`
            :param garbage_collection: Garbage collection information for the registry.
            :type  storage: :class:`list` of :class:`Harbor.StorageInfo`
            :param storage: Storage information associated with the registry.
            :type  health: :class:`Health.Info`
            :param health: Health status of the container registry.
            """
            self.cluster = cluster
            self.namespace = namespace
            self.version = version
            self.creation_time = creation_time
            self.ui_access_url = ui_access_url
            self.cert_chain = cert_chain
            self.garbage_collection = garbage_collection
            self.storage = storage
            self.health = health
            VapiStruct.__init__(self)

    Info._set_binding_type(
        type.StructType(
            'com.vmware.vcenter.content.registries.harbor.info', {
                'cluster':
                type.OptionalType(type.IdType()),
                'namespace':
                type.OptionalType(type.IdType()),
                'version':
                type.StringType(),
                'creation_time':
                type.DateTimeType(),
                'ui_access_url':
                type.URIType(),
                'cert_chain':
                type.ListType(type.StringType()),
                'garbage_collection':
                type.ReferenceType(__name__, 'Harbor.GarbageCollection'),
                'storage':
                type.ListType(
                    type.ReferenceType(__name__, 'Harbor.StorageInfo')),
                'health':
                type.ReferenceType(__name__, 'Health.Info'),
            }, Info, False, None))

    def create(
        self,
        spec,
        client_token=None,
    ):
        """
        Creates a Harbor registry in the cluster.

        :type  client_token: :class:`str` or ``None``
        :param client_token: A unique token generated on the client for each creation request.
            The token should be a universally unique identifier (UUID), for
            example: ``b8a2a2e3-2314-43cd-a871-6ede0f429751``. This token can
            be used to guarantee idempotent creation.
            If not specified, creation is not idempotent.
        :type  spec: :class:`Harbor.CreateSpec`
        :param spec: Specification for creating the Harbor registry.
        :rtype: :class:`str`
        :return: Identifier of the deployed registry.
            The return value will be an identifier for the resource type:
            ``com.vmware.vcenter.content.Registry``.
        :raise: :class:`com.vmware.vapi.std.errors_client.AlreadyExists` 
            if a Harbor already exists in the associated cluster.
        :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` 
            if resources/objects could not be located.
        :raise: :class:`com.vmware.vapi.std.errors_client.Unsupported` 
            if :attr:`Harbor.CreateSpec.cluster` does not have vSphere
            namespace enabled.
        :raise: :class:`com.vmware.vapi.std.errors_client.InvalidArgument` 
            if ``spec`` contains any errors.
        :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 ContentLibrary.ManageRegistry and/or
            CertificateAuthority.Manage privilege, or user does not have
            ContentLibrary.ManageClusterRegistryResource privilege on
            :attr:`Harbor.CreateSpec.cluster`.
        """
        return self._invoke('create', {
            'client_token': client_token,
            'spec': spec,
        })

    def delete(
        self,
        registry,
    ):
        """
        Delete the Harbor registry in the cluster. All Harbor projects,
        repositories and images will be deleted upon Harbor registry deletion.

        :type  registry: :class:`str`
        :param registry: Identifier of the registry.
            The parameter must be an identifier for the resource type:
            ``com.vmware.vcenter.content.Registry``.
        :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` 
            if a registry specified by ``registry`` could not be found.
        :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 ContentLibrary.ManageRegistry privilege.
        """
        return self._invoke('delete', {
            'registry': registry,
        })

    def get(
        self,
        registry,
    ):
        """
        Get detailed information of the Harbor registry.

        :type  registry: :class:`str`
        :param registry: Identifier of the registry.
            The parameter must be an identifier for the resource type:
            ``com.vmware.vcenter.content.Registry``.
        :rtype: :class:`Harbor.Info`
        :return: Information about the registry.
        :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` 
            if a Harbor registry specified by ``registry`` could not be found.
        :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', {
            'registry': registry,
        })

    def list(self):
        """
        Returns basic information of all Harbor registries.


        :rtype: :class:`list` of :class:`Harbor.Summary`
        :return: The list of basic information of all Harbor registries.
        :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)
コード例 #12
0
            of ``type`` is :attr:`SourceType.REMOTE`.
        """
        self.description = description
        self.type = type
        self.filepath = filepath
        self.address = address
        VapiStruct.__init__(self)


SourceCreateSpec._set_binding_type(
    type.StructType(
        'com.vmware.vapi.metadata.source_create_spec', {
            'description': type.StringType(),
            'type': type.ReferenceType(__name__, 'SourceType'),
            'filepath': type.OptionalType(type.StringType()),
            'address': type.OptionalType(type.URIType()),
        }, SourceCreateSpec, False, None))


class SourceInfo(VapiStruct):
    """
    Metadata source info

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

    _validator_list = [
        UnionValidator(
            'type', {
コード例 #13
0
class Reports(VapiInterface):
    """
    The ``Report`` class provides an method to download the report generated by
    the interop and precheck operations. To download a report, you must use the
    ``get`` method. A ``Report.Location`` class represents the location of the
    file which has ``Report.Token`` class which represents the token ID
    (\\\\@name String) and the expiration time of the token
    ``Report.Token.expiry`` DateTime. ``Report.Location`` class also has the
    URI for the file which needs to be downloaded.
    """

    _VAPI_SERVICE_ID = 'com.vmware.vcenter.lcm.reports'
    """
    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, _ReportsStub)
        self._VAPI_OPERATION_IDS = {}

    class Token(VapiStruct):
        """
        The ``Reports.Token`` class contains information about the token required
        in the HTTP GET request to generate the report.

        .. tip::
            The arguments are used to initialize data attributes with the same
            names.
        """
        def __init__(
            self,
            token=None,
            expiry=None,
        ):
            """
            :type  token: :class:`str`
            :param token: A one-time, short-lived token required in the HTTP header of the
                request to the url. This token needs to be passed in as a header
                with the name "session-id".
            :type  expiry: :class:`datetime.datetime`
            :param expiry: Expiry time of the token
            """
            self.token = token
            self.expiry = expiry
            VapiStruct.__init__(self)

    Token._set_binding_type(
        type.StructType('com.vmware.vcenter.lcm.reports.token', {
            'token': type.StringType(),
            'expiry': type.DateTimeType(),
        }, Token, False, None))

    class Location(VapiStruct):
        """
        The ``Reports.Location`` class contains the URI location to download the
        report from, as well as a token required (as a header on the HTTP request)
        to get the bundle. The validity of the token is 5 minutes as best attempt.
        After the token expires, any attempt to call the URI with said token will
        fail.

        .. tip::
            The arguments are used to initialize data attributes with the same
            names.
        """
        def __init__(
            self,
            uri=None,
            download_file_token=None,
        ):
            """
            :type  uri: :class:`str`
            :param uri: Report Download URI.
            :type  download_file_token: :class:`Reports.Token`
            :param download_file_token: Information about the token required in the HTTP GET request to
                retrieve the report
            """
            self.uri = uri
            self.download_file_token = download_file_token
            VapiStruct.__init__(self)

    Location._set_binding_type(
        type.StructType(
            'com.vmware.vcenter.lcm.reports.location', {
                'uri':
                type.URIType(),
                'download_file_token':
                type.ReferenceType(__name__, 'Reports.Token'),
            }, Location, False, None))

    def get(
        self,
        report,
    ):
        """
        Returns the location :class:`Reports.Location` information for
        downloading the report for the specified file name. 
        
         Retrieving a report involves two steps: 
        
        * Step 1: Invoke the :func:`Reports.get` method to provision a token
          and a URI.
        * Step 2: Make an HTTP GET request by using the URI and the token
          returned in step 1 to retrieve the report.
        
         
        
         The HTTP GET request will: 
        
        * Return 401 (Not Authorized) if the download URI is recognized, but
          the token is invalid, 404 if the URL is not recognized otherwise return
          200 (OK)
        * Provide the CSV contents as the output of the request. The API
          accepts the file name as input, reads the contents of that CSV file,
          and returns this text as the result of the API.

        :type  report: :class:`str`
        :param report: 
            The parameter must be an identifier for the resource type:
            ``com.vmware.vcenter.lcm.report``.
        :rtype: :class:`Reports.Location`
        :return: 
        :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 file associated with ``report`` 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 failure.
        """
        return self._invoke('get', {
            'report': report,
        })
コード例 #14
0
class CompatibilityReport(VapiInterface):
    """
    This class provides methods to generate hardware compatibility report for a
    given ESXi host against a specific ESXi release.
    """

    _VAPI_SERVICE_ID = 'com.vmware.esx.hcl.hosts.compatibility_report'
    """
    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, _CompatibilityReportStub)
        self._VAPI_OPERATION_IDS = {}
        self._VAPI_OPERATION_IDS.update({'create_task': 'create$task'})

    class BiosConstraint(VapiStruct):
        """
        This ``CompatibilityReport.BiosConstraint`` class contains attributes that
        describe the BIOS that is supported for the given server and ESXi release.

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




        def __init__(self,
                     bios=None,
                     notes=None,
                    ):
            """
            :type  bios: :class:`com.vmware.esx.hcl_client.Firmware`
            :param bios: The BIOS information about the constraint.
            :type  notes: :class:`list` of :class:`com.vmware.vapi.std_client.LocalizableMessage`
            :param notes: Any information that should be taken into account when reviewing
                the BIOS constraint.
            """
            self.bios = bios
            self.notes = notes
            VapiStruct.__init__(self)


    BiosConstraint._set_binding_type(type.StructType(
        'com.vmware.esx.hcl.hosts.compatibility_report.bios_constraint', {
            'bios': type.ReferenceType('com.vmware.esx.hcl_client', 'Firmware'),
            'notes': type.ListType(type.ReferenceType('com.vmware.vapi.std_client', 'LocalizableMessage')),
        },
        BiosConstraint,
        False,
        None))


    class ServerCompatibility(VapiStruct):
        """
        This ``CompatibilityReport.ServerCompatibility`` class contains attributes
        that provide the compatibility information for a server model, cpu and
        BIOS.

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




        def __init__(self,
                     bios_constraints=None,
                     cpu_series=None,
                     supported_releases=None,
                     vcg_link=None,
                     notes=None,
                    ):
            """
            :type  bios_constraints: :class:`list` of :class:`CompatibilityReport.BiosConstraint` or ``None``
            :param bios_constraints: Lists the BIOS constraints that the target ESXi release has for
                this server.
                If None no constraints are present as server is either not
                compatible or compatibility information is not found.
            :type  cpu_series: :class:`str`
            :param cpu_series: The CPU series name.
            :type  supported_releases: :class:`list` of :class:`str` or ``None``
            :param supported_releases: Provides information about supported releases for this entry.
                If None server is compatible with the given target release.
            :type  vcg_link: :class:`str`
            :param vcg_link: Provides link to the VMware Compatibility Guide for further
                information on the compatibility.
            :type  notes: :class:`list` of :class:`com.vmware.vapi.std_client.LocalizableMessage` or ``None``
            :param notes: Information that needs to be taken into account when considering
                this server hardware compatibility.
                Only :class:`set` if there is any information reported.
            """
            self.bios_constraints = bios_constraints
            self.cpu_series = cpu_series
            self.supported_releases = supported_releases
            self.vcg_link = vcg_link
            self.notes = notes
            VapiStruct.__init__(self)


    ServerCompatibility._set_binding_type(type.StructType(
        'com.vmware.esx.hcl.hosts.compatibility_report.server_compatibility', {
            'bios_constraints': type.OptionalType(type.ListType(type.ReferenceType(__name__, 'CompatibilityReport.BiosConstraint'))),
            'cpu_series': type.StringType(),
            'supported_releases': type.OptionalType(type.ListType(type.StringType())),
            'vcg_link': type.URIType(),
            'notes': type.OptionalType(type.ListType(type.ReferenceType('com.vmware.vapi.std_client', 'LocalizableMessage'))),
        },
        ServerCompatibility,
        False,
        None))


    class ServerHclInfo(VapiStruct):
        """
        This ``CompatibilityReport.ServerHclInfo`` class contains attributes that
        describe the server of a ESXi host and its compatibility information.

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




        def __init__(self,
                     server=None,
                     matches=None,
                     model_compatibility=None,
                    ):
            """
            :type  server: :class:`com.vmware.esx.hcl_client.Server`
            :param server: Information about the server.
            :type  matches: :class:`list` of :class:`CompatibilityReport.ServerCompatibility`
            :param matches: Provides information about possible compatibility matches for the
                given server. 
                
                There could be multiple matches returned as there are several
                possible matches in the Compatibility data.
            :type  model_compatibility: :class:`com.vmware.esx.hcl_client.CompatibilityStatus`
            :param model_compatibility: Shows if the server model is compatible with given target ESXi
                release.
            """
            self.server = server
            self.matches = matches
            self.model_compatibility = model_compatibility
            VapiStruct.__init__(self)


    ServerHclInfo._set_binding_type(type.StructType(
        'com.vmware.esx.hcl.hosts.compatibility_report.server_hcl_info', {
            'server': type.ReferenceType('com.vmware.esx.hcl_client', 'Server'),
            'matches': type.ListType(type.ReferenceType(__name__, 'CompatibilityReport.ServerCompatibility')),
            'model_compatibility': type.ReferenceType('com.vmware.esx.hcl_client', 'CompatibilityStatus'),
        },
        ServerHclInfo,
        False,
        None))


    class DeviceConstraint(VapiStruct):
        """
        This ``CompatibilityReport.DeviceConstraint`` class contains attributes
        that describe pair of driver and firmware that are supported for a given
        PCI device and ESXi release.

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




        def __init__(self,
                     driver=None,
                     firmware=None,
                     notes=None,
                    ):
            """
            :type  driver: :class:`com.vmware.esx.hcl_client.Driver`
            :param driver: The driver information about the constraint.
            :type  firmware: :class:`com.vmware.esx.hcl_client.Firmware` or ``None``
            :param firmware: The firmware information about the constraint.
                If None there is no firmware restriction on the driver to work with
                that release.
            :type  notes: :class:`list` of :class:`com.vmware.vapi.std_client.LocalizableMessage`
            :param notes: Any information that should be taken into account when reviewing
                the device constraint.
            """
            self.driver = driver
            self.firmware = firmware
            self.notes = notes
            VapiStruct.__init__(self)


    DeviceConstraint._set_binding_type(type.StructType(
        'com.vmware.esx.hcl.hosts.compatibility_report.device_constraint', {
            'driver': type.ReferenceType('com.vmware.esx.hcl_client', 'Driver'),
            'firmware': type.OptionalType(type.ReferenceType('com.vmware.esx.hcl_client', 'Firmware')),
            'notes': type.ListType(type.ReferenceType('com.vmware.vapi.std_client', 'LocalizableMessage')),
        },
        DeviceConstraint,
        False,
        None))


    class DeviceHclInfo(VapiStruct):
        """
        This ``CompatibilityReport.DeviceHclInfo`` class contains attributes that
        describe a PCI device of a given ESXi host and its compatibility
        information. 
        
        If there are multiple PCI devices of the same type on the host each one
        will be listed in separate instance of this class.

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




        def __init__(self,
                     compatibility=None,
                     device=None,
                     device_constraints=None,
                     supported_releases=None,
                     vcg_link=None,
                     notes=None,
                    ):
            """
            :type  compatibility: :class:`com.vmware.esx.hcl_client.CompatibilityStatus`
            :param compatibility: Indicates compatibility status of the PCI device.
            :type  device: :class:`com.vmware.esx.hcl_client.PCIDevice`
            :param device: Information about the PCI device.
            :type  device_constraints: :class:`list` of :class:`CompatibilityReport.DeviceConstraint` or ``None``
            :param device_constraints: Lists the constraints the target ESXi release has for this PCI
                device
                If None no constraints are present as PCI device is either not
                compatible or compatibility information is not found.
            :type  supported_releases: :class:`list` of :class:`str` or ``None``
            :param supported_releases: Provides information about supported releases for this device.
                If None device is compatible with the given target release.
            :type  vcg_link: :class:`str` or ``None``
            :param vcg_link: Provides link to the VMware Compatibility Guide for further
                information on the compatibility.
                If None there is no VMware Compatibility link available as this is
                device used by VSAN.
            :type  notes: :class:`list` of :class:`com.vmware.vapi.std_client.LocalizableMessage` or ``None``
            :param notes: Information that needs to be taken into account when considering
                this device hcl.
                Only :class:`set` if there is any information reported.
            """
            self.compatibility = compatibility
            self.device = device
            self.device_constraints = device_constraints
            self.supported_releases = supported_releases
            self.vcg_link = vcg_link
            self.notes = notes
            VapiStruct.__init__(self)


    DeviceHclInfo._set_binding_type(type.StructType(
        'com.vmware.esx.hcl.hosts.compatibility_report.device_hcl_info', {
            'compatibility': type.ReferenceType('com.vmware.esx.hcl_client', 'CompatibilityStatus'),
            'device': type.ReferenceType('com.vmware.esx.hcl_client', 'PCIDevice'),
            'device_constraints': type.OptionalType(type.ListType(type.ReferenceType(__name__, 'CompatibilityReport.DeviceConstraint'))),
            'supported_releases': type.OptionalType(type.ListType(type.StringType())),
            'vcg_link': type.OptionalType(type.URIType()),
            'notes': type.OptionalType(type.ListType(type.ReferenceType('com.vmware.vapi.std_client', 'LocalizableMessage'))),
        },
        DeviceHclInfo,
        False,
        None))


    class HclReport(VapiStruct):
        """
        This ``CompatibilityReport.HclReport`` represents the hardware
        compatibility report generated for a specific host and target ESXi release.

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




        def __init__(self,
                     host=None,
                     target_release=None,
                     server_hcl=None,
                     devices_hcl=None,
                     generated_at=None,
                     notifications=None,
                    ):
            """
            :type  host: :class:`str`
            :param host: FQDN identifying the ESXi host that the report refers to.
            :type  target_release: :class:`str`
            :param target_release: Indicates for which ESXi release the report is generated.
            :type  server_hcl: :class:`CompatibilityReport.ServerHclInfo`
            :param server_hcl: Lists compatibility information for the ESXi's server part.
            :type  devices_hcl: :class:`list` of :class:`CompatibilityReport.DeviceHclInfo` or ``None``
            :param devices_hcl: Lists compatibility information for discoverable PCI devices of the
                host.
                If None the server is not compatible with the requested release and
                the PCI devices cannot be checked.
            :type  generated_at: :class:`datetime.datetime`
            :param generated_at: Specifies the time the report was generated.
            :type  notifications: :class:`com.vmware.esx.hcl_client.Notifications`
            :param notifications: Notifications returned by the operation.
            """
            self.host = host
            self.target_release = target_release
            self.server_hcl = server_hcl
            self.devices_hcl = devices_hcl
            self.generated_at = generated_at
            self.notifications = notifications
            VapiStruct.__init__(self)


    HclReport._set_binding_type(type.StructType(
        'com.vmware.esx.hcl.hosts.compatibility_report.hcl_report', {
            'host': type.URIType(),
            'target_release': type.StringType(),
            'server_hcl': type.ReferenceType(__name__, 'CompatibilityReport.ServerHclInfo'),
            'devices_hcl': type.OptionalType(type.ListType(type.ReferenceType(__name__, 'CompatibilityReport.DeviceHclInfo'))),
            'generated_at': type.DateTimeType(),
            'notifications': type.ReferenceType('com.vmware.esx.hcl_client', 'Notifications'),
        },
        HclReport,
        False,
        None))


    class Result(VapiStruct):
        """
        The ``CompatibilityReport.Result`` class contains the result of hardware
        compatibility report creation operation.

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




        def __init__(self,
                     report=None,
                     identifier=None,
                    ):
            """
            :type  report: :class:`CompatibilityReport.HclReport`
            :param report: The hardware compatibility report.
            :type  identifier: :class:`str` or ``None``
            :param identifier: The identifier of the compatibility report. 
                
                :func:`com.vmware.esx.hcl_client.Reports.get` provides location
                where a file based report based on the
                ``CompatibilityReport.HclReport`` can be downloaded using this
                identifier.
                When clients pass a value of this class as a parameter, the
                attribute must be an identifier for the resource type:
                ``com.vmware.esx.hcl.resources.CompatibilityReport``. When methods
                return a value of this class as a return value, the attribute will
                be an identifier for the resource type:
                ``com.vmware.esx.hcl.resources.CompatibilityReport``.
                None in case of error reported in
                :attr:`CompatibilityReport.HclReport.notifications`.
            """
            self.report = report
            self.identifier = identifier
            VapiStruct.__init__(self)


    Result._set_binding_type(type.StructType(
        'com.vmware.esx.hcl.hosts.compatibility_report.result', {
            'report': type.ReferenceType(__name__, 'CompatibilityReport.HclReport'),
            'identifier': type.OptionalType(type.IdType()),
        },
        Result,
        False,
        None))


    class Spec(VapiStruct):
        """
        The ``CompatibilityReport.Spec`` class contains attributes to describe the
        input configuration for an ESXi's compatibility report generation.

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




        def __init__(self,
                     release=None,
                    ):
            """
            :type  release: :class:`str`
            :param release: A target ESXi release which will be used to generate a
                compatibility report. Releases that can be used to generate report
                can be found using :func:`CompatibilityReleases.list`
            """
            self.release = release
            VapiStruct.__init__(self)


    Spec._set_binding_type(type.StructType(
        'com.vmware.esx.hcl.hosts.compatibility_report.spec', {
            'release': type.StringType(),
        },
        Spec,
        False,
        None))




    def create_task(self,
               host,
               spec=None,
               ):
        """
        Generates hardware compatibility report for a specified ESXi host
        against specific ESXi release.
        
        The result of this operation can be queried by calling the
        cis/tasks/{task-id} where the task-id is the response of this
        operation.

        :type  host: :class:`str`
        :param host: Contains the MoID identifying the ESXi host.
            The parameter must be an identifier for the resource type:
            ``HostSystem``.
        :type  spec: :class:`CompatibilityReport.Spec` or ``None``
        :param spec: Specifies the input parameters for generating compatibility report.
            If None host compatibility will be checked against the current
            release of the ESXi.
        :rtype: :class:  `vmware.vapi.stdlib.client.task.Task`
        :return: Task instance
        :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` 
            if no host with the given MoID can be found.
        :raise: :class:`com.vmware.vapi.std.errors_client.Unauthenticated` 
            if the caller is not authenticated.
        :raise: :class:`com.vmware.vapi.std.errors_client.Unsupported` 
            if the provided host is not supported.
        :raise: :class:`com.vmware.vapi.std.errors_client.ResourceInaccessible` 
            if the vCenter this API is executed on is not part of the Customer
            Experience Improvement Program (CEIP).
        :raise: :class:`com.vmware.vapi.std.errors_client.NotAllowedInCurrentState` 
            if there is no compatibility data on the vCenter executing the
            operation.
        :raise: :class:`com.vmware.vapi.std.errors_client.Error` 
            If there is some unknown error. The accompanying error message will
            give more details about the failure.
        """
        task_id = self._invoke('create$task',
                                {
                                'host': host,
                                'spec': spec,
                                })
        task_svc = Tasks(self._config)
        task_instance = Task(task_id, task_svc, type.ReferenceType(__name__, 'CompatibilityReport.Result'))
        return task_instance

    def get(self,
            host,
            ):
        """
        Returns the last generated hardware compatibility report for the given
        host.

        :type  host: :class:`str`
        :param host: 
            The parameter must be an identifier for the resource type:
            ``HostSystem``.
        :rtype: :class:`CompatibilityReport.Result`
        :return: 
        :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` 
            if there is no report generated for the given host. This operation
            does not check if the host id is valid or it exists.
        :raise: :class:`com.vmware.vapi.std.errors_client.Unauthenticated` 
            if the caller is not authenticated.
        :raise: :class:`com.vmware.vapi.std.errors_client.ResourceInaccessible` 
            if the vCenter this API is executed on is not part of the Customer
            Experience Improvement Program (CEIP).
        :raise: :class:`com.vmware.vapi.std.errors_client.Error` 
            If there is some unknown error. The accompanying error message will
            give more details about the failure.
        """
        return self._invoke('get',
                            {
                            'host': host,
                            })
コード例 #15
0
    Type._set_values([
        Type('invalid_request'),
        Type('invalid_scope'),
        Type('invalid_grant'),
    ])
    Type._set_binding_type(
        type.EnumType('com.vmware.oauth2.errors.error.type', Type))


Error._set_binding_type(
    type.ErrorType(
        'com.vmware.oauth2.errors.error', {
            'error': type.ReferenceType(__name__, 'Error.Type'),
            'error_description': type.OptionalType(type.StringType()),
            'error_uri': type.OptionalType(type.URIType()),
        }, Error))


class InvalidScope(Error):
    """
    Indicates that the requested scope is invalid, unknown, malformed, or
    exceeds the scope granted by the resource owner.

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

    _qualname = 'InvalidScope'
コード例 #16
0
class Source(VapiInterface):
    """
    The ``Source`` class provides methods to manage the sources of privilege
    metadata information. 
    
    The interface definition language infrastructure provides tools to generate
    various kinds of metadata in JSON format from the interface definition
    files and additional properties files. One of the generated files contains
    privilege information. The generated file can be registered as a source of
    metadata. 
    
    The privilege file contains all the data present in the interface
    definition files. Each privilege file contains data about one component
    element. When a privilege file is added as a source, each source
    contributes only one component element's metadata. 
    
    Privilege metadata can also be discovered from a remote server that
    supports the privilege metadata classes (see
    :mod:`com.vmware.vapi.metadata.privilege_client`). Since multiple
    components can be registered with a single metadata server, when a remote
    server is registered as a source, that source can contribute more than one
    component.
    """
    RESOURCE_TYPE = "com.vmware.vapi.metadata.privilege.source"
    """
    Resource type for metadata source.

    """


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

    class Info(VapiStruct):
        """
        The ``Source.Info`` class contains the metadata source information.

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

        _validator_list = [
            UnionValidator(
                'type',
                {
                    'FILE' : [('filepath', True)],
                    'REMOTE' : [('address', True)],
                }
            ),
        ]



        def __init__(self,
                     description=None,
                     type=None,
                     filepath=None,
                     address=None,
                    ):
            """
            :type  description: :class:`str`
            :param description: English language human readable description of the source.
            :type  type: :class:`com.vmware.vapi.metadata_client.SourceType`
            :param type: Type of the metadata source.
            :type  filepath: :class:`str`
            :param filepath: Absolute file path of the privilege metadata file that has the
                privilege information about one component element. The ``filePath``
                is the path to the file in the server's filesystem.
                This attribute is optional and it is only relevant when the value
                of ``type`` is
                :attr:`com.vmware.vapi.metadata_client.SourceType.FILE`.
            :type  address: :class:`str`
            :param address: Connection information for the remote server. This must be in the
                format http(s)://IP:port/namespace. 
                
                The remote server must support the classes in the
                :mod:`com.vmware.vapi.metadata.privilege_client` module. It must
                expose privilege information of one or more components.
                This attribute is optional and it is only relevant when the value
                of ``type`` is
                :attr:`com.vmware.vapi.metadata_client.SourceType.REMOTE`.
            """
            self.description = description
            self.type = type
            self.filepath = filepath
            self.address = address
            VapiStruct.__init__(self)

    Info._set_binding_type(type.StructType(
        'com.vmware.vapi.metadata.privilege.source.info', {
            'description': type.StringType(),
            'type': type.ReferenceType('com.vmware.vapi.metadata_client', 'SourceType'),
            'filepath': type.OptionalType(type.StringType()),
            'address': type.OptionalType(type.URIType()),
        },
        Info,
        False,
        None))


    class CreateSpec(VapiStruct):
        """
        The ``Source.CreateSpec`` class contains the registration information of a
        privilege source.

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

        _validator_list = [
            UnionValidator(
                'type',
                {
                    'FILE' : [('filepath', True)],
                    'REMOTE' : [('address', True)],
                }
            ),
        ]



        def __init__(self,
                     description=None,
                     type=None,
                     filepath=None,
                     address=None,
                    ):
            """
            :type  description: :class:`str`
            :param description: English language human readable description of the source.
            :type  type: :class:`com.vmware.vapi.metadata_client.SourceType`
            :param type: Type of the metadata source.
            :type  filepath: :class:`str`
            :param filepath: Absolute file path of the metamodel metadata file that has the
                metamodel information about one component element.
                This attribute is optional and it is only relevant when the value
                of ``type`` is
                :attr:`com.vmware.vapi.metadata_client.SourceType.FILE`.
            :type  address: :class:`str`
            :param address: Connection information of the remote server. This should be of the
                format http(s)://IP:port/namespace. 
                
                The remote server should contain the classes in
                :mod:`com.vmware.vapi.metadata.metamodel_client` module. It could
                expose metamodel information of one or more components.
                This attribute is optional and it is only relevant when the value
                of ``type`` is
                :attr:`com.vmware.vapi.metadata_client.SourceType.REMOTE`.
            """
            self.description = description
            self.type = type
            self.filepath = filepath
            self.address = address
            VapiStruct.__init__(self)

    CreateSpec._set_binding_type(type.StructType(
        'com.vmware.vapi.metadata.privilege.source.create_spec', {
            'description': type.StringType(),
            'type': type.ReferenceType('com.vmware.vapi.metadata_client', 'SourceType'),
            'filepath': type.OptionalType(type.StringType()),
            'address': type.OptionalType(type.URIType()),
        },
        CreateSpec,
        False,
        None))



    def create(self,
               source_id,
               spec,
               ):
        """
        Creates a new metadata source. Once the server validates the
        registration information of the metadata source, the privilege metadata
        is retrieved from the source. This populates elements in all the
        classes defined in :mod:`com.vmware.vapi.metadata.privilege_client`
        module.

        :type  source_id: :class:`str`
        :param source_id: metadata source identifier.
            The parameter must be an identifier for the resource type:
            ``com.vmware.vapi.metadata.privilege.source``.
        :type  spec: :class:`Source.CreateSpec`
        :param spec: create specification.
        :raise: :class:`com.vmware.vapi.std.errors_client.AlreadyExists` 
            if the metadata source identifier is already registered with the
            infrastructure.
        :raise: :class:`com.vmware.vapi.std.errors_client.InvalidArgument` 
            if the type of the source specified in null is invalid.
        :raise: :class:`com.vmware.vapi.std.errors_client.InvalidArgument` 
            if the file specified in null is not a valid JSON file or if the
            format of the privilege metadata in the JSON file is invalid.
        :raise: :class:`com.vmware.vapi.std.errors_client.InvalidArgument` 
            if the URI specified in null is unreachable or if there is a
            transport protocol or message protocol mismatch between the client
            and the server or if the remote server do not have classes present
            in :mod:`com.vmware.vapi.metadata.privilege_client` module.
        :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` 
            if the file specified in null does not exist.
        """
        return self._invoke('create',
                            {
                            'source_id': source_id,
                            'spec': spec,
                            })

    def delete(self,
               source_id,
               ):
        """
        Deletes an existing privilege metadata source from the infrastructure.

        :type  source_id: :class:`str`
        :param source_id: Identifier of the metadata source.
            The parameter must be an identifier for the resource type:
            ``com.vmware.vapi.metadata.privilege.source``.
        :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` 
            if the metadata source associated with ``source_id`` is not found.
        """
        return self._invoke('delete',
                            {
                            'source_id': source_id,
                            })

    def get(self,
            source_id,
            ):
        """
        Retrieves information about the metadata source corresponding to
        ``source_id``.

        :type  source_id: :class:`str`
        :param source_id: Identifier of the metadata source.
            The parameter must be an identifier for the resource type:
            ``com.vmware.vapi.metadata.privilege.source``.
        :rtype: :class:`Source.Info`
        :return: The :class:`Source.Info` instance that corresponds to ``source_id``
        :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` 
            if the metadata source associated with ``source_id`` is not found.
        """
        return self._invoke('get',
                            {
                            'source_id': source_id,
                            })

    def list(self):
        """
        Returns the identifiers of the metadata sources currently registered
        with the infrastructure.


        :rtype: :class:`list` of :class:`str`
        :return: The list of identifiers for metadata sources currently registered.
            The return value will contain identifiers for the resource type:
            ``com.vmware.vapi.metadata.privilege.source``.
        """
        return self._invoke('list', None)

    def reload(self,
               source_id=None,
               ):
        """
        Reloads the privilege metadata from all the metadata sources or of a
        particular metadata source if ``source_id`` is specified.

        :type  source_id: :class:`str` or ``None``
        :param source_id: Identifier of the metadata source.
            The parameter must be an identifier for the resource type:
            ``com.vmware.vapi.metadata.privilege.source``.
            If unspecified, all the metadata sources are reloaded.
        :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` 
            if the metadata source associated with ``source_id`` is not found.
        """
        return self._invoke('reload',
                            {
                            'source_id': source_id,
                            })

    def fingerprint(self,
                    source_id=None,
                    ):
        """
        Returns the aggregate fingerprint of metadata from all the metadata
        sources or from a particular metadata source if ``source_id`` is
        specified.

        :type  source_id: :class:`str` or ``None``
        :param source_id: Identifier of the metadata source.
            The parameter must be an identifier for the resource type:
            ``com.vmware.vapi.metadata.privilege.source``.
            If unspecified, the fingerprint of all the metadata sources is
            returned.
        :rtype: :class:`str`
        :return: Aggregate fingerprint of all the metadata sources or of a
            particular metadata source.
        :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` 
            if the metadata source associated with ``source_id`` is not found.
        """
        return self._invoke('fingerprint',
                            {
                            'source_id': source_id,
                            })
コード例 #17
0
class Archive(VapiInterface):
    """
    The ``Archive`` class provides methods to get the backup information. This
    class was added in vSphere API 6.7.
    """

    _VAPI_SERVICE_ID = 'com.vmware.appliance.recovery.backup.system_name.archive'
    """
    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, _ArchiveStub)
        self._VAPI_OPERATION_IDS = {}

    class Info(VapiStruct):
        """
        The ``Archive.Info`` class represents backup archive information. 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,
            timestamp=None,
            location=None,
            parts=None,
            version=None,
            system_name=None,
            comment=None,
        ):
            """
            :type  timestamp: :class:`datetime.datetime`
            :param timestamp: Time when this backup was completed. This attribute was added in
                vSphere API 6.7.
            :type  location: :class:`str`
            :param location: Backup location URL. This attribute was added in vSphere API 6.7.
            :type  parts: :class:`list` of :class:`str`
            :param parts: List of parts included in the backup. This attribute was added in
                vSphere API 6.7.
            :type  version: :class:`str`
            :param version: The version of the appliance represented by the backup. This
                attribute was added in vSphere API 6.7.
            :type  system_name: :class:`str`
            :param system_name: The system name identifier of the appliance represented by the
                backup. 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.backup.system_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.appliance.recovery.backup.system_name``.
            :type  comment: :class:`str`
            :param comment: Custom comment added by the user for this backup. This attribute
                was added in vSphere API 6.7.
            """
            self.timestamp = timestamp
            self.location = location
            self.parts = parts
            self.version = version
            self.system_name = system_name
            self.comment = comment
            VapiStruct.__init__(self)

    Info._set_binding_type(
        type.StructType(
            'com.vmware.appliance.recovery.backup.system_name.archive.info', {
                'timestamp':
                type.DateTimeType(),
                'location':
                type.URIType(),
                'parts':
                type.ListType(type.StringType()),
                'version':
                type.StringType(),
                'system_name':
                type.IdType(
                    resource_types=
                    'com.vmware.appliance.recovery.backup.system_name'),
                'comment':
                type.StringType(),
            }, Info, False, None))

    class Summary(VapiStruct):
        """
        The ``Archive.Summary`` class contains commonly used information about a
        backup archive. 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,
            archive=None,
            timestamp=None,
            version=None,
            comment=None,
        ):
            """
            :type  archive: :class:`str`
            :param archive: Backup archive identifier. 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.backup.system_name.archive``. 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.backup.system_name.archive``.
            :type  timestamp: :class:`datetime.datetime`
            :param timestamp: Time when this backup was started. This attribute was added in
                vSphere API 6.7.
            :type  version: :class:`str`
            :param version: The version of the appliance represented by the backup archive.
                This attribute was added in vSphere API 6.7.
            :type  comment: :class:`str`
            :param comment: Custom comment added by the user for this backup. This attribute
                was added in vSphere API 6.7.
            """
            self.archive = archive
            self.timestamp = timestamp
            self.version = version
            self.comment = comment
            VapiStruct.__init__(self)

    Summary._set_binding_type(
        type.StructType(
            'com.vmware.appliance.recovery.backup.system_name.archive.summary',
            {
                'archive':
                type.IdType(
                    resource_types=
                    'com.vmware.appliance.recovery.backup.system_name.archive'
                ),
                'timestamp':
                type.DateTimeType(),
                'version':
                type.StringType(),
                'comment':
                type.StringType(),
            }, Summary, False, None))

    class FilterSpec(VapiStruct):
        """
        The ``Archive.FilterSpec`` class contains attributes used to filter the
        results when listing backup archives (see :func:`Archive.list`). If
        multiple attributes are specified, only backup archives matching all of the
        attributes match the filter. 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,
            start_timestamp=None,
            end_timestamp=None,
            comment_substring=None,
            max_results=None,
        ):
            """
            :type  start_timestamp: :class:`datetime.datetime` or ``None``
            :param start_timestamp: Backup must have been taken on or after this time to match the
                filter. This attribute was added in vSphere API 6.7.
                If None the filter will match oldest backups.
            :type  end_timestamp: :class:`datetime.datetime` or ``None``
            :param end_timestamp: Backup must have been taken on or before this time to match the
                filter. This attribute was added in vSphere API 6.7.
                If None the filter will match most recent backups.
            :type  comment_substring: :class:`str` or ``None``
            :param comment_substring: Backup comment must contain this :class:`str` to match the filter.
                This attribute was added in vSphere API 6.7.
                If None the filter will match backups with any comment.
            :type  max_results: :class:`long` or ``None``
            :param max_results: Limit result to a max count of most recent backups. This attribute
                was added in vSphere API 6.7.
                If None it defaults to 128.
            """
            self.start_timestamp = start_timestamp
            self.end_timestamp = end_timestamp
            self.comment_substring = comment_substring
            self.max_results = max_results
            VapiStruct.__init__(self)

    FilterSpec._set_binding_type(
        type.StructType(
            'com.vmware.appliance.recovery.backup.system_name.archive.filter_spec',
            {
                'start_timestamp': type.OptionalType(type.DateTimeType()),
                'end_timestamp': type.OptionalType(type.DateTimeType()),
                'comment_substring': type.OptionalType(type.StringType()),
                'max_results': type.OptionalType(type.IntegerType()),
            }, FilterSpec, False, None))

    def get(
        self,
        spec,
        system_name,
        archive,
    ):
        """
        Returns the information for backup corresponding to given backup
        location and system name. This method was added in vSphere API 6.7.

        :type  spec: :class:`com.vmware.appliance.recovery.backup_client.LocationSpec`
        :param spec: LocationSpec Structure.
        :type  system_name: :class:`str`
        :param system_name: System name identifier.
            The parameter must be an identifier for the resource type:
            ``com.vmware.appliance.recovery.backup.system_name``.
        :type  archive: :class:`str`
        :param archive: Archive identifier.
            The parameter must be an identifier for the resource type:
            ``com.vmware.appliance.recovery.backup.system_name.archive``.
        :rtype: :class:`Archive.Info`
        :return: Info Structure.
        :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` 
            if backup does not exist.
        :raise: :class:`com.vmware.vapi.std.errors_client.Error` 
            if any error occurs during the execution of the operation.
        """
        return self._invoke('get', {
            'spec': spec,
            'system_name': system_name,
            'archive': archive,
        })

    def list(
        self,
        loc_spec,
        system_name,
        filter_spec,
    ):
        """
        Returns information about backup archives corresponding to given backup
        location and system name, which match the :class:`Archive.FilterSpec`.
        This method was added in vSphere API 6.7.

        :type  loc_spec: :class:`com.vmware.appliance.recovery.backup_client.LocationSpec`
        :param loc_spec: LocationSpec Structure.
        :type  system_name: :class:`str`
        :param system_name: System name identifier.
            The parameter must be an identifier for the resource type:
            ``com.vmware.appliance.recovery.backup.system_name``.
        :type  filter_spec: :class:`Archive.FilterSpec`
        :param filter_spec: Specification of matching backups for which information should be
            returned.
        :rtype: :class:`list` of :class:`Archive.Summary`
        :return: Commonly used information about the backup archives.
        :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` 
            if combination of ``loc_spec`` and system name does not refer to an
            existing location on the backup server.
        :raise: :class:`com.vmware.vapi.std.errors_client.Error` 
            if any error occurs during the execution of the operation.
        """
        return self._invoke(
            'list', {
                'loc_spec': loc_spec,
                'system_name': system_name,
                'filter_spec': filter_spec,
            })
コード例 #18
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,
        })
コード例 #19
0
class Projects(VapiInterface):
    """
    The ``Projects`` class provides methods for managing the lifecycle of
    Harbor project that stores and distributes container repositories and
    images.
    """

    _VAPI_SERVICE_ID = 'com.vmware.vcenter.content.registries.harbor.projects'
    """
    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, _ProjectsStub)
        self._VAPI_OPERATION_IDS = {}

    class Scope(Enum):
        """
        The ``Projects.Scope`` class in a project defines access levels of the
        project.

        .. 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>`.
        """
        PUBLIC = None
        """
        A Harbor project can be accessed by everyone.

        """
        PRIVATE = None
        """
        A Harbor project can only be accessed by assigned users.

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

    Scope._set_values([
        Scope('PUBLIC'),
        Scope('PRIVATE'),
    ])
    Scope._set_binding_type(
        type.EnumType(
            'com.vmware.vcenter.content.registries.harbor.projects.scope',
            Scope))

    class ConfigStatus(Enum):
        """
        The ``Projects.ConfigStatus`` class describes the status of reaching the
        desired configuration state for the Harbor project.

        .. 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
        """
        Harbor project is being created or the configuration is being applied to
        the project.

        """
        REMOVING = None
        """
        The configuration is being removed and Harbor project is being deleted.

        """
        ERROR = None
        """
        Failed to create Harbor project or apply the configuration to the project,
        user intervention needed.

        """
        READY = None
        """
        Harbor project is created or configured correctly.

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

    ConfigStatus._set_values([
        ConfigStatus('PENDING'),
        ConfigStatus('REMOVING'),
        ConfigStatus('ERROR'),
        ConfigStatus('READY'),
    ])
    ConfigStatus._set_binding_type(
        type.EnumType(
            'com.vmware.vcenter.content.registries.harbor.projects.config_status',
            ConfigStatus))

    class CreateSpec(VapiStruct):
        """
        The ``Projects.CreateSpec`` class defines the information required to
        create a Harbor project.

        .. tip::
            The arguments are used to initialize data attributes with the same
            names.
        """
        def __init__(
            self,
            name=None,
            scope=None,
        ):
            """
            :type  name: :class:`str`
            :param name: Name of the Harbor project. Should be between 2-63 characters long
                alphanumeric string and may contain the following characters:
                a-z,0-9, and '-'. Must be starting with characters or numbers, with
                the '-' character allowed anywhere except the first or last
                character.
            :type  scope: :class:`Projects.Scope`
            :param scope: Access type of a Harbor project.
            """
            self.name = name
            self.scope = scope
            VapiStruct.__init__(self)

    CreateSpec._set_binding_type(
        type.StructType(
            'com.vmware.vcenter.content.registries.harbor.projects.create_spec',
            {
                'name': type.StringType(),
                'scope': type.ReferenceType(__name__, 'Projects.Scope'),
            }, CreateSpec, False, None))

    class Summary(VapiStruct):
        """
        The ``Projects.Summary`` class contains basic information about a Harbor
        project.

        .. tip::
            The arguments are used to initialize data attributes with the same
            names.
        """
        def __init__(
            self,
            project=None,
            name=None,
            scope=None,
        ):
            """
            :type  project: :class:`str`
            :param project: Identifier of the harbor project.
                When clients pass a value of this class as a parameter, the
                attribute must be an identifier for the resource type:
                ``com.vmware.vcenter.content.Registry.Harbor.Project``. 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.content.Registry.Harbor.Project``.
            :type  name: :class:`str`
            :param name: Name of the Harbor project. Should be between 2-63 characters long
                alphanumeric string and may contain the following characters:
                a-z,0-9, and '-'. Must be starting with characters or numbers, with
                the '-' character allowed anywhere except the first or last
                character.
            :type  scope: :class:`Projects.Scope`
            :param scope: Access type of a Harbor project.
            """
            self.project = project
            self.name = name
            self.scope = scope
            VapiStruct.__init__(self)

    Summary._set_binding_type(
        type.StructType(
            'com.vmware.vcenter.content.registries.harbor.projects.summary', {
                'project':
                type.IdType(
                    resource_types=
                    'com.vmware.vcenter.content.Registry.Harbor.Project'),
                'name':
                type.StringType(),
                'scope':
                type.ReferenceType(__name__, 'Projects.Scope'),
            }, Summary, False, None))

    class Info(VapiStruct):
        """
        The ``Projects.Info`` class contains detailed information about a Harbor
        project.

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

        _validator_list = [
            UnionValidator(
                'config_status', {
                    'READY': [('update_time', True), ('access_url', True)],
                    'ERROR': [('message', True)],
                    'PENDING': [],
                    'REMOVING': [],
                }),
        ]

        def __init__(
            self,
            name=None,
            config_status=None,
            scope=None,
            creation_time=None,
            update_time=None,
            access_url=None,
            message=None,
        ):
            """
            :type  name: :class:`str`
            :param name: Name of the Harbor project. Should be between 2-63 characters long
                alphanumeric string and may contain the following characters:
                a-z,0-9, and '-'. Must be starting with characters or numbers, with
                the '-' character allowed anywhere except the first or last
                character.
            :type  config_status: :class:`Projects.ConfigStatus`
            :param config_status: The status of the Harbor project.
            :type  scope: :class:`Projects.Scope`
            :param scope: The access type of a Harbor project.
            :type  creation_time: :class:`datetime.datetime`
            :param creation_time: The date and time when the harbor project creation API was
                triggered and project identifier generated.
            :type  update_time: :class:`datetime.datetime`
            :param update_time: The date and time when the harbor project purge API was triggered.
                In case no purge was triggered, ``updateTime`` is same as
                ``creationTime``.
                This attribute is optional and it is only relevant when the value
                of ``configStatus`` is :attr:`Projects.ConfigStatus.READY`.
            :type  access_url: :class:`str`
            :param access_url: URL to access the harbor project through docker client.
                This attribute is optional and it is only relevant when the value
                of ``configStatus`` is :attr:`Projects.ConfigStatus.READY`.
            :type  message: :class:`com.vmware.vapi.std_client.LocalizableMessage`
            :param message: Details about the ERROR project status.
                This attribute is optional and it is only relevant when the value
                of ``configStatus`` is :attr:`Projects.ConfigStatus.ERROR`.
            """
            self.name = name
            self.config_status = config_status
            self.scope = scope
            self.creation_time = creation_time
            self.update_time = update_time
            self.access_url = access_url
            self.message = message
            VapiStruct.__init__(self)

    Info._set_binding_type(
        type.StructType(
            'com.vmware.vcenter.content.registries.harbor.projects.info', {
                'name':
                type.StringType(),
                'config_status':
                type.ReferenceType(__name__, 'Projects.ConfigStatus'),
                'scope':
                type.ReferenceType(__name__, 'Projects.Scope'),
                'creation_time':
                type.DateTimeType(),
                'update_time':
                type.OptionalType(type.DateTimeType()),
                'access_url':
                type.OptionalType(type.URIType()),
                'message':
                type.OptionalType(
                    type.ReferenceType('com.vmware.vapi.std_client',
                                       'LocalizableMessage')),
            }, Info, False, None))

    def create(
        self,
        registry,
        spec,
    ):
        """
        Creates a project in a Harbor registry using the supplied
        specification. In vSphere 7.0, a Harbor registry is deployed in a
        vSphere cluster with vSphere namespaces enabled. When a namespace is
        created, a project with same name as the namespace is created in the
        Harbor registry, so this method should not be called.

        :type  registry: :class:`str`
        :param registry: Identifier of the Registry.
            The parameter must be an identifier for the resource type:
            ``com.vmware.vcenter.content.Registry``.
        :type  spec: :class:`Projects.CreateSpec`
        :param spec: Information used to create the Harbor project.
        :rtype: :class:`str`
        :return: Identifier of the newly created Harbor project.
            The return value will be an identifier for the resource type:
            ``com.vmware.vcenter.content.Registry.Harbor.Project``.
        :raise: :class:`com.vmware.vapi.std.errors_client.InvalidArgument` 
            if ``spec`` contains any error.
        :raise: :class:`com.vmware.vapi.std.errors_client.NotAllowedInCurrentState` 
            if Harbor registry is being deleted.
        :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` 
            if a registry specified by ``registry`` could not be found.
        :raise: :class:`com.vmware.vapi.std.errors_client.AlreadyExists` 
            if a project with the same name already exists in the registry. In
            vSphere 7.0, the existing project could have been created
            automatically when a namespace with the same name is created.
        :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 ContentLibrary.ManageRegistryProject
            privilege.
        """
        return self._invoke('create', {
            'registry': registry,
            'spec': spec,
        })

    def delete(
        self,
        registry,
        project,
    ):
        """
        Deletes the specified project from Harbor registry. Repositories and
        images in the project will be removed upon project deletion. Storage
        space of deleted images in the project will be reclaimed through next
        scheduled Harbor registry garbage collection. In vSphere 7.0, a Harbor
        registry is deployed in a vSphere cluster with vSphere namespaces
        enabled. When a namespace is deleted, a project with same name as the
        namespace is deleted from the Harbor registry, so this method should
        not be called.

        :type  registry: :class:`str`
        :param registry: Identifier of the registry.
            The parameter must be an identifier for the resource type:
            ``com.vmware.vcenter.content.Registry``.
        :type  project: :class:`str`
        :param project: Identifier of the Harbor project.
            The parameter must be an identifier for the resource type:
            ``com.vmware.vcenter.content.Registry.Harbor.Project``.
        :raise: :class:`com.vmware.vapi.std.errors_client.NotAllowedInCurrentState` 
            if Harbor registry is being deleted.
        :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` 
            if ``registry`` or ``project`` cannot be found. In vSphere 7.0, the
            existing project could have been deleted automatically when a
            namespace with the same name is deleted.
        :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 ContentLibrary.ManageRegistryProject
            privilege.
        """
        return self._invoke('delete', {
            'registry': registry,
            'project': project,
        })

    def get(
        self,
        registry,
        project,
    ):
        """
        Returns detailed information about the specified Harbor project.

        :type  registry: :class:`str`
        :param registry: Identifier of the registry.
            The parameter must be an identifier for the resource type:
            ``com.vmware.vcenter.content.Registry``.
        :type  project: :class:`str`
        :param project: Identifier of the Harbor project.
            The parameter must be an identifier for the resource type:
            ``com.vmware.vcenter.content.Registry.Harbor.Project``.
        :rtype: :class:`Projects.Info`
        :return: Detailed information about the specified Harbor project.
        :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` 
            if ``registry`` or ``project`` cannot be found.
        :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', {
            'registry': registry,
            'project': project,
        })

    def list(
        self,
        registry,
    ):
        """
        Returns basic information of all projects in a Harbor registry.

        :type  registry: :class:`str`
        :param registry: Identifier of the registry.
            The parameter must be an identifier for the resource type:
            ``com.vmware.vcenter.content.Registry``.
        :rtype: :class:`list` of :class:`Projects.Summary`
        :return: The list of summary information of all Harbor projects.
        :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` 
            if ``registry`` cannot be found.
        :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', {
            'registry': registry,
        })

    def purge(
        self,
        registry,
        project,
    ):
        """
        Remove all repositories, images and members in the project. Storage
        space of deleted images in the project will be reclaimed through next
        scheduled Harbor registry garbage collection.

        :type  registry: :class:`str`
        :param registry: Registry identifier.
            The parameter must be an identifier for the resource type:
            ``com.vmware.vcenter.content.Registry``.
        :type  project: :class:`str`
        :param project: Identifier of the Harbor project.
            The parameter must be an identifier for the resource type:
            ``com.vmware.vcenter.content.Registry.Harbor.Project``.
        :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` 
            if ``registry`` or ``project`` cannot be found.
        :raise: :class:`com.vmware.vapi.std.errors_client.NotAllowedInCurrentState` 
            if Harbor registry is being deleted or the project is not in
            :attr:`Projects.ConfigStatus.READY` status.
        :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 ContentLibrary.ManageRegistryProject
            privilege.
        """
        return self._invoke('purge', {
            'registry': registry,
            'project': project,
        })