Class: VoiceML::DiagnosticsResource

Inherits:
Object
  • Object
show all
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

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

#healthVoiceML::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_jsonHash

Fetch the OpenAPI spec as parsed JSON.

Returns:

  • (Hash)


30
31
32
# File 'lib/voiceml/resources/diagnostics.rb', line 30

def openapi_json
  unauth_request('/openapi.json')
end