共用方式為


az apim api operation

管理 Azure API 管理 API 作業。

命令

名稱 Description 類型 狀態
az apim api operation create

在 API 中建立新的作業。

核心 GA
az apim api operation delete

刪除 API 中指定的作業。

核心 GA
az apim api operation list

列出指定 API 之作業的集合。

核心 GA
az apim api operation show

取得其識別碼所指定的 API 作業詳細數據。

核心 GA
az apim api operation update

更新其識別碼所指定 API 中作業的詳細數據。

核心 GA

az apim api operation create

在 API 中建立新的作業。

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

範例

使用數個參數在 API 中建立新的作業

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"

必要參數

--api-id

API 識別碼。 目前 API 管理服務實例中必須是唯一的。 非目前的修訂具有 ;rev=n 作為後綴,其中 n 是修訂編號。

--display-name

必須的。 作業名稱。

--method

必須的。 有效的 HTTP 作業方法。 一般 Http 方法,例如 GET、PUT、POST,但不受限制。

--resource-group -g

資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。

--service-name -n

API 管理服務實例的名稱。

--url-template

識別此作業之目標資源的相對URL範本。 可能包含參數。

選擇性參數

--description

作業的描述。 可能包含 HTML 格式標記。

--if-match

實體的 ETag。

--operation-id

API 內的作業標識碼。 目前 API 管理服務實例中必須是唯一的。

--params --template-parameters -p

URL 樣本參數的集合。

全域參數
--debug

提高日誌詳細程度以顯示所有調試日誌。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。

--verbose

增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。

az apim api operation delete

刪除 API 中指定的作業。

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

範例

刪除 API 中指定的作業。

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

必要參數

--api-id

API 識別碼。 目前 API 管理服務實例中必須是唯一的。 非目前的修訂具有 ;rev=n 作為後綴,其中 n 是修訂編號。

--operation-id

API 內的作業標識碼。 目前 API 管理服務實例中必須是唯一的。

--resource-group -g

資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。

--service-name -n

API 管理服務實例的名稱。

選擇性參數

--if-match

實體的 ETag。

全域參數
--debug

提高日誌詳細程度以顯示所有調試日誌。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。

--verbose

增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。

az apim api operation list

列出指定 API 之作業的集合。

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

範例

列出指定 API 之作業的集合。

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

必要參數

--api-id

API 識別碼。 目前 API 管理服務實例中必須是唯一的。 非目前的修訂具有 ;rev=n 作為後綴,其中 n 是修訂編號。

--resource-group -g

資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。

--service-name -n

API 管理服務實例的名稱。

全域參數
--debug

提高日誌詳細程度以顯示所有調試日誌。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。

--verbose

增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。

az apim api operation show

取得其識別碼所指定的 API 作業詳細數據。

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

範例

取得其識別碼所指定的 API 作業詳細數據。

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

必要參數

--api-id

API 識別碼。 目前 API 管理服務實例中必須是唯一的。 非目前的修訂具有 ;rev=n 作為後綴,其中 n 是修訂編號。

--operation-id

API 內的作業標識碼。 目前 API 管理服務實例中必須是唯一的。

--resource-group -g

資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。

--service-name -n

API 管理服務實例的名稱。

全域參數
--debug

提高日誌詳細程度以顯示所有調試日誌。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。

--verbose

增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。

az apim api operation update

更新其識別碼所指定 API 中作業的詳細數據。

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]

範例

更新其標識碼所指定 API 中作業的方法、displayname、描述。

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

必要參數

--api-id

API 識別碼。 目前 API 管理服務實例中必須是唯一的。 非目前的修訂具有 ;rev=n 作為後綴,其中 n 是修訂編號。

--operation-id

API 內的作業標識碼。 目前 API 管理服務實例中必須是唯一的。

--resource-group -g

資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。

--service-name -n

API 管理服務實例的名稱。

選擇性參數

--add

藉由指定路徑和索引鍵值組,將物件加入物件清單。 範例: --add property.listProperty <key=value, string or JSON string>.

預設值: []
--description

作業的描述。 可能包含 HTML 格式標記。

--display-name

必須的。 作業名稱。

--force-string

使用 'set' 或 'add' 時,請保留字串常值,而不是嘗試轉換成 JSON。

預設值: False
--if-match

實體的 ETag。

--method

必須的。 有效的 HTTP 作業方法。 一般 Http 方法,例如 GET、PUT、POST,但不受限制。

--remove

從清單中移除屬性或專案。 範例: --remove property.list <indexToRemove>--remove propertyToRemove

預設值: []
--set

指定要設定的屬性路徑和值,以更新物件。 範例: --set property1.property2=<value>.

預設值: []
--url-template

識別此作業之目標資源的相對URL範本。 可能包含參數。

全域參數
--debug

提高日誌詳細程度以顯示所有調試日誌。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。

--verbose

增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。