Pobiera szczegóły interfejsu API określonego przez jego identyfikator w formacie określonym dla obiektu blob usługi Storage z kluczem sygnatury dostępu współdzielonego ważny przez 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 identyfikatora URI
Nazwa |
W |
Wymagane |
Typ |
Opis |
apiId
|
path |
True
|
string
|
Identyfikator poprawki interfejsu API. Musi być unikatowa w bieżącym wystąpieniu usługi API Management. Nieobsługiwana poprawka ma wartość ; rev=n jako sufiks, gdzie n jest numerem poprawki.
Regex pattern: ^[^*#&+:<>?]+$
|
resourceGroupName
|
path |
True
|
string
|
Nazwa grupy zasobów. W nazwie jest uwzględniana wielkość liter.
|
serviceName
|
path |
True
|
string
|
Nazwa usługi API Management.
Regex pattern: ^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$
|
subscriptionId
|
path |
True
|
string
|
Identyfikator subskrypcji docelowej.
|
api-version
|
query |
True
|
string
|
Wersja interfejsu API do użycia dla tej operacji.
|
export
|
query |
True
|
ExportApi
|
Parametr zapytania wymagany do wyeksportowania szczegółów interfejsu API.
|
format
|
query |
True
|
ExportFormat
|
Format, w którym mają być eksportowane szczegóły interfejsu API do obiektu blob usługi Storage przy użyciu klucza sygnatury dostępu współdzielonego ważnego przez 5 minut.
|
Odpowiedzi
Nazwa |
Typ |
Opis |
200 OK
|
ApiExportResult
|
Odpowiedź zawiera strumień z pełnym zestawem metadanych interfejsu API i zawiera jednostkę interfejsu API z osadzoną tablicą jednostek operacji.
|
Other Status Codes
|
ErrorResponse
|
Odpowiedź na błąd opisująca, dlaczego operacja nie powiodła się.
|
Zabezpieczenia
azure_auth
Przepływ OAuth2 usługi Azure Active Directory.
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Nazwa |
Opis |
user_impersonation
|
personifikacja konta użytkownika
|
Przykłady
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"
}
}
Definicje
Nazwa |
Opis |
ApiExportResult
|
Wynik eksportu interfejsu API.
|
ErrorFieldContract
|
Błąd Kontrakt pola.
|
ErrorResponse
|
Odpowiedź na błąd.
|
ExportApi
|
Parametr zapytania wymagany do wyeksportowania szczegółów interfejsu API.
|
ExportFormat
|
Format, w którym mają być eksportowane szczegóły interfejsu API do obiektu blob usługi Storage przy użyciu klucza sygnatury dostępu współdzielonego ważnego przez 5 minut.
|
ExportResultFormat
|
Format, w którym szczegóły interfejsu API są eksportowane do obiektu blob usługi Storage z kluczem sygnatury dostępu współdzielonego, ważny przez 5 minut.
|
Value
|
Obiekt definiujący schemat wyeksportowanego szczegółu interfejsu API
|
ApiExportResult
Wynik eksportu interfejsu API.
Nazwa |
Typ |
Opis |
format
|
ExportResultFormat
|
Format, w którym szczegóły interfejsu API są eksportowane do obiektu blob usługi Storage z kluczem sygnatury dostępu współdzielonego, ważny przez 5 minut.
|
id
|
string
|
ResourceId wyeksportowanego interfejsu API.
|
value
|
Value
|
Obiekt definiujący schemat wyeksportowanego szczegółu interfejsu API
|
ErrorFieldContract
Błąd Kontrakt pola.
Nazwa |
Typ |
Opis |
code
|
string
|
Kod błędu poziomu właściwości.
|
message
|
string
|
Czytelna dla człowieka reprezentacja błędu na poziomie właściwości.
|
target
|
string
|
Nazwa właściwości.
|
ErrorResponse
Odpowiedź na błąd.
Nazwa |
Typ |
Opis |
error.code
|
string
|
Kod błędu zdefiniowany przez usługę. Ten kod służy jako podstan kodu błędu HTTP określonego w odpowiedzi.
|
error.details
|
ErrorFieldContract[]
|
Lista nieprawidłowych pól jest wysyłana w żądaniu w przypadku błędu walidacji.
|
error.message
|
string
|
Czytelna dla człowieka reprezentacja błędu.
|
ExportApi
Parametr zapytania wymagany do wyeksportowania szczegółów interfejsu API.
Nazwa |
Typ |
Opis |
true
|
string
|
|
Format, w którym mają być eksportowane szczegóły interfejsu API do obiektu blob usługi Storage przy użyciu klucza sygnatury dostępu współdzielonego ważnego przez 5 minut.
Nazwa |
Typ |
Opis |
openapi+json-link
|
string
|
Wyeksportuj definicję interfejsu API w specyfikacji OpenAPI 3.0 jako dokument JSON do obiektu blob usługi Storage.
|
openapi-link
|
string
|
Wyeksportuj definicję interfejsu API w specyfikacji OpenAPI 3.0 jako dokument YAML do obiektu blob usługi Storage.
|
swagger-link
|
string
|
Wyeksportuj definicję interfejsu API w specyfikacji OpenAPI 2.0 jako dokument JSON do obiektu blob usługi Storage.
|
wadl-link
|
string
|
Wyeksportuj definicję interfejsu API w schemacie WADL do obiektu blob magazynu.
|
wsdl-link
|
string
|
Wyeksportuj definicję interfejsu API w schemacie WSDL do obiektu blob magazynu. Jest to obsługiwane tylko w przypadku interfejsów API typu soap
|
Format, w którym szczegóły interfejsu API są eksportowane do obiektu blob usługi Storage z kluczem sygnatury dostępu współdzielonego, ważny przez 5 minut.
Nazwa |
Typ |
Opis |
openapi-link
|
string
|
Wyeksportuj definicję interfejsu API w specyfikacji OpenAPI Specification 3.0 do obiektu blob usługi Storage.
|
swagger-link-json
|
string
|
Definicja interfejsu API jest eksportowana w formacie OpenAPI Specification 2.0 do obiektu blob usługi Storage.
|
wadl-link-json
|
string
|
Wyeksportuj definicję interfejsu API w schemacie WADL do obiektu blob magazynu.
|
wsdl-link+xml
|
string
|
Definicja interfejsu API jest eksportowana w schemacie WSDL do obiektu blob magazynu. Jest to obsługiwane tylko w przypadku interfejsów API typu soap
|
Value
Obiekt definiujący schemat wyeksportowanego szczegółu interfejsu API
Nazwa |
Typ |
Opis |
link
|
string
|
Łącze do obiektu blob usługi Storage zawierającego wynik operacji eksportowania. Identyfikator URI obiektu blob jest ważny tylko przez 5 minut.
|