Class: Anthropic::Resources::Beta::Tunnels
- Inherits:
-
Object
- Object
- Anthropic::Resources::Beta::Tunnels
- Defined in:
- lib/anthropic/resources/beta/tunnels.rb,
lib/anthropic/resources/beta/tunnels/certificates.rb,
sig/anthropic/resources/beta/tunnels.rbs,
sig/anthropic/resources/beta/tunnels/certificates.rbs
Defined Under Namespace
Classes: Certificates
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#archive(tunnel_id, betas: nil, workspace_id: nil, request_options: {}) ⇒ Anthropic::Models::Beta::BetaTunnel
The Tunnels API is in research preview.
-
#create(display_name: nil, betas: nil, workspace_id: nil, request_options: {}) ⇒ Anthropic::Models::Beta::BetaTunnel
The Tunnels API is in research preview.
-
#initialize(client:) ⇒ Tunnels
constructor
private
A new instance of Tunnels.
-
#list(include_archived: nil, limit: nil, page: nil, betas: nil, workspace_id: nil, request_options: {}) ⇒ Anthropic::Internal::PageCursor<Anthropic::Models::Beta::BetaTunnel>
The Tunnels API is in research preview.
-
#retrieve(tunnel_id, betas: nil, workspace_id: nil, request_options: {}) ⇒ Anthropic::Models::Beta::BetaTunnel
The Tunnels API is in research preview.
-
#reveal_token(tunnel_id, betas: nil, workspace_id: nil, request_options: {}) ⇒ Anthropic::Models::Beta::BetaTunnelToken
The Tunnels API is in research preview.
-
#rotate_token(tunnel_id, reason: nil, betas: nil, workspace_id: nil, request_options: {}) ⇒ Anthropic::Models::Beta::BetaTunnelToken
The Tunnels API is in research preview.
Constructor Details
#initialize(client:) ⇒ Tunnels
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 Tunnels.
245 246 247 248 |
# File 'lib/anthropic/resources/beta/tunnels.rb', line 245 def initialize(client:) @client = client @certificates = Anthropic::Resources::Beta::Tunnels::Certificates.new(client: client) end |
Instance Attribute Details
#certificates ⇒ Anthropic::Resources::Beta::Tunnels::Certificates (readonly)
8 9 10 |
# File 'lib/anthropic/resources/beta/tunnels.rb', line 8 def certificates @certificates end |
Instance Method Details
#archive(tunnel_id, betas: nil, workspace_id: nil, request_options: {}) ⇒ Anthropic::Models::Beta::BetaTunnel
The Tunnels API is in research preview. It requires the
anthropic-beta: mcp-tunnels-2026-06-22 header and may change without a
deprecation period. It supersedes the Admin API endpoints at
/v1/organizations/tunnels, which remain available during a migration window.
Archives a tunnel. Archival is irreversible: every non-archived certificate on the tunnel is archived in the same operation, the hostname is retired and never re-allocated, and the tunnel token is invalidated. Retrying against an already-archived tunnel returns the existing record unchanged.
Some parameter documentations has been truncated, see Models::Beta::TunnelArchiveParams for more details.
154 155 156 157 158 159 160 161 162 163 |
# File 'lib/anthropic/resources/beta/tunnels.rb', line 154 def archive(tunnel_id, params = {}) parsed, = Anthropic::Beta::TunnelArchiveParams.dump_request(params) @client.request( method: :post, path: ["v1/tunnels/%1$s/archive?beta=true", tunnel_id], headers: parsed.transform_keys(betas: "anthropic-beta", workspace_id: "anthropic-workspace-id"), model: Anthropic::Beta::BetaTunnel, options: {extra_headers: {"anthropic-beta" => "mcp-tunnels-2026-06-22"}, **} ) end |
#create(display_name: nil, betas: nil, workspace_id: nil, request_options: {}) ⇒ Anthropic::Models::Beta::BetaTunnel
The Tunnels API is in research preview. It requires the
anthropic-beta: mcp-tunnels-2026-06-22 header and may change without a
deprecation period. It supersedes the Admin API endpoints at
/v1/organizations/tunnels, which remain available during a migration window.
Creates a tunnel. Creation allocates a fresh hostname and provisions the tunnel; it is not idempotent. The new tunnel rejects MCP traffic until at least one CA certificate is added.
Some parameter documentations has been truncated, see Models::Beta::TunnelCreateParams for more details.
35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/anthropic/resources/beta/tunnels.rb', line 35 def create(params = {}) parsed, = Anthropic::Beta::TunnelCreateParams.dump_request(params) header_params = {betas: "anthropic-beta", workspace_id: "anthropic-workspace-id"} @client.request( method: :post, path: "v1/tunnels?beta=true", headers: parsed.slice(*header_params.keys).transform_keys(header_params), body: parsed.except(*header_params.keys), model: Anthropic::Beta::BetaTunnel, options: {extra_headers: {"anthropic-beta" => "mcp-tunnels-2026-06-22"}, **} ) end |
#list(include_archived: nil, limit: nil, page: nil, betas: nil, workspace_id: nil, request_options: {}) ⇒ Anthropic::Internal::PageCursor<Anthropic::Models::Beta::BetaTunnel>
The Tunnels API is in research preview. It requires the
anthropic-beta: mcp-tunnels-2026-06-22 header and may change without a
deprecation period. It supersedes the Admin API endpoints at
/v1/organizations/tunnels, which remain available during a migration window.
Lists tunnels. Results are ordered by creation time, newest first; archived tunnels are excluded unless include_archived is set.
Some parameter documentations has been truncated, see Models::Beta::TunnelListParams for more details.
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 |
# File 'lib/anthropic/resources/beta/tunnels.rb', line 110 def list(params = {}) query_params = [:include_archived, :limit, :page] parsed, = Anthropic::Beta::TunnelListParams.dump_request(params) query = Anthropic::Internal::Util.encode_query_params(parsed.slice(*query_params)) @client.request( method: :get, path: "v1/tunnels?beta=true", query: query, headers: parsed.except(*query_params).transform_keys( betas: "anthropic-beta", workspace_id: "anthropic-workspace-id" ), page: Anthropic::Internal::PageCursor, model: Anthropic::Beta::BetaTunnel, options: {extra_headers: {"anthropic-beta" => "mcp-tunnels-2026-06-22"}, **} ) end |
#retrieve(tunnel_id, betas: nil, workspace_id: nil, request_options: {}) ⇒ Anthropic::Models::Beta::BetaTunnel
The Tunnels API is in research preview. It requires the
anthropic-beta: mcp-tunnels-2026-06-22 header and may change without a
deprecation period. It supersedes the Admin API endpoints at
/v1/organizations/tunnels, which remain available during a migration window.
Fetches a tunnel by ID.
Some parameter documentations has been truncated, see Models::Beta::TunnelRetrieveParams for more details.
71 72 73 74 75 76 77 78 79 80 |
# File 'lib/anthropic/resources/beta/tunnels.rb', line 71 def retrieve(tunnel_id, params = {}) parsed, = Anthropic::Beta::TunnelRetrieveParams.dump_request(params) @client.request( method: :get, path: ["v1/tunnels/%1$s?beta=true", tunnel_id], headers: parsed.transform_keys(betas: "anthropic-beta", workspace_id: "anthropic-workspace-id"), model: Anthropic::Beta::BetaTunnel, options: {extra_headers: {"anthropic-beta" => "mcp-tunnels-2026-06-22"}, **} ) end |
#reveal_token(tunnel_id, betas: nil, workspace_id: nil, request_options: {}) ⇒ Anthropic::Models::Beta::BetaTunnelToken
The Tunnels API is in research preview. It requires the
anthropic-beta: mcp-tunnels-2026-06-22 header and may change without a
deprecation period. It supersedes the Admin API endpoints at
/v1/organizations/tunnels, which remain available during a migration window.
Reveals a tunnel's connector token. The value is fetched live on each call; Anthropic does not store it. Repeated calls return the same value until the token is rotated. Exposed as POST so the token does not appear in intermediary access logs.
Some parameter documentations has been truncated, see Models::Beta::TunnelRevealTokenParams for more details.
191 192 193 194 195 196 197 198 199 200 |
# File 'lib/anthropic/resources/beta/tunnels.rb', line 191 def reveal_token(tunnel_id, params = {}) parsed, = Anthropic::Beta::TunnelRevealTokenParams.dump_request(params) @client.request( method: :post, path: ["v1/tunnels/%1$s/reveal_token?beta=true", tunnel_id], headers: parsed.transform_keys(betas: "anthropic-beta", workspace_id: "anthropic-workspace-id"), model: Anthropic::Beta::BetaTunnelToken, options: {extra_headers: {"anthropic-beta" => "mcp-tunnels-2026-06-22"}, **} ) end |
#rotate_token(tunnel_id, reason: nil, betas: nil, workspace_id: nil, request_options: {}) ⇒ Anthropic::Models::Beta::BetaTunnelToken
The Tunnels API is in research preview. It requires the
anthropic-beta: mcp-tunnels-2026-06-22 header and may change without a
deprecation period. It supersedes the Admin API endpoints at
/v1/organizations/tunnels, which remain available during a migration window.
Rotates a tunnel's connector token. Rotation invalidates the current token for new connections and returns a fresh value; established connections are not severed. A connector restarted after rotation must use the new value.
Some parameter documentations has been truncated, see Models::Beta::TunnelRotateTokenParams for more details.
229 230 231 232 233 234 235 236 237 238 239 240 |
# File 'lib/anthropic/resources/beta/tunnels.rb', line 229 def rotate_token(tunnel_id, params = {}) parsed, = Anthropic::Beta::TunnelRotateTokenParams.dump_request(params) header_params = {betas: "anthropic-beta", workspace_id: "anthropic-workspace-id"} @client.request( method: :post, path: ["v1/tunnels/%1$s/rotate_token?beta=true", tunnel_id], headers: parsed.slice(*header_params.keys).transform_keys(header_params), body: parsed.except(*header_params.keys), model: Anthropic::Beta::BetaTunnelToken, options: {extra_headers: {"anthropic-beta" => "mcp-tunnels-2026-06-22"}, **} ) end |