Class: Anthropic::Resources::Beta::Tunnels::Certificates
- Inherits:
-
Object
- Object
- Anthropic::Resources::Beta::Tunnels::Certificates
- Defined in:
- lib/anthropic/resources/beta/tunnels/certificates.rb,
sig/anthropic/resources/beta/tunnels/certificates.rbs
Instance Method Summary collapse
-
#archive(certificate_id, tunnel_id:, betas: nil, request_options: {}) ⇒ Anthropic::Models::Beta::Tunnels::BetaTunnelCertificate
The Tunnels API is in research preview.
-
#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.
-
#initialize(client:) ⇒ Certificates
constructor
private
A new instance of Certificates.
-
#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.
-
#retrieve(certificate_id, tunnel_id:, betas: nil, request_options: {}) ⇒ Anthropic::Models::Beta::Tunnels::BetaTunnelCertificate
The Tunnels API is in research preview.
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.
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.
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, = 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"}, **} ) 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.
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, = 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"}, **} ) 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.
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, = 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"}, **} ) 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.
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, = 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"}, **} ) end |