pfSense-pkg-RESTAPI

ServiceUnavailableError extends Response
in package

Exception class that indicates the requested services is temporarily unavailable. This exception generally corresponds with a 503 Service Unavailable error code.

Table of Contents

Properties

$_links  : ResourceLinkSet
$code  : int
$data  : Model|ModelSet
$help_text  : string
$message  : mixed
$response_id  : string
$status  : string

Methods

__construct()  : mixed
Constructs a new Response object.
get_class_fqn()  : string
Obtains the fully qualified name of the called class.
get_class_shortname()  : string
Obtains the shortname of the called class.
get_classes_in_namespace()  : array<string|int, mixed>
Obtains all classes associated with this class's current namespace.
get_http_status_message()  : string
Fetch HTTP status message associated with a given HTTP status code.
log_error()  : void
Logs an error to the syslog.
to_openapi_component()  : array<string|int, mixed>
Represents this Response object as an OpenAPI response component. This component details which content-types are allowed by the Accept header.
to_openapi_schema()  : array<string|int, mixed>
Represents the Response object as an OpenAPI schema.
to_representation()  : array<string|int, mixed>
Converts this Response object to an array representation of its contents.

Properties

$help_text

public string $help_text = 'The requested service is temporarily unavailable.'

A help text message that can be used to describe the API response in more detail.

$response_id

public string $response_id

$status

public string $status

The HTTP status message that corresponds with the HTTP status code.

Methods

__construct()

Constructs a new Response object.

public __construct(mixed $message, string $response_id[, int $retry_after = 5 ][, Model|ModelSet $data = new ModelSet() ][, ResourceLinkSet $_links = new ResourceLinkSet() ]) : mixed
Parameters
$message : mixed

The verbose message to include in the Response.

$response_id : string

A unique response ID that can be used to identify this specific response. This should be unique from any other Response object in the codebase!

$retry_after : int = 5

The amount of time (in seconds) we expect the service to become available again.

$data : Model|ModelSet = new ModelSet()

A Model or ModelSet this Response relates to. This is typically only included for successful Responses.

$_links : ResourceLinkSet = new ResourceLinkSet()

A ResourceLinkSet containing applicable ResourceLinks for this response.

get_class_fqn()

Obtains the fully qualified name of the called class.

public get_class_fqn() : string
Return values
string

The FQN for this object's class.

get_class_shortname()

Obtains the shortname of the called class.

public get_class_shortname() : string
Return values
string

The shortname for this object's class.

get_classes_in_namespace()

Obtains all classes associated with this class's current namespace.

public get_classes_in_namespace([bool $shortnames = false ]) : array<string|int, mixed>
Parameters
$shortnames : bool = false
Return values
array<string|int, mixed>

An array of classes currently in this object's namespace

get_http_status_message()

Fetch HTTP status message associated with a given HTTP status code.

public final static get_http_status_message(int $http_status) : string
Parameters
$http_status : int

The HTTP status code to fetch the descriptive message for.

Return values
string

The HTTP status message associated with the give HTTP response code OR unknown if not found.

log_error()

Logs an error to the syslog.

public static log_error(string $message) : void
Parameters
$message : string

The error message to write to the syslog

to_openapi_component()

Represents this Response object as an OpenAPI response component. This component details which content-types are allowed by the Accept header.

public final to_openapi_component() : array<string|int, mixed>
Return values
array<string|int, mixed>

This Response object as an OpenAPI response component

to_openapi_schema()

Represents the Response object as an OpenAPI schema.

public final static to_openapi_schema() : array<string|int, mixed>
Return values
array<string|int, mixed>

This Response object as an OpenAPI schema.

to_representation()

Converts this Response object to an array representation of its contents.

public final to_representation() : array<string|int, mixed>
Return values
array<string|int, mixed>

An array containing the response details.


        
On this page

Search results