Cache - Create Or Update

Api Management örneğinde kullanılacak bir Dış Önbellek oluşturur veya güncelleştirir.

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/caches/{cacheId}?api-version=2022-08-01

URI Parametreleri

Name İçinde Gerekli Tür Description
cacheId
path True

string

Cache varlığının tanımlayıcısı. Önbellek tanımlayıcısı ('varsayılan' veya geçerli Azure bölgesi tanımlayıcısı olmalıdır).

Regex pattern: ^[^*#&+:<>?]+$

resourceGroupName
path True

string

Kaynak grubunun adı. Ad büyük/küçük harfe duyarlı değildir.

serviceName
path True

string

API Management hizmetinin adı.

Regex pattern: ^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$

subscriptionId
path True

string

Hedef aboneliğin kimliği.

api-version
query True

string

Bu işlem için kullanılacak API sürümü.

İstek Başlığı

Name Gerekli Tür Description
If-Match

string

Varlığın ETag'i. Varlık oluştururken gerekli değildir, ancak varlığı güncelleştirirken gereklidir.

İstek Gövdesi

Name Gerekli Tür Description
properties.connectionString True

string

Önbelleğe bağlantı dizesi çalışma zamanı

properties.useFromLocation True

string

Önbelleğin kullanılacağı konum tanımlayıcısı ('varsayılan' veya geçerli Azure bölge tanımlayıcısı olmalıdır)

properties.description

string

Önbellek açıklaması

properties.resourceId

string

Dış sistem önbelleğindeki varlığın özgün uri'sini işaret eder

Yanıtlar

Name Tür Description
200 OK

CacheContract

Önbellek ayrıntıları başarıyla güncelleştirildi.

Headers

ETag: string

201 Created

CacheContract

Yeni Önbellek başarıyla eklendi.

Headers

ETag: string

Other Status Codes

ErrorResponse

İşlemin neden başarısız olduğunu açıklayan hata yanıtı.

Güvenlik

azure_auth

Azure Active Directory OAuth2 Flow.

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation kullanıcı hesabınızın kimliğine bürünme

Örnekler

ApiManagementCreateCache

Sample Request

PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/caches/c1?api-version=2022-08-01

{
  "properties": {
    "connectionString": "apim.redis.cache.windows.net:6380,password=xc,ssl=True,abortConnect=False",
    "description": "Redis cache instances in West India",
    "useFromLocation": "default",
    "resourceId": "https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/redis/apimservice1"
  }
}

Sample Response

{
  "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/caches/c1",
  "type": "Microsoft.ApiManagement/service/caches",
  "name": "c1",
  "properties": {
    "useFromLocation": "default",
    "description": "Redis cache instances in West India",
    "connectionString": "{{5f7fbca77a891a2200f3db38}}",
    "resourceId": "https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/redis/apimservice1"
  }
}
{
  "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/caches/c1",
  "type": "Microsoft.ApiManagement/service/caches",
  "name": "c1",
  "properties": {
    "useFromLocation": "default",
    "description": "Redis cache instances in West India",
    "connectionString": "{{5f7fbca77a891a2200f3db38}}",
    "resourceId": "https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/redis/apimservice1"
  }
}

Tanımlar

Name Description
CacheContract

Önbellek ayrıntıları.

ErrorFieldContract

Hata Alanı sözleşmesi.

ErrorResponse

Hata Yanıtı.

CacheContract

Önbellek ayrıntıları.

Name Tür Description
id

string

Kaynağın tam kaynak kimliği. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}

name

string

Kaynağın adı

properties.connectionString

string

Önbelleğe bağlantı dizesi çalışma zamanı

properties.description

string

Önbellek açıklaması

properties.resourceId

string

Dış sistem önbelleğindeki varlığın özgün uri'sini işaret eder

properties.useFromLocation

string

Önbelleğin kullanılacağı konum tanımlayıcısı ('varsayılan' veya geçerli Azure bölge tanımlayıcısı olmalıdır)

type

string

Kaynağın türü. Örneğin, "Microsoft.Compute/virtualMachines" veya "Microsoft.Storage/storageAccounts"

ErrorFieldContract

Hata Alanı sözleşmesi.

Name Tür Description
code

string

Özellik düzeyi hata kodu.

message

string

Özellik düzeyi hatanın insan tarafından okunabilir gösterimi.

target

string

Özellik adı.

ErrorResponse

Hata Yanıtı.

Name Tür Description
error.code

string

Hizmet tanımlı hata kodu. Bu kod, yanıtta belirtilen HTTP hata kodu için bir alt durum görevi görür.

error.details

ErrorFieldContract[]

Doğrulama hatası durumunda istekte gönderilen geçersiz alanların listesi.

error.message

string

Hatanın insan tarafından okunabilir gösterimi.