共用方式為


az apic api deployment

注意

此參考是 Azure CLI 的 apic-extension 延伸模組的一部分(2.57.0 版或更高版本)。 擴充功能會在您第一次執行 az apic api deployment 命令時自動安裝。 深入了解擴充功能。

在 API 中心管理 API 部署的命令。

命令

名稱 Description 類型 狀態
az apic api deployment create

建立新的 API 部署或更新現有的 API 部署。

副檔名 GA
az apic api deployment delete

刪除 API 部署。

副檔名 GA
az apic api deployment list

列出 API 部署的集合。

副檔名 GA
az apic api deployment show

取得 API 部署的詳細數據。

副檔名 GA
az apic api deployment update

更新現有的 API 部署。

副檔名 GA

az apic api deployment create

建立新的 API 部署或更新現有的 API 部署。

az apic api deployment create --api-id
                              --deployment-id
                              --resource-group
                              --service
                              [--custom-properties]
                              [--definition-id]
                              [--description]
                              [--environment-id]
                              [--server]
                              [--state {active, inactive}]
                              [--title]

範例

建立部署

az apic api deployment create -g api-center-test -s contoso --deployment-id production --title "Production deployment" --description "Public cloud production deployment." --api-id echo-api --environment-id "/workspaces/default/environments/production" --definition-id "/workspaces/default/apis/echo-api/versions/2023-01-01/definitions/openapi" --server '{"runtimeUri":["https://example.com"]}'

必要參數

--api-id

API 的識別碼。

--deployment-id

API 部署的識別碼。

--resource-group -g

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

--service --service-name -s

API 中心服務的名稱。

選擇性參數

--custom-properties

針對 API 目錄實體定義的自訂元數據。 支援 json-file 和 yaml-file。

--definition-id

API 中心範圍的定義資源識別碼。

--description

部署的描述。

--environment-id

API 中心範圍的環境資源標識碼。

--server

伺服器支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--state

API 部署的狀態。

接受的值: active, inactive
--title

部署標題。

全域參數
--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 apic api deployment delete

刪除 API 部署。

az apic api deployment delete [--api-id]
                              [--deployment-id]
                              [--ids]
                              [--resource-group]
                              [--service]
                              [--subscription]
                              [--yes]

範例

刪除 API 部署

az apic api deployment delete -g api-center-test -s contoso --deployment-id production --api-id echo-api

選擇性參數

--api-id

API 的識別碼。

--deployment-id

API 部署的識別碼。

--ids

一或多個資源識別碼 (以空格分隔)。 它應該是完整資源識別碼,其中包含「資源標識碼」引數的所有資訊。 您應該提供 --ids 或其他「資源識別碼」引數。

--resource-group -g

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

--service --service-name -s

API 中心服務的名稱。

--subscription

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

--yes -y

不提示確認。

預設值: False
全域參數
--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 apic api deployment list

列出 API 部署的集合。

az apic api deployment list --api-id
                            --resource-group
                            --service
                            [--filter]
                            [--max-items]
                            [--next-token]

範例

列出 API 部署

az apic api deployment list -g api-center-test -s contoso --api-id echo-api

必要參數

--api-id

API 的識別碼。

--resource-group -g

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

--service --service-name -s

API 中心服務的名稱。

選擇性參數

--filter

OData 篩選參數。

--max-items

命令輸出中要傳回的項目總數。 如果可用的專案總數超過指定的值,則會在命令的輸出中提供令牌。 若要繼續分頁,請在後續命令的自變數中 --next-token 提供令牌值。

--next-token

標記,指定要開始分頁的位置。 這是先前截斷回應中的令牌值。

全域參數
--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 apic api deployment show

取得 API 部署的詳細數據。

az apic api deployment show [--api-id]
                            [--deployment-id]
                            [--ids]
                            [--resource-group]
                            [--service]
                            [--subscription]

範例

顯示 API 部署詳細數據

az apic api deployment show -g api-center-test -s contoso --deployment-id production --api-id echo-api

選擇性參數

--api-id

API 的識別碼。

--deployment-id

API 部署的識別碼。

--ids

一或多個資源識別碼 (以空格分隔)。 它應該是完整資源識別碼,其中包含「資源標識碼」引數的所有資訊。 您應該提供 --ids 或其他「資源識別碼」引數。

--resource-group -g

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

--service --service-name -s

API 中心服務的名稱。

--subscription

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

全域參數
--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 apic api deployment update

更新現有的 API 部署。

az apic api deployment update [--add]
                              [--api-id]
                              [--custom-properties]
                              [--definition-id]
                              [--deployment-id]
                              [--description]
                              [--environment-id]
                              [--force-string {0, 1, f, false, n, no, t, true, y, yes}]
                              [--ids]
                              [--remove]
                              [--resource-group]
                              [--server]
                              [--service]
                              [--set]
                              [--state {active, inactive}]
                              [--subscription]
                              [--title]

範例

更新 API 部署

az apic api deployment update -g api-center-test -s contoso --deployment-id production --title "Production deployment" --api-id echo-api

選擇性參數

--add

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

--api-id

API 的識別碼。

--custom-properties

針對 API 目錄實體定義的自訂元數據。 支援 json-file 和 yaml-file。

--definition-id

服務範圍定義資源標識碼。

--deployment-id

API 部署的識別碼。

--description

部署的描述。

--environment-id

服務範圍的環境資源標識碼。

--force-string

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

接受的值: 0, 1, f, false, n, no, t, true, y, yes
--ids

一或多個資源識別碼 (以空格分隔)。 它應該是完整資源識別碼,其中包含「資源標識碼」引數的所有資訊。 您應該提供 --ids 或其他「資源識別碼」引數。

--remove

從清單中移除屬性或專案。 範例:--remove property.list OR --remove 屬性ToRemove。

--resource-group -g

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

--server

伺服器支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--service --service-name -s

API 中心服務的名稱。

--set

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

--state

API 部署的狀態。

接受的值: active, inactive
--subscription

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

--title

標題。

全域參數
--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 來取得完整偵錯記錄。