How to use the flyteidl.admin.common_pb2 function in flyteidl

To help you get started, we’ve selected a few flyteidl examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github lyft / flytekit / flytekit / models / common.py View on Github external
def to_flyte_idl(self):
        """
        :rtype: flyteidl.admin.common_pb2.Notification
        """
        return _common_pb2.Notification(
            phases=self.phases,
            email=self.email.to_flyte_idl() if self.email else None,
            pager_duty=self.pager_duty.to_flyte_idl() if self.pager_duty else None,
            slack=self.slack.to_flyte_idl() if self.slack else None
        )
github lyft / flytekit / flytekit / models / common.py View on Github external
def to_flyte_idl(self):
        """
        :rtype: flyteidl.admin.common_pb2.PagerDutyNotification
        """
        return _common_pb2.PagerDutyNotification(recipients_email=self.recipients_email)
github lyft / flytekit / flytekit / models / common.py View on Github external
def to_flyte_idl(self):
        """
        :rtype: dict[Text, Text]
        """
        return _common_pb2.Labels(
            values={k: v for k, v in _six.iteritems(self.values)}
        )
github lyft / flytekit / flytekit / models / common.py View on Github external
def to_flyte_idl(self):
        """
        :rtype: flyteidl.admin.common_pb2.UrlBlob
        """
        return _common_pb2.UrlBlob(url=self.url, bytes=self.bytes)
github lyft / flytekit / flytekit / models / common.py View on Github external
def to_flyte_idl(self):
        """
        :rtype: flyteidl.admin.common_pb2.SlackNotification
        """
        return _common_pb2.SlackNotification(recipients_email=self.recipients_email)
github lyft / flytekit / flytekit / models / common.py View on Github external
def to_flyte_idl(self):
        """
        Stores object to a Flyte-IDL defined protobuf.
        :rtype: flyteidl.admin.common_pb2.NamedEntityIdentifier
        """

        # We use the kwarg constructor of the protobuf and setting name=None is equivalent to not setting it at all
        return _common_pb2.NamedEntityIdentifier(
            project=self.project,
            domain=self.domain,
            name=self.name
        )
github lyft / flytekit / flytekit / models / common.py View on Github external
def to_flyte_idl(self):
        """
        :rtype: flyteidl.admin.common_pb2.EmailNotification
        """
        return _common_pb2.EmailNotification(recipients_email=self.recipients_email)
github lyft / flytekit / flytekit / clients / friendly.py View on Github external
def get_workflow(self, id):
        """
        This returns a single task for a given ID.

        :param flytekit.models.core.identifier.Identifier id: The ID representing a given task.
        :raises: TODO
        :rtype: flytekit.models.admin.workflow.Workflow
        """
        return _workflow.Workflow.from_flyte_idl(
            super(SynchronousFlyteClient, self).get_workflow(
                _common_pb2.ObjectGetRequest(
                    id=id.to_flyte_idl()
                )
github lyft / flytekit / flytekit / models / common.py View on Github external
def to_flyte_idl(self):
        """
        :rtype: _common_pb2.Annotations
        """
        return _common_pb2.Annotations(
            values={k: v for k, v in _six.iteritems(self.values)}
        )
github lyft / flytekit / flytekit / clients / friendly.py View on Github external
entries on the second page that also appeared on the first.

        :param Text project: The namespace of the project to list.
        :param Text domain: The domain space of the project to list.
        :param int limit: [Optional] The maximum number of entries to return.  Must be greater than 0.  The maximum
            page size is determined by the Flyte Admin Service configuration.  If limit is greater than the maximum
            page size, an exception will be raised.
        :param Text token: [Optional] If specified, this specifies where in the rows of results to skip before reading.
            If you previously retrieved a page response with token="foo" and you want the next page,
            specify token="foo". Please see the notes for this function about the caveats of the paginated API.
        :param flytekit.models.admin.common.Sort sort_by: [Optional] If provided, the results will be sorted.
        :raises: TODO
        :rtype: list[flytekit.models.common.NamedEntityIdentifier], Text
        """
        identifier_list = super(SynchronousFlyteClient, self).list_task_ids_paginated(
            _common_pb2.NamedEntityIdentifierListRequest(
                project=project,
                domain=domain,
                limit=limit,
                token=token,
                sort_by=None if sort_by is None else sort_by.to_flyte_idl()
            )
        )
        return [
                   _common.NamedEntityIdentifier.from_flyte_idl(identifier_pb)
                   for identifier_pb in identifier_list.entities
               ], _six.text_type(identifier_list.token)