def update_task( self, cluster, spec, ): """ Updates the state of a cluster. This method was added in vSphere API 7.0.0.0. :type cluster: :class:`str` :param cluster: Cluster id. The parameter must be an identifier for the resource type: ``ClusterComputeResource``. :type spec: :class:`TrustAuthorityClusters.UpdateSpec` :param spec: The specification for update of a cluster. :raise: :class:`com.vmware.vapi.std.errors_client.Error` if there is a generic error. :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` if ``spec`` doesn't match to any cluster compute resource. :raise: :class:`com.vmware.vapi.std.errors_client.Unauthenticated` if the user can not be authenticated. """ task_id = self._invoke('update$task', { 'cluster': cluster, 'spec': spec, }) task_svc = Tasks(self._config) task_instance = Task(task_id, task_svc, type.VoidType()) return task_instance
def delete_task( self, cluster, service, ): """ Removes the Key Provider Service instance from the configuration of the given cluster. This method was added in vSphere API 7.0.0. :type cluster: :class:`str` :param cluster: the unique ID of the cluster. The parameter must be an identifier for the resource type: ``ClusterComputeResource``. :type service: :class:`str` :param service: the registered Key Provider Service instance unique identifier. The parameter must be an identifier for the resource type: ``com.vmware.vcenter.trusted_infrastructure.kms.Service``. :raise: :class:`com.vmware.vapi.std.errors_client.Error` if there is a generic error. :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` if the Key Provider Service instance or the cluster are not found. :raise: :class:`com.vmware.vapi.std.errors_client.Unauthenticated` if the user can not be authenticated. """ task_id = self._invoke('delete$task', { 'cluster': cluster, 'service': service, }) task_svc = Tasks(self._config) task_instance = Task(task_id, task_svc, type.VoidType()) return task_instance
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
def delete_task( self, cluster, profile, ): """ Removes the read-only policy configured on ESX for a specific principal. This method was added in vSphere API 7.0.0. :type cluster: :class:`str` :param cluster: The ID of the Trust Authority Cluster to configure. The parameter must be an identifier for the resource type: ``ClusterComputeResource``. :type profile: :class:`str` :param profile: The ID of the connection profile to modify. The parameter must be an identifier for the resource type: ``com.vmware.esx.authentication.clientprofile``. :raise: :class:`com.vmware.vapi.std.errors_client.Error` if there is a generic error. :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` if there is no profile configured with that ID. :raise: :class:`com.vmware.vapi.std.errors_client.Unauthenticated` if the user can not be authenticated. """ task_id = self._invoke('delete$task', { 'cluster': cluster, 'profile': profile, }) task_svc = Tasks(self._config) task_instance = Task(task_id, task_svc, type.VoidType()) return task_instance
def scan_task(self, host, ): """ Scans the host against the host's desired state.. 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: Identifier of the host. The parameter must be an identifier for the resource type: ``HostSystem``. :rtype: :class: `vmware.vapi.stdlib.client.task.Task` :return: Task instance :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 there is no host associated with ``host`` in the system or if desired software document 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.Unsupported` If the host is not a standlone host, but instead part of a cluster. """ task_id = self._invoke('scan$task', { 'host': host, }) task_svc = Tasks(self._config) task_instance = Task(task_id, task_svc, type.ReferenceType('com.vmware.esx.settings_client', 'HostCompliance')) return task_instance
def delete_task(self, cluster, ): """ Delete all Trust Authority Components configuration that has been applied to the given cluster. This method has no affect on the desired state, it only removes applied Trust Authority Component configurations from any Trusted Hosts within the given cluster. This method was added in vSphere API 7.0.1.0. :type cluster: :class:`str` :param cluster: The ID of the cluster against which the operation will be executed. The parameter must be an identifier for the resource type: ``ClusterComputeResource``. :raise: :class:`com.vmware.vapi.std.errors_client.Error` if there is a generic error. :raise: :class:`com.vmware.vapi.std.errors_client.InvalidArgument` if the cluster ID is empty. :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` if no cluster corresponding to the given ID is found within this vCenter. :raise: :class:`com.vmware.vapi.std.errors_client.ResourceBusy` if there are ongoing mutating operations. :raise: :class:`com.vmware.vapi.std.errors_client.Unauthenticated` if the caller is not authenticated. """ task_id = self._invoke('delete$task', { 'cluster': cluster, }) task_svc = Tasks(self._config) task_instance = Task(task_id, task_svc, type.VoidType()) return task_instance
def update_task(self, cluster, ): """ Update all applied Trust Authority Component configuration on the given cluster to be consistent with the desired state. This method has no affect on the desired state, apart from it being used as a reference point for the remediation. If the cluster is not a Trusted Cluster, the method will remove all Trust Authority Component configuration from the Trusted Hosts in the cluster, if such hosts are found. This method was added in vSphere API 7.0.1.0. :type cluster: :class:`str` :param cluster: The ID of the cluster against which the operation will be executed. The parameter must be an identifier for the resource type: ``ClusterComputeResource``. :raise: :class:`com.vmware.vapi.std.errors_client.Error` if there is a generic error. :raise: :class:`com.vmware.vapi.std.errors_client.InvalidArgument` if the cluster ID is empty. :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` if no cluster corresponding to the given ID is found within this vCenter. :raise: :class:`com.vmware.vapi.std.errors_client.ResourceBusy` if there are ongoing mutating operations. :raise: :class:`com.vmware.vapi.std.errors_client.Unauthenticated` if the caller is not authenticated. """ task_id = self._invoke('update$task', { 'cluster': cluster, }) task_svc = Tasks(self._config) task_instance = Task(task_id, task_svc, type.VoidType()) return task_instance
def get_task(self, cluster, ): """ Returns detailed information about the health of the applied Trust Authority Component configurations in the given cluster. This method was added in vSphere API 7.0.1.0. :type cluster: :class:`str` :param cluster: The ID of the cluster against which the operation will be executed. The parameter must be an identifier for the resource type: ``ClusterComputeResource``. :rtype: :class: `vmware.vapi.stdlib.client.task.Task` :return: Task instance :raise: :class:`com.vmware.vapi.std.errors_client.Error` if there is a generic error. :raise: :class:`com.vmware.vapi.std.errors_client.InvalidArgument` if the cluster ID is empty. :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` if no cluster corresponding to the given ID is found within this vCenter. :raise: :class:`com.vmware.vapi.std.errors_client.ResourceBusy` if there are ongoing mutating operations. :raise: :class:`com.vmware.vapi.std.errors_client.Unauthenticated` if the caller is not authenticated. """ task_id = self._invoke('get$task', { 'cluster': cluster, }) task_svc = Tasks(self._config) task_instance = Task(task_id, task_svc, type.ReferenceType(__name__, 'ServicesAppliedConfig.Info')) return task_instance
def create_task( self, cluster, spec, ): """ Configures the cluster to use a the given registered Attestation Service. This method was added in vSphere API 7.0.0. :type cluster: :class:`str` :param cluster: The ID of the cluster. The parameter must be an identifier for the resource type: ``ClusterComputeResource``. :type spec: :class:`Services.CreateSpec` :param spec: Describes the registered instance of the Attestation Service :rtype: :class: `vmware.vapi.stdlib.client.task.Task` :return: Task instance :raise: :class:`com.vmware.vapi.std.errors_client.AlreadyExists` if the Attestation Service is already configured for this cluster :raise: :class:`com.vmware.vapi.std.errors_client.Error` for any other error. :raise: :class:`com.vmware.vapi.std.errors_client.InvalidArgument` if the CreateSpec is not valid. :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` if the cluster ID is not valid. :raise: :class:`com.vmware.vapi.std.errors_client.UnableToAllocateResource` if all the hosts in the cluster do not have VMware vSphere Trust Authority enabled license. :raise: :class:`com.vmware.vapi.std.errors_client.Unauthenticated` if the user can not be authenticated. """ task_id = self._invoke('create$task', { 'cluster': cluster, 'spec': spec, }) task_svc = Tasks(self._config) task_instance = Task( task_id, task_svc, type.IdType( resource_types= 'com.vmware.vcenter.trusted_infrastructure.attestation.Service' )) return task_instance
def create_task( self, cluster, provider, ): """ Generate a certificate signing request (CSR) for the client certificate. This overwrites any existing CSR. The CSR will allow the certificate to be signed by a third party. Once the CSR is signed, certificate may be added as a client certificate. Calling the API repeatedly will result in a generating a new CSR each time.. This method was added in vSphere API 7.0.0. :type cluster: :class:`str` :param cluster: Identifier of the cluster. The parameter must be an identifier for the resource type: ``ClusterComputeResource``. :type provider: :class:`str` :param provider: Identifier of the provider. The parameter must be an identifier for the resource type: ``com.vmware.vcenter.trusted_infrastructure.trust_authority_clusters.kms.Provider``. :rtype: :class: `vmware.vapi.stdlib.client.task.Task` :return: Task instance :raise: :class:`com.vmware.vapi.std.errors_client.InvalidArgument` If cluster or provider id are empty. :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` If the provider or cluster 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.Error` If any other error occurs. """ task_id = self._invoke('create$task', { 'cluster': cluster, 'provider': provider, }) task_svc = Tasks(self._config) task_instance = Task(task_id, task_svc, type.ReferenceType(__name__, 'Csr.Info')) return task_instance
def check_task( self, cluster, spec=None, ): """ Checks the possibility to manage the cluster with a single software specification. :type cluster: :class:`str` :param cluster: Identifier of the cluster. The parameter must be an identifier for the resource type: ``ClusterComputeResource``. :type spec: :class:`Software.CheckSpec` or ``None`` :param spec: Check specification. If None, all checks are performed. :rtype: :class: `vmware.vapi.stdlib.client.task.Task` :return: Task instance :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.NotAllowedInCurrentState` If the feature is already enabled for the given cluster. :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` If there is no cluster associated with ``cluster`` in the system. :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. """ task_id = self._invoke('check$task', { 'cluster': cluster, 'spec': spec, }) task_svc = Tasks(self._config) task_instance = Task( task_id, task_svc, type.ReferenceType(__name__, 'Software.CheckResult')) return task_instance
def create_task( self, version, ): """ Creates a vCenter Server pre-update compatibility check report for the pending update version. The report can be exported and downloaded in CSV format. 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 version: :class:`str` :param version: Pending update version for which pre-update compatibility check will be executed. The parameter must be an identifier for the resource type: ``com.vmware.vcenter.lcm.update.pending``. :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.NotFound` if there is no pending update assosiated with the ``version`` in the system. :raise: :class:`com.vmware.vapi.std.errors_client.NotAllowedInCurrentState` if a precheck is already in progress. :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. """ task_id = self._invoke('create$task', { 'version': version, }) task_svc = Tasks(self._config) task_instance = Task( task_id, task_svc, type.ReferenceType(__name__, 'PrecheckReport.Result')) return task_instance
def enable_task( self, cluster, spec=None, ): """ Enables the feature which manages the cluster with a single software specification. :type cluster: :class:`str` :param cluster: Identifier of the cluster. The parameter must be an identifier for the resource type: ``ClusterComputeResource``. :type spec: :class:`Software.EnableSpec` or ``None`` :param spec: Enablement specification. If None, all checks are performed. :raise: :class:`com.vmware.vapi.std.errors_client.Error` If feature enablement failed for the given cluster. The value of the data attribute of :class:`com.vmware.vapi.std.errors_client.Error` will be a class that contains all the attributes defined in :class:`Software.CheckResult`. :raise: :class:`com.vmware.vapi.std.errors_client.NotAllowedInCurrentState` If the feature is already enabled for the given cluster. :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` If there is no cluster associated with ``cluster`` in the system :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. """ task_id = self._invoke('enable$task', { 'cluster': cluster, 'spec': spec, }) task_svc = Tasks(self._config) task_instance = Task(task_id, task_svc, type.VoidType()) return task_instance
def create_task( self, cluster, spec, ): """ Creates a profile with the specified connection information on all hosts from a Trust Authority Cluster. This method was added in vSphere API 7.0.0. :type cluster: :class:`str` :param cluster: The ID of the Trust Authority Cluster to configure. The parameter must be an identifier for the resource type: ``ClusterComputeResource``. :type spec: :class:`ConsumerPrincipals.CreateSpec` :param spec: The CreateSpec specifying the connection information. :rtype: :class: `vmware.vapi.stdlib.client.task.Task` :return: Task instance :raise: :class:`com.vmware.vapi.std.errors_client.AlreadyExists` if a profile for the issuer already exists. :raise: :class:`com.vmware.vapi.std.errors_client.Error` if there is a generic error. :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` if there is no such cluster. :raise: :class:`com.vmware.vapi.std.errors_client.Unauthenticated` if the user can not be authenticated. """ task_id = self._invoke('create$task', { 'cluster': cluster, 'spec': spec, }) task_svc = Tasks(self._config) task_instance = Task( task_id, task_svc, type.IdType( resource_types='com.vmware.esx.authentication.clientprofile')) return task_instance
def list_task( self, cluster, spec=None, ): """ Lists all policies configured on a specific cluster. This method was added in vSphere API 7.0.0. :type cluster: :class:`str` :param cluster: The ID of the Trust Authority Cluster on which the profile is configured. The parameter must be an identifier for the resource type: ``ClusterComputeResource``. :type spec: :class:`ConsumerPrincipals.FilterSpec` or ``None`` :param spec: A FilterSpec specifying the profiles to be listed. If {\\\\@term.unset} return all policies. :rtype: :class: `vmware.vapi.stdlib.client.task.Task` :return: Task instance :raise: :class:`com.vmware.vapi.std.errors_client.Error` if there is a generic error. :raise: :class:`com.vmware.vapi.std.errors_client.NotFound` if there is no profile configured with that ID. :raise: :class:`com.vmware.vapi.std.errors_client.Unauthenticated` if the user can not be authenticated. """ task_id = self._invoke('list$task', { 'cluster': cluster, 'spec': spec, }) task_svc = Tasks(self._config) task_instance = Task( task_id, task_svc, type.ListType( type.ReferenceType(__name__, 'ConsumerPrincipals.Summary'))) return task_instance