Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added version 2024-06-01-preview for Azure API Center resource manager API #31211

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open
47 changes: 47 additions & 0 deletions specification/apicenter/ApiCenter.Management/ApiSource.tsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-azure-resource-manager";
import "@typespec/rest";
import "./models.tsp";
import "./Workspace.tsp";

using TypeSpec.Rest;
using TypeSpec.Versioning;
using Azure.ResourceManager;
using TypeSpec.Http;

namespace Microsoft.ApiCenter;

@added(Versions.v2024_06_01_preview)
@doc("API source entity.")
@parentResource(Workspace)
model ApiSource is ProxyResource<ApiSourceProperties> {
@doc("The name of the API.")
@maxLength(90)
@minLength(1)
@pattern("^[a-zA-Z0-9-]{3,90}$")
@path
@key("apiSourceName")
@segment("apiSources")
name: string;
}

@added(Versions.v2024_06_01_preview)
@armResourceOperations
interface ApiSources {
@doc("Returns details of the API source.")
get is ArmResourceRead<ApiSource>;
@doc("Checks if specified API source exists.")
@head
head(
...ResourceInstanceParameters<
ApiSource,
Foundations.BaseParameters<ApiSource>
>,
): OkResponse | ErrorResponse;
@doc("Creates new or updates existing API source.")
createOrUpdate is ArmResourceCreateOrReplaceSync<ApiSource>;
@doc("Deletes specified API source.")
delete is ArmResourceDeleteSync<ApiSource>;
@doc("Returns a collection of API sources.")
list is ArmResourceListByParent<ApiSource>;
}
9 changes: 9 additions & 0 deletions specification/apicenter/ApiCenter.Management/Service.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import "./models.tsp";
using TypeSpec.Rest;
using Azure.ResourceManager;
using TypeSpec.Http;
using TypeSpec.Versioning;

namespace Microsoft.ApiCenter;
@doc("The service entity.")
Expand Down Expand Up @@ -48,4 +49,12 @@ interface Services {
MetadataSchemaExportRequest,
MetadataSchemaExportResult
>;

@doc("Imports APIs from Azure API Management.")
@added(Versions.v2024_06_01_preview)
importFromApim is ArmResourceActionAsync<
Service,
ImportFromApimRequest,
ImportFromApimSuccessResult
>;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"operationId": "ApiDefinitions_CreateOrUpdate",
"title": "ApiDefinitions_CreateOrUpdate",
"parameters": {
"resourceGroupName": "contoso-resources",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"serviceName": "contoso",
"workspaceName": "default",
"apiName": "openapi",
"versionName": "2023-01-01",
"definitionName": "openapi",
"api-version": "2024-06-01-preview",
"payload": {
"properties": {
"title": "OpenAPI",
"description": "Default spec"
}
}
},
"responses": {
"200": {
"body": {
"type": "Microsoft.ApiCenter/services/apis/versions/definitions",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/apis/echo-api/versions/2023-01-01/definitions/openapi",
"name": "openapi",
"systemData": {
"createdAt": "2023-07-03T18:27:09.128871Z",
"lastModifiedAt": "2023-07-03T18:27:09.1288716Z"
},
"properties": {
"title": "OpenAPI",
"description": "Default spec",
"specification": {
"name": "openapi",
"version": "3.0.6"
}
}
}
},
"201": {
"body": {
"type": "Microsoft.ApiCenter/services/apis/versions/definitions",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/apis/echo-api/versions/2023-01-01/definitions/openapi",
"name": "openapi",
"systemData": {
"createdAt": "2023-07-03T18:27:09.128871Z",
"lastModifiedAt": "2023-07-03T18:27:09.1288716Z"
},
"properties": {
"title": "OpenAPI",
"description": "Default spec",
"specification": {
"name": "openapi",
"version": "3.0.6"
}
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"operationId": "ApiDefinitions_Delete",
"title": "ApiDefinitions_Delete",
"parameters": {
"resourceGroupName": "contoso-resources",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"serviceName": "contoso",
"workspaceName": "default",
"apiName": "echo-api",
"versionName": "2023-01-01",
"definitionName": "openapi",
"api-version": "2024-06-01-preview"
},
"responses": {
"200": {},
"204": {}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"operationId": "ApiDefinitions_ExportSpecification",
"title": "ApiDefinitions_ExportSpecification",
"parameters": {
"resourceGroupName": "contoso-resources",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"serviceName": "contoso",
"workspaceName": "default",
"apiName": "echo-api",
"versionName": "2023-01-01",
"definitionName": "openapi",
"api-version": "2024-06-01-preview"
},
"responses": {
"200": {
"body": {
"format": "inline",
"value": "{ ... }"
}
},
"202": {
"headers": {
"location": "https://..."
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"operationId": "ApiDefinitions_Get",
"title": "ApiDefinitions_Get",
"parameters": {
"resourceGroupName": "contoso-resources",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"serviceName": "contoso",
"workspaceName": "default",
"apiName": "echo-api",
"versionName": "2023-01-01",
"definitionName": "openapi",
"api-version": "2024-06-01-preview"
},
"responses": {
"200": {
"body": {
"type": "Microsoft.ApiCenter/services/apis/versions/definitions",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/apis/echo-api/versions/2023-01-01/definitions/openapi",
"name": "openapi",
"systemData": {
"createdAt": "2023-07-03T18:27:09.128871Z",
"lastModifiedAt": "2023-07-03T18:27:09.1288716Z"
},
"properties": {
"title": "OpenAPI",
"description": "Default spec",
"specification": {
"name": "openapi",
"version": "3.0.6"
}
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"operationId": "ApiDefinitions_Head",
"title": "ApiDefinitions_Head",
"parameters": {
"resourceGroupName": "contoso-resources",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"serviceName": "contoso",
"workspaceName": "default",
"apiName": "echo-api",
"versionName": "2023-01-01",
"definitionName": "openapi",
"api-version": "2024-06-01-preview"
},
"responses": {
"200": {
"headers": {
"Etag": "AAAAAAAACCI="
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"operationId": "ApiDefinitions_ImportSpecification",
"title": "ApiDefinitions_ImportSpecification",
"parameters": {
"resourceGroupName": "contoso-resources",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"serviceName": "contoso",
"workspaceName": "default",
"apiName": "echo-api",
"versionName": "2023-01-01",
"definitionName": "openapi",
"api-version": "2024-06-01-preview",
"payload": {
"format": "link",
"value": "https://...",
"specification": {
"name": "openapi",
"version": "3.0.1"
}
}
},
"responses": {
"200": {},
"202": {
"headers": {
"location": "https://..."
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"operationId": "ApiDefinitions_List",
"title": "ApiDefinitions_ListByApiVersion",
"parameters": {
"resourceGroupName": "contoso-resources",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"serviceName": "contoso",
"workspaceName": "default",
"apiName": "echo-api",
"versionName": "2023-01-01",
"api-version": "2024-06-01-preview"
},
"responses": {
"200": {
"body": {
"value": [
{
"type": "Microsoft.ApiCenter/services/apis/versions/definitions",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/apis/echo-api/versions/2023-01-01/definitions/openapi",
"name": "openapi",
"systemData": {
"createdAt": "2023-07-03T18:27:09.128871Z",
"lastModifiedAt": "2023-07-03T18:27:09.1288716Z"
},
"properties": {
"title": "OpenAPI",
"description": "Default spec",
"specification": {
"name": "openapi",
"version": "3.0.6"
}
}
}
]
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"operationId": "ApiSources_CreateOrUpdate",
"title": "ApiSources_CreateOrUpdate",
"parameters": {
"resourceGroupName": "contoso-resources",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"serviceName": "contoso",
"workspaceName": "default",
"apiSourceName": "contoso-api-management",
"api-version": "2024-06-01-preview",
"resource": {
"properties": {
"apimSource": {
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiManagement/service/contoso",
"msiResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-identity"
},
"shouldImportSpec": "ondemand"
}
}
},
"responses": {
"200": {
"body": {
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/apiSources/contoso-api-management",
"type": "Microsoft.ApiCenter/services/workspaces/apiSources",
"name": "contoso-api-management",
"systemData": {
"createdAt": "2023-07-03T18:27:09.128871Z",
"lastModifiedAt": "2023-07-03T18:27:09.1288716Z"
},
"properties": {
"apimSource": {
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiManagement/service/contoso",
"msiResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-identity"
},
"shouldImportSpec": "ondemand"
}
}
},
"201": {
"body": {
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/apiSources/contoso-api-management",
"type": "Microsoft.ApiCenter/services/workspaces/apiSources",
"name": "contoso-api-management",
"systemData": {
"createdAt": "2023-07-03T18:27:09.128871Z",
"lastModifiedAt": "2023-07-03T18:27:09.1288716Z"
},
"properties": {
"apimSource": {
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiManagement/service/contoso",
"msiResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-identity"
},
"shouldImportSpec": "ondemand"
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"operationId": "ApiSources_Delete",
"title": "ApiSources_Delete",
"parameters": {
"resourceGroupName": "contoso-resources",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"serviceName": "contoso",
"workspaceName": "default",
"apiSourceName": "contoso-api-management",
"api-version": "2024-06-01-preview"
},
"responses": {
"200": {},
"204": {}
}
}
Loading