Class: Anthropic::Resources::Beta::Tunnels::Certificates

Inherits:
Object
  • Object
show all
Defined in:
lib/anthropic/resources/beta/tunnels/certificates.rb,
sig/anthropic/resources/beta/tunnels/certificates.rbs

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Certificates

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

Parameters:



165
166
167
# File 'lib/anthropic/resources/beta/tunnels/certificates.rb', line 165

def initialize(client:)
  @client = client
end

Instance Method Details

#archive(certificate_id, tunnel_id:, betas: nil, request_options: {}) ⇒ Anthropic::Models::Beta::Tunnels::BetaTunnelCertificate

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 certificate, removing it from the set Anthropic trusts for the tunnel. The certificate record is retained. Archiving the last non-archived certificate is permitted; the tunnel rejects MCP traffic until a new certificate is added.

Parameters:

  • certificate_id (String)

    Path param: Path parameter certificate_id

  • tunnel_id (String)

    Path param: Path parameter tunnel_id

  • betas (Array<String, Symbol, Anthropic::Models::AnthropicBeta>)

    Header param: Optional header to specify the beta version(s) you want to use.

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

Returns:

See Also:



147
148
149
150
151
152
153
154
155
156
157
158
159
160
# File 'lib/anthropic/resources/beta/tunnels/certificates.rb', line 147

def archive(certificate_id, params)
  parsed, options = Anthropic::Beta::Tunnels::CertificateArchiveParams.dump_request(params)
  tunnel_id =
    parsed.delete(:tunnel_id) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :post,
    path: ["v1/tunnels/%1$s/certificates/%2$s/archive?beta=true", tunnel_id, certificate_id],
    headers: parsed.transform_keys(betas: "anthropic-beta"),
    model: Anthropic::Beta::Tunnels::BetaTunnelCertificate,
    options: {extra_headers: {"anthropic-beta" => "mcp-tunnels-2026-06-22"}, **options}
  )
end

#create(tunnel_id, ca_certificate_pem:, betas: nil, request_options: {}) ⇒ Anthropic::Models::Beta::Tunnels::BetaTunnelCertificate

Some parameter documentations has been truncated, see Models::Beta::Tunnels::CertificateCreateParams for more details.

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.

Registers a public CA certificate on a tunnel. Anthropic verifies the gateway's server certificate against this CA when it terminates the inner TLS session. A tunnel holds at most two non-archived certificates.

Parameters:

  • tunnel_id (String)

    Path param: Path parameter tunnel_id

  • ca_certificate_pem (String)

    Body param: PEM-encoded X.509 CA certificate. Must contain exactly one certifica

  • betas (Array<String, Symbol, Anthropic::Models::AnthropicBeta>)

    Header param: Optional header to specify the beta version(s) you want to use.

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

Returns:

See Also:



33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/anthropic/resources/beta/tunnels/certificates.rb', line 33

def create(tunnel_id, params)
  parsed, options = Anthropic::Beta::Tunnels::CertificateCreateParams.dump_request(params)
  header_params = {betas: "anthropic-beta"}
  @client.request(
    method: :post,
    path: ["v1/tunnels/%1$s/certificates?beta=true", tunnel_id],
    headers: parsed.slice(*header_params.keys).transform_keys(header_params),
    body: parsed.except(*header_params.keys),
    model: Anthropic::Beta::Tunnels::BetaTunnelCertificate,
    options: {extra_headers: {"anthropic-beta" => "mcp-tunnels-2026-06-22"}, **options}
  )
end

#list(tunnel_id, include_archived: nil, limit: nil, page: nil, betas: nil, request_options: {}) ⇒ Anthropic::Internal::PageCursor<Anthropic::Models::Beta::Tunnels::BetaTunnelCertificate>

Some parameter documentations has been truncated, see Models::Beta::Tunnels::CertificateListParams for more details.

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 the certificates registered on a tunnel. Archived certificates are excluded unless include_archived is set.

Parameters:

  • tunnel_id (String)

    Path param: Path parameter tunnel_id

  • include_archived (Boolean)

    Query param: Whether to include archived certificates in the results. Defaults t

  • limit (Integer)

    Query param: Maximum number of certificates to return per page. Defaults to 20,

  • page (String)

    Query param: Opaque pagination cursor from a previous list_tunnel_certificates

  • betas (Array<String, Symbol, Anthropic::Models::AnthropicBeta>)

    Header param: Optional header to specify the beta version(s) you want to use.

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

Returns:

See Also:



109
110
111
112
113
114
115
116
117
118
119
120
121
122
# File 'lib/anthropic/resources/beta/tunnels/certificates.rb', line 109

def list(tunnel_id, params = {})
  query_params = [:include_archived, :limit, :page]
  parsed, options = Anthropic::Beta::Tunnels::CertificateListParams.dump_request(params)
  query = Anthropic::Internal::Util.encode_query_params(parsed.slice(*query_params))
  @client.request(
    method: :get,
    path: ["v1/tunnels/%1$s/certificates?beta=true", tunnel_id],
    query: query,
    headers: parsed.except(*query_params).transform_keys(betas: "anthropic-beta"),
    page: Anthropic::Internal::PageCursor,
    model: Anthropic::Beta::Tunnels::BetaTunnelCertificate,
    options: {extra_headers: {"anthropic-beta" => "mcp-tunnels-2026-06-22"}, **options}
  )
end

#retrieve(certificate_id, tunnel_id:, betas: nil, request_options: {}) ⇒ Anthropic::Models::Beta::Tunnels::BetaTunnelCertificate

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 certificate by ID.

Parameters:

  • certificate_id (String)

    Path param: Path parameter certificate_id

  • tunnel_id (String)

    Path param: Path parameter tunnel_id

  • betas (Array<String, Symbol, Anthropic::Models::AnthropicBeta>)

    Header param: Optional header to specify the beta version(s) you want to use.

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

Returns:

See Also:



66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/anthropic/resources/beta/tunnels/certificates.rb', line 66

def retrieve(certificate_id, params)
  parsed, options = Anthropic::Beta::Tunnels::CertificateRetrieveParams.dump_request(params)
  tunnel_id =
    parsed.delete(:tunnel_id) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :get,
    path: ["v1/tunnels/%1$s/certificates/%2$s?beta=true", tunnel_id, certificate_id],
    headers: parsed.transform_keys(betas: "anthropic-beta"),
    model: Anthropic::Beta::Tunnels::BetaTunnelCertificate,
    options: {extra_headers: {"anthropic-beta" => "mcp-tunnels-2026-06-22"}, **options}
  )
end