Skip to content

Commit 75536c0

Browse files
committed
update one article
1 parent 3b60f9b commit 75536c0

File tree

1 file changed

+20
-19
lines changed

1 file changed

+20
-19
lines changed

articles/api-center/manage-apis-azure-cli.md

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ title: Manage API inventory in Azure API Center - Azure CLI
33
description: Use the Azure CLI to create and update APIs, API versions, and API definitions in your Azure API center.
44
author: dlepow
55
ms.service: api-center
6+
ms.custom: devx-track-azurecli
67
ms.topic: how-to
7-
ms.date: 01/12/2024
8+
ms.date: 04/30/2024
89
ms.author: danlep
910
# Customer intent: As an API program manager, I want to automate processes to register and update APIs in my Azure API center.
1011
---
@@ -13,20 +14,20 @@ ms.author: danlep
1314

1415
This article shows how to use [`az apic api`](/cli/azure/apic/api) commands in the Azure CLI to add and configure APIs in your [API center](overview.md) inventory. Use commands in the Azure CLI to script operations to manage your API inventory and other aspects of your API center.
1516

16-
[!INCLUDE [api-center-preview-feedback](includes/api-center-preview-feedback.md)]
17+
> [!VIDEO https://www.youtube.com/embed/Dvar8Dg25s0]
1718
1819
## Prerequisites
1920

2021
* An API center in your Azure subscription. If you haven't created one already, see [Quickstart: Create your API center](set-up-api-center.md).
2122

2223
* For Azure CLI:
23-
[!INCLUDE [include](~/articles/reusable-content/azure-cli/azure-cli-prepare-your-environment-no-header.md)]
24+
[!INCLUDE [include](~/reusable-content/azure-cli/azure-cli-prepare-your-environment-no-header.md)]
2425

2526
[!INCLUDE [install-apic-extension](includes/install-apic-extension.md)]
2627

2728
## Register API, API version, and definition
2829

29-
The following steps show how to create an API and associate a single API version and API definition. For background about the data model in API Center, see [Key concepts](key-concepts.md).
30+
The following steps show how to create an API and associate a single API version and API definition. For background about the data model in Azure API Center, see [Key concepts](key-concepts.md).
3031

3132
### Create an API
3233

@@ -36,12 +37,10 @@ The following example creates an API named *Petstore API* in the *myResourceGrou
3637

3738
```azurecli-interactive
3839
az apic api create --resource-group myResourceGroup \
39-
--service myAPICenter --name petstore-api \
40-
--title "Petstore API" --kind "rest"
40+
--service myAPICenter --api-id petstore-api \
41+
--title "Petstore API" --type "rest"
4142
```
4243

43-
By default, the command sets the API's **Lifecycle stage** to *design*.
44-
4544
> [!NOTE]
4645
> After creating an API, you can update the API's properties by using the [az apic api update](/cli/azure/apic/api#az_apic_api_update) command.
4746
@@ -50,12 +49,12 @@ By default, the command sets the API's **Lifecycle stage** to *design*.
5049

5150
Use the [az apic api version create](/cli/azure/apic/api/version#az_apic_api_version_create) command to create a version for your API.
5251

53-
The following example creates an API version named *v1-0-0* for the *petstore-api* API that you created in the previous section.
52+
The following example creates an API version named *v1-0-0* for the *petstore-api* API that you created in the previous section. The version is set to the *testing* lifecycle stage.
5453

5554
```azurecli-interactive
5655
az apic api version create --resource-group myResourceGroup \
57-
--service myAPICenter --api-name petstore-api \
58-
--version v1-0-0 --title "v1-0-0"
56+
--service myAPICenter --api-id petstore-api \
57+
--version-id v1-0-0 --title "v1-0-0" --lifecycle-stage "testing"
5958
```
6059

6160
### Create API definition and add specification file
@@ -68,8 +67,8 @@ The following example uses the [az apic api definition create](/cli/azure/apic/a
6867

6968
```azurecli-interactive
7069
az apic api definition create --resource-group myResourceGroup \
71-
--service myAPICenter --api-name petstore-api \
72-
--version v1-0-0 --name "openapi" --title "OpenAPI"
70+
--service myAPICenter --api-id petstore-api \
71+
--version-id v1-0-0 --definition-id openapi --title "OpenAPI"
7372
```
7473

7574
#### Import a specification file
@@ -82,8 +81,8 @@ The following example imports an OpenAPI specification file from a publicly acce
8281
```azurecli-interactive
8382
az apic api definition import-specification \
8483
--resource-group myResourceGroup --service myAPICenter \
85-
--api-name petstore-api --version-name v1-0-0 \
86-
--definition-name openapi --format "link" \
84+
--api-id petstore-api --version-id v1-0-0 \
85+
--definition-id openapi --format "link" \
8786
--value 'https://petstore3.swagger.io/api/v3/openapi.json' \
8887
--specification '{"name":"openapi","version":"3.0.2"}'
8988
```
@@ -100,8 +99,8 @@ The following example exports the specification file from the *openapi* definiti
10099
```azurecli-interactive
101100
az apic api definition export-specification \
102101
--resource-group myResourceGroup --service myAPICenter \
103-
--api-name petstore-api --version-name v1-0-0 \
104-
--definition-name openapi --file-name "/Path/to/specificationFile.json"
102+
--api-id petstore-api --version-id v1-0-0 \
103+
--definition-id openapi --file-name "/Path/to/specificationFile.json"
105104
```
106105

107106
## Register API from a specification file - single step
@@ -129,11 +128,13 @@ Use the [az apic api delete](/cli/azure/apic/api#az_apic_api_delete) command to
129128
```azurecli-interactive
130129
az apic api delete \
131130
--resource-group myResoureGroup --service myAPICenter \
132-
--name petstore-api
131+
--api-id petstore-api
133132
```
134133

135134
To delete individual API versions and definitions, use [az apic api version delete](/cli/azure/apic/api/version#az-apic-api-version-delete) and [az apic api definition delete](/cli/azure/apic/api/definition#az-apic-api-definition-delete), respectively.
136135

137136
## Related content
138137

139-
See the [Azure CLI reference for API Center](/cli/azure/apic) for a complete command list, including commands to manage [environments](/cli/azure/apic/environment), [deployments](/cli/azure/apic/api/deployment), [metadata schemas](/cli/azure/apic/metadata-schema), and [API Center services](/cli/azure/apic/service).
138+
* See the [Azure CLI reference for Azure API Center](/cli/azure/apic) for a complete command list, including commands to manage [environments](/cli/azure/apic/environment), [deployments](/cli/azure/apic/api/deployment), [metadata schemas](/cli/azure/apic/metadata), and [services](/cli/azure/apic/service).
139+
* [Import APIs to your API center from API Management](import-api-management-apis.md)
140+
* [Use the Visual Studio extension for API Center](use-vscode-extension.md) to build and register APIs from Visual Studio Code.

0 commit comments

Comments
 (0)