az apim api operation

Manage Azure API Management API Operations.

Commands

az apim api operation create

Creates a new operation in the API.

az apim api operation delete

Deletes the specified operation in the API.

az apim api operation list

List a collection of the operations for the specified API.

az apim api operation show

Gets the details of the API Operation specified by its identifier.

az apim api operation update

Updates the details of the operation in the API specified by its identifier.

az apim api operation create

Creates a new operation in the API.

az apim api operation create --api-id
                             --display-name
                             --method
                             --resource-group
                             --service-name
                             --url-template
                             [--description]
                             [--if-match]
                             [--operation-id]
                             [--params]

Examples

Creates a new operation in the API with several parameters

az apim api operation create --resource-group MyResourceGroup --service-name MyServiceName --api-id MyApiId --url-template "/session/{param1}/{param2}" --method "GET" --display-name MyOperationName --description MyDescription --template-parameters name=param1 description=descriptionContent type=paramType required="true" --template-parameters name=param2 required="false" type="string"

Required Parameters

--api-id

API identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number.

--display-name

Required. Operation Name.

--method

Required. A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--service-name -n

The name of the API Management service instance.

--url-template

Relative URL template identifying the target resource for this operation. May include parameters.

Optional Parameters

--description

Description of the operation. May include HTML formatting tags.

--if-match

ETag of the Entity.

--operation-id

Operation identifier within an API. Must be unique in the current API Management service instance.

--params --template-parameters -p

Collection of URL template parameters.

az apim api operation delete

Deletes the specified operation in the API.

az apim api operation delete --api-id
                             --operation-id
                             --resource-group
                             --service-name
                             [--if-match]

Examples

Deletes the specified operation in the API.

az apim api operation delete --resource-group MyResourceGroup --service-name MyServiceName --api-id MyApiId --operation-id MyOperationId

Required Parameters

--api-id

API identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number.

--operation-id

Operation identifier within an API. Must be unique in the current API Management service instance.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--service-name -n

The name of the API Management service instance.

Optional Parameters

--if-match

ETag of the Entity.

az apim api operation list

List a collection of the operations for the specified API.

az apim api operation list --api-id
                           --resource-group
                           --service-name

Examples

List a collection of the operations for the specified API.

az apim api operation list --resource-group MyResourceGroup --service-name MyServiceName --api-id MyApiId

Required Parameters

--api-id

API identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--service-name -n

The name of the API Management service instance.

az apim api operation show

Gets the details of the API Operation specified by its identifier.

az apim api operation show --api-id
                           --operation-id
                           --resource-group
                           --service-name

Examples

Gets the details of the API Operation specified by its identifier.

az apim api operation show --resource-group MyResourceGroup --service-name MyServiceName --api-id MyApiId --operation-id MyOperationId

Required Parameters

--api-id

API identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number.

--operation-id

Operation identifier within an API. Must be unique in the current API Management service instance.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--service-name -n

The name of the API Management service instance.

az apim api operation update

Updates the details of the operation in the API specified by its identifier.

az apim api operation update --api-id
                             --operation-id
                             --resource-group
                             --service-name
                             [--add]
                             [--description]
                             [--display-name]
                             [--force-string]
                             [--if-match]
                             [--method]
                             [--remove]
                             [--set]
                             [--url-template]

Examples

Updates method, displayname, description of the operation in the API specified by its identifier.

az apim api operation update --resource-group MyResourceGroup --service-name MyServiceName --api-id MyApiId --operation-id MyOperationId --method "PUT" --display-name NewDisplayName --description NewDescription

Required Parameters

--api-id

API identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number.

--operation-id

Operation identifier within an API. Must be unique in the current API Management service instance.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--service-name -n

The name of the API Management service instance.

Optional Parameters

--add

Add an object to a list of objects by specifying a path and key value pairs. Example: --add property.listProperty <key=value, string or JSON string>.

default value: []
--description

Description of the operation. May include HTML formatting tags.

--display-name

Required. Operation Name.

--force-string

When using 'set' or 'add', preserve string literals instead of attempting to convert to JSON.

default value: False
--if-match

ETag of the Entity.

--method

Required. A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them.

--remove

Remove a property or an element from a list. Example: --remove property.list OR --remove propertyToRemove.

default value: []
--set

Update an object by specifying a property path and value to set. Example: --set property1.property2=.

default value: []
--url-template

Relative URL template identifying the target resource for this operation. May include parameters.