Import-AzApiManagementApi
Hiermee importeert u een API uit een bestand of een URL.
Syntax
Import-AzApiManagementApi
-Context <PsApiManagementContext>
[-ApiId <String>]
[-ApiRevision <String>]
-SpecificationFormat <PsApiManagementApiFormat>
-SpecificationPath <String>
[-Path <String>]
[-WsdlServiceName <String>]
[-WsdlEndpointName <String>]
[-ApiType <PsApiManagementApiType>]
[-Protocol <PsApiManagementSchema[]>]
[-ServiceUrl <String>]
[-ApiVersionSetId <String>]
[-ApiVersion <String>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Import-AzApiManagementApi
-Context <PsApiManagementContext>
[-ApiId <String>]
[-ApiRevision <String>]
-SpecificationFormat <PsApiManagementApiFormat>
-SpecificationUrl <String>
[-Path <String>]
[-WsdlServiceName <String>]
[-WsdlEndpointName <String>]
[-ApiType <PsApiManagementApiType>]
[-Protocol <PsApiManagementSchema[]>]
[-ServiceUrl <String>]
[-ApiVersionSetId <String>]
[-ApiVersion <String>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Description
Met de cmdlet Import-AzApiManagementApi importeert u een Azure API Management-API uit een bestand of een URL in WaDL (Web Application Description Language), Web Services Description Language (WSDL) of Swagger-indeling.
Voorbeelden
Voorbeeld 1: Een API importeren uit een WADL-bestand
$ApiMgmtContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
Import-AzApiManagementApi -Context $ApiMgmtContext -SpecificationFormat "Wadl" -SpecificationPath "C:\contoso\specifications\echoapi.wadl" -Path "apis"
Met deze opdracht importeert u een API uit het opgegeven WADL-bestand.
Voorbeeld 2: Een API importeren uit een Swagger-bestand
$ApiMgmtContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
Import-AzApiManagementApi -Context $ApiMgmtContext -SpecificationFormat "Swagger" -SpecificationPath "C:\contoso\specifications\echoapi.swagger" -Path "apis"
Met deze opdracht importeert u een API uit het opgegeven Swagger-bestand.
Voorbeeld 3: Een API importeren uit een Swagger-bestand en een bestaande API bijwerken
$ApiMgmtContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
Import-AzApiManagementApi -Context $ApiMgmtContext -ApiId "26591405e27d4ff3a8d8478d7e60c7b0" -SpecificationFormat "Swagger" -SpecificationPath "C:\contoso\specifications\echoapi.swagger" -Path "apis"
Met deze opdracht wordt een API geïmporteerd uit het opgegeven Swagger-bestand en wordt een bestaande API bijgewerkt.
Voorbeeld 4: Een API importeren vanuit een WADL-koppeling
$ApiMgmtContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
Import-AzApiManagementApi -Context $ApiMgmtContext -SpecificationFormat "Wadl" -SpecificationUrl "http://contoso.com/specifications/wadl/echoapi" -Path "apis"
Met deze opdracht wordt een API geïmporteerd uit de opgegeven WADL-koppeling.
Voorbeeld 5: Een API importeren vanuit een Open API-koppeling
$context = New-AzApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
Import-AzApiManagementApi -Context $context -SpecificationFormat OpenApi -SpecificationUrl https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v3.0/petstore.yaml -Path "petstore30"
ApiId : af3f57bab399455aa875d7050654e9d1
Name : Swagger Petstore
Description :
ServiceUrl : http://petstore.swagger.io/v1
Path : petstore30
ApiType : http
Protocols : {Https}
AuthorizationServerId :
AuthorizationScope :
OpenidProviderId :
BearerTokenSendingMethod : {}
SubscriptionKeyHeaderName : Ocp-Apim-Subscription-Key
SubscriptionKeyQueryParamName : subscription-key
ApiRevision : 1
ApiVersion :
IsCurrent : True
IsOnline : False
SubscriptionRequired :
ApiRevisionDescription :
ApiVersionSetDescription :
ApiVersionSetId :
Id : /subscriptions/subid/resourceGroups/Api-Default-West-US/providers/Microsoft.ApiManagement/service/contoso/apis/af3f57bab399455aa875d7050654e9d1
ResourceGroupName : Api-Default-West-US
ServiceName : contoso
Met deze opdracht wordt een API geïmporteerd uit de opgegeven open 3.0-specificatiekoppeling.
Voorbeeld 6: Een API importeren vanuit een Open Api Link in een ApiVersion-set
$context = New-AzApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
Import-AzApiManagementApi -Context $context -SpecificationPath "C:\contoso\specifications\uspto.yml" -SpecificationFormat OpenApi -Path uspostal -ApiVersionSetId 0d50e2cf-aaeb-4ea3-8a58-db9ec079c6cd -ApiVersion v2
ApiId : 6c3f20c66e5745b19229d06cd865948f
Name : USPTO Data Set API
Description : The Data Set API (DSAPI) allows the public users to discover and search USPTO exported data sets. This is a generic API that allows USPTO users to make any CSV based data files
searchable through API. With the help of GET call, it returns the list of data fields that are searchable. With the help of POST call, data can be fetched based on the filters on the
field names. Please note that POST call is used to search the actual data. The reason for the POST call is that it allows users to specify any complex search criteria without worry
about the GET size limitations as well as encoding of the input parameters.
ServiceUrl : https://developer.uspto.gov/ds-api
Path : uspostal
ApiType : http
Protocols : {Https}
AuthorizationServerId :
AuthorizationScope :
OpenidProviderId :
BearerTokenSendingMethod : {}
SubscriptionKeyHeaderName : Ocp-Apim-Subscription-Key
SubscriptionKeyQueryParamName : subscription-key
ApiRevision : 1
ApiVersion : v2
IsCurrent : True
IsOnline : False
SubscriptionRequired :
ApiRevisionDescription :
ApiVersionSetDescription :
ApiVersionSetId : /subscriptions/subid/resourceGroups/Api-Default-East-US/providers/Microsoft.ApiManagement/service/contoso/apiVersionSets/0d50e2cf-aaeb-4ea3-8a58-db9ec079c6cd
Id : /subscriptions/subid/resourceGroups/Api-Default-East-US/providers/Microsoft.ApiManagement/service/contoso/apis/6c3f20c66e5745b19229d06cd865948f
ResourceGroupName : Api-Default-East-US
ServiceName : contoso
Met deze opdracht importeert u een API uit het opgegeven open 3.0-specificatiedocument en maakt u een nieuwe ApiVersion.
Voorbeeld 7: Een API importeren vanuit een GraphQL-koppeling
$ApiMgmtContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
Import-AzApiManagementApi -Context $ApiMgmtContext -SpecificationFormat "GraphQL" -SpecificationUrl "http://contoso.com/graphql" -Path "graphqlapi"
ApiId : bg4g23csd067432zz853f0942341g3z1
Name : GraphQL Api
Description :
ServiceUrl : http://contoso.com/graphql
Path : graphqlapi
ApiType : graphql
Protocols : {Https}
AuthorizationServerId :
AuthorizationScope :
OpenidProviderId :
BearerTokenSendingMethod : {}
SubscriptionKeyHeaderName : Ocp-Apim-Subscription-Key
SubscriptionKeyQueryParamName : subscription-key
ApiRevision : 1
ApiVersion :
IsCurrent : True
IsOnline : False
SubscriptionRequired :
ApiRevisionDescription :
ApiVersionSetDescription :
ApiVersionSetId :
Id : /subscriptions/subid/resourceGroups/Api-Default-West-US/providers/Microsoft.ApiManagement/service/contoso/apis/bg4g23csd067432zz853f0942341g3z1
ResourceGroupName : Api-Default-West-US
ServiceName : contoso
Met deze opdracht importeert u een API vanuit de GraphQL-koppeling.
Parameters
-ApiId
Hiermee geeft u een id op voor de API die moet worden geïmporteerd. Als u deze parameter niet opgeeft, wordt er een id voor u gegenereerd.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ApiRevision
Id van API-revisie. Deze parameter is optioneel. Als dit niet is opgegeven, wordt het importeren uitgevoerd op de momenteel actieve revisie of een nieuwe API.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ApiType
Deze parameter is optioneel met een standaardwaarde van Http. De Soap-optie is alleen van toepassing bij het importeren van WSDL en maakt een SOAP Passthrough-API.
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 |
-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 |
-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 |
-Path
Hiermee geeft u een web-API-pad op als het laatste deel van de openbare URL van de API. Deze URL wordt gebruikt door API-consumenten voor het verzenden van aanvragen naar de webservice. Moet 1 tot 400 tekens lang zijn. De standaardwaarde is $Null.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Protocol
Web-API-protocollen (http, https). Protocollen over welke API beschikbaar wordt gemaakt. Deze parameter is optioneel. Indien opgegeven, worden de protocollen die zijn opgegeven in het specificatiesdocument overschreven.
Type: | PsApiManagementSchema[] |
Accepted values: | Http, Https, Ws, Wss |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ServiceUrl
Een URL van de webservice die de API weergeeft. Deze URL wordt alleen gebruikt door Azure API Management en wordt niet openbaar gemaakt. Deze parameter is optioneel. Indien opgegeven, wordt de ServiceUrl overschreven die is opgegeven in het document Specificaties.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-SpecificationFormat
Hiermee geeft u de specificatie-indeling. psdx_paramvalues Wadl, Wsdl en Swagger.
Type: | PsApiManagementApiFormat |
Accepted values: | Wadl, Swagger, Wsdl, OpenApi, OpenApiJson, GraphQL |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-SpecificationPath
Hiermee geeft u het pad naar het specificatiebestand.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-SpecificationUrl
Hiermee geeft u de specificatie-URL.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-WsdlEndpointName
De lokale naam van het WSDL-eindpunt (poort) dat moet worden geïmporteerd. Moet 1 tot 400 tekens lang zijn. Deze parameter is optioneel en alleen vereist voor het importeren van Wsdl. De standaardwaarde is $null.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-WsdlServiceName
De lokale naam van de WSDL-service die moet worden geïmporteerd. Moet 1 tot 400 tekens lang zijn. Deze parameter is optioneel en alleen vereist voor het importeren van Wsdl. De standaardwaarde is $null.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Invoerwaarden
Nullable<T>[[Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementApiType, Microsoft.Azure.PowerShell.Cmdlets.ApiManagement.ServiceManagement, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]
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