New-AzApiManagementApi
Hiermee maakt u een API.
Syntax
New-AzApiManagementApi
-Context <PsApiManagementContext>
[-ApiId <String>]
-Name <String>
[-Description <String>]
-ServiceUrl <String>
-Path <String>
-Protocols <PsApiManagementSchema[]>
[-AuthorizationServerId <String>]
[-AuthorizationScope <String>]
[-OpenIdProviderId <String>]
[-BearerTokenSendingMethod <String[]>]
[-SubscriptionKeyHeaderName <String>]
[-SubscriptionKeyQueryParamName <String>]
[-ProductIds <String[]>]
[-SubscriptionRequired]
[-ApiVersionDescription <String>]
[-ApiVersionSetId <String>]
[-ApiVersion <String>]
[-SourceApiId <String>]
[-SourceApiRevision <String>]
[-ApiType <PsApiManagementApiType>]
[-TermsOfServiceUrl <String>]
[-ContactName <String>]
[-ContactUrl <String>]
[-ContactEmail <String>]
[-LicenseName <String>]
[-LicenseUrl <String>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Description
Met de cmdlet New-AzApiManagementApi maakt u een Azure API Management-API.
Voorbeelden
Voorbeeld 1: Een API maken
$ApiMgmtContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
New-AzApiManagementApi -Context $ApiMgmtContext -Name "Echo api" -ServiceUrl "https://contoso.com/apis/echo" -Protocols @("http", "https") -Path "testapi"
Met deze opdracht maakt u een API met de naam EchoApi met de opgegeven URL.
Voorbeeld 2: Een API maken door alle bewerkingen, tags, producten en beleidsregels van echo-api en in een ApiVersionSet te kopiëren
$context = New-AzApiManagementContext -ResourceId /subscriptions/subid/resourceGroups/Api-Default-West-US/providers/Microsoft.ApiManagement/service/contoso
$versionSet = Get-AzApiManagementApiVersionSet -Context $context -ApiVersionSetId "xmsVersionSet"
New-AzApiManagementApi -Context $context -Name "echoapiv4" -Description "Create Echo Api V4" -SubscriptionRequired -ServiceUrl "https://echoapi.cloudapp.net/v4" -Path "echov3" -Protocols @("http", "https") -ApiVersionSetId $versionSet.ApiVersionSetId -SourceApiId "echo-api" -ApiVersion "v4"
ApiId : 691b7d410125414a929c108541c60e06
Name : echoapiv4
Description : Create Echo Api V4
ServiceUrl : https://echoapi.cloudapp.net/v4
Path : echov3
ApiType : http
Protocols : {Http, Https}
AuthorizationServerId :
AuthorizationScope :
OpenidProviderId :
BearerTokenSendingMethod : {}
SubscriptionKeyHeaderName : Ocp-Apim-Subscription-Key
SubscriptionKeyQueryParamName : subscription-key
ApiRevision : 1
ApiVersion : v4
IsCurrent : True
IsOnline : False
SubscriptionRequired : True
ApiRevisionDescription :
ApiVersionSetDescription :
ApiVersionSetId : /subscriptions/subid/resourceGroups/Api-Default-West-US/providers/Microsoft.ApiManagement/service/contoso/apiVersionSets/xmsVersionSet
Id : /subscriptions/subid/resourceGroups/Api-Default-West-US/providers/Microsoft.ApiManagement/service/contoso/apis/691b7d410125414a929c108541c60e06
ResourceGroupName : Api-Default-West-US
ServiceName : contoso
Met deze opdracht maakt u een API echoapiv3
in ApiVersionSet xmsVersionSet
en kopieert u alle bewerkingen, tags en beleidsregels van de bron-API echo-api
. Het overschrijft het SubscriptionRequired, ServiceUrl, Path, Protocols
Voorbeeld 3
Hiermee maakt u een API. (automatisch gegenereerd)
New-AzApiManagementApi -ApiId '0001' -Context <PsApiManagementContext> -Name 'Echo api' -Path 'echov3' -Protocols Http -ServiceUrl 'https://contoso.com/apis/echo'
Parameters
-ApiId
Hiermee geeft u de id van de API die moet worden gemaakt. Als u deze parameter niet opgeeft, genereert deze cmdlet een id voor u.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ApiType
Type API dat moet worden gemaakt (http, soap, websocket, graphql). Deze parameter is optioneel.
Type: | Nullable<T>[PsApiManagementApiType] |
Accepted values: | Http, Soap, WebSocket, GraphQL |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ApiVersion
Api-versie van de API die moet worden gemaakt. Deze parameter is optioneel.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ApiVersionDescription
Beschrijving van api-versie. Deze parameter is optioneel.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ApiVersionSetId
Een resource-id voor de gerelateerde API-versieset. Deze parameter is optioneel.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-AuthorizationScope
Hiermee geeft u het OAuth-bewerkingsbereik. De standaardwaarde is $Null.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-AuthorizationServerId
Hiermee geeft u de OAuth-autorisatieserver-id. De standaardwaarde is $Null. U moet deze parameter opgeven als AuthorizationScope is opgegeven.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-BearerTokenSendingMethod
OpenId-autorisatieservermechanisme waarmee het toegangstoken wordt doorgegeven aan de API. https://datatracker.ietf.org/doc/html/rfc6749#section-4Raadpleeg . Deze parameter is optioneel. De standaardwaarde is $null.
Type: | String[] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ContactEmail
Het e-mailadres van de contactpersoon/organisatie. MOET de indeling van een e-mailadres hebben. Deze parameter is optioneel.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ContactName
De identificatienaam van de contactpersoon/organisatie. Deze parameter is optioneel.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ContactUrl
De URL die verwijst naar de contactgegevens. MOET de indeling van een URL hebben. Deze parameter is optioneel.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Context
Hiermee geeft u een PsApiManagementContext-object .
Type: | PsApiManagementContext |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-DefaultProfile
De referenties, het account, de tenant en het abonnement die worden gebruikt voor communicatie met Azure.
Type: | IAzureContextContainer |
Aliases: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Description
Hiermee geeft u een beschrijving voor de web-API.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-LicenseName
De licentienaam die wordt gebruikt voor de API. Deze parameter is optioneel.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-LicenseUrl
Een URL naar de servicevoorwaarden voor de API. Deze parameter is optioneel.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Name
Hiermee geeft u de naam van de web-API. Dit is de openbare naam van de API, zoals deze wordt weergegeven in de ontwikkelaars- en beheerportals.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-OpenIdProviderId
OpenId-autorisatieserver-id. Deze parameter is optioneel. De standaardwaarde is $null. Moet worden opgegeven als BearerTokenSendingMethods is opgegeven.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Path
Hiermee geeft u het web-API-pad op. Dit is het laatste deel van de openbare URL van de API en komt overeen met het achtervoegsel van de web-API in de beheerportal. Deze URL wordt door API-gebruikers gebruikt voor het verzenden van aanvragen naar de webservice en moet één tot 400 tekens lang zijn. De standaardwaarde is $Null.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ProductIds
Hiermee geeft u een matrix van product-id's op waaraan de nieuwe API moet worden toegevoegd.
Type: | String[] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Protocols
Hiermee geeft u een matrix van web-API-protocollen. Geldige waarden zijn http, https. Dit zijn de webprotocollen waarover de API beschikbaar wordt gesteld. De standaardwaarde is $Null.
Type: | PsApiManagementSchema[] |
Accepted values: | Http, Https, Ws, Wss |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ServiceUrl
Hiermee geeft u de URL op van de webservice die de API beschikbaar maakt. Deze URL wordt alleen gebruikt door Azure API Management en wordt niet openbaar gemaakt. De URL moet één tot 2000 tekens lang zijn.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-SourceApiId
Api-id van de bron-API. Deze parameter is optioneel.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-SourceApiRevision
Api-revisie van de bron-API. Deze parameter is optioneel.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-SubscriptionKeyHeaderName
Hiermee geeft u de naam van de header van de abonnementssleutel op. De standaardwaarde is $Null.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-SubscriptionKeyQueryParamName
Hiermee geeft u de naam van de queryreeksparameter voor de abonnementssleutel op. De standaardwaarde is $Null.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-SubscriptionRequired
Vlag voor het afdwingen van SubscriptionRequired voor aanvragen naar de API. Deze parameter is optioneel.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-TermsOfServiceUrl
Een URL naar de servicevoorwaarden voor de API. Deze parameter is optioneel.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Invoerwaarden
String[]
Uitvoerwaarden
Verwante koppelingen
Azure PowerShell
Feedback
https://aka.ms/ContentUserFeedback.
Binnenkort beschikbaar: In de loop van 2024 zullen we GitHub-problemen geleidelijk uitfaseren als het feedbackmechanisme voor inhoud en deze vervangen door een nieuw feedbacksysteem. Zie voor meer informatie:Feedback verzenden en weergeven voor