Skip to content

Latest commit

 

History

History
426 lines (305 loc) · 12.5 KB

DatasourcesApi.md

File metadata and controls

426 lines (305 loc) · 12.5 KB

DatasourcesApi

All URIs are relative to https://api.powerbi.com

Method HTTP request Description
addDatasourceUser POST /v1.0/myorg/gateways/{gatewayId}/datasources/{datasourceId}/users Get a datasource user
createDatasource POST /v1.0/myorg/gateways/{gatewayId}/datasources Create a datasource
deleteDatasource DELETE /v1.0/myorg/gateways/{gatewayId}/datasources/{datasourceId} Delete a datasource
deleteDatasourceUser DELETE /v1.0/myorg/gateways/{gatewayId}/datasources/{datasourceId}/users/{emailAdress} Delete a datasource user
getDatasourceById GET /v1.0/myorg/gateways/{gatewayId}/datasources/{datasourceId} Get a datasource by id
getDatasourceStatusById GET /v1.0/myorg/gateways/{gatewayId}/datasources/{datasourceId}/status Get a datasource status by id
getDatasourceUsers GET /v1.0/myorg/gateways/{gatewayId}/datasources/{datasourceId}/users Get a datasource users list
getDatasources GET /v1.0/myorg/gateways/{gatewayId}/datasources Get all datasources of specific gateway
updateDatasource PATCH /v1.0/myorg/gateways/{gatewayId}/datasources/{datasourceId} Update a datasource credentials

addDatasourceUser

Object addDatasourceUser(gatewayId, datasourceId, addUserToDatasourceRequest)

Get a datasource user

Example

// Import classes:
//import com.microsoft.powerbi.ApiException;
//import com.microsoft.powerbi.api.DatasourcesApi;


DatasourcesApi apiInstance = new DatasourcesApi();
String gatewayId = "gatewayId_example"; // String | The gateway id
String datasourceId = "datasourceId_example"; // String | The datasource id
UserAccessRight addUserToDatasourceRequest = new UserAccessRight(); // UserAccessRight | The add user to datasource request
try {
    Object result = apiInstance.addDatasourceUser(gatewayId, datasourceId, addUserToDatasourceRequest);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling DatasourcesApi#addDatasourceUser");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
gatewayId String The gateway id
datasourceId String The datasource id
addUserToDatasourceRequest UserAccessRight The add user to datasource request

Return type

Object

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: Not defined

createDatasource

GatewayDatasource createDatasource(gatewayId, datasourceToGatewayRequest)

Create a datasource

Example

// Import classes:
//import com.microsoft.powerbi.ApiException;
//import com.microsoft.powerbi.api.DatasourcesApi;


DatasourcesApi apiInstance = new DatasourcesApi();
String gatewayId = "gatewayId_example"; // String | The gateway id
PublishDatasourceToGatewayRequest datasourceToGatewayRequest = new PublishDatasourceToGatewayRequest(); // PublishDatasourceToGatewayRequest | The datasource requested to create
try {
    GatewayDatasource result = apiInstance.createDatasource(gatewayId, datasourceToGatewayRequest);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling DatasourcesApi#createDatasource");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
gatewayId String The gateway id
datasourceToGatewayRequest PublishDatasourceToGatewayRequest The datasource requested to create

Return type

GatewayDatasource

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

deleteDatasource

Object deleteDatasource(gatewayId, datasourceId)

Delete a datasource

Example

// Import classes:
//import com.microsoft.powerbi.ApiException;
//import com.microsoft.powerbi.api.DatasourcesApi;


DatasourcesApi apiInstance = new DatasourcesApi();
String gatewayId = "gatewayId_example"; // String | The gateway id
String datasourceId = "datasourceId_example"; // String | The datasource id
try {
    Object result = apiInstance.deleteDatasource(gatewayId, datasourceId);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling DatasourcesApi#deleteDatasource");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
gatewayId String The gateway id
datasourceId String The datasource id

Return type

Object

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

deleteDatasourceUser

Object deleteDatasourceUser(gatewayId, datasourceId, emailAdress)

Delete a datasource user

Example

// Import classes:
//import com.microsoft.powerbi.ApiException;
//import com.microsoft.powerbi.api.DatasourcesApi;


DatasourcesApi apiInstance = new DatasourcesApi();
String gatewayId = "gatewayId_example"; // String | The gateway id
String datasourceId = "datasourceId_example"; // String | The datasource id
String emailAdress = "emailAdress_example"; // String | The user's email address
try {
    Object result = apiInstance.deleteDatasourceUser(gatewayId, datasourceId, emailAdress);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling DatasourcesApi#deleteDatasourceUser");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
gatewayId String The gateway id
datasourceId String The datasource id
emailAdress String The user's email address

Return type

Object

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: Not defined

getDatasourceById

GatewayDatasource getDatasourceById(gatewayId, datasourceId)

Get a datasource by id

Example

// Import classes:
//import com.microsoft.powerbi.ApiException;
//import com.microsoft.powerbi.api.DatasourcesApi;


DatasourcesApi apiInstance = new DatasourcesApi();
String gatewayId = "gatewayId_example"; // String | The gateway id
String datasourceId = "datasourceId_example"; // String | The datasource id
try {
    GatewayDatasource result = apiInstance.getDatasourceById(gatewayId, datasourceId);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling DatasourcesApi#getDatasourceById");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
gatewayId String The gateway id
datasourceId String The datasource id

Return type

GatewayDatasource

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getDatasourceStatusById

Object getDatasourceStatusById(gatewayId, datasourceId)

Get a datasource status by id

Example

// Import classes:
//import com.microsoft.powerbi.ApiException;
//import com.microsoft.powerbi.api.DatasourcesApi;


DatasourcesApi apiInstance = new DatasourcesApi();
String gatewayId = "gatewayId_example"; // String | The gateway id
String datasourceId = "datasourceId_example"; // String | The datasource id
try {
    Object result = apiInstance.getDatasourceStatusById(gatewayId, datasourceId);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling DatasourcesApi#getDatasourceStatusById");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
gatewayId String The gateway id
datasourceId String The datasource id

Return type

Object

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getDatasourceUsers

ODataResponseListUserAccessRight getDatasourceUsers(gatewayId, datasourceId)

Get a datasource users list

Example

// Import classes:
//import com.microsoft.powerbi.ApiException;
//import com.microsoft.powerbi.api.DatasourcesApi;


DatasourcesApi apiInstance = new DatasourcesApi();
String gatewayId = "gatewayId_example"; // String | The gateway id
String datasourceId = "datasourceId_example"; // String | The datasource id
try {
    ODataResponseListUserAccessRight result = apiInstance.getDatasourceUsers(gatewayId, datasourceId);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling DatasourcesApi#getDatasourceUsers");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
gatewayId String The gateway id
datasourceId String The datasource id

Return type

ODataResponseListUserAccessRight

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getDatasources

ODataResponseListGatewayDatasource getDatasources(gatewayId)

Get all datasources of specific gateway

Example

// Import classes:
//import com.microsoft.powerbi.ApiException;
//import com.microsoft.powerbi.api.DatasourcesApi;


DatasourcesApi apiInstance = new DatasourcesApi();
String gatewayId = "gatewayId_example"; // String | The gateway id
try {
    ODataResponseListGatewayDatasource result = apiInstance.getDatasources(gatewayId);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling DatasourcesApi#getDatasources");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
gatewayId String The gateway id

Return type

ODataResponseListGatewayDatasource

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

updateDatasource

Object updateDatasource(gatewayId, datasourceId, updateDatasourceRequest)

Update a datasource credentials

Example

// Import classes:
//import com.microsoft.powerbi.ApiException;
//import com.microsoft.powerbi.api.DatasourcesApi;


DatasourcesApi apiInstance = new DatasourcesApi();
String gatewayId = "gatewayId_example"; // String | The gateway id
String datasourceId = "datasourceId_example"; // String | The datasource id
UpdateDatasourceRequest updateDatasourceRequest = new UpdateDatasourceRequest(); // UpdateDatasourceRequest | The update datasource request
try {
    Object result = apiInstance.updateDatasource(gatewayId, datasourceId, updateDatasourceRequest);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling DatasourcesApi#updateDatasource");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
gatewayId String The gateway id
datasourceId String The datasource id
updateDatasourceRequest UpdateDatasourceRequest The update datasource request

Return type

Object

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined