azure-mgmt-apicenter-py – skill DevOps & Hạ tầng cho agent AI
Azure API Center Management SDK cho Python. Dùng để quản lý kho API, metadata và quản trị trong toàn tổ chức.
Cài skill azure-mgmt-apicenter-py bằng một lệnh
Chọn công cụ bạn đang dùng, copy lệnh và dán vào terminal. Skill sẽ nằm trong thư mục skills của công cụ đó và sẵn sàng dùng ở phiên làm việc tiếp theo.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/azure-mgmt-apicenter-py-ef227.tgz | tar xz -C ~/.claude/skills
Gọi trong Claude Code: /azure-mgmt-apicenter-py – rồi mô tả công việc bạn muốn làm.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/azure-mgmt-apicenter-py-ef227.tgz | tar xz -C ~/.codex/skills
Gọi trong Codex: $azure-mgmt-apicenter-py – rồi mô tả công việc bạn muốn làm.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/azure-mgmt-apicenter-py-ef227.tgz | tar xz -C ~/.hermes/skills
Gọi trong Hermes Agent: /azure-mgmt-apicenter-py – rồi mô tả công việc bạn muốn làm.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/azure-mgmt-apicenter-py-ef227.tgz | tar xz -C ~/.deepcode/skills
Gọi trong DeepSeek: /azure-mgmt-apicenter-py – rồi mô tả công việc bạn muốn làm.
Nội dung SKILL.md
Nội dung SKILL.md gốc bằng tiếng Anh.
Azure API Center Management SDK for Python
Manage API inventory, metadata, and governance in Azure API Center.
Installation
pip install azure-mgmt-apicenter
pip install azure-identityEnvironment Variables
AZURE_SUBSCRIPTION_ID=your-subscription-idAuthentication
from azure.identity import DefaultAzureCredential
from azure.mgmt.apicenter import ApiCenterMgmtClient
import os
client = ApiCenterMgmtClient(
credential=DefaultAzureCredential(),
subscription_id=os.environ["AZURE_SUBSCRIPTION_ID"]
)Create API Center
from azure.mgmt.apicenter.models import Service
api_center = client.services.create_or_update(
resource_group_name="my-resource-group",
service_name="my-api-center",
resource=Service(
location="eastus",
tags={"environment": "production"}
)
)
print(f"Created API Center: {api_center.name}")List API Centers
api_centers = client.services.list_by_subscription()
for api_center in api_centers:
print(f"{api_center.name} - {api_center.location}")Register an API
from azure.mgmt.apicenter.models import Api, ApiKind, LifecycleStage
api = client.apis.create_or_update(
resource_group_name="my-resource-group",
service_name="my-api-center",
workspace_name="default",
api_name="my-api",
resource=Api(
title="My API",
description="A sample API for demonstration",
kind=ApiKind.REST,
lifecycle_stage=LifecycleStage.PRODUCTION,
terms_of_service={"url": "https://example.com/terms"},
contacts=[{"name": "API Team", "email": "[email protected]"}]
)
)
print(f"Registered API: {api.title}")Create API Version
from azure.mgmt.apicenter.models import ApiVersion, LifecycleStage
version = client.api_versions.create_or_update(
resource_group_name="my-resource-group",
service_name="my-api-center",
workspace_name="default",
api_name="my-api",
version_name="v1",
resource=ApiVersion(
title="Version 1.0",
lifecycle_stage=LifecycleStage.PRODUCTION
)
)
print(f"Created version: {version.title}")Add API Definition
from azure.mgmt.apicenter.models import ApiDefinition
definition = client.api_definitions.create_or_update(
resource_group_name="my-resource-group",
service_name="my-api-center",
workspace_name="default",
api_name="my-api",
version_name="v1",
definition_name="openapi",
resource=ApiDefinition(
title="OpenAPI Definition",
description="OpenAPI 3.0 specification"
)
)Import API Specification
from azure.mgmt.apicenter.models import ApiSpecImportRequest, ApiSpecImportSourceFormat
# Import from inline content
client.api_definitions.import_specification(
resource_group_name="my-resource-group",
service_name="my-api-center",
workspace_name="default",
api_name="my-api",
version_name="v1",
definition_name="openapi",
body=ApiSpecImportRequest(
format=ApiSpecImportSourceFormat.INLINE,
value='{"openapi": "3.0.0", "info": {"title": "My API", "version": "1.0"}, "paths": {}}'
)
)List APIs
apis = client.apis.list(
resource_group_name="my-resource-group",
service_name="my-api-center",
workspace_name="default"
)
for api in apis:
print(f"{api.name}: {api.title} ({api.kind})")Create Environment
from azure.mgmt.apicenter.models import Environment, EnvironmentKind
environment = client.environments.create_or_update(
resource_group_name="my-resource-group",
service_name="my-api-center",
workspace_name="default",
environment_name="production",
resource=Environment(
title="Production",
description="Production environment",
kind=EnvironmentKind.PRODUCTION,
server={"type": "Azure API Management", "management_portal_uri": ["https://portal.azure.com"]}
)
)Create Deployment
from azure.mgmt.apicenter.models import Deployment, DeploymentState
deployment = client.deployments.create_or_update(
resource_group_name="my-resource-group",
service_name="my-api-center",
workspace_name="default",
api_name="my-api",
deployment_name="prod-deployment",
resource=Deployment(
title="Production Deployment",
description="Deployed to production APIM",
environment_id="/workspaces/default/environments/production",
definition_id="/workspaces/default/apis/my-api/versions/v1/definitions/openapi",
state=DeploymentState.ACTIVE,
server={"runtime_uri": ["https://api.example.com"]}
)
)Define Custom Metadata
from azure.mgmt.apicenter.models import MetadataSchema
metadata = client.metadata_schemas.create_or_update(
resource_group_name="my-resource-group",
service_name="my-api-center",
metadata_schema_name="data-classification",
resource=MetadataSchema(
schema='{"type": "string", "title": "Data Classification", "enum": ["public", "internal", "confidential"]}'
)
)Client Types
| Client | Purpose |
|--------|---------|
| ApiCenterMgmtClient | Main client for all operations |
Operations
| Operation Group | Purpose |
|----------------|---------|
| services | API Center service management |
| workspaces | Workspace management |
| apis | API registration and management |
| api_versions | API version management |
| api_definitions | API definition management |
| deployments | Deployment tracking |
| environments | Environment management |
| metadata_schemas | Custom metadata definitions |
Best Practices
1. Use workspaces to organize APIs by team or domain
2. Define metadata schemas for consistent governance
3. Track deployments to understand where APIs are running
4. Import specifications to enable API analysis and linting
5. Use lifecycle stages to track API maturity
6. Add contacts for API ownership and support
When to Use
This skill is applicable to execute the workflow or actions described in the overview.
Limitations
- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
Skill liên quan
- azure-mgmt-apimanagement-dotnet – Azure Resource Manager SDK cho API Management trong .NET.
- azure-mgmt-apimanagement-py – Azure API Management SDK cho Python. Dùng để quản lý dịch vụ APIM, API, sản phẩm…
- nextflow – Xây dựng, chạy và gỡ lỗi pipeline Nextflow DSL2 và workflow nf-core. Dùng cho Nextflow…
- azure-mgmt-applicationinsights-dotnet – Azure Application Insights SDK cho .NET. Quản lý tài nguyên giám sát hiệu năng ứng dụng…
- azure-mgmt-arizeaiobservabilityeval-dotnet – SDK Azure Resource Manager cho Arize AI Observability and Evaluation (.NET).
- azure-mgmt-botservice-dotnet – SDK Azure Resource Manager cho Bot Service trong .NET. Thao tác mặt phẳng quản lý để tạo…
- azure-mgmt-botservice-py – SDK quản lý Azure Bot Service cho Python. Dùng để tạo, quản lý và cấu hình tài nguyên…
- azure-mgmt-fabric-dotnet – SDK Azure Resource Manager cho Fabric trong .NET.