Create a Migration
Initiate a migration of data from an external provider into Telnyx Cloud Storage. Currently, only S3 is supported.
POST
/
storage
/
migrations
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const migration = await client.storage.migrations.create({
source_id: 'source_id',
target_bucket_name: 'target_bucket_name',
target_region: 'target_region',
});
console.log(migration.data);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
migration = client.storage.migrations.create(
source_id="source_id",
target_bucket_name="target_bucket_name",
target_region="target_region",
)
print(migration.data)
package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
migration, err := client.Storage.Migrations.New(context.TODO(), telnyx.StorageMigrationNewParams{
MigrationParams: telnyx.MigrationParams{
SourceID: "source_id",
TargetBucketName: "target_bucket_name",
TargetRegion: "target_region",
},
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", migration.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.storage.migrations.MigrationCreateResponse;
import com.telnyx.sdk.models.storage.migrations.MigrationParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
MigrationParams params = MigrationParams.builder()
.sourceId("source_id")
.targetBucketName("target_bucket_name")
.targetRegion("target_region")
.build();
MigrationCreateResponse migration = client.storage().migrations().create(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
migration = telnyx.storage.migrations.create(
source_id: "source_id",
target_bucket_name: "target_bucket_name",
target_region: "target_region"
)
puts(migration)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$migration = $client->storage->migrations->create(
sourceID: 'source_id',
targetBucketName: 'target_bucket_name',
targetRegion: 'target_region',
refresh: true,
);
var_dump($migration);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx storage:migrations create \
--api-key 'My API Key' \
--source-id source_id \
--target-bucket-name target_bucket_name \
--target-region target_regioncurl --request POST \
--url https://api.telnyx.com/v2/storage/migrations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"source_id": "<string>",
"target_bucket_name": "<string>",
"target_region": "<string>",
"refresh": true
}
'{
"data": {
"source_id": "<string>",
"target_bucket_name": "<string>",
"target_region": "<string>",
"id": "<string>",
"refresh": true,
"last_copy": "2020-01-01T00:00:00Z",
"status": "pending",
"bytes_to_migrate": 123,
"bytes_migrated": 123,
"speed": 123,
"eta": "2020-01-01T00:00:00Z",
"created_at": "2020-01-01T00:00:00Z"
}
}Authorizations
Body
application/json
Was this page helpful?
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const migration = await client.storage.migrations.create({
source_id: 'source_id',
target_bucket_name: 'target_bucket_name',
target_region: 'target_region',
});
console.log(migration.data);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
migration = client.storage.migrations.create(
source_id="source_id",
target_bucket_name="target_bucket_name",
target_region="target_region",
)
print(migration.data)
package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
migration, err := client.Storage.Migrations.New(context.TODO(), telnyx.StorageMigrationNewParams{
MigrationParams: telnyx.MigrationParams{
SourceID: "source_id",
TargetBucketName: "target_bucket_name",
TargetRegion: "target_region",
},
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", migration.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.storage.migrations.MigrationCreateResponse;
import com.telnyx.sdk.models.storage.migrations.MigrationParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
MigrationParams params = MigrationParams.builder()
.sourceId("source_id")
.targetBucketName("target_bucket_name")
.targetRegion("target_region")
.build();
MigrationCreateResponse migration = client.storage().migrations().create(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
migration = telnyx.storage.migrations.create(
source_id: "source_id",
target_bucket_name: "target_bucket_name",
target_region: "target_region"
)
puts(migration)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$migration = $client->storage->migrations->create(
sourceID: 'source_id',
targetBucketName: 'target_bucket_name',
targetRegion: 'target_region',
refresh: true,
);
var_dump($migration);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx storage:migrations create \
--api-key 'My API Key' \
--source-id source_id \
--target-bucket-name target_bucket_name \
--target-region target_regioncurl --request POST \
--url https://api.telnyx.com/v2/storage/migrations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"source_id": "<string>",
"target_bucket_name": "<string>",
"target_region": "<string>",
"refresh": true
}
'{
"data": {
"source_id": "<string>",
"target_bucket_name": "<string>",
"target_region": "<string>",
"id": "<string>",
"refresh": true,
"last_copy": "2020-01-01T00:00:00Z",
"status": "pending",
"bytes_to_migrate": 123,
"bytes_migrated": 123,
"speed": 123,
"eta": "2020-01-01T00:00:00Z",
"created_at": "2020-01-01T00:00:00Z"
}
}