def get_dictionaries(name=None, limit=10, offset=0, sort=None): # noqa: E501 """Get informations about provided dictionaries. Shows a list of supported dictionaries. # noqa: E501 :param name: The indexed key to search with. :type name: str :param limit: How many items to return at one time (max 100) :type limit: int :param offset: The zero-ary offset index into the results :type offset: int :param sort: Sorting order :type sort: str :rtype: Dictionaries """ c = Elasticsearch(hosts='elastic') ret = c.cat.indices(format='json')[offset:offset + limit] ret = filter_indexes(ret) items = [] for i in ret: versions = tools.get_index_doctypes(c, i['index']) items.append(Dictionary(name=i['index'], description="TODO", versions=versions, last_version=versions[-1] if versions else None, meta=i)) return Dictionaries( items=items, offset=offset, offset_next=limit + offset, )
def run_model(id, pipeline_stage, execution_platform, run_name=None, parameters=None): # noqa: E501 """run_model # noqa: E501 :param id: :type id: str :param pipeline_stage: pipeline stage, either 'train' or 'serve' :type pipeline_stage: str :param execution_platform: execution platform, i.e. 'kubernetes', 'knative' :type execution_platform: str :param run_name: name to identify the run on the Kubeflow Pipelines UI, defaults to model identifier :type run_name: str :param parameters: optional run parameters, must include 'github_token' and 'github_url' if credentials are required :type parameters: dict :rtype: ApiRunCodeResponse """ if connexion.request.is_json: parameters = Dictionary.from_dict( connexion.request.get_json()) # noqa: E501 return util.invoke_controller_impl()
def test_modify_application_settings(self): """Test case for modify_application_settings """ dictionary = Dictionary() response = self.client.open('/apis/v1alpha1/settings', method='PUT', data=json.dumps(dictionary), content_type='application/json') self.assert200(response, 'Response body is : ' + response.data.decode('utf-8'))
def modify_application_settings(dictionary): # noqa: E501 """modify_application_settings Modify one or more of the application settings. # noqa: E501 :param dictionary: A dictionary where the name of the keys corresponds to the name of the settings. :type dictionary: dict | bytes :rtype: ApiSettings """ if connexion.request.is_json: dictionary = Dictionary.from_dict(connexion.request.get_json()) # noqa: E501 return util.invoke_controller_impl()
def run_pipeline(id, run_name=None, parameters=None): # noqa: E501 """run_pipeline # noqa: E501 :param id: :type id: str :param run_name: name to identify the run on the Kubeflow Pipelines UI, defaults to pipeline name :type run_name: str :param parameters: optional run parameters, may be required based on pipeline definition :type parameters: dict | bytes :rtype: ApiRunCodeResponse """ if connexion.request.is_json: parameters = Dictionary.from_dict(connexion.request.get_json()) # noqa: E501 return util.invoke_controller_impl()
def get_dictionary(dictionary_name): # noqa: E501 """Get informations about a dictionary. Retrieve available dictionary version and URI. # noqa: E501 :param dictionary_name: The name of the dictionary :type dictionary_name: str :rtype: Dictionary """ c = Elasticsearch(hosts='elastic') ret = c.cat.indices(index=dictionary_name, format='json')[0] versions = tools.get_index_doctypes(c, dictionary_name) return Dictionary(name=dictionary_name, description="TODO", versions=versions, last_version=versions[-1] if versions else None, meta=ret)