你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
New-AzApiManagementProduct
创建 API 管理产品。
语法
New-AzApiManagementProduct
-Context <PsApiManagementContext>
[-ProductId <String>]
-Title <String>
[-Description <String>]
[-LegalTerms <String>]
[-SubscriptionRequired <Boolean>]
[-ApprovalRequired <Boolean>]
[-SubscriptionsLimit <Int32>]
[-State <PsApiManagementProductState>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
说明
New-AzApiManagementProduct cmdlet 创建 API 管理产品。
示例
示例 1:创建不需要订阅的产品
$apimContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
New-AzApiManagementProduct -Context $apimContext -ProductId "0123456789" -Title "Starter" -Description "Starter Product" -LegalTerms "Free for all" -SubscriptionRequired $False -State "Published"
此命令创建 API 管理产品。 不需要订阅。
示例 2:创建需要订阅和审批的产品
$apimContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
New-AzApiManagementProduct -Context $apimContext -ProductId "9876543210" -Title "Unlimited" -Description "Subscribers have completely unlimited access to the API. Administrator approval is required." -LegalTerms "Free for all" -ApprovalRequired $True -State "Published"
此命令创建一个产品。 需要订阅和审批。
参数
-ApprovalRequired
指示产品订阅是否需要批准。 默认情况下,此参数 $False。
类型: | Nullable<T>[Boolean] |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-Context
指定 PsApiManagementContext 对象的实例。
类型: | PsApiManagementContext |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-DefaultProfile
用于与 Azure 通信的凭据、帐户、租户和订阅。
类型: | IAzureContextContainer |
别名: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Description
指定产品说明。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-LegalTerms
指定产品的法律使用条款。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-ProductId
指定新产品的标识符。 如果未指定此参数,则会生成新产品。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-State
指定产品状态。 psdx_paramvalues
- NotPublished
- 已发布 默认值为 NotPublished。
类型: | Nullable<T>[PsApiManagementProductState] |
接受的值: | NotPublished, Published |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-SubscriptionRequired
指示产品是否需要订阅。 默认值为 $True。
类型: | Nullable<T>[Boolean] |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-SubscriptionsLimit
指定同时订阅的最大数目。 默认值为 None。
类型: | Nullable<T>[Int32] |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-Title
指定产品标题。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
输入
Nullable<T>[[System.Boolean, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]
Nullable<T>[[System.Int32, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]
Nullable<T>[[Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementProductState, Microsoft.Azure.PowerShell.Cmdlets.ApiManagement.ServiceManagement, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]