Class: Telnyx::Resources::VirtualCrossConnects

Inherits:
Object
  • Object
show all
Defined in:
lib/telnyx/resources/virtual_cross_connects.rb

Overview

Virtual Cross Connect operations

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ VirtualCrossConnects

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 VirtualCrossConnects.

Parameters:



182
183
184
# File 'lib/telnyx/resources/virtual_cross_connects.rb', line 182

def initialize(client:)
  @client = client
end

Instance Method Details

#create(region_code:, bandwidth_mbps: nil, bgp_asn: nil, cloud_provider: nil, cloud_provider_region: nil, name: nil, network_id: nil, primary_bgp_key: nil, primary_cloud_account_id: nil, primary_cloud_ip: nil, primary_telnyx_ip: nil, secondary_bgp_key: nil, secondary_cloud_account_id: nil, secondary_cloud_ip: nil, secondary_telnyx_ip: nil, request_options: {}) ⇒ Telnyx::Models::VirtualCrossConnectCreateResponse

Some parameter documentations has been truncated, see Models::VirtualCrossConnectCreateParams for more details.

Create a new Virtual Cross Connect.<br /><br />For AWS and GCE, you have the option of creating the primary connection first and the secondary connection later. You also have the option of disabling the primary and/or secondary connections at any time and later re-enabling them. With Azure, you do not have this option. Azure requires both the primary and secondary connections to be created at the same time and they can not be independantly disabled.

Parameters:

  • region_code (String)

    The region the interface should be deployed to.

  • bandwidth_mbps (Float)

    The desired throughput in Megabits per Second (Mbps) for your Virtual Cross Conn

  • bgp_asn (Float)

    The Border Gateway Protocol (BGP) Autonomous System Number (ASN). If null, value

  • cloud_provider (Symbol, Telnyx::Models::VirtualCrossConnectCreateParams::CloudProvider)

    The Virtual Private Cloud with which you would like to establish a cross connect

  • cloud_provider_region (String)

    The region where your Virtual Private Cloud hosts are located.<br /><br />The av

  • name (String)

    A user specified name for the interface.

  • network_id (String)

    The id of the network associated with the interface.

  • primary_bgp_key (String)

    The authentication key for BGP peer configuration.

  • primary_cloud_account_id (String)

    The identifier for your Virtual Private Cloud. The number will be different base

  • primary_cloud_ip (String)

    The IP address assigned for your side of the Virtual Cross Connect.<br /><br />I

  • primary_telnyx_ip (String)

    The IP address assigned to the Telnyx side of the Virtual Cross Connect.<br /><b

  • secondary_bgp_key (String)

    The authentication key for BGP peer configuration.

  • secondary_cloud_account_id (String)

    The identifier for your Virtual Private Cloud. The number will be different base

  • secondary_cloud_ip (String)

    The IP address assigned for your side of the Virtual Cross Connect.<br /><br />I

  • secondary_telnyx_ip (String)

    The IP address assigned to the Telnyx side of the Virtual Cross Connect.<br /><b

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

Returns:

See Also:



54
55
56
57
58
59
60
61
62
63
# File 'lib/telnyx/resources/virtual_cross_connects.rb', line 54

def create(params)
  parsed, options = Telnyx::VirtualCrossConnectCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "virtual_cross_connects",
    body: parsed,
    model: Telnyx::Models::VirtualCrossConnectCreateResponse,
    options: options
  )
end

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

Delete a Virtual Cross Connect.

Parameters:

  • id (String)

    Identifies the resource.

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

Returns:

See Also:



170
171
172
173
174
175
176
177
# File 'lib/telnyx/resources/virtual_cross_connects.rb', line 170

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

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

Some parameter documentations has been truncated, see Models::VirtualCrossConnectListParams for more details.

List all Virtual Cross Connects.

Parameters:

Returns:

See Also:



146
147
148
149
150
151
152
153
154
155
156
157
# File 'lib/telnyx/resources/virtual_cross_connects.rb', line 146

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

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

Retrieve a Virtual Cross Connect.

Parameters:

  • id (String)

    Identifies the resource.

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

Returns:

See Also:



76
77
78
79
80
81
82
83
# File 'lib/telnyx/resources/virtual_cross_connects.rb', line 76

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

#update(id, primary_cloud_ip: nil, primary_enabled: nil, primary_routing_announcement: nil, secondary_cloud_ip: nil, secondary_enabled: nil, secondary_routing_announcement: nil, request_options: {}) ⇒ Telnyx::Models::VirtualCrossConnectUpdateResponse

Some parameter documentations has been truncated, see Models::VirtualCrossConnectUpdateParams for more details.

Update the Virtual Cross Connect.<br /><br />Cloud IPs can only be patched during the ‘created` state, as GCE will only inform you of your generated IP once the pending connection requested has been accepted. Once the Virtual Cross Connect has moved to `provisioning`, the IPs can no longer be patched.<br /><br />Once the Virtual Cross Connect has moved to `provisioned` and you are ready to enable routing, you can toggle the routing announcements to `true`.

Parameters:

  • id (String)

    Identifies the resource.

  • primary_cloud_ip (String)

    The IP address assigned for your side of the Virtual Cross Connect.<br /><br />I

  • primary_enabled (Boolean)

    Indicates whether the primary circuit is enabled. Setting this to ‘false` will d

  • primary_routing_announcement (Boolean)

    Whether the primary BGP route is being announced.

  • secondary_cloud_ip (String)

    The IP address assigned for your side of the Virtual Cross Connect.<br /><br />I

  • secondary_enabled (Boolean)

    Indicates whether the secondary circuit is enabled. Setting this to ‘false` will

  • secondary_routing_announcement (Boolean)

    Whether the secondary BGP route is being announced.

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

Returns:

See Also:



117
118
119
120
121
122
123
124
125
126
# File 'lib/telnyx/resources/virtual_cross_connects.rb', line 117

def update(id, params = {})
  parsed, options = Telnyx::VirtualCrossConnectUpdateParams.dump_request(params)
  @client.request(
    method: :patch,
    path: ["virtual_cross_connects/%1$s", id],
    body: parsed,
    model: Telnyx::Models::VirtualCrossConnectUpdateResponse,
    options: options
  )
end