編集

次の方法で共有


Set-AzApiManagementOperation

Sets API operation details.

Syntax

Set-AzApiManagementOperation
   -Context <PsApiManagementContext>
   -ApiId <String>
   [-ApiRevision <String>]
   -OperationId <String>
   -Name <String>
   -Method <String>
   -UrlTemplate <String>
   [-Description <String>]
   [-TemplateParameters <PsApiManagementParameter[]>]
   [-Request <PsApiManagementRequest>]
   [-Responses <PsApiManagementResponse[]>]
   [-PassThru]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

The Set-AzApiManagementOperation cmdlet sets API operation details.

Examples

Example 1: Set the operation details

$apimContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
New-AzApiManagementOperation -Context $apimContext -ApiId $APIID -OperationId $OperationId -Name "Get Resource" -Method GET -UrlTemplate "/newresource" -Description "Use this operation to get newresource"

This command sets the operation details for API management.

Example 2

Sets API operation details. (autogenerated)

Set-AzApiManagementOperation -ApiId '0001' -Context <PsApiManagementContext> -Method 'GET' -Name 'ContosoApi' -OperationId 'Operation003' -UrlTemplate '/newresource'

Parameters

-ApiId

Specifies the identifier of the API.

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

-ApiRevision

Identifier of API Revision. This parameter is optional. If not specified, the operation will be updated in the currently active api revision.

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

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Context

Specifies an instance of PsApiManagementContext.

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

-Description

Specifies the description of the new operation.

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

-Method

Specifies the HTTP method of the new operation.

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

-Name

Specifies the display name of the new operation.

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

-OperationId

Specifies the identifier of the existing operation.

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

-PassThru

passthru

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

-Request

Specifies the operation request details.

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

-Responses

Specifies an array of possible operation responses.

Type:PsApiManagementResponse[]
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-TemplateParameters

Specifies an array or parameters defined in parameter UrlTemplate. If you do not specify a value, a default value will be generated based on the UrlTemplate. Use the parameter to give more details on parameters such as description, type, and other possible values.

Type:PsApiManagementParameter[]
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-UrlTemplate

Specifies the URL template. For instance: customers/{cid}/orders/{oid}/?date={date}.

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

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

PsApiManagementContext

String

PsApiManagementParameter[]

PsApiManagementRequest

PsApiManagementResponse[]

SwitchParameter

Outputs

PsApiManagementOperation