Create a Migration Source
Create a source from which data can be migrated from.
POST
/
storage
/
migration_sources
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const migrationSource = await client.storage.migrationSources.create({
bucket_name: 'bucket_name',
provider: 'aws',
provider_auth: {},
});
console.log(migrationSource.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_source = client.storage.migration_sources.create(
bucket_name="bucket_name",
provider="aws",
provider_auth={},
)
print(migration_source.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"),
)
migrationSource, err := client.Storage.MigrationSources.New(context.TODO(), telnyx.StorageMigrationSourceNewParams{
MigrationSourceParams: telnyx.MigrationSourceParams{
BucketName: "bucket_name",
Provider: telnyx.MigrationSourceParamsProviderAws,
ProviderAuth: telnyx.MigrationSourceParamsProviderAuth{},
},
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", migrationSource.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.migrationsources.MigrationSourceCreateResponse;
import com.telnyx.sdk.models.storage.migrationsources.MigrationSourceParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
MigrationSourceParams params = MigrationSourceParams.builder()
.bucketName("bucket_name")
.provider(MigrationSourceParams.Provider.AWS)
.providerAuth(MigrationSourceParams.ProviderAuth.builder().build())
.build();
MigrationSourceCreateResponse migrationSource = client.storage().migrationSources().create(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
migration_source = telnyx.storage.migration_sources.create(bucket_name: "bucket_name", provider: :aws, provider_auth: {})
puts(migration_source)<?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 {
$migrationSource = $client->storage->migrationSources->create(
bucketName: 'bucket_name',
provider: 'aws',
providerAuth: [
'accessKey' => 'access_key', 'secretAccessKey' => 'secret_access_key'
],
sourceRegion: 'source_region',
);
var_dump($migrationSource);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx storage:migration-sources create \
--api-key 'My API Key' \
--bucket-name bucket_name \
--provider aws \
--provider-auth '{}'curl --request POST \
--url https://api.telnyx.com/v2/storage/migration_sources \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"provider": "aws",
"source_region": "string",
"provider_auth": {
"access_key": "string",
"secret_access_key": "string"
},
"bucket_name": "string"
}
'{
"data": {
"id": "string",
"provider": "aws",
"source_region": "string",
"provider_auth": {
"access_key": "string",
"secret_access_key": "string"
},
"bucket_name": "string"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Cloud provider from which to migrate data. Use 'telnyx' if you want to migrate data from one Telnyx bucket to another.
Available options:
aws, telnyx Show child attributes
Show child attributes
Bucket name to migrate the data from.
For intra-Telnyx buckets migration, specify the source bucket region in this field.
Response
Create Migration Source Response
Show child attributes
Show child attributes
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 migrationSource = await client.storage.migrationSources.create({
bucket_name: 'bucket_name',
provider: 'aws',
provider_auth: {},
});
console.log(migrationSource.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_source = client.storage.migration_sources.create(
bucket_name="bucket_name",
provider="aws",
provider_auth={},
)
print(migration_source.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"),
)
migrationSource, err := client.Storage.MigrationSources.New(context.TODO(), telnyx.StorageMigrationSourceNewParams{
MigrationSourceParams: telnyx.MigrationSourceParams{
BucketName: "bucket_name",
Provider: telnyx.MigrationSourceParamsProviderAws,
ProviderAuth: telnyx.MigrationSourceParamsProviderAuth{},
},
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", migrationSource.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.migrationsources.MigrationSourceCreateResponse;
import com.telnyx.sdk.models.storage.migrationsources.MigrationSourceParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
MigrationSourceParams params = MigrationSourceParams.builder()
.bucketName("bucket_name")
.provider(MigrationSourceParams.Provider.AWS)
.providerAuth(MigrationSourceParams.ProviderAuth.builder().build())
.build();
MigrationSourceCreateResponse migrationSource = client.storage().migrationSources().create(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
migration_source = telnyx.storage.migration_sources.create(bucket_name: "bucket_name", provider: :aws, provider_auth: {})
puts(migration_source)<?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 {
$migrationSource = $client->storage->migrationSources->create(
bucketName: 'bucket_name',
provider: 'aws',
providerAuth: [
'accessKey' => 'access_key', 'secretAccessKey' => 'secret_access_key'
],
sourceRegion: 'source_region',
);
var_dump($migrationSource);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx storage:migration-sources create \
--api-key 'My API Key' \
--bucket-name bucket_name \
--provider aws \
--provider-auth '{}'curl --request POST \
--url https://api.telnyx.com/v2/storage/migration_sources \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"provider": "aws",
"source_region": "string",
"provider_auth": {
"access_key": "string",
"secret_access_key": "string"
},
"bucket_name": "string"
}
'{
"data": {
"id": "string",
"provider": "aws",
"source_region": "string",
"provider_auth": {
"access_key": "string",
"secret_access_key": "string"
},
"bucket_name": "string"
}
}