Example #1
0
 public function clusterInfoList(array $params = [])
 {
     $resource = '/v1/';
     $query_params = ListParams::listParams($params);
     if (array_key_exists('status', $params)) {
         if ($params['status']) {
             $this->validClusterInfoListStatus($params['status']);
             $query_params = array_merge($query_params, ['status' => $params['status']]);
         }
     }
     if (array_key_exists('type', $params)) {
         $type = $params['type'];
         if ($type) {
             $query_params = array_merge($query_params, ['type' => $type]);
         }
     }
     if (array_key_exists('cluster_name', $params)) {
         $cluster_name = $params['cluster_name'];
         if ($cluster_name) {
             $query_params = array_merge($query_params, ['clusterName' => $cluster_name]);
         }
     }
     if (array_key_exists('order', $params)) {
         $order = $params['order'];
         if ($order) {
             if (!in_array($order, ['asc', 'desc'])) {
                 throw new ParameterInvalid("order is invalid: {$order}");
             }
             $query_params = array_merge($query_params, ['order' => $order]);
         }
     }
     return $this->execute(@ANALYSIS, new RestParameter('get', $resource, ['cano_resource' => 'clusterManagement', 'query_params' => $query_params]));
 }
Example #2
0
 public function queryInfoList(array $params = [])
 {
     $resource = '/v1/';
     $query_params = ListParams::listParams($params);
     if (array_key_exists('status', $params)) {
         if ($params['status']) {
             $this->validQueryInfoListStatus($params['status']);
             $query_params = array_merge($query_params, ['status' => $params['status']]);
         }
     }
     if (array_key_exists('type', $params)) {
         $type = $params['type'];
         if ($type) {
             if (!in_array($type, ['select', 'split'])) {
                 throw new ParameterInvalid("type is invalid: {$type}");
             }
             $query_params = array_merge($query_params, ['type' => $type]);
         }
     }
     if (array_key_exists('cluster_name', $params)) {
         $cluster_name = $params['cluster_name'];
         if ($cluster_name) {
             $query_params = array_merge($query_params, ['clusterName' => $cluster_name]);
         }
     }
     if (array_key_exists('label_prefix', $params)) {
         $label_prefix = $params['label_prefix'];
         if ($label_prefix) {
             $query_params = array_merge($query_params, ['labelPrefix' => $label_prefix]);
         }
     }
     if (array_key_exists('cluster_rebooted', $params)) {
         $cluster_rebooted = $params['cluster_rebooted'];
         if (!is_null($cluster_rebooted)) {
             if (!is_bool($cluster_rebooted)) {
                 throw new ParameterInvalid("cluster_rebooted is invalid: {$cluster_rebooted}");
             }
             $query_params = array_merge($query_params, ['clusterRebooted' => $cluster_rebooted ? 'true' : 'false']);
         }
     }
     if (array_key_exists('order', $params)) {
         $order = $params['order'];
         if ($order) {
             if (!in_array($order, ['asc', 'desc'])) {
                 throw new ParameterInvalid("order is invalid: {$order}");
             }
             $query_params = array_merge($query_params, ['order' => $order]);
         }
     }
     return $this->execute(@ANALYSIS, new RestParameter('get', $resource, ['cano_resource' => 'query', 'query_params' => $query_params]));
 }
Example #3
0
 public function databaseList($cluster_name, array $params = [])
 {
     $resource = '/v1/' . $cluster_name;
     return $this->execute(@ANALYSIS, new RestParameter('get', $resource, ['cano_resource' => 'database', 'query_params' => ListParams::listParams($params)]));
 }
Example #4
0
 public function tableInfoList($cluster_name, $database_name, array $params = [])
 {
     $resource = "/v1/{$cluster_name}/{$database_name}";
     return $this->execute(@ANALYSIS, new RestParameter('get', $resource, ['cano_resource' => 'table', 'query_params' => ListParams::listParams($params)]));
 }