Data التي تُستخدَم للوصول إلى مواصفات مصدر بيانات Looker
الحالية على وجه التحديد لإنشاء مواصفات مصدر بيانات جديدة، استخدِم Spreadsheet.
يوضّح هذا المثال كيفية الحصول على مواصفات مصدر بيانات Looker من ورقة بيانات تتضمّن اتصالاً واحدًا فقط بLooker.
// 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();
الطُرق
| الطريقة | نوع القيمة التي يتم عرضها | وصف قصير |
|---|---|---|
copy() | Data | تُنشئ Data استنادًا إلى إعدادات مصدر البيانات هذا. |
get | String | تحصل على اسم استكشاف Looker في النموذج. |
get | String | تحصل على عنوان URL لنسخة Looker. |
get | String | تحصل على اسم نموذج Looker في المثيل. |
get | Data | تحصل على مَعلمات مصدر البيانات. |
get | Data | تحصل على نوع مصدر البيانات. |
مستندات تفصيلية
copy()
تُنشئ Data استنادًا إلى إعدادات مصدر البيانات هذا.
// 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();
الإرجاع
Data: المطوّر
get Explore Name()
تحصل على اسم استكشاف Looker في النموذج.
// 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);
الإرجاع
String: اسم استكشاف Looker
get Instance Url()
تحصل على عنوان URL لنسخة Looker.
// 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);
الإرجاع
String: عنوان URL لنسخة Looker.
get Model Name()
تحصل على اسم نموذج Looker في المثيل.
// 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);
الإرجاع
String: اسم نموذج Looker
get Parameters()
تحصل على مَعلمات مصدر البيانات.
// 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();
لا تتوفّر هذه الطريقة إلا لمصادر بيانات BigQuery.
الإرجاع
Data - قائمة المَعلمات
get Type()
تحصل على نوع مصدر البيانات.
// 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();
الإرجاع
Data: نوع مصدر البيانات