Class: VoiceML::DiagnosticsResource
- Inherits:
-
Object
- Object
- VoiceML::DiagnosticsResource
- Defined in:
- lib/voiceml/resources/diagnostics.rb
Overview
Diagnostic surfaces — ‘/health` and the OpenAPI doc endpoints.
These don’t sit under ‘/2010-04-01/Accounts/AccountSid/…`; they’re mounted at the server root and don’t require auth (the spec marks them ‘security: []`).
Instance Method Summary collapse
-
#health ⇒ VoiceML::HealthStatus
Hit ‘GET /health`.
-
#initialize(transport) ⇒ DiagnosticsResource
constructor
A new instance of DiagnosticsResource.
-
#openapi_json ⇒ Hash
Fetch the OpenAPI spec as parsed JSON.
Constructor Details
#initialize(transport) ⇒ DiagnosticsResource
Returns a new instance of DiagnosticsResource.
15 16 17 |
# File 'lib/voiceml/resources/diagnostics.rb', line 15 def initialize(transport) @transport = transport end |
Instance Method Details
#health ⇒ VoiceML::HealthStatus
Hit ‘GET /health`. 200 = all hard checks pass; 503 raises `VoiceML::ServerError` with the failure list on `error.body`.
23 24 25 |
# File 'lib/voiceml/resources/diagnostics.rb', line 23 def health HealthStatus.from_hash(unauth_request('/health')) end |
#openapi_json ⇒ Hash
Fetch the OpenAPI spec as parsed JSON.
30 31 32 |
# File 'lib/voiceml/resources/diagnostics.rb', line 30 def openapi_json unauth_request('/openapi.json') end |