Exemple #1
0
    def create_workflow_stream_deployment(
            self,
            id: str,
            build_id: str,
            workflow_stream_deployment: WorkflowStreamDeployment,
            query_params: Dict[str,
                               object] = None) -> WorkflowStreamDeployment:
        """
        Creates a workflow streaming deployment.
        """
        if query_params is None:
            query_params = {}

        path_params = {
            "id": id,
            "buildId": build_id,
        }

        path = Template(
            "/ml/v2beta1/workflows/${id}/builds/${buildId}/stream-deployments"
        ).substitute(path_params)
        url = self.base_client.build_url(path)
        data = workflow_stream_deployment.to_dict()
        response = self.base_client.post(url, json=data, params=query_params)
        return handle_response(response, WorkflowStreamDeployment)
Exemple #2
0
    def get_workflow_stream_deployment(
            self,
            id: str,
            build_id: str,
            stream_deployment_id: str,
            query_params: Dict[str,
                               object] = None) -> WorkflowStreamDeployment:
        """
        Returns the status of a workflow streaming deployment.
        """
        if query_params is None:
            query_params = {}

        path_params = {
            "id": id,
            "buildId": build_id,
            "streamDeploymentId": stream_deployment_id,
        }

        path = Template(
            "/ml/v2beta1/workflows/${id}/builds/${buildId}/stream-deployments/${streamDeploymentId}"
        ).substitute(path_params)
        url = self.base_client.build_url(path)
        response = self.base_client.get(url, params=query_params)
        return handle_response(response, WorkflowStreamDeployment)
Exemple #3
0
    def create_workflow_inference(
            self,
            id: str,
            build_id: str,
            deployment_id: str,
            workflow_inference: WorkflowInference,
            query_params: Dict[str, object] = None) -> WorkflowInference:
        """
        Creates a workflow inference request.
        """
        if query_params is None:
            query_params = {}

        path_params = {
            "id": id,
            "buildId": build_id,
            "deploymentId": deployment_id,
        }

        path = Template(
            "/ml/v2beta1/workflows/${id}/builds/${buildId}/deployments/${deploymentId}/inference"
        ).substitute(path_params)
        url = self.base_client.build_url(path)
        data = workflow_inference.to_dict()
        response = self.base_client.post(url, json=data, params=query_params)
        return handle_response(response, WorkflowInference)
Exemple #4
0
    def list_results(self,
                     sid: str,
                     count: float = None,
                     field: str = None,
                     offset: float = None) -> ListSearchResultsResponse:
        """
        Return the search results for the job with the specified search ID (SID).
        """
        query_params = {}
        if count is not None:
            query_params['count'] = count
        if field is not None:
            query_params['field'] = field
        if offset is not None:
            query_params['offset'] = offset

        path_params = {
            "sid": sid,
        }

        path = Template("/search/v2beta1/jobs/${sid}/results").substitute(
            path_params)
        url = self.base_client.build_url(path)
        response = self.base_client.get(url, **query_params)
        return handle_response(response, ListSearchResultsResponse)
Exemple #5
0
    def list_templates(
        self,
        offset: int = None,
        page_size: int = None,
        sort_dir: str = None,
        sort_field: str = None,
        query_params: Dict[str, object] = None
    ) -> PaginatedResponseOfTemplateResponse:
        """
        Returns a list of all templates.
        """
        if query_params is None:
            query_params = {}
        if offset is not None:
            query_params['offset'] = offset
        if page_size is not None:
            query_params['pageSize'] = page_size
        if sort_dir is not None:
            query_params['sortDir'] = sort_dir
        if sort_field is not None:
            query_params['sortField'] = sort_field

        path_params = {}

        path = Template("/streams/v2beta1/templates").substitute(path_params)
        url = self.base_client.build_url(path)
        response = self.base_client.get(url, params=query_params)
        return handle_response(response, PaginatedResponseOfTemplateResponse)
Exemple #6
0
    def list_events_summary(self,
                            sid: str,
                            count: float = None,
                            earliest: str = None,
                            field: str = None,
                            latest: str = None,
                            offset: float = None) -> ListSearchResultsResponse:
        """
        Return events summary, for search ID (SID) search.
        """
        query_params = {}
        if count is not None:
            query_params['count'] = count
        if earliest is not None:
            query_params['earliest'] = earliest
        if field is not None:
            query_params['field'] = field
        if latest is not None:
            query_params['latest'] = latest
        if offset is not None:
            query_params['offset'] = offset

        path_params = {
            "sid": sid,
        }

        path = Template(
            "/search/v2beta1/jobs/${sid}/timeline-metadata/auto/events-summary"
        ).substitute(path_params)
        url = self.base_client.build_url(path)
        response = self.base_client.get(url, **query_params)
        return handle_response(response, ListSearchResultsResponse)
Exemple #7
0
    def list_connections(self, connector_id: str = None, create_user_id: str = None, function_id: str = None, name: str = None, offset: int = None, page_size: int = None, show_secret_names: str = None, sort_dir: str = None, sort_field: str = None, query_params: Dict[str, object] = None) -> PaginatedResponseOfConnectionResponse:
        """
        Returns a list of connections (latest versions only) by tenant ID.
        """
        if query_params is None:
            query_params = {}
        if connector_id is not None:
            query_params['connectorId'] = connector_id
        if create_user_id is not None:
            query_params['createUserId'] = create_user_id
        if function_id is not None:
            query_params['functionId'] = function_id
        if name is not None:
            query_params['name'] = name
        if offset is not None:
            query_params['offset'] = offset
        if page_size is not None:
            query_params['pageSize'] = page_size
        if show_secret_names is not None:
            query_params['showSecretNames'] = show_secret_names
        if sort_dir is not None:
            query_params['sortDir'] = sort_dir
        if sort_field is not None:
            query_params['sortField'] = sort_field

        path_params = {
        }

        path = Template("/streams/v2beta1/connections").substitute(path_params)
        url = self.base_client.build_url(path)
        response = self.base_client.get(url, params=query_params)
        return handle_response(response, PaginatedResponseOfConnectionResponse)
Exemple #8
0
    def list_preview_results(
            self,
            sid: str,
            count: float = None,
            offset: float = None,
            query_params: Dict[str,
                               object] = None) -> ListPreviewResultsResponse:
        """
        Return the preview search results for the job with the specified search ID (SID). Can be used when a job is running to return interim results.
        """
        if query_params is None:
            query_params = {}
        if count is not None:
            query_params['count'] = count
        if offset is not None:
            query_params['offset'] = offset

        path_params = {
            "sid": sid,
        }

        path = Template("/search/v3alpha1/jobs/${sid}/results-preview"
                        ).substitute(path_params)
        url = self.base_client.build_url(path)
        response = self.base_client.get(url, params=query_params)
        return handle_response(response, ListPreviewResultsResponse)
Exemple #9
0
    def list_results(
            self,
            sid: str,
            count: float = None,
            field: str = None,
            offset: float = None,
            query_params: Dict[str,
                               object] = None) -> ListSearchResultsResponse:
        """
        Returns search results for a job with a specified search ID (sid).
        """
        if query_params is None:
            query_params = {}
        if count is not None:
            query_params['count'] = count
        if field is not None:
            query_params['field'] = field
        if offset is not None:
            query_params['offset'] = offset

        path_params = {
            "sid": sid,
        }

        path = Template("/search/v3alpha1/jobs/${sid}/results").substitute(
            path_params)
        url = self.base_client.build_url(path)
        response = self.base_client.get(url, params=query_params)
        return handle_response(response, ListSearchResultsResponse)
Exemple #10
0
    def list_pipelines(self, activated: bool = None, create_user_id: str = None, include_data: bool = None, name: str = None, offset: int = None, page_size: int = None, sort_dir: str = None, sort_field: str = None, query_params: Dict[str, object] = None) -> PaginatedResponseOfPipelineResponse:
        """
        Returns all pipelines.
        """
        if query_params is None:
            query_params = {}
        if activated is not None:
            query_params['activated'] = activated
        if create_user_id is not None:
            query_params['createUserId'] = create_user_id
        if include_data is not None:
            query_params['includeData'] = include_data
        if name is not None:
            query_params['name'] = name
        if offset is not None:
            query_params['offset'] = offset
        if page_size is not None:
            query_params['pageSize'] = page_size
        if sort_dir is not None:
            query_params['sortDir'] = sort_dir
        if sort_field is not None:
            query_params['sortField'] = sort_field

        path_params = {
        }

        path = Template("/streams/v2beta1/pipelines").substitute(path_params)
        url = self.base_client.build_url(path)
        response = self.base_client.get(url, params=query_params)
        return handle_response(response, PaginatedResponseOfPipelineResponse)
Exemple #11
0
    def list_events_summary(self, sid: str, count: float = None, earliest: str = None, field: str = None, latest: str = None, offset: float = None, query_params: Dict[str, object] = None) -> ListSearchResultsResponse:
        """
        Return the events summary for the job with  specified search ID (sid).

        """
        if query_params is None:
            query_params = {}
        if count is not None:
            query_params['count'] = count
        if earliest is not None:
            query_params['earliest'] = earliest
        if field is not None:
            query_params['field'] = field
        if latest is not None:
            query_params['latest'] = latest
        if offset is not None:
            query_params['offset'] = offset

        path_params = {
            "sid": sid,
        }

        path = Template("/search/v3alpha1/jobs/${sid}/timeline-metadata/auto/events-summary").substitute(path_params)
        url = self.base_client.build_url(path)
        response = self.base_client.get(url, params=query_params)
        return handle_response(response, ListSearchResultsResponse)
Exemple #12
0
    def get_pipelines_status(
            self,
            activated: bool = None,
            create_user_id: str = None,
            name: str = None,
            offset: int = None,
            page_size: int = None,
            sort_dir: str = None,
            sort_field: str = None) -> PaginatedResponseOfPipelineJobStatus:
        """
        Returns the status of pipelines from the underlying streaming system.
        """
        query_params = {}
        if activated is not None:
            query_params['activated'] = activated
        if create_user_id is not None:
            query_params['createUserId'] = create_user_id
        if name is not None:
            query_params['name'] = name
        if offset is not None:
            query_params['offset'] = offset
        if page_size is not None:
            query_params['pageSize'] = page_size
        if sort_dir is not None:
            query_params['sortDir'] = sort_dir
        if sort_field is not None:
            query_params['sortField'] = sort_field

        path_params = {}

        path = Template("/streams/v2beta1/pipelines/status").substitute(
            path_params)
        url = self.base_client.build_url(path)
        response = self.base_client.get(url, **query_params)
        return handle_response(response, PaginatedResponseOfPipelineJobStatus)
    def query_records(self,
                      collection: str,
                      count: int = None,
                      fields: List[str] = None,
                      offset: int = None,
                      orderby: List[str] = None,
                      query: str = None) -> List[object]:
        """
        Returns a list of query records in a collection.
        """
        query_params = {}
        if count is not None:
            query_params['count'] = count
        if fields is not None:
            query_params['fields'] = fields
        if offset is not None:
            query_params['offset'] = offset
        if orderby is not None:
            query_params['orderby'] = orderby
        if query is not None:
            query_params['query'] = query

        path_params = {
            "collection": collection,
        }

        path = Template("/kvstore/v1beta1/collections/${collection}/query"
                        ).substitute(path_params)
        url = self.base_client.build_url(path)
        response = self.base_client.get(url, **query_params)
        return handle_response(response, object)
    def list_records(self,
                     collection: str,
                     count: int = None,
                     fields: List[str] = None,
                     filters: object = None,
                     offset: int = None,
                     orderby: List[str] = None) -> List[object]:
        """
        Returns a list of records in a collection with basic filtering, sorting, pagination and field projection.
        """
        query_params = {}
        if count is not None:
            query_params['count'] = count
        if fields is not None:
            query_params['fields'] = fields
        if filters is not None:
            query_params['filters'] = filters
        if offset is not None:
            query_params['offset'] = offset
        if orderby is not None:
            query_params['orderby'] = orderby

        path_params = {
            "collection": collection,
        }

        path = Template("/kvstore/v1beta1/collections/${collection}"
                        ).substitute(path_params)
        url = self.base_client.build_url(path)
        response = self.base_client.get(url, **query_params)
        return handle_response(response, object)
Exemple #15
0
    def list_fields_summary(
            self,
            sid: str,
            earliest: str = None,
            latest: str = None,
            query_params: Dict[str, object] = None) -> FieldsSummary:
        """
        Return fields stats summary of the events to-date, for search ID (SID) search.
        """
        if query_params is None:
            query_params = {}
        if earliest is not None:
            query_params['earliest'] = earliest
        if latest is not None:
            query_params['latest'] = latest

        path_params = {
            "sid": sid,
        }

        path = Template(
            "/search/v3alpha1/jobs/${sid}/timeline-metadata/auto/fields-summary"
        ).substitute(path_params)
        url = self.base_client.build_url(path)
        response = self.base_client.get(url, params=query_params)
        return handle_response(response, FieldsSummary)
    def list_apps(self) -> List[AppResponseGetList]:
        """
        Returns a list of apps.
        """
        query_params = {}

        path_params = {}

        path = Template("/app-registry/v1beta2/apps").substitute(path_params)
        url = self.base_client.build_url(path)
        response = self.base_client.get(url, **query_params)
        return handle_response(response, AppResponseGetList)
Exemple #17
0
    def list_roles(self) -> List[str]:
        """
        Returns all roles for a given tenant.
        """
        query_params = {}

        path_params = {}

        path = Template("/identity/v2beta1/roles").substitute(path_params)
        url = self.base_client.build_url(path)
        response = self.base_client.get(url, **query_params)
        return handle_response(response, str)
    def ping(self) -> PingResponse:
        """
        Returns the health status from the database.
        """
        query_params = {}

        path_params = {}

        path = Template("/kvstore/v1beta1/ping").substitute(path_params)
        url = self.base_client.build_url(path)
        response = self.base_client.get(url, **query_params)
        return handle_response(response, PingResponse)
Exemple #19
0
    def list_groups(self) -> List[str]:
        """
        List the groups that exist in a given tenant.
        """
        query_params = {}

        path_params = {}

        path = Template("/identity/v2beta1/groups").substitute(path_params)
        url = self.base_client.build_url(path)
        response = self.base_client.get(url, **query_params)
        return handle_response(response, str)
Exemple #20
0
    def list_workflows(self) -> List[WorkflowsGetResponse]:
        """
        Returns a list of workflow configurations.
        """
        query_params = {}

        path_params = {}

        path = Template("/ml/v2beta1/workflows").substitute(path_params)
        url = self.base_client.build_url(path)
        response = self.base_client.get(url, **query_params)
        return handle_response(response, WorkflowsGetResponse)
    def list_actions(self) -> List[Action]:
        """
        Returns the list of action templates.
        """
        query_params = {}

        path_params = {}

        path = Template("/action/v1beta2/actions").substitute(path_params)
        url = self.base_client.build_url(path)
        response = self.base_client.get(url, **query_params)
        return handle_response(response, Action)
Exemple #22
0
    def list_connectors(self) -> PaginatedResponseOfConnectorResponse:
        """
        Returns a list of the available connectors.
        """
        query_params = {}

        path_params = {}

        path = Template("/streams/v2beta1/connectors").substitute(path_params)
        url = self.base_client.build_url(path)
        response = self.base_client.get(url, **query_params)
        return handle_response(response, PaginatedResponseOfConnectorResponse)
    def list_roles(self, query_params: Dict[str, object] = None) -> List[str]:
        """
        Returns all roles for a given tenant.
        """
        if query_params is None:
            query_params = {}

        path_params = {}

        path = Template("/identity/v2beta1/roles").substitute(path_params)
        url = self.base_client.build_url(path)
        response = self.base_client.get(url, params=query_params)
        return handle_response(response, str)
    def create_action(self, action: Action) -> Action:
        """
        Creates an action template.
        """
        query_params = {}

        path_params = {}

        path = Template("/action/v1beta2/actions").substitute(path_params)
        url = self.base_client.build_url(path)
        data = action.to_dict()
        response = self.base_client.post(url, json=data, **query_params)
        return handle_response(response, Action)
    def get_public_webhook_keys(self) -> List[PublicWebhookKey]:
        """
        Returns an array of one or two webhook keys. The first key is active. The second key, if present, is expired.
        """
        query_params = {}

        path_params = {}

        path = Template("/system/action/v1beta2/webhook/keys").substitute(
            path_params)
        url = self.base_client.build_url(path)
        response = self.base_client.get(url, **query_params)
        return handle_response(response, PublicWebhookKey)
    def list_invites(self) -> List[InviteInfo]:
        """
        Lists the invites in a given tenant
        """
        query_params = {}

        path_params = {
        }

        path = Template("/provisioner/v1beta1/invites").substitute(path_params)
        url = self.base_client.build_url(path)
        response = self.base_client.get(url, **query_params)
        return handle_response(response, InviteInfo)
    def list_provision_jobs(self) -> List[ProvisionJobInfo]:
        """
        Lists all provision jobs created by the user
        """
        query_params = {}

        path_params = {
        }

        path = Template("/system/provisioner/v1beta1/jobs/tenants/provision").substitute(path_params)
        url = self.base_client.build_url(path)
        response = self.base_client.get(url, **query_params)
        return handle_response(response, ProvisionJobInfo)
Exemple #28
0
    def create_group(self, group_request: GroupRequest) -> GroupResponse:
        """
        Create a new group function by combining the Streams JSON of two or more functions.
        """
        query_params = {}

        path_params = {}

        path = Template("/streams/v2beta1/groups").substitute(path_params)
        url = self.base_client.build_url(path)
        data = group_request.to_dict()
        response = self.base_client.post(url, json=data, **query_params)
        return handle_response(response, GroupResponse)
    def list_tenants(self) -> List[TenantInfo]:
        """
        Lists all tenants that the user can read
        """
        query_params = {}

        path_params = {
        }

        path = Template("/system/provisioner/v1beta1/tenants").substitute(path_params)
        url = self.base_client.build_url(path)
        response = self.base_client.get(url, **query_params)
        return handle_response(response, TenantInfo)
Exemple #30
0
    def create_job(self, search_job: SearchJob = None) -> SearchJob:
        """
        Creates a search job.
        """
        query_params = {}

        path_params = {}

        path = Template("/search/v2beta1/jobs").substitute(path_params)
        url = self.base_client.build_url(path)
        data = search_job.to_dict()
        response = self.base_client.post(url, json=data, **query_params)
        return handle_response(response, SearchJob)