編輯

共用方式為


New-AzDataProtectionRestoreConfigurationClientObject

Creates new restore configuration object

Syntax

New-AzDataProtectionRestoreConfigurationClientObject
   -DatasourceType <DatasourceTypes>
   [-ExcludedResourceType <String[]>]
   [-IncludedResourceType <String[]>]
   [-ExcludedNamespace <String[]>]
   [-IncludedNamespace <String[]>]
   [-LabelSelector <String[]>]
   [-IncludeClusterScopeResource <Boolean>]
   [-ConflictPolicy <String>]
   [-NamespaceMapping <KubernetesClusterRestoreCriteriaNamespaceMappings>]
   [-PersistentVolumeRestoreMode <String>]
   [-RestoreHookReference <NamespacedNameResource[]>]
   [-ResourceModifierReference <NamespacedNameResource>]
   [-StagingResourceGroupId <String>]
   [-StagingStorageAccountId <String>]
   [<CommonParameters>]

Description

Creates new restore configuration object

Examples

Example 1: Create a RestoreConfiguration for restoring with AzureKubernetesService

$restoreConfig = New-AzDataProtectionRestoreConfigurationClientObject -DatasourceType AzureKubernetesService -PersistentVolumeRestoreMode RestoreWithVolumeData -IncludeClusterScopeResource $true -NamespaceMapping  @{"sourcenamespace1"="targetnamespace1";"sourcenamespace2"="targetnamespace2"} -ExcludedNamespace "excludeNS1","excludeNS2" -RestoreHookReference @(@{name='restorehookname';namespace='default'},@{name='restorehookname1';namespace='hrweb'})

ObjectType                       ConflictPolicy ExcludedNamespace        ExcludedResourceType IncludeClusterScopeResource IncludedNamespace IncludedResourceType LabelSelector PersistentVolumeRestoreMode
----------                       -------------- -----------------        -------------------- --------------------------- ----------------- -------------------- ------------- ---------------------------
KubernetesClusterRestoreCriteria Skip           {excludeNS1, excludeNS2}                      True                                                                             RestoreWithVolumeData

This command can be used to create a restore configuration client object used for Kubernetes cluster restore. RestoreHookReferences is a list of references to RestoreHooks that should be executed during restore.

Parameters

-ConflictPolicy

Conflict policy for restore. Allowed values are Skip, Patch. Default value is Skip

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DatasourceType

Datasource Type

Type:DatasourceTypes
Accepted values:AzureDisk, AzureBlob, AzureDatabaseForPostgreSQL, AzureKubernetesService, AzureDatabaseForPGFlexServer, AzureDatabaseForMySQL
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ExcludedNamespace

List of namespaces to be excluded for restore

Type:String[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ExcludedResourceType

List of resource types to be excluded for restore

Type:String[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-IncludeClusterScopeResource

Boolean parameter to decide whether cluster scope resources are included for restore. By default this is taken as true.

Type:Nullable<T>[Boolean]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-IncludedNamespace

List of namespaces to be included for restore

Type:String[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-IncludedResourceType

List of resource types to be included for restore

Type:String[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-LabelSelector

List of labels for internal filtering for restore

Type:String[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-NamespaceMapping

Namespaces mapping from source namespaces to target namespaces to resolve namespace naming conflicts in the target cluster. To construct, see NOTES section for NAMESPACEMAPPING properties and create a hash table.

Type:KubernetesClusterRestoreCriteriaNamespaceMappings
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-PersistentVolumeRestoreMode

Restore mode for persistent volumes. Allowed values are RestoreWithVolumeData, RestoreWithoutVolumeData. Default value is RestoreWithVolumeData

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ResourceModifierReference

Resource modifier reference to be executed during restore. To construct, see NOTES section for RESOURCEMODIFIERREFERENCE properties and create a hash table.

Type:NamespacedNameResource
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-RestoreHookReference

Hook reference to be executed during restore. To construct, see NOTES section for RESTOREHOOKREFERENCE properties and create a hash table.

Type:NamespacedNameResource[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-StagingResourceGroupId

Staging resource group Id for restore.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-StagingStorageAccountId

Staging storage account Id for restore.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Outputs

PSObject