Content Type - Create Or Update
Erstellt oder aktualisiert den Inhaltstyp des Entwicklerportals. Inhaltstypen beschreiben die Eigenschaften, Validierungsregeln und Einschränkungen von Inhaltselementen. Bezeichner benutzerdefinierter Inhaltstypen müssen mit dem c-
Präfix beginnen. Integrierte Inhaltstypen können nicht geändert werden.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}?api-version=2022-08-01
URI-Parameter
Name | In | Erforderlich | Typ | Beschreibung |
---|---|---|---|---|
content
|
path | True |
string |
Inhaltstypbezeichner. |
resource
|
path | True |
string |
Der Name der Ressourcengruppe. Für den Namen wird die Groß-/Kleinschreibung nicht beachtet. |
service
|
path | True |
string |
Der Name des API Management-Diensts. RegEx-Muster: |
subscription
|
path | True |
string |
Hierbei handelt es sich um die ID des Zielabonnements. |
api-version
|
query | True |
string |
Hierbei handelt es sich um die für diesen Vorgang zu verwendende API-Version. |
Anforderungsheader
Name | Erforderlich | Typ | Beschreibung |
---|---|---|---|
If-Match |
string |
ETag der Entität. Beim Erstellen einer Entität nicht erforderlich, aber beim Aktualisieren einer Entität erforderlich. |
Anforderungstext
Name | Typ | Beschreibung |
---|---|---|
properties.description |
string |
Inhaltstypbeschreibung. |
properties.id |
string |
Inhaltstypbezeichner |
properties.name |
string |
Name des Inhaltstyps. Muss 1 bis 250 Zeichen lang sein. |
properties.schema |
object |
Inhaltstypschema. |
properties.version |
string |
Inhaltstypversion. |
Antworten
Name | Typ | Beschreibung |
---|---|---|
200 OK |
Der vorhandene Inhaltstyp wurde erfolgreich aktualisiert. Header ETag: string |
|
201 Created |
Der Inhaltstyp wurde erfolgreich erstellt. Header ETag: string |
|
Other Status Codes |
Fehlerantwort mit Beschreibung des Grunds für den Fehler. |
Sicherheit
azure_auth
Azure Active Directory OAuth2 Flow.
Typ:
oauth2
Ablauf:
implicit
Autorisierungs-URL:
https://login.microsoftonline.com/common/oauth2/authorize
Bereiche
Name | Beschreibung |
---|---|
user_impersonation | Identitätswechsel Ihres Benutzerkontos |
Beispiele
ApiManagementCreateContentType
Beispielanforderung
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/contentTypes/page?api-version=2022-08-01
{
"properties": {
"name": "Page",
"description": "A regular page",
"schema": {
"properties": {
"en_us": {
"type": "object",
"properties": {
"title": {
"title": "Title",
"description": "Page title. This property gets included in SEO attributes.",
"type": "string",
"indexed": true
},
"description": {
"title": "Description",
"description": "Page description. This property gets included in SEO attributes.",
"type": "string",
"indexed": true
},
"keywords": {
"title": "Keywords",
"description": "Page keywords. This property gets included in SEO attributes.",
"type": "string",
"indexed": true
},
"permalink": {
"title": "Permalink",
"description": "Page permalink, e.g. '/about'.",
"type": "string",
"indexed": true
},
"documentId": {
"title": "Document ID",
"description": "Reference to page content document.",
"type": "string"
}
},
"additionalProperties": false,
"required": [
"title",
"permalink",
"documentId"
]
}
},
"additionalProperties": false
},
"version": "1.0.0"
}
}
Beispiel für eine Antwort
{
"id": "/contentTypes/page",
"type": "Microsoft.ApiManagement/service/contentTypes",
"name": "page",
"properties": {
"name": "Page",
"description": "A regular page",
"schema": {
"properties": {
"en_us": {
"type": "object",
"properties": {
"title": {
"title": "Title",
"description": "Page title. This property gets included in SEO attributes.",
"type": "string",
"indexed": true
},
"description": {
"title": "Description",
"description": "Page description. This property gets included in SEO attributes.",
"type": "string",
"indexed": true
},
"keywords": {
"title": "Keywords",
"description": "Page keywords. This property gets included in SEO attributes.",
"type": "string",
"indexed": true
},
"permalink": {
"title": "Permalink",
"description": "Page permalink, e.g. '/about'.",
"type": "string",
"indexed": true
},
"documentId": {
"title": "Document ID",
"description": "Reference to page content document.",
"type": "string"
}
},
"additionalProperties": false,
"required": [
"title",
"permalink",
"documentId"
]
}
},
"additionalProperties": false
},
"version": "1.0.0"
}
}
{
"id": "/contentTypes/page",
"type": "Microsoft.ApiManagement/service/contentTypes",
"name": "page",
"properties": {
"name": "Page",
"description": "A regular page",
"schema": {
"properties": {
"en_us": {
"type": "object",
"properties": {
"title": {
"title": "Title",
"description": "Page title. This property gets included in SEO attributes.",
"type": "string",
"indexed": true
},
"description": {
"title": "Description",
"description": "Page description. This property gets included in SEO attributes.",
"type": "string",
"indexed": true
},
"keywords": {
"title": "Keywords",
"description": "Page keywords. This property gets included in SEO attributes.",
"type": "string",
"indexed": true
},
"permalink": {
"title": "Permalink",
"description": "Page permalink, e.g. '/about'.",
"type": "string",
"indexed": true
},
"documentId": {
"title": "Document ID",
"description": "Reference to page content document.",
"type": "string"
}
},
"additionalProperties": false,
"required": [
"title",
"permalink",
"documentId"
]
}
},
"additionalProperties": false
},
"version": "1.0.0"
}
}
Definitionen
Name | Beschreibung |
---|---|
Content |
Inhaltstypvertragsdetails. |
Error |
Fehlerfeldvertrag. |
Error |
Fehlerantwort. |
ContentTypeContract
Inhaltstypvertragsdetails.
Name | Typ | Beschreibung |
---|---|---|
id |
string |
Vollqualifizierte Ressourcen-ID für die Ressource. Beispiel: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} |
name |
string |
Der Name der Ressource |
properties.description |
string |
Inhaltstypbeschreibung. |
properties.id |
string |
Inhaltstypbezeichner |
properties.name |
string |
Name des Inhaltstyps. Muss 1 bis 250 Zeichen lang sein. |
properties.schema |
object |
Inhaltstypschema. |
properties.version |
string |
Inhaltstypversion. |
type |
string |
Der Typ der Ressource. Z. B. "Microsoft.Compute/virtualMachines" oder "Microsoft.Storage/storageAccounts" |
ErrorFieldContract
Fehlerfeldvertrag.
Name | Typ | Beschreibung |
---|---|---|
code |
string |
Fehlercode auf Eigenschaftsebene. |
message |
string |
Für Menschen lesbare Darstellung eines Fehlers auf Eigenschaftsebene. |
target |
string |
Der Eigenschaftsname. |
ErrorResponse
Fehlerantwort.
Name | Typ | Beschreibung |
---|---|---|
error.code |
string |
Der vom Dienst definierte Fehlercode. Dieser Code dient als Unterstatus für den in der Antwort angegebenen HTTP-Fehlercode. |
error.details |
Die Liste der ungültigen Felder, die im Falle eines Überprüfungsfehlers gesendet werden. |
|
error.message |
string |
Lesbare Darstellung des Fehlers. |