ASH.ResourceLibrary.WebApi

<back to all web services

ReadinessRequest

The following routes are available for this service:
GET/health/ready
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


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ReadinessRequest:
    pass


# @Flags()
class CacheControl(IntEnum):
    NONE = 0
    PUBLIC = 1
    PRIVATE = 2
    MUST_REVALIDATE = 4
    NO_CACHE = 8
    NO_STORE = 16
    NO_TRANSFORM = 32
    PROXY_REVALIDATE = 64


class IContentTypeWriter:
    pass


class IResponse:
    original_response: Optional[Object] = None
    request: Optional[IRequest] = None
    status_code: Optional[int] = None
    status_description: Optional[str] = None
    content_type: Optional[str] = None
    dto: Optional[Object] = None
    use_buffered_stream: Optional[bool] = None
    is_closed: Optional[bool] = None
    keep_alive: Optional[bool] = None
    has_started: Optional[bool] = None
    items: Optional[Dict[str, Object]] = None


# @Flags()
class RequestAttributes(IntEnum):
    NONE = 0
    LOCALHOST = 1
    LOCAL_SUBNET = 2
    EXTERNAL = 4
    SECURE = 8
    IN_SECURE = 16
    ANY_SECURITY_MODE = 24
    HTTP_HEAD = 32
    HTTP_GET = 64
    HTTP_POST = 128
    HTTP_PUT = 256
    HTTP_DELETE = 512
    HTTP_PATCH = 1024
    HTTP_OPTIONS = 2048
    HTTP_OTHER = 4096
    ANY_HTTP_METHOD = 8160
    ONE_WAY = 8192
    REPLY = 16384
    ANY_CALL_STYLE = 24576
    SOAP11 = 32768
    SOAP12 = 65536
    XML = 131072
    JSON = 262144
    JSV = 524288
    PROTO_BUF = 1048576
    CSV = 2097152
    HTML = 4194304
    WIRE = 8388608
    MSG_PACK = 16777216
    FORMAT_OTHER = 33554432
    ANY_FORMAT = 67076096
    HTTP = 67108864
    MESSAGE_QUEUE = 134217728
    TCP = 268435456
    GRPC = 536870912
    ENDPOINT_OTHER = 1073741824
    ANY_ENDPOINT = 2080374784
    IN_PROCESS = -2147483648
    INTERNAL_NETWORK_ACCESS = -2147483645
    ANY_NETWORK_ACCESS_TYPE = -2147483641
    ANY = -1


class IRequestPreferences:
    accepts_brotli: Optional[bool] = None
    accepts_deflate: Optional[bool] = None
    accepts_gzip: Optional[bool] = None


class IRequest:
    original_request: Optional[Object] = None
    response: Optional[IResponse] = None
    operation_name: Optional[str] = None
    verb: Optional[str] = None
    request_attributes: Optional[RequestAttributes] = None
    request_preferences: Optional[IRequestPreferences] = None
    dto: Optional[Object] = None
    content_type: Optional[str] = None
    is_local: Optional[bool] = None
    user_agent: Optional[str] = None
    cookies: Optional[Dict[str, Cookie]] = None
    response_content_type: Optional[str] = None
    has_explicit_response_content_type: Optional[bool] = None
    items: Optional[Dict[str, Object]] = None
    headers: Optional[NameValueCollection] = None
    query_string: Optional[NameValueCollection] = None
    form_data: Optional[NameValueCollection] = None
    use_buffered_stream: Optional[bool] = None
    raw_url: Optional[str] = None
    absolute_uri: Optional[str] = None
    user_host_address: Optional[str] = None
    remote_ip: Optional[str] = None
    authorization: Optional[str] = None
    is_secure_connection: Optional[bool] = None
    accept_types: Optional[List[str]] = None
    path_info: Optional[str] = None
    original_path_info: Optional[str] = None
    content_length: Optional[int] = None
    files: Optional[List[IHttpFile]] = None
    url_referrer: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class HttpResult:
    response_text: Optional[str] = None
    file_info: Optional[FileInfo] = None
    content_type: Optional[str] = None
    headers: Optional[Dict[str, str]] = None
    cookies: Optional[List[Cookie]] = None
    e_tag: Optional[str] = None
    age: Optional[datetime.timedelta] = None
    max_age: Optional[datetime.timedelta] = None
    expires: Optional[datetime.datetime] = None
    last_modified: Optional[datetime.datetime] = None
    cache_control: Optional[CacheControl] = None
    result_scope: Optional[Func[IDisposable]] = None
    allows_partial_response: Optional[bool] = None
    options: Optional[Dict[str, str]] = None
    status: Optional[int] = None
    status_code: Optional[HttpStatusCode] = None
    status_description: Optional[str] = None
    response: Optional[Object] = None
    response_filter: Optional[IContentTypeWriter] = None
    request_context: Optional[IRequest] = None
    view: Optional[str] = None
    template: Optional[str] = None
    padding_length: Optional[int] = None
    is_partial_request: Optional[bool] = None


class IHttpFile:
    name: Optional[str] = None
    file_name: Optional[str] = None
    content_length: Optional[int] = None
    content_type: Optional[str] = None

Python ReadinessRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv

HTTP + CSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

GET /health/ready HTTP/1.1 
Host: resourcelibrary.api.ashcompanies.com 
Accept: text/csv
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{}