# Managed Object - HttpNfcLease(vim.HttpNfcLease)

Property of
  HttpNfcLeaseInfo
Returned by
  ExportSnapshot, ExportVApp, ExportVm, ImportVApp
See also
  HttpNfcLeaseCapabilities, HttpNfcLeaseInfo, HttpNfcLeaseManifestEntry, HttpNfcLeaseSourceFile, HttpNfcLeaseState, KeyValue, LocalizedMethodFault, MethodFault
Since
  vSphere API 4.0

## Managed Object Description

Represents a lease on a VirtualMachine or a VirtualApp, which can be used to import or export disks for the entity. While the lease is held, operations that alter the state of the virtual machines covered by the lease are blocked. Examples of blocked operations are PowerOn, Destroy, Migrate, etc.

A lease is in one of four states:

Initializing
  This is the initial state. The lease remains in this state while the corresponding import/export task is preparing the objects. In an import session, this involves creating inventory objects.
Ready
  The lease changes to this state once the corresponding import/export task is done preparing the lease. The leased objects are now ready, and the client can use the information provided in the info property to determine where to up/download disks. The client must call HttpNfcLeaseProgress periodically to keep the lease alive and report progress to the corresponding import/export task. Failure to do so causes the lease to time out and enter the error state.
Done
  When the client is done transferring disks, it calls HttpNfcLeaseComplete to signal the end of the import/export session. This causes the corresponding import/export task to complete successfully.
Error
  If an error occurs during initialization or the lease times out, it will change to this state. The client can also abort the lease manually by calling HttpNfcLeaseAbort. In this state, the error property can be read to determine the cause. If the lease belongs to an import session, all objects created during the import are removed when the lease enters this state.

The import/export task corresponding to the lease continues running while the lease is held.

Properties

Name | Type | Description
--- | --- | ---
capabilities | HttpNfcLeaseCapabilities | Current supported capabilities by this lease See Capabilities Since vSphere API 6.7
error* | LocalizedMethodFault | If the lease is in the error state, this property contains the error that caused the lease to be aborted.
info* | HttpNfcLeaseInfo | Provides information on the objects contained in this lease. The info property is only valid when the lease is in the ready state.
initializeProgress | xsd:int | Provides progress information (0-100 percent) for the initializing state of the lease. Clients can use this to track overall progress.
mode | xsd:string | Current mode of the lease. See Mode for possible values. Since vSphere API 6.7
state | HttpNfcLeaseState | The current state of the lease.
transferProgress | xsd:int | Provides progress information (0-100 percent) for current transfer. Transfer covers download, upload and pull scenario. Can be externally updated by progress method. Since vSphere API 6.7

*May not be present

Methods

Methods defined in this Managed Object
HttpNfcLeaseAbort, HttpNfcLeaseComplete, HttpNfcLeaseGetManifest, HttpNfcLeaseProgress, HttpNfcLeasePullFromUrls_Task, HttpNfcLeaseSetManifestChecksumType

# HttpNfcLeaseAbort(abort)

Aborts the import/export and releases this lease. Operations on the objects contained in this lease will no longer be blocked. After calling this method, this lease will no longer be valid.

Clients should call this method if an error occurs while accessing the disks, or if the operation is cancelled. The client can report the cause of the abort to other clients listening on the task with the fault parameter.

Required Privileges
  None

Parameters

Name | Type | Description
--- | --- | ---
_this | ManagedObjectReference | A reference to the HttpNfcLease used to make the method call.
fault* | MethodFault | [in] The fault that caused the abort, if any.

*Need not be set

Return Value

Type | Description
--- | ---
None

Faults

Type | Description
--- | ---
InvalidState | Thrown if the lease has already been aborted.
RuntimeFault | Thrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.
Timedout | Thrown if the lease has timed out before this call.

Events

Type
None

Show WSDL type definition
<element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:vsan="urn:vsan" name="HttpNfcLeaseAbort" type="vsan:HttpNfcLeaseAbortRequestType"/> <element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:vsan="urn:vsan" name="HttpNfcLeaseAbortResponse"> <complexType/> </element>

# HttpNfcLeaseComplete(complete)

Completes the import/export and releases this lease. Operations on the objects contained in this lease will no longer be blocked. After calling this method, this lease will no longer be valid.

Clients should call this method when they are done accessing the disks for the VirtualMachines in this lease. The status of the corresponding task will be set to success.

Required Privileges
  None

Parameters

Name | Type | Description
--- | --- | ---
_this | ManagedObjectReference | A reference to the HttpNfcLease used to make the method call.

Return Value

Type | Description
--- | ---
None

Faults

Type | Description
--- | ---
InvalidState | Thrown if the lease has already been completed or aborted.
RuntimeFault | Thrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.
Timedout | Thrown if the lease has timed out before this call.

Events

Type
None

Show WSDL type definition
<element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:vsan="urn:vsan" name="HttpNfcLeaseComplete" type="vsan:HttpNfcLeaseCompleteRequestType"/> <element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:vsan="urn:vsan" name="HttpNfcLeaseCompleteResponse"> <complexType/> </element>

# HttpNfcLeaseGetManifest(getManifest)

Gets the download manifest for this lease.

Required Privileges
  None
Since
  vSphere API 4.1

Parameters

Name | Type | Description
--- | --- | ---
_this | ManagedObjectReference | A reference to the HttpNfcLease used to make the method call.

Return Value

Type | Description
--- | ---
HttpNfcLeaseManifestEntry[] |

Faults

Type | Description
--- | ---
InvalidState |
RuntimeFault | Thrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.
Timedout |

Events

Type
None

Show WSDL type definition
<element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:vsan="urn:vsan" name="HttpNfcLeaseGetManifest" type="vsan:HttpNfcLeaseGetManifestRequestType"/> <element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:vsan="urn:vsan" name="HttpNfcLeaseGetManifestResponse"> <complexType> <sequence> <element name="returnval" type="vsan:HttpNfcLeaseManifestEntry" minOccurs="0" maxOccurs="unbounded"/> </sequence> </complexType> </element>

# HttpNfcLeaseProgress(progress)

Sets the disk up/download progress, and renews this lease. A lease will time out automatically after a while. If the client wishes to continue using it, for example if it is not done accessing the disks, this method must be called periodically.

Required Privileges
  None

Parameters

Name | Type | Description
--- | --- | ---
_this | ManagedObjectReference | A reference to the HttpNfcLease used to make the method call.
percent | xsd:int | [in] Completion status represented as an integer in the 0-100 range.

Return Value

Type | Description
--- | ---
None

Faults

Type | Description
--- | ---
RuntimeFault | Thrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.
Timedout | Thrown if the lease has timed out.

Events

Type
None

Show WSDL type definition
<element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:vsan="urn:vsan" name="HttpNfcLeaseProgress" type="vsan:HttpNfcLeaseProgressRequestType"/> <element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:vsan="urn:vsan" name="HttpNfcLeaseProgressResponse"> <complexType/> </element>

# HttpNfcLeasePullFromUrls_Task(pullFromUrls)

Upgrades current lease from push to pull mode.

Required Privileges
  None
Since
  vSphere API 6.7

Parameters

Name | Type | Description
--- | --- | ---
_this | ManagedObjectReference | A reference to the HttpNfcLease used to make the method call.
files* | HttpNfcLeaseSourceFile[] | [in] List of remote source file descriptors There should be the same number of SourceFile as DeviceUrl provided by this lease.

*Need not be set

Return Value

Type | Description
--- | ---
ManagedObjectReference to a Task |

Faults

Type | Description
--- | ---
HttpFault |
InvalidState | Thrown if the lease has already been aborted.
RuntimeFault | Thrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.
SSLVerifyFault |

Events

Type
None

# HttpNfcLeaseSetManifestChecksumType(setManifestChecksumType)

Sets desired checksum algorithm per each file that will be returned in ManifestEntry. Should be set before any transfer starts.

Required Privileges
  None
Since
  vSphere API 6.7

Parameters

Name | Type | Description
--- | --- | ---
_this | ManagedObjectReference | A reference to the HttpNfcLease used to make the method call.
deviceUrlsToChecksumTypes* | KeyValue[] | [in] Should contain key value pairs: where key is DeviceUrl#key returned in this lease info and value is desired algorithm from ChecksumType.

*Need not be set

Return Value

Type | Description
--- | ---
None

Faults

Type | Description
--- | ---
InvalidState |
RuntimeFault | Thrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.

Events

Type
None

Show WSDL type definition
<element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:vsan="urn:vsan" name="HttpNfcLeaseSetManifestChecksumType" type="vsan:HttpNfcLeaseSetManifestChecksumTypeRequestType"/> <element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:vsan="urn:vsan" name="HttpNfcLeaseSetManifestChecksumTypeResponse"> <complexType/> </element>