Edit

Share via


Get-AzApiManagementApi

Gets an API.

Syntax

GetAllApis (Default)

Get-AzApiManagementApi
    -Context <PsApiManagementContext>
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

GetByApiId

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

GetByName

Get-AzApiManagementApi
    -Context <PsApiManagementContext>
    -Name <String>
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

GetByProductId

Get-AzApiManagementApi
    -Context <PsApiManagementContext>
    -ProductId <String>
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

GetByGatewayId

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.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

GetByApiId
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-ApiRevision

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

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

GetByApiId
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Context

Specifies a PsApiManagementContext object.

Parameter properties

Type:PsApiManagementContext
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:True
Value from remaining arguments:False

-DefaultProfile

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

Parameter properties

Type:IAzureContextContainer
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AzContext, AzureRmContext, AzureCredential

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-GatewayId

If specified will try to get all Gateway APIs.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

GetByGatewayId
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Name

Specifies the name of the API to get.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

GetByName
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-ProductId

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

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

GetByProductId
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

PsApiManagementContext

String

Outputs

PsApiManagementApi