diff --git a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-04-01-preview/examples/ApiManagementGetPolicyFormat.json b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-04-01-preview/examples/ApiManagementGetPolicyFormat.json
index eef4d1a08cd6..c204f92228fb 100644
--- a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-04-01-preview/examples/ApiManagementGetPolicyFormat.json
+++ b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-04-01-preview/examples/ApiManagementGetPolicyFormat.json
@@ -15,7 +15,7 @@
"name": "policy",
"properties": {
"format": "rawxml",
- "value": "\r\n\r\n\t\r\n\t\t\r\n\t\t\t@{\n var guidBinary = new byte[16];\n Array.Copy(Guid.NewGuid().ToByteArray(), 0, guidBinary, 0, 10);\n long time = DateTime.Now.Ticks;\n byte[] bytes = new byte[6];\n unchecked\n {\n bytes[5] = (byte)(time >> 40);\n bytes[4] = (byte)(time >> 32);\n bytes[3] = (byte)(time >> 24);\n bytes[2] = (byte)(time >> 16);\n bytes[1] = (byte)(time >> 8);\n bytes[0] = (byte)(time);\n }\n Array.Copy(bytes, 0, guidBinary, 10, 6);\n return new Guid(guidBinary).ToString();\n }\n \r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\r\n\t\r\n\t\r\n"
+ "value": "\r\n\r\n\t\r\n\t\t\r\n\t\t\t@{\n var guidBinary = new byte[16];\n Array.Copy(Guid.NewGuid().ToByteArray(), 0, guidBinary, 0, 10);\n long time = DateTime.Now.Ticks;\n byte[] bytes = new byte[6];\n unchecked\n {\n bytes[5] = (byte)(time >> 40);\n bytes[4] = (byte)(time >> 32);\n bytes[3] = (byte)(time >> 24);\n bytes[2] = (byte)(time >> 16);\n bytes[1] = (byte)(time >> 8);\n bytes[0] = (byte)(time);\n }\n Array.Copy(bytes, 0, guidBinary, 10, 6);\n return new Guid(guidBinary).ToString();\n }\n \r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\r\n\t\r\n\t\r\n"
}
}
}
diff --git a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-12-01-preview/apimanagement.json b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-12-01-preview/apimanagement.json
index 1270de56ffa8..a17091dff540 100644
--- a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-12-01-preview/apimanagement.json
+++ b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-12-01-preview/apimanagement.json
@@ -542,6 +542,44 @@
},
"x-ms-parameter-location": "method"
},
+ "IdParameter": {
+ "name": "id",
+ "in": "path",
+ "required": true,
+ "type": "string",
+ "description": "A resource identifier.",
+ "minLength": 1,
+ "maxLength": 80,
+ "pattern": "(^[\\w]+$)|(^[\\w][\\w\\-]+[\\w]$)",
+ "x-ms-parameter-location": "method"
+ },
+ "PolicyFragmentContentFormat": {
+ "name": "format",
+ "in": "query",
+ "required": false,
+ "type": "string",
+ "description": "Policy fragment content format.",
+ "enum": [
+ "xml",
+ "rawxml"
+ ],
+ "x-ms-enum": {
+ "name": "PolicyFragmentContentFormat",
+ "modelAsString": true,
+ "values": [
+ {
+ "value": "xml",
+ "description": "The contents are inline and Content type is an XML document."
+ },
+ {
+ "value": "rawxml",
+ "description": "The contents are inline and Content type is a non XML encoded policy document."
+ }
+ ]
+ },
+ "default": "xml",
+ "x-ms-parameter-location": "method"
+ },
"PortalRevisionIdParameter": {
"name": "portalRevisionId",
"in": "path",
@@ -607,17 +645,6 @@
"description": "The name of the resource group.",
"x-ms-parameter-location": "method"
},
- "SchemaIdParameter": {
- "name": "schemaId",
- "in": "path",
- "required": true,
- "type": "string",
- "description": "Schema identifier within an API. Must be unique in the current API Management service instance.",
- "minLength": 1,
- "maxLength": 80,
- "pattern": "^[^*#&+:<>?]+$",
- "x-ms-parameter-location": "method"
- },
"ServiceNameParameter": {
"name": "serviceName",
"in": "path",
@@ -765,6 +792,16 @@
"minLength": 1,
"maxLength": 80,
"x-ms-parameter-location": "method"
+ },
+ "SchemaIdParameter": {
+ "name": "schemaId",
+ "in": "path",
+ "required": true,
+ "type": "string",
+ "description": "Schema id identifier. Must be unique in the current API Management service instance.",
+ "minLength": 1,
+ "maxLength": 80,
+ "x-ms-parameter-location": "method"
}
}
}
diff --git a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-12-01-preview/apimpolicyfragments.json b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-12-01-preview/apimpolicyfragments.json
new file mode 100644
index 000000000000..08505f2dd781
--- /dev/null
+++ b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-12-01-preview/apimpolicyfragments.json
@@ -0,0 +1,382 @@
+{
+ "swagger": "2.0",
+ "info": {
+ "title": "ApiManagementClient",
+ "description": "REST API for performing operations on policy fragments in an Azure API Management deployment.",
+ "version": "2021-12-01-preview"
+ },
+ "host": "management.azure.com",
+ "schemes": [
+ "https"
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "security": [
+ {
+ "azure_auth": [
+ "user_impersonation"
+ ]
+ }
+ ],
+ "securityDefinitions": {
+ "azure_auth": {
+ "type": "oauth2",
+ "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize",
+ "flow": "implicit",
+ "description": "Azure Active Directory OAuth2 Flow.",
+ "scopes": {
+ "user_impersonation": "impersonate your user account"
+ }
+ }
+ },
+ "paths": {
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policyFragments": {
+ "get": {
+ "tags": [
+ "PolicyFragment"
+ ],
+ "operationId": "PolicyFragment_ListByService",
+ "description": "Gets all policy fragments.",
+ "x-ms-examples": {
+ "ApiManagementListPolicyFragments": {
+ "$ref": "./examples/ApiManagementListPolicyFragments.json"
+ }
+ },
+ "parameters": [
+ {
+ "$ref": "./apimanagement.json#/parameters/ResourceGroupNameParameter"
+ },
+ {
+ "$ref": "./apimanagement.json#/parameters/ServiceNameParameter"
+ },
+ {
+ "$ref": "./apimanagement.json#/parameters/ApiVersionParameter"
+ },
+ {
+ "$ref": "./apimanagement.json#/parameters/SubscriptionIdParameter"
+ },
+ {
+ "name": "$filter",
+ "in": "query",
+ "required": false,
+ "type": "string",
+ "description": "| Field | Usage | Supported operators | Supported functions ||-------------|-------------|-------------|-------------|| name | filter, orderBy | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith || description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith || value | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |"
+ },
+ {
+ "name": "$orderby",
+ "in": "query",
+ "required": false,
+ "type": "string",
+ "description": "OData order by query option."
+ },
+ {
+ "$ref": "./apimanagement.json#/parameters/TopQueryParameter"
+ },
+ {
+ "$ref": "./apimanagement.json#/parameters/SkipQueryParameter"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Successfully returned an array of policy fragments.",
+ "schema": {
+ "$ref": "./definitions.json#/definitions/PolicyFragmentCollection"
+ }
+ },
+ "default": {
+ "description": "Error response describing why the operation failed.",
+ "schema": {
+ "$ref": "./apimanagement.json#/definitions/ErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policyFragments/{id}": {
+ "head": {
+ "tags": [
+ "PolicyFragment"
+ ],
+ "operationId": "PolicyFragment_GetEntityTag",
+ "description": "Gets the entity state (Etag) version of a policy fragment.",
+ "x-ms-examples": {
+ "ApiManagementHeadPolicyFragment": {
+ "$ref": "./examples/ApiManagementHeadPolicyFragment.json"
+ }
+ },
+ "parameters": [
+ {
+ "$ref": "./apimanagement.json#/parameters/ResourceGroupNameParameter"
+ },
+ {
+ "$ref": "./apimanagement.json#/parameters/ServiceNameParameter"
+ },
+ {
+ "$ref": "./apimanagement.json#/parameters/IdParameter"
+ },
+ {
+ "$ref": "./apimanagement.json#/parameters/ApiVersionParameter"
+ },
+ {
+ "$ref": "./apimanagement.json#/parameters/SubscriptionIdParameter"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The specified policy fragment exists and the current entity state version is present in the ETag header.",
+ "headers": {
+ "ETag": {
+ "description": "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests.",
+ "type": "string"
+ }
+ }
+ },
+ "default": {
+ "description": "Error response describing why the operation failed.",
+ "schema": {
+ "$ref": "./apimanagement.json#/definitions/ErrorResponse"
+ }
+ }
+ }
+ },
+ "get": {
+ "tags": [
+ "PolicyFragment"
+ ],
+ "operationId": "PolicyFragment_Get",
+ "description": "Gets a policy fragment.",
+ "x-ms-examples": {
+ "ApiManagementGetPolicyFragment": {
+ "$ref": "./examples/ApiManagementGetPolicyFragment.json"
+ },
+ "ApiManagementGetPolicyFragmentFormat": {
+ "$ref": "./examples/ApiManagementGetPolicyFragmentFormat.json"
+ }
+ },
+ "parameters": [
+ {
+ "$ref": "./apimanagement.json#/parameters/ResourceGroupNameParameter"
+ },
+ {
+ "$ref": "./apimanagement.json#/parameters/ServiceNameParameter"
+ },
+ {
+ "$ref": "./apimanagement.json#/parameters/IdParameter"
+ },
+ {
+ "$ref": "./apimanagement.json#/parameters/ApiVersionParameter"
+ },
+ {
+ "$ref": "./apimanagement.json#/parameters/SubscriptionIdParameter"
+ },
+ {
+ "$ref": "./apimanagement.json#/parameters/PolicyFragmentContentFormat"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Successfully returned a policy fragment.",
+ "schema": {
+ "$ref": "./definitions.json#/definitions/PolicyFragmentContract"
+ },
+ "headers": {
+ "ETag": {
+ "description": "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests.",
+ "type": "string"
+ }
+ }
+ },
+ "default": {
+ "description": "Error response describing why the operation failed.",
+ "schema": {
+ "$ref": "./apimanagement.json#/definitions/ErrorResponse"
+ }
+ }
+ }
+ },
+ "put": {
+ "tags": [
+ "PolicyFragment"
+ ],
+ "operationId": "PolicyFragment_CreateOrUpdate",
+ "description": "Creates or updates a policy fragment.",
+ "x-ms-examples": {
+ "ApiManagementCreatePolicy": {
+ "$ref": "./examples/ApiManagementCreatePolicyFragment.json"
+ }
+ },
+ "parameters": [
+ {
+ "$ref": "./apimanagement.json#/parameters/ResourceGroupNameParameter"
+ },
+ {
+ "$ref": "./apimanagement.json#/parameters/ServiceNameParameter"
+ },
+ {
+ "$ref": "./apimanagement.json#/parameters/IdParameter"
+ },
+ {
+ "name": "parameters",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "./definitions.json#/definitions/PolicyFragmentContract"
+ },
+ "description": "The policy fragment contents to apply."
+ },
+ {
+ "$ref": "./apimanagement.json#/parameters/IfMatchOptionalParameter"
+ },
+ {
+ "$ref": "./apimanagement.json#/parameters/ApiVersionParameter"
+ },
+ {
+ "$ref": "./apimanagement.json#/parameters/SubscriptionIdParameter"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The policy fragment was successfully updated.",
+ "schema": {
+ "$ref": "./definitions.json#/definitions/PolicyFragmentContract"
+ },
+ "headers": {
+ "ETag": {
+ "description": "Current entity state version",
+ "type": "string"
+ }
+ }
+ },
+ "201": {
+ "description": "The policy fragment was successfully created.",
+ "schema": {
+ "$ref": "./definitions.json#/definitions/PolicyFragmentContract"
+ },
+ "headers": {
+ "ETag": {
+ "description": "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests.",
+ "type": "string"
+ }
+ }
+ },
+ "202": {
+ "description": "Request to create or update the policy fragment was accepted. Location header contains the URL where the status of the long running operation can be checked."
+ },
+ "default": {
+ "description": "Error response describing why the operation failed.",
+ "schema": {
+ "$ref": "./apimanagement.json#/definitions/ErrorResponse"
+ }
+ }
+ },
+ "x-ms-long-running-operation": true,
+ "x-ms-long-running-operation-options": {
+ "final-state-via": "location"
+ }
+ },
+ "delete": {
+ "tags": [
+ "PolicyFragment"
+ ],
+ "operationId": "PolicyFragment_Delete",
+ "description": "Deletes a policy fragment.",
+ "x-ms-examples": {
+ "ApiManagementDeletePolicy": {
+ "$ref": "./examples/ApiManagementDeletePolicyFragment.json"
+ }
+ },
+ "parameters": [
+ {
+ "$ref": "./apimanagement.json#/parameters/ResourceGroupNameParameter"
+ },
+ {
+ "$ref": "./apimanagement.json#/parameters/ServiceNameParameter"
+ },
+ {
+ "$ref": "./apimanagement.json#/parameters/IdParameter"
+ },
+ {
+ "$ref": "./apimanagement.json#/parameters/IfMatchRequiredParameter"
+ },
+ {
+ "$ref": "./apimanagement.json#/parameters/ApiVersionParameter"
+ },
+ {
+ "$ref": "./apimanagement.json#/parameters/SubscriptionIdParameter"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The policy fragment was successfully removed."
+ },
+ "204": {
+ "description": "The policy fragment successfully removed by previous request or does not exist."
+ },
+ "default": {
+ "description": "Error response describing why the operation failed.",
+ "schema": {
+ "$ref": "./apimanagement.json#/definitions/ErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policyFragments/{id}/listReferences": {
+ "post": {
+ "tags": [
+ "PolicyFragment"
+ ],
+ "operationId": "PolicyFragment_ListReferences",
+ "description": "Lists policy resources that reference the policy fragment.",
+ "x-ms-examples": {
+ "ApiManagementListPolicyFragmentReferences": {
+ "$ref": "./examples/ApiManagementListPolicyFragmentReferences.json"
+ }
+ },
+ "parameters": [
+ {
+ "$ref": "./apimanagement.json#/parameters/ResourceGroupNameParameter"
+ },
+ {
+ "$ref": "./apimanagement.json#/parameters/ServiceNameParameter"
+ },
+ {
+ "$ref": "./apimanagement.json#/parameters/IdParameter"
+ },
+ {
+ "$ref": "./apimanagement.json#/parameters/ApiVersionParameter"
+ },
+ {
+ "$ref": "./apimanagement.json#/parameters/SubscriptionIdParameter"
+ },
+ {
+ "$ref": "./apimanagement.json#/parameters/TopQueryParameter"
+ },
+ {
+ "$ref": "./apimanagement.json#/parameters/SkipQueryParameter"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Successfully returned an array of references to policy resources that include the policy fragment in their definitions.",
+ "schema": {
+ "$ref": "./definitions.json#/definitions/ResourceCollection"
+ }
+ },
+ "default": {
+ "description": "Error response describing why the operation failed.",
+ "schema": {
+ "$ref": "./apimanagement.json#/definitions/ErrorResponse"
+ }
+ }
+ }
+ }
+ }
+ },
+ "definitions": {},
+ "parameters": {}
+}
diff --git a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-12-01-preview/definitions.json b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-12-01-preview/definitions.json
index c83de02306cb..8f8f57a4356e 100644
--- a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-12-01-preview/definitions.json
+++ b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-12-01-preview/definitions.json
@@ -3908,6 +3908,108 @@
},
"description": "Descriptions of APIM policies."
},
+ "PolicyFragmentCollection": {
+ "properties": {
+ "value": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/PolicyFragmentContract"
+ },
+ "description": "Policy fragment contract value."
+ },
+ "count": {
+ "type": "integer",
+ "format": "int64",
+ "description": "Total record count number."
+ },
+ "nextLink": {
+ "type": "string",
+ "description": "Next page link if any."
+ }
+ },
+ "description": "The response of the get policy fragments operation."
+ },
+ "PolicyFragmentContract": {
+ "properties": {
+ "properties": {
+ "x-ms-client-flatten": true,
+ "$ref": "#/definitions/PolicyFragmentContractProperties",
+ "description": "Properties of the Policy Fragment."
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "./../../../../../common-types/resource-management/v2/types.json#/definitions/Resource"
+ }
+ ],
+ "description": "Policy fragment contract details."
+ },
+ "PolicyFragmentContractProperties": {
+ "properties": {
+ "value": {
+ "type": "string",
+ "description": "Contents of the policy fragment."
+ },
+ "description": {
+ "type": "string",
+ "description": "Policy fragment description.",
+ "minLength": 0,
+ "maxLength": 1000
+ },
+ "format": {
+ "type": "string",
+ "description": "Format of the policy fragment content.",
+ "enum": [
+ "xml",
+ "rawxml"
+ ],
+ "x-ms-enum": {
+ "name": "PolicyFragmentContentFormat",
+ "modelAsString": true,
+ "values": [
+ {
+ "value": "xml",
+ "description": "The contents are inline and Content type is an XML document."
+ },
+ {
+ "value": "rawxml",
+ "description": "The contents are inline and Content type is a non XML encoded policy document."
+ }
+ ]
+ },
+ "default": "xml"
+ }
+ },
+ "required": [
+ "value"
+ ],
+ "description": "Policy fragment contract properties."
+ },
+ "ResourceCollection": {
+ "properties": {
+ "value": {
+ "type": "array",
+ "items": {
+ "allOf": [
+ {
+ "$ref": "./../../../../../common-types/resource-management/v2/types.json#/definitions/Resource"
+ }
+ ]
+ },
+ "description": "A collection of resources."
+ },
+ "count": {
+ "type": "integer",
+ "format": "int64",
+ "description": "Total record count number."
+ },
+ "nextLink": {
+ "type": "string",
+ "description": "Next page link if any."
+ }
+ },
+ "description": "A collection of resources."
+ },
"PortalDelegationSettings": {
"properties": {
"properties": {
diff --git a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-12-01-preview/examples/ApiManagementCreatePolicyFragment.json b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-12-01-preview/examples/ApiManagementCreatePolicyFragment.json
new file mode 100644
index 000000000000..6e9a11f9ff73
--- /dev/null
+++ b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-12-01-preview/examples/ApiManagementCreatePolicyFragment.json
@@ -0,0 +1,47 @@
+{
+ "parameters": {
+ "serviceName": "apimService1",
+ "resourceGroupName": "rg1",
+ "api-version": "2021-12-01-preview",
+ "subscriptionId": "subid",
+ "id": "policyFragment1",
+ "parameters": {
+ "properties": {
+ "format": "xml",
+ "description": "A policy fragment example",
+ "value": ""
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/policyFragments/policyFragment1",
+ "type": "Microsoft.ApiManagement/service/policyFragments",
+ "name": "policyFragment1",
+ "properties": {
+ "format": "xml",
+ "description": "A policy fragment example",
+ "value": ""
+ }
+ }
+ },
+ "201": {
+ "body": {
+ "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/policyFragments/policyFragment1",
+ "type": "Microsoft.ApiManagement/service/policyFragments",
+ "name": "policyFragment1",
+ "properties": {
+ "format": "xml",
+ "description": "A policy fragment example",
+ "value": ""
+ }
+ }
+ },
+ "202": {
+ "headers": {
+ "location": "https://management.azure.com/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/policyFragments/policyFragment1?api-version=2021-12-01-preview&asyncId=5c730e343244df1b9cb56e85&asyncCode=201"
+ }
+ }
+ }
+}
diff --git a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-12-01-preview/examples/ApiManagementDeletePolicyFragment.json b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-12-01-preview/examples/ApiManagementDeletePolicyFragment.json
new file mode 100644
index 000000000000..3e418d05b410
--- /dev/null
+++ b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-12-01-preview/examples/ApiManagementDeletePolicyFragment.json
@@ -0,0 +1,14 @@
+{
+ "parameters": {
+ "serviceName": "apimService1",
+ "resourceGroupName": "rg1",
+ "api-version": "2021-12-01-preview",
+ "subscriptionId": "subid",
+ "id": "policyFragment1",
+ "If-Match": "*"
+ },
+ "responses": {
+ "200": {},
+ "204": {}
+ }
+}
diff --git a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-12-01-preview/examples/ApiManagementGetPolicyFragment.json b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-12-01-preview/examples/ApiManagementGetPolicyFragment.json
new file mode 100644
index 000000000000..84199326ea79
--- /dev/null
+++ b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-12-01-preview/examples/ApiManagementGetPolicyFragment.json
@@ -0,0 +1,23 @@
+{
+ "parameters": {
+ "serviceName": "apimService1",
+ "resourceGroupName": "rg1",
+ "api-version": "2021-12-01-preview",
+ "subscriptionId": "subid",
+ "id": "policyFragment1"
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/policyFragments/policyFragment1",
+ "type": "Microsoft.ApiManagement/service/policyFragments",
+ "name": "policyFragment1",
+ "properties": {
+ "format": "xml",
+ "description": "A policy fragment example",
+ "value": ""
+ }
+ }
+ }
+ }
+}
diff --git a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-12-01-preview/examples/ApiManagementGetPolicyFragmentFormat.json b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-12-01-preview/examples/ApiManagementGetPolicyFragmentFormat.json
new file mode 100644
index 000000000000..1c04fba3275c
--- /dev/null
+++ b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-12-01-preview/examples/ApiManagementGetPolicyFragmentFormat.json
@@ -0,0 +1,24 @@
+{
+ "parameters": {
+ "serviceName": "apimService1",
+ "resourceGroupName": "rg1",
+ "api-version": "2021-12-01-preview",
+ "subscriptionId": "subid",
+ "id": "policyFragment1",
+ "format": "rawxml"
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/policyFragments/policyFragment1",
+ "type": "Microsoft.ApiManagement/service/policyFragments",
+ "name": "policyFragment1",
+ "properties": {
+ "format": "rawxml",
+ "description": "A policy fragment example",
+ "value": "\r\n\t\t\t@{\n var guidBinary = new byte[16];\n Array.Copy(Guid.NewGuid().ToByteArray(), 0, guidBinary, 0, 10);\n long time = DateTime.Now.Ticks;\n byte[] bytes = new byte[6];\n unchecked\n {\n bytes[5] = (byte)(time >> 40);\n bytes[4] = (byte)(time >> 32);\n bytes[3] = (byte)(time >> 24);\n bytes[2] = (byte)(time >> 16);\n bytes[1] = (byte)(time >> 8);\n bytes[0] = (byte)(time);\n }\n Array.Copy(bytes, 0, guidBinary, 10, 6);\n return new Guid(guidBinary).ToString();\n }\n \r\n\t\t"
+ }
+ }
+ }
+ }
+}
diff --git a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-12-01-preview/examples/ApiManagementHeadPolicyFragment.json b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-12-01-preview/examples/ApiManagementHeadPolicyFragment.json
new file mode 100644
index 000000000000..1898dfe953b6
--- /dev/null
+++ b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-12-01-preview/examples/ApiManagementHeadPolicyFragment.json
@@ -0,0 +1,16 @@
+{
+ "parameters": {
+ "serviceName": "apimService1",
+ "resourceGroupName": "rg1",
+ "api-version": "2021-12-01-preview",
+ "subscriptionId": "subid",
+ "id": "policyFragment1"
+ },
+ "responses": {
+ "200": {
+ "headers": {
+ "etag": "AAAAAAAAAAa="
+ }
+ }
+ }
+}
diff --git a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-12-01-preview/examples/ApiManagementListPolicyFragmentReferences.json b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-12-01-preview/examples/ApiManagementListPolicyFragmentReferences.json
new file mode 100644
index 000000000000..2a60cbcfe8a7
--- /dev/null
+++ b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-12-01-preview/examples/ApiManagementListPolicyFragmentReferences.json
@@ -0,0 +1,24 @@
+{
+ "parameters": {
+ "serviceName": "apimService1",
+ "resourceGroupName": "rg1",
+ "api-version": "2021-12-01-preview",
+ "subscriptionId": "subid",
+ "id": "policyFragment1"
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "value": [
+ {
+ "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/policies/policy",
+ "type": "Microsoft.ApiManagement/service/policies",
+ "name": "policy"
+ }
+ ],
+ "count": 1,
+ "nextLink": ""
+ }
+ }
+ }
+}
diff --git a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-12-01-preview/examples/ApiManagementListPolicyFragments.json b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-12-01-preview/examples/ApiManagementListPolicyFragments.json
new file mode 100644
index 000000000000..4f9566161dbe
--- /dev/null
+++ b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-12-01-preview/examples/ApiManagementListPolicyFragments.json
@@ -0,0 +1,28 @@
+{
+ "parameters": {
+ "serviceName": "apimService1",
+ "resourceGroupName": "rg1",
+ "api-version": "2021-12-01-preview",
+ "subscriptionId": "subid"
+ },
+ "responses": {
+ "200": {
+ "body": {
+ "value": [
+ {
+ "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/policyFragments/policyFragment1",
+ "type": "Microsoft.ApiManagement/service/policyFragments",
+ "name": "policyFragment1",
+ "properties": {
+ "format": "xml",
+ "description": "A policy fragment example",
+ "value": ""
+ }
+ }
+ ],
+ "count": 1,
+ "nextLink": ""
+ }
+ }
+ }
+}
diff --git a/specification/apimanagement/resource-manager/readme.md b/specification/apimanagement/resource-manager/readme.md
index b4f4be6c1921..47afefbd827b 100644
--- a/specification/apimanagement/resource-manager/readme.md
+++ b/specification/apimanagement/resource-manager/readme.md
@@ -69,6 +69,7 @@ input-file:
- Microsoft.ApiManagement/preview/2021-12-01-preview/apimoutbounddependency.json
- Microsoft.ApiManagement/preview/2021-12-01-preview/apimpolicies.json
- Microsoft.ApiManagement/preview/2021-12-01-preview/apimpolicydescriptions.json
+ - Microsoft.ApiManagement/preview/2021-12-01-preview/apimpolicyfragments.json
- Microsoft.ApiManagement/preview/2021-12-01-preview/apimportalrevisions.json
- Microsoft.ApiManagement/preview/2021-12-01-preview/apimportalsettings.json
- Microsoft.ApiManagement/preview/2021-12-01-preview/apimprivatelink.json
@@ -780,4 +781,7 @@ directive:
- suppress: R4009
from: apimprivatelink.json
reason: Warning raised to error while PR was being reviewed. SystemData will implement in next preview version.
+ - suppress: R4009
+ from: apimpolicyfragments.json
+ reason: Warning raised to error while PR was being reviewed. SystemData will implement in next preview version.
```