SnapshotOperations class

Class representing a SnapshotOperations.

Constructors

SnapshotOperations(FaceClientContext)

Create a SnapshotOperations.

Methods

apply(string, string, ServiceCallback<void>)
apply(string, string, SnapshotApplyOptionalParams)

Submit an operation to apply a snapshot to current subscription. For each snapshot, only subscriptions included in the applyScope of Snapshot - Take can apply it.
The snapshot interfaces are for users to backup and restore their face data from one face subscription to another, inside same region or across regions. The workflow contains two phases, user first calls Snapshot - Take to create a copy of the source object and store it as a snapshot, then calls Snapshot - Apply to paste the snapshot to target subscription. The snapshots are stored in a centralized location (per Azure instance), so that they can be applied cross accounts and regions.
Applying snapshot is an asynchronous operation. An operation id can be obtained from the "Operation-Location" field in response header, to be used in OperationStatus - Get for tracking the progress of applying the snapshot. The target object id will be included in the "resourceLocation" field in OperationStatus - Get response when the operation status is "succeeded".
Snapshot applying time depends on the number of person and face entries in the snapshot object. It could be in seconds, or up to 1 hour for 1,000,000 persons with multiple faces.
Snapshots will be automatically expired and cleaned in 48 hours after it is created by Snapshot

  • Take. So the target subscription is required to apply the snapshot in 48 hours since its creation.
    Applying a snapshot will not block any other operations against the target object, however it is not recommended because the correctness cannot be guaranteed during snapshot applying. After snapshot applying is completed, all operations towards the target object can work as normal. Snapshot also includes the training results of the source object, which means target subscription the snapshot applied to does not need re-train the target object before calling Identify/FindSimilar.
    One snapshot can be applied multiple times in parallel, while currently only CreateNew apply mode is supported, which means the apply operation will fail if target subscription already contains an object of same type and using the same objectId. Users can specify the "objectId" in request body to avoid such conflicts.
  • Free-tier subscription quota: 100 apply operations per month.
  • S0-tier subscription quota: 100 apply operations per day.
apply(string, string, SnapshotApplyOptionalParams, ServiceCallback<void>)
deleteMethod(string, RequestOptionsBase)

Delete an existing snapshot according to the snapshotId. All object data and information in the snapshot will also be deleted. Only the source subscription who took the snapshot can delete the snapshot. If the user does not delete a snapshot with this API, the snapshot will still be automatically deleted in 48 hours after creation.

deleteMethod(string, RequestOptionsBase, ServiceCallback<void>)
deleteMethod(string, ServiceCallback<void>)
get(string, RequestOptionsBase)

Retrieve information about a snapshot. Snapshot is only accessible to the source subscription who took it, and target subscriptions included in the applyScope in Snapshot - Take.

get(string, RequestOptionsBase, ServiceCallback<Snapshot>)
get(string, ServiceCallback<Snapshot>)
getOperationStatus(string, RequestOptionsBase)

Retrieve the status of a take/apply snapshot operation.

getOperationStatus(string, RequestOptionsBase, ServiceCallback<OperationStatus>)
getOperationStatus(string, ServiceCallback<OperationStatus>)
list(ServiceCallback<Snapshot[]>)
list(SnapshotListOptionalParams)

List all accessible snapshots with related information, including snapshots that were taken by the user, or snapshots to be applied to the user (subscription id was included in the applyScope in Snapshot - Take).

list(SnapshotListOptionalParams, ServiceCallback<Snapshot[]>)
take(SnapshotObjectType, string, string[], ServiceCallback<void>)
take(SnapshotObjectType, string, string[], SnapshotTakeOptionalParams)

Submit an operation to take a snapshot of face list, large face list, person group or large person group, with user-specified snapshot type, source object id, apply scope and an optional user data.
The snapshot interfaces are for users to backup and restore their face data from one face subscription to another, inside same region or across regions. The workflow contains two phases, user first calls Snapshot - Take to create a copy of the source object and store it as a snapshot, then calls Snapshot - Apply to paste the snapshot to target subscription. The snapshots are stored in a centralized location (per Azure instance), so that they can be applied cross accounts and regions.
Taking snapshot is an asynchronous operation. An operation id can be obtained from the "Operation-Location" field in response header, to be used in OperationStatus - Get for tracking the progress of creating the snapshot. The snapshot id will be included in the "resourceLocation" field in OperationStatus - Get response when the operation status is "succeeded".
Snapshot taking time depends on the number of person and face entries in the source object. It could be in seconds, or up to several hours for 1,000,000 persons with multiple faces.
Snapshots will be automatically expired and cleaned in 48 hours after it is created by Snapshot

  • Take. User can delete the snapshot using Snapshot - Delete by themselves any time before expiration.
    Taking snapshot for a certain object will not block any other operations against the object. All read-only operations (Get/List and Identify/FindSimilar/Verify) can be conducted as usual. For all writable operations, including Add/Update/Delete the source object or its persons/faces and Train, they are not blocked but not recommended because writable updates may not be reflected on the snapshot during its taking. After snapshot taking is completed, all readable and writable operations can work as normal. Snapshot will also include the training results of the source object, which means target subscription the snapshot applied to does not need re-train the target object before calling Identify/FindSimilar.
  • Free-tier subscription quota: 100 take operations per month.
  • S0-tier subscription quota: 100 take operations per day.
take(SnapshotObjectType, string, string[], SnapshotTakeOptionalParams, ServiceCallback<void>)
update(string, ServiceCallback<void>)
update(string, SnapshotUpdateOptionalParams)

Update the information of a snapshot. Only the source subscription who took the snapshot can update the snapshot.

update(string, SnapshotUpdateOptionalParams, ServiceCallback<void>)

Constructor Details

SnapshotOperations(FaceClientContext)

Create a SnapshotOperations.

new SnapshotOperations(client: FaceClientContext)

Parameters

client
FaceClientContext

Reference to the service client.

Method Details

apply(string, string, ServiceCallback<void>)

function apply(snapshotId: string, objectId: string, callback: ServiceCallback<void>)

Parameters

snapshotId

string

Id referencing a particular snapshot.

objectId

string

User specified target object id to be created from the snapshot.

callback

ServiceCallback<void>

The callback

apply(string, string, SnapshotApplyOptionalParams)

Submit an operation to apply a snapshot to current subscription. For each snapshot, only subscriptions included in the applyScope of Snapshot - Take can apply it.
The snapshot interfaces are for users to backup and restore their face data from one face subscription to another, inside same region or across regions. The workflow contains two phases, user first calls Snapshot - Take to create a copy of the source object and store it as a snapshot, then calls Snapshot - Apply to paste the snapshot to target subscription. The snapshots are stored in a centralized location (per Azure instance), so that they can be applied cross accounts and regions.
Applying snapshot is an asynchronous operation. An operation id can be obtained from the "Operation-Location" field in response header, to be used in OperationStatus - Get for tracking the progress of applying the snapshot. The target object id will be included in the "resourceLocation" field in OperationStatus - Get response when the operation status is "succeeded".
Snapshot applying time depends on the number of person and face entries in the snapshot object. It could be in seconds, or up to 1 hour for 1,000,000 persons with multiple faces.
Snapshots will be automatically expired and cleaned in 48 hours after it is created by Snapshot

  • Take. So the target subscription is required to apply the snapshot in 48 hours since its creation.
    Applying a snapshot will not block any other operations against the target object, however it is not recommended because the correctness cannot be guaranteed during snapshot applying. After snapshot applying is completed, all operations towards the target object can work as normal. Snapshot also includes the training results of the source object, which means target subscription the snapshot applied to does not need re-train the target object before calling Identify/FindSimilar.
    One snapshot can be applied multiple times in parallel, while currently only CreateNew apply mode is supported, which means the apply operation will fail if target subscription already contains an object of same type and using the same objectId. Users can specify the "objectId" in request body to avoid such conflicts.
  • Free-tier subscription quota: 100 apply operations per month.
  • S0-tier subscription quota: 100 apply operations per day.
function apply(snapshotId: string, objectId: string, options?: SnapshotApplyOptionalParams): Promise<SnapshotApplyResponse>

Parameters

snapshotId

string

Id referencing a particular snapshot.

objectId

string

User specified target object id to be created from the snapshot.

options
SnapshotApplyOptionalParams

The optional parameters

Returns

Promise<Models.SnapshotApplyResponse>

apply(string, string, SnapshotApplyOptionalParams, ServiceCallback<void>)

function apply(snapshotId: string, objectId: string, options: SnapshotApplyOptionalParams, callback: ServiceCallback<void>)

Parameters

snapshotId

string

Id referencing a particular snapshot.

objectId

string

User specified target object id to be created from the snapshot.

options
SnapshotApplyOptionalParams

The optional parameters

callback

ServiceCallback<void>

The callback

deleteMethod(string, RequestOptionsBase)

Delete an existing snapshot according to the snapshotId. All object data and information in the snapshot will also be deleted. Only the source subscription who took the snapshot can delete the snapshot. If the user does not delete a snapshot with this API, the snapshot will still be automatically deleted in 48 hours after creation.

function deleteMethod(snapshotId: string, options?: RequestOptionsBase): Promise<RestResponse>

Parameters

snapshotId

string

Id referencing a particular snapshot.

options
RequestOptionsBase

The optional parameters

Returns

Promise<RestResponse>

Promise<msRest.RestResponse>

deleteMethod(string, RequestOptionsBase, ServiceCallback<void>)

function deleteMethod(snapshotId: string, options: RequestOptionsBase, callback: ServiceCallback<void>)

Parameters

snapshotId

string

Id referencing a particular snapshot.

options
RequestOptionsBase

The optional parameters

callback

ServiceCallback<void>

The callback

deleteMethod(string, ServiceCallback<void>)

function deleteMethod(snapshotId: string, callback: ServiceCallback<void>)

Parameters

snapshotId

string

Id referencing a particular snapshot.

callback

ServiceCallback<void>

The callback

get(string, RequestOptionsBase)

Retrieve information about a snapshot. Snapshot is only accessible to the source subscription who took it, and target subscriptions included in the applyScope in Snapshot - Take.

function get(snapshotId: string, options?: RequestOptionsBase): Promise<SnapshotGetResponse>

Parameters

snapshotId

string

Id referencing a particular snapshot.

options
RequestOptionsBase

The optional parameters

Returns

Promise<Models.SnapshotGetResponse>

get(string, RequestOptionsBase, ServiceCallback<Snapshot>)

function get(snapshotId: string, options: RequestOptionsBase, callback: ServiceCallback<Snapshot>)

Parameters

snapshotId

string

Id referencing a particular snapshot.

options
RequestOptionsBase

The optional parameters

callback

ServiceCallback<Snapshot>

The callback

get(string, ServiceCallback<Snapshot>)

function get(snapshotId: string, callback: ServiceCallback<Snapshot>)

Parameters

snapshotId

string

Id referencing a particular snapshot.

callback

ServiceCallback<Snapshot>

The callback

getOperationStatus(string, RequestOptionsBase)

Retrieve the status of a take/apply snapshot operation.

function getOperationStatus(operationId: string, options?: RequestOptionsBase): Promise<SnapshotGetOperationStatusResponse>

Parameters

operationId

string

Id referencing a particular take/apply snapshot operation.

options
RequestOptionsBase

The optional parameters

Returns

Promise<Models.SnapshotGetOperationStatusResponse>

getOperationStatus(string, RequestOptionsBase, ServiceCallback<OperationStatus>)

function getOperationStatus(operationId: string, options: RequestOptionsBase, callback: ServiceCallback<OperationStatus>)

Parameters

operationId

string

Id referencing a particular take/apply snapshot operation.

options
RequestOptionsBase

The optional parameters

callback

ServiceCallback<OperationStatus>

The callback

getOperationStatus(string, ServiceCallback<OperationStatus>)

function getOperationStatus(operationId: string, callback: ServiceCallback<OperationStatus>)

Parameters

operationId

string

Id referencing a particular take/apply snapshot operation.

callback

ServiceCallback<OperationStatus>

The callback

list(ServiceCallback<Snapshot[]>)

function list(callback: ServiceCallback<Snapshot[]>)

Parameters

callback

ServiceCallback<Snapshot[]>

The callback

list(SnapshotListOptionalParams)

List all accessible snapshots with related information, including snapshots that were taken by the user, or snapshots to be applied to the user (subscription id was included in the applyScope in Snapshot - Take).

function list(options?: SnapshotListOptionalParams): Promise<SnapshotListResponse>

Parameters

options
SnapshotListOptionalParams

The optional parameters

Returns

Promise<Models.SnapshotListResponse>

list(SnapshotListOptionalParams, ServiceCallback<Snapshot[]>)

function list(options: SnapshotListOptionalParams, callback: ServiceCallback<Snapshot[]>)

Parameters

options
SnapshotListOptionalParams

The optional parameters

callback

ServiceCallback<Snapshot[]>

The callback

take(SnapshotObjectType, string, string[], ServiceCallback<void>)

function take(type: SnapshotObjectType, objectId: string, applyScope: string[], callback: ServiceCallback<void>)

Parameters

type
SnapshotObjectType

User specified type for the source object to take snapshot from. Currently FaceList, PersonGroup, LargeFaceList and LargePersonGroup are supported. Possible values include: 'FaceList', 'LargeFaceList', 'LargePersonGroup', 'PersonGroup'

objectId

string

User specified source object id to take snapshot from.

applyScope

string[]

User specified array of target Face subscription ids for the snapshot. For each snapshot, only subscriptions included in the applyScope of Snapshot - Take can apply it.

callback

ServiceCallback<void>

The callback

take(SnapshotObjectType, string, string[], SnapshotTakeOptionalParams)

Submit an operation to take a snapshot of face list, large face list, person group or large person group, with user-specified snapshot type, source object id, apply scope and an optional user data.
The snapshot interfaces are for users to backup and restore their face data from one face subscription to another, inside same region or across regions. The workflow contains two phases, user first calls Snapshot - Take to create a copy of the source object and store it as a snapshot, then calls Snapshot - Apply to paste the snapshot to target subscription. The snapshots are stored in a centralized location (per Azure instance), so that they can be applied cross accounts and regions.
Taking snapshot is an asynchronous operation. An operation id can be obtained from the "Operation-Location" field in response header, to be used in OperationStatus - Get for tracking the progress of creating the snapshot. The snapshot id will be included in the "resourceLocation" field in OperationStatus - Get response when the operation status is "succeeded".
Snapshot taking time depends on the number of person and face entries in the source object. It could be in seconds, or up to several hours for 1,000,000 persons with multiple faces.
Snapshots will be automatically expired and cleaned in 48 hours after it is created by Snapshot

  • Take. User can delete the snapshot using Snapshot - Delete by themselves any time before expiration.
    Taking snapshot for a certain object will not block any other operations against the object. All read-only operations (Get/List and Identify/FindSimilar/Verify) can be conducted as usual. For all writable operations, including Add/Update/Delete the source object or its persons/faces and Train, they are not blocked but not recommended because writable updates may not be reflected on the snapshot during its taking. After snapshot taking is completed, all readable and writable operations can work as normal. Snapshot will also include the training results of the source object, which means target subscription the snapshot applied to does not need re-train the target object before calling Identify/FindSimilar.
  • Free-tier subscription quota: 100 take operations per month.
  • S0-tier subscription quota: 100 take operations per day.
function take(type: SnapshotObjectType, objectId: string, applyScope: string[], options?: SnapshotTakeOptionalParams): Promise<SnapshotTakeResponse>

Parameters

type
SnapshotObjectType

User specified type for the source object to take snapshot from. Currently FaceList, PersonGroup, LargeFaceList and LargePersonGroup are supported. Possible values include: 'FaceList', 'LargeFaceList', 'LargePersonGroup', 'PersonGroup'

objectId

string

User specified source object id to take snapshot from.

applyScope

string[]

User specified array of target Face subscription ids for the snapshot. For each snapshot, only subscriptions included in the applyScope of Snapshot - Take can apply it.

options
SnapshotTakeOptionalParams

The optional parameters

Returns

Promise<Models.SnapshotTakeResponse>

take(SnapshotObjectType, string, string[], SnapshotTakeOptionalParams, ServiceCallback<void>)

function take(type: SnapshotObjectType, objectId: string, applyScope: string[], options: SnapshotTakeOptionalParams, callback: ServiceCallback<void>)

Parameters

type
SnapshotObjectType

User specified type for the source object to take snapshot from. Currently FaceList, PersonGroup, LargeFaceList and LargePersonGroup are supported. Possible values include: 'FaceList', 'LargeFaceList', 'LargePersonGroup', 'PersonGroup'

objectId

string

User specified source object id to take snapshot from.

applyScope

string[]

User specified array of target Face subscription ids for the snapshot. For each snapshot, only subscriptions included in the applyScope of Snapshot - Take can apply it.

options
SnapshotTakeOptionalParams

The optional parameters

callback

ServiceCallback<void>

The callback

update(string, ServiceCallback<void>)

function update(snapshotId: string, callback: ServiceCallback<void>)

Parameters

snapshotId

string

Id referencing a particular snapshot.

callback

ServiceCallback<void>

The callback

update(string, SnapshotUpdateOptionalParams)

Update the information of a snapshot. Only the source subscription who took the snapshot can update the snapshot.

function update(snapshotId: string, options?: SnapshotUpdateOptionalParams): Promise<RestResponse>

Parameters

snapshotId

string

Id referencing a particular snapshot.

options
SnapshotUpdateOptionalParams

The optional parameters

Returns

Promise<RestResponse>

Promise<msRest.RestResponse>

update(string, SnapshotUpdateOptionalParams, ServiceCallback<void>)

function update(snapshotId: string, options: SnapshotUpdateOptionalParams, callback: ServiceCallback<void>)

Parameters

snapshotId

string

Id referencing a particular snapshot.

options
SnapshotUpdateOptionalParams

The optional parameters

callback

ServiceCallback<void>

The callback