Tanımlayıcısı tarafından belirtilen API'nin ayrıntılarını, 5 dakika boyunca geçerli SAS Anahtarı ile Depolama Blobu'na belirtilen biçimde alır.
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
URI Parametreleri
Name |
İçinde |
Gerekli |
Tür |
Description |
apiId
|
path |
True
|
string
|
API düzeltme tanımlayıcısı. Geçerli API Management hizmet örneğinde benzersiz olmalıdır. Geçerli olmayan düzeltmede ; rev=n sonek olarak, burada n düzeltme numarasıdır.
Regex pattern: ^[^*#&+:<>?]+$
|
resourceGroupName
|
path |
True
|
string
|
Kaynak grubunun adı. Ad büyük/küçük harfe duyarlı değildir.
|
serviceName
|
path |
True
|
string
|
API Management hizmetinin adı.
Regex pattern: ^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$
|
subscriptionId
|
path |
True
|
string
|
Hedef aboneliğin kimliği.
|
api-version
|
query |
True
|
string
|
Bu işlem için kullanılacak API sürümü.
|
export
|
query |
True
|
ExportApi
|
API ayrıntılarını dışarı aktarmak için gereken sorgu parametresi.
|
format
|
query |
True
|
ExportFormat
|
Api Ayrıntılarının 5 dakika boyunca geçerli olan Sas Anahtarı ile Depolama Blobu'na dışarı aktarıldığı biçim.
|
Yanıtlar
Name |
Tür |
Description |
200 OK
|
ApiExportResult
|
Yanıt, tam bir API meta verileri kümesi içeren bir akış içerir ve ekli işlem varlıkları dizisine sahip API varlığını içerir.
|
Other Status Codes
|
ErrorResponse
|
İşlemin neden başarısız olduğunu açıklayan hata yanıtı.
|
Güvenlik
azure_auth
Azure Active Directory OAuth2 Flow.
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Name |
Description |
user_impersonation
|
kullanıcı hesabınızın kimliğine bürünme
|
Örnekler
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"
}
}
Tanımlar
Name |
Description |
ApiExportResult
|
API Dışarı Aktarma sonucu.
|
ErrorFieldContract
|
Hata Alanı sözleşmesi.
|
ErrorResponse
|
Hata Yanıtı.
|
ExportApi
|
API ayrıntılarını dışarı aktarmak için gereken sorgu parametresi.
|
ExportFormat
|
Api Ayrıntılarının 5 dakika boyunca geçerli olan Sas Anahtarı ile Depolama Blobu'na dışarı aktarıldığı biçim.
|
ExportResultFormat
|
API Ayrıntılarının 5 dakika süreyle geçerli olan Sas Anahtarı ile Depolama Blobu'na dışarı aktarıldığı biçim.
|
Value
|
Dışarı aktarılan API Ayrıntısı şemasını tanımlayan nesne
|
ApiExportResult
API Dışarı Aktarma sonucu.
Name |
Tür |
Description |
format
|
ExportResultFormat
|
API Ayrıntılarının 5 dakika süreyle geçerli olan Sas Anahtarı ile Depolama Blobu'na dışarı aktarıldığı biçim.
|
id
|
string
|
Dışarı aktarılan API'nin ResourceId değeri.
|
value
|
Value
|
Dışarı aktarılan API Ayrıntısı şemasını tanımlayan nesne
|
ErrorFieldContract
Hata Alanı sözleşmesi.
Name |
Tür |
Description |
code
|
string
|
Özellik düzeyi hata kodu.
|
message
|
string
|
Özellik düzeyi hatanın insan tarafından okunabilir gösterimi.
|
target
|
string
|
Özellik adı.
|
ErrorResponse
Hata Yanıtı.
Name |
Tür |
Description |
error.code
|
string
|
Hizmet tanımlı hata kodu. Bu kod, yanıtta belirtilen HTTP hata kodu için bir alt durum görevi görür.
|
error.details
|
ErrorFieldContract[]
|
Doğrulama hatası durumunda istekte gönderilen geçersiz alanların listesi.
|
error.message
|
string
|
Hatanın insan tarafından okunabilir gösterimi.
|
ExportApi
API ayrıntılarını dışarı aktarmak için gereken sorgu parametresi.
Name |
Tür |
Description |
true
|
string
|
|
Api Ayrıntılarının 5 dakika boyunca geçerli olan Sas Anahtarı ile Depolama Blobu'na dışarı aktarıldığı biçim.
Name |
Tür |
Description |
openapi+json-link
|
string
|
OpenAPI 3.0 Belirtimindeki Api Tanımını JSON belgesi olarak Depolama Blobu'na aktarın.
|
openapi-link
|
string
|
OpenAPI 3.0 Belirtimindeki Api Tanımını YAML belgesi olarak Depolama Blobu'na aktarın.
|
swagger-link
|
string
|
OpenAPI 2.0 Belirtimindeki Api Tanımını JSON belgesi olarak Depolama Blobu'na aktarın.
|
wadl-link
|
string
|
WADL Şemasındaki Api Tanımını Depolama Blobu'na aktarın.
|
wsdl-link
|
string
|
WSDL Şemasındaki Api Tanımını Depolama Blobu'na aktarın. Bu yalnızca Tür API'leri için desteklenir soap
|
API Ayrıntılarının 5 dakika süreyle geçerli olan Sas Anahtarı ile Depolama Blobu'na dışarı aktarıldığı biçim.
Name |
Tür |
Description |
openapi-link
|
string
|
OpenAPI Belirtimi 3.0'daki API Tanımını Depolama Blobu'na aktarın.
|
swagger-link-json
|
string
|
API Tanımı, OpenAPI Belirtimi 2.0 biçiminde Depolama Blobu'na aktarılır.
|
wadl-link-json
|
string
|
WADL Şemasındaki API Tanımını Depolama Blobu'na aktarın.
|
wsdl-link+xml
|
string
|
API Tanımı, WSDL Şemasında Depolama Blobu'na aktarılır. Bu yalnızca Tür API'leri için desteklenir soap
|
Value
Dışarı aktarılan API Ayrıntısı şemasını tanımlayan nesne
Name |
Tür |
Description |
link
|
string
|
Dışarı aktarma işleminin sonucunu içeren Depolama Blobu bağlantısı. Blob Uri'si yalnızca 5 dakika geçerlidir.
|