Class LookerDataSourceSpec

LookerDataSourceSpec

Özellikle mevcut Looker veri kaynağı özelliklerine erişmek için kullanılan bir DataSourceSpec. Yeni bir veri kaynağı spesifikasyonu oluşturmak için SpreadsheetApp.newDataSourceSpec() kullanın.

Bu örnekte, yalnızca bir Looker bağlantısı olan bir sayfadan Looker veri kaynağı spesifikasyonunu nasıl alabileceğiniz gösterilmektedir.

// TODO(developer): Replace the URL with your own.
const ss = SpreadsheetApp.openByUrl(
    'https://docs.google.com/spreadsheets/d/abc123456/edit',
);

const lookerDataSourceSpec = ss.getDataSources()[0].getSpec().asLooker();

Yöntemler

YöntemDönüş türüKısa açıklama
copy()DataSourceSpecBuilderBu veri kaynağının ayarlarına göre DataSourceSpecBuilder oluşturur.
getExploreName()StringModeldeki Looker keşfinin adını alır.
getInstanceUrl()StringLooker örneğinin URL'sini alır.
getModelName()StringÖrnekteki Looker modelinin adını alır.
getParameters()DataSourceParameter[]Veri kaynağının parametrelerini alır.
getType()DataSourceTypeVeri kaynağının türünü alır.

Ayrıntılı belgeler

copy()

Bu veri kaynağının ayarlarına göre DataSourceSpecBuilder oluşturur.

// TODO(developer): Replace the URL with your own.
const ss = SpreadsheetApp.openByUrl(
    'https://docs.google.com/spreadsheets/d/abc123456/edit',
);
const spec = ss.getDataSources()[0].getSpec();

const newSpec = spec.copy();

Return

DataSourceSpecBuilder: Derleyici.


getExploreName()

Modeldeki Looker keşfinin adını alır.

// TODO(developer): Replace the URL with your own.
const ss = SpreadsheetApp.openByUrl(
    'https://docs.google.com/spreadsheets/d/abc123456/edit',
);

const lookerDataSourceSpec = ss.getDataSources()[0].getSpec().asLooker();
const exploreName = lookerDataSourceSpec.getExploreName();
Logger.log(exploreName);

Return

String: Looker keşfinin adı.


getInstanceUrl()

Looker örneğinin URL'sini alır.

// TODO(developer): Replace the URL with your own.
const ss = SpreadsheetApp.openByUrl(
    'https://docs.google.com/spreadsheets/d/abc123456/edit',
);

const lookerDataSourceSpec = ss.getDataSources()[0].getSpec().asLooker();
const instanceUrl = lookerDataSourceSpec.getInstanceUrl();
Logger.log(instanceUrl);

Return

String: Looker örneğinin URL'si.


getModelName()

Örnekteki Looker modelinin adını alır.

// TODO(developer): Replace the URL with your own.
const ss = SpreadsheetApp.openByUrl(
    'https://docs.google.com/spreadsheets/d/abc123456/edit',
);

const lookerDataSourceSpec = ss.getDataSources()[0].getSpec().asLooker();
const modelName = lookerDataSourceSpec.getModelName();
Logger.log(modelName);

Return

String: Looker modelinin adı.


getParameters()

Veri kaynağının parametrelerini alır.

// TODO(developer): Replace the URL with your own.
const ss = SpreadsheetApp.openByUrl(
    'https://docs.google.com/spreadsheets/d/abc123456/edit',
);
const spec = ss.getDataSources()[0].getSpec();
const parameters = spec.getParameters();

Bu yöntem yalnızca BigQuery veri kaynakları için kullanılabilir.

Return

DataSourceParameter[]: Parametre listesi.


getType()

Veri kaynağının türünü alır.

// TODO(developer): Replace the URL with your own.
const ss = SpreadsheetApp.openByUrl(
    'https://docs.google.com/spreadsheets/d/abc123456/edit',
);
const spec = ss.getDataSources()[0].getSpec();
const type = spec.getType();

Return

DataSourceType: Veri kaynağı türü.