Class: VectorAmp::ConnectionsResource
- Inherits:
-
Object
- Object
- VectorAmp::ConnectionsResource
- Defined in:
- lib/vector_amp/connections.rb
Overview
Managed OAuth/credential connections used by ingestion sources.
Connections live at the gateway root (/connections), not under
/ingestion. A connection captures a provider authorization (e.g. Google
Drive, Confluence) that ingestion sources can then reference via
connection_id instead of embedding raw credentials.
Instance Method Summary collapse
-
#create(provider, source_type: nil) ⇒ Hash
Create a connection and begin the provider authorization flow.
-
#delete(connection_id) ⇒ Hash
Delete a connection.
-
#get(connection_id) ⇒ Hash
Fetch a connection.
- #initialize(transport) ⇒ ConnectionsResource constructor
-
#list(provider: nil) ⇒ Hash
List connections, optionally filtered by provider.
Constructor Details
#initialize(transport) ⇒ ConnectionsResource
15 16 17 |
# File 'lib/vector_amp/connections.rb', line 15 def initialize(transport) @transport = transport end |
Instance Method Details
#create(provider, source_type: nil) ⇒ Hash
Create a connection and begin the provider authorization flow.
30 31 32 33 |
# File 'lib/vector_amp/connections.rb', line 30 def create(provider, source_type: nil) body = Utils.compact_hash(provider: provider, source_type: source_type) @transport.request(:post, "/connections", body: body) end |
#delete(connection_id) ⇒ Hash
Delete a connection.
45 46 47 |
# File 'lib/vector_amp/connections.rb', line 45 def delete(connection_id) @transport.request(:delete, "/connections/#{connection_id}") end |
#get(connection_id) ⇒ Hash
Fetch a connection.
38 39 40 |
# File 'lib/vector_amp/connections.rb', line 38 def get(connection_id) @transport.request(:get, "/connections/#{connection_id}") end |
#list(provider: nil) ⇒ Hash
List connections, optionally filtered by provider.
22 23 24 |
# File 'lib/vector_amp/connections.rb', line 22 def list(provider: nil) @transport.request(:get, "/connections", query: Utils.compact_hash(provider: provider)) end |