Method | Request URI |
---|---|
POST | /API/DataCube/Warehouse/{id}/?sessionId=value |
URI Parameter | Description |
---|---|
sessionId | Current session ID. |
Path Parameter | Description |
---|---|
id | The ID of the data cube to build the warehouse on. |
This example will login and build a data warehouse for a Data Cube with the ID = c869a262-0493-4b7c-8c0d-661622e12f76.
using System.Net; using System.Net.Http; using System.Runtime.Serialization; using System.Runtime.Serialization.Json; using System.Web.Script.Serialization; ... using (HttpClient httpClient = new HttpClient()) { // Get Session Id string logonUri = "http://localhost:8004/Api/LogOn/"; var logonOptions = new { accountName = "admin", password = "1234", cultureName = string.Empty, deleteOtherSessions = true, isWindowsLogOn = false }; JavaScriptSerializer serializer = new JavaScriptSerializer(); var requestBodyAsString = serializer.Serialize(logonOptions); StringContent content = new StringContent( requestBodyAsString, Encoding.UTF8, "application/json" ); string jsonString = string.Empty; using (var response = httpClient.PostAsync(logonUri, content).Result) { jsonString = response.Content.ReadAsStringAsync().Result; } var obj = (Dictionary<string,object>) serializer.DeserializeObject(jsonString); string sessionId = obj["sessionId"].ToString(); string url = "http://localhost:8004/API/DataCube/Warehouse/{id}/?sessionId=" + sessionId + ""; // Define the request body HttpContent requestBody = null; requestBody = new StringContent(@" { } ",Encoding.UTF8,"application/json"); using (var response = httpClient.PostAsync(url, requestBody).Result) { if(response.StatusCode == HttpStatusCode.OK) { Console.WriteLine("Success"); // Error code indication of success or // reason of failure. string jsonObject = response.Content.ReadAsStringAsync().Result; } } }
import org.apache.http.HttpResponse; import org.apache.http.client.HttpClient; import org.apache.http.client.methods.HttpPost; import org.apache.http.client.methods.HttpDelete; import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpPut; import org.apache.http.impl.client.HttpClientBuilder; import org.apache.http.util.EntityUtils; import org.apache.http.entity.StringEntity; import org.json.JSONObject; ... HttpClient httpClient = HttpClientBuilder.create().build(); String url = "http://localhost:8004"; // Get Session Id String logonUri = url + "Api/LogOn/" HttpPost httpPost = new HttpPost(logonUri); StringEntity stringEntity = new StringEntity("{ + "\"accountName\":\"admin\"," + "\"password":\"1234\"," + "\"cultureName\":\"\"," + "\"deleteOtherSessions\":false," + "\"isWindowsLogOn\":false" + "}" ); stringEntity.setContentType("application/json"); httpPost.setEntity(stringEntity); HttpResponse httpResponse = httpClient.execute(httpPost); String jsonString = EntityUtils.toString(httpResponse.getEntity()); JSONObject jsonObj = new JSONObject(jsonString); String sessionId = jsonObj.getString("sessionId") String requestUrl = "http://localhost:8004/API/DataCube/Warehouse/{id}/?sessionId=" + sessionId + ""; // Define the Request Method. HttpPost requstMethod = new HttpPost(requestUrl); // Define the Request Body. StringEntity input = new StringEntity( "{" + " " + "}" ); input.setContentType("application/json"); requstMethod.setEntity(input); HttpResponse response = httpClient.execute(requstMethod); if(response.getStatusLine().getStatusCode() == 200) { System.out.println("Success"); } // Error code indication of success or // reason of failure. String json = EntityUtils.toString(response.getEntity());
var baseUrl = 'http://localhost:8005'; var logonOptions = { accountName: 'admin', password: '1234', cultureName: 'en-us', deleteOtherSessions: false, isWindowsLogOn: false }; $.ajax({ type: 'POST', url: baseUrl + '/Api/LogOn/', data: logonOptions, success: function(logOnResultData) { var sessionId = logOnResultData.sessionId; var dataObject = { }; $.ajax({ type: "POST", url: baseUrl + "/API/DataCube/Warehouse/{id}/?sessionId=" + sessionId + "", data: dataObject, success: function(data) { // data = Error code indication of success // or reason of failure. }, error: function(data) { alert('failed' + data); } }); } });
This example will login and schedule a data warehouse to be built daily for a Data Cube with the ID = c869a262-0493-4b7c-8c0d-661622e12f76.
using System.Net; using System.Net.Http; using System.Runtime.Serialization; using System.Runtime.Serialization.Json; using System.Web.Script.Serialization; ... using (HttpClient httpClient = new HttpClient()) { // Get Session Id string logonUri = "http://localhost:8004/Api/LogOn/"; var logonOptions = new { accountName = "admin", password = "1234", cultureName = string.Empty, deleteOtherSessions = true, isWindowsLogOn = false }; JavaScriptSerializer serializer = new JavaScriptSerializer(); var requestBodyAsString = serializer.Serialize(logonOptions); StringContent content = new StringContent( requestBodyAsString, Encoding.UTF8, "application/json" ); string jsonString = string.Empty; using (var response = httpClient.PostAsync(logonUri, content).Result) { jsonString = response.Content.ReadAsStringAsync().Result; } var obj = (Dictionary<string,object>) serializer.DeserializeObject(jsonString); string sessionId = obj["sessionId"].ToString(); string url = "http://localhost:8004/API/DataCube/Warehouse/{id}/?sessionId=" + sessionId + ""; // Define the request body HttpContent requestBody = null; requestBody = new StringContent(@" { ""scheduleRule"": { ""endPolicy"": ""None"", ""patternType"": ""Daily"", ""dailyPatternInterval"": 1, ""weeklyPatternInterval"": null, ""dayOfMonth"": null, ""specificDaysOfWeek"": [ ], ""monthlyPatternKind"": ""Day"", ""nthSpecificDayOfMonth"": ""First"", ""dayOfWeek"": ""Sunday"", ""specificMonths"": [ ], ""recurrenceIntervalKind"": ""NotSet"", ""occurrences"": [ ], ""__classType"": ""dundas.scheduling.ScheduleRule"", ""startTime"": ""2016-03-03T17:58:32.000Z"", ""recurrenceStartTime"": ""2016-03-03T17:58:41.344Z"", ""recurrenceEndTime"": ""2016-03-03T17:58:41.344Z"" }, ""isInMemoryCube"": false } ",Encoding.UTF8,"application/json"); using (var response = httpClient.PostAsync(url, requestBody).Result) { if(response.StatusCode == HttpStatusCode.OK) { Console.WriteLine("Success"); // Error code indication of success or // reason of failure. string jsonObject = response.Content.ReadAsStringAsync().Result; } } }
import org.apache.http.HttpResponse; import org.apache.http.client.HttpClient; import org.apache.http.client.methods.HttpPost; import org.apache.http.client.methods.HttpDelete; import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpPut; import org.apache.http.impl.client.HttpClientBuilder; import org.apache.http.util.EntityUtils; import org.apache.http.entity.StringEntity; import org.json.JSONObject; ... HttpClient httpClient = HttpClientBuilder.create().build(); String url = "http://localhost:8004"; // Get Session Id String logonUri = url + "Api/LogOn/" HttpPost httpPost = new HttpPost(logonUri); StringEntity stringEntity = new StringEntity("{ + "\"accountName\":\"admin\"," + "\"password":\"1234\"," + "\"cultureName\":\"\"," + "\"deleteOtherSessions\":false," + "\"isWindowsLogOn\":false" + "}" ); stringEntity.setContentType("application/json"); httpPost.setEntity(stringEntity); HttpResponse httpResponse = httpClient.execute(httpPost); String jsonString = EntityUtils.toString(httpResponse.getEntity()); JSONObject jsonObj = new JSONObject(jsonString); String sessionId = jsonObj.getString("sessionId") String requestUrl = "http://localhost:8004/API/DataCube/Warehouse/{id}/?sessionId=" + sessionId + ""; // Define the Request Method. HttpPost requstMethod = new HttpPost(requestUrl); // Define the Request Body. StringEntity input = new StringEntity( "{" + "\"scheduleRule\": {" + " \"endPolicy\": \"None\"," + " \"patternType\": \"Daily\"," + " \"dailyPatternInterval\": 1," + " \"weeklyPatternInterval\": null," + " \"dayOfMonth\": null," + " \"specificDaysOfWeek\": [" + " " + " ]," + " \"monthlyPatternKind\": \"Day\"," + " \"nthSpecificDayOfMonth\": \"First\"," + " \"dayOfWeek\": \"Sunday\"," + " \"specificMonths\": [" + " " + " ]," + " \"recurrenceIntervalKind\": \"NotSet\"," + " \"occurrences\": [" + " " + " ]," + " \"__classType\": \"dundas.scheduling.ScheduleRule\"," + " \"startTime\": \"2016-03-03T17:58:32.000Z\"," + " \"recurrenceStartTime\": \"2016-03-03T17:58:41.344Z\"," + " \"recurrenceEndTime\": \"2016-03-03T17:58:41.344Z\"" + "}," + "\"isInMemoryCube\": false" + "}" ); input.setContentType("application/json"); requstMethod.setEntity(input); HttpResponse response = httpClient.execute(requstMethod); if(response.getStatusLine().getStatusCode() == 200) { System.out.println("Success"); } // Error code indication of success or // reason of failure. String json = EntityUtils.toString(response.getEntity());
var baseUrl = 'http://localhost:8005'; var logonOptions = { accountName: 'admin', password: '1234', cultureName: 'en-us', deleteOtherSessions: false, isWindowsLogOn: false }; $.ajax({ type: 'POST', url: baseUrl + '/Api/LogOn/', data: logonOptions, success: function(logOnResultData) { var sessionId = logOnResultData.sessionId; var dataObject = { "scheduleRule": { "endPolicy": "None", "patternType": "Daily", "dailyPatternInterval": 1, "weeklyPatternInterval": null, "dayOfMonth": null, "specificDaysOfWeek": [ ], "monthlyPatternKind": "Day", "nthSpecificDayOfMonth": "First", "dayOfWeek": "Sunday", "specificMonths": [ ], "recurrenceIntervalKind": "NotSet", "occurrences": [ ], "__classType": "dundas.scheduling.ScheduleRule", "startTime": "2016-03-03T17:58:32.000Z", "recurrenceStartTime": "2016-03-03T17:58:41.344Z", "recurrenceEndTime": "2016-03-03T17:58:41.344Z" }, "isInMemoryCube": false }; $.ajax({ type: "POST", url: baseUrl + "/API/DataCube/Warehouse/{id}/?sessionId=" + sessionId + "", data: dataObject, success: function(data) { // data = Error code indication of success // or reason of failure. }, error: function(data) { alert('failed' + data); } }); } });
This example will login and build an in memory Data Cube, for the Data Cube with the ID = f99436bd-82cb-4733-a906-09b1ed8764c1.
using System.Net; using System.Net.Http; using System.Runtime.Serialization; using System.Runtime.Serialization.Json; using System.Web.Script.Serialization; ... using (HttpClient httpClient = new HttpClient()) { // Get Session Id string logonUri = "http://localhost:8004/Api/LogOn/"; var logonOptions = new { accountName = "admin", password = "1234", cultureName = string.Empty, deleteOtherSessions = true, isWindowsLogOn = false }; JavaScriptSerializer serializer = new JavaScriptSerializer(); var requestBodyAsString = serializer.Serialize(logonOptions); StringContent content = new StringContent( requestBodyAsString, Encoding.UTF8, "application/json" ); string jsonString = string.Empty; using (var response = httpClient.PostAsync(logonUri, content).Result) { jsonString = response.Content.ReadAsStringAsync().Result; } var obj = (Dictionary<string,object>) serializer.DeserializeObject(jsonString); string sessionId = obj["sessionId"].ToString(); string url = "http://localhost:8004/API/DataCube/Warehouse/{id}/?sessionId=" + sessionId + ""; // Define the request body HttpContent requestBody = null; requestBody = new StringContent(@" { ""isInMemoryCube"": true } ",Encoding.UTF8,"application/json"); using (var response = httpClient.PostAsync(url, requestBody).Result) { if(response.StatusCode == HttpStatusCode.OK) { Console.WriteLine("Success"); // Error code indication of success or // reason of failure. string jsonObject = response.Content.ReadAsStringAsync().Result; } } }
import org.apache.http.HttpResponse; import org.apache.http.client.HttpClient; import org.apache.http.client.methods.HttpPost; import org.apache.http.client.methods.HttpDelete; import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpPut; import org.apache.http.impl.client.HttpClientBuilder; import org.apache.http.util.EntityUtils; import org.apache.http.entity.StringEntity; import org.json.JSONObject; ... HttpClient httpClient = HttpClientBuilder.create().build(); String url = "http://localhost:8004"; // Get Session Id String logonUri = url + "Api/LogOn/" HttpPost httpPost = new HttpPost(logonUri); StringEntity stringEntity = new StringEntity("{ + "\"accountName\":\"admin\"," + "\"password":\"1234\"," + "\"cultureName\":\"\"," + "\"deleteOtherSessions\":false," + "\"isWindowsLogOn\":false" + "}" ); stringEntity.setContentType("application/json"); httpPost.setEntity(stringEntity); HttpResponse httpResponse = httpClient.execute(httpPost); String jsonString = EntityUtils.toString(httpResponse.getEntity()); JSONObject jsonObj = new JSONObject(jsonString); String sessionId = jsonObj.getString("sessionId") String requestUrl = "http://localhost:8004/API/DataCube/Warehouse/{id}/?sessionId=" + sessionId + ""; // Define the Request Method. HttpPost requstMethod = new HttpPost(requestUrl); // Define the Request Body. StringEntity input = new StringEntity( "{" + "\"isInMemoryCube\": true" + "}" ); input.setContentType("application/json"); requstMethod.setEntity(input); HttpResponse response = httpClient.execute(requstMethod); if(response.getStatusLine().getStatusCode() == 200) { System.out.println("Success"); } // Error code indication of success or // reason of failure. String json = EntityUtils.toString(response.getEntity());
var baseUrl = 'http://localhost:8005'; var logonOptions = { accountName: 'admin', password: '1234', cultureName: 'en-us', deleteOtherSessions: false, isWindowsLogOn: false }; $.ajax({ type: 'POST', url: baseUrl + '/Api/LogOn/', data: logonOptions, success: function(logOnResultData) { var sessionId = logOnResultData.sessionId; var dataObject = { "isInMemoryCube": true }; $.ajax({ type: "POST", url: baseUrl + "/API/DataCube/Warehouse/{id}/?sessionId=" + sessionId + "", data: dataObject, success: function(data) { // data = Error code indication of success // or reason of failure. }, error: function(data) { alert('failed' + data); } }); } });