Compartilhar via


Datasets - Get Datasources

Retorna uma lista de fontes de dados para o conjunto de dados especificado do Meu workspace.

Escopo necessário

Dataset.ReadWrite.All ou Dataset.Read.All

GET https://api.powerbi.com/v1.0/myorg/datasets/{datasetId}/datasources

Parâmetros de URI

Nome Em Obrigatório Tipo Description
datasetId
path True

string

A ID do conjunto de dados

Respostas

Nome Tipo Description
200 OK

Datasources

OK

Exemplos

Analysis Services example
Azure Blobs datasource example
Excel example
Extension datasource example
Microsoft Exchange datasource example
OData example
Oracle example
Salesforce datasource example
SAP HANA example
SharePoint example
SQL example

Analysis Services example

Sample Request

GET https://api.powerbi.com/v1.0/myorg/datasets/{datasetId}/datasources

Sample Response

{
  "@odata.context": "http://api.powerbi.com/v1.0/myorg/groups/222f0f33-3abc-4a57-9f98-ff01bd2aaabb/$metadata#datasources",
  "value": [
    {
      "datasourceType": "AnalysisServices",
      "connectionDetails": {
        "server": "My-As-Server",
        "database": "My-As-Database"
      },
      "datasourceId": "33cc5222-3fb9-44f7-b19d-ffbff18aaaf5",
      "gatewayId": "0a2dafe6-0e93-4120-8d2c-fae123c111b1"
    }
  ]
}

Azure Blobs datasource example

Sample Request

GET https://api.powerbi.com/v1.0/myorg/datasets/{datasetId}/datasources

Sample Response

{
  "value": [
    {
      "datasourceType": "AzureBlobs",
      "datasourceId": "e0315274-90b6-4fc0-abf2-2d60d448cb04",
      "gatewayId": "7f1c4e55-544b-403f-b132-da0d3a024674",
      "connectionDetails": {
        "account": "myAccount",
        "domain": "blob.core.windows.net"
      }
    }
  ]
}

Excel example

Sample Request

GET https://api.powerbi.com/v1.0/myorg/datasets/{datasetId}/datasources

Sample Response

{
  "@odata.context": "http://api.powerbi.com/v1.0/myorg/groups/222f0f33-3abc-4a57-9f98-ff01bd2aaabb/$metadata#datasources",
  "value": [
    {
      "datasourceType": "File",
      "connectionDetails": {
        "path": "c:\\users\\username\\documents\\orders1.xlsx"
      },
      "datasourceId": "33cc5222-3fb9-44f7-b19d-ffbff18aaaf5",
      "gatewayId": "0a2dafe6-0e93-4120-8d2c-fae123c111b1"
    }
  ]
}

Extension datasource example

Sample Request

GET https://api.powerbi.com/v1.0/myorg/datasets/{datasetId}/datasources

Sample Response

{
  "value": [
    {
      "datasourceType": "Extension",
      "datasourceId": "70540d95-4c8e-41ae-88c6-27a103b12841",
      "gatewayId": "7f1c4e55-544b-403f-b132-da0d3a024674",
      "connectionDetails": {
        "kind": "AzureDataExplorer",
        "path": "https://myserver.kusto.windows.net"
      }
    }
  ]
}

Microsoft Exchange datasource example

Sample Request

GET https://api.powerbi.com/v1.0/myorg/datasets/{datasetId}/datasources

Sample Response

{
  "value": [
    {
      "datasourceType": "Exchange",
      "datasourceId": "4d126fc8-1568-46aa-ba16-ccf19b18f012",
      "gatewayId": "7f1c4e55-544b-403f-b132-da0d3a024674",
      "connectionDetails": {
        "emailAddress": "john@contoso.com"
      }
    }
  ]
}

OData example

Sample Request

GET https://api.powerbi.com/v1.0/myorg/datasets/{datasetId}/datasources

Sample Response

{
  "@odata.context": "http://api.powerbi.com/v1.0/myorg/groups/222f0f33-3abc-4a57-9f98-ff01bd2aaabb/$metadata#datasources",
  "value": [
    {
      "datasourceType": "OData",
      "connectionDetails": {
        "url": "http://services.odata.org/MyOdata/MyOdata.svc"
      },
      "datasourceId": "33cc5222-3fb9-44f7-b19d-ffbff18aaaf5",
      "gatewayId": "0a2dafe6-0e93-4120-8d2c-fae123c111b1"
    }
  ]
}

Oracle example

Sample Request

GET https://api.powerbi.com/v1.0/myorg/datasets/{datasetId}/datasources

Sample Response

{
  "@odata.context": "http://api.powerbi.com/v1.0/myorg/groups/222f0f33-3abc-4a57-9f98-ff01bd2aaabb/$metadata#datasources",
  "value": [
    {
      "datasourceType": "Oracle",
      "connectionDetails": {
        "server": "My-Oracle-Server",
        "database": "My-Oracle-Database"
      },
      "datasourceId": "33cc5222-3fb9-44f7-b19d-ffbff18aaaf5",
      "gatewayId": "0a2dafe6-0e93-4120-8d2c-fae123c111b1"
    }
  ]
}

Salesforce datasource example

Sample Request

GET https://api.powerbi.com/v1.0/myorg/datasets/{datasetId}/datasources

Sample Response

{
  "value": [
    {
      "datasourceType": "Salesforce",
      "datasourceId": "e8a6e0f5-b244-402a-ba5a-4d578609ede3",
      "gatewayId": "7f1c4e55-544b-403f-b132-da0d3a024674",
      "connectionDetails": {
        "classInfo": "report-detail",
        "loginServer": "https://login.salesforce.com/"
      }
    }
  ]
}

SAP HANA example

Sample Request

GET https://api.powerbi.com/v1.0/myorg/datasets/{datasetId}/datasources

Sample Response

{
  "@odata.context": "http://api.powerbi.com/v1.0/myorg/groups/222f0f33-3abc-4a57-9f98-ff01bd2aaabb/$metadata#datasources",
  "value": [
    {
      "datasourceType": "SAPHana",
      "connectionDetails": {
        "server": "My-SapHana-Server",
        "database": "My-SapHana-Database"
      },
      "datasourceId": "33cc5222-3fb9-44f7-b19d-ffbff18aaaf5",
      "gatewayId": "0a2dafe6-0e93-4120-8d2c-fae123c111b1"
    }
  ]
}

SharePoint example

Sample Request

GET https://api.powerbi.com/v1.0/myorg/datasets/{datasetId}/datasources

Sample Response

{
  "@odata.context": "http://api.powerbi.com/v1.0/myorg/groups/222f0f33-3abc-4a57-9f98-ff01bd2aaabb/$metadata#datasources",
  "value": [
    {
      "datasourceType": "SharePointList",
      "connectionDetails": {
        "url": "https://microsoft.sharepoint.com/hello/myproj/"
      },
      "datasourceId": "33cc5222-3fb9-44f7-b19d-ffbff18aaaf5",
      "gatewayId": "0a2dafe6-0e93-4120-8d2c-fae123c111b1"
    }
  ]
}

SQL example

Sample Request

GET https://api.powerbi.com/v1.0/myorg/datasets/{datasetId}/datasources

Sample Response

{
  "@odata.context": "http://api.powerbi.com/v1.0/myorg/groups/222f0f33-3abc-4a57-9f98-ff01bd2aaabb/$metadata#datasources",
  "value": [
    {
      "datasourceType": "Sql",
      "connectionDetails": {
        "server": "My-As-Server",
        "database": "My-As-Database"
      },
      "datasourceId": "33cc5222-3fb9-44f7-b19d-ffbff18aaaf5",
      "gatewayId": "0a2dafe6-0e93-4120-8d2c-fae123c111b1"
    }
  ]
}

Definições

Nome Description
Datasource

Uma fonte de dados do Power BI

DatasourceConnectionDetails

Os detalhes da conexão da fonte de dados do Power BI. Veja exemplos em Obter Fontes de Dados ou Obter Fontes de Dados em Grupo.

Datasources

O wrapper de resposta OData para uma coleção de fontes de dados do Power BI

Datasource

Uma fonte de dados do Power BI

Nome Tipo Description
connectionDetails

DatasourceConnectionDetails

Os detalhes da conexão da fonte de dados

connectionString

string

(Preterido) A cadeia de conexão da fonte de dados. Disponível somente para DirectQuery.

datasourceId

string

A ID da fonte de dados associada, que está vazia quando não está associada a um gateway

datasourceType

string

O tipo de fonte de dados

gatewayId

string

A ID do gateway associado, que está vazia quando não está associada a um gateway. Ao usar um cluster de gateway, a ID do gateway refere-se ao gateway primário (primeiro) no cluster e é semelhante à ID do cluster de gateway.

name

string

(Preterido) O nome da fonte de dados. Disponível somente para DirectQuery.

DatasourceConnectionDetails

Os detalhes da conexão da fonte de dados do Power BI. Veja exemplos em Obter Fontes de Dados ou Obter Fontes de Dados em Grupo.

Nome Tipo Description
account

string

A conta de conexão

classInfo

string

As informações da classe de conexão

database

string

O banco de dados de conexão

domain

string

O domínio de conexão

emailAddress

string

O endereço de email de conexão

kind

string

O tipo de conexão

loginServer

string

O servidor de logon de conexão

path

string

O caminho da conexão

server

string

O servidor de conexão

url

string

A URL de conexão

Datasources

O wrapper de resposta OData para uma coleção de fontes de dados do Power BI

Nome Tipo Description
odata.context

string

Contexto OData

value

Datasource[]

A coleção de fontes de dados