Hiermee haalt u de details van de API op die is opgegeven door de id in de indeling die is opgegeven voor de opslagblob met een SAS-sleutel die 5 minuten geldig is.
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}?format={format}&export=true&api-version=2021-08-01
URI-parameters
Name |
In |
Vereist |
Type |
Description |
apiId
|
path |
True
|
string
|
API-revisie-id. Moet uniek zijn in het huidige API Management service-exemplaar. Niet-huidige revisie heeft ; rev=n als een achtervoegsel waarbij n het revisienummer is.
Regex-patroon: ^[^*#&+:<>?]+$
|
resourceGroupName
|
path |
True
|
string
|
De naam van de resourcegroep.
|
serviceName
|
path |
True
|
string
|
De naam van de API Management service.
Regex-patroon: ^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$
|
subscriptionId
|
path |
True
|
string
|
Abonnementsreferenties waarmee het Microsoft Azure-abonnement uniek wordt geïdentificeerd. De abonnements-id maakt deel uit van de URI voor elke service-aanroep.
|
api-version
|
query |
True
|
string
|
Versie van de API die moet worden gebruikt met de clientaanvraag.
|
export
|
query |
True
|
ExportApi
|
Queryparameter vereist voor het exporteren van de API-details.
|
format
|
query |
True
|
ExportFormat
|
Indeling voor het exporteren van de API-details naar de opslagblob met sassleutel die 5 minuten geldig is.
|
Antwoorden
Name |
Type |
Description |
200 OK
|
ApiExportResult
|
Het antwoord bevat een stroom met een volledige set API-metagegevens en bevat een API-entiteit met een ingesloten matrix met bewerkingsentiteiten.
|
Other Status Codes
|
ErrorResponse
|
Foutreactie waarin wordt beschreven waarom de bewerking is mislukt.
|
Beveiliging
azure_auth
Azure Active Directory OAuth2-stroom.
Type:
oauth2
Stroom:
implicit
Autorisatie-URL:
https://login.microsoftonline.com/common/oauth2/authorize
Bereiken
Name |
Description |
user_impersonation
|
uw gebruikersaccount imiteren
|
Voorbeelden
ApiManagementGetApiExportInOpenApi2dot0
Voorbeeldaanvraag
GET https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/echo-api?format=swagger-link&export=true&api-version=2021-08-01
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.ExportApi;
import com.azure.resourcemanager.apimanagement.models.ExportFormat;
/** Samples for ApiExport Get. */
public final class Main {
/*
* x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiExportInOpenApi2dot0.json
*/
/**
* Sample code: ApiManagementGetApiExportInOpenApi2dot0.
*
* @param manager Entry point to ApiManagementManager.
*/
public static void apiManagementGetApiExportInOpenApi2dot0(
com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
manager
.apiExports()
.getWithResponse(
"rg1", "apimService1", "echo-api", ExportFormat.SWAGGER_LINK, ExportApi.TRUE, Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.apimanagement import ApiManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-apimanagement
# USAGE
python api_management_get_api_export_in_open_api2dot0.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ApiManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.api_export.get(
resource_group_name="rg1",
service_name="apimService1",
api_id="echo-api",
format="swagger-link",
export="true",
)
print(response)
# x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiExportInOpenApi2dot0.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armapimanagement_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiExportInOpenApi2dot0.json
func ExampleAPIExportClient_Get_apiManagementGetApiExportInOpenApi2Dot0() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewAPIExportClient().Get(ctx, "rg1", "apimService1", "echo-api", armapimanagement.ExportFormatSwagger, armapimanagement.ExportAPITrue, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.APIExportResult = armapimanagement.APIExportResult{
// ExportResultFormat: to.Ptr(armapimanagement.ExportResultFormatSwagger),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/echo-api"),
// Value: &armapimanagement.APIExportResultValue{
// Link: to.Ptr("https://apimgmtstkjpszxxxxxxx.blob.core.windows.net/api-export/Swagger Petstore Extensive.json?sv=2015-07-08&sr=b&sig=mxhLsFuOonu8EXIjyFPV%2FnDra0qTIoip7N7MuU%2BTFsA%3D&se=2019-04-10T22:41:31Z&sp=r"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ApiManagementClient } = require("@azure/arm-apimanagement");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Gets the details of the API specified by its identifier in the format specified to the Storage Blob with SAS Key valid for 5 minutes.
*
* @summary Gets the details of the API specified by its identifier in the format specified to the Storage Blob with SAS Key valid for 5 minutes.
* x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiExportInOpenApi2dot0.json
*/
async function apiManagementGetApiExportInOpenApi2Dot0() {
const subscriptionId = process.env["APIMANAGEMENT_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["APIMANAGEMENT_RESOURCE_GROUP"] || "rg1";
const serviceName = "apimService1";
const apiId = "echo-api";
const format = "swagger-link";
const exportParam = "true";
const credential = new DefaultAzureCredential();
const client = new ApiManagementClient(credential, subscriptionId);
const result = await client.apiExport.get(
resourceGroupName,
serviceName,
apiId,
format,
exportParam
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Voorbeeldrespons
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/echo-api",
"format": "swagger-link-json",
"value": {
"link": "https://apimgmtstkjpszxxxxxxx.blob.core.windows.net/api-export/Swagger Petstore Extensive.json?sv=2015-07-08&sr=b&sig=mxhLsFuOonu8EXIjyFPV%2FnDra0qTIoip7N7MuU%2BTFsA%3D&se=2019-04-10T22:41:31Z&sp=r"
}
}
ApiManagementGetApiExportInOpenApi3dot0
Voorbeeldaanvraag
GET https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/aid9676?export=true&api-version=2021-08-01
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.ExportApi;
import com.azure.resourcemanager.apimanagement.models.ExportFormat;
/** Samples for ApiExport Get. */
public final class Main {
/*
* x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiExportInOpenApi3dot0.json
*/
/**
* Sample code: ApiManagementGetApiExportInOpenApi3dot0.
*
* @param manager Entry point to ApiManagementManager.
*/
public static void apiManagementGetApiExportInOpenApi3dot0(
com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
manager
.apiExports()
.getWithResponse("rg1", "apimService1", "aid9676", ExportFormat.OPENAPI_LINK, ExportApi.TRUE, Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.apimanagement import ApiManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-apimanagement
# USAGE
python api_management_get_api_export_in_open_api3dot0.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ApiManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.api_export.get(
resource_group_name="rg1",
service_name="apimService1",
api_id="aid9676",
format="openapi-link",
export="true",
)
print(response)
# x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiExportInOpenApi3dot0.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armapimanagement_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiExportInOpenApi3dot0.json
func ExampleAPIExportClient_Get_apiManagementGetApiExportInOpenApi3Dot0() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewAPIExportClient().Get(ctx, "rg1", "apimService1", "aid9676", armapimanagement.ExportFormatOpenapi, armapimanagement.ExportAPITrue, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.APIExportResult = armapimanagement.APIExportResult{
// ExportResultFormat: to.Ptr(armapimanagement.ExportResultFormatOpenAPI),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/aid9676"),
// Value: &armapimanagement.APIExportResultValue{
// Link: to.Ptr("https: //apimgmtstkjpszxxxxxxx.blob.core.windows.net/api-export/Swagger Petstore.yaml?sv=2015-07-08&sr=b&sig=qqtR1y5iTbz5P7USBduqB5vriIU4gmiGqe0lKVV8j9k%3D&se=2019-04-10T22:40:57Z&sp=r"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ApiManagementClient } = require("@azure/arm-apimanagement");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Gets the details of the API specified by its identifier in the format specified to the Storage Blob with SAS Key valid for 5 minutes.
*
* @summary Gets the details of the API specified by its identifier in the format specified to the Storage Blob with SAS Key valid for 5 minutes.
* x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiExportInOpenApi3dot0.json
*/
async function apiManagementGetApiExportInOpenApi3Dot0() {
const subscriptionId = process.env["APIMANAGEMENT_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["APIMANAGEMENT_RESOURCE_GROUP"] || "rg1";
const serviceName = "apimService1";
const apiId = "aid9676";
const format = "openapi-link";
const exportParam = "true";
const credential = new DefaultAzureCredential();
const client = new ApiManagementClient(credential, subscriptionId);
const result = await client.apiExport.get(
resourceGroupName,
serviceName,
apiId,
format,
exportParam
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Voorbeeldrespons
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/aid9676",
"format": "openapi-link",
"value": {
"link": "https: //apimgmtstkjpszxxxxxxx.blob.core.windows.net/api-export/Swagger Petstore.yaml?storage-sas-signature"
}
}
Definities
Name |
Description |
ApiExportResult
|
RESULTAAT VAN API-export.
|
ErrorFieldContract
|
Fout Veldcontract.
|
ErrorResponse
|
Foutreactie.
|
ExportApi
|
Queryparameter vereist voor het exporteren van de API-details.
|
ExportFormat
|
Indeling voor het exporteren van de API-details naar de opslagblob met sassleutel die 5 minuten geldig is.
|
ExportResultFormat
|
Indeling waarin de API-details worden geëxporteerd naar de opslagblob met sassleutel die 5 minuten geldig is.
|
Value
|
Het object dat het schema van de geëxporteerde API-details definieert
|
ApiExportResult
RESULTAAT VAN API-export.
Name |
Type |
Description |
format
|
ExportResultFormat
|
Indeling waarin de API-details worden geëxporteerd naar de opslagblob met sassleutel die 5 minuten geldig is.
|
id
|
string
|
ResourceId van de API die is geëxporteerd.
|
value
|
Value
|
Het object dat het schema van de geëxporteerde API-details definieert
|
ErrorFieldContract
Fout Veldcontract.
Name |
Type |
Description |
code
|
string
|
Foutcode op eigenschapsniveau.
|
message
|
string
|
Door mensen leesbare weergave van fout op eigenschapsniveau.
|
target
|
string
|
Naam van eigenschap.
|
ErrorResponse
Foutreactie.
Name |
Type |
Description |
error.code
|
string
|
Door de service gedefinieerde foutcode. Deze code fungeert als een substatus voor de HTTP-foutcode die is opgegeven in het antwoord.
|
error.details
|
ErrorFieldContract[]
|
De lijst met ongeldige velden verzenden in aanvraag, in het geval van een validatiefout.
|
error.message
|
string
|
Door mensen leesbare weergave van de fout.
|
ExportApi
Queryparameter vereist voor het exporteren van de API-details.
Name |
Type |
Description |
true
|
string
|
|
Indeling voor het exporteren van de API-details naar de opslagblob met sassleutel die 5 minuten geldig is.
Name |
Type |
Description |
openapi+json-link
|
string
|
Exporteer de API-definitie in OpenAPI 3.0-specificatie als JSON-document naar Storage Blob.
|
openapi-link
|
string
|
Exporteer de API-definitie in OpenAPI 3.0-specificatie als YAML-document naar Storage Blob.
|
swagger-link
|
string
|
Exporteer de API-definitie in OpenAPI 2.0-specificatie als JSON-document naar de storage-blob.
|
wadl-link
|
string
|
Exporteer de API-definitie in het WADL-schema naar storage-blob.
|
wsdl-link
|
string
|
Exporteer de API-definitie in het WSDL-schema naar storage-blob. Dit wordt alleen ondersteund voor API's van het type soap
|
Indeling waarin de API-details worden geëxporteerd naar de opslagblob met sassleutel die 5 minuten geldig is.
Name |
Type |
Description |
openapi-link
|
string
|
Exporteer de API-definitie in OpenAPI Specification 3.0 naar Storage Blob.
|
swagger-link-json
|
string
|
De API-definitie wordt geëxporteerd in OpenAPI Specification 2.0-indeling naar de storage-blob.
|
wadl-link-json
|
string
|
Exporteer de API-definitie in het WADL-schema naar storage-blob.
|
wsdl-link+xml
|
string
|
De API-definitie wordt in het WSDL-schema geëxporteerd naar storage-blob. Dit wordt alleen ondersteund voor API's van het type soap
|
Value
Het object dat het schema van de geëxporteerde API-details definieert
Name |
Type |
Description |
link
|
string
|
Maak een koppeling naar de storage-blob met het resultaat van de exportbewerking. De Blob-URI is slechts 5 minuten geldig.
|