Get-AzApiManagementApi

Gets an API.

Syntax

Get-AzApiManagementApi
   -Context <PsApiManagementContext>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzApiManagementApi
   -Context <PsApiManagementContext>
   -ApiId <String>
   [-ApiRevision <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzApiManagementApi
   -Context <PsApiManagementContext>
   -Name <String>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzApiManagementApi
   -Context <PsApiManagementContext>
   -ProductId <String>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzApiManagementApi
   -Context <PsApiManagementContext>
   -GatewayId <String>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

Description

The Get-AzApiManagementApi cmdlet gets one or more Azure API Management APIs.

Examples

Example 1: Get all management APIs

$ApiMgmtContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
Get-AzApiManagementApi -Context $ApiMgmtContext

This command gets all of the APIs for the specified context.

Example 2: Get a management API by ID

$ApiMgmtContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
Get-AzApiManagementApi -Context $ApiMgmtContext -ApiId $ApiId

This command gets the API with the specified ID.

Example 3: Get a management API by name

$ApiMgmtContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
Get-AzApiManagementApi -Context $ApiMgmtContext -Name "EchoApi"

This command gets the API with the specified name.

Example 4: Get a management API by GatewayId

$ApiMgmtContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
Get-AzApiManagementApi -Context $ApiMgmtContext -GatewayId "g01"

This command gets the API for the specified GatewayId.

Parameters

-ApiId

Specifies the ID of the API to get.

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

-ApiRevision

Revision Identifier of the particular Api revision. This parameter is optional.

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

-Context

Specifies a PsApiManagementContext object.

Type:PsApiManagementContext
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with azure.

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

-GatewayId

If specified will try to get all Gateway APIs.

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

-Name

Specifies the name of the API to get.

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

-ProductId

Specifies the ID of the product for which to get the API.

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

Inputs

PsApiManagementContext

String

Outputs

PsApiManagementApi