| GET | /devops/api/caches/{location}/stats |
|---|
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum
# @Flags()
class CacheResult(IntEnum):
NONE = 0
MISS = 1
HIT = 2
PUT = 4
DELETED = 8
CLEARED = 16
ADDED = 32
UPDATED = 64
UNAVAILABLE = 128
EXPIRED = 256
class CacheLocation(IntEnum):
NONE = 0
OUT_OF_PROCESS = 1
IN_PROCESS = 2
IN_CONTEXT = 3
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CacheKey:
region: Optional[str] = None
base_key: Optional[str] = None
key: Optional[str] = None
expiration_seconds: Optional[int] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CacheResultBase:
result: Optional[CacheResult] = None
location: Optional[CacheLocation] = None
key: Optional[CacheKey] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CacheStat:
name: Optional[str] = None
value: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CacheStatResult(CacheResultBase):
statistics: Optional[List[CacheStat]] = None
is_hit: Optional[bool] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CacheStatsRs:
statistics: Optional[CacheStatResult] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CacheStatsRq:
location: Optional[str] = None
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /devops/api/caches/{location}/stats HTTP/1.1
Host: devapi.billhighway.com
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<CacheStatsRs xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BH.CloudAPI.DTO.Caching.Api.Response">
<Statistics xmlns:d2p1="http://schemas.datacontract.org/2004/07/BH.Caching">
<d2p1:Key i:nil="true" />
<d2p1:Location>None</d2p1:Location>
<d2p1:Result>None</d2p1:Result>
<d2p1:Statistics>
<d2p1:CacheStat>
<d2p1:_x003C_Name_x003E_k__BackingField>String</d2p1:_x003C_Name_x003E_k__BackingField>
<d2p1:_x003C_Value_x003E_k__BackingField>String</d2p1:_x003C_Value_x003E_k__BackingField>
</d2p1:CacheStat>
</d2p1:Statistics>
</Statistics>
</CacheStatsRs>