Class: Telnyx::Resources::Storage::Sqldbs
- Inherits:
-
Object
- Object
- Telnyx::Resources::Storage::Sqldbs
- Defined in:
- lib/telnyx/resources/storage/sqldbs.rb,
lib/telnyx/resources/storage/sqldbs/actions.rb,
sig/telnyx/resources/storage/sqldbs.rbs,
sig/telnyx/resources/storage/sqldbs/actions.rbs
Overview
Manage SQL databases and run SQL against them
Defined Under Namespace
Classes: Actions
Instance Attribute Summary collapse
-
#actions ⇒ Telnyx::Resources::Storage::Sqldbs::Actions
readonly
Manage SQL databases and run SQL against them.
Instance Method Summary collapse
-
#create(name:, request_options: {}) ⇒ Telnyx::Models::Storage::SqlDatabaseResponseWrapper
Some parameter documentations has been truncated, see Models::Storage::SqldbCreateParams for more details.
-
#delete(id, force: nil, request_options: {}) ⇒ nil
Some parameter documentations has been truncated, see Models::Storage::SqldbDeleteParams for more details.
-
#initialize(client:) ⇒ Sqldbs
constructor
private
A new instance of Sqldbs.
-
#list(filter_name: nil, filter_status: nil, page_number: nil, page_size: nil, sort: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::Storage::SqlDatabase>
Lists the SQL databases for the authenticated user's organization.
-
#retrieve(id, request_options: {}) ⇒ Telnyx::Models::Storage::SqlDatabaseResponseWrapper
Retrieves a SQL database by its ID, including its provisioning status.
Constructor Details
#initialize(client:) ⇒ Sqldbs
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 Sqldbs.
133 134 135 136 |
# File 'lib/telnyx/resources/storage/sqldbs.rb', line 133 def initialize(client:) @client = client @actions = Telnyx::Resources::Storage::Sqldbs::Actions.new(client: client) end |
Instance Attribute Details
#actions ⇒ Telnyx::Resources::Storage::Sqldbs::Actions (readonly)
Manage SQL databases and run SQL against them
10 11 12 |
# File 'lib/telnyx/resources/storage/sqldbs.rb', line 10 def actions @actions end |
Instance Method Details
#create(name:, request_options: {}) ⇒ Telnyx::Models::Storage::SqlDatabaseResponseWrapper
Some parameter documentations has been truncated, see Models::Storage::SqldbCreateParams for more details.
Creates a new SQL database. Provisioning is asynchronous: the database is
returned with status pending and becomes usable once it reaches
provision_ok.
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/telnyx/resources/storage/sqldbs.rb', line 28 def create(params) parsed, = Telnyx::Storage::SqldbCreateParams.dump_request(params) @client.request( method: :post, path: "storage/sqldbs", body: parsed, model: Telnyx::Storage::SqlDatabaseResponseWrapper, options: ) end |
#delete(id, force: nil, request_options: {}) ⇒ nil
Some parameter documentations has been truncated, see Models::Storage::SqldbDeleteParams for more details.
Deletes a SQL database and all of the data it holds. Deletion is asynchronous
and returns 202 with an empty body — the record is not removed synchronously.
Poll GET /storage/sqldbs/{id}, which returns 404 once the database has been
purged; there is no durable deleted state. A database still bound by a
function is refused with 409 unless force=true.
118 119 120 121 122 123 124 125 126 127 128 |
# File 'lib/telnyx/resources/storage/sqldbs.rb', line 118 def delete(id, params = {}) parsed, = Telnyx::Storage::SqldbDeleteParams.dump_request(params) query = Telnyx::Internal::Util.encode_query_params(parsed) @client.request( method: :delete, path: ["storage/sqldbs/%1$s", id], query: query, model: NilClass, options: ) end |
#list(filter_name: nil, filter_status: nil, page_number: nil, page_size: nil, sort: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::Storage::SqlDatabase>
Lists the SQL databases for the authenticated user's organization. Results use
page-based pagination (page[number]/page[size]) and can be filtered and
sorted.
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
# File 'lib/telnyx/resources/storage/sqldbs.rb', line 80 def list(params = {}) parsed, = Telnyx::Storage::SqldbListParams.dump_request(params) query = Telnyx::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "storage/sqldbs", query: query.transform_keys( filter_name: "filter[name]", filter_status: "filter[status]", page_number: "page[number]", page_size: "page[size]" ), page: Telnyx::Internal::DefaultFlatPagination, model: Telnyx::Storage::SqlDatabase, options: ) end |
#retrieve(id, request_options: {}) ⇒ Telnyx::Models::Storage::SqlDatabaseResponseWrapper
Retrieves a SQL database by its ID, including its provisioning status.
50 51 52 53 54 55 56 57 |
# File 'lib/telnyx/resources/storage/sqldbs.rb', line 50 def retrieve(id, params = {}) @client.request( method: :get, path: ["storage/sqldbs/%1$s", id], model: Telnyx::Storage::SqlDatabaseResponseWrapper, options: params[:request_options] ) end |