data360-schema-get

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

data360-schema-get Skill

data360-schema-get 技能

Overview

概述

This skill retrieves Data Lake Object (DLO) and Data Model Object (DMO) schema information from Salesforce Data Cloud using the SSOT REST API. It can list all DLOs or DMOs in an org, or retrieve detailed schema for a specific DLO or DMO.
此技能使用SSOT REST API从Salesforce Data Cloud中检索数据湖对象(DLO)和数据模型对象(DMO)的架构信息。它可以列出组织中的所有DLO或DMO,或者检索特定DLO或DMO的详细架构。

When to Use

使用场景

  • User wants to see all DLOs or DMOs in a Data Cloud org
  • User needs field schema for a specific DLO or DMO
  • User is exploring Data Cloud data structures
  • User needs to understand DLO or DMO field types and metadata
  • 用户希望查看Data Cloud组织中的所有DLO或DMO
  • 用户需要特定DLO或DMO的字段架构
  • 用户正在探索Data Cloud的数据结构
  • 用户需要了解DLO或DMO的字段类型和元数据

Prerequisites

前提条件

  • SF CLI installed and authenticated to target org
  • Org has Data Cloud enabled
  • User has appropriate Data Cloud permissions
  • 已安装SF CLI并完成目标组织的身份验证
  • 组织已启用Data Cloud
  • 用户拥有相应的Data Cloud权限

Skill Execution

技能执行

Parameters

参数

  1. org_alias (required): The SF CLI org alias (e.g., 'afvibe', 'myorg')
  2. dlo_name (optional): Specific DLO developer name (e.g., 'Employee__dll')
  3. dmo_name (optional): Specific DMO developer name (e.g., 'Individual__dlm')
  1. org_alias(必填):SF CLI组织别名(例如:'afvibe'、'myorg')
  2. dlo_name(可选):特定DLO的开发者名称(例如:'Employee__dll')
  3. dmo_name(可选):特定DMO的开发者名称(例如:'Individual__dlm')

Step 1: Discover Connected Org

步骤1:发现已连接的组织

First, run
sf org list
to find out which org is connected and extract the alias to use for all subsequent calls:
bash
sf org list
Example output:
text
┌────┬───────┬──────────────────────────┬────────────────────┬───────────┐
│    │ Alias │ Username                 │ Org Id             │ Status    │
├────┼───────┼──────────────────────────┼────────────────────┼───────────┤
│ 🍁 │ myorg │ chandresh@afvidedemo.org │ 00DKZ00000b80NT2AY │ Connected │
└────┴───────┴──────────────────────────┴────────────────────┴───────────┘
Extract the Alias value (e.g.,
myorg
) from the output and use it as the
<org_alias>
for all subsequent calls. Use
--all
to see expired and deleted scratch orgs as well.
首先,运行
sf org list
查看已连接的组织,并提取别名用于后续所有调用:
bash
sf org list
示例输出:
text
┌────┬───────┬──────────────────────────┬────────────────────┬───────────┐
│    │ Alias │ Username                 │ Org Id             │ Status    │
├────┼───────┼──────────────────────────┼────────────────────┼───────────┤
│ 🍁 │ myorg │ chandresh@afvidedemo.org │ 00DKZ00000b80NT2AY │ Connected │
└────┴───────┴──────────────────────────┴────────────────────┴───────────┘
从输出中提取 Alias 值(例如:
myorg
),将其作为后续调用中的
<org_alias>
。使用
--all
参数可以查看过期和已删除的临时组织。

Step 2: Validate SF CLI Authentication

步骤2:验证SF CLI身份验证

Before making API calls, verify the org is connected:
bash
sf org display --target-org <org_alias> --json
If not connected, inform user to run:
bash
sf org login web --alias <org_alias>
在调用API之前,验证组织是否已连接:
bash
sf org display --target-org <org_alias> --json
如果未连接,请告知用户运行以下命令:
bash
sf org login web --alias <org_alias>

Step 3a: Execute DLO Schema Script

步骤3a:执行DLO架构脚本

The Python scripts are bundled with this skill in the
scripts/
subdirectory.
To list all DLOs:
bash
python3 ./scripts/get_dlo_schema.py <org_alias>
To get specific DLO schema:
bash
python3 ./scripts/get_dlo_schema.py <org_alias> <dlo_name>
Python脚本已捆绑在此技能的
scripts/
子目录中。
列出所有DLO:
bash
python3 ./scripts/get_dlo_schema.py <org_alias>
获取特定DLO的架构:
bash
python3 ./scripts/get_dlo_schema.py <org_alias> <dlo_name>

Step 3b: Execute DMO Schema Script

步骤3b:执行DMO架构脚本

To list all DMOs:
bash
python3 ./scripts/get_dmo_schema.py <org_alias>
To get specific DMO schema:
bash
python3 ./scripts/get_dmo_schema.py <org_alias> <dmo_name>
列出所有DMO:
bash
python3 ./scripts/get_dmo_schema.py <org_alias>
获取特定DMO的架构:
bash
python3 ./scripts/get_dmo_schema.py <org_alias> <dmo_name>

Step 4: Present Results

步骤4:展示结果

Parse and present the results in a user-friendly format:
For DLO List:
  • Show DLO name, label, category, and ID
  • Indicate total count
  • Highlight DLOs with data (totalRecords > 0)
For DLO Schema:
  • Show basic info (name, label, category, status)
  • List all fields with:
    • Field name
    • Data type
    • Primary key indicator
    • Nullable status
  • Highlight custom fields (exclude system fields like DataSource__c, cdp_sys_*)
  • Show record count if available
For DMO List:
  • Show DMO name, label, category, and ID
  • Indicate total count
For DMO Schema:
  • Show basic info (name, label, category, description)
  • List all fields with:
    • Field name
    • Data type
    • Primary key indicator
    • Nullable status
  • Show dataspace information if available
解析结果并以用户友好的格式展示:
DLO列表:
  • 显示DLO名称、标签、类别和ID
  • 标注总数
  • 高亮显示包含数据的DLO(totalRecords > 0)
DLO架构:
  • 显示基本信息(名称、标签、类别、状态)
  • 列出所有字段,包括:
    • 字段名称
    • 数据类型
    • 主键标识
    • 可空状态
  • 高亮显示自定义字段(排除DataSource__c、cdp_sys_*等系统字段)
  • 若有可用数据则显示记录数
DMO列表:
  • 显示DMO名称、标签、类别和ID
  • 标注总数
DMO架构:
  • 显示基本信息(名称、标签、类别、描述)
  • 列出所有字段,包括:
    • 字段名称
    • 数据类型
    • 主键标识
    • 可空状态
  • 若有可用数据则显示数据空间信息

Step 5: Offer Next Steps

步骤5:提供后续操作建议

After displaying results, suggest relevant follow-up actions:
  • Query data from the DLO
  • Create calculated insights
  • Build segments
  • Set up data streams
  • Create DMO mappings
展示结果后,建议相关的后续操作:
  • 查询DLO中的数据
  • 创建计算洞察
  • 构建细分群体
  • 设置数据流
  • 创建DMO映射

API Endpoints Used

使用的API端点

List All DLOs

列出所有DLO

text
GET /services/data/v64.0/ssot/data-lake-objects
Response structure:
json
{
  "dataLakeObjects": [
    {
      "name": "Employee__dll",
      "label": "Employee",
      "category": "Profile",
      "id": "1dlXXXXXXXXXXXXXXX",
      "status": "ACTIVE",
      "totalRecords": 12,
      "fields": [...]
    }
  ],
  "totalSize": 5
}
text
GET /services/data/v64.0/ssot/data-lake-objects
响应结构:
json
{
  "dataLakeObjects": [
    {
      "name": "Employee__dll",
      "label": "Employee",
      "category": "Profile",
      "id": "1dlXXXXXXXXXXXXXXX",
      "status": "ACTIVE",
      "totalRecords": 12,
      "fields": [...]
    }
  ],
  "totalSize": 5
}

Get DLO Schema

获取DLO架构

text
GET /services/data/v64.0/ssot/data-lake-objects/{dlo_name}
Response structure (same as individual object in list response, but wrapped in paginated format).
text
GET /services/data/v64.0/ssot/data-lake-objects/{dlo_name}
响应结构(与列表响应中的单个对象相同,但包裹在分页格式中)。

List All DMOs

列出所有DMO

text
GET /services/data/v64.0/ssot/data-model-objects
Response structure:
json
{
  "dataModelObjects": [
    {
      "name": "Individual__dlm",
      "label": "Individual",
      "category": "Profile",
      "id": "0dmXXXXXXXXXXXXXXX",
      "fields": [...]
    }
  ],
  "totalSize": 10
}
text
GET /services/data/v64.0/ssot/data-model-objects
响应结构:
json
{
  "dataModelObjects": [
    {
      "name": "Individual__dlm",
      "label": "Individual",
      "category": "Profile",
      "id": "0dmXXXXXXXXXXXXXXX",
      "fields": [...]
    }
  ],
  "totalSize": 10
}

Get DMO Schema

获取DMO架构

text
GET /services/data/v64.0/ssot/data-model-objects/{dmo_name}
Response structure (same as individual object in list response, but wrapped in paginated format).
text
GET /services/data/v64.0/ssot/data-model-objects/{dmo_name}
响应结构(与列表响应中的单个对象相同,但包裹在分页格式中)。

Error Handling

错误处理

Common Issues:
  1. Org not connected
    • Message: "Org not connected"
    • Solution: Ask user to authenticate via SF CLI
  2. DLO not found
    • Message: "DLO 'XYZ__dll' not found"
    • Solution: List all DLOs first to verify name
  3. DMO not found
    • Message: "DMO 'XYZ__dlm' not found"
    • Solution: List all DMOs first to verify name
  4. Permission issues
    • Message: HTTP 403 errors
    • Solution: Verify user has Data Cloud permissions
  5. API version mismatch
    • Current: v64.0
    • Solution: Script can be updated for newer API versions
常见问题:
  1. 组织未连接
    • 提示信息:"Org not connected"
    • 解决方案:请用户通过SF CLI完成身份验证
  2. DLO未找到
    • 提示信息:"DLO 'XYZ__dll' not found"
    • 解决方案:先列出所有DLO以验证名称
  3. DMO未找到
    • 提示信息:"DMO 'XYZ__dlm' not found"
    • 解决方案:先列出所有DMO以验证名称
  4. 权限问题
    • 提示信息:HTTP 403错误
    • 解决方案:验证用户是否拥有Data Cloud权限
  5. API版本不匹配
    • 当前版本:v64.0
    • 解决方案:可更新脚本以适配更高版本的API

Example Usage

示例用法

Example 1: List all DLOs
text
User: "Show me all DLOs in afvibe org"

Response:
1. Run sf org list to discover connected org alias
2. Authenticate to afvibe
3. Run: python3 ./scripts/get_dlo_schema.py afvibe
4. Display formatted list of DLOs
Example 2: Get specific DLO schema
text
User: "Get the schema for Employee__dll in afvibe"

Response:
1. Run sf org list to discover connected org alias
2. Authenticate to afvibe
3. Run: python3 ./scripts/get_dlo_schema.py afvibe Employee__dll
4. Display field schema with types and metadata
Example 3: Explore DLOs then get schema
text
User: "What DLOs exist in myorg and show me the schema for the Employee one"

Response:
1. Run sf org list to discover connected org alias
2. List all DLOs in myorg
3. Identify Employee__dll
4. Get detailed schema for Employee__dll
5. Present both results
Example 4: List all DMOs
text
User: "Show me all DMOs in afvibe org"

Response:
1. Run sf org list to discover connected org alias
2. Authenticate to afvibe
3. Run: python3 ./scripts/get_dmo_schema.py afvibe
4. Display formatted list of DMOs
Example 5: Get specific DMO schema
text
User: "Get the schema for Individual__dlm in afvibe"

Response:
1. Run sf org list to discover connected org alias
2. Authenticate to afvibe
3. Run: python3 ./scripts/get_dmo_schema.py afvibe Individual__dlm
4. Display field schema with types and metadata
Example 6: Explore DMOs then get schema
text
User: "What DMOs exist in myorg and show me the schema for the Individual one"

Response:
1. Run sf org list to discover connected org alias
2. List all DMOs in myorg
3. Identify Individual__dlm
4. Get detailed schema for Individual__dlm
5. Present both results
示例1:列出所有DLO
text
用户:"显示afvibe组织中的所有DLO"

响应:
1. 运行sf org list发现已连接的组织别名
2. 完成afvibe组织的身份验证
3. 运行:python3 ./scripts/get_dlo_schema.py afvibe
4. 展示格式化的DLO列表
示例2:获取特定DLO的架构
text
用户:"获取afvibe组织中Employee__dll的架构"

响应:
1. 运行sf org list发现已连接的组织别名
2. 完成afvibe组织的身份验证
3. 运行:python3 ./scripts/get_dlo_schema.py afvibe Employee__dll
4. 展示包含类型和元数据的字段架构
示例3:先探索DLO再获取架构
text
用户:"myorg组织中有哪些DLO?请展示Employee相关的架构"

响应:
1. 运行sf org list发现已连接的组织别名
2. 列出myorg组织中的所有DLO
3. 定位到Employee__dll
4. 获取Employee__dll的详细架构
5. 展示上述两项结果
示例4:列出所有DMO
text
用户:"显示afvibe组织中的所有DMO"

响应:
1. 运行sf org list发现已连接的组织别名
2. 完成afvibe组织的身份验证
3. 运行:python3 ./scripts/get_dmo_schema.py afvibe
4. 展示格式化的DMO列表
示例5:获取特定DMO的架构
text
用户:"获取afvibe组织中Individual__dlm的架构"

响应:
1. 运行sf org list发现已连接的组织别名
2. 完成afvibe组织的身份验证
3. 运行:python3 ./scripts/get_dmo_schema.py afvibe Individual__dlm
4. 展示包含类型和元数据的字段架构
示例6:先探索DMO再获取架构
text
用户:"myorg组织中有哪些DMO?请展示Individual相关的架构"

响应:
1. 运行sf org list发现已连接的组织别名
2. 列出myorg组织中的所有DMO
3. 定位到Individual__dlm
4. 获取Individual__dlm的详细架构
5. 展示上述两项结果

Output Format

输出格式

DLO List Output

DLO列表输出

text
Found 5 DLOs in org 'afvibe':

1. DataCustomCodeLogs__dll
   Label: DataCustomCodeLogs
   Category: Engagement
   Records: 233

2. Employee__dll
   Label: Employee
   Category: Profile
   Records: 12

[...]
text
在组织'afvibe'中找到5个DLO:

1. DataCustomCodeLogs__dll
   标签:DataCustomCodeLogs
   类别:Engagement
   记录数:233

2. Employee__dll
   标签:Employee
   类别:Profile
   记录数:12

[...]

DLO Schema Output

DLO架构输出

yaml
DLO: Employee__dll
Label: Employee
Category: Profile
Status: ACTIVE
Records: 12

Custom Fields:
  • id__c (Text) - Primary Key
  • name__c (Text)
  • position__c (Text)
  • manager_id__c (Number)

System Fields:
  • DataSource__c (Text)
  • InternalOrganization__c (Text)
  • cdp_sys_SourceVersion__c (Text)

Next steps:
- Query data: SELECT * FROM Employee__dll LIMIT 10
- Create segment based on position field
- Set up data stream for real-time updates
yaml
DLO: Employee__dll
标签: Employee
类别: Profile
状态: ACTIVE
记录数: 12

自定义字段:
  • id__c (文本) - 主键
  • name__c (文本)
  • position__c (文本)
  • manager_id__c (数字)

系统字段:
  • DataSource__c (文本)
  • InternalOrganization__c (文本)
  • cdp_sys_SourceVersion__c (文本)

后续操作建议:
- 查询数据: SELECT * FROM Employee__dll LIMIT 10
- 基于position字段创建细分群体
- 设置数据流以实现实时更新

DMO List Output

DMO列表输出

text
Found 10 DMOs in org 'afvibe':

1. Individual__dlm
   Label: Individual
   Category: Profile

2. ContactPointEmail__dlm
   Label: Contact Point Email
   Category: Profile

[...]
text
在组织'afvibe'中找到10个DMO:

1. Individual__dlm
   标签:Individual
   类别:Profile

2. ContactPointEmail__dlm
   标签:Contact Point Email
   类别:Profile

[...]

DMO Schema Output

DMO架构输出

yaml
DMO: Individual__dlm
Label: Individual
Category: Profile
Description: Represents an individual person

Fields:
  • Id__c (Text) - Primary Key
  • FirstName__c (Text)
  • LastName__c (Text)
  • BirthDate__c (DateTime)

Next steps:
- Query data: SELECT * FROM Individual__dlm LIMIT 10
- View DLO mappings to this DMO
- Create calculated insights
yaml
DMO: Individual__dlm
标签: Individual
类别: Profile
描述: 代表独立个人

字段:
  • Id__c (文本) - 主键
  • FirstName__c (文本)
  • LastName__c (文本)
  • BirthDate__c (日期时间)

后续操作建议:
- 查询数据: SELECT * FROM Individual__dlm LIMIT 10
- 查看与此DMO关联的DLO映射
- 创建计算洞察

Notes

注意事项

  • DLO names always end with
    __dll
    suffix
  • DMO names always end with
    __dlm
    suffix
  • Field names always end with
    __c
    suffix
  • System fields (DataSource__c, KQ_, cdp_sys_) are automatically added
  • Primary key fields are required for DLO and DMO queries
  • API supports pagination (limit/offset) for large result sets
  • DLO名称始终以
    __dll
    后缀结尾
  • DMO名称始终以
    __dlm
    后缀结尾
  • 字段名称始终以
    __c
    后缀结尾
  • 系统字段(DataSource__c、KQ_、cdp_sys_)会自动添加
  • 主键字段是DLO和DMO查询的必填项
  • API支持对大型结果集进行分页(limit/offset参数)

Related Skills

相关技能

  • datakit_workflow: For DMO mapping operations
  • datakit_validation: For validating datakit configurations
  • Use this skill before creating DMO mappings to understand source DLO structure
  • datakit_workflow:用于DMO映射操作
  • datakit_validation:用于验证datakit配置
  • 在创建DMO映射前使用此技能,以了解源DLO的结构