Assets/Watson/Scripts/Services/RetrieveAndRank/RetrieveAndRank.cs
/// <summary>
/// Provisions a Solr cluster asynchronously. When the operation is successful, the status of the cluster is set to NOT_AVAILABLE. The status must be READY before you can use the cluster. For information about cluster sizing see http://www.ibm.com/watson/developercloud/doc/retrieve-rank/solr_ops.shtml#sizing.
/// </summary>
/// <param name="callback"></param>
/// <param name="clusterName">Name to identify the cluster.</param>
/// <param name="clusterSize">Size of the cluster to create. Ranges from 1 to 7. Send an empty value to create a small free cluster for testing. You can create only one free cluster.</param>
/// <param name="customData"></param>
/// <returns></returns>
Provisions a Solr cluster asynchronously. When the operation is successful, the status of the cluster is set to NOT_AVAILABLE. The status must be READY before you can use the cluster.
Provisions a Solr cluster asynchronously . When the operation is successful the status of the cluster is set to NOT_AVAILABLE . The status must be READY before you can use the cluster .
public bool CreateCluster(OnCreateCluster callback, string clusterName = default(string), string clusterSize = default(string), string customData = default(string))
        {
            if (callback == null)
                throw new ArgumentNullException("callback");
            CreateClusterRequest req = new CreateClusterRequest();
            req.Callback = callback;
            req.Data = customData;
            req.Timeout = REQUEST_TIMEOUT;
            RESTConnector connector = RESTConnector.GetConnector(SERVICE_ID, SERVICE_CLUSTERS);
            if (connector == null)
                return false;
            string reqJson = "";
            if(!string.IsNullOrEmpty(clusterName) && !string.IsNullOrEmpty(clusterSize))
                reqJson = "{\n\t\"cluster_name\": \"" + clusterName + "\",\n\t\"cluster_size\": \"" + clusterSize + "\"\n}";
            req.Headers["Content-Type"] = "application/json";
            req.Headers["Accept"] = "application/json";
            req.Send = Encoding.UTF8.GetBytes(reqJson);
            req.OnResponse = OnCreateClusterResponse;
            return connector.Send(req);
        }
public bool CreateCluster ( OnCreateCluster callback , string clusterName = default ( string ) , string clusterSize = default ( string ) , string customData = default ( string ) ) { if ( callback == null ) throw new ArgumentNullException ( " " ) ; CreateClusterRequest req = new CreateClusterRequest ( ) ; req . Callback = callback ; req . Data = customData ; req . Timeout = REQUEST_TIMEOUT ; RESTConnector connector = RESTConnector . GetConnector ( SERVICE_ID , SERVICE_CLUSTERS ) ; if ( connector == null ) return false ; string reqJson = " " ; if ( ! string . IsNullOrEmpty ( clusterName ) && ! string . IsNullOrEmpty ( clusterSize ) ) reqJson = " \n \t \" \" \" " + clusterName + " \" \n \t \" \" \" " + clusterSize + " \" \n " ; req . Headers [ " " ] = " " ; req . Headers [ " " ] = " " ; req . Send = Encoding . UTF8 . GetBytes ( reqJson ) ; req . OnResponse = OnCreateClusterResponse ; return connector . Send ( req ) ; }
Provisions a Solr cluster asynchronously.
Provisions a Solr cluster asynchronously .
None
callback
OnCreateCluster
None
clusterName
string
Name to identify the cluster.
Name to identify the cluster .
clusterSize
string
Size of the cluster to create. Ranges from 1 to 7. Send an empty value to create a small free cluster for testing. You can create only one free cluster.
Size of the cluster to create . Ranges from 1 to 7 . Send an empty value to create a small free cluster for testing . You can create only one free cluster .
customData
string
None