Update Global Datasource

put

/essbase/rest/v1/datasources/{datasourceName}

Update the named global-level Datasource. If the update is successful, returns details about the updated Datasource. type and connection are required inputs for all types of Datasources. Other required inputs differ based on the type of the Datasource.

Request

Supported Media Types
Path Parameters
Body ()

Updated Datasource details.

Root Schema : datasource
Type: object
Show Source
Nested Schema : ColumnsType
Type: object
Show Source
Nested Schema : headers
Type: array
Show Source
Nested Schema : queryParameters
Type: array

Parameter implementation details, if the Datasource query is parameterized. For example, if the query includes a ? placeholder for passing a parameter, as in the following query: select * from profit_data where year=?, then you need define the implementation details.

Show Source
Nested Schema : widths
Type: array
Show Source
Nested Schema : Column
Type: array
Show Source
Nested Schema : ColumnType
Type: object
Show Source
Nested Schema : HeaderType
Type: object
Show Source
Nested Schema : QueryParamsInfo
Type: object
Show Source
  • A fixed, default parameter value that the Datasource should use as a fallback in case the parameter has an invalid context at runtime. Example: Jan. Required only if the Datasource query is parameterized (it includes a ? placeholder for passing a parameter) AND the placeholder is not intended to reference a substitution variable nor a user-defined function developed in the external source.

  • Ordinal index of the Datasource query parameter. For example, 1 for the first parameter, 2 for the second parameter, etc.

  • Optional name for the Datasource query parameter, meaningful for your use case. For example, instead of Param1 you can use param_G_month to indicate that the parameter uses a global variable for the current month, or you can rename it to param_appName_month to indicate that the parameter uses an application-level variable for the current month.

  • true if the Datasource query parameter is required, or false otherwise.

  • If useSubVariable is true, the name of an Essbase substitution variable.

  • Allowed Values: [ "STRING", "DOUBLE", "DATE", "TIMESTAMP", "LONG" ]

    Datatype of the Datasource query parameter.

  • true if the Datasource query parameter references an Essbase substitution variable, or false otherwise.

Back to Top

Response

Supported Media Types

200 Response

OK

Datasource was updated successfully.

Body ()
Root Schema : datasource
Type: object
Show Source
Nested Schema : ColumnsType
Type: object
Show Source
Nested Schema : headers
Type: array
Show Source
Nested Schema : queryParameters
Type: array

Parameter implementation details, if the Datasource query is parameterized. For example, if the query includes a ? placeholder for passing a parameter, as in the following query: select * from profit_data where year=?, then you need define the implementation details.

Show Source
Nested Schema : widths
Type: array
Show Source
Nested Schema : Column
Type: array
Show Source
Nested Schema : ColumnType
Type: object
Show Source
Nested Schema : HeaderType
Type: object
Show Source
Nested Schema : QueryParamsInfo
Type: object
Show Source
  • A fixed, default parameter value that the Datasource should use as a fallback in case the parameter has an invalid context at runtime. Example: Jan. Required only if the Datasource query is parameterized (it includes a ? placeholder for passing a parameter) AND the placeholder is not intended to reference a substitution variable nor a user-defined function developed in the external source.

  • Ordinal index of the Datasource query parameter. For example, 1 for the first parameter, 2 for the second parameter, etc.

  • Optional name for the Datasource query parameter, meaningful for your use case. For example, instead of Param1 you can use param_G_month to indicate that the parameter uses a global variable for the current month, or you can rename it to param_appName_month to indicate that the parameter uses an application-level variable for the current month.

  • true if the Datasource query parameter is required, or false otherwise.

  • If useSubVariable is true, the name of an Essbase substitution variable.

  • Allowed Values: [ "STRING", "DOUBLE", "DATE", "TIMESTAMP", "LONG" ]

    Datatype of the Datasource query parameter.

  • true if the Datasource query parameter references an Essbase substitution variable, or false otherwise.

400 Response

Bad Request

Failed to update the Datasource.

Back to Top

Examples

The following example shows how to update an existing global Datasource.

This example uses cURL to access the REST API from a Windows shell script. The calling user's ID and password are variables whose values are set in properties.bat.

Script with cURL Command

call properties.bat
curl -X PUT "https://myserver.example.com:9001/essbase/rest/v1/datasources/EssbaseDS?links=none" -H Accept:application/json -H Content-Type:application/json --data "@./updateDSessbase.json" -u %User%:%Password%

The cURL example above delivers a JSON payload in updateDSessbase.json. The details you need to include in the payload depend on what type of Datasource you are updating. The example below is for updating an Essbase Datasource.

Sample JSON Payload - Essbase Datasource

The following sample JSON payload, passed to REST API in updateDSessbase.json, is an example for updating a Datasource for another Essbase cube. The required parameters are The required parameters are name, connection, type, columns, application, cube, and query.

{
  "name":"EssbaseDS",
  "type":"ESSBASE",
  "connection":"essconn",
  "columns":{
    "Column":[
      {
        "index":1,
        "name":"Measures",
        "type":"STRING"
      },
      {
        "index":2,
        "name":"Oregon",
        "type":"STRING"
      },
      {
        "index":3,
        "name":"California",
        "type":"STRING"
      },
      {
        "index":4,
        "name":"Utah",
        "type":"STRING"
      }]
  },
  "query":"select {COGS} on rows ,{Oregon, California, Utah} on columns",
  "application":"Sample",
  "cube":"Basic"
}

For more examples of JSON payloads you can use to test, update, and create Datasources for sources supported by Essbase, see the Create Datasource endpoint.

Example of Response Body - Essbase Datasource

The following example shows the contents of the response body in JSON format.

{
  "name" : "EssbaseDS",
  "connection" : "essconn",
  "type" : "ESSBASE",
  "columns" : {
    "Column" : [ {
      "name" : "Measures",
      "type" : "STRING",
      "index" : 1,
      "system" : false
    }, {
      "name" : "Oregon",
      "type" : "STRING",
      "index" : 2,
      "system" : false
    }, {
      "name" : "California",
      "type" : "STRING",
      "index" : 3,
      "system" : false
    }, {
      "name" : "Utah",
      "type" : "STRING",
      "index" : 4,
      "system" : false
    } ]
  },
  "query" : "select {COGS} on rows ,{Oregon, California, Utah} on columns",
  "application" : "Sample",
  "cube" : "Basic",
  "queryParameters" : [ ],
  "links" : [ ]
}
Back to Top