Získá podrobnosti o rozhraní API určeném jeho identifikátorem ve formátu určeném pro objekt blob služby Storage s klíčem SAS s platností 5 minut.
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}?format={format}&export=true&api-version=2022-08-01
Parametry identifikátoru URI
Name |
V |
Vyžadováno |
Typ |
Description |
apiId
|
path |
True
|
string
|
Identifikátor revize rozhraní API. Musí být v aktuální instanci služby API Management jedinečná. Non-current revize má ; rev=n jako přípona, kde n je číslo revize.
Regex pattern: ^[^*#&+:<>?]+$
|
resourceGroupName
|
path |
True
|
string
|
Název skupiny prostředků. V názvu se rozlišují malá a velká písmena.
|
serviceName
|
path |
True
|
string
|
Název služby API Management.
Regex pattern: ^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$
|
subscriptionId
|
path |
True
|
string
|
ID cílového předplatného.
|
api-version
|
query |
True
|
string
|
Verze rozhraní API, která se má použít pro tuto operaci.
|
export
|
query |
True
|
ExportApi
|
Parametr dotazu vyžadovaný k exportu podrobností rozhraní API
|
format
|
query |
True
|
ExportFormat
|
Formát, ve kterém se mají exportovat podrobnosti rozhraní API do objektu blob služby Storage s klíčem Sas s platností 5 minut.
|
Odpovědi
Name |
Typ |
Description |
200 OK
|
ApiExportResult
|
Odpověď obsahuje datový proud s úplnou sadou metadat rozhraní API a zahrnuje entitu rozhraní API s vloženým polem entit operací.
|
Other Status Codes
|
ErrorResponse
|
Chybová odpověď popisující, proč operace selhala.
|
Zabezpečení
azure_auth
Tok Azure Active Directory OAuth2
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Name |
Description |
user_impersonation
|
zosobnění uživatelského účtu
|
Příklady
ApiManagementGetApiExportInOpenApi2dot0
Sample Request
GET https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/echo-api?format=swagger-link&export=true&api-version=2022-08-01
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/2022-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,
com.azure.core.util.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/2022-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/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-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/2022-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
Sample Response
{
"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
Sample Request
GET https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/aid9676?format=openapi-link&export=true&api-version=2022-08-01
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/2022-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,
com.azure.core.util.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/2022-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/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-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?storage-sas-signature"),
// },
// }
}
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/2022-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
Sample Response
{
"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"
}
}
Definice
Name |
Description |
ApiExportResult
|
Výsledek exportu rozhraní API
|
ErrorFieldContract
|
Chyba Kontrakt pole.
|
ErrorResponse
|
Odpověď na chybu.
|
ExportApi
|
Parametr dotazu vyžadovaný k exportu podrobností rozhraní API
|
ExportFormat
|
Formát, ve kterém se mají exportovat podrobnosti rozhraní API do objektu blob služby Storage s klíčem Sas s platností 5 minut.
|
ExportResultFormat
|
Formát, ve kterém se podrobnosti rozhraní API exportují do objektu blob služby Storage s klíčem SAS s platností 5 minut.
|
Value
|
Objekt definující schéma exportovaného detailu rozhraní API
|
ApiExportResult
Výsledek exportu rozhraní API
Name |
Typ |
Description |
format
|
ExportResultFormat
|
Formát, ve kterém se podrobnosti rozhraní API exportují do objektu blob služby Storage s klíčem SAS s platností 5 minut.
|
id
|
string
|
ResourceId exportovaného rozhraní API.
|
value
|
Value
|
Objekt definující schéma exportovaného detailu rozhraní API
|
ErrorFieldContract
Chyba Kontrakt pole.
Name |
Typ |
Description |
code
|
string
|
Kód chyby na úrovni vlastnosti.
|
message
|
string
|
Čitelné znázornění chyby na úrovni vlastností.
|
target
|
string
|
Název vlastnosti.
|
ErrorResponse
Odpověď na chybu.
Name |
Typ |
Description |
error.code
|
string
|
Kód chyby definované službou Tento kód slouží jako dílčí stav pro kód chyby HTTP zadaný v odpovědi.
|
error.details
|
ErrorFieldContract[]
|
Seznam neplatných polí se odešle v žádosti v případě chyby ověření.
|
error.message
|
string
|
Znázornění chyby čitelné pro člověka
|
ExportApi
Parametr dotazu vyžadovaný k exportu podrobností rozhraní API
Name |
Typ |
Description |
true
|
string
|
|
Formát, ve kterém se mají exportovat podrobnosti rozhraní API do objektu blob služby Storage s klíčem Sas s platností 5 minut.
Name |
Typ |
Description |
openapi+json-link
|
string
|
Exportujte definici rozhraní API ve specifikaci OpenAPI 3.0 jako dokument JSON do objektu blob služby Storage.
|
openapi-link
|
string
|
Exportujte definici rozhraní API ve specifikaci OpenAPI 3.0 jako dokument YAML do objektu blob služby Storage.
|
swagger-link
|
string
|
Exportujte definici rozhraní API ve specifikaci OpenAPI 2.0 jako dokument JSON do objektu blob služby Storage.
|
wadl-link
|
string
|
Exportujte definici rozhraní API ve schématu WADL do objektu blob úložiště.
|
wsdl-link
|
string
|
Exportujte definici rozhraní API ve schématu WSDL do objektu blob úložiště. To se podporuje jenom pro rozhraní API typu. soap
|
Formát, ve kterém se podrobnosti rozhraní API exportují do objektu blob služby Storage s klíčem SAS s platností 5 minut.
Name |
Typ |
Description |
openapi-link
|
string
|
Exportujte definici rozhraní API ve specifikaci OpenAPI 3.0 do objektu blob úložiště.
|
swagger-link-json
|
string
|
Definice rozhraní API se exportuje ve formátu Specifikace OpenAPI 2.0 do objektu blob služby Storage.
|
wadl-link-json
|
string
|
Exportujte definici rozhraní API ve schématu WADL do objektu blob úložiště.
|
wsdl-link+xml
|
string
|
Definice rozhraní API se exportuje ve schématu WSDL do objektu blob úložiště. To se podporuje jenom pro rozhraní API typu. soap
|
Value
Objekt definující schéma exportovaného detailu rozhraní API
Name |
Typ |
Description |
link
|
string
|
Odkaz na objekt blob služby Storage obsahující výsledek operace exportu Identifikátor URI objektu blob je platný pouze 5 minut.
|