Class: Telnyx::Resources::Storage::Migrations

Inherits:
Object
  • Object
show all
Defined in:
lib/telnyx/resources/storage/migrations.rb,
lib/telnyx/resources/storage/migrations/actions.rb

Defined Under Namespace

Classes: Actions

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Migrations

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

Parameters:



83
84
85
86
# File 'lib/telnyx/resources/storage/migrations.rb', line 83

def initialize(client:)
  @client = client
  @actions = Telnyx::Resources::Storage::Migrations::Actions.new(client: client)
end

Instance Attribute Details

#actionsTelnyx::Resources::Storage::Migrations::Actions (readonly)



8
9
10
# File 'lib/telnyx/resources/storage/migrations.rb', line 8

def actions
  @actions
end

Instance Method Details

#create(source_id:, target_bucket_name:, target_region:, refresh: nil, request_options: {}) ⇒ Telnyx::Models::Storage::MigrationCreateResponse

Some parameter documentations has been truncated, see Models::Storage::MigrationCreateParams for more details.

Initiate a migration of data from an external provider into Telnyx Cloud Storage. Currently, only S3 is supported.

Parameters:

  • source_id (String)

    ID of the Migration Source from which to migrate data.

  • target_bucket_name (String)

    Bucket name to migrate the data into. Will default to the same name as the ‘sour

  • target_region (String)

    Telnyx Cloud Storage region to migrate the data to.

  • refresh (Boolean)

    If true, will continue to poll the source bucket to ensure new data is continual

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

Returns:

See Also:



31
32
33
34
35
36
37
38
39
40
# File 'lib/telnyx/resources/storage/migrations.rb', line 31

def create(params)
  parsed, options = Telnyx::Storage::MigrationCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "storage/migrations",
    body: parsed,
    model: Telnyx::Models::Storage::MigrationCreateResponse,
    options: options
  )
end

#list(request_options: {}) ⇒ Telnyx::Models::Storage::MigrationListResponse

List all Migrations

Parameters:

Returns:

See Also:



71
72
73
74
75
76
77
78
# File 'lib/telnyx/resources/storage/migrations.rb', line 71

def list(params = {})
  @client.request(
    method: :get,
    path: "storage/migrations",
    model: Telnyx::Models::Storage::MigrationListResponse,
    options: params[:request_options]
  )
end

#retrieve(id, request_options: {}) ⇒ Telnyx::Models::Storage::MigrationRetrieveResponse

Get a Migration

Parameters:

  • id (String)

    Unique identifier for the data migration.

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

Returns:

See Also:



53
54
55
56
57
58
59
60
# File 'lib/telnyx/resources/storage/migrations.rb', line 53

def retrieve(id, params = {})
  @client.request(
    method: :get,
    path: ["storage/migrations/%1$s", id],
    model: Telnyx::Models::Storage::MigrationRetrieveResponse,
    options: params[:request_options]
  )
end