你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Get-AzDeploymentManagerServiceUnit

获取服务单元。

语法

Get-AzDeploymentManagerServiceUnit
   [-ResourceGroupName] <String>
   [-ServiceTopologyName] <String>
   [-ServiceName] <String>
   [[-Name] <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzDeploymentManagerServiceUnit
   [-ResourceGroupName] <String>
   [[-Name] <String>]
   [-ServiceObject] <PSServiceResource>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzDeploymentManagerServiceUnit
   [-ResourceGroupName] <String>
   [[-Name] <String>]
   [-ServiceResourceId] <String>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzDeploymentManagerServiceUnit
   [-ResourceGroupName] <String>
   [-ServiceName] <String>
   [[-Name] <String>]
   [-ServiceTopologyObject] <PSServiceTopologyResource>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzDeploymentManagerServiceUnit
   [-ResourceGroupName] <String>
   [-ServiceName] <String>
   [[-Name] <String>]
   [-ServiceTopologyResourceId] <String>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzDeploymentManagerServiceUnit
   [-ResourceId] <String>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzDeploymentManagerServiceUnit
   [-InputObject] <PSServiceUnitResource>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

说明

Get-AzDeploymentManagerServiceUnit cmdlet 获取服务中的服务单元。

按服务单元的名称、定义的服务、服务拓扑名称和资源组名称指定服务单元。 或者,可以提供 ServiceUnit 对象或 ResourceId。

可以在本地修改此对象,然后使用 Set-AzDeploymentManagerServiceUnit cmdlet 对服务单元应用更改。

示例

示例 1

Get-AzDeploymentManagerServiceUnit -ResourceGroupName ContosoResourceGroup -ServiceTopologyName ContosoServiceTopology -ServiceName ContosoService1  -Name ContosoService1Storage

此命令在 ContosoResourceGroup 中名为 ContosoServiceTopology 的服务拓扑中的服务拓扑中获取名为 ContosoService1 的服务单元存储。

示例 2:使用资源标识符获取服务单元。

Get-AzDeploymentManagerServiceUnit -ResourceId "/subscriptions/subscriptionId/resourcegroups/ContosoResourceGroup/providers/Microsoft.DeploymentManager/serviceTopologies/ContosoServiceTopology/services/ContosoService1/serviceUnits/ContosoService1Storage"

此命令在 ContosoResourceGroup 中名为 ContosoServiceTopology 的服务拓扑中的服务拓扑中获取名为 ContosoService1 的服务单元存储。

示例 3:使用服务单元对象获取服务单元。

Get-AzDeploymentManagerServiceUnit -InputObject $serviceUnitObject

此命令获取一个服务单元,其名称、服务名称、服务拓扑名称和 ResourceGroup 分别与$serviceUnitObject的名称、ServiceName、ServiceTopologyName 和 ResourceGroupName 属性匹配。

参数

-DefaultProfile

用于与 Azure 通信的凭据、帐户、租户和订阅。

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-InputObject

服务单元资源对象。

Type:PSServiceUnitResource
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Name

服务单元的名称。

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

-ResourceGroupName

资源组。

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

-ResourceId

资源标识符。

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

-ServiceName

服务单元所属的服务的名称。

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

-ServiceObject

应在其中创建服务单元的服务对象。

Type:PSServiceResource
Position:1
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ServiceResourceId

应在其中创建服务单元的服务资源标识符。

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

-ServiceTopologyName

服务单元所属的服务拓扑的名称。

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

-ServiceTopologyObject

应在其中创建服务单元的服务拓扑对象。

Type:PSServiceTopologyResource
Position:1
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ServiceTopologyResourceId

应在其中创建服务单元的服务拓扑资源标识符。

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

输入

String

PSServiceUnitResource

输出

PSServiceUnitResource