Class: Telnyx::Resources::GlobalIPHealthChecks

Inherits:
Object
  • Object
show all
Defined in:
lib/telnyx/resources/global_ip_health_checks.rb,
sig/telnyx/resources/global_ip_health_checks.rbs

Overview

Global IPs

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ GlobalIPHealthChecks

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of GlobalIPHealthChecks.

Parameters:



105
106
107
# File 'lib/telnyx/resources/global_ip_health_checks.rb', line 105

def initialize(client:)
  @client = client
end

Instance Method Details

#create(global_ip_id: nil, health_check_params: nil, health_check_type: nil, request_options: {}) ⇒ Telnyx::Models::GlobalIPHealthCheckCreateResponse

Creates a health check for a Global IP to monitor the health of its assignments. Creation is asynchronous, so the request is accepted and the health check becomes active once provisioning completes.

Parameters:

  • global_ip_id (String)

    Global IP ID.

  • health_check_params (Hash{Symbol=>Object})

    A Global IP health check params.

  • health_check_type (String)

    The Global IP health check type.

  • request_options (Telnyx::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



24
25
26
27
28
29
30
31
32
33
# File 'lib/telnyx/resources/global_ip_health_checks.rb', line 24

def create(params = {})
  parsed, options = Telnyx::GlobalIPHealthCheckCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "global_ip_health_checks",
    body: parsed,
    model: Telnyx::Models::GlobalIPHealthCheckCreateResponse,
    options: options
  )
end

#delete(id, request_options: {}) ⇒ Telnyx::Models::GlobalIPHealthCheckDeleteResponse

Deletes the specified Global IP health check so it no longer monitors the Global IP's assignments.

Parameters:

  • id (String)

    Identifies the resource.

  • request_options (Telnyx::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



93
94
95
96
97
98
99
100
# File 'lib/telnyx/resources/global_ip_health_checks.rb', line 93

def delete(id, params = {})
  @client.request(
    method: :delete,
    path: ["global_ip_health_checks/%1$s", id],
    model: Telnyx::Models::GlobalIPHealthCheckDeleteResponse,
    options: params[:request_options]
  )
end

#list(page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::GlobalIPHealthCheck>

Returns a paginated list of the Global IP health checks configured on your account.

Parameters:

  • page_number (Integer)
  • page_size (Integer)
  • request_options (Telnyx::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/telnyx/resources/global_ip_health_checks.rb', line 68

def list(params = {})
  parsed, options = Telnyx::GlobalIPHealthCheckListParams.dump_request(params)
  query = Telnyx::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "global_ip_health_checks",
    query: query.transform_keys(page_number: "page[number]", page_size: "page[size]"),
    page: Telnyx::Internal::DefaultFlatPagination,
    model: Telnyx::GlobalIPHealthCheck,
    options: options
  )
end

#retrieve(id, request_options: {}) ⇒ Telnyx::Models::GlobalIPHealthCheckRetrieveResponse

Returns the details of a single Global IP health check, including its type and configuration.

Parameters:

  • id (String)

    Identifies the resource.

  • request_options (Telnyx::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



47
48
49
50
51
52
53
54
# File 'lib/telnyx/resources/global_ip_health_checks.rb', line 47

def retrieve(id, params = {})
  @client.request(
    method: :get,
    path: ["global_ip_health_checks/%1$s", id],
    model: Telnyx::Models::GlobalIPHealthCheckRetrieveResponse,
    options: params[:request_options]
  )
end