-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ApiProperties support for Cognitive Services (#12870)
* Add ApiProperties support * Change ApiProperties to singular in cmdlet name and parameter * Update NewAzureCognitiveServicesAccountApiProperty.cs Remove `SupportsShouldProcess = true` * Override signature issue
- Loading branch information
Showing
13 changed files
with
1,009 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
756 changes: 756 additions & 0 deletions
756
...CognitiveServices.Test.ScenarioTests.CognitiveServicesAccountTests/TestApiProperties.json
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
...CognitiveServices/CognitiveServicesAccount/NewAzureCognitiveServicesAccountApiProperty.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// ---------------------------------------------------------------------------------- | ||
// | ||
// Copyright Microsoft Corporation | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// ---------------------------------------------------------------------------------- | ||
|
||
using Microsoft.Azure.Management.CognitiveServices.Models; | ||
using System.Management.Automation; | ||
using CognitiveServicesModels = Microsoft.Azure.Management.CognitiveServices.Models; | ||
|
||
namespace Microsoft.Azure.Commands.Management.CognitiveServices | ||
{ | ||
/// <summary> | ||
/// Generate Cognitive Services Account ApiProperties class | ||
/// </summary> | ||
[Cmdlet("New", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "CognitiveServicesAccountApiProperty"), OutputType(typeof(CognitiveServicesModels.CognitiveServicesAccountApiProperties))] | ||
public class NewAzureCognitiveServicesAccountApiPropertyCommand : CognitiveServicesAccountBaseCmdlet | ||
{ | ||
public override void ExecuteCmdlet() | ||
{ | ||
base.ExecuteCmdlet(); | ||
|
||
WriteObject(new CognitiveServicesAccountApiProperties()); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
98 changes: 98 additions & 0 deletions
98
...iveServices/CognitiveServices/help/New-AzCognitiveServicesAccountApiProperty.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
--- | ||
external help file: Microsoft.Azure.PowerShell.Cmdlets.CognitiveServices.dll-Help.xml | ||
Module Name: Az.CognitiveServices | ||
online version: https://docs.microsoft.com/en-us/powershell/module/az.cognitiveservices/new-azcognitiveservicesaccountapiproperty | ||
schema: 2.0.0 | ||
--- | ||
|
||
# New-AzCognitiveServicesAccountApiProperty | ||
|
||
## SYNOPSIS | ||
Generate a new instance of Cognitive Services Account ApiProperties | ||
|
||
## SYNTAX | ||
|
||
``` | ||
New-AzCognitiveServicesAccountApiProperty [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] | ||
[<CommonParameters>] | ||
``` | ||
|
||
## DESCRIPTION | ||
Generate a new instance of Cognitive Services Account ApiProperties. | ||
ApiProperties can be used when creating a new account or updating an existing account. | ||
ApiProperties is required by certain account types. | ||
|
||
## EXAMPLES | ||
|
||
### Example 1 | ||
```powershell | ||
PS C:\> $apiProperties = New-AzCognitiveServicesAccountApiProperty | ||
PS C:\> $apiProperties.QnaRuntimeEndpoint = "https://qnamaker.azurewebsites.net" | ||
PS C:\> New-AzCognitiveServicesAccount -ResourceGroupName cognitive-services-resource-group -name qnamaker -Type QnAMaker -SkuName S0 -Locatio WestUS -ApiProperty $apiProperties | ||
``` | ||
|
||
Above example will create an QnAMaker account, with API property "QnaRuntimeEndpoint". | ||
|
||
|
||
## PARAMETERS | ||
|
||
### -DefaultProfile | ||
The credentials, account, tenant, and subscription used for communication with Azure. | ||
|
||
```yaml | ||
Type: IAzureContextContainer | ||
Parameter Sets: (All) | ||
Aliases: AzContext, AzureRmContext, AzureCredential | ||
|
||
Required: False | ||
Position: Named | ||
Default value: None | ||
Accept pipeline input: False | ||
Accept wildcard characters: False | ||
``` | ||
### -Confirm | ||
Prompts you for confirmation before running the cmdlet. | ||
```yaml | ||
Type: SwitchParameter | ||
Parameter Sets: (All) | ||
Aliases: cf | ||
|
||
Required: False | ||
Position: Named | ||
Default value: None | ||
Accept pipeline input: False | ||
Accept wildcard characters: False | ||
``` | ||
### -WhatIf | ||
Shows what would happen if the cmdlet runs. | ||
The cmdlet is not run. | ||
```yaml | ||
Type: SwitchParameter | ||
Parameter Sets: (All) | ||
Aliases: wi | ||
|
||
Required: False | ||
Position: Named | ||
Default value: None | ||
Accept pipeline input: False | ||
Accept wildcard characters: False | ||
``` | ||
### CommonParameters | ||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). | ||
## INPUTS | ||
### None | ||
## OUTPUTS | ||
### Microsoft.Azure.Management.CognitiveServices.Models.CognitiveServicesAccountApiProperties | ||
## NOTES | ||
## RELATED LINKS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters