Поделиться через


Global Schema - List By Service

Перечисляет коллекцию схем, зарегистрированных в экземпляре службы.

GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/schemas?api-version=2021-08-01
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/schemas?$filter={$filter}&$top={$top}&$skip={$skip}&api-version=2021-08-01

Параметры URI

Имя В Обязательно Тип Описание
resourceGroupName
path True

string

Имя группы ресурсов.

serviceName
path True

string

Имя службы Управление API.

Шаблон регулярного выражения: ^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$

subscriptionId
path True

string

Учетные данные подписки, которые однозначно идентифицируют подписку Microsoft Azure. Идентификатор подписки формирует часть URI для каждого вызова службы.

api-version
query True

string

Версия API для использования с клиентским запросом.

$filter
query

string

| Поле | Использование | Поддерживаемые операторы | Поддерживаемые функции |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |

$skip
query

integer

int32

Количество записей, которые будут пропущены.

$top
query

integer

int32

Количество возвращаемых записей.

Ответы

Имя Тип Описание
200 OK

GlobalSchemaCollection

Перечисляет коллекцию сущностей схемы.

Other Status Codes

ErrorResponse

Ответ об ошибке, описывающий причину сбоя операции.

Безопасность

azure_auth

Поток OAuth2 в Azure Active Directory.

Тип: oauth2
Flow: implicit
URL-адрес авторизации: https://login.microsoftonline.com/common/oauth2/authorize

Области

Имя Описание
user_impersonation олицетворения учетной записи пользователя

Примеры

ApiManagementListSchemas

Образец запроса

GET https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/schemas?api-version=2021-08-01

Пример ответа

{
  "value": [
    {
      "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/schemas/schema1",
      "type": "Microsoft.ApiManagement/service/schemas",
      "name": "schema1",
      "properties": {
        "description": "sample schema description",
        "schemaType": "xml",
        "value": "<xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"\r\n           xmlns:tns=\"http://tempuri.org/PurchaseOrderSchema.xsd\"\r\n           targetNamespace=\"http://tempuri.org/PurchaseOrderSchema.xsd\"\r\n           elementFormDefault=\"qualified\">\r\n <xsd:element name=\"PurchaseOrder\" type=\"tns:PurchaseOrderType\"/>\r\n <xsd:complexType name=\"PurchaseOrderType\">\r\n  <xsd:sequence>\r\n   <xsd:element name=\"ShipTo\" type=\"tns:USAddress\" maxOccurs=\"2\"/>\r\n   <xsd:element name=\"BillTo\" type=\"tns:USAddress\"/>\r\n  </xsd:sequence>\r\n  <xsd:attribute name=\"OrderDate\" type=\"xsd:date\"/>\r\n </xsd:complexType>\r\n\r\n <xsd:complexType name=\"USAddress\">\r\n  <xsd:sequence>\r\n   <xsd:element name=\"name\"   type=\"xsd:string\"/>\r\n   <xsd:element name=\"street\" type=\"xsd:string\"/>\r\n   <xsd:element name=\"city\"   type=\"xsd:string\"/>\r\n   <xsd:element name=\"state\"  type=\"xsd:string\"/>\r\n   <xsd:element name=\"zip\"    type=\"xsd:integer\"/>\r\n  </xsd:sequence>\r\n  <xsd:attribute name=\"country\" type=\"xsd:NMTOKEN\" fixed=\"US\"/>\r\n </xsd:complexType>\r\n</xsd:schema>"
      }
    },
    {
      "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/schemas/schema2",
      "type": "Microsoft.ApiManagement/service/schemas",
      "name": "schema2",
      "properties": {
        "description": "sample schema description",
        "schemaType": "json",
        "document": {
          "$id": "https://example.com/person.schema.json",
          "$schema": "https://json-schema.org/draft/2020-12/schema",
          "title": "Person",
          "type": "object",
          "properties": {
            "firstName": {
              "type": "string",
              "description": "The person's first name."
            },
            "lastName": {
              "type": "string",
              "description": "The person's last name."
            },
            "age": {
              "description": "Age in years which must be equal to or greater than zero.",
              "type": "integer",
              "minimum": 0
            }
          }
        }
      }
    }
  ],
  "count": 2,
  "nextLink": ""
}

Определения

Имя Описание
ErrorFieldContract

Контракт поля ошибки.

ErrorResponse

Ответ об ошибке.

GlobalSchemaCollection

Ответ операции со схемой списка.

GlobalSchemaContract

Сведения о контракте глобальной схемы.

SchemaType

Тип схемы. Неизменяемый.

ErrorFieldContract

Контракт поля ошибки.

Имя Тип Описание
code

string

Код ошибки уровня свойства.

message

string

Удобочитаемое представление ошибки на уровне свойств.

target

string

Имя свойства.

ErrorResponse

Ответ об ошибке.

Имя Тип Описание
error.code

string

Код ошибки, определяемый службой. Это код служит в качестве подсостояния для кода ошибки HTTP, указанного в ответе.

error.details

ErrorFieldContract[]

Список недопустимых полей, отправляемых в запросе, в случае ошибки проверки.

error.message

string

Читаемое представление ошибки.

GlobalSchemaCollection

Ответ операции со схемой списка.

Имя Тип Описание
count

integer

Общее число записей.

nextLink

string

Ссылка на следующую страницу, если она есть.

value

GlobalSchemaContract[]

Значение контракта глобальной схемы.

GlobalSchemaContract

Сведения о контракте глобальной схемы.

Имя Тип Описание
id

string

Полный идентификатор ресурса. Например: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}

name

string

Имя ресурса.

properties.description

string

Описание сущности схемы свободной формы.

properties.schemaType

SchemaType

Тип схемы. Неизменяемый.

properties.value

Строка в кодировке JSON для схемы, отличной от JSON.

type

string

Тип ресурса. Например, Microsoft.Compute/virtualMachines или Microsoft.Storage/storageAccounts.

SchemaType

Тип схемы. Неизменяемый.

Имя Тип Описание
json

string

Тип схемы JSON.

xml

string

Тип схемы XML.