You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/api-center/manage-apis-azure-cli.md
+15-20Lines changed: 15 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ description: Use the Azure CLI to create and update APIs, API versions, and API
4
4
author: dlepow
5
5
ms.service: api-center
6
6
ms.topic: how-to
7
-
ms.date: 01/11/2024
7
+
ms.date: 01/12/2024
8
8
ms.author: danlep
9
9
ms.custom:
10
10
# Customer intent: As an API program manager, I want to automate processes to register and update APIs in my Azure API center.
@@ -48,22 +48,6 @@ By default, the command sets the API's **Lifecycle stage** to *design*.
48
48
> 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.
49
49
50
50
51
-
<!-- `kind' parameter appears to be required but isn't documented that way in command help -->
52
-
53
-
<!-- Need to find out how metadata works and whether custom metadata covers just the custom properties or also built-in
54
-
55
-
You can set more API properties using other command parameters. For example, set [metadata properties](key-concepts.md#metadata-properties) you've defined for APIs by passing values using the `--custom-properties` parameter:
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.
@@ -75,7 +59,6 @@ az apic api version create --resource-group myResourceGroup \
75
59
--service myAPICenter --api-name petstore-api \
76
60
--version v1-0-0 --title "v1-0-0"
77
61
```
78
-
<!-- title param is supposed to be optional but command fails without it -->
79
62
80
63
### 3. Create API definition and add specification file
81
64
@@ -110,6 +93,19 @@ az apic api definition import-specification \
110
93
> [!TIP]
111
94
> You can import the specification file inline by setting the `--format` parameter to `inline` and passing the file contents using the `--value` parameter.
112
95
96
+
### Export a specification file
97
+
98
+
To export an API specification from your API center to a local file, use the [az apic api definition export-specification](/cli/azure/apic/api/definition#az_apic_api_definition_export_specification) command.
99
+
100
+
The following example exports the specification file from the *openapi* definition that you created in the previous section to a local file named *specificationFile.json*.
## Register API from a specification file - single step
114
110
115
111
You can register an API from a local specification file in a single step by using the [az apic api register](/cli/azure/apic/api#az-apic-api-register) command. With this option, a default API version and definition are created automatically for the API.
@@ -128,7 +124,6 @@ az apic api register --resource-group myResourceGroup \
128
124
129
125
After registering an API, you can update the API's properties by using the [az apic api update](/cli/azure/apic/api#az_apic_api_update), [az apic api version update](/cli/azure/apic/api/version#az_apic_api_version_update), and [az apic api definition update](/cli/azure/apic/api/definition#az_apic_api_definition_update) commands.
130
126
131
-
132
127
## Delete API resources
133
128
134
129
Use the [az apic api delete](/cli/azure/apic/api#az_apic_api_delete) command to delete an API and all of its version and definition resources. For example:
@@ -143,4 +138,4 @@ To delete individual API versions and definitions, use [az apic api version dele
143
138
144
139
## Related content
145
140
146
-
*See the [Azure CLI reference for API Center](/cli/azure/apic) for a complete command listand examples.
141
+
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).
0 commit comments